Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:14:22

0001 /************************************************************
0002 Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
0003 
0004 Permission to use, copy, modify, and distribute this
0005 software and its documentation for any purpose and without
0006 fee is hereby granted, provided that the above copyright
0007 notice appear in all copies and that both that copyright
0008 notice and this permission notice appear in supporting
0009 documentation, and that the name of Silicon Graphics not be 
0010 used in advertising or publicity pertaining to distribution 
0011 of the software without specific prior written permission.
0012 Silicon Graphics makes no representation about the suitability 
0013 of this software for any purpose. It is provided "as is"
0014 without any express or implied warranty.
0015 
0016 SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS 
0017 SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 
0018 AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
0019 GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL 
0020 DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 
0021 DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 
0022 OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION  WITH
0023 THE USE OR PERFORMANCE OF THIS SOFTWARE.
0024 
0025 ********************************************************/
0026 
0027 #ifndef _XKBSRV_H_
0028 #define _XKBSRV_H_
0029 
0030 #ifdef XKB_IN_SERVER
0031 #define XkbAllocClientMap       SrvXkbAllocClientMap
0032 #define XkbAllocServerMap       SrvXkbAllocServerMap
0033 #define XkbChangeTypesOfKey     SrvXkbChangeTypesOfKey
0034 #define XkbAddKeyType           SrvXkbAddKeyType
0035 #define XkbCopyKeyType          SrvXkbCopyKeyType
0036 #define XkbCopyKeyTypes         SrvXkbCopyKeyTypes
0037 #define XkbFreeClientMap        SrvXkbFreeClientMap
0038 #define XkbFreeServerMap        SrvXkbFreeServerMap
0039 #define XkbInitCanonicalKeyTypes    SrvXkbInitCanonicalKeyTypes
0040 #define XkbKeyTypesForCoreSymbols   SrvXkbKeyTypesForCoreSymbols
0041 #define XkbApplyCompatMapToKey      SrvXkbApplyCompatMapToKey
0042 #define XkbUpdateMapFromCore        SrvXkbUpdateMapFromCore
0043 #define XkbResizeKeyActions     SrvXkbResizeKeyActions
0044 #define XkbResizeKeySyms        SrvXkbResizeKeySyms
0045 #define XkbResizeKeyType        SrvXkbResizeKeyType
0046 #define XkbAllocCompatMap       SrvXkbAllocCompatMap
0047 #define XkbAllocControls        SrvXkbAllocControls
0048 #define XkbAllocIndicatorMaps       SrvXkbAllocIndicatorMaps
0049 #define XkbAllocKeyboard        SrvXkbAllocKeyboard
0050 #define XkbAllocNames           SrvXkbAllocNames
0051 #define XkbFreeCompatMap        SrvXkbFreeCompatMap
0052 #define XkbFreeControls         SrvXkbFreeControls
0053 #define XkbFreeIndicatorMaps        SrvXkbFreeIndicatorMaps
0054 #define XkbFreeKeyboard         SrvXkbFreeKeyboard
0055 #define XkbFreeNames            SrvXkbFreeNames
0056 #define XkbAddDeviceLedInfo     SrvXkbAddDeviceLedInfo
0057 #define XkbAllocDeviceInfo      SrvXkbAllocDeviceInfo
0058 #define XkbFreeDeviceInfo       SrvXkbFreeDeviceInfo
0059 #define XkbResizeDeviceButtonActions    SrvXkbResizeDeviceButtonActions
0060 #define XkbLatchModifiers       SrvXkbLatchModifiers
0061 #define XkbLatchGroup           SrvXkbLatchGroup
0062 #define XkbVirtualModsToReal        SrvXkbVirtualModsToReal
0063 #define XkbChangeKeycodeRange       SrvXkbChangeKeycodeRange
0064 #define XkbApplyVirtualModChanges   SrvXkbApplyVirtualModChanges
0065 #define XkbUpdateActionVirtualMods  SrvXkbUpdateActionVirtualMods
0066 #define XkbUpdateKeyTypeVirtualMods SrvXkbUpdateKeyTypeVirtualMods
0067 #endif
0068 
0069 #include <X11/extensions/XKBstr.h>
0070 #include <X11/extensions/XKBproto.h>
0071 #include "inputstr.h"
0072 
0073 typedef struct _XkbInterest {
0074     DeviceIntPtr        dev;
0075     ClientPtr       client;
0076     XID         resource;
0077     struct _XkbInterest *   next;
0078     CARD16          extDevNotifyMask;
0079     CARD16          stateNotifyMask;
0080     CARD16          namesNotifyMask;
0081     CARD32          ctrlsNotifyMask;
0082     CARD8           compatNotifyMask;
0083     BOOL            bellNotifyMask;
0084     BOOL            actionMessageMask;
0085     CARD16          accessXNotifyMask;
0086     CARD32          iStateNotifyMask;
0087     CARD32          iMapNotifyMask;
0088     CARD16          altSymsNotifyMask;
0089     CARD32          autoCtrls;
0090     CARD32          autoCtrlValues;
0091 } XkbInterestRec,*XkbInterestPtr;
0092 
0093 typedef struct _XkbRadioGroup {
0094     CARD8       flags;
0095     CARD8       nMembers;
0096     CARD8       dfltDown;
0097     CARD8       currentDown;
0098     CARD8       members[XkbRGMaxMembers];
0099 } XkbRadioGroupRec, *XkbRadioGroupPtr;
0100 
0101 typedef struct  _XkbEventCause {
0102     CARD8       kc;
0103     CARD8       event;
0104     CARD8       mjr;
0105     CARD8       mnr;
0106     ClientPtr   client;
0107 } XkbEventCauseRec,*XkbEventCausePtr;
0108 #define XkbSetCauseKey(c,k,e)   { (c)->kc= (k),(c)->event= (e),\
0109                   (c)->mjr= (c)->mnr= 0; \
0110                   (c)->client= NULL; }
0111 #define XkbSetCauseReq(c,j,n,cl) { (c)->kc= (c)->event= 0,\
0112                   (c)->mjr= (j),(c)->mnr= (n);\
0113                   (c)->client= (cl); }
0114 #define XkbSetCauseCoreReq(c,e,cl) XkbSetCauseReq(c,e,0,cl)
0115 #define XkbSetCauseXkbReq(c,e,cl)  XkbSetCauseReq(c,XkbReqCode,e,cl)
0116 #define XkbSetCauseUnknown(c)      XkbSetCauseKey(c,0,0)
0117 
0118 #define _OFF_TIMER      0
0119 #define _KRG_WARN_TIMER     1
0120 #define _KRG_TIMER      2
0121 #define _SK_TIMEOUT_TIMER   3
0122 #define _ALL_TIMEOUT_TIMER  4
0123 
0124 #define _BEEP_NONE      0
0125 #define _BEEP_FEATURE_ON    1
0126 #define _BEEP_FEATURE_OFF   2
0127 #define _BEEP_FEATURE_CHANGE    3
0128 #define _BEEP_SLOW_WARN     4
0129 #define _BEEP_SLOW_PRESS    5
0130 #define _BEEP_SLOW_ACCEPT   6
0131 #define _BEEP_SLOW_REJECT   7
0132 #define _BEEP_SLOW_RELEASE  8
0133 #define _BEEP_STICKY_LATCH  9
0134 #define _BEEP_STICKY_LOCK   10
0135 #define _BEEP_STICKY_UNLOCK 11
0136 #define _BEEP_LED_ON        12
0137 #define _BEEP_LED_OFF       13
0138 #define _BEEP_LED_CHANGE    14
0139 #define _BEEP_BOUNCE_REJECT 15
0140 
0141 typedef struct _XkbSrvInfo {
0142     XkbStateRec  prev_state;
0143     XkbStateRec  state;
0144     XkbDescPtr   desc;
0145 
0146     DeviceIntPtr     device;
0147     KbdCtrlProcPtr   kbdProc;
0148 
0149     XkbRadioGroupPtr radioGroups;
0150     CARD8        nRadioGroups;
0151     CARD8        clearMods;
0152     CARD8        setMods;
0153     INT16        groupChange;
0154 
0155     CARD16       dfltPtrDelta;
0156 
0157     double       mouseKeysCurve;
0158     double       mouseKeysCurveFactor;
0159     INT16        mouseKeysDX;
0160     INT16        mouseKeysDY;
0161     CARD8        mouseKeysFlags;
0162     Bool         mouseKeysAccel;
0163     CARD8        mouseKeysCounter;
0164 
0165     CARD8        lockedPtrButtons;
0166     CARD8        shiftKeyCount;
0167     KeyCode      mouseKey;
0168     KeyCode      inactiveKey;
0169     KeyCode      slowKey;
0170     KeyCode      repeatKey;
0171     CARD8        krgTimerActive;
0172     CARD8        beepType;
0173     CARD8        beepCount;
0174 
0175     CARD32       flags;
0176     CARD32       lastPtrEventTime;
0177     CARD32       lastShiftEventTime;
0178     OsTimerPtr   beepTimer;
0179     OsTimerPtr   mouseKeyTimer;
0180     OsTimerPtr   slowKeysTimer;
0181     OsTimerPtr   bounceKeysTimer;
0182     OsTimerPtr   repeatKeyTimer;
0183     OsTimerPtr   krgTimer;
0184 } XkbSrvInfoRec, *XkbSrvInfoPtr;
0185 
0186 #define XkbSLI_IsDefault    (1L<<0)
0187 #define XkbSLI_HasOwnState  (1L<<1)
0188 
0189 typedef struct  _XkbSrvLedInfo {
0190     CARD16          flags;
0191     CARD16          class;
0192     CARD16          id;
0193     union {
0194         KbdFeedbackPtr  kf;
0195         LedFeedbackPtr  lf;
0196     }           fb;
0197 
0198     CARD32          physIndicators;
0199     CARD32          autoState;
0200     CARD32          explicitState;
0201     CARD32          effectiveState;
0202 
0203     CARD32          mapsPresent;
0204     CARD32          namesPresent;
0205     XkbIndicatorMapPtr  maps;
0206     Atom *          names;
0207 
0208     CARD32          usesBase;
0209     CARD32          usesLatched;
0210     CARD32          usesLocked;
0211     CARD32          usesEffective;
0212     CARD32          usesCompat;
0213     CARD32          usesControls;
0214 
0215     CARD32          usedComponents;
0216 } XkbSrvLedInfoRec, *XkbSrvLedInfoPtr;
0217 
0218 /*
0219  * Settings for xkbClientFlags field (used by DIX)
0220  * These flags _must_ not overlap with XkbPCF_*
0221  */
0222 #define _XkbClientInitialized       (1<<15)
0223 
0224 #define _XkbWantsDetectableAutoRepeat(c)\
0225     ((c)->xkbClientFlags&XkbPCF_DetectableAutoRepeatMask)
0226 
0227 /*
0228  * Settings for flags field
0229  */
0230 #define _XkbStateNotifyInProgress   (1<<0)
0231 
0232 typedef struct
0233 {
0234     ProcessInputProc processInputProc;
0235     ProcessInputProc realInputProc;
0236     DeviceUnwrapProc unwrapProc;
0237 } xkbDeviceInfoRec, *xkbDeviceInfoPtr;
0238 
0239 #define WRAP_PROCESS_INPUT_PROC(device, oldprocs, proc, unwrapproc) \
0240     device->public.processInputProc = proc; \
0241     oldprocs->processInputProc = \
0242     oldprocs->realInputProc = device->public.realInputProc; \
0243     device->public.realInputProc = proc; \
0244     oldprocs->unwrapProc = device->unwrapProc; \
0245     device->unwrapProc = unwrapproc;
0246 
0247 #define COND_WRAP_PROCESS_INPUT_PROC(device, oldprocs, proc, unwrapproc) \
0248     if (device->public.processInputProc == device->public.realInputProc)\
0249         device->public.processInputProc = proc; \
0250     oldprocs->processInputProc = \
0251     oldprocs->realInputProc = device->public.realInputProc; \
0252     device->public.realInputProc = proc; \
0253     oldprocs->unwrapProc = device->unwrapProc; \
0254     device->unwrapProc = unwrapproc;
0255 
0256 #define UNWRAP_PROCESS_INPUT_PROC(device, oldprocs) \
0257     device->public.processInputProc = oldprocs->processInputProc; \
0258     device->public.realInputProc = oldprocs->realInputProc; \
0259     device->unwrapProc = oldprocs->unwrapProc;
0260 
0261 #define XKBDEVICEINFO(dev) ((xkbDeviceInfoPtr) (dev)->devPrivates[xkbDevicePrivateIndex].ptr)
0262 
0263 /***====================================================================***/
0264 
0265 
0266 /***====================================================================***/
0267 
0268 #define XkbAX_KRGMask    (XkbSlowKeysMask|XkbBounceKeysMask)
0269 #define XkbAllFilteredEventsMask \
0270     (XkbAccessXKeysMask|XkbRepeatKeysMask|XkbMouseKeysAccelMask|XkbAX_KRGMask)
0271 
0272 /***====================================================================***/
0273 
0274 extern int  XkbReqCode;
0275 extern int  XkbEventBase;
0276 extern int  XkbKeyboardErrorCode;
0277 extern int  XkbDisableLockActions;
0278 extern char *   XkbBaseDirectory;
0279 extern char *   XkbBinDirectory;
0280 extern char *   XkbInitialMap;
0281 extern int  _XkbClientMajor;
0282 extern int  _XkbClientMinor;
0283 extern unsigned int XkbXIUnsupported;
0284 
0285 extern char *   XkbModelUsed,*XkbLayoutUsed,*XkbVariantUsed,*XkbOptionsUsed;
0286 extern Bool noXkbExtension;
0287 extern Bool XkbWantRulesProp;
0288 
0289 extern pointer  XkbLastRepeatEvent;
0290 
0291 extern CARD32   xkbDebugFlags;
0292 extern CARD32   xkbDebugCtrls;
0293 
0294 #define _XkbAlloc(s)        xalloc((s))
0295 #define _XkbCalloc(n,s)     Xcalloc((n)*(s))
0296 #define _XkbRealloc(o,s)    Xrealloc((o),(s))
0297 #define _XkbTypedAlloc(t)   ((t *)xalloc(sizeof(t)))
0298 #define _XkbTypedCalloc(n,t)    ((t *)Xcalloc((n)*sizeof(t)))
0299 #define _XkbTypedRealloc(o,n,t) \
0300     ((o)?(t *)Xrealloc((o),(n)*sizeof(t)):_XkbTypedCalloc(n,t))
0301 #define _XkbClearElems(a,f,l,t) bzero(&(a)[f],((l)-(f)+1)*sizeof(t))
0302 #define _XkbFree(p)     Xfree(p)
0303 
0304 #define _XkbLibError(c,l,d) \
0305     { _XkbErrCode= (c); _XkbErrLocation= (l); _XkbErrData= (d); }
0306 #define _XkbErrCode2(a,b) ((XID)((((unsigned int)(a))<<24)|((b)&0xffffff)))
0307 #define _XkbErrCode3(a,b,c) _XkbErrCode2(a,(((unsigned int)(b))<<16)|(c))
0308 #define _XkbErrCode4(a,b,c,d) _XkbErrCode3(a,b,((((unsigned int)(c))<<8)|(d)))
0309 
0310 extern  int DeviceKeyPress,DeviceKeyRelease;
0311 extern  int DeviceButtonPress,DeviceButtonRelease;
0312 
0313 #ifdef XINPUT
0314 #define _XkbIsPressEvent(t) (((t)==KeyPress)||((t)==DeviceKeyPress))
0315 #define _XkbIsReleaseEvent(t)   (((t)==KeyRelease)||((t)==DeviceKeyRelease))
0316 #else
0317 #define _XkbIsPressEvent(t) ((t)==KeyPress)
0318 #define _XkbIsReleaseEvent(t)   ((t)==KeyRelease)
0319 #endif
0320 
0321 #define _XkbCoreKeycodeInRange(c,k) (((k)>=(c)->curKeySyms.minKeyCode)&&\
0322                      ((k)<=(c)->curKeySyms.maxKeyCode))
0323 #define _XkbCoreNumKeys(c)  ((c)->curKeySyms.maxKeyCode-\
0324                  (c)->curKeySyms.minKeyCode+1)
0325 
0326 #define XConvertCase(s,l,u) XkbConvertCase(s,l,u)
0327 #undef  IsKeypadKey
0328 #define IsKeypadKey(s)      XkbKSIsKeypad(s)
0329 
0330 typedef int Status;
0331 typedef pointer XPointer;
0332 typedef struct _XDisplay Display;
0333 
0334 #ifndef True
0335 #define True    1
0336 #define False   0
0337 #endif
0338 
0339 #ifndef PATH_MAX
0340 #ifdef MAXPATHLEN
0341 #define PATH_MAX MAXPATHLEN
0342 #else
0343 #define PATH_MAX 1024
0344 #endif
0345 #endif
0346 
0347 _XFUNCPROTOBEGIN
0348 
0349 extern void XkbUseMsg(
0350     void
0351 );
0352 
0353 extern int XkbProcessArguments(
0354     int             /* argc */,
0355     char **         /* argv */,
0356     int             /* i */
0357 );
0358 
0359 extern  void    XkbSetExtension(DeviceIntPtr device, ProcessInputProc proc);
0360 
0361 extern  void    XkbFreeCompatMap(
0362     XkbDescPtr          /* xkb */,
0363     unsigned int        /* which */,
0364     Bool            /* freeMap */
0365 );
0366 
0367 extern  void XkbFreeNames(
0368     XkbDescPtr      /* xkb */,
0369     unsigned int        /* which */,
0370     Bool            /* freeMap */
0371 );
0372 
0373 extern DeviceIntPtr _XkbLookupAnyDevice(
0374     int         /* id */,
0375     int *       /* why_rtrn */
0376 );
0377 
0378 extern DeviceIntPtr _XkbLookupKeyboard(
0379     int         /* id */,
0380     int *       /* why_rtrn */
0381 );
0382 
0383 extern DeviceIntPtr _XkbLookupBellDevice(
0384     int         /* id */,
0385     int *       /* why_rtrn */
0386 );
0387 
0388 extern DeviceIntPtr _XkbLookupLedDevice(
0389     int         /* id */,
0390     int *       /* why_rtrn */
0391 );
0392 
0393 extern DeviceIntPtr _XkbLookupButtonDevice(
0394     int         /* id */,
0395     int *       /* why_rtrn */
0396 );
0397 
0398 extern  XkbDescPtr XkbAllocKeyboard(
0399     void
0400 );
0401 
0402 extern  Status XkbAllocClientMap(
0403     XkbDescPtr      /* xkb */,
0404     unsigned int        /* which */,
0405     unsigned int        /* nTypes */
0406 );
0407 
0408 extern  Status XkbAllocServerMap(
0409     XkbDescPtr      /* xkb */,
0410     unsigned int        /* which */,
0411     unsigned int        /* nNewActions */
0412 );
0413 
0414 extern  void    XkbFreeClientMap(
0415     XkbDescPtr          /* xkb */,
0416     unsigned int        /* what */,
0417     Bool            /* freeMap */
0418 );
0419 
0420 extern  void    XkbFreeServerMap(
0421     XkbDescPtr          /* xkb */,
0422     unsigned int        /* what */,
0423     Bool            /* freeMap */
0424 );
0425 
0426 extern  Status XkbAllocIndicatorMaps(
0427     XkbDescPtr      /* xkb */
0428 );
0429 
0430 extern  Status  XkbAllocCompatMap(
0431     XkbDescPtr          /* xkb */,
0432     unsigned int        /* which */,
0433     unsigned int        /* nInterpret */
0434 );
0435 
0436 extern  Status XkbAllocNames(
0437     XkbDescPtr      /* xkb */,
0438     unsigned int        /* which */,
0439     int         /* nTotalRG */,
0440     int         /* nTotalAliases */
0441 );
0442 
0443 extern  Status  XkbAllocControls(
0444     XkbDescPtr      /* xkb */,
0445     unsigned int        /* which*/
0446 );
0447 
0448 extern  Status  XkbCopyKeyType(
0449     XkbKeyTypePtr       /* from */,
0450     XkbKeyTypePtr       /* into */
0451 );
0452 
0453 extern  Status  XkbCopyKeyTypes(
0454     XkbKeyTypePtr       /* from */,
0455     XkbKeyTypePtr       /* into */,
0456     int             /* num_types */
0457 );
0458 
0459 extern  Status  XkbResizeKeyType(
0460     XkbDescPtr      /* xkb */,
0461     int         /* type_ndx */,
0462     int         /* map_count */,
0463     Bool        /* want_preserve */,
0464     int         /* new_num_lvls */
0465 );
0466 
0467 extern  void    XkbFreeKeyboard(
0468     XkbDescPtr      /* xkb */,
0469     unsigned int        /* which */,
0470     Bool            /* freeDesc */
0471 );
0472 
0473 extern  void XkbSetActionKeyMods(
0474     XkbDescPtr      /* xkb */,
0475     XkbAction *     /* act */,
0476     unsigned int        /* mods */
0477 );
0478 
0479 extern Bool XkbCheckActionVMods(
0480     XkbDescPtr      /* xkb */,
0481     XkbAction *     /* act */,
0482     unsigned int        /* changed */
0483 );
0484 
0485 extern Bool XkbApplyVModChanges(
0486     XkbSrvInfoPtr   /* xkbi */,
0487     unsigned int    /* changed */,
0488     XkbChangesPtr   /* pChanges */,
0489     unsigned int *  /* needChecksRtrn */,
0490     XkbEventCausePtr    /* cause */
0491 );
0492 
0493 extern void XkbApplyVModChangesToAllDevices(
0494     DeviceIntPtr    /* dev */,
0495     XkbDescPtr      /* xkb */,
0496     unsigned int    /* changed */,
0497     XkbEventCausePtr    /* cause */
0498 );
0499 
0500 extern  unsigned int XkbMaskForVMask(
0501     XkbDescPtr      /* xkb */,
0502     unsigned int    /* vmask */
0503 );
0504 
0505 extern Bool XkbVirtualModsToReal(
0506     XkbDescPtr  /* xkb */,
0507     unsigned int    /* virtua_mask */,
0508     unsigned int *  /* mask_rtrn */
0509 );
0510 
0511 extern  unsigned int    XkbAdjustGroup(
0512     int         /* group */,
0513     XkbControlsPtr  /* ctrls */
0514 );
0515 
0516 extern KeySym *XkbResizeKeySyms(
0517     XkbDescPtr      /* xkb */,
0518     int         /* key */,
0519     int         /* needed */
0520 );
0521 
0522 extern XkbAction *XkbResizeKeyActions(
0523     XkbDescPtr      /* xkb */,
0524     int         /* key */,
0525     int         /* needed */
0526 );
0527 
0528 extern void XkbUpdateKeyTypesFromCore(
0529     DeviceIntPtr    /* pXDev */,
0530     KeyCode         /* first */,
0531     CARD8       /* num */,
0532     XkbChangesPtr   /* pChanges */
0533 );
0534 
0535 extern  void XkbUpdateDescActions(  
0536     XkbDescPtr      /* xkb */,
0537     KeyCode     /* first */,
0538     CARD8       /* num */,
0539     XkbChangesPtr   /* changes */
0540 );
0541 
0542 extern void XkbUpdateActions(
0543     DeviceIntPtr    /* pXDev */,
0544     KeyCode         /* first */,
0545     CARD8       /* num */,
0546     XkbChangesPtr   /* pChanges */,
0547     unsigned int *  /* needChecksRtrn */,
0548     XkbEventCausePtr    /* cause */
0549 );
0550 
0551 extern void XkbUpdateCoreDescription(
0552     DeviceIntPtr    /* keybd */,
0553     Bool        /* resize */
0554 );
0555 
0556 extern void XkbApplyMappingChange(
0557     DeviceIntPtr    /* pXDev */,
0558     CARD8       /* request */,
0559     KeyCode         /* firstKey */,
0560     CARD8       /* num */,
0561     ClientPtr       /* client */
0562 );
0563 
0564 extern void XkbSetIndicators(
0565     DeviceIntPtr        /* pXDev */,
0566     CARD32          /* affect */,
0567     CARD32          /* values */,
0568     XkbEventCausePtr        /* cause */
0569 );
0570 
0571 extern void XkbUpdateIndicators(
0572     DeviceIntPtr        /* keybd */,
0573     CARD32          /* changed */,
0574     Bool            /* check_edevs */,
0575     XkbChangesPtr       /* pChanges */,
0576     XkbEventCausePtr        /* cause */
0577 );
0578 
0579 extern XkbSrvLedInfoPtr XkbAllocSrvLedInfo(
0580     DeviceIntPtr        /* dev */,
0581     KbdFeedbackPtr      /* kf */,
0582     LedFeedbackPtr      /* lf */,
0583     unsigned int        /* needed_parts */
0584 );
0585 
0586 extern XkbSrvLedInfoPtr XkbFindSrvLedInfo(
0587     DeviceIntPtr        /* dev */,
0588     unsigned int        /* class */,
0589     unsigned int        /* id */,
0590     unsigned int        /* needed_parts */
0591 );
0592 
0593 extern void XkbApplyLedNameChanges(
0594     DeviceIntPtr        /* dev */,
0595     XkbSrvLedInfoPtr        /* sli */,
0596     unsigned int        /* changed_names */,
0597     xkbExtensionDeviceNotify *  /* ed */,
0598     XkbChangesPtr       /* changes */,
0599     XkbEventCausePtr        /* cause */
0600 );
0601 
0602 extern void XkbApplyLedMapChanges(
0603     DeviceIntPtr        /* dev */,
0604     XkbSrvLedInfoPtr        /* sli */,
0605     unsigned int        /* changed_maps */,
0606     xkbExtensionDeviceNotify *  /* ed */,
0607     XkbChangesPtr       /* changes */,
0608     XkbEventCausePtr        /* cause */
0609 );
0610 
0611 extern void XkbApplyLedStateChanges(
0612     DeviceIntPtr        /* dev */,
0613     XkbSrvLedInfoPtr        /* sli */,
0614     unsigned int        /* changed_leds */,
0615     xkbExtensionDeviceNotify *  /* ed */,
0616     XkbChangesPtr       /* changes */,
0617     XkbEventCausePtr        /* cause */
0618 );
0619 
0620 extern void XkbUpdateLedAutoState(
0621     DeviceIntPtr        /* dev */,
0622     XkbSrvLedInfoPtr        /* sli */,
0623     unsigned int        /* maps_to_check */,
0624     xkbExtensionDeviceNotify *  /* ed */,
0625     XkbChangesPtr       /* changes */,
0626     XkbEventCausePtr        /* cause */
0627 );
0628 
0629 extern void XkbFlushLedEvents(  
0630     DeviceIntPtr        /* dev */,
0631     DeviceIntPtr        /* kbd */,
0632     XkbSrvLedInfoPtr        /* sli */,
0633     xkbExtensionDeviceNotify *  /* ed */,
0634     XkbChangesPtr       /* changes */,
0635     XkbEventCausePtr        /* cause */
0636 );
0637 
0638 extern void XkbUpdateAllDeviceIndicators(
0639     XkbChangesPtr       /* changes */,
0640     XkbEventCausePtr        /* cause */
0641 );
0642 
0643 extern unsigned int XkbIndicatorsToUpdate(
0644     DeviceIntPtr        /* dev */,
0645     unsigned long       /* state_changes */,
0646     Bool            /* enabled_ctrl_changes */
0647 );
0648 
0649 extern void XkbComputeDerivedState(
0650     XkbSrvInfoPtr       /* xkbi */
0651 );
0652 
0653 extern void XkbCheckSecondaryEffects(
0654     XkbSrvInfoPtr       /* xkbi */,
0655     unsigned int        /* which */,
0656     XkbChangesPtr       /* changes */,
0657     XkbEventCausePtr        /* cause */
0658 );
0659 
0660 extern void XkbCheckIndicatorMaps(
0661     DeviceIntPtr        /* dev */,
0662     XkbSrvLedInfoPtr        /* sli */,
0663     unsigned int        /* which */
0664 );
0665 
0666 extern unsigned int XkbStateChangedFlags(
0667     XkbStatePtr         /* old */,
0668     XkbStatePtr         /* new */
0669 );
0670 
0671 extern  void XkbSendStateNotify(
0672        DeviceIntPtr /* kbd */,
0673        xkbStateNotify * /* pSN */
0674 );
0675 
0676 extern  void XkbSendMapNotify(
0677        DeviceIntPtr /* kbd */,
0678        xkbMapNotify *   /* ev */
0679 );
0680 
0681 extern  int  XkbComputeControlsNotify(
0682     DeviceIntPtr        /* kbd */,
0683     XkbControlsPtr      /* old */,
0684     XkbControlsPtr      /* new */,
0685     xkbControlsNotify * /* pCN */,
0686     Bool            /* forceCtrlProc */
0687 );
0688 
0689 extern  void XkbSendControlsNotify(
0690        DeviceIntPtr     /* kbd */,
0691        xkbControlsNotify *  /* ev */
0692 );
0693 
0694 extern  void XkbSendCompatMapNotify(
0695     DeviceIntPtr        /* kbd */,
0696     xkbCompatMapNotify *    /* ev */
0697 );
0698 
0699 extern  void XkbSendIndicatorNotify(
0700        DeviceIntPtr     /* kbd */,
0701        int          /* xkbType */,
0702        xkbIndicatorNotify * /* ev */
0703 );
0704 
0705 extern  void XkbHandleBell(
0706        BOOL     /* force */,
0707        BOOL     /* eventOnly */,
0708        DeviceIntPtr /* kbd */,
0709        CARD8        /* percent */,
0710        pointer      /* ctrl */,
0711        CARD8        /* class */,
0712        Atom     /* name */,
0713        WindowPtr    /* pWin */,
0714        ClientPtr    /* pClient */
0715 );
0716 
0717 extern  void XkbSendAccessXNotify(
0718        DeviceIntPtr     /* kbd */,
0719        xkbAccessXNotify *   /* pEv */
0720 );
0721 
0722 extern  void XkbSendNamesNotify(
0723        DeviceIntPtr /* kbd */,
0724        xkbNamesNotify * /* ev */
0725 );
0726 
0727 extern  void XkbSendCompatNotify(
0728        DeviceIntPtr     /* kbd */,
0729        xkbCompatMapNotify * /* ev */
0730 );
0731 
0732 extern  void XkbSendActionMessage(
0733        DeviceIntPtr     /* kbd */,
0734        xkbActionMessage *   /* ev */
0735 );
0736 
0737 extern  void XkbSendExtensionDeviceNotify(
0738        DeviceIntPtr         /* kbd */,
0739        ClientPtr            /* client */,
0740        xkbExtensionDeviceNotify *   /* ev */
0741 );
0742 
0743 extern void XkbSendNotification(
0744     DeviceIntPtr        /* kbd */,
0745     XkbChangesPtr       /* pChanges */,
0746     XkbEventCausePtr        /* cause */
0747 );
0748 
0749 extern void XkbProcessKeyboardEvent(
0750     struct _xEvent *        /* xE */,
0751     DeviceIntPtr        /* keybd */,
0752     int             /* count */
0753 );
0754 
0755 extern void XkbProcessOtherEvent(
0756     struct _xEvent *        /* xE */,
0757     DeviceIntPtr        /* keybd */,
0758     int             /* count */
0759 );
0760 
0761 extern void XkbHandleActions(
0762     DeviceIntPtr        /* dev */,
0763     DeviceIntPtr        /* kbd */,
0764     struct _xEvent *        /* xE */,
0765     int             /* count */
0766 );
0767 
0768 extern Bool XkbEnableDisableControls(
0769     XkbSrvInfoPtr   /* xkbi */,
0770     unsigned long   /* change */,
0771     unsigned long   /* newValues */,
0772     XkbChangesPtr   /* changes */,
0773     XkbEventCausePtr    /* cause */
0774 );
0775 
0776 extern void AccessXInit(
0777     DeviceIntPtr        /* dev */
0778 );
0779 
0780 extern Bool AccessXFilterPressEvent(
0781     register struct _xEvent *   /* xE */,
0782     register DeviceIntPtr   /* keybd */,
0783     int             /* count */
0784 );
0785 
0786 extern Bool AccessXFilterReleaseEvent(
0787     register struct _xEvent *   /* xE */,
0788     register DeviceIntPtr   /* keybd */,
0789     int             /* count */
0790 );
0791 
0792 extern void AccessXCancelRepeatKey(
0793     XkbSrvInfoPtr   /* xkbi */,
0794     KeyCode     /* key */
0795 );
0796 
0797 extern void AccessXComputeCurveFactor(
0798     XkbSrvInfoPtr   /* xkbi */,
0799     XkbControlsPtr  /* ctrls */
0800 );
0801 
0802 extern  XkbDeviceLedInfoPtr XkbAddDeviceLedInfo(
0803     XkbDeviceInfoPtr    /* devi */,
0804     unsigned int        /* ledClass */,
0805     unsigned int        /* ledId */
0806 );
0807 
0808 extern  XkbDeviceInfoPtr    XkbAllocDeviceInfo(
0809     unsigned int        /* deviceSpec */,
0810     unsigned int        /* nButtons */,
0811     unsigned int        /* szLeds */
0812 );
0813 
0814 extern  void XkbFreeDeviceInfo(
0815     XkbDeviceInfoPtr    /* devi */,
0816     unsigned int        /* which */,
0817     Bool            /* freeDevI */
0818 );
0819 
0820 extern Status XkbResizeDeviceButtonActions(
0821     XkbDeviceInfoPtr        /* devi */,
0822     unsigned int            /* newTotal */
0823 );
0824 
0825 extern  XkbInterestPtr XkbFindClientResource(
0826        DevicePtr    /* inDev */,
0827        ClientPtr    /* client */
0828 );
0829 
0830 extern  XkbInterestPtr XkbAddClientResource(
0831        DevicePtr    /* inDev */,
0832        ClientPtr    /* client */,
0833        XID      /* id */
0834 );
0835 
0836 extern  int XkbRemoveClient(
0837        DevicePtr    /* inDev */,
0838        ClientPtr    /* client */
0839 );
0840 
0841 extern  int XkbRemoveResourceClient(
0842        DevicePtr    /* inDev */,
0843        XID      /* id */
0844 );
0845 
0846 extern int XkbDDXInitDevice(
0847     DeviceIntPtr        /* dev */
0848 );
0849 
0850 extern  int XkbDDXAccessXBeep(
0851     DeviceIntPtr        /* dev */,
0852     unsigned int    /* what */,
0853     unsigned int    /* which */
0854 );
0855 
0856 extern  void XkbDDXKeyClick(
0857     DeviceIntPtr    /* dev */,
0858     int         /* keycode */,
0859     int         /* synthetic */
0860 );
0861 
0862 extern  int XkbDDXUsesSoftRepeat(
0863     DeviceIntPtr    /* dev */
0864 );
0865 
0866 extern  void XkbDDXKeybdCtrlProc(
0867     DeviceIntPtr    /* dev */,
0868     KeybdCtrl * /* ctrl */
0869 );
0870 
0871 extern void XkbDDXChangeControls(
0872     DeviceIntPtr    /* dev */,
0873     XkbControlsPtr  /* old */,
0874     XkbControlsPtr  /* new */
0875 );
0876 
0877 extern void XkbDDXUpdateIndicators(
0878     DeviceIntPtr    /* keybd */,
0879     CARD32      /* newState */
0880 );
0881 
0882 extern void XkbDDXUpdateDeviceIndicators(
0883     DeviceIntPtr        /* dev */,
0884     XkbSrvLedInfoPtr    /* sli */,
0885     CARD32          /* newState */
0886 );
0887 
0888 extern void XkbDDXFakePointerButton(
0889     int         /* event */,
0890     int     /* button */
0891 );
0892 
0893 extern void XkbDDXFakePointerMotion(
0894     unsigned int    /* flags */,
0895     int     /* x */,
0896     int     /* y */
0897 );
0898 
0899 extern void XkbDDXFakeDeviceButton(
0900     DeviceIntPtr    /* dev */,
0901     Bool        /* press */,
0902     int     /* button */
0903 );
0904 
0905 extern int XkbDDXTerminateServer(
0906     DeviceIntPtr    /* dev */,
0907     KeyCode     /* key */,
0908     XkbAction * /* act */
0909 );
0910 
0911 extern int XkbDDXSwitchScreen(
0912     DeviceIntPtr    /* dev */,
0913     KeyCode     /* key */,
0914     XkbAction * /* act */
0915 );
0916 
0917 extern int XkbDDXPrivate(
0918     DeviceIntPtr    /* dev */,
0919     KeyCode     /* key */,
0920     XkbAction * /* act */
0921 );
0922 
0923 extern void XkbDisableComputedAutoRepeats(
0924     DeviceIntPtr    /* pXDev */,
0925     unsigned int    /* key */
0926 );
0927 
0928 extern void XkbSetRepeatKeys(
0929     DeviceIntPtr    /* pXDev */,
0930     int     /* key */,
0931     int     /* onoff */
0932 );
0933 
0934 extern  int XkbLatchModifiers(
0935     DeviceIntPtr    /* pXDev */,
0936     CARD8       /* mask */,
0937     CARD8       /* latches */
0938 );
0939 
0940 extern  int XkbLatchGroup(
0941     DeviceIntPtr    /* pXDev */,
0942     int     /* group */
0943 );
0944 
0945 extern  void XkbClearAllLatchesAndLocks(
0946     DeviceIntPtr        /* dev */,
0947     XkbSrvInfoPtr       /* xkbi */,
0948     Bool            /* genEv */,
0949     XkbEventCausePtr    /* cause */
0950 );
0951 
0952 extern  void    XkbSetRulesDflts(
0953     char *          /* rulesFile */,
0954     char *          /* model */,
0955     char *          /* layout */,
0956     char *          /* variant */,
0957     char *          /* options */
0958 );
0959 
0960 extern  void    XkbInitDevice(
0961     DeviceIntPtr    /* pXDev */
0962 );
0963 
0964 extern  Bool    XkbInitKeyboardDeviceStruct(
0965     DeviceIntPtr        /* pXDev */,
0966     XkbComponentNamesPtr    /* pNames */,
0967     KeySymsPtr      /* pSyms */,
0968     CARD8           /* pMods */[],
0969     BellProcPtr     /* bellProc */,
0970     KbdCtrlProcPtr      /* ctrlProc */
0971 );
0972 
0973 extern  int SProcXkbDispatch(
0974     ClientPtr       /* client */
0975 );
0976 
0977 extern XkbGeometryPtr XkbLookupNamedGeometry(
0978     DeviceIntPtr        /* dev */,
0979     Atom            /* name */,
0980     Bool *          /* shouldFree */
0981 );
0982 
0983 extern char *   _XkbDupString(
0984     char *          /* str */
0985 );
0986 
0987 extern void XkbConvertCase(
0988     KeySym          /* sym */,
0989     KeySym *        /* lower */,
0990     KeySym *        /* upper */
0991 );
0992 
0993 extern  Status   XkbChangeKeycodeRange( 
0994     XkbDescPtr      /* xkb */,
0995     int             /* minKC */,
0996     int             /* maxKC */,
0997     XkbChangesPtr       /* changes */
0998 );
0999 
1000 extern int XkbFinishDeviceInit(
1001     DeviceIntPtr        /* pXDev */
1002 );
1003 
1004 extern void XkbFreeSrvLedInfo(
1005     XkbSrvLedInfoPtr    /* sli */
1006 );
1007 
1008 extern void XkbFreeInfo(
1009     XkbSrvInfoPtr       /* xkbi */
1010 );
1011 
1012 extern Status XkbChangeTypesOfKey(
1013     XkbDescPtr      /* xkb */,
1014     int         /* key */,
1015     int         /* nGroups */,
1016     unsigned int        /* groups */,
1017     int *           /* newTypesIn */,
1018     XkbMapChangesPtr    /* changes */
1019 );
1020 
1021 extern XkbKeyTypePtr XkbAddKeyType(
1022     XkbDescPtr      /* xkb */,
1023     Atom            /* name */,
1024     int         /* map_count */,
1025     Bool            /* want_preserve */,
1026     int         /* num_lvls */
1027 );
1028 
1029 extern Status XkbInitCanonicalKeyTypes(
1030     XkbDescPtr      /* xkb */,
1031     unsigned int        /* which */,
1032     int         /* keypadVMod */
1033 );
1034 
1035 extern int XkbKeyTypesForCoreSymbols(
1036     XkbDescPtr      /* xkb */,
1037     int         /* map_width */,
1038     KeySym *        /* core_syms */,
1039     unsigned int        /* protected */,
1040     int *           /* types_inout */,
1041     KeySym *        /* xkb_syms_rtrn */
1042 );
1043 
1044 extern Bool XkbApplyCompatMapToKey(
1045     XkbDescPtr      /* xkb */,
1046     KeyCode         /* key */,
1047     XkbChangesPtr       /* changes */
1048 );
1049 
1050 extern Bool XkbUpdateMapFromCore(
1051     XkbDescPtr      /* xkb */,
1052     KeyCode         /* first_key */,
1053     int         /* num_keys */,
1054     int         /* map_width */,
1055     KeySym *        /* core_keysyms */,
1056     XkbChangesPtr       /* changes */
1057 );
1058 
1059 extern void XkbFreeControls(
1060     XkbDescPtr      /* xkb */,
1061     unsigned int        /* which */,
1062     Bool            /* freeMap */
1063 );
1064 
1065 extern void XkbFreeIndicatorMaps(
1066     XkbDescPtr      /* xkb */
1067 );
1068 
1069 extern Bool XkbApplyVirtualModChanges(
1070     XkbDescPtr      /* xkb */,
1071     unsigned int        /* changed */,
1072     XkbChangesPtr       /* changes */
1073 );
1074 
1075 extern Bool XkbUpdateActionVirtualMods(
1076     XkbDescPtr      /* xkb */,
1077     XkbAction *     /* act */,
1078     unsigned int        /* changed */
1079 );
1080 
1081 extern void XkbUpdateKeyTypeVirtualMods(
1082     XkbDescPtr      /* xkb */,
1083     XkbKeyTypePtr       /* type */,
1084     unsigned int        /* changed */,
1085     XkbChangesPtr       /* changes */
1086 );
1087 
1088 extern void XkbSendNewKeyboardNotify(
1089     DeviceIntPtr        /* kbd */,
1090     xkbNewKeyboardNotify *  /* pNKN */
1091 );
1092 
1093 #ifdef XKBSRV_NEED_FILE_FUNCS
1094 
1095 #include <X11/extensions/XKMformat.h>
1096 #include <X11/extensions/XKBfile.h>
1097 #include <X11/extensions/XKBrules.h>
1098 
1099 #define _XkbListKeymaps     0
1100 #define _XkbListKeycodes    1
1101 #define _XkbListTypes       2
1102 #define _XkbListCompat      3
1103 #define _XkbListSymbols     4
1104 #define _XkbListGeometry    5
1105 #define _XkbListNumComponents   6
1106 
1107 typedef struct _XkbSrvListInfo {
1108     int     szPool;
1109     int     nPool;
1110     char *      pool;
1111 
1112     int     maxRtrn;
1113     int     nTotal;
1114 
1115     char *      pattern[_XkbListNumComponents];
1116     int     nFound[_XkbListNumComponents];
1117 } XkbSrvListInfoRec,*XkbSrvListInfoPtr;
1118 
1119 char *
1120 XkbGetRulesDflts(
1121     XkbRF_VarDefsPtr    /* defs */
1122 );
1123 
1124 extern void XkbSetRulesUsed(
1125     XkbRF_VarDefsPtr    /* defs */
1126 );
1127 
1128 
1129 extern  Status  XkbDDXList(
1130     DeviceIntPtr        /* dev */,
1131     XkbSrvListInfoPtr   /* listing */,
1132     ClientPtr       /* client */
1133 );
1134 
1135 extern  unsigned int XkbDDXLoadKeymapByNames(
1136     DeviceIntPtr        /* keybd */,
1137     XkbComponentNamesPtr    /* names */,
1138     unsigned int        /* want */,
1139     unsigned int        /* need */,
1140     XkbFileInfoPtr      /* finfoRtrn */,
1141     char *          /* keymapNameRtrn */,
1142     int             /* keymapNameRtrnLen */
1143 );
1144 
1145 extern  Bool XkbDDXNamesFromRules(
1146     DeviceIntPtr        /* keybd */,
1147     char *          /* rules */,
1148     XkbRF_VarDefsPtr    /* defs */,
1149     XkbComponentNamesPtr    /* names */
1150 );
1151 
1152 extern  FILE *XkbDDXOpenConfigFile(
1153     char *  /* mapName */,
1154     char *  /* fileNameRtrn */,
1155     int /* fileNameRtrnLen */
1156 );
1157 
1158 extern  Bool XkbDDXApplyConfig(
1159     XPointer    /* cfg_in */,
1160     XkbSrvInfoPtr   /* xkbi */
1161 );
1162 
1163 extern XPointer XkbDDXPreloadConfig(
1164     char **         /* rulesFileRtrn */,
1165     XkbRF_VarDefsPtr    /* defs */,
1166     XkbComponentNamesPtr    /* names */,
1167     DeviceIntPtr        /* dev */
1168 );
1169 
1170 extern  int _XkbStrCaseCmp(
1171     char *          /* str1 */,
1172     char *          /* str2 */
1173 );
1174 
1175 #endif /* XKBSRV_NEED_FILE_FUNCS */
1176 
1177 
1178 _XFUNCPROTOEND
1179 
1180 #define XkbAtomGetString(d,s)   NameForAtom(s)
1181 
1182 #endif /* _XKBSRV_H_ */
1183 
1184