First import
[xorg_rtime.git] / xorg-server-1.4 / include / xkbsrv.h
blob5edee539b258fd2b6e60f1eb1cb6046dacef4717
1 /************************************************************
2 Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
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.
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.
25 ********************************************************/
27 #ifndef _XKBSRV_H_
28 #define _XKBSRV_H_
30 #ifdef XKB_IN_SERVER
31 #define XkbAllocClientMap SrvXkbAllocClientMap
32 #define XkbAllocServerMap SrvXkbAllocServerMap
33 #define XkbChangeTypesOfKey SrvXkbChangeTypesOfKey
34 #define XkbCopyKeyTypes SrvXkbCopyKeyTypes
35 #define XkbFreeClientMap SrvXkbFreeClientMap
36 #define XkbFreeServerMap SrvXkbFreeServerMap
37 #define XkbKeyTypesForCoreSymbols SrvXkbKeyTypesForCoreSymbols
38 #define XkbApplyCompatMapToKey SrvXkbApplyCompatMapToKey
39 #define XkbResizeKeyActions SrvXkbResizeKeyActions
40 #define XkbResizeKeySyms SrvXkbResizeKeySyms
41 #define XkbResizeKeyType SrvXkbResizeKeyType
42 #define XkbAllocCompatMap SrvXkbAllocCompatMap
43 #define XkbAllocControls SrvXkbAllocControls
44 #define XkbAllocIndicatorMaps SrvXkbAllocIndicatorMaps
45 #define XkbAllocKeyboard SrvXkbAllocKeyboard
46 #define XkbAllocNames SrvXkbAllocNames
47 #define XkbFreeCompatMap SrvXkbFreeCompatMap
48 #define XkbFreeKeyboard SrvXkbFreeKeyboard
49 #define XkbFreeNames SrvXkbFreeNames
50 #define XkbLatchModifiers SrvXkbLatchModifiers
51 #define XkbLatchGroup SrvXkbLatchGroup
52 #define XkbVirtualModsToReal SrvXkbVirtualModsToReal
53 #define XkbChangeKeycodeRange SrvXkbChangeKeycodeRange
54 #define XkbApplyVirtualModChanges SrvXkbApplyVirtualModChanges
55 #endif
57 #include <X11/extensions/XKBstr.h>
58 #include <X11/extensions/XKBproto.h>
59 #include "inputstr.h"
61 typedef struct _XkbInterest {
62 DeviceIntPtr dev;
63 ClientPtr client;
64 XID resource;
65 struct _XkbInterest * next;
66 CARD16 extDevNotifyMask;
67 CARD16 stateNotifyMask;
68 CARD16 namesNotifyMask;
69 CARD32 ctrlsNotifyMask;
70 CARD8 compatNotifyMask;
71 BOOL bellNotifyMask;
72 BOOL actionMessageMask;
73 CARD16 accessXNotifyMask;
74 CARD32 iStateNotifyMask;
75 CARD32 iMapNotifyMask;
76 CARD16 altSymsNotifyMask;
77 CARD32 autoCtrls;
78 CARD32 autoCtrlValues;
79 } XkbInterestRec,*XkbInterestPtr;
81 typedef struct _XkbRadioGroup {
82 CARD8 flags;
83 CARD8 nMembers;
84 CARD8 dfltDown;
85 CARD8 currentDown;
86 CARD8 members[XkbRGMaxMembers];
87 } XkbRadioGroupRec, *XkbRadioGroupPtr;
89 typedef struct _XkbEventCause {
90 CARD8 kc;
91 CARD8 event;
92 CARD8 mjr;
93 CARD8 mnr;
94 ClientPtr client;
95 } XkbEventCauseRec,*XkbEventCausePtr;
96 #define XkbSetCauseKey(c,k,e) { (c)->kc= (k),(c)->event= (e),\
97 (c)->mjr= (c)->mnr= 0; \
98 (c)->client= NULL; }
99 #define XkbSetCauseReq(c,j,n,cl) { (c)->kc= (c)->event= 0,\
100 (c)->mjr= (j),(c)->mnr= (n);\
101 (c)->client= (cl); }
102 #define XkbSetCauseCoreReq(c,e,cl) XkbSetCauseReq(c,e,0,cl)
103 #define XkbSetCauseXkbReq(c,e,cl) XkbSetCauseReq(c,XkbReqCode,e,cl)
104 #define XkbSetCauseUnknown(c) XkbSetCauseKey(c,0,0)
106 #define _OFF_TIMER 0
107 #define _KRG_WARN_TIMER 1
108 #define _KRG_TIMER 2
109 #define _SK_TIMEOUT_TIMER 3
110 #define _ALL_TIMEOUT_TIMER 4
112 #define _BEEP_NONE 0
113 #define _BEEP_FEATURE_ON 1
114 #define _BEEP_FEATURE_OFF 2
115 #define _BEEP_FEATURE_CHANGE 3
116 #define _BEEP_SLOW_WARN 4
117 #define _BEEP_SLOW_PRESS 5
118 #define _BEEP_SLOW_ACCEPT 6
119 #define _BEEP_SLOW_REJECT 7
120 #define _BEEP_SLOW_RELEASE 8
121 #define _BEEP_STICKY_LATCH 9
122 #define _BEEP_STICKY_LOCK 10
123 #define _BEEP_STICKY_UNLOCK 11
124 #define _BEEP_LED_ON 12
125 #define _BEEP_LED_OFF 13
126 #define _BEEP_LED_CHANGE 14
127 #define _BEEP_BOUNCE_REJECT 15
129 typedef struct _XkbSrvInfo {
130 XkbStateRec prev_state;
131 XkbStateRec state;
132 XkbDescPtr desc;
134 DeviceIntPtr device;
135 KbdCtrlProcPtr kbdProc;
137 XkbRadioGroupPtr radioGroups;
138 CARD8 nRadioGroups;
139 CARD8 clearMods;
140 CARD8 setMods;
141 INT16 groupChange;
143 CARD16 dfltPtrDelta;
145 double mouseKeysCurve;
146 double mouseKeysCurveFactor;
147 INT16 mouseKeysDX;
148 INT16 mouseKeysDY;
149 CARD8 mouseKeysFlags;
150 Bool mouseKeysAccel;
151 CARD8 mouseKeysCounter;
153 CARD8 lockedPtrButtons;
154 CARD8 shiftKeyCount;
155 KeyCode mouseKey;
156 KeyCode inactiveKey;
157 KeyCode slowKey;
158 KeyCode repeatKey;
159 CARD8 krgTimerActive;
160 CARD8 beepType;
161 CARD8 beepCount;
163 CARD32 flags;
164 CARD32 lastPtrEventTime;
165 CARD32 lastShiftEventTime;
166 OsTimerPtr beepTimer;
167 OsTimerPtr mouseKeyTimer;
168 OsTimerPtr slowKeysTimer;
169 OsTimerPtr bounceKeysTimer;
170 OsTimerPtr repeatKeyTimer;
171 OsTimerPtr krgTimer;
172 } XkbSrvInfoRec, *XkbSrvInfoPtr;
174 #define XkbSLI_IsDefault (1L<<0)
175 #define XkbSLI_HasOwnState (1L<<1)
177 typedef struct _XkbSrvLedInfo {
178 CARD16 flags;
179 CARD16 class;
180 CARD16 id;
181 union {
182 KbdFeedbackPtr kf;
183 LedFeedbackPtr lf;
184 } fb;
186 CARD32 physIndicators;
187 CARD32 autoState;
188 CARD32 explicitState;
189 CARD32 effectiveState;
191 CARD32 mapsPresent;
192 CARD32 namesPresent;
193 XkbIndicatorMapPtr maps;
194 Atom * names;
196 CARD32 usesBase;
197 CARD32 usesLatched;
198 CARD32 usesLocked;
199 CARD32 usesEffective;
200 CARD32 usesCompat;
201 CARD32 usesControls;
203 CARD32 usedComponents;
204 } XkbSrvLedInfoRec, *XkbSrvLedInfoPtr;
207 * Settings for xkbClientFlags field (used by DIX)
208 * These flags _must_ not overlap with XkbPCF_*
210 #define _XkbClientInitialized (1<<15)
212 #define _XkbWantsDetectableAutoRepeat(c)\
213 ((c)->xkbClientFlags&XkbPCF_DetectableAutoRepeatMask)
216 * Settings for flags field
218 #define _XkbStateNotifyInProgress (1<<0)
220 typedef struct
222 ProcessInputProc processInputProc;
223 ProcessInputProc realInputProc;
224 DeviceUnwrapProc unwrapProc;
225 } xkbDeviceInfoRec, *xkbDeviceInfoPtr;
227 #define WRAP_PROCESS_INPUT_PROC(device, oldprocs, proc, unwrapproc) \
228 device->public.processInputProc = proc; \
229 oldprocs->processInputProc = \
230 oldprocs->realInputProc = device->public.realInputProc; \
231 device->public.realInputProc = proc; \
232 oldprocs->unwrapProc = device->unwrapProc; \
233 device->unwrapProc = unwrapproc;
235 #define COND_WRAP_PROCESS_INPUT_PROC(device, oldprocs, proc, unwrapproc) \
236 if (device->public.processInputProc == device->public.realInputProc)\
237 device->public.processInputProc = proc; \
238 oldprocs->processInputProc = \
239 oldprocs->realInputProc = device->public.realInputProc; \
240 device->public.realInputProc = proc; \
241 oldprocs->unwrapProc = device->unwrapProc; \
242 device->unwrapProc = unwrapproc;
244 #define UNWRAP_PROCESS_INPUT_PROC(device, oldprocs) \
245 device->public.processInputProc = oldprocs->processInputProc; \
246 device->public.realInputProc = oldprocs->realInputProc; \
247 device->unwrapProc = oldprocs->unwrapProc;
249 #define XKBDEVICEINFO(dev) ((xkbDeviceInfoPtr) (dev)->devPrivates[xkbDevicePrivateIndex].ptr)
251 /***====================================================================***/
254 /***====================================================================***/
256 #define XkbAX_KRGMask (XkbSlowKeysMask|XkbBounceKeysMask)
257 #define XkbAllFilteredEventsMask \
258 (XkbAccessXKeysMask|XkbRepeatKeysMask|XkbMouseKeysAccelMask|XkbAX_KRGMask)
260 /***====================================================================***/
262 extern int XkbReqCode;
263 extern int XkbEventBase;
264 extern int XkbDisableLockActions;
265 extern char * XkbBaseDirectory;
266 extern char * XkbBinDirectory;
267 extern char * XkbInitialMap;
268 extern unsigned int XkbXIUnsupported;
270 extern Bool noXkbExtension;
272 extern pointer XkbLastRepeatEvent;
274 extern CARD32 xkbDebugFlags;
276 #define _XkbAlloc(s) xalloc((s))
277 #define _XkbCalloc(n,s) Xcalloc((n)*(s))
278 #define _XkbRealloc(o,s) Xrealloc((o),(s))
279 #define _XkbTypedAlloc(t) ((t *)xalloc(sizeof(t)))
280 #define _XkbTypedCalloc(n,t) ((t *)Xcalloc((n)*sizeof(t)))
281 #define _XkbTypedRealloc(o,n,t) \
282 ((o)?(t *)Xrealloc((o),(n)*sizeof(t)):_XkbTypedCalloc(n,t))
283 #define _XkbClearElems(a,f,l,t) bzero(&(a)[f],((l)-(f)+1)*sizeof(t))
284 #define _XkbFree(p) Xfree(p)
286 #define _XkbLibError(c,l,d) \
287 { _XkbErrCode= (c); _XkbErrLocation= (l); _XkbErrData= (d); }
288 #define _XkbErrCode2(a,b) ((XID)((((unsigned int)(a))<<24)|((b)&0xffffff)))
289 #define _XkbErrCode3(a,b,c) _XkbErrCode2(a,(((unsigned int)(b))<<16)|(c))
290 #define _XkbErrCode4(a,b,c,d) _XkbErrCode3(a,b,((((unsigned int)(c))<<8)|(d)))
292 extern int DeviceKeyPress,DeviceKeyRelease;
293 extern int DeviceButtonPress,DeviceButtonRelease;
295 #ifdef XINPUT
296 #define _XkbIsPressEvent(t) (((t)==KeyPress)||((t)==DeviceKeyPress))
297 #define _XkbIsReleaseEvent(t) (((t)==KeyRelease)||((t)==DeviceKeyRelease))
298 #else
299 #define _XkbIsPressEvent(t) ((t)==KeyPress)
300 #define _XkbIsReleaseEvent(t) ((t)==KeyRelease)
301 #endif
303 #define _XkbCoreKeycodeInRange(c,k) (((k)>=(c)->curKeySyms.minKeyCode)&&\
304 ((k)<=(c)->curKeySyms.maxKeyCode))
305 #define _XkbCoreNumKeys(c) ((c)->curKeySyms.maxKeyCode-\
306 (c)->curKeySyms.minKeyCode+1)
308 #define XConvertCase(s,l,u) XkbConvertCase(s,l,u)
309 #undef IsKeypadKey
310 #define IsKeypadKey(s) XkbKSIsKeypad(s)
312 #define Status int
313 #define XPointer pointer
314 #define Display struct _XDisplay
316 #ifndef True
317 #define True 1
318 #define False 0
319 #endif
321 #ifndef PATH_MAX
322 #ifdef MAXPATHLEN
323 #define PATH_MAX MAXPATHLEN
324 #else
325 #define PATH_MAX 1024
326 #endif
327 #endif
329 _XFUNCPROTOBEGIN
331 extern void XkbUseMsg(
332 void
335 extern int XkbProcessArguments(
336 int /* argc */,
337 char ** /* argv */,
338 int /* i */
341 extern void XkbSetExtension(DeviceIntPtr device, ProcessInputProc proc);
343 extern void XkbFreeCompatMap(
344 XkbDescPtr /* xkb */,
345 unsigned int /* which */,
346 Bool /* freeMap */
349 extern void XkbFreeNames(
350 XkbDescPtr /* xkb */,
351 unsigned int /* which */,
352 Bool /* freeMap */
355 extern DeviceIntPtr _XkbLookupAnyDevice(
356 int /* id */,
357 int * /* why_rtrn */
360 extern DeviceIntPtr _XkbLookupKeyboard(
361 int /* id */,
362 int * /* why_rtrn */
365 extern DeviceIntPtr _XkbLookupBellDevice(
366 int /* id */,
367 int * /* why_rtrn */
370 extern DeviceIntPtr _XkbLookupLedDevice(
371 int /* id */,
372 int * /* why_rtrn */
375 extern DeviceIntPtr _XkbLookupButtonDevice(
376 int /* id */,
377 int * /* why_rtrn */
380 extern XkbDescPtr XkbAllocKeyboard(
381 void
384 extern Status XkbAllocClientMap(
385 XkbDescPtr /* xkb */,
386 unsigned int /* which */,
387 unsigned int /* nTypes */
390 extern Status XkbAllocServerMap(
391 XkbDescPtr /* xkb */,
392 unsigned int /* which */,
393 unsigned int /* nNewActions */
396 extern void XkbFreeClientMap(
397 XkbDescPtr /* xkb */,
398 unsigned int /* what */,
399 Bool /* freeMap */
402 extern void XkbFreeServerMap(
403 XkbDescPtr /* xkb */,
404 unsigned int /* what */,
405 Bool /* freeMap */
408 extern Status XkbAllocIndicatorMaps(
409 XkbDescPtr /* xkb */
412 extern Status XkbAllocCompatMap(
413 XkbDescPtr /* xkb */,
414 unsigned int /* which */,
415 unsigned int /* nInterpret */
418 extern Status XkbAllocNames(
419 XkbDescPtr /* xkb */,
420 unsigned int /* which */,
421 int /* nTotalRG */,
422 int /* nTotalAliases */
425 extern Status XkbAllocControls(
426 XkbDescPtr /* xkb */,
427 unsigned int /* which*/
430 extern Status XkbCopyKeyTypes(
431 XkbKeyTypePtr /* from */,
432 XkbKeyTypePtr /* into */,
433 int /* num_types */
436 extern Status XkbResizeKeyType(
437 XkbDescPtr /* xkb */,
438 int /* type_ndx */,
439 int /* map_count */,
440 Bool /* want_preserve */,
441 int /* new_num_lvls */
444 extern void XkbFreeKeyboard(
445 XkbDescPtr /* xkb */,
446 unsigned int /* which */,
447 Bool /* freeDesc */
450 extern void XkbSetActionKeyMods(
451 XkbDescPtr /* xkb */,
452 XkbAction * /* act */,
453 unsigned int /* mods */
456 extern Bool XkbCheckActionVMods(
457 XkbDescPtr /* xkb */,
458 XkbAction * /* act */,
459 unsigned int /* changed */
462 extern unsigned int XkbMaskForVMask(
463 XkbDescPtr /* xkb */,
464 unsigned int /* vmask */
467 extern Bool XkbVirtualModsToReal(
468 XkbDescPtr /* xkb */,
469 unsigned int /* virtua_mask */,
470 unsigned int * /* mask_rtrn */
473 extern unsigned int XkbAdjustGroup(
474 int /* group */,
475 XkbControlsPtr /* ctrls */
478 extern KeySym *XkbResizeKeySyms(
479 XkbDescPtr /* xkb */,
480 int /* key */,
481 int /* needed */
484 extern XkbAction *XkbResizeKeyActions(
485 XkbDescPtr /* xkb */,
486 int /* key */,
487 int /* needed */
490 extern void XkbUpdateKeyTypesFromCore(
491 DeviceIntPtr /* pXDev */,
492 KeyCode /* first */,
493 CARD8 /* num */,
494 XkbChangesPtr /* pChanges */
497 extern void XkbUpdateDescActions(
498 XkbDescPtr /* xkb */,
499 KeyCode /* first */,
500 CARD8 /* num */,
501 XkbChangesPtr /* changes */
504 extern void XkbUpdateActions(
505 DeviceIntPtr /* pXDev */,
506 KeyCode /* first */,
507 CARD8 /* num */,
508 XkbChangesPtr /* pChanges */,
509 unsigned int * /* needChecksRtrn */,
510 XkbEventCausePtr /* cause */
513 extern void XkbUpdateCoreDescription(
514 DeviceIntPtr /* keybd */,
515 Bool /* resize */
518 extern void XkbApplyMappingChange(
519 DeviceIntPtr /* pXDev */,
520 CARD8 /* request */,
521 KeyCode /* firstKey */,
522 CARD8 /* num */,
523 ClientPtr /* client */
526 extern void XkbSetIndicators(
527 DeviceIntPtr /* pXDev */,
528 CARD32 /* affect */,
529 CARD32 /* values */,
530 XkbEventCausePtr /* cause */
533 extern void XkbUpdateIndicators(
534 DeviceIntPtr /* keybd */,
535 CARD32 /* changed */,
536 Bool /* check_edevs */,
537 XkbChangesPtr /* pChanges */,
538 XkbEventCausePtr /* cause */
541 extern XkbSrvLedInfoPtr XkbAllocSrvLedInfo(
542 DeviceIntPtr /* dev */,
543 KbdFeedbackPtr /* kf */,
544 LedFeedbackPtr /* lf */,
545 unsigned int /* needed_parts */
548 extern XkbSrvLedInfoPtr XkbFindSrvLedInfo(
549 DeviceIntPtr /* dev */,
550 unsigned int /* class */,
551 unsigned int /* id */,
552 unsigned int /* needed_parts */
555 extern void XkbApplyLedNameChanges(
556 DeviceIntPtr /* dev */,
557 XkbSrvLedInfoPtr /* sli */,
558 unsigned int /* changed_names */,
559 xkbExtensionDeviceNotify * /* ed */,
560 XkbChangesPtr /* changes */,
561 XkbEventCausePtr /* cause */
564 extern void XkbApplyLedMapChanges(
565 DeviceIntPtr /* dev */,
566 XkbSrvLedInfoPtr /* sli */,
567 unsigned int /* changed_maps */,
568 xkbExtensionDeviceNotify * /* ed */,
569 XkbChangesPtr /* changes */,
570 XkbEventCausePtr /* cause */
573 extern void XkbApplyLedStateChanges(
574 DeviceIntPtr /* dev */,
575 XkbSrvLedInfoPtr /* sli */,
576 unsigned int /* changed_leds */,
577 xkbExtensionDeviceNotify * /* ed */,
578 XkbChangesPtr /* changes */,
579 XkbEventCausePtr /* cause */
582 extern void XkbFlushLedEvents(
583 DeviceIntPtr /* dev */,
584 DeviceIntPtr /* kbd */,
585 XkbSrvLedInfoPtr /* sli */,
586 xkbExtensionDeviceNotify * /* ed */,
587 XkbChangesPtr /* changes */,
588 XkbEventCausePtr /* cause */
591 extern unsigned int XkbIndicatorsToUpdate(
592 DeviceIntPtr /* dev */,
593 unsigned long /* state_changes */,
594 Bool /* enabled_ctrl_changes */
597 extern void XkbComputeDerivedState(
598 XkbSrvInfoPtr /* xkbi */
601 extern void XkbCheckSecondaryEffects(
602 XkbSrvInfoPtr /* xkbi */,
603 unsigned int /* which */,
604 XkbChangesPtr /* changes */,
605 XkbEventCausePtr /* cause */
608 extern void XkbCheckIndicatorMaps(
609 DeviceIntPtr /* dev */,
610 XkbSrvLedInfoPtr /* sli */,
611 unsigned int /* which */
614 extern unsigned int XkbStateChangedFlags(
615 XkbStatePtr /* old */,
616 XkbStatePtr /* new */
619 extern void XkbSendStateNotify(
620 DeviceIntPtr /* kbd */,
621 xkbStateNotify * /* pSN */
624 extern void XkbSendMapNotify(
625 DeviceIntPtr /* kbd */,
626 xkbMapNotify * /* ev */
629 extern int XkbComputeControlsNotify(
630 DeviceIntPtr /* kbd */,
631 XkbControlsPtr /* old */,
632 XkbControlsPtr /* new */,
633 xkbControlsNotify * /* pCN */,
634 Bool /* forceCtrlProc */
637 extern void XkbSendControlsNotify(
638 DeviceIntPtr /* kbd */,
639 xkbControlsNotify * /* ev */
642 extern void XkbSendCompatMapNotify(
643 DeviceIntPtr /* kbd */,
644 xkbCompatMapNotify * /* ev */
647 extern void XkbHandleBell(
648 BOOL /* force */,
649 BOOL /* eventOnly */,
650 DeviceIntPtr /* kbd */,
651 CARD8 /* percent */,
652 pointer /* ctrl */,
653 CARD8 /* class */,
654 Atom /* name */,
655 WindowPtr /* pWin */,
656 ClientPtr /* pClient */
659 extern void XkbSendAccessXNotify(
660 DeviceIntPtr /* kbd */,
661 xkbAccessXNotify * /* pEv */
664 extern void XkbSendNamesNotify(
665 DeviceIntPtr /* kbd */,
666 xkbNamesNotify * /* ev */
669 extern void XkbSendCompatNotify(
670 DeviceIntPtr /* kbd */,
671 xkbCompatMapNotify * /* ev */
674 extern void XkbSendActionMessage(
675 DeviceIntPtr /* kbd */,
676 xkbActionMessage * /* ev */
679 extern void XkbSendExtensionDeviceNotify(
680 DeviceIntPtr /* kbd */,
681 ClientPtr /* client */,
682 xkbExtensionDeviceNotify * /* ev */
685 extern void XkbSendNotification(
686 DeviceIntPtr /* kbd */,
687 XkbChangesPtr /* pChanges */,
688 XkbEventCausePtr /* cause */
691 extern void XkbProcessKeyboardEvent(
692 struct _xEvent * /* xE */,
693 DeviceIntPtr /* keybd */,
694 int /* count */
697 extern void XkbHandleActions(
698 DeviceIntPtr /* dev */,
699 DeviceIntPtr /* kbd */,
700 struct _xEvent * /* xE */,
701 int /* count */
704 extern Bool XkbEnableDisableControls(
705 XkbSrvInfoPtr /* xkbi */,
706 unsigned long /* change */,
707 unsigned long /* newValues */,
708 XkbChangesPtr /* changes */,
709 XkbEventCausePtr /* cause */
712 extern void AccessXInit(
713 DeviceIntPtr /* dev */
716 extern Bool AccessXFilterPressEvent(
717 register struct _xEvent * /* xE */,
718 register DeviceIntPtr /* keybd */,
719 int /* count */
722 extern Bool AccessXFilterReleaseEvent(
723 register struct _xEvent * /* xE */,
724 register DeviceIntPtr /* keybd */,
725 int /* count */
728 extern void AccessXCancelRepeatKey(
729 XkbSrvInfoPtr /* xkbi */,
730 KeyCode /* key */
733 extern void AccessXComputeCurveFactor(
734 XkbSrvInfoPtr /* xkbi */,
735 XkbControlsPtr /* ctrls */
738 extern XkbInterestPtr XkbFindClientResource(
739 DevicePtr /* inDev */,
740 ClientPtr /* client */
743 extern XkbInterestPtr XkbAddClientResource(
744 DevicePtr /* inDev */,
745 ClientPtr /* client */,
746 XID /* id */
749 extern int XkbRemoveResourceClient(
750 DevicePtr /* inDev */,
751 XID /* id */
754 extern int XkbDDXInitDevice(
755 DeviceIntPtr /* dev */
758 extern int XkbDDXAccessXBeep(
759 DeviceIntPtr /* dev */,
760 unsigned int /* what */,
761 unsigned int /* which */
764 extern void XkbDDXKeyClick(
765 DeviceIntPtr /* dev */,
766 int /* keycode */,
767 int /* synthetic */
770 extern int XkbDDXUsesSoftRepeat(
771 DeviceIntPtr /* dev */
774 extern void XkbDDXKeybdCtrlProc(
775 DeviceIntPtr /* dev */,
776 KeybdCtrl * /* ctrl */
779 extern void XkbDDXChangeControls(
780 DeviceIntPtr /* dev */,
781 XkbControlsPtr /* old */,
782 XkbControlsPtr /* new */
785 extern void XkbDDXUpdateDeviceIndicators(
786 DeviceIntPtr /* dev */,
787 XkbSrvLedInfoPtr /* sli */,
788 CARD32 /* newState */
791 extern void XkbDDXFakePointerButton(
792 int /* event */,
793 int /* button */
796 extern void XkbDDXFakePointerMotion(
797 unsigned int /* flags */,
798 int /* x */,
799 int /* y */
802 extern void XkbDDXFakeDeviceButton(
803 DeviceIntPtr /* dev */,
804 Bool /* press */,
805 int /* button */
808 extern int XkbDDXTerminateServer(
809 DeviceIntPtr /* dev */,
810 KeyCode /* key */,
811 XkbAction * /* act */
814 extern int XkbDDXSwitchScreen(
815 DeviceIntPtr /* dev */,
816 KeyCode /* key */,
817 XkbAction * /* act */
820 extern int XkbDDXPrivate(
821 DeviceIntPtr /* dev */,
822 KeyCode /* key */,
823 XkbAction * /* act */
826 extern void XkbDisableComputedAutoRepeats(
827 DeviceIntPtr /* pXDev */,
828 unsigned int /* key */
831 extern void XkbSetRepeatKeys(
832 DeviceIntPtr /* pXDev */,
833 int /* key */,
834 int /* onoff */
837 extern int XkbLatchModifiers(
838 DeviceIntPtr /* pXDev */,
839 CARD8 /* mask */,
840 CARD8 /* latches */
843 extern int XkbLatchGroup(
844 DeviceIntPtr /* pXDev */,
845 int /* group */
848 extern void XkbClearAllLatchesAndLocks(
849 DeviceIntPtr /* dev */,
850 XkbSrvInfoPtr /* xkbi */,
851 Bool /* genEv */,
852 XkbEventCausePtr /* cause */
855 extern void XkbSetRulesDflts(
856 char * /* rulesFile */,
857 char * /* model */,
858 char * /* layout */,
859 char * /* variant */,
860 char * /* options */
863 extern void XkbInitDevice(
864 DeviceIntPtr /* pXDev */
867 extern Bool XkbInitKeyboardDeviceStruct(
868 DeviceIntPtr /* pXDev */,
869 XkbComponentNamesPtr /* pNames */,
870 KeySymsPtr /* pSyms */,
871 CARD8 /* pMods */[],
872 BellProcPtr /* bellProc */,
873 KbdCtrlProcPtr /* ctrlProc */
876 extern int SProcXkbDispatch(
877 ClientPtr /* client */
880 extern XkbGeometryPtr XkbLookupNamedGeometry(
881 DeviceIntPtr /* dev */,
882 Atom /* name */,
883 Bool * /* shouldFree */
886 extern char * _XkbDupString(
887 char * /* str */
890 extern void XkbConvertCase(
891 KeySym /* sym */,
892 KeySym * /* lower */,
893 KeySym * /* upper */
896 extern Status XkbChangeKeycodeRange(
897 XkbDescPtr /* xkb */,
898 int /* minKC */,
899 int /* maxKC */,
900 XkbChangesPtr /* changes */
903 extern int XkbFinishDeviceInit(
904 DeviceIntPtr /* pXDev */
907 extern void XkbFreeSrvLedInfo(
908 XkbSrvLedInfoPtr /* sli */
911 extern void XkbFreeInfo(
912 XkbSrvInfoPtr /* xkbi */
915 extern Status XkbChangeTypesOfKey(
916 XkbDescPtr /* xkb */,
917 int /* key */,
918 int /* nGroups */,
919 unsigned int /* groups */,
920 int * /* newTypesIn */,
921 XkbMapChangesPtr /* changes */
924 extern int XkbKeyTypesForCoreSymbols(
925 XkbDescPtr /* xkb */,
926 int /* map_width */,
927 KeySym * /* core_syms */,
928 unsigned int /* protected */,
929 int * /* types_inout */,
930 KeySym * /* xkb_syms_rtrn */
933 extern Bool XkbApplyCompatMapToKey(
934 XkbDescPtr /* xkb */,
935 KeyCode /* key */,
936 XkbChangesPtr /* changes */
939 extern Bool XkbApplyVirtualModChanges(
940 XkbDescPtr /* xkb */,
941 unsigned int /* changed */,
942 XkbChangesPtr /* changes */
945 extern void XkbSendNewKeyboardNotify(
946 DeviceIntPtr /* kbd */,
947 xkbNewKeyboardNotify * /* pNKN */
950 #ifdef XKBSRV_NEED_FILE_FUNCS
952 #include <X11/extensions/XKMformat.h>
953 #include <X11/extensions/XKBfile.h>
954 #include <X11/extensions/XKBrules.h>
956 #define _XkbListKeymaps 0
957 #define _XkbListKeycodes 1
958 #define _XkbListTypes 2
959 #define _XkbListCompat 3
960 #define _XkbListSymbols 4
961 #define _XkbListGeometry 5
962 #define _XkbListNumComponents 6
964 typedef struct _XkbSrvListInfo {
965 int szPool;
966 int nPool;
967 char * pool;
969 int maxRtrn;
970 int nTotal;
972 char * pattern[_XkbListNumComponents];
973 int nFound[_XkbListNumComponents];
974 } XkbSrvListInfoRec,*XkbSrvListInfoPtr;
976 extern Status XkbDDXList(
977 DeviceIntPtr /* dev */,
978 XkbSrvListInfoPtr /* listing */,
979 ClientPtr /* client */
982 extern unsigned int XkbDDXLoadKeymapByNames(
983 DeviceIntPtr /* keybd */,
984 XkbComponentNamesPtr /* names */,
985 unsigned int /* want */,
986 unsigned int /* need */,
987 XkbFileInfoPtr /* finfoRtrn */,
988 char * /* keymapNameRtrn */,
989 int /* keymapNameRtrnLen */
992 extern Bool XkbDDXNamesFromRules(
993 DeviceIntPtr /* keybd */,
994 char * /* rules */,
995 XkbRF_VarDefsPtr /* defs */,
996 XkbComponentNamesPtr /* names */
999 extern Bool XkbDDXApplyConfig(
1000 XPointer /* cfg_in */,
1001 XkbSrvInfoPtr /* xkbi */
1004 extern XPointer XkbDDXPreloadConfig(
1005 char ** /* rulesFileRtrn */,
1006 XkbRF_VarDefsPtr /* defs */,
1007 XkbComponentNamesPtr /* names */,
1008 DeviceIntPtr /* dev */
1011 extern int _XkbStrCaseCmp(
1012 char * /* str1 */,
1013 char * /* str2 */
1016 #endif /* XKBSRV_NEED_FILE_FUNCS */
1018 _XFUNCPROTOEND
1020 #define XkbAtomGetString(d,s) NameForAtom(s)
1022 #endif /* _XKBSRV_H_ */