XKBsrv.h
上传用户:lctgjx
上传日期:2022-06-04
资源大小:8887k
文件大小:28k
源码类别:

流媒体/Mpeg4/MP4

开发平台:

Visual C++

  1. /* $Xorg: XKBsrv.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ */
  2. /* $XdotOrg: $ */
  3. /************************************************************
  4. Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
  5. Permission to use, copy, modify, and distribute this
  6. software and its documentation for any purpose and without
  7. fee is hereby granted, provided that the above copyright
  8. notice appear in all copies and that both that copyright
  9. notice and this permission notice appear in supporting
  10. documentation, and that the name of Silicon Graphics not be 
  11. used in advertising or publicity pertaining to distribution 
  12. of the software without specific prior written permission.
  13. Silicon Graphics makes no representation about the suitability 
  14. of this software for any purpose. It is provided "as is"
  15. without any express or implied warranty.
  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.
  24. ********************************************************/
  25. /* $XFree86: xc/include/extensions/XKBsrv.h,v 3.22 2002/11/20 04:49:01 dawes Exp $ */
  26. #ifndef _XKBSRV_H_
  27. #define _XKBSRV_H_
  28. #ifdef XKB_IN_SERVER
  29. #define XkbAllocClientMap SrvXkbAllocClientMap
  30. #define XkbAllocServerMap SrvXkbAllocServerMap
  31. #define XkbChangeTypesOfKey SrvXkbChangeTypesOfKey
  32. #define XkbAddKeyType SrvXkbAddKeyType
  33. #define XkbCopyKeyType SrvXkbCopyKeyType
  34. #define XkbCopyKeyTypes SrvXkbCopyKeyTypes
  35. #define XkbFreeClientMap SrvXkbFreeClientMap
  36. #define XkbFreeServerMap SrvXkbFreeServerMap
  37. #define XkbInitCanonicalKeyTypes SrvXkbInitCanonicalKeyTypes
  38. #define XkbKeyTypesForCoreSymbols SrvXkbKeyTypesForCoreSymbols
  39. #define XkbApplyCompatMapToKey SrvXkbApplyCompatMapToKey
  40. #define XkbUpdateMapFromCore SrvXkbUpdateMapFromCore
  41. #define XkbResizeKeyActions SrvXkbResizeKeyActions
  42. #define XkbResizeKeySyms SrvXkbResizeKeySyms
  43. #define XkbResizeKeyType SrvXkbResizeKeyType
  44. #define XkbAllocCompatMap SrvXkbAllocCompatMap
  45. #define XkbAllocControls SrvXkbAllocControls
  46. #define XkbAllocIndicatorMaps SrvXkbAllocIndicatorMaps
  47. #define XkbAllocKeyboard SrvXkbAllocKeyboard
  48. #define XkbAllocNames SrvXkbAllocNames
  49. #define XkbFreeCompatMap SrvXkbFreeCompatMap
  50. #define XkbFreeControls SrvXkbFreeControls
  51. #define XkbFreeIndicatorMaps SrvXkbFreeIndicatorMaps
  52. #define XkbFreeKeyboard SrvXkbFreeKeyboard
  53. #define XkbFreeNames SrvXkbFreeNames
  54. #define XkbAddDeviceLedInfo SrvXkbAddDeviceLedInfo
  55. #define XkbAllocDeviceInfo SrvXkbAllocDeviceInfo
  56. #define XkbFreeDeviceInfo SrvXkbFreeDeviceInfo
  57. #define XkbResizeDeviceButtonActions SrvXkbResizeDeviceButtonActions
  58. #define XkbLatchModifiers SrvXkbLatchModifiers
  59. #define XkbLatchGroup SrvXkbLatchGroup
  60. #define XkbVirtualModsToReal SrvXkbVirtualModsToReal
  61. #define XkbChangeKeycodeRange SrvXkbChangeKeycodeRange
  62. #define XkbApplyVirtualModChanges SrvXkbApplyVirtualModChanges
  63. #define XkbUpdateActionVirtualMods SrvXkbUpdateActionVirtualMods
  64. #define XkbUpdateKeyTypeVirtualMods SrvXkbUpdateKeyTypeVirtualMods
  65. #endif
  66. #include <X11/extensions/XKBstr.h>
  67. #include <X11/extensions/XKBproto.h>
  68. #include "inputstr.h"
  69. typedef struct _XkbInterest {
  70. DeviceIntPtr dev;
  71. ClientPtr client;
  72. XID resource;
  73. struct _XkbInterest * next;
  74. CARD16 extDevNotifyMask;
  75. CARD16 stateNotifyMask;
  76. CARD16 namesNotifyMask;
  77. CARD32  ctrlsNotifyMask;
  78. CARD8 compatNotifyMask;
  79. BOOL bellNotifyMask;
  80. BOOL actionMessageMask;
  81. CARD16 accessXNotifyMask;
  82. CARD32 iStateNotifyMask;
  83. CARD32 iMapNotifyMask;
  84. CARD16 altSymsNotifyMask;
  85. CARD32 autoCtrls;
  86. CARD32 autoCtrlValues;
  87. } XkbInterestRec,*XkbInterestPtr;
  88. typedef struct _XkbRadioGroup {
  89. CARD8 flags;
  90. CARD8 nMembers;
  91. CARD8 dfltDown;
  92. CARD8 currentDown;
  93. CARD8 members[XkbRGMaxMembers];
  94. } XkbRadioGroupRec, *XkbRadioGroupPtr;
  95. typedef struct _XkbEventCause {
  96. CARD8 kc;
  97. CARD8 event;
  98. CARD8 mjr;
  99. CARD8 mnr;
  100. ClientPtr client;
  101. } XkbEventCauseRec,*XkbEventCausePtr;
  102. #define XkbSetCauseKey(c,k,e) { (c)->kc= (k),(c)->event= (e),
  103.   (c)->mjr= (c)->mnr= 0; 
  104.   (c)->client= NULL; }
  105. #define XkbSetCauseReq(c,j,n,cl) { (c)->kc= (c)->event= 0,
  106.   (c)->mjr= (j),(c)->mnr= (n);
  107.   (c)->client= (cl); }
  108. #define XkbSetCauseCoreReq(c,e,cl) XkbSetCauseReq(c,e,0,cl)
  109. #define XkbSetCauseXkbReq(c,e,cl)  XkbSetCauseReq(c,XkbReqCode,e,cl)
  110. #define XkbSetCauseUnknown(c)    XkbSetCauseKey(c,0,0)
  111. #define _OFF_TIMER 0
  112. #define _KRG_WARN_TIMER 1
  113. #define _KRG_TIMER 2
  114. #define _SK_TIMEOUT_TIMER 3
  115. #define _ALL_TIMEOUT_TIMER 4
  116. #define _BEEP_NONE 0
  117. #define _BEEP_FEATURE_ON 1
  118. #define _BEEP_FEATURE_OFF 2
  119. #define _BEEP_FEATURE_CHANGE 3
  120. #define _BEEP_SLOW_WARN 4
  121. #define _BEEP_SLOW_PRESS 5
  122. #define _BEEP_SLOW_ACCEPT 6
  123. #define _BEEP_SLOW_REJECT 7
  124. #define _BEEP_SLOW_RELEASE 8
  125. #define _BEEP_STICKY_LATCH 9
  126. #define _BEEP_STICKY_LOCK 10
  127. #define _BEEP_STICKY_UNLOCK 11
  128. #define _BEEP_LED_ON 12
  129. #define _BEEP_LED_OFF 13
  130. #define _BEEP_LED_CHANGE 14
  131. #define _BEEP_BOUNCE_REJECT 15
  132. typedef struct _XkbSrvInfo {
  133. XkbStateRec  prev_state;
  134. XkbStateRec  state;
  135. XkbDescPtr  desc;
  136. DeviceIntPtr  device;
  137. KbdCtrlProcPtr  kbdProc;
  138. XkbRadioGroupPtr radioGroups;
  139. CARD8  nRadioGroups;
  140. CARD8  clearMods;
  141. CARD8  setMods;
  142. INT16  groupChange;
  143. CARD16  dfltPtrDelta;
  144. double  mouseKeysCurve;
  145. double  mouseKeysCurveFactor;
  146. INT16  mouseKeysDX;
  147. INT16  mouseKeysDY;
  148. CARD8  mouseKeysFlags;
  149. Bool  mouseKeysAccel;
  150. CARD8  mouseKeysCounter;
  151. CARD8  lockedPtrButtons;
  152. CARD8  shiftKeyCount;
  153. KeyCode  mouseKey;
  154. KeyCode  inactiveKey;
  155. KeyCode  slowKey;
  156. KeyCode  repeatKey;
  157. CARD8  krgTimerActive;
  158. CARD8  beepType;
  159. CARD8  beepCount;
  160. CARD32  flags;
  161. CARD32  lastPtrEventTime;
  162. CARD32  lastShiftEventTime;
  163. OsTimerPtr  beepTimer;
  164. OsTimerPtr  mouseKeyTimer;
  165. OsTimerPtr  slowKeysTimer;
  166. OsTimerPtr  bounceKeysTimer;
  167. OsTimerPtr  repeatKeyTimer;
  168. OsTimerPtr  krgTimer;
  169. } XkbSrvInfoRec, *XkbSrvInfoPtr;
  170. #define XkbSLI_IsDefault (1L<<0)
  171. #define XkbSLI_HasOwnState (1L<<1)
  172. typedef struct _XkbSrvLedInfo {
  173. CARD16 flags;
  174. CARD16 class;
  175. CARD16 id;
  176. union {
  177.     KbdFeedbackPtr kf;
  178.     LedFeedbackPtr lf;
  179. }  fb;
  180. CARD32 physIndicators;
  181. CARD32 autoState;
  182. CARD32 explicitState;
  183. CARD32 effectiveState;
  184. CARD32 mapsPresent;
  185. CARD32 namesPresent;
  186. XkbIndicatorMapPtr maps;
  187. Atom * names;
  188. CARD32 usesBase;
  189. CARD32 usesLatched;
  190. CARD32 usesLocked;
  191. CARD32 usesEffective;
  192. CARD32 usesCompat;
  193. CARD32 usesControls;
  194. CARD32 usedComponents;
  195. } XkbSrvLedInfoRec, *XkbSrvLedInfoPtr;
  196. /*
  197.  * Settings for xkbClientFlags field (used by DIX)
  198.  * These flags _must_ not overlap with XkbPCF_*
  199.  */
  200. #define _XkbClientInitialized (1<<15)
  201. #define _XkbWantsDetectableAutoRepeat(c)
  202. ((c)->xkbClientFlags&XkbPCF_DetectableAutoRepeatMask)
  203. /*
  204.  * Settings for flags field
  205.  */
  206. #define _XkbStateNotifyInProgress (1<<0)
  207. typedef struct
  208. {
  209.     ProcessInputProc processInputProc;
  210.     ProcessInputProc realInputProc;
  211.     DeviceUnwrapProc unwrapProc;
  212. } xkbDeviceInfoRec, *xkbDeviceInfoPtr;
  213. #define WRAP_PROCESS_INPUT_PROC(device, oldprocs, proc, unwrapproc) 
  214. device->public.processInputProc = proc; 
  215. oldprocs->processInputProc = 
  216. oldprocs->realInputProc = device->public.realInputProc; 
  217. device->public.realInputProc = proc; 
  218. oldprocs->unwrapProc = device->unwrapProc; 
  219. device->unwrapProc = unwrapproc;
  220. #define COND_WRAP_PROCESS_INPUT_PROC(device, oldprocs, proc, unwrapproc) 
  221. if (device->public.processInputProc == device->public.realInputProc)
  222.     device->public.processInputProc = proc; 
  223. oldprocs->processInputProc = 
  224. oldprocs->realInputProc = device->public.realInputProc; 
  225. device->public.realInputProc = proc; 
  226. oldprocs->unwrapProc = device->unwrapProc; 
  227. device->unwrapProc = unwrapproc;
  228. #define UNWRAP_PROCESS_INPUT_PROC(device, oldprocs) 
  229. device->public.processInputProc = oldprocs->processInputProc; 
  230. device->public.realInputProc = oldprocs->realInputProc; 
  231. device->unwrapProc = oldprocs->unwrapProc;
  232. #define XKBDEVICEINFO(dev) ((xkbDeviceInfoPtr) (dev)->devPrivates[xkbDevicePrivateIndex].ptr)
  233. /***====================================================================***/
  234. /***====================================================================***/
  235. #define XkbAX_KRGMask  (XkbSlowKeysMask|XkbBounceKeysMask)
  236. #define XkbAllFilteredEventsMask 
  237. (XkbAccessXKeysMask|XkbRepeatKeysMask|XkbMouseKeysAccelMask|XkbAX_KRGMask)
  238. /***====================================================================***/
  239. extern int XkbReqCode;
  240. extern int XkbEventBase;
  241. extern int XkbKeyboardErrorCode;
  242. extern int XkbDisableLockActions;
  243. extern char * XkbBaseDirectory;
  244. extern char * XkbBinDirectory;
  245. extern char * XkbInitialMap;
  246. extern int _XkbClientMajor;
  247. extern int _XkbClientMinor;
  248. extern unsigned int XkbXIUnsupported;
  249. extern char * XkbModelUsed,*XkbLayoutUsed,*XkbVariantUsed,*XkbOptionsUsed;
  250. extern Bool noXkbExtension;
  251. extern Bool XkbWantRulesProp;
  252. extern pointer XkbLastRepeatEvent;
  253. extern CARD32 xkbDebugFlags;
  254. extern CARD32 xkbDebugCtrls;
  255. #define _XkbAlloc(s) xalloc((s))
  256. #define _XkbCalloc(n,s) Xcalloc((n)*(s))
  257. #define _XkbRealloc(o,s) Xrealloc((o),(s))
  258. #define _XkbTypedAlloc(t) ((t *)xalloc(sizeof(t)))
  259. #define _XkbTypedCalloc(n,t) ((t *)Xcalloc((n)*sizeof(t)))
  260. #define _XkbTypedRealloc(o,n,t) 
  261. ((o)?(t *)Xrealloc((o),(n)*sizeof(t)):_XkbTypedCalloc(n,t))
  262. #define _XkbClearElems(a,f,l,t) bzero(&(a)[f],((l)-(f)+1)*sizeof(t))
  263. #define _XkbFree(p) Xfree(p)
  264. #define _XkbLibError(c,l,d) 
  265. { _XkbErrCode= (c); _XkbErrLocation= (l); _XkbErrData= (d); }
  266. #define _XkbErrCode2(a,b) ((XID)((((unsigned int)(a))<<24)|((b)&0xffffff)))
  267. #define _XkbErrCode3(a,b,c) _XkbErrCode2(a,(((unsigned int)(b))<<16)|(c))
  268. #define _XkbErrCode4(a,b,c,d) _XkbErrCode3(a,b,((((unsigned int)(c))<<8)|(d)))
  269. extern int DeviceKeyPress,DeviceKeyRelease;
  270. extern int DeviceButtonPress,DeviceButtonRelease;
  271. #ifdef XINPUT
  272. #define _XkbIsPressEvent(t) (((t)==KeyPress)||((t)==DeviceKeyPress))
  273. #define _XkbIsReleaseEvent(t) (((t)==KeyRelease)||((t)==DeviceKeyRelease))
  274. #else
  275. #define _XkbIsPressEvent(t) ((t)==KeyPress)
  276. #define _XkbIsReleaseEvent(t) ((t)==KeyRelease)
  277. #endif
  278. #define _XkbCoreKeycodeInRange(c,k) (((k)>=(c)->curKeySyms.minKeyCode)&&
  279.  ((k)<=(c)->curKeySyms.maxKeyCode))
  280. #define _XkbCoreNumKeys(c) ((c)->curKeySyms.maxKeyCode-
  281.  (c)->curKeySyms.minKeyCode+1)
  282. #define XConvertCase(s,l,u) XkbConvertCase(s,l,u)
  283. #undef IsKeypadKey
  284. #define IsKeypadKey(s) XkbKSIsKeypad(s)
  285. #define Status int
  286. #define XPointer pointer
  287. #define Display struct _XDisplay
  288. #ifndef True
  289. #define True 1
  290. #define False 0
  291. #endif
  292. #ifndef PATH_MAX
  293. #ifdef MAXPATHLEN
  294. #define PATH_MAX MAXPATHLEN
  295. #else
  296. #define PATH_MAX 1024
  297. #endif
  298. #endif
  299. _XFUNCPROTOBEGIN
  300. extern void XkbUseMsg(
  301.     void
  302. );
  303. extern int XkbProcessArguments(
  304.     int /* argc */,
  305.     char ** /* argv */,
  306.     int /* i */
  307. );
  308. extern void XkbSetExtension(DeviceIntPtr device, ProcessInputProc proc);
  309. extern void XkbFreeCompatMap(
  310.     XkbDescPtr /* xkb */,
  311.     unsigned int /* which */,
  312.     Bool /* freeMap */
  313. );
  314. extern void XkbFreeNames(
  315. XkbDescPtr /* xkb */,
  316. unsigned int /* which */,
  317. Bool /* freeMap */
  318. );
  319. extern DeviceIntPtr _XkbLookupAnyDevice(
  320.     int /* id */,
  321.     int * /* why_rtrn */
  322. );
  323. extern DeviceIntPtr _XkbLookupKeyboard(
  324.     int /* id */,
  325.     int * /* why_rtrn */
  326. );
  327. extern DeviceIntPtr _XkbLookupBellDevice(
  328.     int /* id */,
  329.     int * /* why_rtrn */
  330. );
  331. extern DeviceIntPtr _XkbLookupLedDevice(
  332.     int /* id */,
  333.     int * /* why_rtrn */
  334. );
  335. extern DeviceIntPtr _XkbLookupButtonDevice(
  336.     int /* id */,
  337.     int * /* why_rtrn */
  338. );
  339. extern XkbDescPtr XkbAllocKeyboard(
  340. void
  341. );
  342. extern Status XkbAllocClientMap(
  343. XkbDescPtr /* xkb */,
  344. unsigned int /* which */,
  345. unsigned int /* nTypes */
  346. );
  347. extern Status XkbAllocServerMap(
  348. XkbDescPtr /* xkb */,
  349. unsigned int /* which */,
  350. unsigned int /* nNewActions */
  351. );
  352. extern void XkbFreeClientMap(
  353.     XkbDescPtr /* xkb */,
  354.     unsigned int /* what */,
  355.     Bool /* freeMap */
  356. );
  357. extern void XkbFreeServerMap(
  358.     XkbDescPtr /* xkb */,
  359.     unsigned int /* what */,
  360.     Bool /* freeMap */
  361. );
  362. extern Status XkbAllocIndicatorMaps(
  363. XkbDescPtr /* xkb */
  364. );
  365. extern Status XkbAllocCompatMap(
  366.     XkbDescPtr /* xkb */,
  367.     unsigned int /* which */,
  368.     unsigned int /* nInterpret */
  369. );
  370. extern Status XkbAllocNames(
  371. XkbDescPtr /* xkb */,
  372. unsigned int /* which */,
  373. int /* nTotalRG */,
  374. int /* nTotalAliases */
  375. );
  376. extern Status XkbAllocControls(
  377. XkbDescPtr /* xkb */,
  378. unsigned int /* which*/
  379. );
  380. extern Status XkbCopyKeyType(
  381.     XkbKeyTypePtr /* from */,
  382.     XkbKeyTypePtr /* into */
  383. );
  384. extern Status XkbCopyKeyTypes(
  385.     XkbKeyTypePtr /* from */,
  386.     XkbKeyTypePtr /* into */,
  387.     int /* num_types */
  388. );
  389. extern Status XkbResizeKeyType(
  390.     XkbDescPtr /* xkb */,
  391.     int /* type_ndx */,
  392.     int /* map_count */,
  393.     Bool /* want_preserve */,
  394.     int /* new_num_lvls */
  395. );
  396. extern void XkbFreeKeyboard(
  397. XkbDescPtr /* xkb */,
  398. unsigned int /* which */,
  399. Bool /* freeDesc */
  400. );
  401. extern  void XkbSetActionKeyMods(
  402. XkbDescPtr /* xkb */,
  403. XkbAction * /* act */,
  404. unsigned int  /* mods */
  405. );
  406. extern Bool XkbCheckActionVMods(
  407. XkbDescPtr /* xkb */,
  408. XkbAction * /* act */,
  409. unsigned int  /* changed */
  410. );
  411. extern Bool XkbApplyVModChanges(
  412.     XkbSrvInfoPtr /* xkbi */,
  413.     unsigned int /* changed */,
  414.     XkbChangesPtr /* pChanges */,
  415.     unsigned int * /* needChecksRtrn */,
  416.     XkbEventCausePtr /* cause */
  417. );
  418. extern void XkbApplyVModChangesToAllDevices(
  419.     DeviceIntPtr /* dev */,
  420.     XkbDescPtr  /* xkb */,
  421.     unsigned int  /* changed */,
  422.     XkbEventCausePtr /* cause */
  423. );
  424. extern unsigned int XkbMaskForVMask(
  425.     XkbDescPtr /* xkb */,
  426.     unsigned int /* vmask */
  427. );
  428. extern Bool XkbVirtualModsToReal(
  429. XkbDescPtr /* xkb */,
  430. unsigned int /* virtua_mask */,
  431. unsigned int * /* mask_rtrn */
  432. );
  433. extern unsigned int XkbAdjustGroup(
  434.     int /* group */,
  435.     XkbControlsPtr /* ctrls */
  436. );
  437. extern KeySym *XkbResizeKeySyms(
  438.     XkbDescPtr /* xkb */,
  439.     int  /* key */,
  440.     int  /* needed */
  441. );
  442. extern XkbAction *XkbResizeKeyActions(
  443.     XkbDescPtr /* xkb */,
  444.     int  /* key */,
  445.     int  /* needed */
  446. );
  447. extern void XkbUpdateKeyTypesFromCore(
  448.     DeviceIntPtr /* pXDev */,
  449.     KeyCode  /* first */,
  450.     CARD8  /* num */,
  451.     XkbChangesPtr /* pChanges */
  452. );
  453. extern void XkbUpdateDescActions(
  454.     XkbDescPtr /* xkb */,
  455.     KeyCode /* first */,
  456.     CARD8 /* num */,
  457.     XkbChangesPtr /* changes */
  458. );
  459. extern void XkbUpdateActions(
  460.     DeviceIntPtr /* pXDev */,
  461.     KeyCode  /* first */,
  462.     CARD8  /* num */,
  463.     XkbChangesPtr   /* pChanges */,
  464.     unsigned int * /* needChecksRtrn */,
  465.     XkbEventCausePtr /* cause */
  466. );
  467. extern void XkbUpdateCoreDescription(
  468.     DeviceIntPtr /* keybd */,
  469.     Bool /* resize */
  470. );
  471. extern void XkbApplyMappingChange(
  472.     DeviceIntPtr /* pXDev */,
  473.     CARD8  /* request */,
  474.     KeyCode  /* firstKey */,
  475.     CARD8  /* num */,
  476.     ClientPtr /* client */
  477. );
  478. extern void XkbSetIndicators(
  479.     DeviceIntPtr /* pXDev */,
  480.     CARD32 /* affect */,
  481.     CARD32 /* values */,
  482.     XkbEventCausePtr /* cause */
  483. );
  484. extern void XkbUpdateIndicators(
  485.     DeviceIntPtr /* keybd */,
  486.     CARD32   /* changed */,
  487.     Bool /* check_edevs */,
  488.     XkbChangesPtr /* pChanges */,
  489.     XkbEventCausePtr /* cause */
  490. );
  491. extern XkbSrvLedInfoPtr XkbAllocSrvLedInfo(
  492.     DeviceIntPtr /* dev */,
  493.     KbdFeedbackPtr /* kf */,
  494.     LedFeedbackPtr /* lf */,
  495.     unsigned int /* needed_parts */
  496. );
  497. extern XkbSrvLedInfoPtr XkbFindSrvLedInfo(
  498.     DeviceIntPtr /* dev */,
  499.     unsigned int /* class */,
  500.     unsigned int /* id */,
  501.     unsigned int /* needed_parts */
  502. );
  503. extern void XkbApplyLedNameChanges(
  504.     DeviceIntPtr /* dev */,
  505.     XkbSrvLedInfoPtr /* sli */,
  506.     unsigned int /* changed_names */,
  507.     xkbExtensionDeviceNotify * /* ed */,
  508.     XkbChangesPtr /* changes */,
  509.     XkbEventCausePtr /* cause */
  510. );
  511. extern void XkbApplyLedMapChanges(
  512.     DeviceIntPtr /* dev */,
  513.     XkbSrvLedInfoPtr /* sli */,
  514.     unsigned int /* changed_maps */,
  515.     xkbExtensionDeviceNotify * /* ed */,
  516.     XkbChangesPtr /* changes */,
  517.     XkbEventCausePtr /* cause */
  518. );
  519. extern void XkbApplyLedStateChanges(
  520.     DeviceIntPtr /* dev */,
  521.     XkbSrvLedInfoPtr /* sli */,
  522.     unsigned int /* changed_leds */,
  523.     xkbExtensionDeviceNotify * /* ed */,
  524.     XkbChangesPtr /* changes */,
  525.     XkbEventCausePtr /* cause */
  526. );
  527. extern void XkbUpdateLedAutoState(
  528.     DeviceIntPtr /* dev */,
  529.     XkbSrvLedInfoPtr /* sli */,
  530.     unsigned int /* maps_to_check */,
  531.     xkbExtensionDeviceNotify * /* ed */,
  532.     XkbChangesPtr /* changes */,
  533.     XkbEventCausePtr /* cause */
  534. );
  535. extern void XkbFlushLedEvents(
  536.     DeviceIntPtr /* dev */,
  537.     DeviceIntPtr /* kbd */,
  538.     XkbSrvLedInfoPtr /* sli */,
  539.     xkbExtensionDeviceNotify * /* ed */,
  540.     XkbChangesPtr /* changes */,
  541.     XkbEventCausePtr /* cause */
  542. );
  543. extern void XkbUpdateAllDeviceIndicators(
  544.     XkbChangesPtr /* changes */,
  545.     XkbEventCausePtr /* cause */
  546. );
  547. extern unsigned int XkbIndicatorsToUpdate(
  548.     DeviceIntPtr /* dev */,
  549.     unsigned long /* state_changes */,
  550.     Bool /* enabled_ctrl_changes */
  551. );
  552. extern void XkbComputeDerivedState(
  553.     XkbSrvInfoPtr /* xkbi */
  554. );
  555. extern void XkbCheckSecondaryEffects(
  556.     XkbSrvInfoPtr /* xkbi */,
  557.     unsigned int /* which */,
  558.     XkbChangesPtr /* changes */,
  559.     XkbEventCausePtr /* cause */
  560. );
  561. extern void XkbCheckIndicatorMaps(
  562.     DeviceIntPtr /* dev */,
  563.     XkbSrvLedInfoPtr /* sli */,
  564.     unsigned int /* which */
  565. );
  566. extern unsigned int XkbStateChangedFlags(
  567.     XkbStatePtr /* old */,
  568.     XkbStatePtr /* new */
  569. );
  570. extern void XkbSendStateNotify(
  571.        DeviceIntPtr /* kbd */,
  572.        xkbStateNotify * /* pSN */
  573. );
  574. extern void XkbSendMapNotify(
  575.        DeviceIntPtr /* kbd */,
  576.        xkbMapNotify * /* ev */
  577. );
  578. extern int  XkbComputeControlsNotify(
  579. DeviceIntPtr /* kbd */,
  580. XkbControlsPtr /* old */,
  581. XkbControlsPtr /* new */,
  582. xkbControlsNotify * /* pCN */,
  583. Bool /* forceCtrlProc */
  584. );
  585. extern void XkbSendControlsNotify(
  586.        DeviceIntPtr /* kbd */,
  587.        xkbControlsNotify * /* ev */
  588. );
  589. extern void XkbSendCompatMapNotify(
  590. DeviceIntPtr /* kbd */,
  591. xkbCompatMapNotify * /* ev */
  592. );
  593. extern void XkbSendIndicatorNotify(
  594.        DeviceIntPtr /* kbd */,
  595.        int /* xkbType */,
  596.        xkbIndicatorNotify * /* ev */
  597. );
  598. extern void XkbHandleBell(
  599.        BOOL /* force */,
  600.        BOOL /* eventOnly */,
  601.        DeviceIntPtr /* kbd */,
  602.        CARD8 /* percent */,
  603.        pointer  /* ctrl */,
  604.        CARD8 /* class */,
  605.        Atom /* name */,
  606.        WindowPtr /* pWin */,
  607.        ClientPtr /* pClient */
  608. );
  609. extern void XkbSendAccessXNotify(
  610.        DeviceIntPtr /* kbd */,
  611.        xkbAccessXNotify * /* pEv */
  612. );
  613. extern void XkbSendNamesNotify(
  614.        DeviceIntPtr /* kbd */,
  615.        xkbNamesNotify * /* ev */
  616. );
  617. extern void XkbSendCompatNotify(
  618.        DeviceIntPtr /* kbd */,
  619.        xkbCompatMapNotify * /* ev */
  620. );
  621. extern void XkbSendActionMessage(
  622.        DeviceIntPtr /* kbd */,
  623.        xkbActionMessage * /* ev */
  624. );
  625. extern void XkbSendExtensionDeviceNotify(
  626.        DeviceIntPtr /* kbd */,
  627.        ClientPtr /* client */,
  628.        xkbExtensionDeviceNotify * /* ev */
  629. );
  630. extern void XkbSendNotification(
  631.     DeviceIntPtr /* kbd */,
  632.     XkbChangesPtr /* pChanges */,
  633.     XkbEventCausePtr /* cause */
  634. );
  635. extern void XkbProcessKeyboardEvent(
  636.     struct _xEvent *  /* xE */,
  637.     DeviceIntPtr /* keybd */,
  638.     int  /* count */
  639. );
  640. extern void XkbProcessOtherEvent(
  641.     struct _xEvent *  /* xE */,
  642.     DeviceIntPtr /* keybd */,
  643.     int  /* count */
  644. );
  645. extern void XkbHandleActions(
  646.     DeviceIntPtr /* dev */,
  647.     DeviceIntPtr /* kbd */,
  648.     struct _xEvent *  /* xE */,
  649.     int  /* count */
  650. );
  651. extern Bool XkbEnableDisableControls(
  652.     XkbSrvInfoPtr /* xkbi */,
  653.     unsigned long /* change */,
  654.     unsigned long /* newValues */,
  655.     XkbChangesPtr /* changes */,
  656.     XkbEventCausePtr /* cause */
  657. );
  658. extern void AccessXInit(
  659.     DeviceIntPtr        /* dev */
  660. );
  661. extern Bool AccessXFilterPressEvent(
  662.     register struct _xEvent * /* xE */,
  663.     register DeviceIntPtr /* keybd */,
  664.     int /* count */
  665. );
  666. extern Bool AccessXFilterReleaseEvent(
  667.     register struct _xEvent * /* xE */,
  668.     register DeviceIntPtr /* keybd */,
  669.     int /* count */
  670. );
  671. extern void AccessXCancelRepeatKey(
  672.     XkbSrvInfoPtr /* xkbi */,
  673.     KeyCode /* key */
  674. );
  675. extern void AccessXComputeCurveFactor(
  676.     XkbSrvInfoPtr /* xkbi */,
  677.     XkbControlsPtr /* ctrls */
  678. );
  679. extern XkbDeviceLedInfoPtr XkbAddDeviceLedInfo(
  680. XkbDeviceInfoPtr /* devi */,
  681. unsigned int /* ledClass */,
  682. unsigned int /* ledId */
  683. );
  684. extern XkbDeviceInfoPtr XkbAllocDeviceInfo(
  685. unsigned int /* deviceSpec */,
  686. unsigned int /* nButtons */,
  687. unsigned int /* szLeds */
  688. );
  689. extern void XkbFreeDeviceInfo(
  690. XkbDeviceInfoPtr /* devi */,
  691. unsigned int /* which */,
  692. Bool /* freeDevI */
  693. );
  694. extern Status XkbResizeDeviceButtonActions(
  695. XkbDeviceInfoPtr        /* devi */,
  696. unsigned int            /* newTotal */
  697. );
  698. extern XkbInterestPtr XkbFindClientResource(
  699.        DevicePtr /* inDev */,
  700.        ClientPtr /* client */
  701. );
  702. extern XkbInterestPtr XkbAddClientResource(
  703.        DevicePtr /* inDev */,
  704.        ClientPtr /* client */,
  705.        XID /* id */
  706. );
  707. extern int XkbRemoveClient(
  708.        DevicePtr /* inDev */,
  709.        ClientPtr /* client */
  710. );
  711. extern int XkbRemoveResourceClient(
  712.        DevicePtr /* inDev */,
  713.        XID /* id */
  714. );
  715. extern int XkbDDXInitDevice(
  716.     DeviceIntPtr        /* dev */
  717. );
  718. extern int XkbDDXAccessXBeep(
  719.     DeviceIntPtr        /* dev */,
  720.     unsigned int /* what */,
  721.     unsigned int /* which */
  722. );
  723. extern void XkbDDXKeyClick(
  724.     DeviceIntPtr /* dev */,
  725.     int /* keycode */,
  726.     int /* synthetic */
  727. );
  728. extern  int XkbDDXUsesSoftRepeat(
  729.     DeviceIntPtr /* dev */
  730. );
  731. extern void XkbDDXKeybdCtrlProc(
  732. DeviceIntPtr /* dev */,
  733. KeybdCtrl * /* ctrl */
  734. );
  735. extern void XkbDDXChangeControls(
  736. DeviceIntPtr /* dev */,
  737. XkbControlsPtr  /* old */,
  738. XkbControlsPtr  /* new */
  739. );
  740. extern void XkbDDXUpdateIndicators(
  741. DeviceIntPtr /* keybd */,
  742. CARD32 /* newState */
  743. );
  744. extern void XkbDDXUpdateDeviceIndicators(
  745. DeviceIntPtr /* dev */,
  746. XkbSrvLedInfoPtr /* sli */,
  747. CARD32 /* newState */
  748. );
  749. extern void XkbDDXFakePointerButton(
  750. int  /* event */,
  751. int /* button */
  752. );
  753. extern void XkbDDXFakePointerMotion(
  754.   unsigned int /* flags */,
  755. int /* x */,
  756. int /* y */
  757. );
  758. extern void XkbDDXFakeDeviceButton(
  759. DeviceIntPtr /* dev */,
  760. Bool /* press */,
  761. int /* button */
  762. );
  763. extern int XkbDDXTerminateServer(
  764. DeviceIntPtr /* dev */,
  765. KeyCode /* key */,
  766. XkbAction * /* act */
  767. );
  768. extern int XkbDDXSwitchScreen(
  769. DeviceIntPtr /* dev */,
  770. KeyCode /* key */,
  771. XkbAction * /* act */
  772. );
  773. extern int XkbDDXPrivate(
  774. DeviceIntPtr /* dev */,
  775. KeyCode /* key */,
  776. XkbAction * /* act */
  777. );
  778. extern void XkbDisableComputedAutoRepeats(
  779. DeviceIntPtr  /* pXDev */,
  780. unsigned int /* key */
  781. );
  782. extern void XkbSetRepeatKeys(
  783. DeviceIntPtr  /* pXDev */,
  784. int /* key */,
  785. int   /* onoff */
  786. );
  787. extern int XkbLatchModifiers(
  788. DeviceIntPtr  /* pXDev */,
  789. CARD8  /* mask */,
  790. CARD8  /* latches */
  791. );
  792. extern int XkbLatchGroup(
  793. DeviceIntPtr   /* pXDev */,
  794. int    /* group */
  795. );
  796. extern void XkbClearAllLatchesAndLocks(
  797. DeviceIntPtr /* dev */,
  798. XkbSrvInfoPtr /* xkbi */,
  799. Bool /* genEv */,
  800. XkbEventCausePtr /* cause */
  801. );
  802. extern void XkbSetRulesDflts(
  803. char * /* rulesFile */,
  804. char * /* model */,
  805. char * /* layout */,
  806. char * /* variant */,
  807. char * /* options */
  808. );
  809. extern void XkbInitDevice(
  810. DeviceIntPtr  /* pXDev */
  811. );
  812. extern Bool XkbInitKeyboardDeviceStruct(
  813. DeviceIntPtr  /* pXDev */,
  814. XkbComponentNamesPtr /* pNames */,
  815. KeySymsPtr /* pSyms */,
  816. CARD8  /* pMods */[],
  817. BellProcPtr /* bellProc */,
  818. KbdCtrlProcPtr /* ctrlProc */
  819. );
  820. extern int SProcXkbDispatch(
  821. ClientPtr /* client */
  822. );
  823. extern XkbGeometryPtr XkbLookupNamedGeometry(
  824. DeviceIntPtr /* dev */,
  825. Atom /* name */,
  826. Bool * /* shouldFree */
  827. );
  828. extern char * _XkbDupString(
  829. char * /* str */
  830. );
  831. extern void XkbConvertCase(
  832. KeySym  /* sym */,
  833. KeySym * /* lower */,
  834. KeySym * /* upper */
  835. );
  836. extern Status  XkbChangeKeycodeRange(
  837. XkbDescPtr /* xkb */,
  838. int  /* minKC */,
  839. int  /* maxKC */,
  840. XkbChangesPtr /* changes */
  841. );
  842. extern int XkbFinishDeviceInit(
  843. DeviceIntPtr /* pXDev */
  844. );
  845. extern void XkbFreeSrvLedInfo(
  846. XkbSrvLedInfoPtr /* sli */
  847. );
  848. extern void XkbFreeInfo(
  849. XkbSrvInfoPtr /* xkbi */
  850. );
  851. extern Status XkbChangeTypesOfKey(
  852. XkbDescPtr /* xkb */,
  853. int /* key */,
  854. int /* nGroups */,
  855. unsigned int /* groups */,
  856. int * /* newTypesIn */,
  857. XkbMapChangesPtr /* changes */
  858. );
  859. extern XkbKeyTypePtr XkbAddKeyType(
  860. XkbDescPtr /* xkb */,
  861. Atom /* name */,
  862. int /* map_count */,
  863. Bool /* want_preserve */,
  864. int /* num_lvls */
  865. );
  866. extern Status XkbInitCanonicalKeyTypes(
  867. XkbDescPtr /* xkb */,
  868. unsigned int /* which */,
  869. int /* keypadVMod */
  870. );
  871. extern int XkbKeyTypesForCoreSymbols(
  872. XkbDescPtr /* xkb */,
  873. int /* map_width */,
  874. KeySym * /* core_syms */,
  875. unsigned int /* protected */,
  876. int * /* types_inout */,
  877. KeySym * /* xkb_syms_rtrn */
  878. );
  879. extern Bool XkbApplyCompatMapToKey(
  880. XkbDescPtr /* xkb */,
  881. KeyCode /* key */,
  882. XkbChangesPtr /* changes */
  883. );
  884. extern Bool XkbUpdateMapFromCore(
  885. XkbDescPtr /* xkb */,
  886. KeyCode /* first_key */,
  887. int /* num_keys */,
  888. int /* map_width */,
  889. KeySym * /* core_keysyms */,
  890. XkbChangesPtr /* changes */
  891. );
  892. extern void XkbFreeControls(
  893. XkbDescPtr /* xkb */,
  894. unsigned int /* which */,
  895. Bool /* freeMap */
  896. );
  897. extern void XkbFreeIndicatorMaps(
  898. XkbDescPtr /* xkb */
  899. );
  900. extern Bool XkbApplyVirtualModChanges(
  901. XkbDescPtr /* xkb */,
  902. unsigned int /* changed */,
  903. XkbChangesPtr /* changes */
  904. );
  905. extern Bool XkbUpdateActionVirtualMods(
  906. XkbDescPtr /* xkb */,
  907. XkbAction * /* act */,
  908. unsigned int /* changed */
  909. );
  910. extern void XkbUpdateKeyTypeVirtualMods(
  911. XkbDescPtr /* xkb */,
  912. XkbKeyTypePtr /* type */,
  913. unsigned int /* changed */,
  914. XkbChangesPtr /* changes */
  915. );
  916. extern void XkbSendNewKeyboardNotify(
  917. DeviceIntPtr /* kbd */,
  918. xkbNewKeyboardNotify * /* pNKN */
  919. );
  920. #ifdef XKBSRV_NEED_FILE_FUNCS
  921. #include <X11/extensions/XKMformat.h>
  922. #include <X11/extensions/XKBfile.h>
  923. #include <X11/extensions/XKBrules.h>
  924. #define _XkbListKeymaps 0
  925. #define _XkbListKeycodes 1
  926. #define _XkbListTypes 2
  927. #define _XkbListCompat 3
  928. #define _XkbListSymbols 4
  929. #define _XkbListGeometry 5
  930. #define _XkbListNumComponents 6
  931. typedef struct _XkbSrvListInfo {
  932. int szPool;
  933. int nPool;
  934. char * pool;
  935. int maxRtrn;
  936. int nTotal;
  937. char * pattern[_XkbListNumComponents];
  938. int nFound[_XkbListNumComponents];
  939. } XkbSrvListInfoRec,*XkbSrvListInfoPtr;
  940. char *
  941. XkbGetRulesDflts(
  942. XkbRF_VarDefsPtr /* defs */
  943. );
  944. extern void XkbSetRulesUsed(
  945. XkbRF_VarDefsPtr /* defs */
  946. );
  947. extern Status XkbDDXList(
  948. DeviceIntPtr /* dev */,
  949. XkbSrvListInfoPtr /* listing */,
  950. ClientPtr /* client */
  951. );
  952. extern unsigned int XkbDDXLoadKeymapByNames(
  953. DeviceIntPtr /* keybd */,
  954. XkbComponentNamesPtr /* names */,
  955. unsigned int /* want */,
  956. unsigned int /* need */,
  957. XkbFileInfoPtr /* finfoRtrn */,
  958. char * /* keymapNameRtrn */,
  959. int  /* keymapNameRtrnLen */
  960. );
  961. extern Bool XkbDDXNamesFromRules(
  962. DeviceIntPtr /* keybd */,
  963. char * /* rules */,
  964. XkbRF_VarDefsPtr /* defs */,
  965. XkbComponentNamesPtr /* names */
  966. );
  967. extern FILE *XkbDDXOpenConfigFile(
  968. char * /* mapName */,
  969. char * /* fileNameRtrn */,
  970. int /* fileNameRtrnLen */
  971. );
  972. extern Bool XkbDDXApplyConfig(
  973. XPointer /* cfg_in */,
  974. XkbSrvInfoPtr /* xkbi */
  975. );
  976. extern XPointer XkbDDXPreloadConfig(
  977. char ** /* rulesFileRtrn */,
  978. XkbRF_VarDefsPtr /* defs */,
  979. XkbComponentNamesPtr /* names */,
  980. DeviceIntPtr /* dev */
  981. );
  982. extern int _XkbStrCaseCmp(
  983. char * /* str1 */,
  984. char * /* str2 */
  985. );
  986. #endif /* XKBSRV_NEED_FILE_FUNCS */
  987. _XFUNCPROTOEND
  988. #define XkbAtomGetString(d,s) NameForAtom(s)
  989. #endif /* _XKBSRV_H_ */