1 | // This file contains generated code. Do not edit directly. |
2 | // To regenerate this, run 'make'. |
3 | |
4 | //! Bindings to the `Input` X11 extension. |
5 | |
6 | #![allow (clippy::too_many_arguments)] |
7 | |
8 | #[allow (unused_imports)] |
9 | use std::borrow::Cow; |
10 | #[allow (unused_imports)] |
11 | use std::convert::TryInto; |
12 | #[allow (unused_imports)] |
13 | use crate::utils::RawFdContainer; |
14 | #[allow (unused_imports)] |
15 | use crate::x11_utils::{Request, RequestHeader, Serialize, TryParse, TryParseFd}; |
16 | use std::io::IoSlice; |
17 | use crate::connection::RequestConnection; |
18 | #[allow (unused_imports)] |
19 | use crate::connection::Connection as X11Connection; |
20 | #[allow (unused_imports)] |
21 | use crate::cookie::{Cookie, CookieWithFds, VoidCookie}; |
22 | use crate::errors::ConnectionError; |
23 | #[allow (unused_imports)] |
24 | use crate::errors::ReplyOrIdError; |
25 | #[allow (unused_imports)] |
26 | use super::xfixes; |
27 | #[allow (unused_imports)] |
28 | use super::xproto; |
29 | |
30 | pub use x11rb_protocol::protocol::xinput::*; |
31 | |
32 | /// Get the major opcode of this extension |
33 | fn major_opcode<Conn: RequestConnection + ?Sized>(conn: &Conn) -> Result<u8, ConnectionError> { |
34 | let info: Option = conn.extension_information(X11_EXTENSION_NAME)?; |
35 | let info: ExtensionInformation = info.ok_or(err:ConnectionError::UnsupportedExtension)?; |
36 | Ok(info.major_opcode) |
37 | } |
38 | |
39 | pub fn get_extension_version<'c, 'input, Conn>(conn: &'c Conn, name: &'input [u8]) -> Result<Cookie<'c, Conn, GetExtensionVersionReply>, ConnectionError> |
40 | where |
41 | Conn: RequestConnection + ?Sized, |
42 | { |
43 | let request0: GetExtensionVersionRequest<'_> = GetExtensionVersionRequest { |
44 | name: Cow::Borrowed(name), |
45 | }; |
46 | let (bytes: [Cow<'_, [u8]>; 3], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
47 | let slices: [IoSlice<'_>; 3] = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])]; |
48 | assert_eq!(slices.len(), bytes.len()); |
49 | conn.send_request_with_reply(&slices, fds) |
50 | } |
51 | |
52 | pub fn list_input_devices<Conn>(conn: &Conn) -> Result<Cookie<'_, Conn, ListInputDevicesReply>, ConnectionError> |
53 | where |
54 | Conn: RequestConnection + ?Sized, |
55 | { |
56 | let request0: ListInputDevicesRequest = ListInputDevicesRequest; |
57 | let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
58 | let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])]; |
59 | assert_eq!(slices.len(), bytes.len()); |
60 | conn.send_request_with_reply(&slices, fds) |
61 | } |
62 | |
63 | pub fn open_device<Conn>(conn: &Conn, device_id: u8) -> Result<Cookie<'_, Conn, OpenDeviceReply>, ConnectionError> |
64 | where |
65 | Conn: RequestConnection + ?Sized, |
66 | { |
67 | let request0: OpenDeviceRequest = OpenDeviceRequest { |
68 | device_id, |
69 | }; |
70 | let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
71 | let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])]; |
72 | assert_eq!(slices.len(), bytes.len()); |
73 | conn.send_request_with_reply(&slices, fds) |
74 | } |
75 | |
76 | pub fn close_device<Conn>(conn: &Conn, device_id: u8) -> Result<VoidCookie<'_, Conn>, ConnectionError> |
77 | where |
78 | Conn: RequestConnection + ?Sized, |
79 | { |
80 | let request0: CloseDeviceRequest = CloseDeviceRequest { |
81 | device_id, |
82 | }; |
83 | let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
84 | let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])]; |
85 | assert_eq!(slices.len(), bytes.len()); |
86 | conn.send_request_without_reply(&slices, fds) |
87 | } |
88 | |
89 | pub fn set_device_mode<Conn>(conn: &Conn, device_id: u8, mode: ValuatorMode) -> Result<Cookie<'_, Conn, SetDeviceModeReply>, ConnectionError> |
90 | where |
91 | Conn: RequestConnection + ?Sized, |
92 | { |
93 | let request0: SetDeviceModeRequest = SetDeviceModeRequest { |
94 | device_id, |
95 | mode, |
96 | }; |
97 | let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
98 | let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])]; |
99 | assert_eq!(slices.len(), bytes.len()); |
100 | conn.send_request_with_reply(&slices, fds) |
101 | } |
102 | |
103 | pub fn select_extension_event<'c, 'input, Conn>(conn: &'c Conn, window: xproto::Window, classes: &'input [EventClass]) -> Result<VoidCookie<'c, Conn>, ConnectionError> |
104 | where |
105 | Conn: RequestConnection + ?Sized, |
106 | { |
107 | let request0: SelectExtensionEventRequest<'_> = SelectExtensionEventRequest { |
108 | window, |
109 | classes: Cow::Borrowed(classes), |
110 | }; |
111 | let (bytes: [Cow<'_, [u8]>; 3], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
112 | let slices: [IoSlice<'_>; 3] = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])]; |
113 | assert_eq!(slices.len(), bytes.len()); |
114 | conn.send_request_without_reply(&slices, fds) |
115 | } |
116 | |
117 | pub fn get_selected_extension_events<Conn>(conn: &Conn, window: xproto::Window) -> Result<Cookie<'_, Conn, GetSelectedExtensionEventsReply>, ConnectionError> |
118 | where |
119 | Conn: RequestConnection + ?Sized, |
120 | { |
121 | let request0: GetSelectedExtensionEventsRequest = GetSelectedExtensionEventsRequest { |
122 | window, |
123 | }; |
124 | let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
125 | let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])]; |
126 | assert_eq!(slices.len(), bytes.len()); |
127 | conn.send_request_with_reply(&slices, fds) |
128 | } |
129 | |
130 | pub fn change_device_dont_propagate_list<'c, 'input, Conn>(conn: &'c Conn, window: xproto::Window, mode: PropagateMode, classes: &'input [EventClass]) -> Result<VoidCookie<'c, Conn>, ConnectionError> |
131 | where |
132 | Conn: RequestConnection + ?Sized, |
133 | { |
134 | let request0: ChangeDeviceDontPropagateListRequest<'_> = ChangeDeviceDontPropagateListRequest { |
135 | window, |
136 | mode, |
137 | classes: Cow::Borrowed(classes), |
138 | }; |
139 | let (bytes: [Cow<'_, [u8]>; 3], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
140 | let slices: [IoSlice<'_>; 3] = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])]; |
141 | assert_eq!(slices.len(), bytes.len()); |
142 | conn.send_request_without_reply(&slices, fds) |
143 | } |
144 | |
145 | pub fn get_device_dont_propagate_list<Conn>(conn: &Conn, window: xproto::Window) -> Result<Cookie<'_, Conn, GetDeviceDontPropagateListReply>, ConnectionError> |
146 | where |
147 | Conn: RequestConnection + ?Sized, |
148 | { |
149 | let request0: GetDeviceDontPropagateListRequest = GetDeviceDontPropagateListRequest { |
150 | window, |
151 | }; |
152 | let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
153 | let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])]; |
154 | assert_eq!(slices.len(), bytes.len()); |
155 | conn.send_request_with_reply(&slices, fds) |
156 | } |
157 | |
158 | pub fn get_device_motion_events<Conn, A>(conn: &Conn, start: xproto::Timestamp, stop: A, device_id: u8) -> Result<Cookie<'_, Conn, GetDeviceMotionEventsReply>, ConnectionError> |
159 | where |
160 | Conn: RequestConnection + ?Sized, |
161 | A: Into<xproto::Timestamp>, |
162 | { |
163 | let stop: xproto::Timestamp = stop.into(); |
164 | let request0: GetDeviceMotionEventsRequest = GetDeviceMotionEventsRequest { |
165 | start, |
166 | stop, |
167 | device_id, |
168 | }; |
169 | let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
170 | let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])]; |
171 | assert_eq!(slices.len(), bytes.len()); |
172 | conn.send_request_with_reply(&slices, fds) |
173 | } |
174 | |
175 | pub fn change_keyboard_device<Conn>(conn: &Conn, device_id: u8) -> Result<Cookie<'_, Conn, ChangeKeyboardDeviceReply>, ConnectionError> |
176 | where |
177 | Conn: RequestConnection + ?Sized, |
178 | { |
179 | let request0: ChangeKeyboardDeviceRequest = ChangeKeyboardDeviceRequest { |
180 | device_id, |
181 | }; |
182 | let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
183 | let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])]; |
184 | assert_eq!(slices.len(), bytes.len()); |
185 | conn.send_request_with_reply(&slices, fds) |
186 | } |
187 | |
188 | pub fn change_pointer_device<Conn>(conn: &Conn, x_axis: u8, y_axis: u8, device_id: u8) -> Result<Cookie<'_, Conn, ChangePointerDeviceReply>, ConnectionError> |
189 | where |
190 | Conn: RequestConnection + ?Sized, |
191 | { |
192 | let request0: ChangePointerDeviceRequest = ChangePointerDeviceRequest { |
193 | x_axis, |
194 | y_axis, |
195 | device_id, |
196 | }; |
197 | let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
198 | let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])]; |
199 | assert_eq!(slices.len(), bytes.len()); |
200 | conn.send_request_with_reply(&slices, fds) |
201 | } |
202 | |
203 | pub fn grab_device<'c, 'input, Conn, A>(conn: &'c Conn, grab_window: xproto::Window, time: A, this_device_mode: xproto::GrabMode, other_device_mode: xproto::GrabMode, owner_events: bool, device_id: u8, classes: &'input [EventClass]) -> Result<Cookie<'c, Conn, GrabDeviceReply>, ConnectionError> |
204 | where |
205 | Conn: RequestConnection + ?Sized, |
206 | A: Into<xproto::Timestamp>, |
207 | { |
208 | let time: xproto::Timestamp = time.into(); |
209 | let request0: GrabDeviceRequest<'_> = GrabDeviceRequest { |
210 | grab_window, |
211 | time, |
212 | this_device_mode, |
213 | other_device_mode, |
214 | owner_events, |
215 | device_id, |
216 | classes: Cow::Borrowed(classes), |
217 | }; |
218 | let (bytes: [Cow<'_, [u8]>; 3], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
219 | let slices: [IoSlice<'_>; 3] = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])]; |
220 | assert_eq!(slices.len(), bytes.len()); |
221 | conn.send_request_with_reply(&slices, fds) |
222 | } |
223 | |
224 | pub fn ungrab_device<Conn, A>(conn: &Conn, time: A, device_id: u8) -> Result<VoidCookie<'_, Conn>, ConnectionError> |
225 | where |
226 | Conn: RequestConnection + ?Sized, |
227 | A: Into<xproto::Timestamp>, |
228 | { |
229 | let time: xproto::Timestamp = time.into(); |
230 | let request0: UngrabDeviceRequest = UngrabDeviceRequest { |
231 | time, |
232 | device_id, |
233 | }; |
234 | let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
235 | let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])]; |
236 | assert_eq!(slices.len(), bytes.len()); |
237 | conn.send_request_without_reply(&slices, fds) |
238 | } |
239 | |
240 | pub fn grab_device_key<'c, 'input, Conn, A, B>(conn: &'c Conn, grab_window: xproto::Window, modifiers: xproto::ModMask, modifier_device: A, grabbed_device: u8, key: B, this_device_mode: xproto::GrabMode, other_device_mode: xproto::GrabMode, owner_events: bool, classes: &'input [EventClass]) -> Result<VoidCookie<'c, Conn>, ConnectionError> |
241 | where |
242 | Conn: RequestConnection + ?Sized, |
243 | A: Into<u8>, |
244 | B: Into<u8>, |
245 | { |
246 | let modifier_device: u8 = modifier_device.into(); |
247 | let key: u8 = key.into(); |
248 | let request0: GrabDeviceKeyRequest<'_> = GrabDeviceKeyRequest { |
249 | grab_window, |
250 | modifiers, |
251 | modifier_device, |
252 | grabbed_device, |
253 | key, |
254 | this_device_mode, |
255 | other_device_mode, |
256 | owner_events, |
257 | classes: Cow::Borrowed(classes), |
258 | }; |
259 | let (bytes: [Cow<'_, [u8]>; 3], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
260 | let slices: [IoSlice<'_>; 3] = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])]; |
261 | assert_eq!(slices.len(), bytes.len()); |
262 | conn.send_request_without_reply(&slices, fds) |
263 | } |
264 | |
265 | pub fn ungrab_device_key<Conn, A, B>(conn: &Conn, grab_window: xproto::Window, modifiers: xproto::ModMask, modifier_device: A, key: B, grabbed_device: u8) -> Result<VoidCookie<'_, Conn>, ConnectionError> |
266 | where |
267 | Conn: RequestConnection + ?Sized, |
268 | A: Into<u8>, |
269 | B: Into<u8>, |
270 | { |
271 | let modifier_device: u8 = modifier_device.into(); |
272 | let key: u8 = key.into(); |
273 | let request0: UngrabDeviceKeyRequest = UngrabDeviceKeyRequest { |
274 | grab_window, |
275 | modifiers, |
276 | modifier_device, |
277 | key, |
278 | grabbed_device, |
279 | }; |
280 | let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
281 | let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])]; |
282 | assert_eq!(slices.len(), bytes.len()); |
283 | conn.send_request_without_reply(&slices, fds) |
284 | } |
285 | |
286 | pub fn grab_device_button<'c, 'input, Conn, A, B>(conn: &'c Conn, grab_window: xproto::Window, grabbed_device: u8, modifier_device: A, modifiers: xproto::ModMask, this_device_mode: xproto::GrabMode, other_device_mode: xproto::GrabMode, button: B, owner_events: bool, classes: &'input [EventClass]) -> Result<VoidCookie<'c, Conn>, ConnectionError> |
287 | where |
288 | Conn: RequestConnection + ?Sized, |
289 | A: Into<u8>, |
290 | B: Into<u8>, |
291 | { |
292 | let modifier_device: u8 = modifier_device.into(); |
293 | let button: u8 = button.into(); |
294 | let request0: GrabDeviceButtonRequest<'_> = GrabDeviceButtonRequest { |
295 | grab_window, |
296 | grabbed_device, |
297 | modifier_device, |
298 | modifiers, |
299 | this_device_mode, |
300 | other_device_mode, |
301 | button, |
302 | owner_events, |
303 | classes: Cow::Borrowed(classes), |
304 | }; |
305 | let (bytes: [Cow<'_, [u8]>; 3], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
306 | let slices: [IoSlice<'_>; 3] = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])]; |
307 | assert_eq!(slices.len(), bytes.len()); |
308 | conn.send_request_without_reply(&slices, fds) |
309 | } |
310 | |
311 | pub fn ungrab_device_button<Conn, A, B>(conn: &Conn, grab_window: xproto::Window, modifiers: xproto::ModMask, modifier_device: A, button: B, grabbed_device: u8) -> Result<VoidCookie<'_, Conn>, ConnectionError> |
312 | where |
313 | Conn: RequestConnection + ?Sized, |
314 | A: Into<u8>, |
315 | B: Into<u8>, |
316 | { |
317 | let modifier_device: u8 = modifier_device.into(); |
318 | let button: u8 = button.into(); |
319 | let request0: UngrabDeviceButtonRequest = UngrabDeviceButtonRequest { |
320 | grab_window, |
321 | modifiers, |
322 | modifier_device, |
323 | button, |
324 | grabbed_device, |
325 | }; |
326 | let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
327 | let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])]; |
328 | assert_eq!(slices.len(), bytes.len()); |
329 | conn.send_request_without_reply(&slices, fds) |
330 | } |
331 | |
332 | pub fn allow_device_events<Conn, A>(conn: &Conn, time: A, mode: DeviceInputMode, device_id: u8) -> Result<VoidCookie<'_, Conn>, ConnectionError> |
333 | where |
334 | Conn: RequestConnection + ?Sized, |
335 | A: Into<xproto::Timestamp>, |
336 | { |
337 | let time: xproto::Timestamp = time.into(); |
338 | let request0: AllowDeviceEventsRequest = AllowDeviceEventsRequest { |
339 | time, |
340 | mode, |
341 | device_id, |
342 | }; |
343 | let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
344 | let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])]; |
345 | assert_eq!(slices.len(), bytes.len()); |
346 | conn.send_request_without_reply(&slices, fds) |
347 | } |
348 | |
349 | pub fn get_device_focus<Conn>(conn: &Conn, device_id: u8) -> Result<Cookie<'_, Conn, GetDeviceFocusReply>, ConnectionError> |
350 | where |
351 | Conn: RequestConnection + ?Sized, |
352 | { |
353 | let request0: GetDeviceFocusRequest = GetDeviceFocusRequest { |
354 | device_id, |
355 | }; |
356 | let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
357 | let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])]; |
358 | assert_eq!(slices.len(), bytes.len()); |
359 | conn.send_request_with_reply(&slices, fds) |
360 | } |
361 | |
362 | pub fn set_device_focus<Conn, A, B>(conn: &Conn, focus: A, time: B, revert_to: xproto::InputFocus, device_id: u8) -> Result<VoidCookie<'_, Conn>, ConnectionError> |
363 | where |
364 | Conn: RequestConnection + ?Sized, |
365 | A: Into<xproto::Window>, |
366 | B: Into<xproto::Timestamp>, |
367 | { |
368 | let focus: xproto::Window = focus.into(); |
369 | let time: xproto::Timestamp = time.into(); |
370 | let request0: SetDeviceFocusRequest = SetDeviceFocusRequest { |
371 | focus, |
372 | time, |
373 | revert_to, |
374 | device_id, |
375 | }; |
376 | let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
377 | let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])]; |
378 | assert_eq!(slices.len(), bytes.len()); |
379 | conn.send_request_without_reply(&slices, fds) |
380 | } |
381 | |
382 | pub fn get_feedback_control<Conn>(conn: &Conn, device_id: u8) -> Result<Cookie<'_, Conn, GetFeedbackControlReply>, ConnectionError> |
383 | where |
384 | Conn: RequestConnection + ?Sized, |
385 | { |
386 | let request0: GetFeedbackControlRequest = GetFeedbackControlRequest { |
387 | device_id, |
388 | }; |
389 | let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
390 | let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])]; |
391 | assert_eq!(slices.len(), bytes.len()); |
392 | conn.send_request_with_reply(&slices, fds) |
393 | } |
394 | |
395 | pub fn change_feedback_control<Conn>(conn: &Conn, mask: ChangeFeedbackControlMask, device_id: u8, feedback_id: u8, feedback: FeedbackCtl) -> Result<VoidCookie<'_, Conn>, ConnectionError> |
396 | where |
397 | Conn: RequestConnection + ?Sized, |
398 | { |
399 | let request0: ChangeFeedbackControlRequest = ChangeFeedbackControlRequest { |
400 | mask, |
401 | device_id, |
402 | feedback_id, |
403 | feedback, |
404 | }; |
405 | let (bytes: [Cow<'_, [u8]>; 3], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
406 | let slices: [IoSlice<'_>; 3] = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])]; |
407 | assert_eq!(slices.len(), bytes.len()); |
408 | conn.send_request_without_reply(&slices, fds) |
409 | } |
410 | |
411 | pub fn get_device_key_mapping<Conn>(conn: &Conn, device_id: u8, first_keycode: KeyCode, count: u8) -> Result<Cookie<'_, Conn, GetDeviceKeyMappingReply>, ConnectionError> |
412 | where |
413 | Conn: RequestConnection + ?Sized, |
414 | { |
415 | let request0: GetDeviceKeyMappingRequest = GetDeviceKeyMappingRequest { |
416 | device_id, |
417 | first_keycode, |
418 | count, |
419 | }; |
420 | let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
421 | let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])]; |
422 | assert_eq!(slices.len(), bytes.len()); |
423 | conn.send_request_with_reply(&slices, fds) |
424 | } |
425 | |
426 | pub fn change_device_key_mapping<'c, 'input, Conn>(conn: &'c Conn, device_id: u8, first_keycode: KeyCode, keysyms_per_keycode: u8, keycode_count: u8, keysyms: &'input [xproto::Keysym]) -> Result<VoidCookie<'c, Conn>, ConnectionError> |
427 | where |
428 | Conn: RequestConnection + ?Sized, |
429 | { |
430 | let request0: ChangeDeviceKeyMappingRequest<'_> = ChangeDeviceKeyMappingRequest { |
431 | device_id, |
432 | first_keycode, |
433 | keysyms_per_keycode, |
434 | keycode_count, |
435 | keysyms: Cow::Borrowed(keysyms), |
436 | }; |
437 | let (bytes: [Cow<'_, [u8]>; 3], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
438 | let slices: [IoSlice<'_>; 3] = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])]; |
439 | assert_eq!(slices.len(), bytes.len()); |
440 | conn.send_request_without_reply(&slices, fds) |
441 | } |
442 | |
443 | pub fn get_device_modifier_mapping<Conn>(conn: &Conn, device_id: u8) -> Result<Cookie<'_, Conn, GetDeviceModifierMappingReply>, ConnectionError> |
444 | where |
445 | Conn: RequestConnection + ?Sized, |
446 | { |
447 | let request0: GetDeviceModifierMappingRequest = GetDeviceModifierMappingRequest { |
448 | device_id, |
449 | }; |
450 | let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
451 | let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])]; |
452 | assert_eq!(slices.len(), bytes.len()); |
453 | conn.send_request_with_reply(&slices, fds) |
454 | } |
455 | |
456 | pub fn set_device_modifier_mapping<'c, 'input, Conn>(conn: &'c Conn, device_id: u8, keymaps: &'input [u8]) -> Result<Cookie<'c, Conn, SetDeviceModifierMappingReply>, ConnectionError> |
457 | where |
458 | Conn: RequestConnection + ?Sized, |
459 | { |
460 | let request0: SetDeviceModifierMappingRequest<'_> = SetDeviceModifierMappingRequest { |
461 | device_id, |
462 | keymaps: Cow::Borrowed(keymaps), |
463 | }; |
464 | let (bytes: [Cow<'_, [u8]>; 3], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
465 | let slices: [IoSlice<'_>; 3] = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])]; |
466 | assert_eq!(slices.len(), bytes.len()); |
467 | conn.send_request_with_reply(&slices, fds) |
468 | } |
469 | |
470 | pub fn get_device_button_mapping<Conn>(conn: &Conn, device_id: u8) -> Result<Cookie<'_, Conn, GetDeviceButtonMappingReply>, ConnectionError> |
471 | where |
472 | Conn: RequestConnection + ?Sized, |
473 | { |
474 | let request0: GetDeviceButtonMappingRequest = GetDeviceButtonMappingRequest { |
475 | device_id, |
476 | }; |
477 | let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
478 | let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])]; |
479 | assert_eq!(slices.len(), bytes.len()); |
480 | conn.send_request_with_reply(&slices, fds) |
481 | } |
482 | |
483 | pub fn set_device_button_mapping<'c, 'input, Conn>(conn: &'c Conn, device_id: u8, map: &'input [u8]) -> Result<Cookie<'c, Conn, SetDeviceButtonMappingReply>, ConnectionError> |
484 | where |
485 | Conn: RequestConnection + ?Sized, |
486 | { |
487 | let request0: SetDeviceButtonMappingRequest<'_> = SetDeviceButtonMappingRequest { |
488 | device_id, |
489 | map: Cow::Borrowed(map), |
490 | }; |
491 | let (bytes: [Cow<'_, [u8]>; 3], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
492 | let slices: [IoSlice<'_>; 3] = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])]; |
493 | assert_eq!(slices.len(), bytes.len()); |
494 | conn.send_request_with_reply(&slices, fds) |
495 | } |
496 | |
497 | pub fn query_device_state<Conn>(conn: &Conn, device_id: u8) -> Result<Cookie<'_, Conn, QueryDeviceStateReply>, ConnectionError> |
498 | where |
499 | Conn: RequestConnection + ?Sized, |
500 | { |
501 | let request0: QueryDeviceStateRequest = QueryDeviceStateRequest { |
502 | device_id, |
503 | }; |
504 | let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
505 | let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])]; |
506 | assert_eq!(slices.len(), bytes.len()); |
507 | conn.send_request_with_reply(&slices, fds) |
508 | } |
509 | |
510 | pub fn device_bell<Conn>(conn: &Conn, device_id: u8, feedback_id: u8, feedback_class: u8, percent: i8) -> Result<VoidCookie<'_, Conn>, ConnectionError> |
511 | where |
512 | Conn: RequestConnection + ?Sized, |
513 | { |
514 | let request0: DeviceBellRequest = DeviceBellRequest { |
515 | device_id, |
516 | feedback_id, |
517 | feedback_class, |
518 | percent, |
519 | }; |
520 | let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
521 | let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])]; |
522 | assert_eq!(slices.len(), bytes.len()); |
523 | conn.send_request_without_reply(&slices, fds) |
524 | } |
525 | |
526 | pub fn set_device_valuators<'c, 'input, Conn>(conn: &'c Conn, device_id: u8, first_valuator: u8, valuators: &'input [i32]) -> Result<Cookie<'c, Conn, SetDeviceValuatorsReply>, ConnectionError> |
527 | where |
528 | Conn: RequestConnection + ?Sized, |
529 | { |
530 | let request0: SetDeviceValuatorsRequest<'_> = SetDeviceValuatorsRequest { |
531 | device_id, |
532 | first_valuator, |
533 | valuators: Cow::Borrowed(valuators), |
534 | }; |
535 | let (bytes: [Cow<'_, [u8]>; 3], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
536 | let slices: [IoSlice<'_>; 3] = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])]; |
537 | assert_eq!(slices.len(), bytes.len()); |
538 | conn.send_request_with_reply(&slices, fds) |
539 | } |
540 | |
541 | pub fn get_device_control<Conn>(conn: &Conn, control_id: DeviceControl, device_id: u8) -> Result<Cookie<'_, Conn, GetDeviceControlReply>, ConnectionError> |
542 | where |
543 | Conn: RequestConnection + ?Sized, |
544 | { |
545 | let request0: GetDeviceControlRequest = GetDeviceControlRequest { |
546 | control_id, |
547 | device_id, |
548 | }; |
549 | let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
550 | let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])]; |
551 | assert_eq!(slices.len(), bytes.len()); |
552 | conn.send_request_with_reply(&slices, fds) |
553 | } |
554 | |
555 | pub fn change_device_control<Conn>(conn: &Conn, control_id: DeviceControl, device_id: u8, control: DeviceCtl) -> Result<Cookie<'_, Conn, ChangeDeviceControlReply>, ConnectionError> |
556 | where |
557 | Conn: RequestConnection + ?Sized, |
558 | { |
559 | let request0: ChangeDeviceControlRequest = ChangeDeviceControlRequest { |
560 | control_id, |
561 | device_id, |
562 | control, |
563 | }; |
564 | let (bytes: [Cow<'_, [u8]>; 3], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
565 | let slices: [IoSlice<'_>; 3] = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])]; |
566 | assert_eq!(slices.len(), bytes.len()); |
567 | conn.send_request_with_reply(&slices, fds) |
568 | } |
569 | |
570 | pub fn list_device_properties<Conn>(conn: &Conn, device_id: u8) -> Result<Cookie<'_, Conn, ListDevicePropertiesReply>, ConnectionError> |
571 | where |
572 | Conn: RequestConnection + ?Sized, |
573 | { |
574 | let request0: ListDevicePropertiesRequest = ListDevicePropertiesRequest { |
575 | device_id, |
576 | }; |
577 | let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
578 | let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])]; |
579 | assert_eq!(slices.len(), bytes.len()); |
580 | conn.send_request_with_reply(&slices, fds) |
581 | } |
582 | |
583 | pub fn change_device_property<'c, 'input, Conn>(conn: &'c Conn, property: xproto::Atom, type_: xproto::Atom, device_id: u8, mode: xproto::PropMode, num_items: u32, items: &'input ChangeDevicePropertyAux) -> Result<VoidCookie<'c, Conn>, ConnectionError> |
584 | where |
585 | Conn: RequestConnection + ?Sized, |
586 | { |
587 | let request0: ChangeDevicePropertyRequest<'_> = ChangeDevicePropertyRequest { |
588 | property, |
589 | type_, |
590 | device_id, |
591 | mode, |
592 | num_items, |
593 | items: Cow::Borrowed(items), |
594 | }; |
595 | let (bytes: [Cow<'_, [u8]>; 3], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
596 | let slices: [IoSlice<'_>; 3] = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])]; |
597 | assert_eq!(slices.len(), bytes.len()); |
598 | conn.send_request_without_reply(&slices, fds) |
599 | } |
600 | |
601 | pub fn delete_device_property<Conn>(conn: &Conn, property: xproto::Atom, device_id: u8) -> Result<VoidCookie<'_, Conn>, ConnectionError> |
602 | where |
603 | Conn: RequestConnection + ?Sized, |
604 | { |
605 | let request0: DeleteDevicePropertyRequest = DeleteDevicePropertyRequest { |
606 | property, |
607 | device_id, |
608 | }; |
609 | let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
610 | let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])]; |
611 | assert_eq!(slices.len(), bytes.len()); |
612 | conn.send_request_without_reply(&slices, fds) |
613 | } |
614 | |
615 | pub fn get_device_property<Conn>(conn: &Conn, property: xproto::Atom, type_: xproto::Atom, offset: u32, len: u32, device_id: u8, delete: bool) -> Result<Cookie<'_, Conn, GetDevicePropertyReply>, ConnectionError> |
616 | where |
617 | Conn: RequestConnection + ?Sized, |
618 | { |
619 | let request0: GetDevicePropertyRequest = GetDevicePropertyRequest { |
620 | property, |
621 | type_, |
622 | offset, |
623 | len, |
624 | device_id, |
625 | delete, |
626 | }; |
627 | let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
628 | let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])]; |
629 | assert_eq!(slices.len(), bytes.len()); |
630 | conn.send_request_with_reply(&slices, fds) |
631 | } |
632 | |
633 | pub fn xi_query_pointer<Conn, A>(conn: &Conn, window: xproto::Window, deviceid: A) -> Result<Cookie<'_, Conn, XIQueryPointerReply>, ConnectionError> |
634 | where |
635 | Conn: RequestConnection + ?Sized, |
636 | A: Into<DeviceId>, |
637 | { |
638 | let deviceid: DeviceId = deviceid.into(); |
639 | let request0: XIQueryPointerRequest = XIQueryPointerRequest { |
640 | window, |
641 | deviceid, |
642 | }; |
643 | let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
644 | let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])]; |
645 | assert_eq!(slices.len(), bytes.len()); |
646 | conn.send_request_with_reply(&slices, fds) |
647 | } |
648 | |
649 | pub fn xi_warp_pointer<Conn, A>(conn: &Conn, src_win: xproto::Window, dst_win: xproto::Window, src_x: Fp1616, src_y: Fp1616, src_width: u16, src_height: u16, dst_x: Fp1616, dst_y: Fp1616, deviceid: A) -> Result<VoidCookie<'_, Conn>, ConnectionError> |
650 | where |
651 | Conn: RequestConnection + ?Sized, |
652 | A: Into<DeviceId>, |
653 | { |
654 | let deviceid: DeviceId = deviceid.into(); |
655 | let request0: XIWarpPointerRequest = XIWarpPointerRequest { |
656 | src_win, |
657 | dst_win, |
658 | src_x, |
659 | src_y, |
660 | src_width, |
661 | src_height, |
662 | dst_x, |
663 | dst_y, |
664 | deviceid, |
665 | }; |
666 | let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
667 | let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])]; |
668 | assert_eq!(slices.len(), bytes.len()); |
669 | conn.send_request_without_reply(&slices, fds) |
670 | } |
671 | |
672 | pub fn xi_change_cursor<Conn, A>(conn: &Conn, window: xproto::Window, cursor: xproto::Cursor, deviceid: A) -> Result<VoidCookie<'_, Conn>, ConnectionError> |
673 | where |
674 | Conn: RequestConnection + ?Sized, |
675 | A: Into<DeviceId>, |
676 | { |
677 | let deviceid: DeviceId = deviceid.into(); |
678 | let request0: XIChangeCursorRequest = XIChangeCursorRequest { |
679 | window, |
680 | cursor, |
681 | deviceid, |
682 | }; |
683 | let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
684 | let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])]; |
685 | assert_eq!(slices.len(), bytes.len()); |
686 | conn.send_request_without_reply(&slices, fds) |
687 | } |
688 | |
689 | pub fn xi_change_hierarchy<'c, 'input, Conn>(conn: &'c Conn, changes: &'input [HierarchyChange]) -> Result<VoidCookie<'c, Conn>, ConnectionError> |
690 | where |
691 | Conn: RequestConnection + ?Sized, |
692 | { |
693 | let request0: XIChangeHierarchyRequest<'_> = XIChangeHierarchyRequest { |
694 | changes: Cow::Borrowed(changes), |
695 | }; |
696 | let (bytes: [Cow<'_, [u8]>; 3], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
697 | let slices: [IoSlice<'_>; 3] = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])]; |
698 | assert_eq!(slices.len(), bytes.len()); |
699 | conn.send_request_without_reply(&slices, fds) |
700 | } |
701 | |
702 | pub fn xi_set_client_pointer<Conn, A>(conn: &Conn, window: xproto::Window, deviceid: A) -> Result<VoidCookie<'_, Conn>, ConnectionError> |
703 | where |
704 | Conn: RequestConnection + ?Sized, |
705 | A: Into<DeviceId>, |
706 | { |
707 | let deviceid: DeviceId = deviceid.into(); |
708 | let request0: XISetClientPointerRequest = XISetClientPointerRequest { |
709 | window, |
710 | deviceid, |
711 | }; |
712 | let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
713 | let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])]; |
714 | assert_eq!(slices.len(), bytes.len()); |
715 | conn.send_request_without_reply(&slices, fds) |
716 | } |
717 | |
718 | pub fn xi_get_client_pointer<Conn>(conn: &Conn, window: xproto::Window) -> Result<Cookie<'_, Conn, XIGetClientPointerReply>, ConnectionError> |
719 | where |
720 | Conn: RequestConnection + ?Sized, |
721 | { |
722 | let request0: XIGetClientPointerRequest = XIGetClientPointerRequest { |
723 | window, |
724 | }; |
725 | let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
726 | let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])]; |
727 | assert_eq!(slices.len(), bytes.len()); |
728 | conn.send_request_with_reply(&slices, fds) |
729 | } |
730 | |
731 | pub fn xi_select_events<'c, 'input, Conn>(conn: &'c Conn, window: xproto::Window, masks: &'input [EventMask]) -> Result<VoidCookie<'c, Conn>, ConnectionError> |
732 | where |
733 | Conn: RequestConnection + ?Sized, |
734 | { |
735 | let request0: XISelectEventsRequest<'_> = XISelectEventsRequest { |
736 | window, |
737 | masks: Cow::Borrowed(masks), |
738 | }; |
739 | let (bytes: [Cow<'_, [u8]>; 3], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
740 | let slices: [IoSlice<'_>; 3] = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])]; |
741 | assert_eq!(slices.len(), bytes.len()); |
742 | conn.send_request_without_reply(&slices, fds) |
743 | } |
744 | |
745 | pub fn xi_query_version<Conn>(conn: &Conn, major_version: u16, minor_version: u16) -> Result<Cookie<'_, Conn, XIQueryVersionReply>, ConnectionError> |
746 | where |
747 | Conn: RequestConnection + ?Sized, |
748 | { |
749 | let request0: XIQueryVersionRequest = XIQueryVersionRequest { |
750 | major_version, |
751 | minor_version, |
752 | }; |
753 | let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
754 | let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])]; |
755 | assert_eq!(slices.len(), bytes.len()); |
756 | conn.send_request_with_reply(&slices, fds) |
757 | } |
758 | |
759 | pub fn xi_query_device<Conn, A>(conn: &Conn, deviceid: A) -> Result<Cookie<'_, Conn, XIQueryDeviceReply>, ConnectionError> |
760 | where |
761 | Conn: RequestConnection + ?Sized, |
762 | A: Into<DeviceId>, |
763 | { |
764 | let deviceid: DeviceId = deviceid.into(); |
765 | let request0: XIQueryDeviceRequest = XIQueryDeviceRequest { |
766 | deviceid, |
767 | }; |
768 | let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
769 | let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])]; |
770 | assert_eq!(slices.len(), bytes.len()); |
771 | conn.send_request_with_reply(&slices, fds) |
772 | } |
773 | |
774 | pub fn xi_set_focus<Conn, A, B>(conn: &Conn, window: xproto::Window, time: A, deviceid: B) -> Result<VoidCookie<'_, Conn>, ConnectionError> |
775 | where |
776 | Conn: RequestConnection + ?Sized, |
777 | A: Into<xproto::Timestamp>, |
778 | B: Into<DeviceId>, |
779 | { |
780 | let time: xproto::Timestamp = time.into(); |
781 | let deviceid: DeviceId = deviceid.into(); |
782 | let request0: XISetFocusRequest = XISetFocusRequest { |
783 | window, |
784 | time, |
785 | deviceid, |
786 | }; |
787 | let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
788 | let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])]; |
789 | assert_eq!(slices.len(), bytes.len()); |
790 | conn.send_request_without_reply(&slices, fds) |
791 | } |
792 | |
793 | pub fn xi_get_focus<Conn, A>(conn: &Conn, deviceid: A) -> Result<Cookie<'_, Conn, XIGetFocusReply>, ConnectionError> |
794 | where |
795 | Conn: RequestConnection + ?Sized, |
796 | A: Into<DeviceId>, |
797 | { |
798 | let deviceid: DeviceId = deviceid.into(); |
799 | let request0: XIGetFocusRequest = XIGetFocusRequest { |
800 | deviceid, |
801 | }; |
802 | let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
803 | let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])]; |
804 | assert_eq!(slices.len(), bytes.len()); |
805 | conn.send_request_with_reply(&slices, fds) |
806 | } |
807 | |
808 | pub fn xi_grab_device<'c, 'input, Conn, A, B>(conn: &'c Conn, window: xproto::Window, time: A, cursor: xproto::Cursor, deviceid: B, mode: xproto::GrabMode, paired_device_mode: xproto::GrabMode, owner_events: GrabOwner, mask: &'input [u32]) -> Result<Cookie<'c, Conn, XIGrabDeviceReply>, ConnectionError> |
809 | where |
810 | Conn: RequestConnection + ?Sized, |
811 | A: Into<xproto::Timestamp>, |
812 | B: Into<DeviceId>, |
813 | { |
814 | let time: xproto::Timestamp = time.into(); |
815 | let deviceid: DeviceId = deviceid.into(); |
816 | let request0: XIGrabDeviceRequest<'_> = XIGrabDeviceRequest { |
817 | window, |
818 | time, |
819 | cursor, |
820 | deviceid, |
821 | mode, |
822 | paired_device_mode, |
823 | owner_events, |
824 | mask: Cow::Borrowed(mask), |
825 | }; |
826 | let (bytes: [Cow<'_, [u8]>; 3], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
827 | let slices: [IoSlice<'_>; 3] = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])]; |
828 | assert_eq!(slices.len(), bytes.len()); |
829 | conn.send_request_with_reply(&slices, fds) |
830 | } |
831 | |
832 | pub fn xi_ungrab_device<Conn, A, B>(conn: &Conn, time: A, deviceid: B) -> Result<VoidCookie<'_, Conn>, ConnectionError> |
833 | where |
834 | Conn: RequestConnection + ?Sized, |
835 | A: Into<xproto::Timestamp>, |
836 | B: Into<DeviceId>, |
837 | { |
838 | let time: xproto::Timestamp = time.into(); |
839 | let deviceid: DeviceId = deviceid.into(); |
840 | let request0: XIUngrabDeviceRequest = XIUngrabDeviceRequest { |
841 | time, |
842 | deviceid, |
843 | }; |
844 | let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
845 | let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])]; |
846 | assert_eq!(slices.len(), bytes.len()); |
847 | conn.send_request_without_reply(&slices, fds) |
848 | } |
849 | |
850 | pub fn xi_allow_events<Conn, A, B>(conn: &Conn, time: A, deviceid: B, event_mode: EventMode, touchid: u32, grab_window: xproto::Window) -> Result<VoidCookie<'_, Conn>, ConnectionError> |
851 | where |
852 | Conn: RequestConnection + ?Sized, |
853 | A: Into<xproto::Timestamp>, |
854 | B: Into<DeviceId>, |
855 | { |
856 | let time: xproto::Timestamp = time.into(); |
857 | let deviceid: DeviceId = deviceid.into(); |
858 | let request0: XIAllowEventsRequest = XIAllowEventsRequest { |
859 | time, |
860 | deviceid, |
861 | event_mode, |
862 | touchid, |
863 | grab_window, |
864 | }; |
865 | let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
866 | let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])]; |
867 | assert_eq!(slices.len(), bytes.len()); |
868 | conn.send_request_without_reply(&slices, fds) |
869 | } |
870 | |
871 | pub fn xi_passive_grab_device<'c, 'input, Conn, A, B>(conn: &'c Conn, time: A, grab_window: xproto::Window, cursor: xproto::Cursor, detail: u32, deviceid: B, grab_type: GrabType, grab_mode: GrabMode22, paired_device_mode: xproto::GrabMode, owner_events: GrabOwner, mask: &'input [u32], modifiers: &'input [u32]) -> Result<Cookie<'c, Conn, XIPassiveGrabDeviceReply>, ConnectionError> |
872 | where |
873 | Conn: RequestConnection + ?Sized, |
874 | A: Into<xproto::Timestamp>, |
875 | B: Into<DeviceId>, |
876 | { |
877 | let time: xproto::Timestamp = time.into(); |
878 | let deviceid: DeviceId = deviceid.into(); |
879 | let request0: XIPassiveGrabDeviceRequest<'_> = XIPassiveGrabDeviceRequest { |
880 | time, |
881 | grab_window, |
882 | cursor, |
883 | detail, |
884 | deviceid, |
885 | grab_type, |
886 | grab_mode, |
887 | paired_device_mode, |
888 | owner_events, |
889 | mask: Cow::Borrowed(mask), |
890 | modifiers: Cow::Borrowed(modifiers), |
891 | }; |
892 | let (bytes: [Cow<'_, [u8]>; 4], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
893 | let slices: [IoSlice<'_>; 4] = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2]), IoSlice::new(&bytes[3])]; |
894 | assert_eq!(slices.len(), bytes.len()); |
895 | conn.send_request_with_reply(&slices, fds) |
896 | } |
897 | |
898 | pub fn xi_passive_ungrab_device<'c, 'input, Conn, A>(conn: &'c Conn, grab_window: xproto::Window, detail: u32, deviceid: A, grab_type: GrabType, modifiers: &'input [u32]) -> Result<VoidCookie<'c, Conn>, ConnectionError> |
899 | where |
900 | Conn: RequestConnection + ?Sized, |
901 | A: Into<DeviceId>, |
902 | { |
903 | let deviceid: DeviceId = deviceid.into(); |
904 | let request0: XIPassiveUngrabDeviceRequest<'_> = XIPassiveUngrabDeviceRequest { |
905 | grab_window, |
906 | detail, |
907 | deviceid, |
908 | grab_type, |
909 | modifiers: Cow::Borrowed(modifiers), |
910 | }; |
911 | let (bytes: [Cow<'_, [u8]>; 3], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
912 | let slices: [IoSlice<'_>; 3] = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])]; |
913 | assert_eq!(slices.len(), bytes.len()); |
914 | conn.send_request_without_reply(&slices, fds) |
915 | } |
916 | |
917 | pub fn xi_list_properties<Conn, A>(conn: &Conn, deviceid: A) -> Result<Cookie<'_, Conn, XIListPropertiesReply>, ConnectionError> |
918 | where |
919 | Conn: RequestConnection + ?Sized, |
920 | A: Into<DeviceId>, |
921 | { |
922 | let deviceid: DeviceId = deviceid.into(); |
923 | let request0: XIListPropertiesRequest = XIListPropertiesRequest { |
924 | deviceid, |
925 | }; |
926 | let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
927 | let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])]; |
928 | assert_eq!(slices.len(), bytes.len()); |
929 | conn.send_request_with_reply(&slices, fds) |
930 | } |
931 | |
932 | pub fn xi_change_property<'c, 'input, Conn, A>(conn: &'c Conn, deviceid: A, mode: xproto::PropMode, property: xproto::Atom, type_: xproto::Atom, num_items: u32, items: &'input XIChangePropertyAux) -> Result<VoidCookie<'c, Conn>, ConnectionError> |
933 | where |
934 | Conn: RequestConnection + ?Sized, |
935 | A: Into<DeviceId>, |
936 | { |
937 | let deviceid: DeviceId = deviceid.into(); |
938 | let request0: XIChangePropertyRequest<'_> = XIChangePropertyRequest { |
939 | deviceid, |
940 | mode, |
941 | property, |
942 | type_, |
943 | num_items, |
944 | items: Cow::Borrowed(items), |
945 | }; |
946 | let (bytes: [Cow<'_, [u8]>; 3], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
947 | let slices: [IoSlice<'_>; 3] = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])]; |
948 | assert_eq!(slices.len(), bytes.len()); |
949 | conn.send_request_without_reply(&slices, fds) |
950 | } |
951 | |
952 | pub fn xi_delete_property<Conn, A>(conn: &Conn, deviceid: A, property: xproto::Atom) -> Result<VoidCookie<'_, Conn>, ConnectionError> |
953 | where |
954 | Conn: RequestConnection + ?Sized, |
955 | A: Into<DeviceId>, |
956 | { |
957 | let deviceid: DeviceId = deviceid.into(); |
958 | let request0: XIDeletePropertyRequest = XIDeletePropertyRequest { |
959 | deviceid, |
960 | property, |
961 | }; |
962 | let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
963 | let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])]; |
964 | assert_eq!(slices.len(), bytes.len()); |
965 | conn.send_request_without_reply(&slices, fds) |
966 | } |
967 | |
968 | pub fn xi_get_property<Conn, A>(conn: &Conn, deviceid: A, delete: bool, property: xproto::Atom, type_: xproto::Atom, offset: u32, len: u32) -> Result<Cookie<'_, Conn, XIGetPropertyReply>, ConnectionError> |
969 | where |
970 | Conn: RequestConnection + ?Sized, |
971 | A: Into<DeviceId>, |
972 | { |
973 | let deviceid: DeviceId = deviceid.into(); |
974 | let request0: XIGetPropertyRequest = XIGetPropertyRequest { |
975 | deviceid, |
976 | delete, |
977 | property, |
978 | type_, |
979 | offset, |
980 | len, |
981 | }; |
982 | let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
983 | let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])]; |
984 | assert_eq!(slices.len(), bytes.len()); |
985 | conn.send_request_with_reply(&slices, fds) |
986 | } |
987 | |
988 | pub fn xi_get_selected_events<Conn>(conn: &Conn, window: xproto::Window) -> Result<Cookie<'_, Conn, XIGetSelectedEventsReply>, ConnectionError> |
989 | where |
990 | Conn: RequestConnection + ?Sized, |
991 | { |
992 | let request0: XIGetSelectedEventsRequest = XIGetSelectedEventsRequest { |
993 | window, |
994 | }; |
995 | let (bytes: [Cow<'_, [u8]>; 1], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
996 | let slices: [IoSlice<'_>; 1] = [IoSlice::new(&bytes[0])]; |
997 | assert_eq!(slices.len(), bytes.len()); |
998 | conn.send_request_with_reply(&slices, fds) |
999 | } |
1000 | |
1001 | pub fn xi_barrier_release_pointer<'c, 'input, Conn>(conn: &'c Conn, barriers: &'input [BarrierReleasePointerInfo]) -> Result<VoidCookie<'c, Conn>, ConnectionError> |
1002 | where |
1003 | Conn: RequestConnection + ?Sized, |
1004 | { |
1005 | let request0: XIBarrierReleasePointerRequest<'_> = XIBarrierReleasePointerRequest { |
1006 | barriers: Cow::Borrowed(barriers), |
1007 | }; |
1008 | let (bytes: [Cow<'_, [u8]>; 3], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
1009 | let slices: [IoSlice<'_>; 3] = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2])]; |
1010 | assert_eq!(slices.len(), bytes.len()); |
1011 | conn.send_request_without_reply(&slices, fds) |
1012 | } |
1013 | |
1014 | pub fn send_extension_event<'c, 'input, Conn>(conn: &'c Conn, destination: xproto::Window, device_id: u8, propagate: bool, events: &'input [EventForSend], classes: &'input [EventClass]) -> Result<VoidCookie<'c, Conn>, ConnectionError> |
1015 | where |
1016 | Conn: RequestConnection + ?Sized, |
1017 | { |
1018 | let request0: SendExtensionEventRequest<'_> = SendExtensionEventRequest { |
1019 | destination, |
1020 | device_id, |
1021 | propagate, |
1022 | events: Cow::Borrowed(events), |
1023 | classes: Cow::Borrowed(classes), |
1024 | }; |
1025 | let (bytes: [Cow<'_, [u8]>; 4], fds: Vec) = request0.serialize(major_opcode:major_opcode(conn)?); |
1026 | let slices: [IoSlice<'_>; 4] = [IoSlice::new(&bytes[0]), IoSlice::new(&bytes[1]), IoSlice::new(&bytes[2]), IoSlice::new(&bytes[3])]; |
1027 | assert_eq!(slices.len(), bytes.len()); |
1028 | conn.send_request_without_reply(&slices, fds) |
1029 | } |
1030 | |
1031 | /// Extension trait defining the requests of this extension. |
1032 | pub trait ConnectionExt: RequestConnection { |
1033 | fn xinput_get_extension_version<'c, 'input>(&'c self, name: &'input [u8]) -> Result<Cookie<'c, Self, GetExtensionVersionReply>, ConnectionError> |
1034 | { |
1035 | get_extension_version(self, name) |
1036 | } |
1037 | fn xinput_list_input_devices(&self) -> Result<Cookie<'_, Self, ListInputDevicesReply>, ConnectionError> |
1038 | { |
1039 | list_input_devices(self) |
1040 | } |
1041 | fn xinput_open_device(&self, device_id: u8) -> Result<Cookie<'_, Self, OpenDeviceReply>, ConnectionError> |
1042 | { |
1043 | open_device(self, device_id) |
1044 | } |
1045 | fn xinput_close_device(&self, device_id: u8) -> Result<VoidCookie<'_, Self>, ConnectionError> |
1046 | { |
1047 | close_device(self, device_id) |
1048 | } |
1049 | fn xinput_set_device_mode(&self, device_id: u8, mode: ValuatorMode) -> Result<Cookie<'_, Self, SetDeviceModeReply>, ConnectionError> |
1050 | { |
1051 | set_device_mode(self, device_id, mode) |
1052 | } |
1053 | fn xinput_select_extension_event<'c, 'input>(&'c self, window: xproto::Window, classes: &'input [EventClass]) -> Result<VoidCookie<'c, Self>, ConnectionError> |
1054 | { |
1055 | select_extension_event(self, window, classes) |
1056 | } |
1057 | fn xinput_get_selected_extension_events(&self, window: xproto::Window) -> Result<Cookie<'_, Self, GetSelectedExtensionEventsReply>, ConnectionError> |
1058 | { |
1059 | get_selected_extension_events(self, window) |
1060 | } |
1061 | fn xinput_change_device_dont_propagate_list<'c, 'input>(&'c self, window: xproto::Window, mode: PropagateMode, classes: &'input [EventClass]) -> Result<VoidCookie<'c, Self>, ConnectionError> |
1062 | { |
1063 | change_device_dont_propagate_list(self, window, mode, classes) |
1064 | } |
1065 | fn xinput_get_device_dont_propagate_list(&self, window: xproto::Window) -> Result<Cookie<'_, Self, GetDeviceDontPropagateListReply>, ConnectionError> |
1066 | { |
1067 | get_device_dont_propagate_list(self, window) |
1068 | } |
1069 | fn xinput_get_device_motion_events<A>(&self, start: xproto::Timestamp, stop: A, device_id: u8) -> Result<Cookie<'_, Self, GetDeviceMotionEventsReply>, ConnectionError> |
1070 | where |
1071 | A: Into<xproto::Timestamp>, |
1072 | { |
1073 | get_device_motion_events(self, start, stop, device_id) |
1074 | } |
1075 | fn xinput_change_keyboard_device(&self, device_id: u8) -> Result<Cookie<'_, Self, ChangeKeyboardDeviceReply>, ConnectionError> |
1076 | { |
1077 | change_keyboard_device(self, device_id) |
1078 | } |
1079 | fn xinput_change_pointer_device(&self, x_axis: u8, y_axis: u8, device_id: u8) -> Result<Cookie<'_, Self, ChangePointerDeviceReply>, ConnectionError> |
1080 | { |
1081 | change_pointer_device(self, x_axis, y_axis, device_id) |
1082 | } |
1083 | fn xinput_grab_device<'c, 'input, A>(&'c self, grab_window: xproto::Window, time: A, this_device_mode: xproto::GrabMode, other_device_mode: xproto::GrabMode, owner_events: bool, device_id: u8, classes: &'input [EventClass]) -> Result<Cookie<'c, Self, GrabDeviceReply>, ConnectionError> |
1084 | where |
1085 | A: Into<xproto::Timestamp>, |
1086 | { |
1087 | grab_device(self, grab_window, time, this_device_mode, other_device_mode, owner_events, device_id, classes) |
1088 | } |
1089 | fn xinput_ungrab_device<A>(&self, time: A, device_id: u8) -> Result<VoidCookie<'_, Self>, ConnectionError> |
1090 | where |
1091 | A: Into<xproto::Timestamp>, |
1092 | { |
1093 | ungrab_device(self, time, device_id) |
1094 | } |
1095 | fn xinput_grab_device_key<'c, 'input, A, B>(&'c self, grab_window: xproto::Window, modifiers: xproto::ModMask, modifier_device: A, grabbed_device: u8, key: B, this_device_mode: xproto::GrabMode, other_device_mode: xproto::GrabMode, owner_events: bool, classes: &'input [EventClass]) -> Result<VoidCookie<'c, Self>, ConnectionError> |
1096 | where |
1097 | A: Into<u8>, |
1098 | B: Into<u8>, |
1099 | { |
1100 | grab_device_key(self, grab_window, modifiers, modifier_device, grabbed_device, key, this_device_mode, other_device_mode, owner_events, classes) |
1101 | } |
1102 | fn xinput_ungrab_device_key<A, B>(&self, grab_window: xproto::Window, modifiers: xproto::ModMask, modifier_device: A, key: B, grabbed_device: u8) -> Result<VoidCookie<'_, Self>, ConnectionError> |
1103 | where |
1104 | A: Into<u8>, |
1105 | B: Into<u8>, |
1106 | { |
1107 | ungrab_device_key(self, grab_window, modifiers, modifier_device, key, grabbed_device) |
1108 | } |
1109 | fn xinput_grab_device_button<'c, 'input, A, B>(&'c self, grab_window: xproto::Window, grabbed_device: u8, modifier_device: A, modifiers: xproto::ModMask, this_device_mode: xproto::GrabMode, other_device_mode: xproto::GrabMode, button: B, owner_events: bool, classes: &'input [EventClass]) -> Result<VoidCookie<'c, Self>, ConnectionError> |
1110 | where |
1111 | A: Into<u8>, |
1112 | B: Into<u8>, |
1113 | { |
1114 | grab_device_button(self, grab_window, grabbed_device, modifier_device, modifiers, this_device_mode, other_device_mode, button, owner_events, classes) |
1115 | } |
1116 | fn xinput_ungrab_device_button<A, B>(&self, grab_window: xproto::Window, modifiers: xproto::ModMask, modifier_device: A, button: B, grabbed_device: u8) -> Result<VoidCookie<'_, Self>, ConnectionError> |
1117 | where |
1118 | A: Into<u8>, |
1119 | B: Into<u8>, |
1120 | { |
1121 | ungrab_device_button(self, grab_window, modifiers, modifier_device, button, grabbed_device) |
1122 | } |
1123 | fn xinput_allow_device_events<A>(&self, time: A, mode: DeviceInputMode, device_id: u8) -> Result<VoidCookie<'_, Self>, ConnectionError> |
1124 | where |
1125 | A: Into<xproto::Timestamp>, |
1126 | { |
1127 | allow_device_events(self, time, mode, device_id) |
1128 | } |
1129 | fn xinput_get_device_focus(&self, device_id: u8) -> Result<Cookie<'_, Self, GetDeviceFocusReply>, ConnectionError> |
1130 | { |
1131 | get_device_focus(self, device_id) |
1132 | } |
1133 | fn xinput_set_device_focus<A, B>(&self, focus: A, time: B, revert_to: xproto::InputFocus, device_id: u8) -> Result<VoidCookie<'_, Self>, ConnectionError> |
1134 | where |
1135 | A: Into<xproto::Window>, |
1136 | B: Into<xproto::Timestamp>, |
1137 | { |
1138 | set_device_focus(self, focus, time, revert_to, device_id) |
1139 | } |
1140 | fn xinput_get_feedback_control(&self, device_id: u8) -> Result<Cookie<'_, Self, GetFeedbackControlReply>, ConnectionError> |
1141 | { |
1142 | get_feedback_control(self, device_id) |
1143 | } |
1144 | fn xinput_change_feedback_control(&self, mask: ChangeFeedbackControlMask, device_id: u8, feedback_id: u8, feedback: FeedbackCtl) -> Result<VoidCookie<'_, Self>, ConnectionError> |
1145 | { |
1146 | change_feedback_control(self, mask, device_id, feedback_id, feedback) |
1147 | } |
1148 | fn xinput_get_device_key_mapping(&self, device_id: u8, first_keycode: KeyCode, count: u8) -> Result<Cookie<'_, Self, GetDeviceKeyMappingReply>, ConnectionError> |
1149 | { |
1150 | get_device_key_mapping(self, device_id, first_keycode, count) |
1151 | } |
1152 | fn xinput_change_device_key_mapping<'c, 'input>(&'c self, device_id: u8, first_keycode: KeyCode, keysyms_per_keycode: u8, keycode_count: u8, keysyms: &'input [xproto::Keysym]) -> Result<VoidCookie<'c, Self>, ConnectionError> |
1153 | { |
1154 | change_device_key_mapping(self, device_id, first_keycode, keysyms_per_keycode, keycode_count, keysyms) |
1155 | } |
1156 | fn xinput_get_device_modifier_mapping(&self, device_id: u8) -> Result<Cookie<'_, Self, GetDeviceModifierMappingReply>, ConnectionError> |
1157 | { |
1158 | get_device_modifier_mapping(self, device_id) |
1159 | } |
1160 | fn xinput_set_device_modifier_mapping<'c, 'input>(&'c self, device_id: u8, keymaps: &'input [u8]) -> Result<Cookie<'c, Self, SetDeviceModifierMappingReply>, ConnectionError> |
1161 | { |
1162 | set_device_modifier_mapping(self, device_id, keymaps) |
1163 | } |
1164 | fn xinput_get_device_button_mapping(&self, device_id: u8) -> Result<Cookie<'_, Self, GetDeviceButtonMappingReply>, ConnectionError> |
1165 | { |
1166 | get_device_button_mapping(self, device_id) |
1167 | } |
1168 | fn xinput_set_device_button_mapping<'c, 'input>(&'c self, device_id: u8, map: &'input [u8]) -> Result<Cookie<'c, Self, SetDeviceButtonMappingReply>, ConnectionError> |
1169 | { |
1170 | set_device_button_mapping(self, device_id, map) |
1171 | } |
1172 | fn xinput_query_device_state(&self, device_id: u8) -> Result<Cookie<'_, Self, QueryDeviceStateReply>, ConnectionError> |
1173 | { |
1174 | query_device_state(self, device_id) |
1175 | } |
1176 | fn xinput_device_bell(&self, device_id: u8, feedback_id: u8, feedback_class: u8, percent: i8) -> Result<VoidCookie<'_, Self>, ConnectionError> |
1177 | { |
1178 | device_bell(self, device_id, feedback_id, feedback_class, percent) |
1179 | } |
1180 | fn xinput_set_device_valuators<'c, 'input>(&'c self, device_id: u8, first_valuator: u8, valuators: &'input [i32]) -> Result<Cookie<'c, Self, SetDeviceValuatorsReply>, ConnectionError> |
1181 | { |
1182 | set_device_valuators(self, device_id, first_valuator, valuators) |
1183 | } |
1184 | fn xinput_get_device_control(&self, control_id: DeviceControl, device_id: u8) -> Result<Cookie<'_, Self, GetDeviceControlReply>, ConnectionError> |
1185 | { |
1186 | get_device_control(self, control_id, device_id) |
1187 | } |
1188 | fn xinput_change_device_control(&self, control_id: DeviceControl, device_id: u8, control: DeviceCtl) -> Result<Cookie<'_, Self, ChangeDeviceControlReply>, ConnectionError> |
1189 | { |
1190 | change_device_control(self, control_id, device_id, control) |
1191 | } |
1192 | fn xinput_list_device_properties(&self, device_id: u8) -> Result<Cookie<'_, Self, ListDevicePropertiesReply>, ConnectionError> |
1193 | { |
1194 | list_device_properties(self, device_id) |
1195 | } |
1196 | fn xinput_change_device_property<'c, 'input>(&'c self, property: xproto::Atom, type_: xproto::Atom, device_id: u8, mode: xproto::PropMode, num_items: u32, items: &'input ChangeDevicePropertyAux) -> Result<VoidCookie<'c, Self>, ConnectionError> |
1197 | { |
1198 | change_device_property(self, property, type_, device_id, mode, num_items, items) |
1199 | } |
1200 | fn xinput_delete_device_property(&self, property: xproto::Atom, device_id: u8) -> Result<VoidCookie<'_, Self>, ConnectionError> |
1201 | { |
1202 | delete_device_property(self, property, device_id) |
1203 | } |
1204 | fn xinput_get_device_property(&self, property: xproto::Atom, type_: xproto::Atom, offset: u32, len: u32, device_id: u8, delete: bool) -> Result<Cookie<'_, Self, GetDevicePropertyReply>, ConnectionError> |
1205 | { |
1206 | get_device_property(self, property, type_, offset, len, device_id, delete) |
1207 | } |
1208 | fn xinput_xi_query_pointer<A>(&self, window: xproto::Window, deviceid: A) -> Result<Cookie<'_, Self, XIQueryPointerReply>, ConnectionError> |
1209 | where |
1210 | A: Into<DeviceId>, |
1211 | { |
1212 | xi_query_pointer(self, window, deviceid) |
1213 | } |
1214 | fn xinput_xi_warp_pointer<A>(&self, src_win: xproto::Window, dst_win: xproto::Window, src_x: Fp1616, src_y: Fp1616, src_width: u16, src_height: u16, dst_x: Fp1616, dst_y: Fp1616, deviceid: A) -> Result<VoidCookie<'_, Self>, ConnectionError> |
1215 | where |
1216 | A: Into<DeviceId>, |
1217 | { |
1218 | xi_warp_pointer(self, src_win, dst_win, src_x, src_y, src_width, src_height, dst_x, dst_y, deviceid) |
1219 | } |
1220 | fn xinput_xi_change_cursor<A>(&self, window: xproto::Window, cursor: xproto::Cursor, deviceid: A) -> Result<VoidCookie<'_, Self>, ConnectionError> |
1221 | where |
1222 | A: Into<DeviceId>, |
1223 | { |
1224 | xi_change_cursor(self, window, cursor, deviceid) |
1225 | } |
1226 | fn xinput_xi_change_hierarchy<'c, 'input>(&'c self, changes: &'input [HierarchyChange]) -> Result<VoidCookie<'c, Self>, ConnectionError> |
1227 | { |
1228 | xi_change_hierarchy(self, changes) |
1229 | } |
1230 | fn xinput_xi_set_client_pointer<A>(&self, window: xproto::Window, deviceid: A) -> Result<VoidCookie<'_, Self>, ConnectionError> |
1231 | where |
1232 | A: Into<DeviceId>, |
1233 | { |
1234 | xi_set_client_pointer(self, window, deviceid) |
1235 | } |
1236 | fn xinput_xi_get_client_pointer(&self, window: xproto::Window) -> Result<Cookie<'_, Self, XIGetClientPointerReply>, ConnectionError> |
1237 | { |
1238 | xi_get_client_pointer(self, window) |
1239 | } |
1240 | fn xinput_xi_select_events<'c, 'input>(&'c self, window: xproto::Window, masks: &'input [EventMask]) -> Result<VoidCookie<'c, Self>, ConnectionError> |
1241 | { |
1242 | xi_select_events(self, window, masks) |
1243 | } |
1244 | fn xinput_xi_query_version(&self, major_version: u16, minor_version: u16) -> Result<Cookie<'_, Self, XIQueryVersionReply>, ConnectionError> |
1245 | { |
1246 | xi_query_version(self, major_version, minor_version) |
1247 | } |
1248 | fn xinput_xi_query_device<A>(&self, deviceid: A) -> Result<Cookie<'_, Self, XIQueryDeviceReply>, ConnectionError> |
1249 | where |
1250 | A: Into<DeviceId>, |
1251 | { |
1252 | xi_query_device(self, deviceid) |
1253 | } |
1254 | fn xinput_xi_set_focus<A, B>(&self, window: xproto::Window, time: A, deviceid: B) -> Result<VoidCookie<'_, Self>, ConnectionError> |
1255 | where |
1256 | A: Into<xproto::Timestamp>, |
1257 | B: Into<DeviceId>, |
1258 | { |
1259 | xi_set_focus(self, window, time, deviceid) |
1260 | } |
1261 | fn xinput_xi_get_focus<A>(&self, deviceid: A) -> Result<Cookie<'_, Self, XIGetFocusReply>, ConnectionError> |
1262 | where |
1263 | A: Into<DeviceId>, |
1264 | { |
1265 | xi_get_focus(self, deviceid) |
1266 | } |
1267 | fn xinput_xi_grab_device<'c, 'input, A, B>(&'c self, window: xproto::Window, time: A, cursor: xproto::Cursor, deviceid: B, mode: xproto::GrabMode, paired_device_mode: xproto::GrabMode, owner_events: GrabOwner, mask: &'input [u32]) -> Result<Cookie<'c, Self, XIGrabDeviceReply>, ConnectionError> |
1268 | where |
1269 | A: Into<xproto::Timestamp>, |
1270 | B: Into<DeviceId>, |
1271 | { |
1272 | xi_grab_device(self, window, time, cursor, deviceid, mode, paired_device_mode, owner_events, mask) |
1273 | } |
1274 | fn xinput_xi_ungrab_device<A, B>(&self, time: A, deviceid: B) -> Result<VoidCookie<'_, Self>, ConnectionError> |
1275 | where |
1276 | A: Into<xproto::Timestamp>, |
1277 | B: Into<DeviceId>, |
1278 | { |
1279 | xi_ungrab_device(self, time, deviceid) |
1280 | } |
1281 | fn xinput_xi_allow_events<A, B>(&self, time: A, deviceid: B, event_mode: EventMode, touchid: u32, grab_window: xproto::Window) -> Result<VoidCookie<'_, Self>, ConnectionError> |
1282 | where |
1283 | A: Into<xproto::Timestamp>, |
1284 | B: Into<DeviceId>, |
1285 | { |
1286 | xi_allow_events(self, time, deviceid, event_mode, touchid, grab_window) |
1287 | } |
1288 | fn xinput_xi_passive_grab_device<'c, 'input, A, B>(&'c self, time: A, grab_window: xproto::Window, cursor: xproto::Cursor, detail: u32, deviceid: B, grab_type: GrabType, grab_mode: GrabMode22, paired_device_mode: xproto::GrabMode, owner_events: GrabOwner, mask: &'input [u32], modifiers: &'input [u32]) -> Result<Cookie<'c, Self, XIPassiveGrabDeviceReply>, ConnectionError> |
1289 | where |
1290 | A: Into<xproto::Timestamp>, |
1291 | B: Into<DeviceId>, |
1292 | { |
1293 | xi_passive_grab_device(self, time, grab_window, cursor, detail, deviceid, grab_type, grab_mode, paired_device_mode, owner_events, mask, modifiers) |
1294 | } |
1295 | fn xinput_xi_passive_ungrab_device<'c, 'input, A>(&'c self, grab_window: xproto::Window, detail: u32, deviceid: A, grab_type: GrabType, modifiers: &'input [u32]) -> Result<VoidCookie<'c, Self>, ConnectionError> |
1296 | where |
1297 | A: Into<DeviceId>, |
1298 | { |
1299 | xi_passive_ungrab_device(self, grab_window, detail, deviceid, grab_type, modifiers) |
1300 | } |
1301 | fn xinput_xi_list_properties<A>(&self, deviceid: A) -> Result<Cookie<'_, Self, XIListPropertiesReply>, ConnectionError> |
1302 | where |
1303 | A: Into<DeviceId>, |
1304 | { |
1305 | xi_list_properties(self, deviceid) |
1306 | } |
1307 | fn xinput_xi_change_property<'c, 'input, A>(&'c self, deviceid: A, mode: xproto::PropMode, property: xproto::Atom, type_: xproto::Atom, num_items: u32, items: &'input XIChangePropertyAux) -> Result<VoidCookie<'c, Self>, ConnectionError> |
1308 | where |
1309 | A: Into<DeviceId>, |
1310 | { |
1311 | xi_change_property(self, deviceid, mode, property, type_, num_items, items) |
1312 | } |
1313 | fn xinput_xi_delete_property<A>(&self, deviceid: A, property: xproto::Atom) -> Result<VoidCookie<'_, Self>, ConnectionError> |
1314 | where |
1315 | A: Into<DeviceId>, |
1316 | { |
1317 | xi_delete_property(self, deviceid, property) |
1318 | } |
1319 | fn xinput_xi_get_property<A>(&self, deviceid: A, delete: bool, property: xproto::Atom, type_: xproto::Atom, offset: u32, len: u32) -> Result<Cookie<'_, Self, XIGetPropertyReply>, ConnectionError> |
1320 | where |
1321 | A: Into<DeviceId>, |
1322 | { |
1323 | xi_get_property(self, deviceid, delete, property, type_, offset, len) |
1324 | } |
1325 | fn xinput_xi_get_selected_events(&self, window: xproto::Window) -> Result<Cookie<'_, Self, XIGetSelectedEventsReply>, ConnectionError> |
1326 | { |
1327 | xi_get_selected_events(self, window) |
1328 | } |
1329 | fn xinput_xi_barrier_release_pointer<'c, 'input>(&'c self, barriers: &'input [BarrierReleasePointerInfo]) -> Result<VoidCookie<'c, Self>, ConnectionError> |
1330 | { |
1331 | xi_barrier_release_pointer(self, barriers) |
1332 | } |
1333 | fn xinput_send_extension_event<'c, 'input>(&'c self, destination: xproto::Window, device_id: u8, propagate: bool, events: &'input [EventForSend], classes: &'input [EventClass]) -> Result<VoidCookie<'c, Self>, ConnectionError> |
1334 | { |
1335 | send_extension_event(self, destination, device_id, propagate, events, classes) |
1336 | } |
1337 | } |
1338 | |
1339 | impl<C: RequestConnection + ?Sized> ConnectionExt for C {} |
1340 | |