get_registry/common/protocols_data/tablet_v2/
zwp_tablet_manager_v2.rs1use super::super::all_types::*;
8use ::wl_client::builder::prelude::*;
9
10static INTERFACE: wl_interface = wl_interface {
11 name: c"zwp_tablet_manager_v2".as_ptr(),
12 version: 1,
13 method_count: 2,
14 methods: {
15 static MESSAGES: [wl_message; 2] = [
16 wl_message {
17 name: c"get_tablet_seat".as_ptr(),
18 signature: c"no".as_ptr(),
19 types: {
20 static TYPES: [Option<&'static wl_interface>; 2] = [
21 Some(ZwpTabletSeatV2::WL_INTERFACE),
22 Some(WlSeat::WL_INTERFACE),
23 ];
24 TYPES.as_ptr().cast()
25 },
26 },
27 wl_message {
28 name: c"destroy".as_ptr(),
29 signature: c"".as_ptr(),
30 types: {
31 static TYPES: [Option<&'static wl_interface>; 0] = [];
32 TYPES.as_ptr().cast()
33 },
34 },
35 ];
36 MESSAGES.as_ptr()
37 },
38 event_count: 0,
39 events: ptr::null(),
40};
41
42#[derive(Clone, Eq, PartialEq)]
46#[repr(transparent)]
47pub struct ZwpTabletManagerV2 {
48 proxy: UntypedOwnedProxy,
50}
51
52#[derive(Eq, PartialEq)]
56#[repr(transparent)]
57pub struct ZwpTabletManagerV2Ref {
58 proxy: UntypedBorrowedProxy,
60}
61
62unsafe impl UntypedOwnedProxyWrapper for ZwpTabletManagerV2 {}
64
65unsafe impl OwnedProxy for ZwpTabletManagerV2 {
68 const INTERFACE: &'static str = "zwp_tablet_manager_v2";
69 const WL_INTERFACE: &'static wl_interface = &INTERFACE;
70 const NO_OP_EVENT_HANDLER: Self::NoOpEventHandler =
71 private::EventHandler(private::NoOpEventHandler);
72 const MAX_VERSION: u32 = 1;
73
74 type Borrowed = ZwpTabletManagerV2Ref;
75 type Api = private::ProxyApi;
76 type NoOpEventHandler = private::EventHandler<private::NoOpEventHandler>;
77}
78
79unsafe impl UntypedBorrowedProxyWrapper for ZwpTabletManagerV2Ref {}
81
82unsafe impl BorrowedProxy for ZwpTabletManagerV2Ref {
84 type Owned = ZwpTabletManagerV2;
85}
86
87impl Deref for ZwpTabletManagerV2 {
88 type Target = ZwpTabletManagerV2Ref;
89
90 fn deref(&self) -> &Self::Target {
91 proxy::low_level::deref(self)
92 }
93}
94
95mod private {
96 pub struct ProxyApi;
97
98 #[allow(dead_code)]
99 pub struct EventHandler<H>(pub(super) H);
100
101 #[allow(dead_code)]
102 pub struct NoOpEventHandler;
103}
104
105impl Debug for ZwpTabletManagerV2 {
106 fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
107 write!(f, "zwp_tablet_manager_v2#{}", self.proxy.id())
108 }
109}
110
111impl Debug for ZwpTabletManagerV2Ref {
112 fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
113 write!(f, "zwp_tablet_manager_v2#{}", self.proxy.id())
114 }
115}
116
117impl PartialEq<ZwpTabletManagerV2Ref> for ZwpTabletManagerV2 {
118 fn eq(&self, other: &ZwpTabletManagerV2Ref) -> bool {
119 self.proxy == other.proxy
120 }
121}
122
123impl PartialEq<ZwpTabletManagerV2> for ZwpTabletManagerV2Ref {
124 fn eq(&self, other: &ZwpTabletManagerV2) -> bool {
125 self.proxy == other.proxy
126 }
127}
128
129#[allow(dead_code)]
130impl ZwpTabletManagerV2 {
131 #[allow(dead_code)]
133 pub const REQ__GET_TABLET_SEAT__SINCE: u32 = 1;
134
135 #[allow(dead_code)]
137 pub const REQ__DESTROY__SINCE: u32 = 1;
138}
139
140#[allow(dead_code)]
141impl ZwpTabletManagerV2 {
142 #[inline]
151 pub fn get_tablet_seat(&self, seat: &WlSeatRef) -> ZwpTabletSeatV2 {
152 let (arg1,) = (seat,);
153 let obj1_lock = proxy::lock(arg1);
154 let obj1 = check_argument_proxy("seat", obj1_lock.wl_proxy());
155 let mut args = [wl_argument { n: 0 }, wl_argument { o: obj1 }];
156 let data = unsafe {
161 self.proxy
162 .send_constructor::<false>(0, &mut args, ZwpTabletSeatV2::WL_INTERFACE, None)
163 };
164 unsafe { proxy::low_level::from_untyped_owned(data) }
166 }
167
168 #[inline]
173 pub fn destroy(&self) {
174 let mut args = [];
175 unsafe {
179 self.proxy.send_destructor(1, &mut args);
180 }
181 }
182}
183
184#[allow(dead_code)]
185impl ZwpTabletManagerV2Ref {
186 #[inline]
196 pub fn get_tablet_seat(&self, _queue: &Queue, seat: &WlSeatRef) -> ZwpTabletSeatV2 {
197 let (arg1,) = (seat,);
198 let obj1_lock = proxy::lock(arg1);
199 let obj1 = check_argument_proxy("seat", obj1_lock.wl_proxy());
200 let mut args = [wl_argument { n: 0 }, wl_argument { o: obj1 }];
201 let data = unsafe {
206 self.proxy
207 .send_constructor(_queue, 0, &mut args, ZwpTabletSeatV2::WL_INTERFACE, None)
208 };
209 unsafe { proxy::low_level::from_untyped_owned(data) }
211 }
212}
213
214#[allow(dead_code)]
216pub trait ZwpTabletManagerV2EventHandler {
217 type Data: 'static;
218}
219
220impl ZwpTabletManagerV2EventHandler for private::NoOpEventHandler {
221 type Data = ();
222}
223
224unsafe impl<H> EventHandler for private::EventHandler<H>
227where
228 H: ZwpTabletManagerV2EventHandler,
229{
230 const WL_INTERFACE: &'static wl_interface = &INTERFACE;
231
232 #[inline]
233 fn mutable_type() -> Option<(TypeId, &'static str)> {
234 let id = TypeId::of::<H::Data>();
235 let name = std::any::type_name::<H::Data>();
236 Some((id, name))
237 }
238
239 #[allow(unused_variables)]
240 unsafe fn handle_event(
241 &self,
242 queue: &Queue,
243 data: *mut u8,
244 slf: &UntypedBorrowedProxy,
245 opcode: u32,
246 args: *mut wl_argument,
247 ) {
248 invalid_opcode("zwp_tablet_manager_v2", opcode);
249 }
250}
251
252impl<H> CreateEventHandler<H> for private::ProxyApi
253where
254 H: ZwpTabletManagerV2EventHandler,
255{
256 type EventHandler = private::EventHandler<H>;
257
258 #[inline]
259 fn create_event_handler(handler: H) -> Self::EventHandler {
260 private::EventHandler(handler)
261 }
262}
263
264pub mod event_handlers {
266 use super::*;
267
268 impl ZwpTabletManagerV2 {}
269}