1.3 Wayland book Introduction:What's in the Wayland package
What’s in the Wayland package
When you install “wayland” in your Linux distribution, you’ll most likely end up with the freedesktop.org distribution of libwayland-client, libwayland-server, wayland-scanner, and wayland.xml. Respectively, these will probably be in /usr/lib & /usr/include, /usr/bin, and /usr/share/wayland/. This package represents the most popular implementation of the Wayland protocol, but it is not the only one. Chapter 3 covers this implementation of Wayland in detail; the rest of the book is equally applicable to any implementation.
当你在 Linux 发行版中安装 “wayland” 时,很可能最终会得到 freedesktop.org 发行版内容, 包括 libwayland-client、libwayland-server、wayland-scanner 和 wayland.xml。它们分别 位于 /usr/lib 和 /usr/include、/usr/bin 和 /usr/share/wayland/ 中。这个包代表了 Wayland 协议最常见的实现,但它不是唯一的。第 3 章详细介绍了 Wayland 的这种实现;本书的其余部 分同样可用其他方式实现。
wayland.xml
Wayland protocols are defined by XML files. If you locate and open “wayland.xml” in your favorite text editor, you will find the XML specification for the “core” Wayland protocol. This is a high-level protocol — built on top of the wire protocol that we’ll discuss in the next chapter. Most of this book is devoted to explaining this file.
Wayland 协议使用 XML 文件定义。如果在文本编辑器中打开 “wayland.xml”,将观察到 “核心” Wayland 协议的 XML 版规范。这是一个高级协议 — 建立在我们将在下一章讨论的有线协 议之上。本书的大部分内容都致力于解释这个协议文件。
wayland-scanner
The “wayland-scanner” tool is used to process these XML files and generate code from them. The most common implementation is the one you’re examining now, and it can be used to generate C headers & glue code from XML files like wayland.xml. Other scanners exist for other programming languages, notably wayland-rs (Rust), waymonad-scanner (Haskell), and more.
“wayland-scanner” 工具用于解析这些 XML 文件,生成对应的代码。 最常见的实现是 “wayland-scanner”, 它可用于从诸如 wayland.xml 之类的 XML 文件生成 C 头文件和粘合代码。基于其他编程语言的实 现,也有不同的 scanner,比如 wayland-rs (Rust)、waymonad-scanner (Haskell) 等。
libwayland
The two libraries, libwayland-client and libwayland-server, include an
implementation of the wire protocol for each end of the connection. Some common
utilities are offered for working with Wayland data structures, a simple event
loop, and so on. Additionally, these libraries contain a pre-compiled copy of
the core Wayland protocol as generated by wayland-scanner
.
libwayland-client 和 libwayland-server 这两个库包括连接每一端的有线协议的实现。提供 了一些常用的实用方法来处理 Wayland 的数据结构、简单的事件循环等。此外,这些库包含由 “wayland-scanner” 生成的核心 Wayland 协议的预编译副本。
原文链接:https://wayland-book.com/