Mercurial > games > semicongine
comparison semiconginev2/thirdparty/x11/xkblib.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/xkblib.nim@239adab121a3 |
children |
comparison
equal
deleted
inserted
replaced
1217:f819a874058f | 1218:56781cc0fc7c |
---|---|
1 # $Xorg: XKBlib.h,v 1.6 2000/08/17 19:45:03 cpqbld Exp $ | |
2 #************************************************************ | |
3 #Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. | |
4 # | |
5 #Permission to use, copy, modify, and distribute this | |
6 #software and its documentation for any purpose and without | |
7 #fee is hereby granted, provided that the above copyright | |
8 #notice appear in all copies and that both that copyright | |
9 #notice and this permission notice appear in supporting | |
10 #documentation, and that the name of Silicon Graphics not be | |
11 #used in advertising or publicity pertaining to distribution | |
12 #of the software without specific prior written permission. | |
13 #Silicon Graphics makes no representation about the suitability | |
14 #of this software for any purpose. It is provided "as is" | |
15 #without any express or implied warranty. | |
16 # | |
17 #SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS | |
18 #SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | |
19 #AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON | |
20 #GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL | |
21 #DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING `from` LOSS OF USE, | |
22 #DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE | |
23 #OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH | |
24 #THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
25 # | |
26 #********************************************************/ | |
27 # $XFree86: xc/lib/X11/XKBlib.h,v 3.3 2001/08/01 00:44:38 tsi Exp $ | |
28 # | |
29 # Pascal Convertion was made by Ido Kannner - kanerido@actcom.net.il | |
30 # | |
31 #Thanks: | |
32 # I want to thanks to oliebol for putting up with all of the problems that was found | |
33 # while translating this code. ;) | |
34 # | |
35 # I want to thanks #fpc channel in freenode irc, for helping me, and to put up with my | |
36 # wierd questions ;) | |
37 # | |
38 # Thanks for mmc in #xlib on freenode irc And so for the channel itself for the helping me to | |
39 # understanding some of the problems I had converting this headers and pointing me to resources | |
40 # that helped translating this headers. | |
41 # | |
42 # Ido | |
43 # | |
44 #History: | |
45 # 2004/10/15 - Fixed a bug of accessing second based records by removing "paced record" and | |
46 # chnaged it to "reocrd" only. | |
47 # 2004/10/10 - Added to XkbGetAtomNameFunc and XkbInternAtomFunc the cdecl call. | |
48 # 2004/10/06 - 09 - Convertion `from` the c header of XKBlib.h | |
49 # | |
50 # | |
51 | |
52 import | |
53 x, xlib, xkb | |
54 | |
55 | |
56 include "x11pragma.nim" | |
57 | |
58 | |
59 type | |
60 PXkbAnyEvent* = ptr XkbAnyEvent | |
61 XkbAnyEvent*{.final.} = object | |
62 theType*: int16 # XkbAnyEvent | |
63 serial*: int32 # # of last req processed by server | |
64 send_event*: bool # is this `from` a SendEvent request? | |
65 display*: PDisplay # Display the event was read `from` | |
66 time*: Time # milliseconds; | |
67 xkb_type*: int16 # XKB event minor code | |
68 device*: int16 # device ID | |
69 | |
70 | |
71 type | |
72 PXkbNewKeyboardNotifyEvent* = ptr XkbNewKeyboardNotifyEvent | |
73 XkbNewKeyboardNotifyEvent*{.final.} = object | |
74 theType*: int16 # XkbAnyEvent | |
75 serial*: int32 # of last req processed by server | |
76 send_event*: bool # is this `from` a SendEvent request? | |
77 display*: PDisplay # Display the event was read `from` | |
78 time*: Time # milliseconds | |
79 xkb_type*: int16 # XkbNewKeyboardNotify | |
80 device*: int16 # device ID | |
81 old_device*: int16 # device ID of previous keyboard | |
82 min_key_code*: int16 # minimum key code | |
83 max_key_code*: int16 # maximum key code | |
84 old_min_key_code*: int16 # min key code of previous kbd | |
85 old_max_key_code*: int16 # max key code of previous kbd | |
86 changed*: int16 # changed aspects of the keyboard | |
87 req_major*: int8 # major and minor opcode of req | |
88 req_minor*: int8 # that caused change, if applicable | |
89 | |
90 | |
91 type | |
92 PXkbMapNotifyEvent* = ptr XkbMapNotifyEvent | |
93 XkbMapNotifyEvent*{.final.} = object | |
94 theType*: int16 # XkbAnyEvent | |
95 serial*: int32 # of last req processed by server | |
96 send_event*: bool # is this `from` a SendEvent request | |
97 display*: PDisplay # Display the event was read `from` | |
98 time*: Time # milliseconds | |
99 xkb_type*: int16 # XkbMapNotify | |
100 device*: int16 # device ID | |
101 changed*: int16 # fields which have been changed | |
102 flags*: int16 # reserved | |
103 first_type*: int16 # first changed key type | |
104 num_types*: int16 # number of changed key types | |
105 min_key_code*: KeyCode | |
106 max_key_code*: KeyCode | |
107 first_key_sym*: KeyCode | |
108 first_key_act*: KeyCode | |
109 first_key_behavior*: KeyCode | |
110 first_key_explicit*: KeyCode | |
111 first_modmap_key*: KeyCode | |
112 first_vmodmap_key*: KeyCode | |
113 num_key_syms*: int16 | |
114 num_key_acts*: int16 | |
115 num_key_behaviors*: int16 | |
116 num_key_explicit*: int16 | |
117 num_modmap_keys*: int16 | |
118 num_vmodmap_keys*: int16 | |
119 vmods*: int16 # mask of changed virtual mods | |
120 | |
121 | |
122 type | |
123 PXkbStateNotifyEvent* = ptr XkbStateNotifyEvent | |
124 XkbStateNotifyEvent*{.final.} = object | |
125 theType*: int16 # XkbAnyEvent | |
126 serial*: int32 # # of last req processed by server | |
127 send_event*: bool # is this `from` a SendEvent request? | |
128 display*: PDisplay # Display the event was read `from` | |
129 time*: Time # milliseconds | |
130 xkb_type*: int16 # XkbStateNotify | |
131 device*: int16 # device ID | |
132 changed*: int16 # mask of changed state components | |
133 group*: int16 # keyboard group | |
134 base_group*: int16 # base keyboard group | |
135 latched_group*: int16 # latched keyboard group | |
136 locked_group*: int16 # locked keyboard group | |
137 mods*: int16 # modifier state | |
138 base_mods*: int16 # base modifier state | |
139 latched_mods*: int16 # latched modifiers | |
140 locked_mods*: int16 # locked modifiers | |
141 compat_state*: int16 # compatibility state | |
142 grab_mods*: int8 # mods used for grabs | |
143 compat_grab_mods*: int8 # grab mods for non-XKB clients | |
144 lookup_mods*: int8 # mods sent to clients | |
145 compat_lookup_mods*: int8 # mods sent to non-XKB clients | |
146 ptr_buttons*: int16 # pointer button state | |
147 keycode*: KeyCode # keycode that caused the change | |
148 event_type*: int8 # KeyPress or KeyRelease | |
149 req_major*: int8 # Major opcode of request | |
150 req_minor*: int8 # Minor opcode of request | |
151 | |
152 | |
153 type | |
154 PXkbControlsNotifyEvent* = ptr XkbControlsNotifyEvent | |
155 XkbControlsNotifyEvent*{.final.} = object | |
156 theType*: int16 # XkbAnyEvent | |
157 serial*: int32 # of last req processed by server | |
158 send_event*: bool # is this `from` a SendEvent request? | |
159 display*: PDisplay # Display the event was read `from` | |
160 time*: Time # milliseconds | |
161 xkb_type*: int16 # XkbControlsNotify | |
162 device*: int16 # device ID | |
163 changed_ctrls*: int16 # controls with changed sub-values | |
164 enabled_ctrls*: int16 # controls currently enabled | |
165 enabled_ctrl_changes*: int16 # controls just {en,dis}abled | |
166 num_groups*: int16 # total groups on keyboard | |
167 keycode*: KeyCode # key that caused change or 0 | |
168 event_type*: int8 # type of event that caused change | |
169 req_major*: int8 # if keycode==0, major and minor | |
170 req_minor*: int8 # opcode of req that caused change | |
171 | |
172 | |
173 type | |
174 PXkbIndicatorNotifyEvent* = ptr XkbIndicatorNotifyEvent | |
175 XkbIndicatorNotifyEvent*{.final.} = object | |
176 theType*: int16 # XkbAnyEvent | |
177 serial*: int32 # of last req processed by server | |
178 send_event*: bool # is this `from` a SendEvent request? | |
179 display*: PDisplay # Display the event was read `from` | |
180 time*: Time # milliseconds | |
181 xkb_type*: int16 # XkbIndicatorNotify | |
182 device*: int16 # device | |
183 changed*: int16 # indicators with new state or map | |
184 state*: int16 # current state of all indicators | |
185 | |
186 | |
187 type | |
188 PXkbNamesNotifyEvent* = ptr XkbNamesNotifyEvent | |
189 XkbNamesNotifyEvent*{.final.} = object | |
190 theType*: int16 # XkbAnyEvent | |
191 serial*: int32 # of last req processed by server | |
192 send_event*: bool # is this `from` a SendEvent request? | |
193 display*: PDisplay # Display the event was read `from` | |
194 time*: Time # milliseconds | |
195 xkb_type*: int16 # XkbNamesNotify | |
196 device*: int16 # device ID | |
197 changed*: int32 # names that have changed | |
198 first_type*: int16 # first key type with new name | |
199 num_types*: int16 # number of key types with new names | |
200 first_lvl*: int16 # first key type new new level names | |
201 num_lvls*: int16 # # of key types w/new level names | |
202 num_aliases*: int16 # total number of key aliases | |
203 num_radio_groups*: int16 # total number of radio groups | |
204 changed_vmods*: int16 # virtual modifiers with new names | |
205 changed_groups*: int16 # groups with new names | |
206 changed_indicators*: int16 # indicators with new names | |
207 first_key*: int16 # first key with new name | |
208 num_keys*: int16 # number of keys with new names | |
209 | |
210 | |
211 type | |
212 PXkbCompatMapNotifyEvent* = ptr XkbCompatMapNotifyEvent | |
213 XkbCompatMapNotifyEvent*{.final.} = object | |
214 theType*: int16 # XkbAnyEvent | |
215 serial*: int32 # of last req processed by server | |
216 send_event*: bool # is this `from` a SendEvent request? | |
217 display*: PDisplay # Display the event was read `from` | |
218 time*: Time # milliseconds | |
219 xkb_type*: int16 # XkbCompatMapNotify | |
220 device*: int16 # device ID | |
221 changed_groups*: int16 # groups with new compat maps | |
222 first_si*: int16 # first new symbol interp | |
223 num_si*: int16 # number of new symbol interps | |
224 num_total_si*: int16 # total # of symbol interps | |
225 | |
226 | |
227 type | |
228 PXkbBellNotifyEvent* = ptr XkbBellNotifyEvent | |
229 XkbBellNotifyEvent*{.final.} = object | |
230 theType*: int16 # XkbAnyEvent | |
231 serial*: int32 # of last req processed by server | |
232 send_event*: bool # is this `from` a SendEvent request? | |
233 display*: PDisplay # Display the event was read `from` | |
234 time*: Time # milliseconds | |
235 xkb_type*: int16 # XkbBellNotify | |
236 device*: int16 # device ID | |
237 percent*: int16 # requested volume as a % of maximum | |
238 pitch*: int16 # requested pitch in Hz | |
239 duration*: int16 # requested duration in useconds | |
240 bell_class*: int16 # (input extension) feedback class | |
241 bell_id*: int16 # (input extension) ID of feedback | |
242 name*: Atom # "name" of requested bell | |
243 window*: Window # window associated with event | |
244 event_only*: bool # "event only" requested | |
245 | |
246 | |
247 type | |
248 PXkbActionMessageEvent* = ptr XkbActionMessageEvent | |
249 XkbActionMessageEvent*{.final.} = object | |
250 theType*: int16 # XkbAnyEvent | |
251 serial*: int32 # of last req processed by server | |
252 send_event*: bool # is this `from` a SendEvent request? | |
253 display*: PDisplay # Display the event was read `from` | |
254 time*: Time # milliseconds | |
255 xkb_type*: int16 # XkbActionMessage | |
256 device*: int16 # device ID | |
257 keycode*: KeyCode # key that generated the event | |
258 press*: bool # true if act caused by key press | |
259 key_event_follows*: bool # true if key event also generated | |
260 group*: int16 # effective group | |
261 mods*: int16 # effective mods | |
262 message*: array[0..XkbActionMessageLength, char] # message -- leave space for NUL | |
263 | |
264 | |
265 type | |
266 PXkbAccessXNotifyEvent* = ptr XkbAccessXNotifyEvent | |
267 XkbAccessXNotifyEvent*{.final.} = object | |
268 theType*: int16 # XkbAnyEvent | |
269 serial*: int32 # of last req processed by server | |
270 send_event*: bool # is this `from` a SendEvent request? | |
271 display*: PDisplay # Display the event was read `from` | |
272 time*: Time # milliseconds | |
273 xkb_type*: int16 # XkbAccessXNotify | |
274 device*: int16 # device ID | |
275 detail*: int16 # XkbAXN_* | |
276 keycode*: int16 # key of event | |
277 sk_delay*: int16 # current slow keys delay | |
278 debounce_delay*: int16 # current debounce delay | |
279 | |
280 | |
281 type | |
282 PXkbExtensionDeviceNotifyEvent* = ptr XkbExtensionDeviceNotifyEvent | |
283 XkbExtensionDeviceNotifyEvent*{.final.} = object | |
284 theType*: int16 # XkbAnyEvent | |
285 serial*: int32 # of last req processed by server | |
286 send_event*: bool # is this `from` a SendEvent request? | |
287 display*: PDisplay # Display the event was read `from` | |
288 time*: Time # milliseconds | |
289 xkb_type*: int16 # XkbExtensionDeviceNotify | |
290 device*: int16 # device ID | |
291 reason*: int16 # reason for the event | |
292 supported*: int16 # mask of supported features | |
293 unsupported*: int16 # mask of unsupported features | |
294 # that some app tried to use | |
295 first_btn*: int16 # first button that changed | |
296 num_btns*: int16 # range of buttons changed | |
297 leds_defined*: int16 # indicators with names or maps | |
298 led_state*: int16 # current state of the indicators | |
299 led_class*: int16 # feedback class for led changes | |
300 led_id*: int16 # feedback id for led changes | |
301 | |
302 | |
303 type | |
304 PXkbEvent* = ptr XkbEvent | |
305 XkbEvent*{.final.} = object | |
306 theType*: int16 | |
307 any*: XkbAnyEvent | |
308 new_kbd*: XkbNewKeyboardNotifyEvent | |
309 map*: XkbMapNotifyEvent | |
310 state*: XkbStateNotifyEvent | |
311 ctrls*: XkbControlsNotifyEvent | |
312 indicators*: XkbIndicatorNotifyEvent | |
313 names*: XkbNamesNotifyEvent | |
314 compat*: XkbCompatMapNotifyEvent | |
315 bell*: XkbBellNotifyEvent | |
316 message*: XkbActionMessageEvent | |
317 accessx*: XkbAccessXNotifyEvent | |
318 device*: XkbExtensionDeviceNotifyEvent | |
319 core*: XEvent | |
320 | |
321 | |
322 type | |
323 PXkbKbdDpyStatePtr* = ptr XkbKbdDpyStateRec | |
324 XkbKbdDpyStateRec*{.final.} = object # XkbOpenDisplay error codes | |
325 | |
326 const | |
327 XkbOD_Success* = 0 | |
328 XkbOD_BadLibraryVersion* = 1 | |
329 XkbOD_ConnectionRefused* = 2 | |
330 XkbOD_NonXkbServer* = 3 | |
331 XkbOD_BadServerVersion* = 4 # Values for XlibFlags | |
332 | |
333 const | |
334 XkbLC_ForceLatin1Lookup* = 1 shl 0 | |
335 XkbLC_ConsumeLookupMods* = 1 shl 1 | |
336 XkbLC_AlwaysConsumeShiftAndLock* = 1 shl 2 | |
337 XkbLC_IgnoreNewKeyboards* = 1 shl 3 | |
338 XkbLC_ControlFallback* = 1 shl 4 | |
339 XkbLC_ConsumeKeysOnComposeFail* = 1 shl 29 | |
340 XkbLC_ComposeLED* = 1 shl 30 | |
341 XkbLC_BeepOnComposeFail* = 1 shl 31 | |
342 XkbLC_AllComposeControls* = 0xC0000000 | |
343 XkbLC_AllControls* = 0xC000001F | |
344 | |
345 proc XkbIgnoreExtension*(ignore: bool): bool{.libx11c, | |
346 importc: "XkbIgnoreExtension".} | |
347 proc XkbOpenDisplay*(name: cstring, ev_rtrn, err_rtrn, major_rtrn, minor_rtrn, | |
348 reason: ptr int16): PDisplay{.libx11c, importc: "XkbOpenDisplay".} | |
349 proc XkbQueryExtension*(dpy: PDisplay, opcodeReturn, eventBaseReturn, | |
350 errorBaseReturn, majorRtrn, minorRtrn: ptr int16): bool{. | |
351 libx11c, importc: "XkbQueryExtension".} | |
352 proc XkbUseExtension*(dpy: PDisplay, major_rtrn, minor_rtrn: ptr int16): bool{. | |
353 libx11c, importc: "XkbUseExtension".} | |
354 proc XkbLibraryVersion*(libMajorRtrn, libMinorRtrn: ptr int16): bool{.libx11c, importc: "XkbLibraryVersion".} | |
355 proc XkbSetXlibControls*(dpy: PDisplay, affect, values: int16): int16{.libx11c, importc: "XkbSetXlibControls".} | |
356 proc XkbGetXlibControls*(dpy: PDisplay): int16{.libx11c, | |
357 importc: "XkbGetXlibControls".} | |
358 type | |
359 XkbInternAtomFunc* = proc (dpy: PDisplay, name: cstring, only_if_exists: bool): Atom{. | |
360 cdecl.} | |
361 | |
362 type | |
363 XkbGetAtomNameFunc* = proc (dpy: PDisplay, atom: Atom): cstring{.cdecl.} | |
364 | |
365 proc XkbSetAtomFuncs*(getAtom: XkbInternAtomFunc, getName: XkbGetAtomNameFunc){. | |
366 libx11c, importc: "XkbSetAtomFuncs".} | |
367 proc XkbKeycodeToKeysym*(dpy: PDisplay, kc: KeyCode, group, level: int16): KeySym{. | |
368 libx11c, importc: "XkbKeycodeToKeysym".} | |
369 proc XkbKeysymToModifiers*(dpy: PDisplay, ks: KeySym): int16{.libx11c, importc: "XkbKeysymToModifiers".} | |
370 proc XkbLookupKeySym*(dpy: PDisplay, keycode: KeyCode, | |
371 modifiers, modifiers_return: int16, keysym_return: PKeySym): bool{. | |
372 libx11c, importc: "XkbLookupKeySym".} | |
373 proc XkbLookupKeyBinding*(dpy: PDisplay, sym_rtrn: KeySym, mods: int16, | |
374 buffer: cstring, nbytes: int16, extra_rtrn: ptr int16): int16{. | |
375 libx11c, importc: "XkbLookupKeyBinding".} | |
376 proc XkbTranslateKeyCode*(xkb: PXkbDescPtr, keycode: KeyCode, | |
377 modifiers, modifiers_return: int16, | |
378 keysym_return: PKeySym): bool{.libx11c, | |
379 importc: "XkbTranslateKeyCode".} | |
380 proc XkbTranslateKeySym*(dpy: PDisplay, sym_return: KeySym, modifiers: int16, | |
381 buffer: cstring, nbytes: int16, extra_rtrn: ptr int16): int16{. | |
382 libx11c, importc: "XkbTranslateKeySym".} | |
383 proc XkbSetAutoRepeatRate*(dpy: PDisplay, deviceSpec, delay, interval: int16): bool{. | |
384 libx11c, importc: "XkbSetAutoRepeatRate".} | |
385 proc XkbGetAutoRepeatRate*(dpy: PDisplay, deviceSpec: int16, | |
386 delayRtrn, intervalRtrn: PWord): bool{.libx11c, importc: "XkbGetAutoRepeatRate".} | |
387 proc XkbChangeEnabledControls*(dpy: PDisplay, deviceSpec, affect, values: int16): bool{. | |
388 libx11c, importc: "XkbChangeEnabledControls".} | |
389 proc XkbDeviceBell*(dpy: PDisplay, win: Window, | |
390 deviceSpec, bellClass, bellID, percent: int16, name: Atom): bool{. | |
391 libx11c, importc: "XkbDeviceBell".} | |
392 proc XkbForceDeviceBell*(dpy: PDisplay, | |
393 deviceSpec, bellClass, bellID, percent: int16): bool{. | |
394 libx11c, importc: "XkbForceDeviceBell".} | |
395 proc XkbDeviceBellEvent*(dpy: PDisplay, win: Window, | |
396 deviceSpec, bellClass, bellID, percent: int16, | |
397 name: Atom): bool{.libx11c, | |
398 importc: "XkbDeviceBellEvent".} | |
399 proc XkbBell*(dpy: PDisplay, win: Window, percent: int16, name: Atom): bool{. | |
400 libx11c, importc: "XkbBell".} | |
401 proc XkbForceBell*(dpy: PDisplay, percent: int16): bool{.libx11c, | |
402 importc: "XkbForceBell".} | |
403 proc XkbBellEvent*(dpy: PDisplay, win: Window, percent: int16, name: Atom): bool{. | |
404 libx11c, importc: "XkbBellEvent".} | |
405 proc XkbSelectEvents*(dpy: PDisplay, deviceID, affect, values: int16): bool{. | |
406 libx11c, importc: "XkbSelectEvents".} | |
407 proc XkbSelectEventDetails*(dpy: PDisplay, deviceID, eventType: int16, | |
408 affect, details: int32): bool{.libx11c, importc: "XkbSelectEventDetails".} | |
409 proc XkbNoteMapChanges*(old: PXkbMapChangesPtr, new: PXkbMapNotifyEvent, | |
410 wanted: int16){.libx11c, | |
411 importc: "XkbNoteMapChanges".} | |
412 proc XkbNoteNameChanges*(old: PXkbNameChangesPtr, new: PXkbNamesNotifyEvent, | |
413 wanted: int16){.libx11c, | |
414 importc: "XkbNoteNameChanges".} | |
415 proc XkbGetIndicatorState*(dpy: PDisplay, deviceSpec: int16, pStateRtrn: PWord): Status{. | |
416 libx11c, importc: "XkbGetIndicatorState".} | |
417 proc XkbGetDeviceIndicatorState*(dpy: PDisplay, | |
418 deviceSpec, ledClass, ledID: int16, | |
419 pStateRtrn: PWord): Status{.libx11c, importc: "XkbGetDeviceIndicatorState".} | |
420 proc XkbGetIndicatorMap*(dpy: PDisplay, which: int32, desc: PXkbDescPtr): Status{. | |
421 libx11c, importc: "XkbGetIndicatorMap".} | |
422 proc XkbSetIndicatorMap*(dpy: PDisplay, which: int32, desc: PXkbDescPtr): bool{. | |
423 libx11c, importc: "XkbSetIndicatorMap".} | |
424 proc XkbNoteIndicatorMapChanges*(o, n: PXkbIndicatorChangesPtr, w: int16) | |
425 proc XkbNoteIndicatorStateChanges*(o, n: PXkbIndicatorChangesPtr, w: int16) | |
426 proc XkbGetIndicatorMapChanges*(d: PDisplay, x: PXkbDescPtr, | |
427 c: PXkbIndicatorChangesPtr): Status | |
428 proc XkbChangeIndicatorMaps*(d: PDisplay, x: PXkbDescPtr, | |
429 c: PXkbIndicatorChangesPtr): bool | |
430 proc XkbGetNamedIndicator*(dpy: PDisplay, name: Atom, pNdxRtrn: ptr int16, | |
431 pStateRtrn: ptr bool, pMapRtrn: PXkbIndicatorMapPtr, | |
432 pRealRtrn: ptr bool): bool{.libx11c, | |
433 importc: "XkbGetNamedIndicator".} | |
434 proc XkbGetNamedDeviceIndicator*(dpy: PDisplay, | |
435 deviceSpec, ledClass, ledID: int16, | |
436 name: Atom, pNdxRtrn: ptr int16, | |
437 pStateRtrn: ptr bool, | |
438 pMapRtrn: PXkbIndicatorMapPtr, | |
439 pRealRtrn: ptr bool): bool{.libx11c, importc: "XkbGetNamedDeviceIndicator".} | |
440 proc XkbSetNamedIndicator*(dpy: PDisplay, name: Atom, | |
441 changeState, state, createNewMap: bool, | |
442 pMap: PXkbIndicatorMapPtr): bool{.libx11c, importc: "XkbSetNamedIndicator".} | |
443 proc XkbSetNamedDeviceIndicator*(dpy: PDisplay, | |
444 deviceSpec, ledClass, ledID: int16, | |
445 name: Atom, | |
446 changeState, state, createNewMap: bool, | |
447 pMap: PXkbIndicatorMapPtr): bool{.libx11c, importc: "XkbSetNamedDeviceIndicator".} | |
448 proc XkbLockModifiers*(dpy: PDisplay, deviceSpec, affect, values: int16): bool{. | |
449 libx11c, importc: "XkbLockModifiers".} | |
450 proc XkbLatchModifiers*(dpy: PDisplay, deviceSpec, affect, values: int16): bool{. | |
451 libx11c, importc: "XkbLatchModifiers".} | |
452 proc XkbLockGroup*(dpy: PDisplay, deviceSpec, group: int16): bool{.libx11c, importc: "XkbLockGroup".} | |
453 proc XkbLatchGroup*(dpy: PDisplay, deviceSpec, group: int16): bool{.libx11c, importc: "XkbLatchGroup".} | |
454 proc XkbSetServerInternalMods*(dpy: PDisplay, deviceSpec, affectReal, | |
455 realValues, affectVirtual, virtualValues: int16): bool{.libx11c, importc: "XkbSetServerInternalMods".} | |
456 proc XkbSetIgnoreLockMods*(dpy: PDisplay, deviceSpec, affectReal, realValues, | |
457 affectVirtual, virtualValues: int16): bool{.libx11c, | |
458 importc: "XkbSetIgnoreLockMods".} | |
459 proc XkbVirtualModsToReal*(dpy: PDisplay, virtual_mask: int16, mask_rtrn: PWord): bool{. | |
460 libx11c, importc: "XkbVirtualModsToReal".} | |
461 proc XkbComputeEffectiveMap*(xkb: PXkbDescPtr, theType: PXkbKeyTypePtr, | |
462 map_rtrn: PByte): bool{.libx11c, | |
463 importc: "XkbComputeEffectiveMap".} | |
464 proc XkbInitCanonicalKeyTypes*(xkb: PXkbDescPtr, which: int16, keypadVMod: int16): Status{. | |
465 libx11c, importc: "XkbInitCanonicalKeyTypes".} | |
466 proc XkbAllocKeyboard*(): PXkbDescPtr{.libx11c, | |
467 importc: "XkbAllocKeyboard".} | |
468 proc XkbFreeKeyboard*(xkb: PXkbDescPtr, which: int16, freeDesc: bool){.libx11c, importc: "XkbFreeKeyboard".} | |
469 proc XkbAllocClientMap*(xkb: PXkbDescPtr, which, nTypes: int16): Status{.libx11c, importc: "XkbAllocClientMap".} | |
470 proc XkbAllocServerMap*(xkb: PXkbDescPtr, which, nActions: int16): Status{. | |
471 libx11c, importc: "XkbAllocServerMap".} | |
472 proc XkbFreeClientMap*(xkb: PXkbDescPtr, what: int16, freeMap: bool){.libx11c, importc: "XkbFreeClientMap".} | |
473 proc XkbFreeServerMap*(xkb: PXkbDescPtr, what: int16, freeMap: bool){.libx11c, importc: "XkbFreeServerMap".} | |
474 proc XkbAddKeyType*(xkb: PXkbDescPtr, name: Atom, map_count: int16, | |
475 want_preserve: bool, num_lvls: int16): PXkbKeyTypePtr{. | |
476 libx11c, importc: "XkbAddKeyType".} | |
477 proc XkbAllocIndicatorMaps*(xkb: PXkbDescPtr): Status{.libx11c, | |
478 importc: "XkbAllocIndicatorMaps".} | |
479 proc XkbFreeIndicatorMaps*(xkb: PXkbDescPtr){.libx11c, | |
480 importc: "XkbFreeIndicatorMaps".} | |
481 proc XkbGetMap*(dpy: PDisplay, which, deviceSpec: int16): PXkbDescPtr{.libx11c, importc: "XkbGetMap".} | |
482 proc XkbGetUpdatedMap*(dpy: PDisplay, which: int16, desc: PXkbDescPtr): Status{. | |
483 libx11c, importc: "XkbGetUpdatedMap".} | |
484 proc XkbGetMapChanges*(dpy: PDisplay, xkb: PXkbDescPtr, | |
485 changes: PXkbMapChangesPtr): Status{.libx11c, importc: "XkbGetMapChanges".} | |
486 proc XkbRefreshKeyboardMapping*(event: PXkbMapNotifyEvent): Status{.libx11c, importc: "XkbRefreshKeyboardMapping".} | |
487 proc XkbGetKeyTypes*(dpy: PDisplay, first, num: int16, xkb: PXkbDescPtr): Status{. | |
488 libx11c, importc: "XkbGetKeyTypes".} | |
489 proc XkbGetKeySyms*(dpy: PDisplay, first, num: int16, xkb: PXkbDescPtr): Status{. | |
490 libx11c, importc: "XkbGetKeySyms".} | |
491 proc XkbGetKeyActions*(dpy: PDisplay, first, num: int16, xkb: PXkbDescPtr): Status{. | |
492 libx11c, importc: "XkbGetKeyActions".} | |
493 proc XkbGetKeyBehaviors*(dpy: PDisplay, firstKey, nKeys: int16, | |
494 desc: PXkbDescPtr): Status{.libx11c, | |
495 importc: "XkbGetKeyBehaviors".} | |
496 proc XkbGetVirtualMods*(dpy: PDisplay, which: int16, desc: PXkbDescPtr): Status{. | |
497 libx11c, importc: "XkbGetVirtualMods".} | |
498 proc XkbGetKeyExplicitComponents*(dpy: PDisplay, firstKey, nKeys: int16, | |
499 desc: PXkbDescPtr): Status{.libx11c, importc: "XkbGetKeyExplicitComponents".} | |
500 proc XkbGetKeyModifierMap*(dpy: PDisplay, firstKey, nKeys: int16, | |
501 desc: PXkbDescPtr): Status{.libx11c, | |
502 importc: "XkbGetKeyModifierMap".} | |
503 proc XkbAllocControls*(xkb: PXkbDescPtr, which: int16): Status{.libx11c, importc: "XkbAllocControls".} | |
504 proc XkbFreeControls*(xkb: PXkbDescPtr, which: int16, freeMap: bool){.libx11c, importc: "XkbFreeControls".} | |
505 proc XkbGetControls*(dpy: PDisplay, which: int32, desc: PXkbDescPtr): Status{. | |
506 libx11c, importc: "XkbGetControls".} | |
507 proc XkbSetControls*(dpy: PDisplay, which: int32, desc: PXkbDescPtr): bool{. | |
508 libx11c, importc: "XkbSetControls".} | |
509 proc XkbNoteControlsChanges*(old: PXkbControlsChangesPtr, | |
510 new: PXkbControlsNotifyEvent, wanted: int16){. | |
511 libx11c, importc: "XkbNoteControlsChanges".} | |
512 proc XkbGetControlsChanges*(d: PDisplay, x: PXkbDescPtr, | |
513 c: PXkbControlsChangesPtr): Status | |
514 proc XkbChangeControls*(d: PDisplay, x: PXkbDescPtr, c: PXkbControlsChangesPtr): bool | |
515 proc XkbAllocCompatMap*(xkb: PXkbDescPtr, which, nInterpret: int16): Status{. | |
516 libx11c, importc: "XkbAllocCompatMap".} | |
517 proc XkbFreeCompatMap*(xkib: PXkbDescPtr, which: int16, freeMap: bool){.libx11c, importc: "XkbFreeCompatMap".} | |
518 proc XkbGetCompatMap*(dpy: PDisplay, which: int16, xkb: PXkbDescPtr): Status{. | |
519 libx11c, importc: "XkbGetCompatMap".} | |
520 proc XkbSetCompatMap*(dpy: PDisplay, which: int16, xkb: PXkbDescPtr, | |
521 updateActions: bool): bool{.libx11c, | |
522 importc: "XkbSetCompatMap".} | |
523 proc XkbAddSymInterpret*(xkb: PXkbDescPtr, si: PXkbSymInterpretPtr, | |
524 updateMap: bool, changes: PXkbChangesPtr): PXkbSymInterpretPtr{. | |
525 libx11c, importc: "XkbAddSymInterpret".} | |
526 proc XkbAllocNames*(xkb: PXkbDescPtr, which: int16, | |
527 nTotalRG, nTotalAliases: int16): Status{.libx11c, importc: "XkbAllocNames".} | |
528 proc XkbGetNames*(dpy: PDisplay, which: int16, desc: PXkbDescPtr): Status{. | |
529 libx11c, importc: "XkbGetNames".} | |
530 proc XkbSetNames*(dpy: PDisplay, which, firstType, nTypes: int16, | |
531 desc: PXkbDescPtr): bool{.libx11c, | |
532 importc: "XkbSetNames".} | |
533 proc XkbChangeNames*(dpy: PDisplay, xkb: PXkbDescPtr, | |
534 changes: PXkbNameChangesPtr): bool{.libx11c, | |
535 importc: "XkbChangeNames".} | |
536 proc XkbFreeNames*(xkb: PXkbDescPtr, which: int16, freeMap: bool){.libx11c, importc: "XkbFreeNames".} | |
537 proc XkbGetState*(dpy: PDisplay, deviceSpec: int16, rtrnState: PXkbStatePtr): Status{. | |
538 libx11c, importc: "XkbGetState".} | |
539 proc XkbSetMap*(dpy: PDisplay, which: int16, desc: PXkbDescPtr): bool{.libx11c, importc: "XkbSetMap".} | |
540 proc XkbChangeMap*(dpy: PDisplay, desc: PXkbDescPtr, changes: PXkbMapChangesPtr): bool{. | |
541 libx11c, importc: "XkbChangeMap".} | |
542 proc XkbSetDetectableAutoRepeat*(dpy: PDisplay, detectable: bool, | |
543 supported: ptr bool): bool{.libx11c, importc: "XkbSetDetectableAutoRepeat".} | |
544 proc XkbGetDetectableAutoRepeat*(dpy: PDisplay, supported: ptr bool): bool{. | |
545 libx11c, importc: "XkbGetDetectableAutoRepeat".} | |
546 proc XkbSetAutoResetControls*(dpy: PDisplay, changes: int16, | |
547 auto_ctrls, auto_values: PWord): bool{.libx11c, importc: "XkbSetAutoResetControls".} | |
548 proc XkbGetAutoResetControls*(dpy: PDisplay, auto_ctrls, auto_ctrl_values: PWord): bool{. | |
549 libx11c, importc: "XkbGetAutoResetControls".} | |
550 proc XkbSetPerClientControls*(dpy: PDisplay, change: int16, values: PWord): bool{. | |
551 libx11c, importc: "XkbSetPerClientControls".} | |
552 proc XkbGetPerClientControls*(dpy: PDisplay, ctrls: PWord): bool{.libx11c, importc: "XkbGetPerClientControls".} | |
553 proc XkbCopyKeyType*(`from`, into: PXkbKeyTypePtr): Status{.libx11c, importc: "XkbCopyKeyType".} | |
554 proc XkbCopyKeyTypes*(`from`, into: PXkbKeyTypePtr, num_types: int16): Status{. | |
555 libx11c, importc: "XkbCopyKeyTypes".} | |
556 proc XkbResizeKeyType*(xkb: PXkbDescPtr, type_ndx, map_count: int16, | |
557 want_preserve: bool, new_num_lvls: int16): Status{. | |
558 libx11c, importc: "XkbResizeKeyType".} | |
559 proc XkbResizeKeySyms*(desc: PXkbDescPtr, forKey, symsNeeded: int16): PKeySym{. | |
560 libx11c, importc: "XkbResizeKeySyms".} | |
561 proc XkbResizeKeyActions*(desc: PXkbDescPtr, forKey, actsNeeded: int16): PXkbAction{. | |
562 libx11c, importc: "XkbResizeKeyActions".} | |
563 proc XkbChangeTypesOfKey*(xkb: PXkbDescPtr, key, num_groups: int16, | |
564 groups: int16, newTypes: ptr int16, | |
565 pChanges: PXkbMapChangesPtr): Status{.libx11c, importc: "XkbChangeTypesOfKey".} | |
566 | |
567 proc XkbListComponents*(dpy: PDisplay, deviceSpec: int16, | |
568 ptrns: PXkbComponentNamesPtr, max_inout: ptr int16): PXkbComponentListPtr{. | |
569 libx11c, importc: "XkbListComponents".} | |
570 proc XkbFreeComponentList*(list: PXkbComponentListPtr){.libx11c, | |
571 importc: "XkbFreeComponentList".} | |
572 proc XkbGetKeyboard*(dpy: PDisplay, which, deviceSpec: int16): PXkbDescPtr{. | |
573 libx11c, importc: "XkbGetKeyboard".} | |
574 proc XkbGetKeyboardByName*(dpy: PDisplay, deviceSpec: int16, | |
575 names: PXkbComponentNamesPtr, want, need: int16, | |
576 load: bool): PXkbDescPtr{.libx11c, | |
577 importc: "XkbGetKeyboardByName".} | |
578 | |
579 proc XkbKeyTypesForCoreSymbols*(xkb: PXkbDescPtr, | |
580 map_width: int16, # keyboard device | |
581 core_syms: PKeySym, # always mapWidth symbols | |
582 protected: int16, # explicit key types | |
583 types_inout: ptr int16, # always four type indices | |
584 xkb_syms_rtrn: PKeySym): int16{.libx11c, importc: "XkbKeyTypesForCoreSymbols".} | |
585 # must have enough space | |
586 proc XkbApplyCompatMapToKey*(xkb: PXkbDescPtr, | |
587 key: KeyCode, # key to be updated | |
588 changes: PXkbChangesPtr): bool{.libx11c, importc: "XkbApplyCompatMapToKey".} | |
589 # resulting changes to map | |
590 proc XkbUpdateMapFromCore*(xkb: PXkbDescPtr, | |
591 first_key: KeyCode, # first changed key | |
592 num_keys, | |
593 map_width: int16, | |
594 core_keysyms: PKeySym, # symbols `from` core keymap | |
595 changes: PXkbChangesPtr): bool{.libx11c, importc: "XkbUpdateMapFromCore".} | |
596 | |
597 proc XkbAddDeviceLedInfo*(devi: PXkbDeviceInfoPtr, ledClass, ledId: int16): PXkbDeviceLedInfoPtr{. | |
598 libx11c, importc: "XkbAddDeviceLedInfo".} | |
599 proc XkbResizeDeviceButtonActions*(devi: PXkbDeviceInfoPtr, newTotal: int16): Status{. | |
600 libx11c, importc: "XkbResizeDeviceButtonActions".} | |
601 proc XkbAllocDeviceInfo*(deviceSpec, nButtons, szLeds: int16): PXkbDeviceInfoPtr{. | |
602 libx11c, importc: "XkbAllocDeviceInfo".} | |
603 proc XkbFreeDeviceInfo*(devi: PXkbDeviceInfoPtr, which: int16, freeDevI: bool){. | |
604 libx11c, importc: "XkbFreeDeviceInfo".} | |
605 proc XkbNoteDeviceChanges*(old: PXkbDeviceChangesPtr, | |
606 new: PXkbExtensionDeviceNotifyEvent, wanted: int16){. | |
607 libx11c, importc: "XkbNoteDeviceChanges".} | |
608 proc XkbGetDeviceInfo*(dpy: PDisplay, which, deviceSpec, ledClass, ledID: int16): PXkbDeviceInfoPtr{. | |
609 libx11c, importc: "XkbGetDeviceInfo".} | |
610 proc XkbGetDeviceInfoChanges*(dpy: PDisplay, devi: PXkbDeviceInfoPtr, | |
611 changes: PXkbDeviceChangesPtr): Status{.libx11c, importc: "XkbGetDeviceInfoChanges".} | |
612 proc XkbGetDeviceButtonActions*(dpy: PDisplay, devi: PXkbDeviceInfoPtr, | |
613 all: bool, first, nBtns: int16): Status{.libx11c, importc: "XkbGetDeviceButtonActions".} | |
614 proc XkbGetDeviceLedInfo*(dpy: PDisplay, devi: PXkbDeviceInfoPtr, | |
615 ledClass, ledId, which: int16): Status{.libx11c, importc: "XkbGetDeviceLedInfo".} | |
616 proc XkbSetDeviceInfo*(dpy: PDisplay, which: int16, devi: PXkbDeviceInfoPtr): bool{. | |
617 libx11c, importc: "XkbSetDeviceInfo".} | |
618 proc XkbChangeDeviceInfo*(dpy: PDisplay, desc: PXkbDeviceInfoPtr, | |
619 changes: PXkbDeviceChangesPtr): bool{.libx11c, importc: "XkbChangeDeviceInfo".} | |
620 proc XkbSetDeviceLedInfo*(dpy: PDisplay, devi: PXkbDeviceInfoPtr, | |
621 ledClass, ledID, which: int16): bool{.libx11c, importc: "XkbSetDeviceLedInfo".} | |
622 proc XkbSetDeviceButtonActions*(dpy: PDisplay, devi: PXkbDeviceInfoPtr, | |
623 first, nBtns: int16): bool{.libx11c, importc: "XkbSetDeviceButtonActions".} | |
624 | |
625 proc XkbToControl*(c: int8): int8{.libx11c, | |
626 importc: "XkbToControl".} | |
627 | |
628 proc XkbSetDebuggingFlags*(dpy: PDisplay, mask, flags: int16, msg: cstring, | |
629 ctrls_mask, ctrls, rtrn_flags, rtrn_ctrls: int16): bool{. | |
630 libx11c, importc: "XkbSetDebuggingFlags".} | |
631 proc XkbApplyVirtualModChanges*(xkb: PXkbDescPtr, changed: int16, | |
632 changes: PXkbChangesPtr): bool{.libx11c, importc: "XkbApplyVirtualModChanges".} | |
633 | |
634 # implementation | |
635 | |
636 proc XkbNoteIndicatorMapChanges(o, n: PXkbIndicatorChangesPtr, w: int16) = | |
637 ##define XkbNoteIndicatorMapChanges(o,n,w) ((o)->map_changes|=((n)->map_changes&(w))) | |
638 o.map_changes = o.map_changes or (n.map_changes and w) | |
639 | |
640 proc XkbNoteIndicatorStateChanges(o, n: PXkbIndicatorChangesPtr, w: int16) = | |
641 ##define XkbNoteIndicatorStateChanges(o,n,w) ((o)->state_changes|=((n)->state_changes&(w))) | |
642 o.state_changes = o.state_changes or (n.state_changes and (w)) | |
643 | |
644 proc XkbGetIndicatorMapChanges(d: PDisplay, x: PXkbDescPtr, | |
645 c: PXkbIndicatorChangesPtr): Status = | |
646 ##define XkbGetIndicatorMapChanges(d,x,c) (XkbGetIndicatorMap((d),(c)->map_changes,x) | |
647 result = XkbGetIndicatorMap(d, c.map_changes, x) | |
648 | |
649 proc XkbChangeIndicatorMaps(d: PDisplay, x: PXkbDescPtr, | |
650 c: PXkbIndicatorChangesPtr): bool = | |
651 ##define XkbChangeIndicatorMaps(d,x,c) (XkbSetIndicatorMap((d),(c)->map_changes,x)) | |
652 result = XkbSetIndicatorMap(d, c.map_changes, x) | |
653 | |
654 proc XkbGetControlsChanges(d: PDisplay, x: PXkbDescPtr, | |
655 c: PXkbControlsChangesPtr): Status = | |
656 ##define XkbGetControlsChanges(d,x,c) XkbGetControls(d,(c)->changed_ctrls,x) | |
657 result = XkbGetControls(d, c.changed_ctrls, x) | |
658 | |
659 proc XkbChangeControls(d: PDisplay, x: PXkbDescPtr, c: PXkbControlsChangesPtr): bool = | |
660 ##define XkbChangeControls(d,x,c) XkbSetControls(d,(c)->changed_ctrls,x) | |
661 result = XkbSetControls(d, c.changed_ctrls, x) |