simple_window/common/protocols/tablet_v2/
zwp_tablet_manager_v2.rs1use {super::super::all_types::*, ::wl_client::builder::prelude::*};
8
9static INTERFACE: wl_interface = wl_interface {
10 name: c"zwp_tablet_manager_v2".as_ptr(),
11 version: 1,
12 method_count: 2,
13 methods: {
14 static MESSAGES: [wl_message; 2] = [
15 wl_message {
16 name: c"get_tablet_seat".as_ptr(),
17 signature: c"no".as_ptr(),
18 types: {
19 static TYPES: [Option<&'static wl_interface>; 2] = [
20 Some(ZwpTabletSeatV2::WL_INTERFACE),
21 Some(WlSeat::WL_INTERFACE),
22 ];
23 TYPES.as_ptr().cast()
24 },
25 },
26 wl_message {
27 name: c"destroy".as_ptr(),
28 signature: c"".as_ptr(),
29 types: {
30 static TYPES: [Option<&'static wl_interface>; 0] = [];
31 TYPES.as_ptr().cast()
32 },
33 },
34 ];
35 MESSAGES.as_ptr()
36 },
37 event_count: 0,
38 events: ptr::null(),
39};
40
41#[derive(Clone, Eq, PartialEq)]
45#[repr(transparent)]
46pub struct ZwpTabletManagerV2 {
47 proxy: UntypedOwnedProxy,
49}
50
51#[derive(Eq, PartialEq)]
55#[repr(transparent)]
56pub struct ZwpTabletManagerV2Ref {
57 proxy: UntypedBorrowedProxy,
59}
60
61unsafe impl UntypedOwnedProxyWrapper for ZwpTabletManagerV2 {}
63
64unsafe impl OwnedProxy for ZwpTabletManagerV2 {
67 const INTERFACE: &'static str = "zwp_tablet_manager_v2";
68 const WL_INTERFACE: &'static wl_interface = &INTERFACE;
69 const NO_OP_EVENT_HANDLER: Self::NoOpEventHandler =
70 private::EventHandler(private::NoOpEventHandler);
71 const MAX_VERSION: u32 = 1;
72
73 type Borrowed = ZwpTabletManagerV2Ref;
74 type Api = private::ProxyApi;
75 type NoOpEventHandler = private::EventHandler<private::NoOpEventHandler>;
76}
77
78unsafe impl UntypedBorrowedProxyWrapper for ZwpTabletManagerV2Ref {}
80
81unsafe impl BorrowedProxy for ZwpTabletManagerV2Ref {
83 type Owned = ZwpTabletManagerV2;
84}
85
86impl Deref for ZwpTabletManagerV2 {
87 type Target = ZwpTabletManagerV2Ref;
88
89 fn deref(&self) -> &Self::Target {
90 proxy::low_level::deref(self)
91 }
92}
93
94mod private {
95 pub struct ProxyApi;
96
97 #[allow(dead_code)]
98 pub struct EventHandler<H>(pub(super) H);
99
100 #[allow(dead_code)]
101 pub struct NoOpEventHandler;
102}
103
104impl Debug for ZwpTabletManagerV2 {
105 fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
106 write!(f, "zwp_tablet_manager_v2#{}", self.proxy.id())
107 }
108}
109
110impl Debug for ZwpTabletManagerV2Ref {
111 fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
112 write!(f, "zwp_tablet_manager_v2#{}", self.proxy.id())
113 }
114}
115
116impl PartialEq<ZwpTabletManagerV2Ref> for ZwpTabletManagerV2 {
117 fn eq(&self, other: &ZwpTabletManagerV2Ref) -> bool {
118 self.proxy == other.proxy
119 }
120}
121
122impl PartialEq<ZwpTabletManagerV2> for ZwpTabletManagerV2Ref {
123 fn eq(&self, other: &ZwpTabletManagerV2) -> bool {
124 self.proxy == other.proxy
125 }
126}
127
128#[allow(dead_code)]
129impl ZwpTabletManagerV2 {
130 #[allow(dead_code)]
132 pub const REQ__GET_TABLET_SEAT__SINCE: u32 = 1;
133
134 #[inline]
143 pub fn get_tablet_seat(&self, seat: &WlSeatRef) -> ZwpTabletSeatV2 {
144 let (arg1,) = (seat,);
145 let obj1_lock = proxy::lock(arg1);
146 let obj1 = check_argument_proxy("seat", obj1_lock.wl_proxy());
147 let mut args = [wl_argument { n: 0 }, wl_argument { o: obj1 }];
148 let data = unsafe {
153 self.proxy
154 .send_constructor::<false>(0, &mut args, ZwpTabletSeatV2::WL_INTERFACE, None)
155 };
156 unsafe { proxy::low_level::from_untyped_owned(data) }
158 }
159
160 #[allow(dead_code)]
162 pub const REQ__DESTROY__SINCE: u32 = 1;
163
164 #[inline]
169 pub fn destroy(&self) {
170 let mut args = [];
171 unsafe {
175 self.proxy.send_destructor(1, &mut args);
176 }
177 }
178}
179
180#[allow(dead_code)]
181impl ZwpTabletManagerV2Ref {
182 #[inline]
192 pub fn get_tablet_seat(&self, _queue: &Queue, seat: &WlSeatRef) -> ZwpTabletSeatV2 {
193 let (arg1,) = (seat,);
194 let obj1_lock = proxy::lock(arg1);
195 let obj1 = check_argument_proxy("seat", obj1_lock.wl_proxy());
196 let mut args = [wl_argument { n: 0 }, wl_argument { o: obj1 }];
197 let data = unsafe {
202 self.proxy
203 .send_constructor(_queue, 0, &mut args, ZwpTabletSeatV2::WL_INTERFACE, None)
204 };
205 unsafe { proxy::low_level::from_untyped_owned(data) }
207 }
208}
209
210#[allow(dead_code)]
212pub trait ZwpTabletManagerV2EventHandler {}
213
214impl ZwpTabletManagerV2EventHandler for private::NoOpEventHandler {}
215
216unsafe impl<H> EventHandler for private::EventHandler<H>
218where
219 H: ZwpTabletManagerV2EventHandler,
220{
221 const WL_INTERFACE: &'static wl_interface = &INTERFACE;
222
223 #[allow(unused_variables)]
224 unsafe fn handle_event(
225 &self,
226 queue: &Queue,
227 data: *mut u8,
228 slf: &UntypedBorrowedProxy,
229 opcode: u32,
230 args: *mut wl_argument,
231 ) {
232 invalid_opcode("zwp_tablet_manager_v2", opcode);
233 }
234}
235
236impl<H> CreateEventHandler<H> for private::ProxyApi
237where
238 H: ZwpTabletManagerV2EventHandler,
239{
240 type EventHandler = private::EventHandler<H>;
241
242 #[inline]
243 fn create_event_handler(handler: H) -> Self::EventHandler {
244 private::EventHandler(handler)
245 }
246}
247
248pub mod event_handlers {
250 use super::*;
251
252 impl ZwpTabletManagerV2 {}
253}