simple_window/common/protocols_data/wayland/
wl_fixes.rs1use {super::super::all_types::*, ::wl_client::builder::prelude::*};
7
8static INTERFACE: wl_interface = wl_interface {
9 name: c"wl_fixes".as_ptr(),
10 version: 1,
11 method_count: 2,
12 methods: {
13 static MESSAGES: [wl_message; 2] = [
14 wl_message {
15 name: c"destroy".as_ptr(),
16 signature: c"".as_ptr(),
17 types: {
18 static TYPES: [Option<&'static wl_interface>; 0] = [];
19 TYPES.as_ptr().cast()
20 },
21 },
22 wl_message {
23 name: c"destroy_registry".as_ptr(),
24 signature: c"o".as_ptr(),
25 types: {
26 static TYPES: [Option<&'static wl_interface>; 1] =
27 [Some(WlRegistry::WL_INTERFACE)];
28 TYPES.as_ptr().cast()
29 },
30 },
31 ];
32 MESSAGES.as_ptr()
33 },
34 event_count: 0,
35 events: ptr::null(),
36};
37
38#[derive(Clone, Eq, PartialEq)]
42#[repr(transparent)]
43pub struct WlFixes {
44 proxy: UntypedOwnedProxy,
46}
47
48#[derive(Eq, PartialEq)]
52#[repr(transparent)]
53pub struct WlFixesRef {
54 proxy: UntypedBorrowedProxy,
56}
57
58unsafe impl UntypedOwnedProxyWrapper for WlFixes {}
60
61unsafe impl OwnedProxy for WlFixes {
64 const INTERFACE: &'static str = "wl_fixes";
65 const WL_INTERFACE: &'static wl_interface = &INTERFACE;
66 const NO_OP_EVENT_HANDLER: Self::NoOpEventHandler =
67 private::EventHandler(private::NoOpEventHandler);
68 const MAX_VERSION: u32 = 1;
69
70 type Borrowed = WlFixesRef;
71 type Api = private::ProxyApi;
72 type NoOpEventHandler = private::EventHandler<private::NoOpEventHandler>;
73}
74
75unsafe impl UntypedBorrowedProxyWrapper for WlFixesRef {}
77
78unsafe impl BorrowedProxy for WlFixesRef {
80 type Owned = WlFixes;
81}
82
83impl Deref for WlFixes {
84 type Target = WlFixesRef;
85
86 fn deref(&self) -> &Self::Target {
87 proxy::low_level::deref(self)
88 }
89}
90
91mod private {
92 pub struct ProxyApi;
93
94 #[allow(dead_code)]
95 pub struct EventHandler<H>(pub(super) H);
96
97 #[allow(dead_code)]
98 pub struct NoOpEventHandler;
99}
100
101impl Debug for WlFixes {
102 fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
103 write!(f, "wl_fixes#{}", self.proxy.id())
104 }
105}
106
107impl Debug for WlFixesRef {
108 fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
109 write!(f, "wl_fixes#{}", self.proxy.id())
110 }
111}
112
113impl PartialEq<WlFixesRef> for WlFixes {
114 fn eq(&self, other: &WlFixesRef) -> bool {
115 self.proxy == other.proxy
116 }
117}
118
119impl PartialEq<WlFixes> for WlFixesRef {
120 fn eq(&self, other: &WlFixes) -> bool {
121 self.proxy == other.proxy
122 }
123}
124
125#[allow(dead_code)]
126impl WlFixes {
127 #[allow(dead_code)]
129 pub const REQ__DESTROY__SINCE: u32 = 1;
130
131 #[inline]
133 pub fn destroy(&self) {
134 let mut args = [];
135 unsafe {
139 self.proxy.send_destructor(0, &mut args);
140 }
141 }
142}
143
144#[allow(dead_code)]
145impl WlFixesRef {
146 #[inline]
162 pub fn destroy_registry(&self, registry: &WlRegistryRef) {
163 let (arg0,) = (registry,);
164 let obj0_lock = proxy::lock(arg0);
165 let obj0 = check_argument_proxy("registry", obj0_lock.wl_proxy());
166 let mut args = [wl_argument { o: obj0 }];
167 unsafe {
171 self.proxy.send_request(1, &mut args);
172 }
173 }
174}
175
176#[allow(dead_code)]
178pub trait WlFixesEventHandler {
179 type Data: 'static;
180}
181
182impl WlFixesEventHandler for private::NoOpEventHandler {
183 type Data = ();
184}
185
186unsafe impl<H> EventHandler for private::EventHandler<H>
189where
190 H: WlFixesEventHandler,
191{
192 const WL_INTERFACE: &'static wl_interface = &INTERFACE;
193
194 #[inline]
195 fn mutable_type() -> Option<(TypeId, &'static str)> {
196 let id = TypeId::of::<H::Data>();
197 let name = std::any::type_name::<H::Data>();
198 Some((id, name))
199 }
200
201 #[allow(unused_variables)]
202 unsafe fn handle_event(
203 &self,
204 queue: &Queue,
205 data: *mut u8,
206 slf: &UntypedBorrowedProxy,
207 opcode: u32,
208 args: *mut wl_argument,
209 ) {
210 invalid_opcode("wl_fixes", opcode);
211 }
212}
213
214impl<H> CreateEventHandler<H> for private::ProxyApi
215where
216 H: WlFixesEventHandler,
217{
218 type EventHandler = private::EventHandler<H>;
219
220 #[inline]
221 fn create_event_handler(handler: H) -> Self::EventHandler {
222 private::EventHandler(handler)
223 }
224}
225
226pub mod event_handlers {
228 use super::*;
229
230 impl WlFixes {}
231}