aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorMark Bolhuis <mark@bolhuis.dev>2022-02-10 21:01:58 +0000
committerXavier Claessens <xclaesse@gmail.com>2022-02-27 14:33:33 -0500
commit5a4177523e382cc13057d65905266ad261c4bba2 (patch)
treeee96a8f1031173122b3710d710151fc1f69ab0d8 /docs
parentfcca265035a92eac2773f85a79a8ad142a9bb795 (diff)
downloadmeson-5a4177523e382cc13057d65905266ad261c4bba2.zip
meson-5a4177523e382cc13057d65905266ad261c4bba2.tar.gz
meson-5a4177523e382cc13057d65905266ad261c4bba2.tar.bz2
modules/wayland: Add unstable_wayland module
Diffstat (limited to 'docs')
-rw-r--r--docs/markdown/Wayland-module.md64
-rw-r--r--docs/markdown/_Sidebar.md1
-rw-r--r--docs/markdown/snippets/wayland-module.md4
-rw-r--r--docs/sitemap.txt1
-rw-r--r--docs/theme/extra/templates/navbar_links.html1
5 files changed, 71 insertions, 0 deletions
diff --git a/docs/markdown/Wayland-module.md b/docs/markdown/Wayland-module.md
new file mode 100644
index 0000000..d30627c
--- /dev/null
+++ b/docs/markdown/Wayland-module.md
@@ -0,0 +1,64 @@
+# Unstable Wayland Module
+
+This module is available since version 0.62.0.
+
+This module provides helper functions to find wayland protocol
+xmls and to generate .c and .h files using wayland-scanner
+
+**Note**: this module is unstable. It is only provided as a technology
+preview. Its API may change in arbitrary ways between releases or it
+might be removed from Meson altogether.
+
+## Quick Usage
+
+```meson
+project('hello-wayland', 'c')
+
+wl_dep = dependency('wayland-client')
+wl_mod = import('unstable-wayland')
+
+xml = wl_mod.find_protocol('xdg-shell')
+xdg_shell = wl_mod.scan_xml(xml)
+
+executable('hw', 'main.c', xdg_shell, dependencies : wl_dep)
+```
+
+## Methods
+
+### find_protocol
+
+```meson
+xml = wl_mod.find_protocol(
+ 'xdg-decoration',
+ state : 'unstable',
+ version : 1,
+)
+```
+This function requires one positional argument: the protocol base name.
+- `state` Optional arg that specifies the current state of the protocol.
+Either stable, staging, or unstable.
+The default is stable.
+- `version` The backwards incompatible version number.
+Required for staging or unstable. An error is raised for stable.
+
+### scan_xml
+```meson
+generated = wl_mod.scan_xml(
+ 'my-protocol.xml',
+ side : 'client',
+ scope : 'private',
+)
+```
+This function accepts one or more arguments of either string or file type.
+
+- `side` Optional arg that specifies if client or server side code is generated.
+The default is client side.
+- `scope` Optional arg that specifies the scope of the generated code.
+Either public or private.
+The default is private.
+
+
+## Links
+- [Official Wayland Documentation](https://wayland.freedesktop.org/docs/html/)
+- [Wayland GitLab](https://gitlab.freedesktop.org/wayland)
+- [Wayland Book](https://wayland-book.com/)
diff --git a/docs/markdown/_Sidebar.md b/docs/markdown/_Sidebar.md
index 0ca1762..ce73d5a 100644
--- a/docs/markdown/_Sidebar.md
+++ b/docs/markdown/_Sidebar.md
@@ -13,3 +13,4 @@
* [i18n](i18n-module.md)
* [pkgconfig](Pkgconfig-module.md)
* [rust](Rust-module.md)
+* [wayland](Wayland-module.md)
diff --git a/docs/markdown/snippets/wayland-module.md b/docs/markdown/snippets/wayland-module.md
new file mode 100644
index 0000000..cd5e5dc
--- /dev/null
+++ b/docs/markdown/snippets/wayland-module.md
@@ -0,0 +1,4 @@
+## New unstable wayland module
+
+This module can search for protocol xml files from the wayland-protocols
+package, and generate .c and .h files using wayland-scanner.
diff --git a/docs/sitemap.txt b/docs/sitemap.txt
index 82e0a7b..11b64e0 100644
--- a/docs/sitemap.txt
+++ b/docs/sitemap.txt
@@ -58,6 +58,7 @@ index.md
SourceSet-module.md
Windows-module.md
i18n-module.md
+ Wayland-module.md
Java.md
Vala.md
D.md
diff --git a/docs/theme/extra/templates/navbar_links.html b/docs/theme/extra/templates/navbar_links.html
index c518de5..65a21a2 100644
--- a/docs/theme/extra/templates/navbar_links.html
+++ b/docs/theme/extra/templates/navbar_links.html
@@ -26,6 +26,7 @@
("Rust-module.html","Rust"), \
("Simd-module.html","Simd"), \
("SourceSet-module.html","SourceSet"), \
+ ("Wayland-module.html","Wayland"), \
("Windows-module.html","Windows")]:
<li>
<a href="@tup[0]">@tup[1]</a>