cosmic_protocols/
lib.rs

1// SPDX-License-Identifier: GPL-3.0-only
2
3//! This crate provides bindings to the COSMIC wayland protocol extensions.
4//!
5//! These bindings are built on top of the crates wayland-client and wayland-server.
6//!
7//! Each protocol module contains a `client` and a `server` submodules, for each side of the
8//! protocol. The creation of these modules (and the dependency on the associated crate) is
9//! controlled by the two cargo features `client` and `server`.
10
11#![warn(missing_docs)]
12#![forbid(improper_ctypes, unsafe_op_in_unsafe_fn)]
13#![cfg_attr(docsrs, feature(doc_auto_cfg))]
14#![cfg_attr(rustfmt, rustfmt_skip)]
15
16
17#[macro_use]
18mod protocol_macro;
19
20pub mod a11y {
21    //! Accessibility support.
22
23    #[allow(missing_docs)]
24    pub mod v1 {
25        wayland_protocol!(
26            "./unstable/cosmic-a11y-unstable-v1.xml",
27            []
28        );
29    }
30}
31
32pub mod atspi {
33    //! Atspi accessibility support.
34
35    #[allow(missing_docs)]
36    pub mod v1 {
37        wayland_protocol!(
38            "./unstable/cosmic-atspi-unstable-v1.xml",
39            []
40        );
41    }
42}
43
44pub mod image_capture_source {
45    //! Capture source interface extending `ext-image-capture-source-v1`.
46
47    #[allow(missing_docs)]
48    pub mod v1 {
49        wayland_protocol!(
50            "./unstable/cosmic-image-capture-source-unstable-v1.xml",
51            [wayland_protocols::ext::image_capture_source::v1, wayland_protocols::ext::workspace::v1]
52        );
53    }
54}
55
56pub mod image_source {
57    //! Capture interface.
58
59    #[allow(missing_docs)]
60    pub mod v1 {
61        wayland_protocol!(
62            "./unstable/cosmic-image-source-unstable-v1.xml",
63            [crate::workspace::v1, crate::toplevel_info::v1, wayland_protocols::ext::workspace::v1]
64        );
65    }
66}
67
68pub mod screencopy {
69    //! Capture interface.
70
71    #[allow(missing_docs)]
72    pub mod v2 {
73        wayland_protocol!(
74            "./unstable/cosmic-screencopy-unstable-v2.xml",
75            [crate::image_source::v1]
76        );
77    }
78}
79
80pub mod output_management {
81    //! Output management interface.
82
83    #[allow(missing_docs)]
84    pub mod v1 {
85        wayland_protocol!(
86            "./unstable/cosmic-output-management-unstable-v1.xml",
87            [wayland_protocols_wlr::output_management::v1]
88        );
89    }
90}
91
92pub mod toplevel_info {
93    //! Receive information about toplevel surfaces.
94
95    #[allow(missing_docs)]
96    pub mod v1 {
97        wayland_protocol!(
98            "./unstable/cosmic-toplevel-info-unstable-v1.xml",
99            [crate::workspace::v1, wayland_protocols::ext::foreign_toplevel_list::v1, wayland_protocols::ext::workspace::v1]
100        );
101    }
102}
103
104pub mod toplevel_management {
105    //! Modify state toplevel surfaces.
106
107    #[allow(missing_docs)]
108    pub mod v1 {
109        wayland_protocol!(
110            "./unstable/cosmic-toplevel-management-unstable-v1.xml",
111            [crate::toplevel_info::v1, crate::workspace::v1, wayland_protocols::ext::workspace::v1]
112        );
113    }
114}
115
116pub mod overlap_notify {
117    //! Get overlap notifications for layer surfaces
118
119    #[allow(missing_docs)]
120    pub mod v1 {
121        wayland_protocol!(
122            "./unstable/cosmic-overlap-notify-unstable-v1.xml",
123            [wayland_protocols_wlr::layer_shell::v1, wayland_protocols::ext::foreign_toplevel_list::v1]
124        );
125    }
126}
127
128pub mod workspace {
129    //! Receive information about and control workspaces.
130
131    #[allow(missing_docs)]
132    pub mod v1 {
133        wayland_protocol!(
134            "./unstable/cosmic-workspace-unstable-v1.xml",
135            []
136        );
137    }
138
139
140    #[allow(missing_docs)]
141    pub mod v2 {
142        wayland_protocol!(
143            "./unstable/cosmic-workspace-unstable-v2.xml",
144            [wayland_protocols::ext::workspace::v1]
145        );
146    }
147}