1 | macro_rules! wayland_protocol( |
2 | ($path:expr, [$($imports:path),*]) => { |
3 | #[cfg(feature = "client" )] |
4 | pub use self::generated::client; |
5 | |
6 | #[cfg(feature = "server" )] |
7 | pub use self::generated::server; |
8 | |
9 | mod generated { |
10 | #![allow(dead_code,non_camel_case_types,unused_unsafe,unused_variables)] |
11 | #![allow(non_upper_case_globals,non_snake_case,unused_imports)] |
12 | #![allow(missing_docs, clippy::all)] |
13 | |
14 | #[cfg(feature = "client" )] |
15 | pub mod client { |
16 | //! Client-side API of this protocol |
17 | use wayland_client; |
18 | use wayland_client::protocol::*; |
19 | $(use $imports::{client::*};)* |
20 | |
21 | pub mod __interfaces { |
22 | use wayland_client::protocol::__interfaces::*; |
23 | $(use $imports::{client::__interfaces::*};)* |
24 | wayland_scanner::generate_interfaces!($path); |
25 | } |
26 | use self::__interfaces::*; |
27 | |
28 | wayland_scanner::generate_client_code!($path); |
29 | } |
30 | |
31 | #[cfg(feature = "server" )] |
32 | pub mod server { |
33 | //! Server-side API of this protocol |
34 | use wayland_server; |
35 | use wayland_server::protocol::*; |
36 | $(use $imports::{server::*};)* |
37 | |
38 | pub mod __interfaces { |
39 | use wayland_server::protocol::__interfaces::*; |
40 | $(use $imports::{server::__interfaces::*};)* |
41 | wayland_scanner::generate_interfaces!($path); |
42 | } |
43 | use self::__interfaces::*; |
44 | |
45 | wayland_scanner::generate_server_code!($path); |
46 | } |
47 | } |
48 | } |
49 | ); |
50 | |