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