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