Mercurial > games > semicongine
comparison semiconginev2/thirdparty/x11/xinput.nim @ 1218:56781cc0fc7c compiletime-tests
did: renamge main package
author | sam <sam@basx.dev> |
---|---|
date | Wed, 17 Jul 2024 21:01:37 +0700 |
parents | semicongine/old/thirdparty/x11/xinput.nim@239adab121a3 |
children |
comparison
equal
deleted
inserted
replaced
1217:f819a874058f | 1218:56781cc0fc7c |
---|---|
1 import x, xlib, xi | |
2 | |
3 const xNeedWidePrototypes {.booldefine.} = defined(posix) | |
4 | |
5 const | |
6 deviceKeyPress* = 0 | |
7 deviceKeyRelease* = 1 | |
8 deviceButtonPress* = 0 | |
9 deviceButtonRelease* = 1 | |
10 deviceMotionNotify* = 0 | |
11 deviceFocusIn* = 0 | |
12 deviceFocusOut* = 1 | |
13 proximityIn* = 0 | |
14 proximityOut* = 1 | |
15 deviceStateNotify* = 0 | |
16 deviceMappingNotify* = 1 | |
17 changeDeviceNotify* = 2 | |
18 | |
19 propertyNotify* = 6 | |
20 | |
21 template FindTypeAndClass*(d, `type`, class, classid, offset: untyped) = | |
22 var i: cint | |
23 var ip: PXInputClassInfo | |
24 `type` = 0 | |
25 class = 0 | |
26 i = 0 | |
27 ip = (cast[PXDevice](d)).classes | |
28 while i < (cast[PXDevice](d)).num_classes: | |
29 if ip.input_class == classid: | |
30 `type` = ip.event_type_base + offset | |
31 class = (cast[PXDevice](d)).device_id shl 8 or `type` | |
32 inc(i) | |
33 inc(ip) | |
34 | |
35 template DeviceKeyPress*(d, `type`, class: untyped): untyped = | |
36 FindTypeAndClass(d, `type`, class, KeyClass, deviceKeyPress) | |
37 | |
38 template DeviceKeyRelease*(d, `type`, class: untyped): untyped = | |
39 FindTypeAndClass(d, `type`, class, KeyClass, deviceKeyRelease) | |
40 | |
41 template DeviceButtonPress*(d, `type`, class: untyped): untyped = | |
42 FindTypeAndClass(d, `type`, class, ButtonClass, deviceButtonPress) | |
43 | |
44 template DeviceButtonRelease*(d, `type`, class: untyped): untyped = | |
45 FindTypeAndClass(d, `type`, class, ButtonClass, deviceButtonRelease) | |
46 | |
47 template DeviceMotionNotify*(d, `type`, class: untyped): untyped = | |
48 FindTypeAndClass(d, `type`, class, ValuatorClass, deviceMotionNotify) | |
49 | |
50 template DeviceFocusIn*(d, `type`, class: untyped): untyped = | |
51 FindTypeAndClass(d, `type`, class, FocusClass, deviceFocusIn) | |
52 | |
53 template DeviceFocusOut*(d, `type`, class: untyped): untyped = | |
54 FindTypeAndClass(d, `type`, class, FocusClass, deviceFocusOut) | |
55 | |
56 template ProximityIn*(d, `type`, class: untyped): untyped = | |
57 FindTypeAndClass(d, `type`, class, ProximityClass, proximityIn) | |
58 | |
59 template ProximityOut*(d, `type`, class: untyped): untyped = | |
60 FindTypeAndClass(d, `type`, class, ProximityClass, proximityOut) | |
61 | |
62 template DeviceStateNotify*(d, `type`, class: untyped): untyped = | |
63 FindTypeAndClass(d, `type`, class, OtherClass, deviceStateNotify) | |
64 | |
65 template DeviceMappingNotify*(d, `type`, class: untyped): untyped = | |
66 FindTypeAndClass(d, `type`, class, OtherClass, deviceMappingNotify) | |
67 | |
68 template ChangeDeviceNotify*(d, `type`, class: untyped): untyped = | |
69 FindTypeAndClass(d, `type`, class, OtherClass, changeDeviceNotify) | |
70 | |
71 template DevicePropertyNotify*(d, `type`, class: untyped): untyped = | |
72 FindTypeAndClass(d, `type`, class, OtherClass, propertyNotify) | |
73 | |
74 template DevicePointerMotionHint*(d, `type`, class: untyped) = | |
75 class = (cast[PXDevice](d)).device_id shl 8 or devicePointerMotionHint | |
76 | |
77 template DeviceButton1Motion*(d, `type`, class: untyped) = | |
78 class = (cast[PXDevice](d)).device_id shl 8 or deviceButton1Motion | |
79 | |
80 template DeviceButton2Motion*(d, `type`, class: untyped) = | |
81 class = (cast[PXDevice](d)).device_id shl 8 or deviceButton2Motion | |
82 | |
83 template DeviceButton3Motion*(d, `type`, class: untyped) = | |
84 class = (cast[PXDevice](d)).device_id shl 8 or deviceButton3Motion | |
85 | |
86 template DeviceButton4Motion*(d, `type`, class: untyped) = | |
87 class = (cast[PXDevice](d)).device_id shl 8 or deviceButton4Motion | |
88 | |
89 template DeviceButton5Motion*(d, `type`, class: untyped) = | |
90 class = (cast[PXDevice](d)).device_id shl 8 or deviceButton5Motion | |
91 | |
92 template DeviceButtonMotion*(d, `type`, class: untyped) = | |
93 class = (cast[PXDevice](d)).device_id shl 8 or deviceButtonMotion | |
94 | |
95 template DeviceOwnerGrabButton*(d, `type`, class: untyped) = | |
96 class = (cast[PXDevice](d)).device_id shl 8 or deviceOwnerGrabButton | |
97 | |
98 template DeviceButtonPressGrab*(d, `type`, class: untyped) = | |
99 class = (cast[PXDevice](d)).device_id shl 8 or deviceButtonGrab | |
100 | |
101 template NoExtensionEvent*(d, `type`, class: untyped) = | |
102 class = (cast[PXDevice](d)).device_id shl 8 or noExtensionEvent | |
103 | |
104 template DevicePresence*(dpy, `type`, class: untyped) = | |
105 `type` = XiGetDevicePresenceNotifyEvent(dpy) | |
106 class = (0x00010000 or devicePresence) | |
107 | |
108 ## Errors | |
109 | |
110 template BadDevice*(dpy, error: untyped): untyped = | |
111 xibaddevice(dpy, addr(error)) | |
112 | |
113 template BadClass*(dpy, error: untyped): untyped = | |
114 xibadclass(dpy, addr(error)) | |
115 | |
116 template BadEvent*(dpy, error: untyped): untyped = | |
117 xibadevent(dpy, addr(error)) | |
118 | |
119 template BadMode*(dpy, error: untyped): untyped = | |
120 xibadmode(dpy, addr(error)) | |
121 | |
122 template DeviceBusy*(dpy, error: untyped): untyped = | |
123 xidevicebusy(dpy, addr(error)) | |
124 | |
125 type | |
126 PXDeviceKeyEvent* = ptr XDeviceKeyEvent | |
127 XDeviceKeyEvent* {.final.} = object | |
128 ## DeviceKey events. These events are sent by input devices that | |
129 ## support input class Keys. | |
130 ## The location of the X pointer is reported in the coordinate | |
131 ## fields of the x,y and x_root,y_root fields. | |
132 `type`*: cint ## of event | |
133 serial*: culong ## # of last request processed | |
134 send_event*: XBool ## true if from SendEvent request | |
135 display*: PDisplay ## Display the event was read from | |
136 window*: Window ## "event" window reported relative to | |
137 deviceid*: XID | |
138 root*: Window ## root window event occured on | |
139 subwindow*: Window ## child window | |
140 time*: Time ## milliseconds | |
141 x*: cint | |
142 y*: cint ## x, y coordinates in event window | |
143 x_root*: cint ## coordinates relative to root | |
144 y_root*: cint ## coordinates relative to root | |
145 state*: cuint ## key or button mask | |
146 keycode*: cuint ## detail | |
147 same_screen*: XBool ## same screen flag | |
148 device_state*: cuint ## device key or button mask | |
149 axes_count*: cuchar | |
150 first_axis*: cuchar | |
151 axis_data*: array[6, cint] | |
152 | |
153 PXDeviceKeyPressedEvent* = PXDeviceKeyEvent | |
154 XDeviceKeyPressedEvent* = XDeviceKeyEvent | |
155 | |
156 PXDeviceKeyReleasedEvent* = PXDeviceKeyEvent | |
157 XDeviceKeyReleasedEvent* = XDeviceKeyEvent | |
158 | |
159 PXDeviceButtonEvent* = ptr XDeviceButtonEvent | |
160 XDeviceButtonEvent* {.final.} = object | |
161 ## DeviceButton events. These events are sent by extension devices | |
162 ## that support input class Buttons. | |
163 `type`*: cint ## of event | |
164 serial*: culong ## # of last request processed by server | |
165 send_event*: XBool ## true if from a SendEvent request | |
166 display*: PDisplay ## Display the event was read from | |
167 window*: Window ## "event" window reported relative to | |
168 deviceid*: XID | |
169 root*: Window ## root window that the event occured on | |
170 subwindow*: Window ## child window | |
171 time*: Time ## milliseconds | |
172 x*: cint | |
173 y*: cint ## x, y coordinates in event window | |
174 x_root*: cint ## coordinates relative to root | |
175 y_root*: cint ## coordinates relative to root | |
176 state*: cuint ## key or button mask | |
177 button*: cuint ## detail | |
178 same_screen*: XBool ## same screen flag | |
179 device_state*: cuint ## device key or button mask | |
180 axes_count*: cuchar | |
181 first_axis*: cuchar | |
182 axis_data*: array[6, cint] | |
183 | |
184 PXDeviceButtonPressedEvent* = PXDeviceButtonEvent | |
185 XDeviceButtonPressedEvent* = XDeviceButtonEvent | |
186 | |
187 PXDeviceButtonReleasedEvent* = PXDeviceButtonEvent | |
188 XDeviceButtonReleasedEvent* = XDeviceButtonEvent | |
189 | |
190 PXDeviceMotionEvent* = ptr XDeviceMotionEvent | |
191 XDeviceMotionEvent* {.final.} = object | |
192 ## DeviceMotionNotify event. These events are sent by extension devices | |
193 ## that support input class Valuators. | |
194 `type`*: cint ## of event | |
195 serial*: culong ## # of last request processed by server | |
196 send_event*: XBool ## true if from a SendEvent request | |
197 display*: PDisplay ## Display the event was read from | |
198 window*: Window ## "event" window reported relative to | |
199 deviceid*: XID | |
200 root*: Window ## root window that the event occured on | |
201 subwindow*: Window ## child window | |
202 time*: Time ## milliseconds | |
203 x*: cint | |
204 y*: cint ## x, y coordinates in event window | |
205 x_root*: cint ## coordinates relative to root | |
206 y_root*: cint ## coordinates relative to root | |
207 state*: cuint ## key or button mask | |
208 is_hint*: char ## detail | |
209 same_screen*: XBool ## same screen flag | |
210 device_state*: cuint ## device key or button mask | |
211 axes_count*: cuchar | |
212 first_axis*: cuchar | |
213 axis_data*: array[6, cint] | |
214 | |
215 PXDeviceFocusChangeEvent* = ptr XDeviceFocusChangeEvent | |
216 XDeviceFocusChangeEvent* {.final.} = object | |
217 ## DeviceFocusChange events. These events are sent when the focus | |
218 ## of an extension device that can be focused is changed. | |
219 `type`*: cint ## of event | |
220 serial*: culong ## # of last request processed by server | |
221 send_event*: XBool ## true if from a SendEvent request | |
222 display*: PDisplay ## Display the event was read from | |
223 window*: Window ## "event" window reported relative to | |
224 deviceid*: XID | |
225 mode*: cint ## NotifyNormal, NotifyGrab, NotifyUngrab | |
226 detail*: cint ## | |
227 ## NotifyAncestor, NotifyVirtual, NotifyInferior, | |
228 ## NotifyNonLinear,NotifyNonLinearVirtual, NotifyPointer, | |
229 ## NotifyPointerRoot, NotifyDetailNone | |
230 ## | |
231 time*: Time | |
232 | |
233 PXDeviceFocusInEvent* = PXDeviceFocusChangeEvent | |
234 XDeviceFocusInEvent* = XDeviceFocusChangeEvent | |
235 | |
236 PXDeviceFocusOutEvent* = PXDeviceFocusChangeEvent | |
237 XDeviceFocusOutEvent* = XDeviceFocusChangeEvent | |
238 | |
239 PXProximityNotifyEvent* = ptr XProximityNotifyEvent | |
240 XProximityNotifyEvent* {.final.} = object | |
241 ## ProximityNotify events. These events are sent by those absolute | |
242 ## positioning devices that are capable of generating proximity information. | |
243 `type`*: cint ## ProximityIn or ProximityOut | |
244 serial*: culong ## # of last request processed by server | |
245 send_event*: XBool ## true if this came from a SendEvent request | |
246 display*: PDisplay ## Display the event was read from | |
247 window*: Window | |
248 deviceid*: XID | |
249 root*: Window | |
250 subwindow*: Window | |
251 time*: Time | |
252 x*: cint | |
253 y*: cint | |
254 x_root*: cint | |
255 y_root*: cint | |
256 state*: cuint | |
257 same_screen*: XBool | |
258 device_state*: cuint ## device key or button mask | |
259 axes_count*: cuchar | |
260 first_axis*: cuchar | |
261 axis_data*: array[6, cint] | |
262 | |
263 PXProximityInEvent* = PXProximityNotifyEvent | |
264 XProximityInEvent* = XProximityNotifyEvent | |
265 | |
266 PXProximityOutEvent* = PXProximityNotifyEvent | |
267 XProximityOutEvent* = XProximityNotifyEvent | |
268 | |
269 PXInputClass* = ptr XInputClass | |
270 XInputClass* {.final.} = object | |
271 class*: cuchar | |
272 length*: cuchar | |
273 | |
274 PXDeviceStateNotifyEvent* = ptr XDeviceStateNotifyEvent | |
275 XDeviceStateNotifyEvent* {.final.} = object | |
276 ## DeviceStateNotify events are generated on EnterWindow and FocusIn | |
277 ## for those clients who have selected DeviceState. | |
278 `type`*: cint | |
279 serial*: culong ## # of last request processed by server | |
280 send_event*: XBool ## true if this came from a SendEvent request | |
281 display*: PDisplay ## Display the event was read from | |
282 window*: Window | |
283 deviceid*: XID | |
284 time*: Time | |
285 num_classes*: cint | |
286 data*: array[64, char] | |
287 | |
288 PXValuatorStatus* = ptr XValuatorStatus | |
289 XValuatorStatus* {.final.} = object | |
290 class*: cuchar | |
291 length*: cuchar | |
292 num_valuators*: cuchar | |
293 mode*: cuchar | |
294 valuators*: array[6, cint] | |
295 | |
296 PXKeyStatus* = ptr XKeyStatus | |
297 XKeyStatus* {.final.} = object | |
298 class*: cuchar | |
299 length*: cuchar | |
300 num_keys*: cshort | |
301 keys*: array[32, char] | |
302 | |
303 PXButtonStatus* = ptr XButtonStatus | |
304 XButtonStatus* {.final.} = object | |
305 class*: cuchar | |
306 length*: cuchar | |
307 num_buttons*: cshort | |
308 buttons*: array[32, char] | |
309 | |
310 PXDeviceMappingEvent* = ptr XDeviceMappingEvent | |
311 XDeviceMappingEvent* {.final.} = object | |
312 ## DeviceMappingNotify event. This event is sent when the key mapping, | |
313 ## modifier mapping, or button mapping of an extension device is changed. | |
314 `type`*: cint | |
315 serial*: culong ## # of last request processed by server | |
316 send_event*: XBool ## true if this came from a SendEvent request | |
317 display*: PDisplay ## Display the event was read from | |
318 window*: Window ## unused | |
319 deviceid*: XID | |
320 time*: Time | |
321 request*: cint ## one of MappingModifier, MappingKeyboard, | |
322 ## MappingPointer | |
323 first_keycode*: cint ## first keycode | |
324 count*: cint ## defines range of change w. first_keycode | |
325 | |
326 PXChangeDeviceNotifyEvent* = ptr XChangeDeviceNotifyEvent | |
327 XChangeDeviceNotifyEvent* {.final.} = object | |
328 ## ChangeDeviceNotify event. This event is sent when an | |
329 ## XChangeKeyboard or XChangePointer request is made. | |
330 `type`*: cint | |
331 serial*: culong ## # of last request processed by server | |
332 send_event*: XBool ## true if this came from a SendEvent request | |
333 display*: PDisplay ## Display the event was read from | |
334 window*: Window ## unused | |
335 deviceid*: XID | |
336 time*: Time | |
337 request*: cint ## NewPointer or NewKeyboard | |
338 | |
339 PXDevicePresenceNotifyEvent* = ptr XDevicePresenceNotifyEvent | |
340 XDevicePresenceNotifyEvent* {.final.} = object | |
341 ## DevicePresenceNotify event. This event is sent when the list of | |
342 ## input devices changes, in which case devchange will be false, and | |
343 ## no information about the change will be contained in the event; | |
344 ## the client should use XListInputDevices() to learn what has changed. | |
345 ## | |
346 ## If devchange is true, an attribute that the server believes is | |
347 ## important has changed on a device, and the client should use | |
348 ## XGetDeviceControl to examine the device. If control is non-zero, | |
349 ## then that control has changed meaningfully. | |
350 `type`*: cint | |
351 serial*: culong ## # of last request processed by server | |
352 send_event*: XBool ## true if this came from a SendEvent request | |
353 display*: PDisplay ## Display the event was read from | |
354 window*: Window ## unused | |
355 time*: Time | |
356 devchange*: XBool | |
357 deviceid*: XID | |
358 control*: XID | |
359 | |
360 PXDevicePropertyNotifyEvent* = ptr XDevicePropertyNotifyEvent | |
361 XDevicePropertyNotifyEvent* {.final.} = object | |
362 `type`*: cint | |
363 serial*: culong ## # of last request processed by server | |
364 send_event*: XBool ## true if this came from a SendEvent request | |
365 display*: PDisplay ## Display the event was read from | |
366 window*: Window ## unused | |
367 time*: Time | |
368 deviceid*: XID ## id of the device that changed | |
369 atom*: Atom ## the property that changed | |
370 state*: cint ## PropertyNewValue or PropertyDeleted | |
371 | |
372 PXFeedbackState* = ptr XFeedbackState | |
373 XFeedbackState* {.final.} = object | |
374 class*: XID | |
375 length*: cint | |
376 id*: XID | |
377 | |
378 PXKbdFeedbackState* = ptr XKbdFeedbackState | |
379 XKbdFeedbackState* {.final.} = object | |
380 class*: XID | |
381 length*: cint | |
382 id*: XID | |
383 click*: cint | |
384 percent*: cint | |
385 pitch*: cint | |
386 duration*: cint | |
387 led_mask*: cint | |
388 global_auto_repeat*: cint | |
389 auto_repeats*: array[32, char] | |
390 | |
391 PXPtrFeedbackState* = ptr XPtrFeedbackState | |
392 XPtrFeedbackState* {.final.} = object | |
393 class*: XID | |
394 length*: cint | |
395 id*: XID | |
396 accelNum*: cint | |
397 accelDenom*: cint | |
398 threshold*: cint | |
399 | |
400 PXIntegerFeedbackState* = ptr XIntegerFeedbackState | |
401 XIntegerFeedbackState* {.final.} = object | |
402 class*: XID | |
403 length*: cint | |
404 id*: XID | |
405 resolution*: cint | |
406 minVal*: cint | |
407 maxVal*: cint | |
408 | |
409 PXStringFeedbackState* = ptr XStringFeedbackState | |
410 XStringFeedbackState* {.final.} = object | |
411 class*: XID | |
412 length*: cint | |
413 id*: XID | |
414 max_symbols*: cint | |
415 num_syms_supported*: cint | |
416 syms_supported*: PKeySym | |
417 | |
418 PXBellFeedbackState* = ptr XBellFeedbackState | |
419 XBellFeedbackState* {.final.} = object | |
420 class*: XID | |
421 length*: cint | |
422 id*: XID | |
423 percent*: cint | |
424 pitch*: cint | |
425 duration*: cint | |
426 | |
427 PXLedFeedbackState* = ptr XLedFeedbackState | |
428 XLedFeedbackState* {.final.} = object | |
429 class*: XID | |
430 length*: cint | |
431 id*: XID | |
432 led_values*: cint | |
433 led_mask*: cint | |
434 | |
435 PXFeedbackControl* = ptr XFeedbackControl | |
436 XFeedbackControl* {.final.} = object | |
437 class*: XID | |
438 length*: cint | |
439 id*: XID | |
440 | |
441 PXPtrFeedbackControl* = ptr XPtrFeedbackControl | |
442 XPtrFeedbackControl* {.final.} = object | |
443 class*: XID | |
444 length*: cint | |
445 id*: XID | |
446 accelNum*: cint | |
447 accelDenom*: cint | |
448 threshold*: cint | |
449 | |
450 PXKbdFeedbackControl* = ptr XKbdFeedbackControl | |
451 XKbdFeedbackControl* {.final.} = object | |
452 class*: XID | |
453 length*: cint | |
454 id*: XID | |
455 click*: cint | |
456 percent*: cint | |
457 pitch*: cint | |
458 duration*: cint | |
459 led_mask*: cint | |
460 led_value*: cint | |
461 key*: cint | |
462 auto_repeat_mode*: cint | |
463 | |
464 PXStringFeedbackControl* = ptr XStringFeedbackControl | |
465 XStringFeedbackControl* {.final.} = object | |
466 class*: XID | |
467 length*: cint | |
468 id*: XID | |
469 num_keysyms*: cint | |
470 syms_to_display*: PKeySym | |
471 | |
472 PXIntegerFeedbackControl* = ptr XIntegerFeedbackControl | |
473 XIntegerFeedbackControl* {.final.} = object | |
474 class*: XID | |
475 length*: cint | |
476 id*: XID | |
477 int_to_display*: cint | |
478 | |
479 PXBellFeedbackControl* = ptr XBellFeedbackControl | |
480 XBellFeedbackControl* {.final.} = object | |
481 class*: XID | |
482 length*: cint | |
483 id*: XID | |
484 percent*: cint | |
485 pitch*: cint | |
486 duration*: cint | |
487 | |
488 PXLedFeedbackControl* = ptr XLedFeedbackControl | |
489 XLedFeedbackControl* {.final.} = object | |
490 class*: XID | |
491 length*: cint | |
492 id*: XID | |
493 led_mask*: cint | |
494 led_values*: cint | |
495 | |
496 PXDeviceControl* = ptr XDeviceControl | |
497 XDeviceControl* {.final.} = object | |
498 control*: XID | |
499 length*: cint | |
500 | |
501 PXDeviceResolutionControl* = ptr XDeviceResolutionControl | |
502 XDeviceResolutionControl* {.final.} = object | |
503 control*: XID | |
504 length*: cint | |
505 first_valuator*: cint | |
506 num_valuators*: cint | |
507 resolutions*: ptr cint | |
508 | |
509 PXDeviceResolutionState* = ptr XDeviceResolutionState | |
510 XDeviceResolutionState* {.final.} = object | |
511 control*: XID | |
512 length*: cint | |
513 num_valuators*: cint | |
514 resolutions*: ptr cint | |
515 min_resolutions*: ptr cint | |
516 max_resolutions*: ptr cint | |
517 | |
518 PXDeviceAbsCalibControl* = ptr XDeviceAbsCalibControl | |
519 XDeviceAbsCalibControl* {.final.} = object | |
520 control*: XID | |
521 length*: cint | |
522 min_x*: cint | |
523 max_x*: cint | |
524 min_y*: cint | |
525 max_y*: cint | |
526 flip_x*: cint | |
527 flip_y*: cint | |
528 rotation*: cint | |
529 button_threshold*: cint | |
530 | |
531 PXDeviceAbsCalibState* = PXDeviceAbsCalibControl | |
532 XDeviceAbsCalibState* = XDeviceAbsCalibControl | |
533 | |
534 PXDeviceAbsAreaControl* = ptr XDeviceAbsAreaControl | |
535 XDeviceAbsAreaControl* {.final.} = object | |
536 control*: XID | |
537 length*: cint | |
538 offset_x*: cint | |
539 offset_y*: cint | |
540 width*: cint | |
541 height*: cint | |
542 screen*: cint | |
543 following*: XID | |
544 | |
545 PXDeviceAbsAreaState* = PXDeviceAbsAreaControl | |
546 XDeviceAbsAreaState* = XDeviceAbsAreaControl | |
547 | |
548 PXDeviceCoreControl* = ptr XDeviceCoreControl | |
549 XDeviceCoreControl* {.final.} = object | |
550 control*: XID | |
551 length*: cint | |
552 status*: cint | |
553 | |
554 PXDeviceCoreState* = ptr XDeviceCoreState | |
555 XDeviceCoreState* {.final.} = object | |
556 control*: XID | |
557 length*: cint | |
558 status*: cint | |
559 iscore*: cint | |
560 | |
561 PXDeviceEnableControl* = ptr XDeviceEnableControl | |
562 XDeviceEnableControl* {.final.} = object | |
563 control*: XID | |
564 length*: cint | |
565 enable*: cint | |
566 | |
567 PXDeviceEnableState* = PXDeviceEnableControl | |
568 XDeviceEnableState* = XDeviceEnableControl | |
569 | |
570 PXAnyClassInfo* = ptr XAnyClassInfo | |
571 XAnyClassInfo* {.final.} = object | |
572 class*: XID | |
573 length*: cint | |
574 | |
575 PXDeviceInfo* = ptr XDeviceInfo | |
576 XDeviceInfo* {.final.} = object | |
577 id*: XID | |
578 `type`*: Atom | |
579 name*: cstring | |
580 num_classes*: cint | |
581 use*: cint | |
582 inputclassinfo*: PXAnyClassInfo | |
583 | |
584 PXKeyInfo* = ptr XKeyInfo | |
585 XKeyInfo* {.final.} = object | |
586 class*: XID | |
587 length*: cint | |
588 min_keycode*: cushort | |
589 max_keycode*: cushort | |
590 num_keys*: cushort | |
591 | |
592 PXButtonInfo* = ptr XButtonInfo | |
593 XButtonInfo* {.final.} = object | |
594 class*: XID | |
595 length*: cint | |
596 num_buttons*: cshort | |
597 | |
598 PXAxisInfo* = ptr XAxisInfo | |
599 XAxisInfo* {.final.} = object | |
600 resolution*: cint | |
601 min_value*: cint | |
602 max_value*: cint | |
603 | |
604 PXValuatorInfo* = ptr XValuatorInfo | |
605 XValuatorInfo* {.final.} = object | |
606 class*: XID | |
607 length*: cint | |
608 num_axes*: cuchar | |
609 mode*: cuchar | |
610 motion_buffer*: culong | |
611 axes*: PXAxisInfo | |
612 | |
613 PXInputClassInfo* = ptr XInputClassInfo | |
614 XInputClassInfo* {.final.} = object | |
615 input_class*: cuchar | |
616 event_type_base*: cuchar | |
617 | |
618 PXDevice* = ptr XDevice | |
619 XDevice* {.final.} = object | |
620 device_id*: XID | |
621 num_classes*: cint | |
622 classes*: PXInputClassInfo | |
623 | |
624 PXEventList* = ptr XEventList | |
625 XEventList* {.final.} = object | |
626 event_type*: XEventClass | |
627 device*: XID | |
628 | |
629 PXDeviceTimeCoord* = ptr XDeviceTimeCoord | |
630 XDeviceTimeCoord* {.final.} = object | |
631 time*: Time | |
632 data*: ptr cint | |
633 | |
634 PXDeviceState* = ptr XDeviceState | |
635 XDeviceState* {.final.} = object | |
636 device_id*: XID | |
637 num_classes*: cint | |
638 data*: PXInputClass | |
639 | |
640 PXValuatorState* = ptr XValuatorState | |
641 XValuatorState* {.final.} = object | |
642 class*: cuchar | |
643 length*: cuchar | |
644 num_valuators*: cuchar | |
645 mode*: cuchar | |
646 valuators*: ptr cint | |
647 | |
648 PXKeyState* = ptr XKeyState | |
649 XKeyState* {.final.} = object | |
650 class*: cuchar | |
651 length*: cuchar | |
652 num_keys*: cshort | |
653 keys*: array[32, char] | |
654 | |
655 PXButtonState* = ptr XButtonState | |
656 XButtonState* {.final.} = object | |
657 class*: cuchar | |
658 length*: cuchar | |
659 num_buttons*: cshort | |
660 buttons*: array[32, char] | |
661 | |
662 | |
663 {.push cdecl, importc, dynlib: libXi.} | |
664 | |
665 proc XChangeKeyboardDevice*(a1: PDisplay, a2: PXDevice): cint | |
666 proc XChangePointerDevice*(a1: PDisplay, a2: PXDevice, a3, a4: cint): cint | |
667 proc XGrabDevice*(a1: PDisplay, a2: PXDevice, a3: Window, a4: XBool, a5: cint, | |
668 a6: ptr UncheckedArray[XEventClass], a7, a8: cint, a9: Time): cint | |
669 proc XUngrabDevice*(a1: PDisplay, a2: PXDevice, a3: Time): cint | |
670 proc XGrabDeviceKey*(a1: PDisplay, a2: PXDevice, a3, a4: cuint, | |
671 a5: PXDevice, a6: Window, a7: XBool, a8: cuint, | |
672 a9: ptr UncheckedArray[XEventClass], a10, a11: cint): cint | |
673 proc XUngrabDeviceKey*(a1: PDisplay, a2: PXDevice, a3: cuint, a4: cuint, | |
674 a5: PXDevice, a6: Window): cint | |
675 proc XGrabDeviceButton*(a1: PDisplay, a2: PXDevice, a3: cuint, a4: cuint, | |
676 a5: PXDevice, a6: Window, a7: XBool, a8: cuint, | |
677 a9: ptr UncheckedArray[XEventClass], a10: cint, a11: cint): cint | |
678 proc XUngrabDeviceButton*(a1: PDisplay, a2: PXDevice, a3: cuint, a4: cuint, | |
679 a5: PXDevice, a6: Window): cint | |
680 proc XAllowDeviceEvents*(a1: PDisplay, a2: PXDevice, a3: cint, a4: Time): cint | |
681 proc XGetDeviceFocus*(a1: PDisplay, a2: PXDevice, a3: PWindow, a4: ptr cint, | |
682 a5: ptr Time): cint | |
683 proc XSetDeviceFocus*(a1: PDisplay, a2: PXDevice, a3: Window, a4: cint, a5: Time): cint | |
684 proc XGetFeedbackControl*(a1: PDisplay, a2: PXDevice, a3: ptr cint): PXFeedbackState | |
685 proc XFreeFeedbackList*(a1: PXFeedbackState) | |
686 proc XChangeFeedbackControl*(a1: PDisplay, a2: PXDevice, a3: culong, | |
687 a4: PXFeedbackControl): cint | |
688 proc XDeviceBell*(a1: PDisplay, a2: PXDevice, a3, a4: XID, a5: cint): cint | |
689 proc XGetDeviceKeyMapping*(a1: PDisplay, a2: PXDevice, | |
690 a3: (when xNeedWidePrototypes: cuint else: KeyCode), | |
691 a4: cint, a5: ptr cint): PKeySym | |
692 proc XChangeDeviceKeyMapping*(a1: PDisplay, a2: PXDevice, a3: cint, a4: cint, | |
693 a5: PKeySym, a6: cint): cint | |
694 proc XGetDeviceModifierMapping*(a1: PDisplay, a2: PXDevice): PXModifierKeymap | |
695 proc XSetDeviceModifierMapping*(a1: PDisplay, a2: PXDevice, | |
696 a3: PXModifierKeymap): cint | |
697 proc XSetDeviceButtonMapping*(a1: PDisplay, a2: PXDevice, a3: cstring, a4: cint): cint | |
698 proc XGetDeviceButtonMapping*(a1: PDisplay, a2: PXDevice, a3: cstring, a4: cuint): cint | |
699 proc XQueryDeviceState*(a1: PDisplay, a2: PXDevice): PXDeviceState | |
700 proc XFreeDeviceState*(a1: PXDeviceState) | |
701 proc XGetExtensionVersion*(a1: PDisplay, a2: cstring): PXExtensionVersion | |
702 proc XListInputDevices*(a1: PDisplay, a2: ptr cint): PXDeviceInfo | |
703 proc XFreeDeviceList*(a1: PXDeviceInfo) | |
704 proc XOpenDevice*(a1: PDisplay, a2: XID): PXDevice | |
705 proc XCloseDevice*(a1: PDisplay, a2: PXDevice): cint | |
706 proc XSetDeviceMode*(a1: PDisplay, a2: PXDevice, a3: cint): cint | |
707 proc XSetDeviceValuators*(a1: PDisplay, a2: PXDevice, a3: ptr cint, a4: cint, a5: cint): cint | |
708 proc XGetDeviceControl*(a1: PDisplay, a2: PXDevice, a3: cint): PXDeviceControl | |
709 proc XChangeDeviceControl*(a1: PDisplay, a2: PXDevice, a3: cint, | |
710 a4: PXDeviceControl): cint | |
711 proc XSelectExtensionEvent*(a1: PDisplay, a2: Window, a3: ptr UncheckedArray[XEventClass], a4: cint): cint | |
712 proc XGetSelectedExtensionEvents*(a1: PDisplay, a2: Window, a3: ptr cint, | |
713 a4: ptr ptr UncheckedArray[XEventClass], a5: ptr cint, | |
714 a6: ptr ptr UncheckedArray[XEventClass]): cint | |
715 proc XChangeDeviceDontPropagateList*(a1: PDisplay, a2: Window, a3: cint, | |
716 a4: ptr UncheckedArray[XEventClass], a5: cint): cint | |
717 proc XGetDeviceDontPropagateList*(a1: PDisplay, a2: Window, a3: ptr cint): ptr UncheckedArray[XEventClass] | |
718 proc XSendExtensionEvent*(a1: PDisplay, a2: PXDevice, a3: Window, a4: XBool, a5: cint, | |
719 a6: ptr UncheckedArray[XEventClass], a7: PXEvent): Status | |
720 proc XGetDeviceMotionEvents*(a1: PDisplay, a2: PXDevice, a3, a4: Time, | |
721 a5, a6, a7: ptr cint): PXDeviceTimeCoord | |
722 proc XFreeDeviceMotionEvents*(a1: PXDeviceTimeCoord) | |
723 proc XFreeDeviceControl*(a1: PXDeviceControl) | |
724 proc XListDeviceProperties*(a1: PDisplay, a2: PXDevice, a3: ptr cint): PAtom | |
725 proc XChangeDeviceProperty*(a1: PDisplay, a2: PXDevice, a3: Atom, a4: Atom, a5: cint, | |
726 a6: cint, a7: cstring, a8: cint) | |
727 proc XDeleteDeviceProperty*(a1: PDisplay, a2: PXDevice, a3: Atom) | |
728 proc XGetDeviceProperty*(a1: PDisplay, a2: PXDevice, a3: Atom, a4, a5: clong, | |
729 a6: XBool, a7: Atom, a8: PAtom, a9: ptr cint, a10: ptr culong, | |
730 a11: ptr culong, a12: ptr cstring): Status | |
731 | |
732 {.pop.} |