1 /* $XConsortium: XKBlib.h /main/17 1996/03/01 14:30:14 kaleb $ */
2 /************************************************************
3 Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
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.
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.
26 ********************************************************/
31 #include <X11/extensions/XKBstr.h>
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 */
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;
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 */
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;
83 int num_key_behaviors;
87 unsigned int vmods; /* mask of changed virtual mods */
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;
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;
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;
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;
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;
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;
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;
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;
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;
254 typedef union _XkbEvent {
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;
271 typedef struct _XkbKbdDpyState XkbKbdDpyStateRec,*XkbKbdDpyStatePtr;
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
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)
290 #define XkbLC_AllComposeControls (0xc0000000)
291 #define XkbLC_AllControls (0xc000001f)
295 extern Bool XkbIgnoreExtension(
296 #if NeedFunctionPrototypes
301 extern Display *XkbOpenDisplay(
302 #if NeedFunctionPrototypes
305 int * /* err_rtrn */,
306 int * /* major_rtrn */,
307 int * /* minor_rtrn */,
312 extern Bool XkbQueryExtension(
313 #if NeedFunctionPrototypes
315 int * /* opcodeReturn */,
316 int * /* eventBaseReturn */,
317 int * /* errorBaseReturn */,
318 int * /* majorRtrn */,
319 int * /* minorRtrn */
323 extern Bool XkbUseExtension(
324 #if NeedFunctionPrototypes
326 int * /* major_rtrn */,
327 int * /* minor_rtrn */
331 extern Bool XkbLibraryVersion(
332 #if NeedFunctionPrototypes
333 int * /* libMajorRtrn */,
334 int * /* libMinorRtrn */
338 extern unsigned int XkbSetXlibControls(
339 #if NeedFunctionPrototypes
341 unsigned int /* affect */,
342 unsigned int /* values */
346 extern unsigned int XkbGetXlibControls(
347 #if NeedFunctionPrototypes
352 typedef Atom (*XkbInternAtomFunc)(
353 #if NeedFunctionPrototypes
355 _Xconst char * /* name */,
356 Bool /* only_if_exists */
360 typedef char * (*XkbGetAtomNameFunc)(
361 #if NeedFunctionPrototypes
367 extern void XkbSetAtomFuncs(
368 #if NeedFunctionPrototypes
369 XkbInternAtomFunc /* getAtom */,
370 XkbGetAtomNameFunc /* getName */
374 extern KeySym XkbKeycodeToKeysym(
375 #if NeedFunctionPrototypes
377 #if NeedWidePrototypes
378 unsigned int /* kc */,
387 extern unsigned int XkbKeysymToModifiers(
388 #if NeedFunctionPrototypes
394 extern Bool XkbLookupKeySym(
395 #if NeedFunctionPrototypes
397 KeyCode /* keycode */,
398 unsigned int /* modifiers */,
399 unsigned int * /* modifiers_return */,
400 KeySym * /* keysym_return */
404 extern int XkbLookupKeyBinding(
405 #if NeedFunctionPrototypes
407 KeySym /* sym_rtrn */,
408 unsigned int /* mods */,
411 int * /* extra_rtrn */
415 extern Bool XkbTranslateKeyCode(
416 #if NeedFunctionPrototypes
417 XkbDescPtr /* xkb */,
418 KeyCode /* keycode */,
419 unsigned int /* modifiers */,
420 unsigned int * /* modifiers_return */,
421 KeySym * /* keysym_return */
425 extern int XkbTranslateKeySym(
426 #if NeedFunctionPrototypes
428 register KeySym * /* sym_return */,
429 unsigned int /* modifiers */,
432 int * /* extra_rtrn */
436 extern Bool XkbSetAutoRepeatRate(
437 #if NeedFunctionPrototypes
439 unsigned int /* deviceSpec */,
440 unsigned int /* delay */,
441 unsigned int /* interval */
445 extern Bool XkbGetAutoRepeatRate(
446 #if NeedFunctionPrototypes
448 unsigned int /* deviceSpec */,
449 unsigned int * /* delayRtrn */,
450 unsigned int * /* intervalRtrn */
454 extern Bool XkbChangeEnabledControls(
455 #if NeedFunctionPrototypes
457 unsigned int /* deviceSpec */,
458 unsigned int /* affect */,
459 unsigned int /* values */
463 extern Bool XkbDeviceBell(
464 #if NeedFunctionPrototypes
467 int /* deviceSpec */,
475 extern Bool XkbForceDeviceBell(
476 #if NeedFunctionPrototypes
478 int /* deviceSpec */,
485 extern Bool XkbDeviceBellEvent(
486 #if NeedFunctionPrototypes
489 int /* deviceSpec */,
498 #if NeedFunctionPrototypes
506 extern Bool XkbForceBell(
507 #if NeedFunctionPrototypes
513 extern Bool XkbBellEvent(
514 #if NeedFunctionPrototypes
522 extern Bool XkbSelectEvents(
523 #if NeedFunctionPrototypes
525 unsigned int /* deviceID */,
526 unsigned int /* affect */,
527 unsigned int /* values */
531 extern Bool XkbSelectEventDetails(
532 #if NeedFunctionPrototypes
534 unsigned int /* deviceID */,
535 unsigned int /* eventType */,
536 unsigned long /* affect */,
537 unsigned long /* details */
541 extern void XkbNoteMapChanges(
542 #if NeedFunctionPrototypes
543 XkbMapChangesPtr /* old */,
544 XkbMapNotifyEvent * /* new */,
545 unsigned int /* wanted */
549 extern void XkbNoteNameChanges(
550 #if NeedFunctionPrototypes
551 XkbNameChangesPtr /* old */,
552 XkbNamesNotifyEvent * /* new */,
553 unsigned int /* wanted */
557 extern Status XkbGetIndicatorState(
558 #if NeedFunctionPrototypes
560 unsigned int /* deviceSpec */,
561 unsigned int * /* pStateRtrn */
565 extern Status XkbGetDeviceIndicatorState(
566 #if NeedFunctionPrototypes
568 unsigned int /* deviceSpec */,
569 unsigned int /* ledClass */,
570 unsigned int /* ledID */,
571 unsigned int * /* pStateRtrn */
575 extern Status XkbGetIndicatorMap(
576 #if NeedFunctionPrototypes
578 unsigned long /* which */,
579 XkbDescPtr /* desc */
583 extern Bool XkbSetIndicatorMap(
584 #if NeedFunctionPrototypes
586 unsigned long /* which */,
587 XkbDescPtr /* desc */
591 #define XkbNoteIndicatorMapChanges(o,n,w) \
592 ((o)->map_changes|=((n)->map_changes&(w)))
593 #define XkbNoteIndicatorStateChanges(o,n,w)\
594 ((o)->state_changes|=((n)->state_changes&(w)))
595 #define XkbGetIndicatorMapChanges(d,x,c) \
596 (XkbGetIndicatorMap((d),(c)->map_changes,x)
597 #define XkbChangeIndicatorMaps(d,x,c) \
598 (XkbSetIndicatorMap((d),(c)->map_changes,x))
600 extern Bool XkbGetNamedIndicator(
601 #if NeedFunctionPrototypes
604 int * /* pNdxRtrn */,
605 Bool * /* pStateRtrn */,
606 XkbIndicatorMapPtr /* pMapRtrn */,
607 Bool * /* pRealRtrn */
611 extern Bool XkbGetNamedDeviceIndicator(
612 #if NeedFunctionPrototypes
614 unsigned int /* deviceSpec */,
615 unsigned int /* ledClass */,
616 unsigned int /* ledID */,
618 int * /* pNdxRtrn */,
619 Bool * /* pStateRtrn */,
620 XkbIndicatorMapPtr /* pMapRtrn */,
621 Bool * /* pRealRtrn */
625 extern Bool XkbSetNamedIndicator(
626 #if NeedFunctionPrototypes
629 Bool /* changeState */,
631 Bool /* createNewMap */,
632 XkbIndicatorMapPtr /* pMap */
636 extern Bool XkbSetNamedDeviceIndicator(
637 #if NeedFunctionPrototypes
639 unsigned int /* deviceSpec */,
640 unsigned int /* ledClass */,
641 unsigned int /* ledID */,
643 Bool /* changeState */,
645 Bool /* createNewMap */,
646 XkbIndicatorMapPtr /* pMap */
650 extern Bool XkbLockModifiers(
651 #if NeedFunctionPrototypes
653 unsigned int /* deviceSpec */,
654 unsigned int /* affect */,
655 unsigned int /* values */
659 extern Bool XkbLatchModifiers(
660 #if NeedFunctionPrototypes
662 unsigned int /* deviceSpec */,
663 unsigned int /* affect */,
664 unsigned int /* values */
668 extern Bool XkbLockGroup(
669 #if NeedFunctionPrototypes
671 unsigned int /* deviceSpec */,
672 unsigned int /* group */
676 extern Bool XkbLatchGroup(
677 #if NeedFunctionPrototypes
679 unsigned int /* deviceSpec */,
680 unsigned int /* group */
684 extern Bool XkbSetServerInternalMods(
685 #if NeedFunctionPrototypes
687 unsigned int /* deviceSpec */,
688 unsigned int /* affectReal */,
689 unsigned int /* realValues */,
690 unsigned int /* affectVirtual */,
691 unsigned int /* virtualValues */
695 extern Bool XkbSetIgnoreLockMods(
696 #if NeedFunctionPrototypes
698 unsigned int /* deviceSpec */,
699 unsigned int /* affectReal */,
700 unsigned int /* realValues */,
701 unsigned int /* affectVirtual */,
702 unsigned int /* virtualValues */
707 extern Bool XkbVirtualModsToReal(
708 #if NeedFunctionPrototypes
709 XkbDescPtr /* xkb */,
710 unsigned int /* virtual_mask */,
711 unsigned int * /* mask_rtrn */
715 extern Bool XkbComputeEffectiveMap(
716 #if NeedFunctionPrototypes
717 XkbDescPtr /* xkb */,
718 XkbKeyTypePtr /* type */,
719 unsigned char * /* map_rtrn */
723 extern Status XkbInitCanonicalKeyTypes(
724 #if NeedFunctionPrototypes
725 XkbDescPtr /* xkb */,
726 unsigned int /* which */,
731 extern XkbDescPtr XkbAllocKeyboard(
732 #if NeedFunctionPrototypes
737 extern void XkbFreeKeyboard(
738 #if NeedFunctionPrototypes
739 XkbDescPtr /* xkb */,
740 unsigned int /* which */,
745 extern Status XkbAllocClientMap(
746 #if NeedFunctionPrototypes
747 XkbDescPtr /* xkb */,
748 unsigned int /* which */,
749 unsigned int /* nTypes */
753 extern Status XkbAllocServerMap(
754 #if NeedFunctionPrototypes
755 XkbDescPtr /* xkb */,
756 unsigned int /* which */,
757 unsigned int /* nActions */
761 extern void XkbFreeClientMap(
762 #if NeedFunctionPrototypes
763 XkbDescPtr /* xkb */,
764 unsigned int /* what */,
769 extern void XkbFreeServerMap(
770 #if NeedFunctionPrototypes
771 XkbDescPtr /* xkb */,
772 unsigned int /* what */,
777 extern XkbKeyTypePtr XkbAddKeyType(
778 #if NeedFunctionPrototypes
779 XkbDescPtr /* xkb */,
782 Bool /* want_preserve */,
787 extern Status XkbAllocIndicatorMaps(
788 #if NeedFunctionPrototypes
793 extern void XkbFreeIndicatorMaps(
794 #if NeedFunctionPrototypes
799 extern XkbDescPtr XkbGetMap(
800 #if NeedFunctionPrototypes
802 unsigned int /* which */,
803 unsigned int /* deviceSpec */
807 extern Status XkbGetUpdatedMap(
808 #if NeedFunctionPrototypes
810 unsigned int /* which */,
811 XkbDescPtr /* desc */
815 extern Status XkbGetMapChanges(
816 #if NeedFunctionPrototypes
818 XkbDescPtr /* xkb */,
819 XkbMapChangesPtr /* changes */
824 extern Status XkbRefreshKeyboardMapping(
825 #if NeedFunctionPrototypes
826 XkbMapNotifyEvent * /* event */
830 extern Status XkbGetKeyTypes(
831 #if NeedFunctionPrototypes
833 unsigned int /* first */,
834 unsigned int /* num */,
839 extern Status XkbGetKeySyms(
840 #if NeedFunctionPrototypes
842 unsigned int /* first */,
843 unsigned int /* num */,
848 extern Status XkbGetKeyActions(
849 #if NeedFunctionPrototypes
851 unsigned int /* first */,
852 unsigned int /* num */,
857 extern Status XkbGetKeyBehaviors(
858 #if NeedFunctionPrototypes
860 unsigned int /* firstKey */,
861 unsigned int /* nKeys */,
862 XkbDescPtr /* desc */
866 extern Status XkbGetVirtualMods(
867 #if NeedFunctionPrototypes
869 unsigned int /* which */,
870 XkbDescPtr /* desc */
874 extern Status XkbGetKeyExplicitComponents(
875 #if NeedFunctionPrototypes
877 unsigned int /* firstKey */,
878 unsigned int /* nKeys */,
879 XkbDescPtr /* desc */
883 extern Status XkbGetKeyModifierMap(
884 #if NeedFunctionPrototypes
886 unsigned int /* firstKey */,
887 unsigned int /* nKeys */,
888 XkbDescPtr /* desc */
892 extern Status XkbAllocControls(
893 #if NeedFunctionPrototypes
894 XkbDescPtr /* xkb */,
895 unsigned int /* which*/
899 extern void XkbFreeControls(
900 #if NeedFunctionPrototypes
901 XkbDescPtr /* xkb */,
902 unsigned int /* which */,
907 extern Status XkbGetControls(
908 #if NeedFunctionPrototypes
910 unsigned long /* which */,
911 XkbDescPtr /* desc */
915 extern Bool XkbSetControls(
916 #if NeedFunctionPrototypes
918 unsigned long /* which */,
919 XkbDescPtr /* desc */
923 extern void XkbNoteControlsChanges(
924 #if NeedFunctionPrototypes
925 XkbControlsChangesPtr /* old */,
926 XkbControlsNotifyEvent * /* new */,
927 unsigned int /* wanted */
931 #define XkbGetControlsChanges(d,x,c) XkbGetControls(d,(c)->changed_ctrls,x)
932 #define XkbChangeControls(d,x,c) XkbSetControls(d,(c)->changed_ctrls,x)
934 extern Status XkbAllocCompatMap(
935 #if NeedFunctionPrototypes
936 XkbDescPtr /* xkb */,
937 unsigned int /* which */,
938 unsigned int /* nInterpret */
942 extern void XkbFreeCompatMap(
943 #if NeedFunctionPrototypes
944 XkbDescPtr /* xkb */,
945 unsigned int /* which */,
950 extern Status XkbGetCompatMap(
951 #if NeedFunctionPrototypes
953 unsigned int /* which */,
958 extern Bool XkbSetCompatMap(
959 #if NeedFunctionPrototypes
961 unsigned int /* which */,
962 XkbDescPtr /* xkb */,
963 Bool /* updateActions */
967 extern XkbSymInterpretPtr XkbAddSymInterpret(
968 #if NeedFunctionPrototypes
969 XkbDescPtr /* xkb */,
970 XkbSymInterpretPtr /* si */,
971 Bool /* updateMap */,
972 XkbChangesPtr /* changes */
976 extern Status XkbAllocNames(
977 #if NeedFunctionPrototypes
978 XkbDescPtr /* xkb */,
979 unsigned int /* which */,
981 int /* nTotalAliases */
985 extern Status XkbGetNames(
986 #if NeedFunctionPrototypes
988 unsigned int /* which */,
989 XkbDescPtr /* desc */
993 extern Bool XkbSetNames(
994 #if NeedFunctionPrototypes
996 unsigned int /* which */,
997 unsigned int /* firstType */,
998 unsigned int /* nTypes */,
999 XkbDescPtr /* desc */
1003 extern Bool XkbChangeNames(
1004 #if NeedFunctionPrototypes
1005 Display * /* dpy */,
1006 XkbDescPtr /* xkb */,
1007 XkbNameChangesPtr /* changes */
1011 extern void XkbFreeNames(
1012 #if NeedFunctionPrototypes
1013 XkbDescPtr /* xkb */,
1014 unsigned int /* which */,
1020 extern Status XkbGetState(
1021 #if NeedFunctionPrototypes
1022 Display * /* dpy */,
1023 unsigned int /* deviceSpec */,
1024 XkbStatePtr /* rtrnState */
1028 extern Bool XkbSetMap(
1029 #if NeedFunctionPrototypes
1030 Display * /* dpy */,
1031 unsigned int /* which */,
1032 XkbDescPtr /* desc */
1036 extern Bool XkbChangeMap(
1037 #if NeedFunctionPrototypes
1039 XkbDescPtr /* desc */,
1040 XkbMapChangesPtr /* changes */
1044 extern Bool XkbSetDetectableAutoRepeat(
1045 #if NeedFunctionPrototypes
1046 Display * /* dpy */,
1047 Bool /* detectable */,
1048 Bool * /* supported */
1052 extern Bool XkbGetDetectableAutoRepeat(
1053 #if NeedFunctionPrototypes
1054 Display * /* dpy */,
1055 Bool * /* supported */
1059 extern Bool XkbSetAutoResetControls(
1060 #if NeedFunctionPrototypes
1061 Display * /* dpy */,
1062 unsigned int /* changes */,
1063 unsigned int * /* auto_ctrls */,
1064 unsigned int * /* auto_values */
1068 extern Bool XkbGetAutoResetControls(
1069 #if NeedFunctionPrototypes
1070 Display * /* dpy */,
1071 unsigned int * /* auto_ctrls */,
1072 unsigned int * /* auto_ctrl_values */
1076 extern Status XkbCopyKeyType(
1077 #if NeedFunctionPrototypes
1078 XkbKeyTypePtr /* from */,
1079 XkbKeyTypePtr /* into */
1083 extern Status XkbCopyKeyTypes(
1084 #if NeedFunctionPrototypes
1085 XkbKeyTypePtr /* from */,
1086 XkbKeyTypePtr /* into */,
1091 extern Status XkbResizeKeyType(
1092 #if NeedFunctionPrototypes
1093 XkbDescPtr /* xkb */,
1095 int /* map_count */,
1096 Bool /* want_preserve */,
1097 int /* new_num_lvls */
1101 extern KeySym *XkbResizeKeySyms(
1102 #if NeedFunctionPrototypes
1103 XkbDescPtr /* desc */,
1105 int /* symsNeeded */
1109 extern XkbAction *XkbResizeKeyActions(
1110 #if NeedFunctionPrototypes
1111 XkbDescPtr /* desc */,
1113 int /* actsNeeded */
1117 extern Status XkbChangeTypesOfKey(
1118 #if NeedFunctionPrototypes
1119 XkbDescPtr /* xkb */,
1121 int /* num_groups */,
1122 unsigned int /* groups */,
1123 int * /* newTypes */,
1124 XkbMapChangesPtr /* pChanges */
1128 /***====================================================================***/
1130 extern XkbComponentListPtr XkbListComponents(
1131 #if NeedFunctionPrototypes
1132 Display * /* dpy */,
1133 unsigned int /* deviceSpec */,
1134 XkbComponentNamesPtr /* ptrns */,
1135 int * /* max_inout */
1139 extern void XkbFreeComponentList(
1140 #if NeedFunctionPrototypes
1141 XkbComponentListPtr /* list */
1145 extern XkbDescPtr XkbGetKeyboard(
1146 #if NeedFunctionPrototypes
1147 Display * /* dpy */,
1148 unsigned int /* which */,
1149 unsigned int /* deviceSpec */
1153 extern XkbDescPtr XkbGetKeyboardByName(
1154 #if NeedFunctionPrototypes
1155 Display * /* dpy */,
1156 unsigned int /* deviceSpec */,
1157 XkbComponentNamesPtr /* names */,
1158 unsigned int /* want */,
1159 unsigned int /* need */,
1164 /***====================================================================***/
1166 extern int XkbKeyTypesForCoreSymbols( /* returns # of groups */
1167 #if NeedFunctionPrototypes
1168 XkbDescPtr /* xkb */, /* keyboard device */
1169 int /* map_width */, /* width of core KeySym array */
1170 KeySym * /* core_syms */, /* always mapWidth symbols */
1171 unsigned int /* protected */, /* explicit key types */
1172 int * /* types_inout */, /* always four type indices */
1173 KeySym * /* xkb_syms_rtrn */ /* must have enough space */
1177 extern Bool XkbApplyCompatMapToKey( /* False only on error */
1178 #if NeedFunctionPrototypes
1179 XkbDescPtr /* xkb */, /* keymap to be edited */
1180 KeyCode /* key */, /* key to be updated */
1181 XkbChangesPtr /* changes */ /* resulting changes to map */
1185 extern Bool XkbUpdateMapFromCore( /* False only on error */
1186 #if NeedFunctionPrototypes
1187 XkbDescPtr /* xkb */, /* XKB keyboard to be edited */
1188 KeyCode /* first_key */, /* first changed key */
1189 int /* num_keys */, /* number of changed keys */
1190 int /* map_width */, /* width of core keymap */
1191 KeySym * /* core_keysyms */, /* symbols from core keymap */
1192 XkbChangesPtr /* changes */ /* resulting changes */
1196 /***====================================================================***/
1198 extern XkbDeviceLedInfoPtr XkbAddDeviceLedInfo(
1199 #if NeedFunctionPrototypes
1200 XkbDeviceInfoPtr /* devi */,
1201 unsigned int /* ledClass */,
1202 unsigned int /* ledId */
1206 extern Status XkbResizeDeviceButtonActions(
1207 #if NeedFunctionPrototypes
1208 XkbDeviceInfoPtr /* devi */,
1209 unsigned int /* newTotal */
1213 extern XkbDeviceInfoPtr XkbAllocDeviceInfo(
1214 #if NeedFunctionPrototypes
1215 unsigned int /* deviceSpec */,
1216 unsigned int /* nButtons */,
1217 unsigned int /* szLeds */
1221 extern void XkbFreeDeviceInfo(
1222 #if NeedFunctionPrototypes
1223 XkbDeviceInfoPtr /* devi */,
1224 unsigned int /* which */,
1229 extern void XkbNoteDeviceChanges(
1230 #if NeedFunctionPrototypes
1231 XkbDeviceChangesPtr /* old */,
1232 XkbExtensionDeviceNotifyEvent * /* new */,
1233 unsigned int /* wanted */
1237 extern XkbDeviceInfoPtr XkbGetDeviceInfo(
1238 #if NeedFunctionPrototypes
1239 Display * /* dpy */,
1240 unsigned int /* which */,
1241 unsigned int /* deviceSpec */,
1242 unsigned int /* ledClass */,
1243 unsigned int /* ledID */
1247 extern Status XkbGetDeviceInfoChanges(
1248 #if NeedFunctionPrototypes
1249 Display * /* dpy */,
1250 XkbDeviceInfoPtr /* devi */,
1251 XkbDeviceChangesPtr /* changes */
1255 extern Status XkbGetDeviceButtonActions(
1256 #if NeedFunctionPrototypes
1257 Display * /* dpy */,
1258 XkbDeviceInfoPtr /* devi */,
1260 unsigned int /* first */,
1261 unsigned int /* nBtns */
1265 extern Status XkbGetDeviceLedInfo(
1266 #if NeedFunctionPrototypes
1267 Display * /* dpy */,
1268 XkbDeviceInfoPtr /* devi */,
1269 unsigned int /* ledClass (class, XIDflt, XIAll) */,
1270 unsigned int /* ledId (id, XIDflt, XIAll) */,
1271 unsigned int /* which (XkbXI_Indicator{Names,Map}Mask */
1275 extern Bool XkbSetDeviceInfo(
1276 #if NeedFunctionPrototypes
1277 Display * /* dpy */,
1278 unsigned int /* which */,
1279 XkbDeviceInfoPtr /* devi */
1283 extern Bool XkbChangeDeviceInfo(
1284 #if NeedFunctionPrototypes
1286 XkbDeviceInfoPtr /* desc */,
1287 XkbDeviceChangesPtr /* changes */
1291 extern Bool XkbSetDeviceLedInfo(
1292 #if NeedFunctionPrototypes
1293 Display * /* dpy */,
1294 XkbDeviceInfoPtr /* devi */,
1295 unsigned int /* ledClass */,
1296 unsigned int /* ledID */,
1297 unsigned int /* which */
1301 extern Bool XkbSetDeviceButtonActions(
1302 #if NeedFunctionPrototypes
1303 Display * /* dpy */,
1304 XkbDeviceInfoPtr /* devi */,
1305 unsigned int /* first */,
1306 unsigned int /* nBtns */
1310 /***====================================================================***/
1312 extern char XkbToControl(
1313 #if NeedFunctionPrototypes
1318 /***====================================================================***/
1320 extern Bool XkbSetDebuggingFlags(
1321 #if NeedFunctionPrototypes
1322 Display * /* dpy */,
1323 unsigned int /* mask */,
1324 unsigned int /* flags */,
1326 unsigned int /* ctrls_mask */,
1327 unsigned int /* ctrls */,
1328 unsigned int * /* rtrn_flags */,
1329 unsigned int * /* rtrn_ctrls */
1335 #endif /* _XKBLIB_H_ */