1 use xfixes::PointerBarrier;
2 use xlib::{Atom, Display, Time, Window};
3 use std::os::raw::{c_int, c_uint, c_long, c_double, c_ulong, c_uchar};
4
5 //
6 // macro translations
7 //
mask_byte(mask_flag: i32) -> usize8 fn mask_byte(mask_flag: i32) -> usize {
9 (mask_flag >> 3) as usize
10 }
11
XISetMask(mask: &mut [::std::os::raw::c_uchar], event: i32)12 pub fn XISetMask(mask: &mut [::std::os::raw::c_uchar], event: i32) {
13 mask[mask_byte(event)] |= 1 << (event & 7);
14 }
15
XIClearMask(mask: &mut [::std::os::raw::c_uchar], event: i32)16 pub fn XIClearMask(mask: &mut [::std::os::raw::c_uchar], event: i32) {
17 mask[mask_byte(event)] &= 1 << (event & 7);
18 }
19
XIMaskIsSet(mask: &[::std::os::raw::c_uchar], event: i32) -> bool20 pub 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 //
27 x11_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,
62 variadic:
63 globals:
64 }
65
66 //
67 // constants
68 // (auto-generated with cmacros)
69 //
70
71 pub const XInput_2_0: i32 = 7;
72 pub const XI_2_Major: i32 = 2;
73 pub const XI_2_Minor: i32 = 3;
74 pub const XIPropertyDeleted: i32 = 0;
75 pub const XIPropertyCreated: i32 = 1;
76 pub const XIPropertyModified: i32 = 2;
77 pub const XIPropModeReplace: i32 = 0;
78 pub const XIPropModePrepend: i32 = 1;
79 pub const XIPropModeAppend: i32 = 2;
80 pub const XINotifyNormal: i32 = 0;
81 pub const XINotifyGrab: i32 = 1;
82 pub const XINotifyUngrab: i32 = 2;
83 pub const XINotifyWhileGrabbed: i32 = 3;
84 pub const XINotifyPassiveGrab: i32 = 4;
85 pub const XINotifyPassiveUngrab: i32 = 5;
86 pub const XINotifyAncestor: i32 = 0;
87 pub const XINotifyVirtual: i32 = 1;
88 pub const XINotifyInferior: i32 = 2;
89 pub const XINotifyNonlinear: i32 = 3;
90 pub const XINotifyNonlinearVirtual: i32 = 4;
91 pub const XINotifyPointer: i32 = 5;
92 pub const XINotifyPointerRoot: i32 = 6;
93 pub const XINotifyDetailNone: i32 = 7;
94 pub const XIGrabModeSync: i32 = 0;
95 pub const XIGrabModeAsync: i32 = 1;
96 pub const XIGrabModeTouch: i32 = 2;
97 pub const XIGrabSuccess: i32 = 0;
98 pub const XIAlreadyGrabbed: i32 = 1;
99 pub const XIGrabInvalidTime: i32 = 2;
100 pub const XIGrabNotViewable: i32 = 3;
101 pub const XIGrabFrozen: i32 = 4;
102 pub const XIGrabtypeButton: i32 = 0;
103 pub const XIGrabtypeKeycode: i32 = 1;
104 pub const XIGrabtypeEnter: i32 = 2;
105 pub const XIGrabtypeFocusIn: i32 = 3;
106 pub const XIGrabtypeTouchBegin: i32 = 4;
107 pub const XIAnyButton: i32 = 0;
108 pub const XIAnyKeycode: i32 = 0;
109 pub const XIAsyncDevice: i32 = 0;
110 pub const XISyncDevice: i32 = 1;
111 pub const XIReplayDevice: i32 = 2;
112 pub const XIAsyncPairedDevice: i32 = 3;
113 pub const XIAsyncPair: i32 = 4;
114 pub const XISyncPair: i32 = 5;
115 pub const XIAcceptTouch: i32 = 6;
116 pub const XIRejectTouch: i32 = 7;
117 pub const XISlaveSwitch: i32 = 1;
118 pub const XIDeviceChange: i32 = 2;
119 pub const XIMasterAdded: i32 = (1 << 0);
120 pub const XIMasterRemoved: i32 = (1 << 1);
121 pub const XISlaveAdded: i32 = (1 << 2);
122 pub const XISlaveRemoved: i32 = (1 << 3);
123 pub const XISlaveAttached: i32 = (1 << 4);
124 pub const XISlaveDetached: i32 = (1 << 5);
125 pub const XIDeviceEnabled: i32 = (1 << 6);
126 pub const XIDeviceDisabled: i32 = (1 << 7);
127 pub const XIAddMaster: i32 = 1;
128 pub const XIRemoveMaster: i32 = 2;
129 pub const XIAttachSlave: i32 = 3;
130 pub const XIDetachSlave: i32 = 4;
131 pub const XIAttachToMaster: i32 = 1;
132 pub const XIFloating: i32 = 2;
133 pub const XIModeRelative: i32 = 0;
134 pub const XIModeAbsolute: i32 = 1;
135 pub const XIMasterPointer: i32 = 1;
136 pub const XIMasterKeyboard: i32 = 2;
137 pub const XISlavePointer: i32 = 3;
138 pub const XISlaveKeyboard: i32 = 4;
139 pub const XIFloatingSlave: i32 = 5;
140 pub const XIKeyClass: i32 = 0;
141 pub const XIButtonClass: i32 = 1;
142 pub const XIValuatorClass: i32 = 2;
143 pub const XIScrollClass: i32 = 3;
144 pub const XITouchClass: i32 = 8;
145 pub const XIScrollTypeVertical: i32 = 1;
146 pub const XIScrollTypeHorizontal: i32 = 2;
147 pub const XIScrollFlagNoEmulation: i32 = (1 << 0);
148 pub const XIScrollFlagPreferred: i32 = (1 << 1);
149 pub const XIKeyRepeat: i32 = (1 << 16);
150 pub const XIPointerEmulated: i32 = (1 << 16);
151 pub const XITouchPendingEnd: i32 = (1 << 16);
152 pub const XITouchEmulatingPointer: i32 = (1 << 17);
153 pub const XIBarrierPointerReleased: i32 = (1 << 0);
154 pub const XIBarrierDeviceIsGrabbed: i32 = (1 << 1);
155 pub const XIDirectTouch: i32 = 1;
156 pub const XIDependentTouch: i32 = 2;
157 pub const XIAllDevices: i32 = 0;
158 pub const XIAllMasterDevices: i32 = 1;
159 pub const XI_DeviceChanged: i32 = 1;
160 pub const XI_KeyPress: i32 = 2;
161 pub const XI_KeyRelease: i32 = 3;
162 pub const XI_ButtonPress: i32 = 4;
163 pub const XI_ButtonRelease: i32 = 5;
164 pub const XI_Motion: i32 = 6;
165 pub const XI_Enter: i32 = 7;
166 pub const XI_Leave: i32 = 8;
167 pub const XI_FocusIn: i32 = 9;
168 pub const XI_FocusOut: i32 = 10;
169 pub const XI_HierarchyChanged: i32 = 11;
170 pub const XI_PropertyEvent: i32 = 12;
171 pub const XI_RawKeyPress: i32 = 13;
172 pub const XI_RawKeyRelease: i32 = 14;
173 pub const XI_RawButtonPress: i32 = 15;
174 pub const XI_RawButtonRelease: i32 = 16;
175 pub const XI_RawMotion: i32 = 17;
176 pub const XI_TouchBegin: i32 = 18 /* XI 2.2 */;
177 pub const XI_TouchUpdate: i32 = 19;
178 pub const XI_TouchEnd: i32 = 20;
179 pub const XI_TouchOwnership: i32 = 21;
180 pub const XI_RawTouchBegin: i32 = 22;
181 pub const XI_RawTouchUpdate: i32 = 23;
182 pub const XI_RawTouchEnd: i32 = 24;
183 pub const XI_BarrierHit: i32 = 25 /* XI 2.3 */;
184 pub const XI_BarrierLeave: i32 = 26;
185 pub const XI_LASTEVENT: i32 = XI_BarrierLeave;
186 pub const XI_DeviceChangedMask: i32 = (1 << XI_DeviceChanged);
187 pub const XI_KeyPressMask: i32 = (1 << XI_KeyPress);
188 pub const XI_KeyReleaseMask: i32 = (1 << XI_KeyRelease);
189 pub const XI_ButtonPressMask: i32 = (1 << XI_ButtonPress);
190 pub const XI_ButtonReleaseMask: i32 = (1 << XI_ButtonRelease);
191 pub const XI_MotionMask: i32 = (1 << XI_Motion);
192 pub const XI_EnterMask: i32 = (1 << XI_Enter);
193 pub const XI_LeaveMask: i32 = (1 << XI_Leave);
194 pub const XI_FocusInMask: i32 = (1 << XI_FocusIn);
195 pub const XI_FocusOutMask: i32 = (1 << XI_FocusOut);
196 pub const XI_HierarchyChangedMask: i32 = (1 << XI_HierarchyChanged);
197 pub const XI_PropertyEventMask: i32 = (1 << XI_PropertyEvent);
198 pub const XI_RawKeyPressMask: i32 = (1 << XI_RawKeyPress);
199 pub const XI_RawKeyReleaseMask: i32 = (1 << XI_RawKeyRelease);
200 pub const XI_RawButtonPressMask: i32 = (1 << XI_RawButtonPress);
201 pub const XI_RawButtonReleaseMask: i32 = (1 << XI_RawButtonRelease);
202 pub const XI_RawMotionMask: i32 = (1 << XI_RawMotion);
203 pub const XI_TouchBeginMask: i32 = (1 << XI_TouchBegin);
204 pub const XI_TouchEndMask: i32 = (1 << XI_TouchEnd);
205 pub const XI_TouchOwnershipChangedMask: i32 = (1 << XI_TouchOwnership);
206 pub const XI_TouchUpdateMask: i32 = (1 << XI_TouchUpdate);
207 pub const XI_RawTouchBeginMask: i32 = (1 << XI_RawTouchBegin);
208 pub const XI_RawTouchEndMask: i32 = (1 << XI_RawTouchEnd);
209 pub const XI_RawTouchUpdateMask: i32 = (1 << XI_RawTouchUpdate);
210 pub const XI_BarrierHitMask: i32 = (1 << XI_BarrierHit);
211 pub 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)]
220 pub 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 }
226 impl ::std::clone::Clone for XIAddMasterInfo {
clone(&self) -> Self227 fn clone(&self) -> Self { *self }
228 }
229 impl ::std::default::Default for XIAddMasterInfo {
default() -> Self230 fn default() -> Self { unsafe { ::std::mem::zeroed() } }
231 }
232
233 #[repr(C)]
234 #[derive(Debug, Copy)]
235 pub struct XIRemoveMasterInfo {
236 pub _type: ::std::os::raw::c_int,
237 pub deviceid: ::std::os::raw::c_int,
238 pub return_mode: ::std::os::raw::c_int,
239 pub return_pointer: ::std::os::raw::c_int,
240 pub return_keyboard: ::std::os::raw::c_int,
241 }
242 impl ::std::clone::Clone for XIRemoveMasterInfo {
clone(&self) -> Self243 fn clone(&self) -> Self { *self }
244 }
245 impl ::std::default::Default for XIRemoveMasterInfo {
default() -> Self246 fn default() -> Self { unsafe { ::std::mem::zeroed() } }
247 }
248
249 #[repr(C)]
250 #[derive(Debug, Copy)]
251 pub struct XIAttachSlaveInfo {
252 pub _type: ::std::os::raw::c_int,
253 pub deviceid: ::std::os::raw::c_int,
254 pub new_master: ::std::os::raw::c_int,
255 }
256 impl ::std::clone::Clone for XIAttachSlaveInfo {
clone(&self) -> Self257 fn clone(&self) -> Self { *self }
258 }
259 impl ::std::default::Default for XIAttachSlaveInfo {
default() -> Self260 fn default() -> Self { unsafe { ::std::mem::zeroed() } }
261 }
262
263 #[repr(C)]
264 #[derive(Debug, Copy)]
265 pub struct XIDetachSlaveInfo {
266 pub _type: ::std::os::raw::c_int,
267 pub deviceid: ::std::os::raw::c_int,
268 }
269 impl ::std::clone::Clone for XIDetachSlaveInfo {
clone(&self) -> Self270 fn clone(&self) -> Self { *self }
271 }
272 impl ::std::default::Default for XIDetachSlaveInfo {
default() -> Self273 fn default() -> Self { unsafe { ::std::mem::zeroed() } }
274 }
275
276 #[repr(C)]
277 #[derive(Debug, Copy)]
278 pub struct XIAnyHierarchyChangeInfo {
279 pub _bindgen_data_: [u64; 3usize],
280 }
281 impl XIAnyHierarchyChangeInfo {
_type(&mut self) -> *mut ::std::os::raw::c_int282 pub unsafe fn _type(&mut self) -> *mut ::std::os::raw::c_int {
283 let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
284 ::std::mem::transmute(raw.offset(0))
285 }
add(&mut self) -> *mut XIAddMasterInfo286 pub unsafe fn add(&mut self) -> *mut XIAddMasterInfo {
287 let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
288 ::std::mem::transmute(raw.offset(0))
289 }
remove(&mut self) -> *mut XIRemoveMasterInfo290 pub unsafe fn remove(&mut self) -> *mut XIRemoveMasterInfo {
291 let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
292 ::std::mem::transmute(raw.offset(0))
293 }
attach(&mut self) -> *mut XIAttachSlaveInfo294 pub unsafe fn attach(&mut self) -> *mut XIAttachSlaveInfo {
295 let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
296 ::std::mem::transmute(raw.offset(0))
297 }
detach(&mut self) -> *mut XIDetachSlaveInfo298 pub unsafe fn detach(&mut self) -> *mut XIDetachSlaveInfo {
299 let raw: *mut u8 = ::std::mem::transmute(&self._bindgen_data_);
300 ::std::mem::transmute(raw.offset(0))
301 }
302 }
303 impl ::std::clone::Clone for XIAnyHierarchyChangeInfo {
clone(&self) -> Self304 fn clone(&self) -> Self { *self }
305 }
306 impl ::std::default::Default for XIAnyHierarchyChangeInfo {
default() -> Self307 fn default() -> Self { unsafe { ::std::mem::zeroed() } }
308 }
309
310 #[repr(C)]
311 #[derive(Debug, Copy)]
312 pub struct XIModifierState {
313 pub base: ::std::os::raw::c_int,
314 pub latched: ::std::os::raw::c_int,
315 pub locked: ::std::os::raw::c_int,
316 pub effective: ::std::os::raw::c_int,
317 }
318 impl ::std::clone::Clone for XIModifierState {
clone(&self) -> Self319 fn clone(&self) -> Self { *self }
320 }
321 impl ::std::default::Default for XIModifierState {
default() -> Self322 fn default() -> Self { unsafe { ::std::mem::zeroed() } }
323 }
324
325 pub type XIGroupState = XIModifierState;
326
327 #[repr(C)]
328 #[derive(Debug, Copy)]
329 pub struct XIButtonState {
330 pub mask_len: ::std::os::raw::c_int,
331 pub mask: *mut ::std::os::raw::c_uchar,
332 }
333 impl ::std::clone::Clone for XIButtonState {
clone(&self) -> Self334 fn clone(&self) -> Self { *self }
335 }
336 impl ::std::default::Default for XIButtonState {
default() -> Self337 fn default() -> Self { unsafe { ::std::mem::zeroed() } }
338 }
339
340 #[repr(C)]
341 #[derive(Debug, Copy)]
342 pub struct XIValuatorState {
343 pub mask_len: ::std::os::raw::c_int,
344 pub mask: *mut ::std::os::raw::c_uchar,
345 pub values: *mut ::std::os::raw::c_double,
346 }
347 impl ::std::clone::Clone for XIValuatorState {
clone(&self) -> Self348 fn clone(&self) -> Self { *self }
349 }
350 impl ::std::default::Default for XIValuatorState {
default() -> Self351 fn default() -> Self { unsafe { ::std::mem::zeroed() } }
352 }
353
354 #[repr(C)]
355 #[derive(Debug, Copy)]
356 pub struct XIEventMask {
357 pub deviceid: ::std::os::raw::c_int,
358 pub mask_len: ::std::os::raw::c_int,
359 pub mask: *mut ::std::os::raw::c_uchar,
360 }
361 impl ::std::clone::Clone for XIEventMask {
clone(&self) -> Self362 fn clone(&self) -> Self { *self }
363 }
364 impl ::std::default::Default for XIEventMask {
default() -> Self365 fn default() -> Self { unsafe { ::std::mem::zeroed() } }
366 }
367
368 #[repr(C)]
369 #[derive(Debug, Copy)]
370 pub struct XIAnyClassInfo {
371 pub _type: ::std::os::raw::c_int,
372 pub sourceid: ::std::os::raw::c_int,
373 }
374 impl ::std::clone::Clone for XIAnyClassInfo {
clone(&self) -> Self375 fn clone(&self) -> Self { *self }
376 }
377 impl ::std::default::Default for XIAnyClassInfo {
default() -> Self378 fn default() -> Self { unsafe { ::std::mem::zeroed() } }
379 }
380
381 #[repr(C)]
382 #[derive(Debug, Copy)]
383 pub struct XIButtonClassInfo {
384 pub _type: ::std::os::raw::c_int,
385 pub sourceid: ::std::os::raw::c_int,
386 pub num_buttons: ::std::os::raw::c_int,
387 pub labels: *mut Atom,
388 pub state: XIButtonState,
389 }
390 impl ::std::clone::Clone for XIButtonClassInfo {
clone(&self) -> Self391 fn clone(&self) -> Self { *self }
392 }
393 impl ::std::default::Default for XIButtonClassInfo {
default() -> Self394 fn default() -> Self { unsafe { ::std::mem::zeroed() } }
395 }
396
397 #[repr(C)]
398 #[derive(Debug, Copy)]
399 pub struct XIKeyClassInfo {
400 pub _type: ::std::os::raw::c_int,
401 pub sourceid: ::std::os::raw::c_int,
402 pub num_keycodes: ::std::os::raw::c_int,
403 pub keycodes: *mut ::std::os::raw::c_int,
404 }
405 impl ::std::clone::Clone for XIKeyClassInfo {
clone(&self) -> Self406 fn clone(&self) -> Self { *self }
407 }
408 impl ::std::default::Default for XIKeyClassInfo {
default() -> Self409 fn default() -> Self { unsafe { ::std::mem::zeroed() } }
410 }
411
412 #[repr(C)]
413 #[derive(Debug, Copy)]
414 pub struct XIValuatorClassInfo {
415 pub _type: ::std::os::raw::c_int,
416 pub sourceid: ::std::os::raw::c_int,
417 pub number: ::std::os::raw::c_int,
418 pub label: Atom,
419 pub min: ::std::os::raw::c_double,
420 pub max: ::std::os::raw::c_double,
421 pub value: ::std::os::raw::c_double,
422 pub resolution: ::std::os::raw::c_int,
423 pub mode: ::std::os::raw::c_int,
424 }
425 impl ::std::clone::Clone for XIValuatorClassInfo {
clone(&self) -> Self426 fn clone(&self) -> Self { *self }
427 }
428 impl ::std::default::Default for XIValuatorClassInfo {
default() -> Self429 fn default() -> Self { unsafe { ::std::mem::zeroed() } }
430 }
431
432 #[repr(C)]
433 #[derive(Debug, Copy)]
434 pub struct XIScrollClassInfo {
435 pub _type: ::std::os::raw::c_int,
436 pub sourceid: ::std::os::raw::c_int,
437 pub number: ::std::os::raw::c_int,
438 pub scroll_type: ::std::os::raw::c_int,
439 pub increment: ::std::os::raw::c_double,
440 pub flags: ::std::os::raw::c_int,
441 }
442 impl ::std::clone::Clone for XIScrollClassInfo {
clone(&self) -> Self443 fn clone(&self) -> Self { *self }
444 }
445 impl ::std::default::Default for XIScrollClassInfo {
default() -> Self446 fn default() -> Self { unsafe { ::std::mem::zeroed() } }
447 }
448
449 #[repr(C)]
450 #[derive(Debug, Copy)]
451 pub struct XITouchClassInfo {
452 pub _type: ::std::os::raw::c_int,
453 pub sourceid: ::std::os::raw::c_int,
454 pub mode: ::std::os::raw::c_int,
455 pub num_touches: ::std::os::raw::c_int,
456 }
457 impl ::std::clone::Clone for XITouchClassInfo {
clone(&self) -> Self458 fn clone(&self) -> Self { *self }
459 }
460 impl ::std::default::Default for XITouchClassInfo {
default() -> Self461 fn default() -> Self { unsafe { ::std::mem::zeroed() } }
462 }
463
464 #[repr(C)]
465 #[derive(Debug, Copy)]
466 pub struct XIDeviceInfo {
467 pub deviceid: ::std::os::raw::c_int,
468 pub name: *mut ::std::os::raw::c_char,
469 pub _use: ::std::os::raw::c_int,
470 pub attachment: ::std::os::raw::c_int,
471 pub enabled: ::std::os::raw::c_int,
472 pub num_classes: ::std::os::raw::c_int,
473 pub classes: *mut *mut XIAnyClassInfo,
474 }
475 impl ::std::clone::Clone for XIDeviceInfo {
clone(&self) -> Self476 fn clone(&self) -> Self { *self }
477 }
478 impl ::std::default::Default for XIDeviceInfo {
default() -> Self479 fn default() -> Self { unsafe { ::std::mem::zeroed() } }
480 }
481
482 #[repr(C)]
483 #[derive(Debug, Copy)]
484 pub struct XIGrabModifiers {
485 pub modifiers: ::std::os::raw::c_int,
486 pub status: ::std::os::raw::c_int,
487 }
488 impl ::std::clone::Clone for XIGrabModifiers {
clone(&self) -> Self489 fn clone(&self) -> Self { *self }
490 }
491 impl ::std::default::Default for XIGrabModifiers {
default() -> Self492 fn default() -> Self { unsafe { ::std::mem::zeroed() } }
493 }
494
495 pub type BarrierEventID = ::std::os::raw::c_uint;
496
497 #[repr(C)]
498 #[derive(Debug, Copy)]
499 pub struct XIBarrierReleasePointerInfo {
500 pub deviceid: ::std::os::raw::c_int,
501 pub barrier: PointerBarrier,
502 pub eventid: BarrierEventID,
503 }
504 impl ::std::clone::Clone for XIBarrierReleasePointerInfo {
clone(&self) -> Self505 fn clone(&self) -> Self { *self }
506 }
507 impl ::std::default::Default for XIBarrierReleasePointerInfo {
default() -> Self508 fn default() -> Self { unsafe { ::std::mem::zeroed() } }
509 }
510
511 #[repr(C)]
512 #[derive(Debug, Copy)]
513 pub struct XIEvent {
514 pub _type: ::std::os::raw::c_int,
515 pub serial: ::std::os::raw::c_ulong,
516 pub send_event: ::std::os::raw::c_int,
517 pub display: *mut Display,
518 pub extension: ::std::os::raw::c_int,
519 pub evtype: ::std::os::raw::c_int,
520 pub time: Time,
521 }
522 impl ::std::clone::Clone for XIEvent {
clone(&self) -> Self523 fn clone(&self) -> Self { *self }
524 }
525 impl ::std::default::Default for XIEvent {
default() -> Self526 fn default() -> Self { unsafe { ::std::mem::zeroed() } }
527 }
528
529 #[repr(C)]
530 #[derive(Debug, Copy)]
531 pub struct XIHierarchyInfo {
532 pub deviceid: ::std::os::raw::c_int,
533 pub attachment: ::std::os::raw::c_int,
534 pub _use: ::std::os::raw::c_int,
535 pub enabled: ::std::os::raw::c_int,
536 pub flags: ::std::os::raw::c_int,
537 }
538 impl ::std::clone::Clone for XIHierarchyInfo {
clone(&self) -> Self539 fn clone(&self) -> Self { *self }
540 }
541 impl ::std::default::Default for XIHierarchyInfo {
default() -> Self542 fn default() -> Self { unsafe { ::std::mem::zeroed() } }
543 }
544
545 #[repr(C)]
546 #[derive(Debug, Copy)]
547 pub struct XIHierarchyEvent {
548 pub _type: ::std::os::raw::c_int,
549 pub serial: ::std::os::raw::c_ulong,
550 pub send_event: ::std::os::raw::c_int,
551 pub display: *mut Display,
552 pub extension: ::std::os::raw::c_int,
553 pub evtype: ::std::os::raw::c_int,
554 pub time: Time,
555 pub flags: ::std::os::raw::c_int,
556 pub num_info: ::std::os::raw::c_int,
557 pub info: *mut XIHierarchyInfo,
558 }
559 impl ::std::clone::Clone for XIHierarchyEvent {
clone(&self) -> Self560 fn clone(&self) -> Self { *self }
561 }
562 impl ::std::default::Default for XIHierarchyEvent {
default() -> Self563 fn default() -> Self { unsafe { ::std::mem::zeroed() } }
564 }
565
566 #[repr(C)]
567 #[derive(Debug, Copy)]
568 pub struct XIDeviceChangedEvent {
569 pub _type: ::std::os::raw::c_int,
570 pub serial: ::std::os::raw::c_ulong,
571 pub send_event: ::std::os::raw::c_int,
572 pub display: *mut Display,
573 pub extension: ::std::os::raw::c_int,
574 pub evtype: ::std::os::raw::c_int,
575 pub time: Time,
576 pub deviceid: ::std::os::raw::c_int,
577 pub sourceid: ::std::os::raw::c_int,
578 pub reason: ::std::os::raw::c_int,
579 pub num_classes: ::std::os::raw::c_int,
580 pub classes: *mut *mut XIAnyClassInfo,
581 }
582 impl ::std::clone::Clone for XIDeviceChangedEvent {
clone(&self) -> Self583 fn clone(&self) -> Self { *self }
584 }
585 impl ::std::default::Default for XIDeviceChangedEvent {
default() -> Self586 fn default() -> Self { unsafe { ::std::mem::zeroed() } }
587 }
588
589 #[repr(C)]
590 #[derive(Debug, Copy)]
591 pub struct XIDeviceEvent {
592 pub _type: ::std::os::raw::c_int,
593 pub serial: ::std::os::raw::c_ulong,
594 pub send_event: ::std::os::raw::c_int,
595 pub display: *mut Display,
596 pub extension: ::std::os::raw::c_int,
597 pub evtype: ::std::os::raw::c_int,
598 pub time: Time,
599 pub deviceid: ::std::os::raw::c_int,
600 pub sourceid: ::std::os::raw::c_int,
601 pub detail: ::std::os::raw::c_int,
602 pub root: Window,
603 pub event: Window,
604 pub child: Window,
605 pub root_x: ::std::os::raw::c_double,
606 pub root_y: ::std::os::raw::c_double,
607 pub event_x: ::std::os::raw::c_double,
608 pub event_y: ::std::os::raw::c_double,
609 pub flags: ::std::os::raw::c_int,
610 pub buttons: XIButtonState,
611 pub valuators: XIValuatorState,
612 pub mods: XIModifierState,
613 pub group: XIGroupState,
614 }
615 impl ::std::clone::Clone for XIDeviceEvent {
clone(&self) -> Self616 fn clone(&self) -> Self { *self }
617 }
618 impl ::std::default::Default for XIDeviceEvent {
default() -> Self619 fn default() -> Self { unsafe { ::std::mem::zeroed() } }
620 }
621
622 #[repr(C)]
623 #[derive(Debug, Copy)]
624 pub struct XIRawEvent {
625 pub _type: ::std::os::raw::c_int,
626 pub serial: ::std::os::raw::c_ulong,
627 pub send_event: ::std::os::raw::c_int,
628 pub display: *mut Display,
629 pub extension: ::std::os::raw::c_int,
630 pub evtype: ::std::os::raw::c_int,
631 pub time: Time,
632 pub deviceid: ::std::os::raw::c_int,
633 pub sourceid: ::std::os::raw::c_int,
634 pub detail: ::std::os::raw::c_int,
635 pub flags: ::std::os::raw::c_int,
636 pub valuators: XIValuatorState,
637 pub raw_values: *mut ::std::os::raw::c_double,
638 }
639 impl ::std::clone::Clone for XIRawEvent {
clone(&self) -> Self640 fn clone(&self) -> Self { *self }
641 }
642 impl ::std::default::Default for XIRawEvent {
default() -> Self643 fn default() -> Self { unsafe { ::std::mem::zeroed() } }
644 }
645
646 #[repr(C)]
647 #[derive(Debug, Copy)]
648 pub struct XIEnterEvent {
649 pub _type: ::std::os::raw::c_int,
650 pub serial: ::std::os::raw::c_ulong,
651 pub send_event: ::std::os::raw::c_int,
652 pub display: *mut Display,
653 pub extension: ::std::os::raw::c_int,
654 pub evtype: ::std::os::raw::c_int,
655 pub time: Time,
656 pub deviceid: ::std::os::raw::c_int,
657 pub sourceid: ::std::os::raw::c_int,
658 pub detail: ::std::os::raw::c_int,
659 pub root: Window,
660 pub event: Window,
661 pub child: Window,
662 pub root_x: ::std::os::raw::c_double,
663 pub root_y: ::std::os::raw::c_double,
664 pub event_x: ::std::os::raw::c_double,
665 pub event_y: ::std::os::raw::c_double,
666 pub mode: ::std::os::raw::c_int,
667 pub focus: ::std::os::raw::c_int,
668 pub same_screen: ::std::os::raw::c_int,
669 pub buttons: XIButtonState,
670 pub mods: XIModifierState,
671 pub group: XIGroupState,
672 }
673 impl ::std::clone::Clone for XIEnterEvent {
clone(&self) -> Self674 fn clone(&self) -> Self { *self }
675 }
676 impl ::std::default::Default for XIEnterEvent {
default() -> Self677 fn default() -> Self { unsafe { ::std::mem::zeroed() } }
678 }
679
680 pub type XILeaveEvent = XIEnterEvent;
681 pub type XIFocusInEvent = XIEnterEvent;
682 pub type XIFocusOutEvent = XIEnterEvent;
683
684 #[repr(C)]
685 #[derive(Debug, Copy)]
686 pub struct XIPropertyEvent {
687 pub _type: ::std::os::raw::c_int,
688 pub serial: ::std::os::raw::c_ulong,
689 pub send_event: ::std::os::raw::c_int,
690 pub display: *mut Display,
691 pub extension: ::std::os::raw::c_int,
692 pub evtype: ::std::os::raw::c_int,
693 pub time: Time,
694 pub deviceid: ::std::os::raw::c_int,
695 pub property: Atom,
696 pub what: ::std::os::raw::c_int,
697 }
698 impl ::std::clone::Clone for XIPropertyEvent {
clone(&self) -> Self699 fn clone(&self) -> Self { *self }
700 }
701 impl ::std::default::Default for XIPropertyEvent {
default() -> Self702 fn default() -> Self { unsafe { ::std::mem::zeroed() } }
703 }
704
705 #[repr(C)]
706 #[derive(Debug, Copy)]
707 pub struct XITouchOwnershipEvent {
708 pub _type: ::std::os::raw::c_int,
709 pub serial: ::std::os::raw::c_ulong,
710 pub send_event: ::std::os::raw::c_int,
711 pub display: *mut Display,
712 pub extension: ::std::os::raw::c_int,
713 pub evtype: ::std::os::raw::c_int,
714 pub time: Time,
715 pub deviceid: ::std::os::raw::c_int,
716 pub sourceid: ::std::os::raw::c_int,
717 pub touchid: ::std::os::raw::c_uint,
718 pub root: Window,
719 pub event: Window,
720 pub child: Window,
721 pub flags: ::std::os::raw::c_int,
722 }
723 impl ::std::clone::Clone for XITouchOwnershipEvent {
clone(&self) -> Self724 fn clone(&self) -> Self { *self }
725 }
726 impl ::std::default::Default for XITouchOwnershipEvent {
default() -> Self727 fn default() -> Self { unsafe { ::std::mem::zeroed() } }
728 }
729
730 #[repr(C)]
731 #[derive(Debug, Copy)]
732 pub struct XIBarrierEvent {
733 pub _type: ::std::os::raw::c_int,
734 pub serial: ::std::os::raw::c_ulong,
735 pub send_event: ::std::os::raw::c_int,
736 pub display: *mut Display,
737 pub extension: ::std::os::raw::c_int,
738 pub evtype: ::std::os::raw::c_int,
739 pub time: Time,
740 pub deviceid: ::std::os::raw::c_int,
741 pub sourceid: ::std::os::raw::c_int,
742 pub event: Window,
743 pub root: Window,
744 pub root_x: ::std::os::raw::c_double,
745 pub root_y: ::std::os::raw::c_double,
746 pub dx: ::std::os::raw::c_double,
747 pub dy: ::std::os::raw::c_double,
748 pub dtime: ::std::os::raw::c_int,
749 pub flags: ::std::os::raw::c_int,
750 pub barrier: PointerBarrier,
751 pub eventid: BarrierEventID,
752 }
753 impl ::std::clone::Clone for XIBarrierEvent {
clone(&self) -> Self754 fn clone(&self) -> Self { *self }
755 }
756 impl ::std::default::Default for XIBarrierEvent {
default() -> Self757 fn default() -> Self { unsafe { ::std::mem::zeroed() } }
758 }
759