home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-bin / x11r6.1 / include / x11 / extensions / xkbsrv.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-10-17  |  27.3 KB  |  1,248 lines

  1. /* $XConsortium: XKBsrv.h /main/22 1996/03/06 21:40:17 kaleb $ */
  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.  
  28. #ifndef _XKBSRV_H_
  29. #define    _XKBSRV_H_
  30.  
  31. #ifdef XKB_IN_SERVER
  32. #define XkbAllocClientMap        SrvXkbAllocClientMap
  33. #define XkbAllocServerMap        SrvXkbAllocServerMap
  34. #define XkbChangeTypesOfKey        SrvXkbChangeTypesOfKey
  35. #define    XkbAddKeyType            SrvXkbAddKeyType
  36. #define XkbCopyKeyType            SrvXkbCopyKeyType
  37. #define XkbCopyKeyTypes            SrvXkbCopyKeyTypes
  38. #define XkbFreeClientMap        SrvXkbFreeClientMap
  39. #define XkbFreeServerMap        SrvXkbFreeServerMap
  40. #define XkbInitCanonicalKeyTypes    SrvXkbInitCanonicalKeyTypes
  41. #define    XkbKeyTypesForCoreSymbols    SrvXkbKeyTypesForCoreSymbols
  42. #define    XkbApplyCompatMapToKey        SrvXkbApplyCompatMapToKey
  43. #define    XkbUpdateMapFromCore        SrvXkbUpdateMapFromCore
  44. #define XkbResizeKeyActions        SrvXkbResizeKeyActions
  45. #define XkbResizeKeySyms        SrvXkbResizeKeySyms
  46. #define XkbResizeKeyType        SrvXkbResizeKeyType
  47. #define XkbAllocCompatMap        SrvXkbAllocCompatMap
  48. #define XkbAllocControls        SrvXkbAllocControls
  49. #define XkbAllocIndicatorMaps        SrvXkbAllocIndicatorMaps
  50. #define XkbAllocKeyboard        SrvXkbAllocKeyboard
  51. #define XkbAllocNames            SrvXkbAllocNames
  52. #define XkbFreeCompatMap        SrvXkbFreeCompatMap
  53. #define XkbFreeControls            SrvXkbFreeControls
  54. #define XkbFreeIndicatorMaps        SrvXkbFreeIndicatorMaps
  55. #define XkbFreeKeyboard            SrvXkbFreeKeyboard
  56. #define XkbFreeNames            SrvXkbFreeNames
  57. #define    XkbAddDeviceLedInfo        SrvXkbAddDeviceLedInfo
  58. #define    XkbAllocDeviceInfo        SrvXkbAllocDeviceInfo
  59. #define    XkbFreeDeviceInfo        SrvXkbFreeDeviceInfo
  60. #define    XkbResizeDeviceButtonActions    SrvXkbResizeDeviceButtonActions
  61. #define XkbLatchModifiers        SrvXkbLatchModifiers
  62. #define XkbLatchGroup            SrvXkbLatchGroup
  63. #define XkbVirtualModsToReal        SrvXkbVirtualModsToReal
  64. #define    XkbChangeKeycodeRange        SrvXkbChangeKeycodeRange
  65. #define    XkbApplyVirtualModChanges    SrvXkbApplyVirtualModChanges
  66. #define    XkbUpdateActionVirtualMods    SrvXkbUpdateActionVirtualMods
  67. #define XkbUpdateKeyTypeVirtualMods    SrvXkbUpdateKeyTypeVirtualMods
  68. #endif
  69.  
  70. #include <X11/extensions/XKBstr.h>
  71. #include <X11/extensions/XKBproto.h>
  72.  
  73. typedef struct _XkbInterest {
  74.     DeviceIntPtr        dev;
  75.     ClientPtr        client;
  76.     XID            resource;
  77.     struct _XkbInterest *    next;
  78.     CARD16            extDevNotifyMask;
  79.     CARD16            stateNotifyMask;
  80.     CARD16            namesNotifyMask;
  81.     CARD32             ctrlsNotifyMask;
  82.     CARD8            compatNotifyMask;
  83.     BOOL            bellNotifyMask;
  84.     BOOL            actionMessageMask;
  85.     CARD16            accessXNotifyMask;
  86.     CARD32            iStateNotifyMask;
  87.     CARD32            iMapNotifyMask;
  88.     CARD16            altSymsNotifyMask;
  89.     CARD32            autoCtrls;
  90.     CARD32            autoCtrlValues;
  91. } XkbInterestRec,*XkbInterestPtr;
  92.  
  93. typedef struct _XkbRadioGroup {
  94.     CARD8        flags;
  95.     CARD8        nMembers;
  96.     CARD8        dfltDown;
  97.     CARD8        currentDown;
  98.     CARD8        members[XkbRGMaxMembers];
  99. } XkbRadioGroupRec, *XkbRadioGroupPtr;
  100.  
  101. typedef struct    _XkbEventCause {
  102.     CARD8        kc;
  103.     CARD8        event;
  104.     CARD8        mjr;
  105.     CARD8        mnr;
  106.     ClientPtr    client;
  107. } XkbEventCauseRec,*XkbEventCausePtr;
  108. #define    XkbSetCauseKey(c,k,e)    { (c)->kc= (k),(c)->event= (e),\
  109.                   (c)->mjr= (c)->mnr= 0; \
  110.                   (c)->client= NULL; }
  111. #define    XkbSetCauseReq(c,j,n,cl) { (c)->kc= (c)->event= 0,\
  112.                   (c)->mjr= (j),(c)->mnr= (n);\
  113.                   (c)->client= (cl); }
  114. #define    XkbSetCauseCoreReq(c,e,cl) XkbSetCauseReq(c,e,0,cl)
  115. #define    XkbSetCauseXkbReq(c,e,cl)  XkbSetCauseReq(c,XkbReqCode,e,cl)
  116. #define    XkbSetCauseUnknown(c)       XkbSetCauseKey(c,0,0)
  117.  
  118. #define    _OFF_TIMER        0
  119. #define    _KRG_WARN_TIMER        1
  120. #define    _KRG_TIMER        2
  121. #define    _SK_TIMEOUT_TIMER    3
  122. #define    _ALL_TIMEOUT_TIMER    4
  123.  
  124. #define    _BEEP_NONE        0
  125. #define    _BEEP_FEATURE_ON    1
  126. #define    _BEEP_FEATURE_OFF    2
  127. #define    _BEEP_FEATURE_CHANGE    3
  128. #define    _BEEP_SLOW_WARN        4
  129. #define    _BEEP_SLOW_PRESS    5
  130. #define    _BEEP_SLOW_ACCEPT    6
  131. #define    _BEEP_SLOW_REJECT    7
  132. #define    _BEEP_SLOW_RELEASE    8
  133. #define    _BEEP_STICKY_LATCH    9
  134. #define    _BEEP_STICKY_LOCK    10
  135. #define    _BEEP_STICKY_UNLOCK    11
  136. #define    _BEEP_LED_ON        12
  137. #define    _BEEP_LED_OFF        13
  138. #define    _BEEP_LED_CHANGE    14
  139. #define    _BEEP_BOUNCE_REJECT    15
  140.  
  141. typedef struct _XkbSrvInfo {
  142.     XkbStateRec     prev_state;
  143.     XkbStateRec     state;
  144.     XkbDescPtr     desc;
  145.  
  146.     DeviceIntPtr     device;
  147.     KbdCtrlProcPtr     kbdProc;
  148.  
  149.     XkbRadioGroupPtr radioGroups;
  150.     CARD8         nRadioGroups;
  151.     CARD8         clearMods;
  152.     CARD8         setMods;
  153.     INT16         groupChange;
  154.  
  155.     CARD16         dfltPtrDelta;
  156.  
  157.     double         mouseKeysCurve;
  158.     double         mouseKeysCurveFactor;
  159.     INT16         mouseKeysDX;
  160.     INT16         mouseKeysDY;
  161.     CARD8         mouseKeysFlags;
  162.     Bool         mouseKeysAccel;
  163.     CARD8         mouseKeysCounter;
  164.  
  165.     CARD8         lockedPtrButtons;
  166.     CARD8         shiftKeyCount;
  167.     KeyCode         mouseKey;
  168.     KeyCode         inactiveKey;
  169.     KeyCode         slowKey;
  170.     KeyCode         repeatKey;
  171.     CARD8         krgTimerActive;
  172.     CARD8         beepType;
  173.     CARD8         beepCount;
  174.  
  175.     CARD32         flags;
  176.     CARD32         lastPtrEventTime;
  177.     CARD32         lastShiftEventTime;
  178.     OsTimerPtr     beepTimer;
  179.     OsTimerPtr     mouseKeyTimer;
  180.     OsTimerPtr     slowKeysTimer;
  181.     OsTimerPtr     bounceKeysTimer;
  182.     OsTimerPtr     repeatKeyTimer;
  183.     OsTimerPtr     krgTimer;
  184. } XkbSrvInfoRec, *XkbSrvInfoPtr;
  185.  
  186. #define    XkbSLI_IsDefault    (1L<<0)
  187. #define    XkbSLI_HasOwnState    (1L<<1)
  188.  
  189. typedef struct    _XkbSrvLedInfo {
  190.     CARD16            flags;
  191.     CARD16            class;
  192.     CARD16            id;
  193.     union {
  194.         KbdFeedbackPtr    kf;
  195.         LedFeedbackPtr    lf;
  196.     }             fb;
  197.  
  198.     CARD32            physIndicators;
  199.     CARD32            autoState;
  200.     CARD32            explicitState;
  201.     CARD32            effectiveState;
  202.  
  203.     CARD32            mapsPresent;
  204.     CARD32            namesPresent;
  205.     XkbIndicatorMapPtr    maps;
  206.     Atom *            names;
  207.  
  208.     CARD32            usesBase;
  209.     CARD32            usesLatched;
  210.     CARD32            usesLocked;
  211.     CARD32            usesEffective;
  212.     CARD32            usesCompat;
  213.     CARD32            usesControls;
  214.  
  215.     CARD32            usedComponents;
  216. } XkbSrvLedInfoRec, *XkbSrvLedInfoPtr;
  217.  
  218. /*
  219.  * Settings for xkbClientFlags field (used by DIX)
  220.  * These flags _must_ not overlap with XkbPCF_*
  221.  */
  222. #define    _XkbClientInitialized        (1<<15)
  223.  
  224. #define    _XkbWantsDetectableAutoRepeat(c)\
  225.     ((c)->xkbClientFlags&XkbPCF_DetectableAutoRepeatMask)
  226.  
  227. /*
  228.  * Settings for flags field
  229.  */
  230. #define    _XkbStateNotifyInProgress    (1<<0)
  231.  
  232. /***====================================================================***/
  233.  
  234. #define XkbAX_KRGMask     (XkbSlowKeysMask|XkbBounceKeysMask)
  235. #define    XkbAllFilteredEventsMask \
  236.             (XkbAccessXKeysMask|XkbRepeatKeysMask|XkbAX_KRGMask)
  237.  
  238. /***====================================================================***/
  239.  
  240. extern int    XkbReqCode;
  241. extern int    XkbEventBase;
  242. extern int    XkbKeyboardErrorCode;
  243. extern int    XkbDisableLockActions;
  244. extern char *    XkbBaseDirectory;
  245. extern char *    XkbInitialMap;
  246. extern int    _XkbClientMajor;
  247. extern int    _XkbClientMinor;
  248. extern unsigned    int XkbXIUnsupported;
  249.  
  250. extern Bool    noXkbExtension;
  251.  
  252. extern pointer    XkbLastRepeatEvent;
  253.  
  254. extern CARD32    xkbDebugFlags;
  255. extern CARD32    xkbDebugCtrls;
  256.  
  257. #define    _XkbAlloc(s)        xalloc((s))
  258. #define    _XkbCalloc(n,s)        Xcalloc((n)*(s))
  259. #define    _XkbRealloc(o,s)    Xrealloc((o),(s))
  260. #define    _XkbTypedAlloc(t)    ((t *)xalloc(sizeof(t)))
  261. #define    _XkbTypedCalloc(n,t)    ((t *)Xcalloc((n)*sizeof(t)))
  262. #define    _XkbTypedRealloc(o,n,t) \
  263.     ((o)?(t *)Xrealloc((o),(n)*sizeof(t)):_XkbTypedCalloc(n,t))
  264. #define    _XkbClearElems(a,f,l,t)    bzero(&(a)[f],((l)-(f)+1)*sizeof(t))
  265. #define    _XkbFree(p)        Xfree(p)
  266.  
  267. #define    _XkbLibError(c,l,d) \
  268.     { _XkbErrCode= (c); _XkbErrLocation= (l); _XkbErrData= (d); }
  269. #define    _XkbErrCode2(a,b) ((XID)((((unsigned int)(a))<<24)|((b)&0xffffff)))
  270. #define    _XkbErrCode3(a,b,c)    _XkbErrCode2(a,(((unsigned int)(b))<<16)|(c))
  271. #define    _XkbErrCode4(a,b,c,d) _XkbErrCode3(a,b,((((unsigned int)(c))<<8)|(d)))
  272.  
  273. extern    int    DeviceKeyPress,DeviceKeyRelease;
  274. extern    int    DeviceButtonPress,DeviceButtonRelease;
  275.  
  276. #ifdef XINPUT
  277. #define    _XkbIsPressEvent(t)    (((t)==KeyPress)||((t)==DeviceKeyPress))
  278. #define    _XkbIsReleaseEvent(t)    (((t)==KeyRelease)||((t)==DeviceKeyRelease))
  279. #else
  280. #define    _XkbIsPressEvent(t)    ((t)==KeyPress)
  281. #define    _XkbIsReleaseEvent(t)    ((t)==KeyRelease)
  282. #endif
  283.  
  284. #define    _XkbCoreKeycodeInRange(c,k)    (((k)>=(c)->curKeySyms.minKeyCode)&&\
  285.                      ((k)<=(c)->curKeySyms.maxKeyCode))
  286. #define    _XkbCoreNumKeys(c)    ((c)->curKeySyms.maxKeyCode-\
  287.                  (c)->curKeySyms.minKeyCode+1)
  288.  
  289. #define    XConvertCase(s,l,u)    XkbConvertCase(s,l,u)
  290. #define    IsKeypadKey(s)        XkbKSIsKeypad(s)
  291.  
  292. #define    Status        int
  293. #define    XPointer    pointer
  294. #define    Display        struct _XDisplay
  295.  
  296. #ifndef True
  297. #define    True    1
  298. #define    False    0
  299. #endif
  300.  
  301. #ifndef PATH_MAX
  302. #ifdef MAXPATHLEN
  303. #define    PATH_MAX MAXPATHLEN
  304. #else
  305. #define    PATH_MAX 1024
  306. #endif
  307. #endif
  308.  
  309. _XFUNCPROTOBEGIN
  310.  
  311. extern    void    XkbFreeCompatMap(
  312. #if NeedFunctionPrototypes
  313.     XkbDescPtr            /* xkb */,
  314.     unsigned int        /* which */,
  315.     Bool            /* freeMap */
  316. #endif
  317. );
  318.  
  319. extern    void XkbFreeNames(
  320. #if NeedFunctionPrototypes
  321.     XkbDescPtr        /* xkb */,
  322.     unsigned int        /* which */,
  323.     Bool            /* freeMap */
  324. #endif
  325. );
  326.  
  327. extern DeviceIntPtr _XkbLookupAnyDevice(
  328. #if NeedFunctionPrototypes
  329.     int            /* id */,
  330.     int *        /* why_rtrn */
  331. #endif
  332. );
  333.  
  334. extern DeviceIntPtr _XkbLookupKeyboard(
  335. #if NeedFunctionPrototypes
  336.     int            /* id */,
  337.     int *        /* why_rtrn */
  338. #endif
  339. );
  340.  
  341. extern DeviceIntPtr _XkbLookupBellDevice(
  342. #if NeedFunctionPrototypes
  343.     int            /* id */,
  344.     int *        /* why_rtrn */
  345. #endif
  346. );
  347.  
  348. extern DeviceIntPtr _XkbLookupLedDevice(
  349. #if NeedFunctionPrototypes
  350.     int            /* id */,
  351.     int *        /* why_rtrn */
  352. #endif
  353. );
  354.  
  355. extern DeviceIntPtr _XkbLookupButtonDevice(
  356. #if NeedFunctionPrototypes
  357.     int            /* id */,
  358.     int *        /* why_rtrn */
  359. #endif
  360. );
  361.  
  362. extern    XkbDescPtr XkbAllocKeyboard(
  363. #if NeedFunctionPrototypes
  364.     void
  365. #endif
  366. );
  367.  
  368. extern    Status XkbAllocClientMap(
  369. #if NeedFunctionPrototypes
  370.     XkbDescPtr        /* xkb */,
  371.     unsigned int        /* which */,
  372.     unsigned int        /* nTypes */
  373. #endif
  374. );
  375.  
  376. extern    Status XkbAllocServerMap(
  377. #if NeedFunctionPrototypes
  378.     XkbDescPtr        /* xkb */,
  379.     unsigned int        /* which */,
  380.     unsigned int        /* nNewActions */
  381. #endif
  382. );
  383.  
  384. extern    void    XkbFreeClientMap(
  385. #if NeedFunctionPrototypes
  386.     XkbDescPtr            /* xkb */,
  387.     unsigned int        /* what */,
  388.     Bool            /* freeMap */
  389. #endif
  390. );
  391.  
  392. extern    void    XkbFreeServerMap(
  393. #if NeedFunctionPrototypes
  394.     XkbDescPtr            /* xkb */,
  395.     unsigned int        /* what */,
  396.     Bool            /* freeMap */
  397. #endif
  398. );
  399.  
  400. extern    Status XkbAllocIndicatorMaps(
  401. #if NeedFunctionPrototypes
  402.     XkbDescPtr        /* xkb */
  403. #endif
  404. );
  405.  
  406. extern    Status    XkbAllocCompatMap(
  407. #if NeedFunctionPrototypes
  408.     XkbDescPtr            /* xkb */,
  409.     unsigned int        /* which */,
  410.     unsigned int        /* nInterpret */
  411. #endif
  412. );
  413.  
  414. extern    Status XkbAllocNames(
  415. #if NeedFunctionPrototypes
  416.     XkbDescPtr        /* xkb */,
  417.     unsigned int        /* which */,
  418.     int            /* nTotalRG */,
  419.     int            /* nTotalAliases */
  420. #endif
  421. );
  422.  
  423. extern    Status    XkbAllocControls(
  424. #if NeedFunctionPrototypes
  425.     XkbDescPtr        /* xkb */,
  426.     unsigned int        /* which*/
  427. #endif
  428. );
  429.  
  430. extern    Status    XkbCopyKeyType(
  431. #if NeedFunctionPrototypes
  432.     XkbKeyTypePtr        /* from */,
  433.     XkbKeyTypePtr        /* into */
  434. #endif
  435. );
  436.  
  437. extern    Status    XkbCopyKeyTypes(
  438. #if NeedFunctionPrototypes
  439.     XkbKeyTypePtr        /* from */,
  440.     XkbKeyTypePtr        /* into */,
  441.     int                /* num_types */
  442. #endif
  443. );
  444.  
  445. extern    Status    XkbResizeKeyType(
  446. #if NeedFunctionPrototypes
  447.     XkbDescPtr        /* xkb */,
  448.     int            /* type_ndx */,
  449.     int            /* map_count */,
  450.     Bool        /* want_preserve */,
  451.     int            /* new_num_lvls */
  452. #endif
  453. );
  454.  
  455. extern    void    XkbFreeKeyboard(
  456. #if NeedFunctionPrototypes
  457.     XkbDescPtr        /* xkb */,
  458.     unsigned int        /* which */,
  459.     Bool            /* freeDesc */
  460. #endif
  461. );
  462.  
  463. extern  void XkbSetActionKeyMods(
  464. #if NeedFunctionPrototypes
  465.     XkbDescPtr        /* xkb */,
  466.     XkbAction *        /* act */,
  467.     unsigned int         /* mods */
  468. #endif
  469. );
  470.  
  471. extern Bool XkbCheckActionVMods(
  472. #if NeedFunctionPrototypes
  473.     XkbDescPtr        /* xkb */,
  474.     XkbAction *        /* act */,
  475.     unsigned int         /* changed */
  476. #endif
  477. );
  478.  
  479. extern Bool XkbApplyVModChanges(
  480. #if NeedFunctionPrototypes
  481.     XkbSrvInfoPtr    /* xkbi */,
  482.     unsigned int    /* changed */,
  483.     XkbChangesPtr    /* pChanges */,
  484.     unsigned int *    /* needChecksRtrn */,
  485.     XkbEventCausePtr    /* cause */
  486. #endif
  487. );
  488.  
  489. extern void XkbApplyVModChangesToAllDevices(
  490. #if NeedFunctionPrototypes
  491.     DeviceIntPtr    /* dev */,
  492.     XkbDescPtr         /* xkb */,
  493.     unsigned int     /* changed */,
  494.     XkbEventCausePtr    /* cause */
  495. #endif
  496. );
  497.  
  498. extern    unsigned int XkbMaskForVMask(
  499. #if NeedFunctionPrototypes
  500.     XkbDescPtr        /* xkb */,
  501.     unsigned int    /* vmask */
  502. #endif
  503. );
  504.  
  505. extern Bool XkbVirtualModsToReal(
  506. #if NeedFunctionPrototypes
  507.     XkbDescPtr    /* xkb */,
  508.     unsigned int    /* virtua_mask */,
  509.     unsigned int *    /* mask_rtrn */
  510. #endif
  511. );
  512.  
  513. extern    unsigned int    XkbAdjustGroup(
  514. #if NeedFunctionPrototypes
  515.     int            /* group */,
  516.     XkbControlsPtr    /* ctrls */
  517. #endif
  518. );
  519.  
  520. extern KeySym *XkbResizeKeySyms(
  521. #if NeedFunctionPrototypes
  522.     XkbDescPtr        /* xkb */,
  523.     int         /* key */,
  524.     int         /* needed */
  525. #endif
  526. );
  527.  
  528. extern XkbAction *XkbResizeKeyActions(
  529. #if NeedFunctionPrototypes
  530.     XkbDescPtr        /* xkb */,
  531.     int         /* key */,
  532.     int         /* needed */
  533. #endif
  534. );
  535.  
  536. extern void XkbUpdateKeyTypesFromCore(
  537. #if NeedFunctionPrototypes
  538.     DeviceIntPtr    /* pXDev */,
  539.     KeyCode         /* first */,
  540.     CARD8         /* num */,
  541.     XkbChangesPtr    /* pChanges */
  542. #endif
  543. );
  544.  
  545. extern    void XkbUpdateDescActions(    
  546. #if NeedFunctionPrototypes
  547.     XkbDescPtr        /* xkb */,
  548.     KeyCode        /* first */,
  549.     CARD8        /* num */,
  550.     XkbChangesPtr    /* changes */
  551. #endif
  552. );
  553.  
  554. extern void XkbUpdateActions(
  555. #if NeedFunctionPrototypes
  556.     DeviceIntPtr    /* pXDev */,
  557.     KeyCode         /* first */,
  558.     CARD8         /* num */,
  559.     XkbChangesPtr      /* pChanges */,
  560.     unsigned int *    /* needChecksRtrn */,
  561.     XkbEventCausePtr    /* cause */
  562. #endif
  563. );
  564.  
  565. extern void XkbUpdateCoreDescription(
  566. #if NeedFunctionPrototypes
  567.     DeviceIntPtr    /* keybd */,
  568.     Bool        /* resize */
  569. #endif
  570. );
  571.  
  572. extern void XkbApplyMappingChange(
  573. #if NeedFunctionPrototypes
  574.     DeviceIntPtr    /* pXDev */,
  575.     CARD8         /* request */,
  576.     KeyCode         /* firstKey */,
  577.     CARD8         /* num */,
  578.     ClientPtr        /* client */
  579. #endif
  580. );
  581.  
  582. extern void XkbSetIndicators(
  583. #if NeedFunctionPrototypes
  584.     DeviceIntPtr        /* pXDev */,
  585.     CARD32            /* affect */,
  586.     CARD32            /* values */,
  587.     XkbEventCausePtr        /* cause */
  588. #endif
  589. );
  590.  
  591. extern void XkbUpdateIndicators(
  592. #if NeedFunctionPrototypes
  593.     DeviceIntPtr        /* keybd */,
  594.     CARD32             /* changed */,
  595.     Bool            /* check_edevs */,
  596.     XkbChangesPtr        /* pChanges */,
  597.     XkbEventCausePtr        /* cause */
  598. #endif
  599. );
  600.  
  601. extern XkbSrvLedInfoPtr XkbAllocSrvLedInfo(
  602. #if NeedFunctionPrototypes
  603.     DeviceIntPtr        /* dev */,
  604.     KbdFeedbackPtr        /* kf */,
  605.     LedFeedbackPtr        /* lf */,
  606.     unsigned int        /* needed_parts */
  607. #endif
  608. );
  609.  
  610. extern XkbSrvLedInfoPtr XkbFindSrvLedInfo(
  611. #if NeedFunctionPrototypes
  612.     DeviceIntPtr        /* dev */,
  613.     unsigned int        /* class */,
  614.     unsigned int        /* id */,
  615.     unsigned int        /* needed_parts */
  616. #endif
  617. );
  618.  
  619. extern void XkbApplyLedNameChanges(
  620. #if NeedFunctionPrototypes
  621.     DeviceIntPtr        /* dev */,
  622.     XkbSrvLedInfoPtr        /* sli */,
  623.     unsigned int        /* changed_names */,
  624.     xkbExtensionDeviceNotify *    /* ed */,
  625.     XkbChangesPtr        /* changes */,
  626.     XkbEventCausePtr        /* cause */
  627. #endif
  628. );
  629.  
  630. extern void XkbApplyLedMapChanges(
  631. #if NeedFunctionPrototypes
  632.     DeviceIntPtr        /* dev */,
  633.     XkbSrvLedInfoPtr        /* sli */,
  634.     unsigned int        /* changed_maps */,
  635.     xkbExtensionDeviceNotify *    /* ed */,
  636.     XkbChangesPtr        /* changes */,
  637.     XkbEventCausePtr        /* cause */
  638. #endif
  639. );
  640.  
  641. extern void XkbApplyLedStateChanges(
  642. #if NeedFunctionPrototypes
  643.     DeviceIntPtr        /* dev */,
  644.     XkbSrvLedInfoPtr        /* sli */,
  645.     unsigned int        /* changed_leds */,
  646.     xkbExtensionDeviceNotify *    /* ed */,
  647.     XkbChangesPtr        /* changes */,
  648.     XkbEventCausePtr        /* cause */
  649. #endif
  650. );
  651.  
  652. extern void XkbUpdateLedAutoState(
  653. #if NeedFunctionPrototypes
  654.     DeviceIntPtr        /* dev */,
  655.     XkbSrvLedInfoPtr        /* sli */,
  656.     unsigned int        /* maps_to_check */,
  657.     xkbExtensionDeviceNotify *    /* ed */,
  658.     XkbChangesPtr        /* changes */,
  659.     XkbEventCausePtr        /* cause */
  660. #endif
  661. );
  662.  
  663. extern void XkbFlushLedEvents(    
  664. #if NeedFunctionPrototypes
  665.     DeviceIntPtr        /* dev */,
  666.     DeviceIntPtr        /* kbd */,
  667.     XkbSrvLedInfoPtr        /* sli */,
  668.     xkbExtensionDeviceNotify *    /* ed */,
  669.     XkbChangesPtr        /* changes */,
  670.     XkbEventCausePtr        /* cause */
  671. #endif
  672. );
  673.  
  674. extern void XkbUpdateAllDeviceIndicators(
  675. #if NeedFunctionPrototypes
  676.     XkbChangesPtr        /* changes */,
  677.     XkbEventCausePtr        /* cause */
  678. #endif
  679. );
  680.  
  681. extern unsigned int XkbIndicatorsToUpdate(
  682. #if NeedFunctionPrototypes
  683.     DeviceIntPtr        /* dev */,
  684.     unsigned long        /* state_changes */,
  685.     Bool            /* enabled_ctrl_changes */
  686. #endif
  687. );
  688.  
  689. extern void XkbComputeDerivedState(
  690. #if NeedFunctionPrototypes
  691.     XkbSrvInfoPtr        /* xkbi */
  692. #endif
  693. );
  694.  
  695. extern void XkbCheckSecondaryEffects(
  696. #if NeedFunctionPrototypes
  697.     XkbSrvInfoPtr        /* xkbi */,
  698.     unsigned int        /* which */,
  699.     XkbChangesPtr        /* changes */,
  700.     XkbEventCausePtr        /* cause */
  701. #endif
  702. );
  703.  
  704. extern void XkbCheckIndicatorMaps(
  705. #if NeedFunctionPrototypes
  706.     DeviceIntPtr        /* dev */,
  707.     XkbSrvLedInfoPtr        /* sli */,
  708.     unsigned int        /* which */
  709. #endif
  710. );
  711.  
  712. extern unsigned int XkbStateChangedFlags(
  713. #if NeedFunctionPrototypes
  714.     XkbStatePtr            /* old */,
  715.     XkbStatePtr            /* new */
  716. #endif
  717. );
  718.  
  719. extern    void XkbSendStateNotify(
  720. #if NeedFunctionPrototypes
  721.        DeviceIntPtr    /* kbd */,
  722.        xkbStateNotify *    /* pSN */
  723. #endif
  724. );
  725.  
  726. extern    void XkbSendMapNotify(
  727. #if NeedFunctionPrototypes
  728.        DeviceIntPtr    /* kbd */,
  729.        xkbMapNotify *    /* ev */
  730. #endif
  731. );
  732.  
  733. extern    int  XkbComputeControlsNotify(
  734. #if NeedFunctionPrototypes
  735.     DeviceIntPtr        /* kbd */,
  736.     XkbControlsPtr        /* old */,
  737.     XkbControlsPtr        /* new */,
  738.     xkbControlsNotify *    /* pCN */,
  739.         Bool            /* forceCtrlProc */
  740. #endif
  741. );
  742.  
  743. extern    void XkbSendControlsNotify(
  744. #if NeedFunctionPrototypes
  745.        DeviceIntPtr        /* kbd */,
  746.        xkbControlsNotify *    /* ev */
  747. #endif
  748. );
  749.  
  750. extern    void XkbSendCompatMapNotify(
  751. #if NeedFunctionPrototypes
  752.     DeviceIntPtr        /* kbd */,
  753.     xkbCompatMapNotify *    /* ev */
  754. #endif
  755. );
  756.  
  757. extern    void XkbSendIndicatorNotify(
  758. #if NeedFunctionPrototypes
  759.        DeviceIntPtr        /* kbd */,
  760.        int            /* xkbType */,
  761.        xkbIndicatorNotify *    /* ev */
  762. #endif
  763. );
  764.  
  765. extern    void XkbHandleBell(
  766. #if NeedFunctionPrototypes
  767.        BOOL        /* force */,
  768.        BOOL        /* eventOnly */,
  769.        DeviceIntPtr    /* kbd */,
  770.        CARD8        /* percent */,
  771.        pointer         /* ctrl */,
  772.        CARD8        /* class */,
  773.        Atom        /* name */,
  774.        WindowPtr    /* pWin */,
  775.        ClientPtr    /* pClient */
  776. #endif
  777. );
  778.  
  779. extern    void XkbSendAccessXNotify(
  780. #if NeedFunctionPrototypes
  781.        DeviceIntPtr        /* kbd */,
  782.        xkbAccessXNotify *    /* pEv */
  783. #endif
  784. );
  785.  
  786. extern    void XkbSendNamesNotify(
  787. #if NeedFunctionPrototypes
  788.        DeviceIntPtr    /* kbd */,
  789.        xkbNamesNotify *    /* ev */
  790. #endif
  791. );
  792.  
  793. extern    void XkbSendCompatNotify(
  794. #if NeedFunctionPrototypes
  795.        DeviceIntPtr        /* kbd */,
  796.        xkbCompatMapNotify *    /* ev */
  797. #endif
  798. );
  799.  
  800. extern    void XkbSendActionMessage(
  801. #if NeedFunctionPrototypes
  802.        DeviceIntPtr        /* kbd */,
  803.        xkbActionMessage *    /* ev */
  804. #endif
  805. );
  806.  
  807. extern    void XkbSendExtensionDeviceNotify(
  808. #if NeedFunctionPrototypes
  809.        DeviceIntPtr            /* kbd */,
  810.        ClientPtr            /* client */,
  811.        xkbExtensionDeviceNotify *    /* ev */
  812. #endif
  813. );
  814.  
  815. extern void XkbSendNotification(
  816. #if NeedFunctionPrototypes
  817.     DeviceIntPtr        /* kbd */,
  818.     XkbChangesPtr        /* pChanges */,
  819.     XkbEventCausePtr        /* cause */
  820. #endif
  821. );
  822.  
  823. extern void XkbProcessKeyboardEvent(
  824. #if NeedFunctionPrototypes
  825.     struct _xEvent *         /* xE */,
  826.     DeviceIntPtr        /* keybd */,
  827.     int             /* count */
  828. #endif
  829. );
  830.  
  831. extern void XkbProcessOtherEvent(
  832. #if NeedFunctionPrototypes
  833.     struct _xEvent *         /* xE */,
  834.     DeviceIntPtr        /* keybd */,
  835.     int             /* count */
  836. #endif
  837. );
  838.  
  839. extern void XkbHandleActions(
  840. #if NeedFunctionPrototypes
  841.     DeviceIntPtr        /* dev */,
  842.     DeviceIntPtr        /* kbd */,
  843.     struct _xEvent *         /* xE */,
  844.     int             /* count */
  845. #endif
  846. );
  847.  
  848. extern Bool XkbChangeEnabledControls(
  849. #if NeedFunctionPrototypes
  850.     XkbSrvInfoPtr    /* xkbi */,
  851.     unsigned long    /* change */,
  852.     unsigned long    /* newValues */,
  853.     XkbChangesPtr    /* changes */,
  854.     XkbEventCausePtr    /* cause */
  855. #endif
  856. );
  857.  
  858. extern void AccessXInit(
  859. #if NeedFunctionPrototypes
  860.     DeviceIntPtr        /* dev */
  861. #endif
  862. );
  863.  
  864. extern Bool AccessXFilterPressEvent(
  865. #if NeedFunctionPrototypes
  866.     register struct _xEvent *    /* xE */,
  867.     register DeviceIntPtr    /* keybd */,
  868.     int                /* count */
  869. #endif
  870. );
  871.  
  872. extern Bool AccessXFilterReleaseEvent(
  873. #if NeedFunctionPrototypes
  874.     register struct _xEvent *    /* xE */,
  875.     register DeviceIntPtr    /* keybd */,
  876.     int                /* count */
  877. #endif
  878. );
  879.  
  880. extern void AccessXCancelRepeatKey(
  881. #if NeedFunctionPrototypes
  882.     XkbSrvInfoPtr    /* xkbi */,
  883.     KeyCode        /* key */
  884. #endif
  885. );
  886.  
  887. extern void AccessXComputeCurveFactor(
  888. #if NeedFunctionPrototypes
  889.     XkbSrvInfoPtr    /* xkbi */,
  890.     XkbControlsPtr    /* ctrls */
  891. #endif
  892. );
  893.  
  894. extern    XkbDeviceLedInfoPtr    XkbAddDeviceLedInfo(
  895. #if NeedFunctionPrototypes
  896.     XkbDeviceInfoPtr    /* devi */,
  897.     unsigned int        /* ledClass */,
  898.     unsigned int        /* ledId */
  899. #endif
  900. );
  901.  
  902. extern    XkbDeviceInfoPtr    XkbAllocDeviceInfo(
  903. #if NeedFunctionPrototypes
  904.     unsigned int        /* deviceSpec */,
  905.     unsigned int        /* nButtons */,
  906.     unsigned int        /* szLeds */
  907. #endif
  908. );
  909.  
  910. extern    void XkbFreeDeviceInfo(
  911. #if NeedFunctionPrototypes
  912.     XkbDeviceInfoPtr    /* devi */,
  913.     unsigned int        /* which */,
  914.     Bool            /* freeDevI */
  915. #endif
  916. );
  917.  
  918. extern Status XkbResizeDeviceButtonActions(
  919. #if NeedFunctionPrototypes
  920.         XkbDeviceInfoPtr        /* devi */,
  921.         unsigned int            /* newTotal */
  922. #endif
  923. );
  924.  
  925. extern    XkbInterestPtr XkbFindClientResource(
  926. #if NeedFunctionPrototypes
  927.        DevicePtr    /* inDev */,
  928.        ClientPtr    /* client */
  929. #endif
  930. );
  931.  
  932. extern    XkbInterestPtr XkbAddClientResource(
  933. #if NeedFunctionPrototypes
  934.        DevicePtr    /* inDev */,
  935.        ClientPtr    /* client */,
  936.        XID        /* id */
  937. #endif
  938. );
  939.  
  940. extern    int XkbRemoveClient(
  941. #if NeedFunctionPrototypes
  942.        DevicePtr    /* inDev */,
  943.        ClientPtr    /* client */
  944. #endif
  945. );
  946.  
  947. extern    int XkbRemoveResourceClient(
  948. #if NeedFunctionPrototypes
  949.        DevicePtr    /* inDev */,
  950.        XID        /* id */
  951. #endif
  952. );
  953.  
  954. extern int XkbDDXInitDevice(
  955. #if NeedFunctionPrototypes
  956.     DeviceIntPtr        /* dev */
  957. #endif
  958. );
  959.  
  960. extern    int XkbDDXAccessXBeep(
  961. #if NeedFunctionPrototypes
  962.     DeviceIntPtr        /* dev */,
  963.     unsigned int    /* what */,
  964.     unsigned int    /* which */
  965. #endif
  966. );
  967.  
  968. extern    void XkbDDXKeyClick(
  969. #if NeedFunctionPrototypes
  970.     DeviceIntPtr    /* dev */,
  971.     int            /* keycode */,
  972.     int            /* synthetic */
  973. #endif
  974. );
  975.  
  976. extern     int XkbDDXUsesSoftRepeat(
  977. #if NeedFunctionPrototypes
  978.     DeviceIntPtr    /* dev */
  979. #endif
  980. );
  981.  
  982. extern    void XkbDDXKeybdCtrlProc(
  983. #if NeedFunctionPrototypes
  984.     DeviceIntPtr    /* dev */,
  985.     KeybdCtrl *    /* ctrl */
  986. #endif
  987. );
  988.  
  989. extern void XkbDDXChangeControls(
  990. #if NeedFunctionPrototypes
  991.     DeviceIntPtr    /* dev */,
  992.     XkbControlsPtr     /* old */,
  993.     XkbControlsPtr     /* new */
  994. #endif
  995. );
  996.  
  997. extern void XkbDDXUpdateIndicators(
  998. #if NeedFunctionPrototypes
  999.     DeviceIntPtr    /* keybd */,
  1000.     CARD32        /* newState */
  1001. #endif
  1002. );
  1003.  
  1004. extern void XkbDDXUpdateDeviceIndicators(
  1005. #if NeedFunctionPrototypes
  1006.     DeviceIntPtr        /* dev */,
  1007.     XkbSrvLedInfoPtr    /* sli */,
  1008.     CARD32            /* newState */
  1009. #endif
  1010. );
  1011.  
  1012. extern void XkbDDXFakePointerButton(
  1013. #if NeedFunctionPrototypes
  1014.     int         /* event */,
  1015.     int        /* button */
  1016. #endif
  1017. );
  1018.  
  1019. extern void XkbDDXFakePointerMotion(
  1020. #if NeedFunctionPrototypes
  1021.      unsigned int    /* flags */,
  1022.     int        /* x */,
  1023.     int        /* y */
  1024. #endif
  1025. );
  1026.  
  1027. extern void XkbDDXFakeDeviceButton(
  1028. #if NeedFunctionPrototypes
  1029.     DeviceIntPtr    /* dev */,
  1030.     Bool        /* press */,
  1031.     int        /* button */
  1032. #endif
  1033. );
  1034.  
  1035. extern int XkbDDXTerminateServer(
  1036. #if NeedFunctionPrototypes
  1037.     DeviceIntPtr    /* dev */,
  1038.     KeyCode        /* key */,
  1039.     XkbAction *    /* act */
  1040. #endif
  1041. );
  1042.  
  1043. extern int XkbDDXSwitchScreen(
  1044. #if NeedFunctionPrototypes
  1045.     DeviceIntPtr    /* dev */,
  1046.     KeyCode        /* key */,
  1047.     XkbAction *    /* act */
  1048. #endif
  1049. );
  1050.  
  1051. extern void XkbDisableComputedAutoRepeats(
  1052. #if NeedFunctionPrototypes
  1053.     DeviceIntPtr     /* pXDev */,
  1054.     unsigned int    /* key */
  1055. #endif
  1056. );
  1057.  
  1058. extern void XkbSetRepeatKeys(
  1059. #if NeedFunctionPrototypes
  1060.     DeviceIntPtr     /* pXDev */,
  1061.     int        /* key */,
  1062.     int         /* onoff */
  1063. #endif
  1064. );
  1065.  
  1066. extern    int XkbLatchModifiers(
  1067. #if NeedFunctionPrototypes
  1068.     DeviceIntPtr     /* pXDev */,
  1069.     CARD8         /* mask */,
  1070.     CARD8         /* latches */
  1071. #endif
  1072. );
  1073.  
  1074. extern    int XkbLatchGroup(
  1075. #if NeedFunctionPrototypes
  1076.     DeviceIntPtr      /* pXDev */,
  1077.     int          /* group */
  1078. #endif
  1079. );
  1080.  
  1081. extern    void XkbClearAllLatchesAndLocks(
  1082. #if NeedFunctionPrototypes
  1083.     DeviceIntPtr        /* dev */,
  1084.     XkbSrvInfoPtr        /* xkbi */,
  1085.     Bool            /* genEv */,
  1086.     XkbEventCausePtr    /* cause */
  1087. #endif
  1088. );
  1089.  
  1090. extern    void    XkbInitDevice(
  1091. #if NeedFunctionPrototypes
  1092.     DeviceIntPtr     /* pXDev */
  1093. #endif
  1094. );
  1095.  
  1096. extern    Bool    XkbInitKeyboardDeviceStruct(
  1097. #if NeedFunctionPrototypes
  1098.     DeviceIntPtr         /* pXDev */,
  1099.     XkbComponentNamesPtr    /* pNames */,
  1100.     KeySymsPtr        /* pSyms */,
  1101.     CARD8             /* pMods */[],
  1102.     BellProcPtr        /* bellProc */,
  1103.     KbdCtrlProcPtr        /* ctrlProc */
  1104. #endif
  1105. );
  1106.  
  1107. extern    void    XkbInitDevice(
  1108. #if NeedFunctionPrototypes
  1109.     DeviceIntPtr         /* pXDev */
  1110. #endif
  1111. );
  1112.  
  1113. extern    int SProcXkbDispatch(
  1114. #if NeedFunctionPrototypes
  1115.     ClientPtr        /* client */
  1116. #endif
  1117. );
  1118.  
  1119. extern XkbGeometryPtr XkbLookupNamedGeometry(
  1120. #if NeedFunctionPrototypes
  1121.     DeviceIntPtr        /* dev */,
  1122.     Atom            /* name */,
  1123.     Bool *            /* shouldFree */
  1124. #endif
  1125. );
  1126.  
  1127. extern char *    _XkbDupString(
  1128. #if NeedFunctionPrototypes
  1129.     char *            /* str */
  1130. #endif
  1131. );
  1132.  
  1133. extern void    XkbConvertCase(
  1134. #if NeedFunctionPrototypes
  1135.     KeySym             /* sym */,
  1136.     KeySym *        /* lower */,
  1137.     KeySym *        /* upper */
  1138. #endif
  1139. );
  1140.  
  1141. extern    Status     XkbChangeKeycodeRange(    
  1142. #if NeedFunctionPrototypes
  1143.     XkbDescPtr        /* xkb */,
  1144.     int             /* minKC */,
  1145.     int             /* maxKC */,
  1146.     XkbChangesPtr        /* changes */
  1147. #endif
  1148. );
  1149.  
  1150. #ifdef XKBSRV_NEED_FILE_FUNCS
  1151.  
  1152. #include "extensions/XKMformat.h"
  1153. #include "extensions/XKBfile.h"
  1154.  
  1155. #define    _XkbListKeymaps        0
  1156. #define    _XkbListKeycodes    1
  1157. #define    _XkbListTypes        2
  1158. #define    _XkbListCompat        3
  1159. #define    _XkbListSymbols        4
  1160. #define    _XkbListGeometry    5
  1161. #define    _XkbListNumComponents    6
  1162.  
  1163. typedef struct _XkbSrvListInfo {
  1164.     int        szPool;
  1165.     int        nPool;
  1166.     char *        pool;
  1167.  
  1168.     int        maxRtrn;
  1169.     int        nTotal;
  1170.  
  1171.     char *        pattern[_XkbListNumComponents];
  1172.     int        nFound[_XkbListNumComponents];
  1173. } XkbSrvListInfoRec,*XkbSrvListInfoPtr;
  1174.  
  1175. extern    Status    XkbDDXList(
  1176. #if NeedFunctionPrototypes
  1177.     DeviceIntPtr        /* dev */,
  1178.     XkbSrvListInfoPtr    /* listing */,
  1179.     ClientPtr        /* client */
  1180. #endif
  1181. );
  1182.  
  1183. extern    unsigned int XkbDDXLoadKeymapByNames(
  1184. #if NeedFunctionPrototypes
  1185.     DeviceIntPtr        /* keybd */,
  1186.     XkbComponentNamesPtr    /* names */,
  1187.     unsigned int        /* want */,
  1188.     unsigned int        /* need */,
  1189.     XkbFileInfoPtr        /* finfoRtrn */,
  1190.     char *            /* keymapNameRtrn */,
  1191.     int             /* keymapNameRtrnLen */
  1192. #endif
  1193. );
  1194.  
  1195. extern    FILE *XkbDDXOpenConfigFile(
  1196. #if NeedFunctionPrototypes
  1197.     char *    /* mapName */,
  1198.     char *    /* fileNameRtrn */,
  1199.     int    /* fileNameRtrnLen */
  1200. #endif
  1201. );
  1202.  
  1203. extern    Bool XkbDDXApplyConfig(
  1204. #if NeedFunctionPrototypes
  1205.     XPointer    /* cfg_in */,
  1206.     XkbSrvInfoPtr    /* xkbi */
  1207. #endif
  1208. );
  1209.  
  1210. extern XPointer XkbDDXPreloadConfig(
  1211. #if NeedFunctionPrototypes
  1212.     XkbComponentNamesPtr    /* names */,
  1213.     DeviceIntPtr        /* dev */
  1214. #endif
  1215. );
  1216.  
  1217. extern    int XkbDDXUsesSoftRepeat(
  1218. #if NeedFunctionPrototypes
  1219.     DeviceIntPtr     /* pXDev */
  1220. #endif
  1221. );
  1222.  
  1223. extern    void XkbDDXFakePointerMotion(
  1224. #if NeedFunctionPrototypes
  1225.     unsigned int        /* flags */,
  1226.     int            /* x */,
  1227.     int            /* y */
  1228. #endif
  1229. );
  1230.  
  1231. extern    int _XkbStrCaseCmp(
  1232. #if NeedFunctionPrototypes
  1233.     char *            /* str1 */,
  1234.     char *            /* str2 */
  1235. #endif
  1236. );
  1237.  
  1238. #endif /* XKBSRV_NEED_FILE_FUNCS */
  1239.  
  1240.  
  1241. _XFUNCPROTOEND
  1242.  
  1243. #define    XkbAtomGetString(d,s)    NameForAtom(s)
  1244.  
  1245. #endif /* _XKBSRV_H_ */
  1246.  
  1247.  
  1248.