x11_dl/
xinput2.rs

1use super::xfixes::PointerBarrier;
2use super::xlib::{Atom, Display, Time, Window};
3use std::os::raw::{c_double, c_int, c_long, c_uchar, c_uint, c_ulong};
4
5//
6// macro translations
7//
8fn mask_byte(mask_flag: i32) -> usize {
9    (mask_flag >> 3) as usize
10}
11
12pub fn XISetMask(mask: &mut [::std::os::raw::c_uchar], event: i32) {
13    mask[mask_byte(event)] |= 1 << (event & 7);
14}
15
16pub fn XIClearMask(mask: &mut [::std::os::raw::c_uchar], event: i32) {
17    mask[mask_byte(event)] &= 1 << (event & 7);
18}
19
20pub fn XIMaskIsSet(mask: &[::std::os::raw::c_uchar], event: i32) -> bool {
21    (mask[mask_byte(event)] & (1 << (event & 7))) != 0
22}
23
24//
25// functions
26//
27x11_link! { XInput2, xi, ["libXi.so.6", "libXi.so"], 34,
28  pub fn XIAllowEvents (_4: *mut Display, _3: c_int, _2: c_int, _1: c_ulong) -> c_int,
29  pub fn XIAllowTouchEvents (_5: *mut Display, _4: c_int, _3: c_uint, _2: c_ulong, _1: c_int) -> c_int,
30  pub fn XIBarrierReleasePointer (_4: *mut Display, _3: c_int, _2: c_ulong, _1: c_uint) -> (),
31  pub fn XIBarrierReleasePointers (_3: *mut Display, _2: *mut XIBarrierReleasePointerInfo, _1: c_int) -> (),
32  pub fn XIChangeHierarchy (_3: *mut Display, _2: *mut XIAnyHierarchyChangeInfo, _1: c_int) -> c_int,
33  pub fn XIChangeProperty (_8: *mut Display, _7: c_int, _6: c_ulong, _5: c_ulong, _4: c_int, _3: c_int, _2: *mut c_uchar, _1: c_int) -> (),
34  pub fn XIDefineCursor (_4: *mut Display, _3: c_int, _2: c_ulong, _1: c_ulong) -> c_int,
35  pub fn XIDeleteProperty (_3: *mut Display, _2: c_int, _1: c_ulong) -> (),
36  pub fn XIFreeDeviceInfo (_1: *mut XIDeviceInfo) -> (),
37  pub fn XIGetClientPointer (_3: *mut Display, _2: c_ulong, _1: *mut c_int) -> c_int,
38  pub fn XIGetFocus (_3: *mut Display, _2: c_int, _1: *mut c_ulong) -> c_int,
39  pub fn XIGetProperty (_12: *mut Display, _11: c_int, _10: c_ulong, _9: c_long, _8: c_long, _7: c_int, _6: c_ulong, _5: *mut c_ulong, _4: *mut c_int, _3: *mut c_ulong, _2: *mut c_ulong, _1: *mut *mut c_uchar) -> c_int,
40  pub fn XIGetSelectedEvents (_3: *mut Display, _2: c_ulong, _1: *mut c_int) -> *mut XIEventMask,
41  pub fn XIGrabButton (_11: *mut Display, _10: c_int, _9: c_int, _8: c_ulong, _7: c_ulong, _6: c_int, _5: c_int, _4: c_int, _3: *mut XIEventMask, _2: c_int, _1: *mut XIGrabModifiers) -> c_int,
42  pub fn XIGrabDevice (_9: *mut Display, _8: c_int, _7: c_ulong, _6: c_ulong, _5: c_ulong, _4: c_int, _3: c_int, _2: c_int, _1: *mut XIEventMask) -> c_int,
43  pub fn XIGrabEnter (_10: *mut Display, _9: c_int, _8: c_ulong, _7: c_ulong, _6: c_int, _5: c_int, _4: c_int, _3: *mut XIEventMask, _2: c_int, _1: *mut XIGrabModifiers) -> c_int,
44  pub fn XIGrabFocusIn (_9: *mut Display, _8: c_int, _7: c_ulong, _6: c_int, _5: c_int, _4: c_int, _3: *mut XIEventMask, _2: c_int, _1: *mut XIGrabModifiers) -> c_int,
45  pub fn XIGrabKeycode (_10: *mut Display, _9: c_int, _8: c_int, _7: c_ulong, _6: c_int, _5: c_int, _4: c_int, _3: *mut XIEventMask, _2: c_int, _1: *mut XIGrabModifiers) -> c_int,
46  pub fn XIGrabTouchBegin (_7: *mut Display, _6: c_int, _5: c_ulong, _4: c_int, _3: *mut XIEventMask, _2: c_int, _1: *mut XIGrabModifiers) -> c_int,
47  pub fn XIListProperties (_3: *mut Display, _2: c_int, _1: *mut c_int) -> *mut c_ulong,
48  pub fn XIQueryDevice (_3: *mut Display, _2: c_int, _1: *mut c_int) -> *mut XIDeviceInfo,
49  pub fn XIQueryPointer (_12: *mut Display, _11: c_int, _10: c_ulong, _9: *mut c_ulong, _8: *mut c_ulong, _7: *mut c_double, _6: *mut c_double, _5: *mut c_double, _4: *mut c_double, _3: *mut XIButtonState, _2: *mut XIModifierState, _1: *mut XIModifierState) -> c_int,
50  pub fn XIQueryVersion (_3: *mut Display, _2: *mut c_int, _1: *mut c_int) -> c_int,
51  pub fn XISelectEvents (_4: *mut Display, _3: c_ulong, _2: *mut XIEventMask, _1: c_int) -> c_int,
52  pub fn XISetClientPointer (_3: *mut Display, _2: c_ulong, _1: c_int) -> c_int,
53  pub fn XISetFocus (_4: *mut Display, _3: c_int, _2: c_ulong, _1: c_ulong) -> c_int,
54  pub fn XIUndefineCursor (_3: *mut Display, _2: c_int, _1: c_ulong) -> c_int,
55  pub fn XIUngrabButton (_6: *mut Display, _5: c_int, _4: c_int, _3: c_ulong, _2: c_int, _1: *mut XIGrabModifiers) -> c_int,
56  pub fn XIUngrabDevice (_3: *mut Display, _2: c_int, _1: c_ulong) -> c_int,
57  pub fn XIUngrabEnter (_5: *mut Display, _4: c_int, _3: c_ulong, _2: c_int, _1: *mut XIGrabModifiers) -> c_int,
58  pub fn XIUngrabFocusIn (_5: *mut Display, _4: c_int, _3: c_ulong, _2: c_int, _1: *mut XIGrabModifiers) -> c_int,
59  pub fn XIUngrabKeycode (_6: *mut Display, _5: c_int, _4: c_int, _3: c_ulong, _2: c_int, _1: *mut XIGrabModifiers) -> c_int,
60  pub fn XIUngrabTouchBegin (_5: *mut Display, _4: c_int, _3: c_ulong, _2: c_int, _1: *mut XIGrabModifiers) -> c_int,
61  pub fn XIWarpPointer (_10: *mut Display, _9: c_int, _8: c_ulong, _7: c_ulong, _6: c_double, _5: c_double, _4: c_uint, _3: c_uint, _2: c_double, _1: c_double) -> c_int,
62variadic:
63globals:
64}
65
66//
67// constants
68// (auto-generated with cmacros)
69//
70
71pub const XInput_2_0: i32 = 7;
72pub const XI_2_Major: i32 = 2;
73pub const XI_2_Minor: i32 = 3;
74pub const XIPropertyDeleted: i32 = 0;
75pub const XIPropertyCreated: i32 = 1;
76pub const XIPropertyModified: i32 = 2;
77pub const XIPropModeReplace: i32 = 0;
78pub const XIPropModePrepend: i32 = 1;
79pub const XIPropModeAppend: i32 = 2;
80pub const XINotifyNormal: i32 = 0;
81pub const XINotifyGrab: i32 = 1;
82pub const XINotifyUngrab: i32 = 2;
83pub const XINotifyWhileGrabbed: i32 = 3;
84pub const XINotifyPassiveGrab: i32 = 4;
85pub const XINotifyPassiveUngrab: i32 = 5;
86pub const XINotifyAncestor: i32 = 0;
87pub const XINotifyVirtual: i32 = 1;
88pub const XINotifyInferior: i32 = 2;
89pub const XINotifyNonlinear: i32 = 3;
90pub const XINotifyNonlinearVirtual: i32 = 4;
91pub const XINotifyPointer: i32 = 5;
92pub const XINotifyPointerRoot: i32 = 6;
93pub const XINotifyDetailNone: i32 = 7;
94pub const XIGrabModeSync: i32 = 0;
95pub const XIGrabModeAsync: i32 = 1;
96pub const XIGrabModeTouch: i32 = 2;
97pub const XIGrabSuccess: i32 = 0;
98pub const XIAlreadyGrabbed: i32 = 1;
99pub const XIGrabInvalidTime: i32 = 2;
100pub const XIGrabNotViewable: i32 = 3;
101pub const XIGrabFrozen: i32 = 4;
102pub const XIGrabtypeButton: i32 = 0;
103pub const XIGrabtypeKeycode: i32 = 1;
104pub const XIGrabtypeEnter: i32 = 2;
105pub const XIGrabtypeFocusIn: i32 = 3;
106pub const XIGrabtypeTouchBegin: i32 = 4;
107pub const XIAnyButton: i32 = 0;
108pub const XIAnyKeycode: i32 = 0;
109pub const XIAsyncDevice: i32 = 0;
110pub const XISyncDevice: i32 = 1;
111pub const XIReplayDevice: i32 = 2;
112pub const XIAsyncPairedDevice: i32 = 3;
113pub const XIAsyncPair: i32 = 4;
114pub const XISyncPair: i32 = 5;
115pub const XIAcceptTouch: i32 = 6;
116pub const XIRejectTouch: i32 = 7;
117pub const XISlaveSwitch: i32 = 1;
118pub const XIDeviceChange: i32 = 2;
119pub const XIMasterAdded: i32 = 1 << 0;
120pub const XIMasterRemoved: i32 = 1 << 1;
121pub const XISlaveAdded: i32 = 1 << 2;
122pub const XISlaveRemoved: i32 = 1 << 3;
123pub const XISlaveAttached: i32 = 1 << 4;
124pub const XISlaveDetached: i32 = 1 << 5;
125pub const XIDeviceEnabled: i32 = 1 << 6;
126pub const XIDeviceDisabled: i32 = 1 << 7;
127pub const XIAddMaster: i32 = 1;
128pub const XIRemoveMaster: i32 = 2;
129pub const XIAttachSlave: i32 = 3;
130pub const XIDetachSlave: i32 = 4;
131pub const XIAttachToMaster: i32 = 1;
132pub const XIFloating: i32 = 2;
133pub const XIModeRelative: i32 = 0;
134pub const XIModeAbsolute: i32 = 1;
135pub const XIMasterPointer: i32 = 1;
136pub const XIMasterKeyboard: i32 = 2;
137pub const XISlavePointer: i32 = 3;
138pub const XISlaveKeyboard: i32 = 4;
139pub const XIFloatingSlave: i32 = 5;
140pub const XIKeyClass: i32 = 0;
141pub const XIButtonClass: i32 = 1;
142pub const XIValuatorClass: i32 = 2;
143pub const XIScrollClass: i32 = 3;
144pub const XITouchClass: i32 = 8;
145pub const XIScrollTypeVertical: i32 = 1;
146pub const XIScrollTypeHorizontal: i32 = 2;
147pub const XIScrollFlagNoEmulation: i32 = 1 << 0;
148pub const XIScrollFlagPreferred: i32 = 1 << 1;
149pub const XIKeyRepeat: i32 = 1 << 16;
150pub const XIPointerEmulated: i32 = 1 << 16;
151pub const XITouchPendingEnd: i32 = 1 << 16;
152pub const XITouchEmulatingPointer: i32 = 1 << 17;
153pub const XIBarrierPointerReleased: i32 = 1 << 0;
154pub const XIBarrierDeviceIsGrabbed: i32 = 1 << 1;
155pub const XIDirectTouch: i32 = 1;
156pub const XIDependentTouch: i32 = 2;
157pub const XIAllDevices: i32 = 0;
158pub const XIAllMasterDevices: i32 = 1;
159pub const XI_DeviceChanged: i32 = 1;
160pub const XI_KeyPress: i32 = 2;
161pub const XI_KeyRelease: i32 = 3;
162pub const XI_ButtonPress: i32 = 4;
163pub const XI_ButtonRelease: i32 = 5;
164pub const XI_Motion: i32 = 6;
165pub const XI_Enter: i32 = 7;
166pub const XI_Leave: i32 = 8;
167pub const XI_FocusIn: i32 = 9;
168pub const XI_FocusOut: i32 = 10;
169pub const XI_HierarchyChanged: i32 = 11;
170pub const XI_PropertyEvent: i32 = 12;
171pub const XI_RawKeyPress: i32 = 13;
172pub const XI_RawKeyRelease: i32 = 14;
173pub const XI_RawButtonPress: i32 = 15;
174pub const XI_RawButtonRelease: i32 = 16;
175pub const XI_RawMotion: i32 = 17;
176pub const XI_TouchBegin: i32 = 18 /* XI 2.2 */;
177pub const XI_TouchUpdate: i32 = 19;
178pub const XI_TouchEnd: i32 = 20;
179pub const XI_TouchOwnership: i32 = 21;
180pub const XI_RawTouchBegin: i32 = 22;
181pub const XI_RawTouchUpdate: i32 = 23;
182pub const XI_RawTouchEnd: i32 = 24;
183pub const XI_BarrierHit: i32 = 25 /* XI 2.3 */;
184pub const XI_BarrierLeave: i32 = 26;
185pub const XI_LASTEVENT: i32 = XI_BarrierLeave;
186pub const XI_DeviceChangedMask: i32 = 1 << XI_DeviceChanged;
187pub const XI_KeyPressMask: i32 = 1 << XI_KeyPress;
188pub const XI_KeyReleaseMask: i32 = 1 << XI_KeyRelease;
189pub const XI_ButtonPressMask: i32 = 1 << XI_ButtonPress;
190pub const XI_ButtonReleaseMask: i32 = 1 << XI_ButtonRelease;
191pub const XI_MotionMask: i32 = 1 << XI_Motion;
192pub const XI_EnterMask: i32 = 1 << XI_Enter;
193pub const XI_LeaveMask: i32 = 1 << XI_Leave;
194pub const XI_FocusInMask: i32 = 1 << XI_FocusIn;
195pub const XI_FocusOutMask: i32 = 1 << XI_FocusOut;
196pub const XI_HierarchyChangedMask: i32 = 1 << XI_HierarchyChanged;
197pub const XI_PropertyEventMask: i32 = 1 << XI_PropertyEvent;
198pub const XI_RawKeyPressMask: i32 = 1 << XI_RawKeyPress;
199pub const XI_RawKeyReleaseMask: i32 = 1 << XI_RawKeyRelease;
200pub const XI_RawButtonPressMask: i32 = 1 << XI_RawButtonPress;
201pub const XI_RawButtonReleaseMask: i32 = 1 << XI_RawButtonRelease;
202pub const XI_RawMotionMask: i32 = 1 << XI_RawMotion;
203pub const XI_TouchBeginMask: i32 = 1 << XI_TouchBegin;
204pub const XI_TouchEndMask: i32 = 1 << XI_TouchEnd;
205pub const XI_TouchOwnershipChangedMask: i32 = 1 << XI_TouchOwnership;
206pub const XI_TouchUpdateMask: i32 = 1 << XI_TouchUpdate;
207pub const XI_RawTouchBeginMask: i32 = 1 << XI_RawTouchBegin;
208pub const XI_RawTouchEndMask: i32 = 1 << XI_RawTouchEnd;
209pub const XI_RawTouchUpdateMask: i32 = 1 << XI_RawTouchUpdate;
210pub const XI_BarrierHitMask: i32 = 1 << XI_BarrierHit;
211pub const XI_BarrierLeaveMask: i32 = 1 << XI_BarrierLeave;
212
213//
214// structs
215// (auto-generated with rust-bindgen)
216//
217
218#[repr(C)]
219#[derive(Debug, Copy)]
220pub struct XIAddMasterInfo {
221    pub _type: ::std::os::raw::c_int,
222    pub name: *mut ::std::os::raw::c_char,
223    pub send_core: ::std::os::raw::c_int,
224    pub enable: ::std::os::raw::c_int,
225}
226impl ::std::clone::Clone for XIAddMasterInfo {
227    fn clone(&self) -> Self {
228        *self
229    }
230}
231impl ::std::default::Default for XIAddMasterInfo {
232    fn default() -> Self {
233        unsafe { ::std::mem::zeroed() }
234    }
235}
236
237#[repr(C)]
238#[derive(Debug, Copy)]
239pub struct XIRemoveMasterInfo {
240    pub _type: ::std::os::raw::c_int,
241    pub deviceid: ::std::os::raw::c_int,
242    pub return_mode: ::std::os::raw::c_int,
243    pub return_pointer: ::std::os::raw::c_int,
244    pub return_keyboard: ::std::os::raw::c_int,
245}
246impl ::std::clone::Clone for XIRemoveMasterInfo {
247    fn clone(&self) -> Self {
248        *self
249    }
250}
251impl ::std::default::Default for XIRemoveMasterInfo {
252    fn default() -> Self {
253        unsafe { ::std::mem::zeroed() }
254    }
255}
256
257#[repr(C)]
258#[derive(Debug, Copy)]
259pub struct XIAttachSlaveInfo {
260    pub _type: ::std::os::raw::c_int,
261    pub deviceid: ::std::os::raw::c_int,
262    pub new_master: ::std::os::raw::c_int,
263}
264impl ::std::clone::Clone for XIAttachSlaveInfo {
265    fn clone(&self) -> Self {
266        *self
267    }
268}
269impl ::std::default::Default for XIAttachSlaveInfo {
270    fn default() -> Self {
271        unsafe { ::std::mem::zeroed() }
272    }
273}
274
275#[repr(C)]
276#[derive(Debug, Copy)]
277pub struct XIDetachSlaveInfo {
278    pub _type: ::std::os::raw::c_int,
279    pub deviceid: ::std::os::raw::c_int,
280}
281impl ::std::clone::Clone for XIDetachSlaveInfo {
282    fn clone(&self) -> Self {
283        *self
284    }
285}
286impl ::std::default::Default for XIDetachSlaveInfo {
287    fn default() -> Self {
288        unsafe { ::std::mem::zeroed() }
289    }
290}
291
292#[repr(C)]
293#[derive(Debug, Copy)]
294pub struct XIAnyHierarchyChangeInfo {
295    pub _bindgen_data_: [u64; 3usize],
296}
297impl XIAnyHierarchyChangeInfo {
298    pub unsafe fn _type(&mut self) -> *mut ::std::os::raw::c_int {
299        let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
300        ::std::mem::transmute(raw.offset(0))
301    }
302    pub unsafe fn add(&mut self) -> *mut XIAddMasterInfo {
303        let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
304        ::std::mem::transmute(raw.offset(0))
305    }
306    pub unsafe fn remove(&mut self) -> *mut XIRemoveMasterInfo {
307        let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
308        ::std::mem::transmute(raw.offset(0))
309    }
310    pub unsafe fn attach(&mut self) -> *mut XIAttachSlaveInfo {
311        let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
312        ::std::mem::transmute(raw.offset(0))
313    }
314    pub unsafe fn detach(&mut self) -> *mut XIDetachSlaveInfo {
315        let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
316        ::std::mem::transmute(raw.offset(0))
317    }
318}
319impl ::std::clone::Clone for XIAnyHierarchyChangeInfo {
320    fn clone(&self) -> Self {
321        *self
322    }
323}
324impl ::std::default::Default for XIAnyHierarchyChangeInfo {
325    fn default() -> Self {
326        unsafe { ::std::mem::zeroed() }
327    }
328}
329
330#[repr(C)]
331#[derive(Debug, Copy)]
332pub struct XIModifierState {
333    pub base: ::std::os::raw::c_int,
334    pub latched: ::std::os::raw::c_int,
335    pub locked: ::std::os::raw::c_int,
336    pub effective: ::std::os::raw::c_int,
337}
338impl ::std::clone::Clone for XIModifierState {
339    fn clone(&self) -> Self {
340        *self
341    }
342}
343impl ::std::default::Default for XIModifierState {
344    fn default() -> Self {
345        unsafe { ::std::mem::zeroed() }
346    }
347}
348
349pub type XIGroupState = XIModifierState;
350
351#[repr(C)]
352#[derive(Debug, Copy)]
353pub struct XIButtonState {
354    pub mask_len: ::std::os::raw::c_int,
355    pub mask: *mut ::std::os::raw::c_uchar,
356}
357impl ::std::clone::Clone for XIButtonState {
358    fn clone(&self) -> Self {
359        *self
360    }
361}
362impl ::std::default::Default for XIButtonState {
363    fn default() -> Self {
364        unsafe { ::std::mem::zeroed() }
365    }
366}
367
368#[repr(C)]
369#[derive(Debug, Copy)]
370pub struct XIValuatorState {
371    pub mask_len: ::std::os::raw::c_int,
372    pub mask: *mut ::std::os::raw::c_uchar,
373    pub values: *mut ::std::os::raw::c_double,
374}
375impl ::std::clone::Clone for XIValuatorState {
376    fn clone(&self) -> Self {
377        *self
378    }
379}
380impl ::std::default::Default for XIValuatorState {
381    fn default() -> Self {
382        unsafe { ::std::mem::zeroed() }
383    }
384}
385
386#[repr(C)]
387#[derive(Debug, Copy)]
388pub struct XIEventMask {
389    pub deviceid: ::std::os::raw::c_int,
390    pub mask_len: ::std::os::raw::c_int,
391    pub mask: *mut ::std::os::raw::c_uchar,
392}
393impl ::std::clone::Clone for XIEventMask {
394    fn clone(&self) -> Self {
395        *self
396    }
397}
398impl ::std::default::Default for XIEventMask {
399    fn default() -> Self {
400        unsafe { ::std::mem::zeroed() }
401    }
402}
403
404#[repr(C)]
405#[derive(Debug, Copy)]
406pub struct XIAnyClassInfo {
407    pub _type: ::std::os::raw::c_int,
408    pub sourceid: ::std::os::raw::c_int,
409}
410impl ::std::clone::Clone for XIAnyClassInfo {
411    fn clone(&self) -> Self {
412        *self
413    }
414}
415impl ::std::default::Default for XIAnyClassInfo {
416    fn default() -> Self {
417        unsafe { ::std::mem::zeroed() }
418    }
419}
420
421#[repr(C)]
422#[derive(Debug, Copy)]
423pub struct XIButtonClassInfo {
424    pub _type: ::std::os::raw::c_int,
425    pub sourceid: ::std::os::raw::c_int,
426    pub num_buttons: ::std::os::raw::c_int,
427    pub labels: *mut Atom,
428    pub state: XIButtonState,
429}
430impl ::std::clone::Clone for XIButtonClassInfo {
431    fn clone(&self) -> Self {
432        *self
433    }
434}
435impl ::std::default::Default for XIButtonClassInfo {
436    fn default() -> Self {
437        unsafe { ::std::mem::zeroed() }
438    }
439}
440
441#[repr(C)]
442#[derive(Debug, Copy)]
443pub struct XIKeyClassInfo {
444    pub _type: ::std::os::raw::c_int,
445    pub sourceid: ::std::os::raw::c_int,
446    pub num_keycodes: ::std::os::raw::c_int,
447    pub keycodes: *mut ::std::os::raw::c_int,
448}
449impl ::std::clone::Clone for XIKeyClassInfo {
450    fn clone(&self) -> Self {
451        *self
452    }
453}
454impl ::std::default::Default for XIKeyClassInfo {
455    fn default() -> Self {
456        unsafe { ::std::mem::zeroed() }
457    }
458}
459
460#[repr(C)]
461#[derive(Debug, Copy)]
462pub struct XIValuatorClassInfo {
463    pub _type: ::std::os::raw::c_int,
464    pub sourceid: ::std::os::raw::c_int,
465    pub number: ::std::os::raw::c_int,
466    pub label: Atom,
467    pub min: ::std::os::raw::c_double,
468    pub max: ::std::os::raw::c_double,
469    pub value: ::std::os::raw::c_double,
470    pub resolution: ::std::os::raw::c_int,
471    pub mode: ::std::os::raw::c_int,
472}
473impl ::std::clone::Clone for XIValuatorClassInfo {
474    fn clone(&self) -> Self {
475        *self
476    }
477}
478impl ::std::default::Default for XIValuatorClassInfo {
479    fn default() -> Self {
480        unsafe { ::std::mem::zeroed() }
481    }
482}
483
484#[repr(C)]
485#[derive(Debug, Copy)]
486pub struct XIScrollClassInfo {
487    pub _type: ::std::os::raw::c_int,
488    pub sourceid: ::std::os::raw::c_int,
489    pub number: ::std::os::raw::c_int,
490    pub scroll_type: ::std::os::raw::c_int,
491    pub increment: ::std::os::raw::c_double,
492    pub flags: ::std::os::raw::c_int,
493}
494impl ::std::clone::Clone for XIScrollClassInfo {
495    fn clone(&self) -> Self {
496        *self
497    }
498}
499impl ::std::default::Default for XIScrollClassInfo {
500    fn default() -> Self {
501        unsafe { ::std::mem::zeroed() }
502    }
503}
504
505#[repr(C)]
506#[derive(Debug, Copy)]
507pub struct XITouchClassInfo {
508    pub _type: ::std::os::raw::c_int,
509    pub sourceid: ::std::os::raw::c_int,
510    pub mode: ::std::os::raw::c_int,
511    pub num_touches: ::std::os::raw::c_int,
512}
513impl ::std::clone::Clone for XITouchClassInfo {
514    fn clone(&self) -> Self {
515        *self
516    }
517}
518impl ::std::default::Default for XITouchClassInfo {
519    fn default() -> Self {
520        unsafe { ::std::mem::zeroed() }
521    }
522}
523
524#[repr(C)]
525#[derive(Debug, Copy)]
526pub struct XIDeviceInfo {
527    pub deviceid: ::std::os::raw::c_int,
528    pub name: *mut ::std::os::raw::c_char,
529    pub _use: ::std::os::raw::c_int,
530    pub attachment: ::std::os::raw::c_int,
531    pub enabled: ::std::os::raw::c_int,
532    pub num_classes: ::std::os::raw::c_int,
533    pub classes: *mut *mut XIAnyClassInfo,
534}
535impl ::std::clone::Clone for XIDeviceInfo {
536    fn clone(&self) -> Self {
537        *self
538    }
539}
540impl ::std::default::Default for XIDeviceInfo {
541    fn default() -> Self {
542        unsafe { ::std::mem::zeroed() }
543    }
544}
545
546#[repr(C)]
547#[derive(Debug, Copy)]
548pub struct XIGrabModifiers {
549    pub modifiers: ::std::os::raw::c_int,
550    pub status: ::std::os::raw::c_int,
551}
552impl ::std::clone::Clone for XIGrabModifiers {
553    fn clone(&self) -> Self {
554        *self
555    }
556}
557impl ::std::default::Default for XIGrabModifiers {
558    fn default() -> Self {
559        unsafe { ::std::mem::zeroed() }
560    }
561}
562
563pub type BarrierEventID = ::std::os::raw::c_uint;
564
565#[repr(C)]
566#[derive(Debug, Copy)]
567pub struct XIBarrierReleasePointerInfo {
568    pub deviceid: ::std::os::raw::c_int,
569    pub barrier: PointerBarrier,
570    pub eventid: BarrierEventID,
571}
572impl ::std::clone::Clone for XIBarrierReleasePointerInfo {
573    fn clone(&self) -> Self {
574        *self
575    }
576}
577impl ::std::default::Default for XIBarrierReleasePointerInfo {
578    fn default() -> Self {
579        unsafe { ::std::mem::zeroed() }
580    }
581}
582
583#[repr(C)]
584#[derive(Debug, Copy)]
585pub struct XIEvent {
586    pub _type: ::std::os::raw::c_int,
587    pub serial: ::std::os::raw::c_ulong,
588    pub send_event: ::std::os::raw::c_int,
589    pub display: *mut Display,
590    pub extension: ::std::os::raw::c_int,
591    pub evtype: ::std::os::raw::c_int,
592    pub time: Time,
593}
594impl ::std::clone::Clone for XIEvent {
595    fn clone(&self) -> Self {
596        *self
597    }
598}
599impl ::std::default::Default for XIEvent {
600    fn default() -> Self {
601        unsafe { ::std::mem::zeroed() }
602    }
603}
604
605#[repr(C)]
606#[derive(Debug, Copy)]
607pub struct XIHierarchyInfo {
608    pub deviceid: ::std::os::raw::c_int,
609    pub attachment: ::std::os::raw::c_int,
610    pub _use: ::std::os::raw::c_int,
611    pub enabled: ::std::os::raw::c_int,
612    pub flags: ::std::os::raw::c_int,
613}
614impl ::std::clone::Clone for XIHierarchyInfo {
615    fn clone(&self) -> Self {
616        *self
617    }
618}
619impl ::std::default::Default for XIHierarchyInfo {
620    fn default() -> Self {
621        unsafe { ::std::mem::zeroed() }
622    }
623}
624
625#[repr(C)]
626#[derive(Debug, Copy)]
627pub struct XIHierarchyEvent {
628    pub _type: ::std::os::raw::c_int,
629    pub serial: ::std::os::raw::c_ulong,
630    pub send_event: ::std::os::raw::c_int,
631    pub display: *mut Display,
632    pub extension: ::std::os::raw::c_int,
633    pub evtype: ::std::os::raw::c_int,
634    pub time: Time,
635    pub flags: ::std::os::raw::c_int,
636    pub num_info: ::std::os::raw::c_int,
637    pub info: *mut XIHierarchyInfo,
638}
639impl ::std::clone::Clone for XIHierarchyEvent {
640    fn clone(&self) -> Self {
641        *self
642    }
643}
644impl ::std::default::Default for XIHierarchyEvent {
645    fn default() -> Self {
646        unsafe { ::std::mem::zeroed() }
647    }
648}
649
650#[repr(C)]
651#[derive(Debug, Copy)]
652pub struct XIDeviceChangedEvent {
653    pub _type: ::std::os::raw::c_int,
654    pub serial: ::std::os::raw::c_ulong,
655    pub send_event: ::std::os::raw::c_int,
656    pub display: *mut Display,
657    pub extension: ::std::os::raw::c_int,
658    pub evtype: ::std::os::raw::c_int,
659    pub time: Time,
660    pub deviceid: ::std::os::raw::c_int,
661    pub sourceid: ::std::os::raw::c_int,
662    pub reason: ::std::os::raw::c_int,
663    pub num_classes: ::std::os::raw::c_int,
664    pub classes: *mut *mut XIAnyClassInfo,
665}
666impl ::std::clone::Clone for XIDeviceChangedEvent {
667    fn clone(&self) -> Self {
668        *self
669    }
670}
671impl ::std::default::Default for XIDeviceChangedEvent {
672    fn default() -> Self {
673        unsafe { ::std::mem::zeroed() }
674    }
675}
676
677#[repr(C)]
678#[derive(Debug, Copy)]
679pub struct XIDeviceEvent {
680    pub _type: ::std::os::raw::c_int,
681    pub serial: ::std::os::raw::c_ulong,
682    pub send_event: ::std::os::raw::c_int,
683    pub display: *mut Display,
684    pub extension: ::std::os::raw::c_int,
685    pub evtype: ::std::os::raw::c_int,
686    pub time: Time,
687    pub deviceid: ::std::os::raw::c_int,
688    pub sourceid: ::std::os::raw::c_int,
689    pub detail: ::std::os::raw::c_int,
690    pub root: Window,
691    pub event: Window,
692    pub child: Window,
693    pub root_x: ::std::os::raw::c_double,
694    pub root_y: ::std::os::raw::c_double,
695    pub event_x: ::std::os::raw::c_double,
696    pub event_y: ::std::os::raw::c_double,
697    pub flags: ::std::os::raw::c_int,
698    pub buttons: XIButtonState,
699    pub valuators: XIValuatorState,
700    pub mods: XIModifierState,
701    pub group: XIGroupState,
702}
703impl ::std::clone::Clone for XIDeviceEvent {
704    fn clone(&self) -> Self {
705        *self
706    }
707}
708impl ::std::default::Default for XIDeviceEvent {
709    fn default() -> Self {
710        unsafe { ::std::mem::zeroed() }
711    }
712}
713
714#[repr(C)]
715#[derive(Debug, Copy)]
716pub struct XIRawEvent {
717    pub _type: ::std::os::raw::c_int,
718    pub serial: ::std::os::raw::c_ulong,
719    pub send_event: ::std::os::raw::c_int,
720    pub display: *mut Display,
721    pub extension: ::std::os::raw::c_int,
722    pub evtype: ::std::os::raw::c_int,
723    pub time: Time,
724    pub deviceid: ::std::os::raw::c_int,
725    pub sourceid: ::std::os::raw::c_int,
726    pub detail: ::std::os::raw::c_int,
727    pub flags: ::std::os::raw::c_int,
728    pub valuators: XIValuatorState,
729    pub raw_values: *mut ::std::os::raw::c_double,
730}
731impl ::std::clone::Clone for XIRawEvent {
732    fn clone(&self) -> Self {
733        *self
734    }
735}
736impl ::std::default::Default for XIRawEvent {
737    fn default() -> Self {
738        unsafe { ::std::mem::zeroed() }
739    }
740}
741
742#[repr(C)]
743#[derive(Debug, Copy)]
744pub struct XIEnterEvent {
745    pub _type: ::std::os::raw::c_int,
746    pub serial: ::std::os::raw::c_ulong,
747    pub send_event: ::std::os::raw::c_int,
748    pub display: *mut Display,
749    pub extension: ::std::os::raw::c_int,
750    pub evtype: ::std::os::raw::c_int,
751    pub time: Time,
752    pub deviceid: ::std::os::raw::c_int,
753    pub sourceid: ::std::os::raw::c_int,
754    pub detail: ::std::os::raw::c_int,
755    pub root: Window,
756    pub event: Window,
757    pub child: Window,
758    pub root_x: ::std::os::raw::c_double,
759    pub root_y: ::std::os::raw::c_double,
760    pub event_x: ::std::os::raw::c_double,
761    pub event_y: ::std::os::raw::c_double,
762    pub mode: ::std::os::raw::c_int,
763    pub focus: ::std::os::raw::c_int,
764    pub same_screen: ::std::os::raw::c_int,
765    pub buttons: XIButtonState,
766    pub mods: XIModifierState,
767    pub group: XIGroupState,
768}
769impl ::std::clone::Clone for XIEnterEvent {
770    fn clone(&self) -> Self {
771        *self
772    }
773}
774impl ::std::default::Default for XIEnterEvent {
775    fn default() -> Self {
776        unsafe { ::std::mem::zeroed() }
777    }
778}
779
780pub type XILeaveEvent = XIEnterEvent;
781pub type XIFocusInEvent = XIEnterEvent;
782pub type XIFocusOutEvent = XIEnterEvent;
783
784#[repr(C)]
785#[derive(Debug, Copy)]
786pub struct XIPropertyEvent {
787    pub _type: ::std::os::raw::c_int,
788    pub serial: ::std::os::raw::c_ulong,
789    pub send_event: ::std::os::raw::c_int,
790    pub display: *mut Display,
791    pub extension: ::std::os::raw::c_int,
792    pub evtype: ::std::os::raw::c_int,
793    pub time: Time,
794    pub deviceid: ::std::os::raw::c_int,
795    pub property: Atom,
796    pub what: ::std::os::raw::c_int,
797}
798impl ::std::clone::Clone for XIPropertyEvent {
799    fn clone(&self) -> Self {
800        *self
801    }
802}
803impl ::std::default::Default for XIPropertyEvent {
804    fn default() -> Self {
805        unsafe { ::std::mem::zeroed() }
806    }
807}
808
809#[repr(C)]
810#[derive(Debug, Copy)]
811pub struct XITouchOwnershipEvent {
812    pub _type: ::std::os::raw::c_int,
813    pub serial: ::std::os::raw::c_ulong,
814    pub send_event: ::std::os::raw::c_int,
815    pub display: *mut Display,
816    pub extension: ::std::os::raw::c_int,
817    pub evtype: ::std::os::raw::c_int,
818    pub time: Time,
819    pub deviceid: ::std::os::raw::c_int,
820    pub sourceid: ::std::os::raw::c_int,
821    pub touchid: ::std::os::raw::c_uint,
822    pub root: Window,
823    pub event: Window,
824    pub child: Window,
825    pub flags: ::std::os::raw::c_int,
826}
827impl ::std::clone::Clone for XITouchOwnershipEvent {
828    fn clone(&self) -> Self {
829        *self
830    }
831}
832impl ::std::default::Default for XITouchOwnershipEvent {
833    fn default() -> Self {
834        unsafe { ::std::mem::zeroed() }
835    }
836}
837
838#[repr(C)]
839#[derive(Debug, Copy)]
840pub struct XIBarrierEvent {
841    pub _type: ::std::os::raw::c_int,
842    pub serial: ::std::os::raw::c_ulong,
843    pub send_event: ::std::os::raw::c_int,
844    pub display: *mut Display,
845    pub extension: ::std::os::raw::c_int,
846    pub evtype: ::std::os::raw::c_int,
847    pub time: Time,
848    pub deviceid: ::std::os::raw::c_int,
849    pub sourceid: ::std::os::raw::c_int,
850    pub event: Window,
851    pub root: Window,
852    pub root_x: ::std::os::raw::c_double,
853    pub root_y: ::std::os::raw::c_double,
854    pub dx: ::std::os::raw::c_double,
855    pub dy: ::std::os::raw::c_double,
856    pub dtime: ::std::os::raw::c_int,
857    pub flags: ::std::os::raw::c_int,
858    pub barrier: PointerBarrier,
859    pub eventid: BarrierEventID,
860}
861impl ::std::clone::Clone for XIBarrierEvent {
862    fn clone(&self) -> Self {
863        *self
864    }
865}
866impl ::std::default::Default for XIBarrierEvent {
867    fn default() -> Self {
868        unsafe { ::std::mem::zeroed() }
869    }
870}