1 | /************************************************************ |
2 | Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. |
3 | |
4 | Permission to use, copy, modify, and distribute this |
5 | software and its documentation for any purpose and without |
6 | fee is hereby granted, provided that the above copyright |
7 | notice appear in all copies and that both that copyright |
8 | notice and this permission notice appear in supporting |
9 | documentation, and that the name of Silicon Graphics not be |
10 | used in advertising or publicity pertaining to distribution |
11 | of the software without specific prior written permission. |
12 | Silicon Graphics makes no representation about the suitability |
13 | of this software for any purpose. It is provided "as is" |
14 | without any express or implied warranty. |
15 | |
16 | SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS |
17 | SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY |
18 | AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON |
19 | GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL |
20 | DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, |
21 | DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE |
22 | OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH |
23 | THE USE OR PERFORMANCE OF THIS SOFTWARE. |
24 | |
25 | ********************************************************/ |
26 | |
27 | #ifndef _X11_XKBLIB_H_ |
28 | #define _X11_XKBLIB_H_ |
29 | |
30 | #include <X11/Xlib.h> |
31 | #include <X11/extensions/XKBstr.h> |
32 | |
33 | typedef struct _XkbAnyEvent { |
34 | int type; /* XkbAnyEvent */ |
35 | unsigned long serial; /* # of last req processed by server */ |
36 | Bool send_event; /* is this from a SendEvent request? */ |
37 | Display * display; /* Display the event was read from */ |
38 | Time time; /* milliseconds */ |
39 | int xkb_type; /* XKB event minor code */ |
40 | unsigned int device; /* device ID */ |
41 | } XkbAnyEvent; |
42 | |
43 | typedef struct _XkbNewKeyboardNotify { |
44 | int type; /* XkbAnyEvent */ |
45 | unsigned long serial; /* of last req processed by server */ |
46 | Bool send_event; /* is this from a SendEvent request? */ |
47 | Display * display; /* Display the event was read from */ |
48 | Time time; /* milliseconds */ |
49 | int xkb_type; /* XkbNewKeyboardNotify */ |
50 | int device; /* device ID */ |
51 | int old_device; /* device ID of previous keyboard */ |
52 | int min_key_code; /* minimum key code */ |
53 | int max_key_code; /* maximum key code */ |
54 | int old_min_key_code;/* min key code of previous kbd */ |
55 | int old_max_key_code;/* max key code of previous kbd */ |
56 | unsigned int changed; /* changed aspects of the keyboard */ |
57 | char req_major; /* major and minor opcode of req */ |
58 | char req_minor; /* that caused change, if applicable */ |
59 | } XkbNewKeyboardNotifyEvent; |
60 | |
61 | typedef struct _XkbMapNotifyEvent { |
62 | int type; /* XkbAnyEvent */ |
63 | unsigned long serial; /* of last req processed by server */ |
64 | Bool send_event; /* is this from a SendEvent request */ |
65 | Display * display; /* Display the event was read from */ |
66 | Time time; /* milliseconds */ |
67 | int xkb_type; /* XkbMapNotify */ |
68 | int device; /* device ID */ |
69 | unsigned int changed; /* fields which have been changed */ |
70 | unsigned int flags; /* reserved */ |
71 | int first_type; /* first changed key type */ |
72 | int num_types; /* number of changed key types */ |
73 | KeyCode min_key_code; |
74 | KeyCode max_key_code; |
75 | KeyCode first_key_sym; |
76 | KeyCode first_key_act; |
77 | KeyCode first_key_behavior; |
78 | KeyCode first_key_explicit; |
79 | KeyCode first_modmap_key; |
80 | KeyCode first_vmodmap_key; |
81 | int num_key_syms; |
82 | int num_key_acts; |
83 | int num_key_behaviors; |
84 | int num_key_explicit; |
85 | int num_modmap_keys; |
86 | int num_vmodmap_keys; |
87 | unsigned int vmods; /* mask of changed virtual mods */ |
88 | } XkbMapNotifyEvent; |
89 | |
90 | typedef struct _XkbStateNotifyEvent { |
91 | int type; /* XkbAnyEvent */ |
92 | unsigned long serial; /* # of last req processed by server */ |
93 | Bool send_event; /* is this from a SendEvent request? */ |
94 | Display * display; /* Display the event was read from */ |
95 | Time time; /* milliseconds */ |
96 | int xkb_type; /* XkbStateNotify */ |
97 | int device; /* device ID */ |
98 | unsigned int changed; /* mask of changed state components */ |
99 | int group; /* keyboard group */ |
100 | int base_group; /* base keyboard group */ |
101 | int latched_group; /* latched keyboard group */ |
102 | int locked_group; /* locked keyboard group */ |
103 | unsigned int mods; /* modifier state */ |
104 | unsigned int base_mods; /* base modifier state */ |
105 | unsigned int latched_mods; /* latched modifiers */ |
106 | unsigned int locked_mods; /* locked modifiers */ |
107 | int compat_state; /* compatibility state */ |
108 | unsigned char grab_mods; /* mods used for grabs */ |
109 | unsigned char compat_grab_mods;/* grab mods for non-XKB clients */ |
110 | unsigned char lookup_mods; /* mods sent to clients */ |
111 | unsigned char compat_lookup_mods; /* mods sent to non-XKB clients */ |
112 | int ptr_buttons; /* pointer button state */ |
113 | KeyCode keycode; /* keycode that caused the change */ |
114 | char event_type; /* KeyPress or KeyRelease */ |
115 | char req_major; /* Major opcode of request */ |
116 | char req_minor; /* Minor opcode of request */ |
117 | } XkbStateNotifyEvent; |
118 | |
119 | typedef struct _XkbControlsNotify { |
120 | int type; /* XkbAnyEvent */ |
121 | unsigned long serial; /* of last req processed by server */ |
122 | Bool send_event; /* is this from a SendEvent request? */ |
123 | Display * display; /* Display the event was read from */ |
124 | Time time; /* milliseconds */ |
125 | int xkb_type; /* XkbControlsNotify */ |
126 | int device; /* device ID */ |
127 | unsigned int changed_ctrls; /* controls with changed sub-values */ |
128 | unsigned int enabled_ctrls; /* controls currently enabled */ |
129 | unsigned int enabled_ctrl_changes;/* controls just {en,dis}abled */ |
130 | int num_groups; /* total groups on keyboard */ |
131 | KeyCode keycode; /* key that caused change or 0 */ |
132 | char event_type; /* type of event that caused change */ |
133 | char req_major; /* if keycode==0, major and minor */ |
134 | char req_minor; /* opcode of req that caused change */ |
135 | } XkbControlsNotifyEvent; |
136 | |
137 | typedef struct _XkbIndicatorNotify { |
138 | int type; /* XkbAnyEvent */ |
139 | unsigned long serial; /* of last req processed by server */ |
140 | Bool send_event; /* is this from a SendEvent request? */ |
141 | Display * display; /* Display the event was read from */ |
142 | Time time; /* milliseconds */ |
143 | int xkb_type; /* XkbIndicatorNotify */ |
144 | int device; /* device ID */ |
145 | unsigned int changed; /* indicators with new state or map */ |
146 | unsigned int state; /* current state of all indicators */ |
147 | } XkbIndicatorNotifyEvent; |
148 | |
149 | typedef struct _XkbNamesNotify { |
150 | int type; /* XkbAnyEvent */ |
151 | unsigned long serial; /* of last req processed by server */ |
152 | Bool send_event; /* is this from a SendEvent request? */ |
153 | Display * display; /* Display the event was read from */ |
154 | Time time; /* milliseconds */ |
155 | int xkb_type; /* XkbNamesNotify */ |
156 | int device; /* device ID */ |
157 | unsigned int changed; /* names that have changed */ |
158 | int first_type; /* first key type with new name */ |
159 | int num_types; /* number of key types with new names */ |
160 | int first_lvl; /* first key type new new level names */ |
161 | int num_lvls; /* # of key types w/new level names */ |
162 | int num_aliases; /* total number of key aliases*/ |
163 | int num_radio_groups;/* total number of radio groups */ |
164 | unsigned int changed_vmods; /* virtual modifiers with new names */ |
165 | unsigned int changed_groups; /* groups with new names */ |
166 | unsigned int changed_indicators;/* indicators with new names */ |
167 | int first_key; /* first key with new name */ |
168 | int num_keys; /* number of keys with new names */ |
169 | } XkbNamesNotifyEvent; |
170 | |
171 | typedef struct _XkbCompatMapNotify { |
172 | int type; /* XkbAnyEvent */ |
173 | unsigned long serial; /* of last req processed by server */ |
174 | Bool send_event; /* is this from a SendEvent request? */ |
175 | Display * display; /* Display the event was read from */ |
176 | Time time; /* milliseconds */ |
177 | int xkb_type; /* XkbCompatMapNotify */ |
178 | int device; /* device ID */ |
179 | unsigned int changed_groups; /* groups with new compat maps */ |
180 | int first_si; /* first new symbol interp */ |
181 | int num_si; /* number of new symbol interps */ |
182 | int num_total_si; /* total # of symbol interps */ |
183 | } XkbCompatMapNotifyEvent; |
184 | |
185 | typedef struct _XkbBellNotify { |
186 | int type; /* XkbAnyEvent */ |
187 | unsigned long serial; /* of last req processed by server */ |
188 | Bool send_event; /* is this from a SendEvent request? */ |
189 | Display * display; /* Display the event was read from */ |
190 | Time time; /* milliseconds */ |
191 | int xkb_type; /* XkbBellNotify */ |
192 | int device; /* device ID */ |
193 | int percent; /* requested volume as a % of maximum */ |
194 | int pitch; /* requested pitch in Hz */ |
195 | int duration; /* requested duration in useconds */ |
196 | int bell_class; /* (input extension) feedback class */ |
197 | int bell_id; /* (input extension) ID of feedback */ |
198 | Atom name; /* "name" of requested bell */ |
199 | Window window; /* window associated with event */ |
200 | Bool event_only; /* "event only" requested */ |
201 | } XkbBellNotifyEvent; |
202 | |
203 | typedef struct _XkbActionMessage { |
204 | int type; /* XkbAnyEvent */ |
205 | unsigned long serial; /* of last req processed by server */ |
206 | Bool send_event; /* is this from a SendEvent request? */ |
207 | Display * display; /* Display the event was read from */ |
208 | Time time; /* milliseconds */ |
209 | int xkb_type; /* XkbActionMessage */ |
210 | int device; /* device ID */ |
211 | KeyCode keycode; /* key that generated the event */ |
212 | Bool press; /* true if act caused by key press */ |
213 | Bool key_event_follows;/* true if key event also generated */ |
214 | int group; /* effective group */ |
215 | unsigned int mods; /* effective mods */ |
216 | char message[XkbActionMessageLength+1]; |
217 | /* message -- leave space for NUL */ |
218 | } XkbActionMessageEvent; |
219 | |
220 | typedef struct _XkbAccessXNotify { |
221 | int type; /* XkbAnyEvent */ |
222 | unsigned long serial; /* of last req processed by server */ |
223 | Bool send_event; /* is this from a SendEvent request? */ |
224 | Display * display; /* Display the event was read from */ |
225 | Time time; /* milliseconds */ |
226 | int xkb_type; /* XkbAccessXNotify */ |
227 | int device; /* device ID */ |
228 | int detail; /* XkbAXN_* */ |
229 | int keycode; /* key of event */ |
230 | int sk_delay; /* current slow keys delay */ |
231 | int debounce_delay; /* current debounce delay */ |
232 | } XkbAccessXNotifyEvent; |
233 | |
234 | typedef struct _XkbExtensionDeviceNotify { |
235 | int type; /* XkbAnyEvent */ |
236 | unsigned long serial; /* of last req processed by server */ |
237 | Bool send_event; /* is this from a SendEvent request? */ |
238 | Display * display; /* Display the event was read from */ |
239 | Time time; /* milliseconds */ |
240 | int xkb_type; /* XkbExtensionDeviceNotify */ |
241 | int device; /* device ID */ |
242 | unsigned int reason; /* reason for the event */ |
243 | unsigned int supported; /* mask of supported features */ |
244 | unsigned int unsupported; /* mask of unsupported features */ |
245 | /* that some app tried to use */ |
246 | int first_btn; /* first button that changed */ |
247 | int num_btns; /* range of buttons changed */ |
248 | unsigned int leds_defined; /* indicators with names or maps */ |
249 | unsigned int led_state; /* current state of the indicators */ |
250 | int led_class; /* feedback class for led changes */ |
251 | int led_id; /* feedback id for led changes */ |
252 | } XkbExtensionDeviceNotifyEvent; |
253 | |
254 | typedef union _XkbEvent { |
255 | int type; |
256 | XkbAnyEvent any; |
257 | XkbNewKeyboardNotifyEvent new_kbd; |
258 | XkbMapNotifyEvent map; |
259 | XkbStateNotifyEvent state; |
260 | XkbControlsNotifyEvent ctrls; |
261 | XkbIndicatorNotifyEvent indicators; |
262 | XkbNamesNotifyEvent names; |
263 | XkbCompatMapNotifyEvent compat; |
264 | XkbBellNotifyEvent bell; |
265 | XkbActionMessageEvent message; |
266 | XkbAccessXNotifyEvent accessx; |
267 | XkbExtensionDeviceNotifyEvent device; |
268 | XEvent core; |
269 | } XkbEvent; |
270 | |
271 | typedef struct _XkbKbdDpyState XkbKbdDpyStateRec,*XkbKbdDpyStatePtr; |
272 | |
273 | /* XkbOpenDisplay error codes */ |
274 | #define XkbOD_Success 0 |
275 | #define XkbOD_BadLibraryVersion 1 |
276 | #define XkbOD_ConnectionRefused 2 |
277 | #define XkbOD_NonXkbServer 3 |
278 | #define XkbOD_BadServerVersion 4 |
279 | |
280 | /* Values for XlibFlags */ |
281 | #define XkbLC_ForceLatin1Lookup (1<<0) |
282 | #define XkbLC_ConsumeLookupMods (1<<1) |
283 | #define XkbLC_AlwaysConsumeShiftAndLock (1<<2) |
284 | #define XkbLC_IgnoreNewKeyboards (1<<3) |
285 | #define XkbLC_ControlFallback (1<<4) |
286 | #define XkbLC_ConsumeKeysOnComposeFail (1<<29) |
287 | #define XkbLC_ComposeLED (1<<30) |
288 | #define XkbLC_BeepOnComposeFail (1<<31) |
289 | |
290 | #define XkbLC_AllComposeControls (0xc0000000) |
291 | #define XkbLC_AllControls (0xc000001f) |
292 | |
293 | _XFUNCPROTOBEGIN |
294 | |
295 | extern Bool XkbIgnoreExtension( |
296 | Bool /* ignore */ |
297 | ); |
298 | |
299 | extern Display *XkbOpenDisplay( |
300 | char * /* name */, |
301 | int * /* ev_rtrn */, |
302 | int * /* err_rtrn */, |
303 | int * /* major_rtrn */, |
304 | int * /* minor_rtrn */, |
305 | int * /* reason */ |
306 | ); |
307 | |
308 | extern Bool XkbQueryExtension( |
309 | Display * /* dpy */, |
310 | int * /* opcodeReturn */, |
311 | int * /* eventBaseReturn */, |
312 | int * /* errorBaseReturn */, |
313 | int * /* majorRtrn */, |
314 | int * /* minorRtrn */ |
315 | ); |
316 | |
317 | extern Bool XkbUseExtension( |
318 | Display * /* dpy */, |
319 | int * /* major_rtrn */, |
320 | int * /* minor_rtrn */ |
321 | ); |
322 | |
323 | extern Bool XkbLibraryVersion( |
324 | int * /* libMajorRtrn */, |
325 | int * /* libMinorRtrn */ |
326 | ); |
327 | |
328 | extern unsigned int XkbSetXlibControls( |
329 | Display* /* dpy */, |
330 | unsigned int /* affect */, |
331 | unsigned int /* values */ |
332 | ); |
333 | |
334 | extern unsigned int XkbGetXlibControls( |
335 | Display* /* dpy */ |
336 | ); |
337 | |
338 | extern unsigned int XkbXlibControlsImplemented(void); |
339 | |
340 | typedef Atom (*XkbInternAtomFunc)( |
341 | Display * /* dpy */, |
342 | _Xconst char * /* name */, |
343 | Bool /* only_if_exists */ |
344 | ); |
345 | |
346 | typedef char * (*XkbGetAtomNameFunc)( |
347 | Display * /* dpy */, |
348 | Atom /* atom */ |
349 | ); |
350 | |
351 | extern void XkbSetAtomFuncs( |
352 | XkbInternAtomFunc /* getAtom */, |
353 | XkbGetAtomNameFunc /* getName */ |
354 | ); |
355 | |
356 | extern KeySym XkbKeycodeToKeysym( |
357 | Display * /* dpy */, |
358 | #if NeedWidePrototypes |
359 | unsigned int /* kc */, |
360 | #else |
361 | KeyCode /* kc */, |
362 | #endif |
363 | int /* group */, |
364 | int /* level */ |
365 | ); |
366 | |
367 | extern unsigned int XkbKeysymToModifiers( |
368 | Display * /* dpy */, |
369 | KeySym /* ks */ |
370 | ); |
371 | |
372 | extern Bool XkbLookupKeySym( |
373 | Display * /* dpy */, |
374 | KeyCode /* keycode */, |
375 | unsigned int /* modifiers */, |
376 | unsigned int * /* modifiers_return */, |
377 | KeySym * /* keysym_return */ |
378 | ); |
379 | |
380 | extern int XkbLookupKeyBinding( |
381 | Display * /* dpy */, |
382 | KeySym /* sym_rtrn */, |
383 | unsigned int /* mods */, |
384 | char * /* buffer */, |
385 | int /* nbytes */, |
386 | int * /* extra_rtrn */ |
387 | ); |
388 | |
389 | extern Bool XkbTranslateKeyCode( |
390 | XkbDescPtr /* xkb */, |
391 | KeyCode /* keycode */, |
392 | unsigned int /* modifiers */, |
393 | unsigned int * /* modifiers_return */, |
394 | KeySym * /* keysym_return */ |
395 | ); |
396 | |
397 | extern int XkbTranslateKeySym( |
398 | Display * /* dpy */, |
399 | KeySym * /* sym_return */, |
400 | unsigned int /* modifiers */, |
401 | char * /* buffer */, |
402 | int /* nbytes */, |
403 | int * /* extra_rtrn */ |
404 | ); |
405 | |
406 | extern Bool XkbSetAutoRepeatRate( |
407 | Display * /* dpy */, |
408 | unsigned int /* deviceSpec */, |
409 | unsigned int /* delay */, |
410 | unsigned int /* interval */ |
411 | ); |
412 | |
413 | extern Bool XkbGetAutoRepeatRate( |
414 | Display * /* dpy */, |
415 | unsigned int /* deviceSpec */, |
416 | unsigned int * /* delayRtrn */, |
417 | unsigned int * /* intervalRtrn */ |
418 | ); |
419 | |
420 | extern Bool XkbChangeEnabledControls( |
421 | Display * /* dpy */, |
422 | unsigned int /* deviceSpec */, |
423 | unsigned int /* affect */, |
424 | unsigned int /* values */ |
425 | ); |
426 | |
427 | extern Bool XkbDeviceBell( |
428 | Display * /* dpy */, |
429 | Window /* win */, |
430 | int /* deviceSpec */, |
431 | int /* bellClass */, |
432 | int /* bellID */, |
433 | int /* percent */, |
434 | Atom /* name */ |
435 | ); |
436 | |
437 | extern Bool XkbForceDeviceBell( |
438 | Display * /* dpy */, |
439 | int /* deviceSpec */, |
440 | int /* bellClass */, |
441 | int /* bellID */, |
442 | int /* percent */ |
443 | ); |
444 | |
445 | extern Bool XkbDeviceBellEvent( |
446 | Display * /* dpy */, |
447 | Window /* win */, |
448 | int /* deviceSpec */, |
449 | int /* bellClass */, |
450 | int /* bellID */, |
451 | int /* percent */, |
452 | Atom /* name */ |
453 | ); |
454 | |
455 | extern Bool XkbBell( |
456 | Display * /* dpy */, |
457 | Window /* win */, |
458 | int /* percent */, |
459 | Atom /* name */ |
460 | ); |
461 | |
462 | extern Bool XkbForceBell( |
463 | Display * /* dpy */, |
464 | int /* percent */ |
465 | ); |
466 | |
467 | extern Bool XkbBellEvent( |
468 | Display * /* dpy */, |
469 | Window /* win */, |
470 | int /* percent */, |
471 | Atom /* name */ |
472 | ); |
473 | |
474 | extern Bool XkbSelectEvents( |
475 | Display * /* dpy */, |
476 | unsigned int /* deviceID */, |
477 | unsigned int /* affect */, |
478 | unsigned int /* values */ |
479 | ); |
480 | |
481 | extern Bool XkbSelectEventDetails( |
482 | Display * /* dpy */, |
483 | unsigned int /* deviceID */, |
484 | unsigned int /* eventType */, |
485 | unsigned long /* affect */, |
486 | unsigned long /* details */ |
487 | ); |
488 | |
489 | extern void XkbNoteMapChanges( |
490 | XkbMapChangesPtr /* old */, |
491 | XkbMapNotifyEvent * /* new */, |
492 | unsigned int /* wanted */ |
493 | ); |
494 | |
495 | extern void XkbNoteNameChanges( |
496 | XkbNameChangesPtr /* old */, |
497 | XkbNamesNotifyEvent * /* new */, |
498 | unsigned int /* wanted */ |
499 | ); |
500 | |
501 | extern Status XkbGetIndicatorState( |
502 | Display * /* dpy */, |
503 | unsigned int /* deviceSpec */, |
504 | unsigned int * /* pStateRtrn */ |
505 | ); |
506 | |
507 | extern Status XkbGetDeviceIndicatorState( |
508 | Display * /* dpy */, |
509 | unsigned int /* deviceSpec */, |
510 | unsigned int /* ledClass */, |
511 | unsigned int /* ledID */, |
512 | unsigned int * /* pStateRtrn */ |
513 | ); |
514 | |
515 | extern Status XkbGetIndicatorMap( |
516 | Display * /* dpy */, |
517 | unsigned long /* which */, |
518 | XkbDescPtr /* desc */ |
519 | ); |
520 | |
521 | extern Bool XkbSetIndicatorMap( |
522 | Display * /* dpy */, |
523 | unsigned long /* which */, |
524 | XkbDescPtr /* desc */ |
525 | ); |
526 | |
527 | #define XkbNoteIndicatorMapChanges(o,n,w) \ |
528 | ((o)->map_changes|=((n)->map_changes&(w))) |
529 | #define XkbNoteIndicatorStateChanges(o,n,w)\ |
530 | ((o)->state_changes|=((n)->state_changes&(w))) |
531 | #define XkbGetIndicatorMapChanges(d,x,c) \ |
532 | (XkbGetIndicatorMap((d),(c)->map_changes,x)) |
533 | #define XkbChangeIndicatorMaps(d,x,c) \ |
534 | (XkbSetIndicatorMap((d),(c)->map_changes,x)) |
535 | |
536 | extern Bool XkbGetNamedIndicator( |
537 | Display * /* dpy */, |
538 | Atom /* name */, |
539 | int * /* pNdxRtrn */, |
540 | Bool * /* pStateRtrn */, |
541 | XkbIndicatorMapPtr /* pMapRtrn */, |
542 | Bool * /* pRealRtrn */ |
543 | ); |
544 | |
545 | extern Bool XkbGetNamedDeviceIndicator( |
546 | Display * /* dpy */, |
547 | unsigned int /* deviceSpec */, |
548 | unsigned int /* ledClass */, |
549 | unsigned int /* ledID */, |
550 | Atom /* name */, |
551 | int * /* pNdxRtrn */, |
552 | Bool * /* pStateRtrn */, |
553 | XkbIndicatorMapPtr /* pMapRtrn */, |
554 | Bool * /* pRealRtrn */ |
555 | ); |
556 | |
557 | extern Bool XkbSetNamedIndicator( |
558 | Display * /* dpy */, |
559 | Atom /* name */, |
560 | Bool /* changeState */, |
561 | Bool /* state */, |
562 | Bool /* createNewMap */, |
563 | XkbIndicatorMapPtr /* pMap */ |
564 | ); |
565 | |
566 | extern Bool XkbSetNamedDeviceIndicator( |
567 | Display * /* dpy */, |
568 | unsigned int /* deviceSpec */, |
569 | unsigned int /* ledClass */, |
570 | unsigned int /* ledID */, |
571 | Atom /* name */, |
572 | Bool /* changeState */, |
573 | Bool /* state */, |
574 | Bool /* createNewMap */, |
575 | XkbIndicatorMapPtr /* pMap */ |
576 | ); |
577 | |
578 | extern Bool XkbLockModifiers( |
579 | Display * /* dpy */, |
580 | unsigned int /* deviceSpec */, |
581 | unsigned int /* affect */, |
582 | unsigned int /* values */ |
583 | ); |
584 | |
585 | extern Bool XkbLatchModifiers( |
586 | Display * /* dpy */, |
587 | unsigned int /* deviceSpec */, |
588 | unsigned int /* affect */, |
589 | unsigned int /* values */ |
590 | ); |
591 | |
592 | extern Bool XkbLockGroup( |
593 | Display * /* dpy */, |
594 | unsigned int /* deviceSpec */, |
595 | unsigned int /* group */ |
596 | ); |
597 | |
598 | extern Bool XkbLatchGroup( |
599 | Display * /* dpy */, |
600 | unsigned int /* deviceSpec */, |
601 | unsigned int /* group */ |
602 | ); |
603 | |
604 | extern Bool XkbSetServerInternalMods( |
605 | Display * /* dpy */, |
606 | unsigned int /* deviceSpec */, |
607 | unsigned int /* affectReal */, |
608 | unsigned int /* realValues */, |
609 | unsigned int /* affectVirtual */, |
610 | unsigned int /* virtualValues */ |
611 | ); |
612 | |
613 | extern Bool XkbSetIgnoreLockMods( |
614 | Display * /* dpy */, |
615 | unsigned int /* deviceSpec */, |
616 | unsigned int /* affectReal */, |
617 | unsigned int /* realValues */, |
618 | unsigned int /* affectVirtual */, |
619 | unsigned int /* virtualValues */ |
620 | ); |
621 | |
622 | |
623 | extern Bool XkbVirtualModsToReal( |
624 | XkbDescPtr /* xkb */, |
625 | unsigned int /* virtual_mask */, |
626 | unsigned int * /* mask_rtrn */ |
627 | ); |
628 | |
629 | extern Bool XkbComputeEffectiveMap( |
630 | XkbDescPtr /* xkb */, |
631 | XkbKeyTypePtr /* type */, |
632 | unsigned char * /* map_rtrn */ |
633 | ); |
634 | |
635 | extern Status XkbInitCanonicalKeyTypes( |
636 | XkbDescPtr /* xkb */, |
637 | unsigned int /* which */, |
638 | int /* keypadVMod */ |
639 | ); |
640 | |
641 | extern XkbDescPtr XkbAllocKeyboard( |
642 | void |
643 | ); |
644 | |
645 | extern void XkbFreeKeyboard( |
646 | XkbDescPtr /* xkb */, |
647 | unsigned int /* which */, |
648 | Bool /* freeDesc */ |
649 | ); |
650 | |
651 | extern Status XkbAllocClientMap( |
652 | XkbDescPtr /* xkb */, |
653 | unsigned int /* which */, |
654 | unsigned int /* nTypes */ |
655 | ); |
656 | |
657 | extern Status XkbAllocServerMap( |
658 | XkbDescPtr /* xkb */, |
659 | unsigned int /* which */, |
660 | unsigned int /* nActions */ |
661 | ); |
662 | |
663 | extern void XkbFreeClientMap( |
664 | XkbDescPtr /* xkb */, |
665 | unsigned int /* what */, |
666 | Bool /* freeMap */ |
667 | ); |
668 | |
669 | extern void XkbFreeServerMap( |
670 | XkbDescPtr /* xkb */, |
671 | unsigned int /* what */, |
672 | Bool /* freeMap */ |
673 | ); |
674 | |
675 | extern XkbKeyTypePtr XkbAddKeyType( |
676 | XkbDescPtr /* xkb */, |
677 | Atom /* name */, |
678 | int /* map_count */, |
679 | Bool /* want_preserve */, |
680 | int /* num_lvls */ |
681 | ); |
682 | |
683 | extern Status XkbAllocIndicatorMaps( |
684 | XkbDescPtr /* xkb */ |
685 | ); |
686 | |
687 | extern void XkbFreeIndicatorMaps( |
688 | XkbDescPtr /* xkb */ |
689 | ); |
690 | |
691 | extern XkbDescPtr XkbGetMap( |
692 | Display * /* dpy */, |
693 | unsigned int /* which */, |
694 | unsigned int /* deviceSpec */ |
695 | ); |
696 | |
697 | extern Status XkbGetUpdatedMap( |
698 | Display * /* dpy */, |
699 | unsigned int /* which */, |
700 | XkbDescPtr /* desc */ |
701 | ); |
702 | |
703 | extern Status XkbGetMapChanges( |
704 | Display * /* dpy */, |
705 | XkbDescPtr /* xkb */, |
706 | XkbMapChangesPtr /* changes */ |
707 | ); |
708 | |
709 | |
710 | extern Status XkbRefreshKeyboardMapping( |
711 | XkbMapNotifyEvent * /* event */ |
712 | ); |
713 | |
714 | extern Status XkbGetKeyTypes( |
715 | Display * /* dpy */, |
716 | unsigned int /* first */, |
717 | unsigned int /* num */, |
718 | XkbDescPtr /* xkb */ |
719 | ); |
720 | |
721 | extern Status XkbGetKeySyms( |
722 | Display * /* dpy */, |
723 | unsigned int /* first */, |
724 | unsigned int /* num */, |
725 | XkbDescPtr /* xkb */ |
726 | ); |
727 | |
728 | extern Status XkbGetKeyActions( |
729 | Display * /* dpy */, |
730 | unsigned int /* first */, |
731 | unsigned int /* num */, |
732 | XkbDescPtr /* xkb */ |
733 | ); |
734 | |
735 | extern Status XkbGetKeyBehaviors( |
736 | Display * /* dpy */, |
737 | unsigned int /* firstKey */, |
738 | unsigned int /* nKeys */, |
739 | XkbDescPtr /* desc */ |
740 | ); |
741 | |
742 | extern Status XkbGetVirtualMods( |
743 | Display * /* dpy */, |
744 | unsigned int /* which */, |
745 | XkbDescPtr /* desc */ |
746 | ); |
747 | |
748 | extern Status XkbGetKeyExplicitComponents( |
749 | Display * /* dpy */, |
750 | unsigned int /* firstKey */, |
751 | unsigned int /* nKeys */, |
752 | XkbDescPtr /* desc */ |
753 | ); |
754 | |
755 | extern Status XkbGetKeyModifierMap( |
756 | Display * /* dpy */, |
757 | unsigned int /* firstKey */, |
758 | unsigned int /* nKeys */, |
759 | XkbDescPtr /* desc */ |
760 | ); |
761 | |
762 | extern Status XkbGetKeyVirtualModMap( |
763 | Display * /* dpy */, |
764 | unsigned int /* first */, |
765 | unsigned int /* num */, |
766 | XkbDescPtr /* xkb */ |
767 | ); |
768 | |
769 | extern Status XkbAllocControls( |
770 | XkbDescPtr /* xkb */, |
771 | unsigned int /* which*/ |
772 | ); |
773 | |
774 | extern void XkbFreeControls( |
775 | XkbDescPtr /* xkb */, |
776 | unsigned int /* which */, |
777 | Bool /* freeMap */ |
778 | ); |
779 | |
780 | extern Status XkbGetControls( |
781 | Display * /* dpy */, |
782 | unsigned long /* which */, |
783 | XkbDescPtr /* desc */ |
784 | ); |
785 | |
786 | extern Bool XkbSetControls( |
787 | Display * /* dpy */, |
788 | unsigned long /* which */, |
789 | XkbDescPtr /* desc */ |
790 | ); |
791 | |
792 | extern void XkbNoteControlsChanges( |
793 | XkbControlsChangesPtr /* old */, |
794 | XkbControlsNotifyEvent * /* new */, |
795 | unsigned int /* wanted */ |
796 | ); |
797 | |
798 | #define XkbGetControlsChanges(d,x,c) XkbGetControls(d,(c)->changed_ctrls,x) |
799 | #define XkbChangeControls(d,x,c) XkbSetControls(d,(c)->changed_ctrls,x) |
800 | |
801 | extern Status XkbAllocCompatMap( |
802 | XkbDescPtr /* xkb */, |
803 | unsigned int /* which */, |
804 | unsigned int /* nInterpret */ |
805 | ); |
806 | |
807 | extern void XkbFreeCompatMap( |
808 | XkbDescPtr /* xkb */, |
809 | unsigned int /* which */, |
810 | Bool /* freeMap */ |
811 | ); |
812 | |
813 | extern Status XkbGetCompatMap( |
814 | Display * /* dpy */, |
815 | unsigned int /* which */, |
816 | XkbDescPtr /* xkb */ |
817 | ); |
818 | |
819 | extern Bool XkbSetCompatMap( |
820 | Display * /* dpy */, |
821 | unsigned int /* which */, |
822 | XkbDescPtr /* xkb */, |
823 | Bool /* updateActions */ |
824 | ); |
825 | |
826 | extern XkbSymInterpretPtr XkbAddSymInterpret( |
827 | XkbDescPtr /* xkb */, |
828 | XkbSymInterpretPtr /* si */, |
829 | Bool /* updateMap */, |
830 | XkbChangesPtr /* changes */ |
831 | ); |
832 | |
833 | extern Status XkbAllocNames( |
834 | XkbDescPtr /* xkb */, |
835 | unsigned int /* which */, |
836 | int /* nTotalRG */, |
837 | int /* nTotalAliases */ |
838 | ); |
839 | |
840 | extern Status XkbGetNames( |
841 | Display * /* dpy */, |
842 | unsigned int /* which */, |
843 | XkbDescPtr /* desc */ |
844 | ); |
845 | |
846 | extern Bool XkbSetNames( |
847 | Display * /* dpy */, |
848 | unsigned int /* which */, |
849 | unsigned int /* firstType */, |
850 | unsigned int /* nTypes */, |
851 | XkbDescPtr /* desc */ |
852 | ); |
853 | |
854 | extern Bool XkbChangeNames( |
855 | Display * /* dpy */, |
856 | XkbDescPtr /* xkb */, |
857 | XkbNameChangesPtr /* changes */ |
858 | ); |
859 | |
860 | extern void XkbFreeNames( |
861 | XkbDescPtr /* xkb */, |
862 | unsigned int /* which */, |
863 | Bool /* freeMap */ |
864 | ); |
865 | |
866 | |
867 | extern Status XkbGetState( |
868 | Display * /* dpy */, |
869 | unsigned int /* deviceSpec */, |
870 | XkbStatePtr /* rtrnState */ |
871 | ); |
872 | |
873 | extern Bool XkbSetMap( |
874 | Display * /* dpy */, |
875 | unsigned int /* which */, |
876 | XkbDescPtr /* desc */ |
877 | ); |
878 | |
879 | extern Bool XkbChangeMap( |
880 | Display* /* dpy */, |
881 | XkbDescPtr /* desc */, |
882 | XkbMapChangesPtr /* changes */ |
883 | ); |
884 | |
885 | extern Bool XkbSetDetectableAutoRepeat( |
886 | Display * /* dpy */, |
887 | Bool /* detectable */, |
888 | Bool * /* supported */ |
889 | ); |
890 | |
891 | extern Bool XkbGetDetectableAutoRepeat( |
892 | Display * /* dpy */, |
893 | Bool * /* supported */ |
894 | ); |
895 | |
896 | extern Bool XkbSetAutoResetControls( |
897 | Display * /* dpy */, |
898 | unsigned int /* changes */, |
899 | unsigned int * /* auto_ctrls */, |
900 | unsigned int * /* auto_values */ |
901 | ); |
902 | |
903 | extern Bool XkbGetAutoResetControls( |
904 | Display * /* dpy */, |
905 | unsigned int * /* auto_ctrls */, |
906 | unsigned int * /* auto_ctrl_values */ |
907 | ); |
908 | |
909 | extern Bool XkbSetPerClientControls( |
910 | Display * /* dpy */, |
911 | unsigned int /* change */, |
912 | unsigned int * /* values */ |
913 | ); |
914 | |
915 | extern Bool XkbGetPerClientControls( |
916 | Display * /* dpy */, |
917 | unsigned int * /* ctrls */ |
918 | ); |
919 | |
920 | extern Status XkbCopyKeyType( |
921 | XkbKeyTypePtr /* from */, |
922 | XkbKeyTypePtr /* into */ |
923 | ); |
924 | |
925 | extern Status XkbCopyKeyTypes( |
926 | XkbKeyTypePtr /* from */, |
927 | XkbKeyTypePtr /* into */, |
928 | int /* num_types */ |
929 | ); |
930 | |
931 | extern Status XkbResizeKeyType( |
932 | XkbDescPtr /* xkb */, |
933 | int /* type_ndx */, |
934 | int /* map_count */, |
935 | Bool /* want_preserve */, |
936 | int /* new_num_lvls */ |
937 | ); |
938 | |
939 | extern KeySym *XkbResizeKeySyms( |
940 | XkbDescPtr /* desc */, |
941 | int /* forKey */, |
942 | int /* symsNeeded */ |
943 | ); |
944 | |
945 | extern XkbAction *XkbResizeKeyActions( |
946 | XkbDescPtr /* desc */, |
947 | int /* forKey */, |
948 | int /* actsNeeded */ |
949 | ); |
950 | |
951 | extern Status XkbChangeTypesOfKey( |
952 | XkbDescPtr /* xkb */, |
953 | int /* key */, |
954 | int /* num_groups */, |
955 | unsigned int /* groups */, |
956 | int * /* newTypes */, |
957 | XkbMapChangesPtr /* pChanges */ |
958 | ); |
959 | |
960 | extern Status XkbChangeKeycodeRange( |
961 | XkbDescPtr /* xkb */, |
962 | int /* minKC */, |
963 | int /* maxKC */, |
964 | XkbChangesPtr /* changes */ |
965 | ); |
966 | |
967 | /***====================================================================***/ |
968 | |
969 | extern XkbComponentListPtr XkbListComponents( |
970 | Display * /* dpy */, |
971 | unsigned int /* deviceSpec */, |
972 | XkbComponentNamesPtr /* ptrns */, |
973 | int * /* max_inout */ |
974 | ); |
975 | |
976 | extern void XkbFreeComponentList( |
977 | XkbComponentListPtr /* list */ |
978 | ); |
979 | |
980 | extern XkbDescPtr XkbGetKeyboard( |
981 | Display * /* dpy */, |
982 | unsigned int /* which */, |
983 | unsigned int /* deviceSpec */ |
984 | ); |
985 | |
986 | extern XkbDescPtr XkbGetKeyboardByName( |
987 | Display * /* dpy */, |
988 | unsigned int /* deviceSpec */, |
989 | XkbComponentNamesPtr /* names */, |
990 | unsigned int /* want */, |
991 | unsigned int /* need */, |
992 | Bool /* load */ |
993 | ); |
994 | |
995 | /***====================================================================***/ |
996 | |
997 | extern int XkbKeyTypesForCoreSymbols( /* returns # of groups */ |
998 | XkbDescPtr /* xkb */, /* keyboard device */ |
999 | int /* map_width */, /* width of core KeySym array */ |
1000 | KeySym * /* core_syms */, /* always mapWidth symbols */ |
1001 | unsigned int /* protected */, /* explicit key types */ |
1002 | int * /* types_inout */, /* always four type indices */ |
1003 | KeySym * /* xkb_syms_rtrn */ /* must have enough space */ |
1004 | ); |
1005 | |
1006 | extern Bool XkbApplyCompatMapToKey( /* False only on error */ |
1007 | XkbDescPtr /* xkb */, /* keymap to be edited */ |
1008 | KeyCode /* key */, /* key to be updated */ |
1009 | XkbChangesPtr /* changes */ /* resulting changes to map */ |
1010 | ); |
1011 | |
1012 | extern Bool XkbUpdateMapFromCore( /* False only on error */ |
1013 | XkbDescPtr /* xkb */, /* XKB keyboard to be edited */ |
1014 | KeyCode /* first_key */, /* first changed key */ |
1015 | int /* num_keys */, /* number of changed keys */ |
1016 | int /* map_width */, /* width of core keymap */ |
1017 | KeySym * /* core_keysyms */, /* symbols from core keymap */ |
1018 | XkbChangesPtr /* changes */ /* resulting changes */ |
1019 | ); |
1020 | |
1021 | /***====================================================================***/ |
1022 | |
1023 | extern XkbDeviceLedInfoPtr XkbAddDeviceLedInfo( |
1024 | XkbDeviceInfoPtr /* devi */, |
1025 | unsigned int /* ledClass */, |
1026 | unsigned int /* ledId */ |
1027 | ); |
1028 | |
1029 | extern Status XkbResizeDeviceButtonActions( |
1030 | XkbDeviceInfoPtr /* devi */, |
1031 | unsigned int /* newTotal */ |
1032 | ); |
1033 | |
1034 | extern XkbDeviceInfoPtr XkbAllocDeviceInfo( |
1035 | unsigned int /* deviceSpec */, |
1036 | unsigned int /* nButtons */, |
1037 | unsigned int /* szLeds */ |
1038 | ); |
1039 | |
1040 | extern void XkbFreeDeviceInfo( |
1041 | XkbDeviceInfoPtr /* devi */, |
1042 | unsigned int /* which */, |
1043 | Bool /* freeDevI */ |
1044 | ); |
1045 | |
1046 | extern void XkbNoteDeviceChanges( |
1047 | XkbDeviceChangesPtr /* old */, |
1048 | XkbExtensionDeviceNotifyEvent * /* new */, |
1049 | unsigned int /* wanted */ |
1050 | ); |
1051 | |
1052 | extern XkbDeviceInfoPtr XkbGetDeviceInfo( |
1053 | Display * /* dpy */, |
1054 | unsigned int /* which */, |
1055 | unsigned int /* deviceSpec */, |
1056 | unsigned int /* ledClass */, |
1057 | unsigned int /* ledID */ |
1058 | ); |
1059 | |
1060 | extern Status XkbGetDeviceInfoChanges( |
1061 | Display * /* dpy */, |
1062 | XkbDeviceInfoPtr /* devi */, |
1063 | XkbDeviceChangesPtr /* changes */ |
1064 | ); |
1065 | |
1066 | extern Status XkbGetDeviceButtonActions( |
1067 | Display * /* dpy */, |
1068 | XkbDeviceInfoPtr /* devi */, |
1069 | Bool /* all */, |
1070 | unsigned int /* first */, |
1071 | unsigned int /* nBtns */ |
1072 | ); |
1073 | |
1074 | extern Status XkbGetDeviceLedInfo( |
1075 | Display * /* dpy */, |
1076 | XkbDeviceInfoPtr /* devi */, |
1077 | unsigned int /* ledClass (class, XIDflt, XIAll) */, |
1078 | unsigned int /* ledId (id, XIDflt, XIAll) */, |
1079 | unsigned int /* which (XkbXI_Indicator{Names,Map}Mask */ |
1080 | ); |
1081 | |
1082 | extern Bool XkbSetDeviceInfo( |
1083 | Display * /* dpy */, |
1084 | unsigned int /* which */, |
1085 | XkbDeviceInfoPtr /* devi */ |
1086 | ); |
1087 | |
1088 | extern Bool XkbChangeDeviceInfo( |
1089 | Display* /* dpy */, |
1090 | XkbDeviceInfoPtr /* desc */, |
1091 | XkbDeviceChangesPtr /* changes */ |
1092 | ); |
1093 | |
1094 | extern Bool XkbSetDeviceLedInfo( |
1095 | Display * /* dpy */, |
1096 | XkbDeviceInfoPtr /* devi */, |
1097 | unsigned int /* ledClass */, |
1098 | unsigned int /* ledID */, |
1099 | unsigned int /* which */ |
1100 | ); |
1101 | |
1102 | extern Bool XkbSetDeviceButtonActions( |
1103 | Display * /* dpy */, |
1104 | XkbDeviceInfoPtr /* devi */, |
1105 | unsigned int /* first */, |
1106 | unsigned int /* nBtns */ |
1107 | ); |
1108 | |
1109 | /***====================================================================***/ |
1110 | |
1111 | extern char XkbToControl( |
1112 | char /* c */ |
1113 | ); |
1114 | |
1115 | /***====================================================================***/ |
1116 | |
1117 | extern Bool XkbSetDebuggingFlags( |
1118 | Display * /* dpy */, |
1119 | unsigned int /* mask */, |
1120 | unsigned int /* flags */, |
1121 | char * /* msg */, |
1122 | unsigned int /* ctrls_mask */, |
1123 | unsigned int /* ctrls */, |
1124 | unsigned int * /* rtrn_flags */, |
1125 | unsigned int * /* rtrn_ctrls */ |
1126 | ); |
1127 | |
1128 | extern Bool XkbApplyVirtualModChanges( |
1129 | XkbDescPtr /* xkb */, |
1130 | unsigned int /* changed */, |
1131 | XkbChangesPtr /* changes */ |
1132 | ); |
1133 | |
1134 | extern Bool XkbUpdateActionVirtualMods( |
1135 | XkbDescPtr /* xkb */, |
1136 | XkbAction * /* act */, |
1137 | unsigned int /* changed */ |
1138 | ); |
1139 | |
1140 | extern void XkbUpdateKeyTypeVirtualMods( |
1141 | XkbDescPtr /* xkb */, |
1142 | XkbKeyTypePtr /* type */, |
1143 | unsigned int /* changed */, |
1144 | XkbChangesPtr /* changes */ |
1145 | ); |
1146 | |
1147 | _XFUNCPROTOEND |
1148 | |
1149 | #endif /* _X11_XKBLIB_H_ */ |
1150 | |