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

流媒体/Mpeg4/MP4

开发平台:

Visual C++

  1. /* $Xorg: XKBstr.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ */
  2. /************************************************************
  3. Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
  4. Permission to use, copy, modify, and distribute this
  5. software and its documentation for any purpose and without
  6. fee is hereby granted, provided that the above copyright
  7. notice appear in all copies and that both that copyright
  8. notice and this permission notice appear in supporting
  9. documentation, and that the name of Silicon Graphics not be 
  10. used in advertising or publicity pertaining to distribution 
  11. of the software without specific prior written permission.
  12. Silicon Graphics makes no representation about the suitability 
  13. of this software for any purpose. It is provided "as is"
  14. without any express or implied warranty.
  15. SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS 
  16. SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 
  17. AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
  18. GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL 
  19. DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 
  20. DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 
  21. OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION  WITH
  22. THE USE OR PERFORMANCE OF THIS SOFTWARE.
  23. ********************************************************/
  24. #ifndef _XKBSTR_H_
  25. #define _XKBSTR_H_
  26. #include <X11/extensions/XKB.h>
  27. #define XkbCharToInt(v) ((v)&0x80?(int)((v)|(~0xff)):(int)((v)&0x7f))
  28. #define XkbIntTo2Chars(i,h,l) (((h)=((i>>8)&0xff)),((l)=((i)&0xff)))
  29. #if defined(WORD64) && defined(UNSIGNEDBITFIELDS)
  30. #define Xkb2CharsToInt(h,l) ((h)&0x80?(int)(((h)<<8)|(l)|(~0xffff)):
  31.   (int)(((h)<<8)|(l)&0x7fff))
  32. #else
  33. #define Xkb2CharsToInt(h,l) ((short)(((h)<<8)|(l)))
  34. #endif
  35. /*
  36.  * Common data structures and access macros
  37.  */
  38. typedef struct _XkbStateRec {
  39. unsigned char group;
  40. unsigned char   locked_group;
  41. unsigned short base_group;
  42. unsigned short latched_group;
  43. unsigned char mods;
  44. unsigned char base_mods;
  45. unsigned char latched_mods;
  46. unsigned char locked_mods;
  47. unsigned char compat_state;
  48. unsigned char grab_mods;
  49. unsigned char compat_grab_mods;
  50. unsigned char lookup_mods;
  51. unsigned char compat_lookup_mods;
  52. unsigned short ptr_buttons;
  53. } XkbStateRec,*XkbStatePtr;
  54. #define XkbModLocks(s)  ((s)->locked_mods)
  55. #define XkbStateMods(s)  ((s)->base_mods|(s)->latched_mods|XkbModLocks(s))
  56. #define XkbGroupLock(s)  ((s)->locked_group)
  57. #define XkbStateGroup(s) ((s)->base_group+(s)->latched_group+XkbGroupLock(s))
  58. #define XkbStateFieldFromRec(s) XkbBuildCoreState((s)->lookup_mods,(s)->group)
  59. #define XkbGrabStateFromRec(s) XkbBuildCoreState((s)->grab_mods,(s)->group)
  60. typedef struct _XkbMods {
  61. unsigned char mask; /* effective mods */
  62. unsigned char real_mods;
  63. unsigned short vmods;
  64. } XkbModsRec,*XkbModsPtr;
  65. typedef struct _XkbKTMapEntry {
  66. Bool active;
  67. unsigned char level;
  68. XkbModsRec mods;
  69. } XkbKTMapEntryRec,*XkbKTMapEntryPtr;
  70. typedef struct _XkbKeyType {
  71. XkbModsRec mods;
  72. unsigned char    num_levels;
  73. unsigned char    map_count;
  74. XkbKTMapEntryPtr   map;
  75. XkbModsPtr   preserve;
  76. Atom    name;
  77. Atom * level_names;
  78. } XkbKeyTypeRec, *XkbKeyTypePtr;
  79. #define XkbNumGroups(g) ((g)&0x0f)
  80. #define XkbOutOfRangeGroupInfo(g) ((g)&0xf0)
  81. #define XkbOutOfRangeGroupAction(g) ((g)&0xc0)
  82. #define XkbOutOfRangeGroupNumber(g) (((g)&0x30)>>4)
  83. #define XkbSetGroupInfo(g,w,n) (((w)&0xc0)|(((n)&3)<<4)|((g)&0x0f))
  84. #define XkbSetNumGroups(g,n) (((g)&0xf0)|((n)&0x0f))
  85. /*
  86.  * Structures and access macros used primarily by the server
  87.  */
  88. typedef struct _XkbBehavior {
  89. unsigned char type;
  90. unsigned char data;
  91. } XkbBehavior;
  92. #define XkbAnyActionDataSize 7
  93. typedef struct _XkbAnyAction {
  94. unsigned char type;
  95. unsigned char data[XkbAnyActionDataSize];
  96. } XkbAnyAction;
  97. typedef struct _XkbModAction {
  98. unsigned char type;
  99. unsigned char flags;
  100. unsigned char mask;
  101. unsigned char real_mods;
  102. unsigned char vmods1;
  103. unsigned char vmods2;
  104. } XkbModAction;
  105. #define XkbModActionVMods(a)      
  106. ((short)(((a)->vmods1<<8)|((a)->vmods2)))
  107. #define XkbSetModActionVMods(a,v) 
  108. (((a)->vmods1=(((v)>>8)&0xff)),(a)->vmods2=((v)&0xff))
  109. typedef struct _XkbGroupAction {
  110. unsigned char type;
  111. unsigned char flags;
  112. char group_XXX;
  113. } XkbGroupAction;
  114. #define XkbSAGroup(a) (XkbCharToInt((a)->group_XXX))
  115. #define XkbSASetGroup(a,g) ((a)->group_XXX=(g))
  116. typedef struct _XkbISOAction {
  117. unsigned char type;
  118. unsigned char flags;
  119. unsigned char mask;
  120. unsigned char real_mods;
  121. char group_XXX;
  122. unsigned char affect;
  123. unsigned char vmods1;
  124. unsigned char vmods2;
  125. } XkbISOAction;
  126. typedef struct _XkbPtrAction {
  127. unsigned char type;
  128. unsigned char flags;
  129. unsigned char high_XXX;
  130. unsigned char low_XXX;
  131. unsigned char high_YYY;
  132. unsigned char low_YYY;
  133. } XkbPtrAction;
  134. #define XkbPtrActionX(a)      (Xkb2CharsToInt((a)->high_XXX,(a)->low_XXX))
  135. #define XkbPtrActionY(a)      (Xkb2CharsToInt((a)->high_YYY,(a)->low_YYY))
  136. #define XkbSetPtrActionX(a,x) (XkbIntTo2Chars(x,(a)->high_XXX,(a)->low_XXX))
  137. #define XkbSetPtrActionY(a,y) (XkbIntTo2Chars(y,(a)->high_YYY,(a)->low_YYY))
  138. typedef struct _XkbPtrBtnAction {
  139. unsigned char type;
  140. unsigned char flags;
  141. unsigned char count;
  142. unsigned char button;
  143. } XkbPtrBtnAction;
  144. typedef struct _XkbPtrDfltAction {
  145. unsigned char type;
  146. unsigned char flags;
  147. unsigned char affect;
  148. char valueXXX;
  149. } XkbPtrDfltAction;
  150. #define XkbSAPtrDfltValue(a) (XkbCharToInt((a)->valueXXX))
  151. #define XkbSASetPtrDfltValue(a,c) ((a)->valueXXX= ((c)&0xff))
  152. typedef struct _XkbSwitchScreenAction {
  153. unsigned char type;
  154. unsigned char flags;
  155. char screenXXX;
  156. } XkbSwitchScreenAction;
  157. #define XkbSAScreen(a) (XkbCharToInt((a)->screenXXX))
  158. #define XkbSASetScreen(a,s) ((a)->screenXXX= ((s)&0xff))
  159. typedef struct _XkbCtrlsAction {
  160. unsigned char type;
  161. unsigned char flags;
  162. unsigned char ctrls3;
  163. unsigned char ctrls2;
  164. unsigned char ctrls1;
  165. unsigned char ctrls0;
  166. } XkbCtrlsAction;
  167. #define XkbActionSetCtrls(a,c) (((a)->ctrls3=(((c)>>24)&0xff)),
  168. ((a)->ctrls2=(((c)>>16)&0xff)),
  169. ((a)->ctrls1=(((c)>>8)&0xff)),
  170. ((a)->ctrls0=((c)&0xff)))
  171. #define XkbActionCtrls(a) ((((unsigned int)(a)->ctrls3)<<24)|
  172.    (((unsigned int)(a)->ctrls2)<<16)|
  173.    (((unsigned int)(a)->ctrls1)<<8)|
  174.    ((unsigned int)((a)->ctrls0)))
  175. typedef struct _XkbMessageAction {
  176. unsigned char type;
  177. unsigned char flags;
  178. unsigned char message[6];
  179. } XkbMessageAction;
  180. typedef struct _XkbRedirectKeyAction {
  181. unsigned char type;
  182. unsigned char new_key;
  183. unsigned char mods_mask;
  184. unsigned char mods;
  185. unsigned char vmods_mask0;
  186. unsigned char vmods_mask1;
  187. unsigned char vmods0;
  188. unsigned char vmods1;
  189. } XkbRedirectKeyAction;
  190. #define XkbSARedirectVMods(a) ((((unsigned int)(a)->vmods1)<<8)|
  191. ((unsigned int)(a)->vmods0))
  192. #define XkbSARedirectSetVMods(a,m) (((a)->vmods_mask1=(((m)>>8)&0xff)),
  193.  ((a)->vmods_mask0=((m)&0xff)))
  194. #define XkbSARedirectVModsMask(a) ((((unsigned int)(a)->vmods_mask1)<<8)|
  195. ((unsigned int)(a)->vmods_mask0))
  196. #define XkbSARedirectSetVModsMask(a,m) (((a)->vmods_mask1=(((m)>>8)&0xff)),
  197.  ((a)->vmods_mask0=((m)&0xff)))
  198. typedef struct _XkbDeviceBtnAction {
  199. unsigned char type;
  200. unsigned char flags;
  201. unsigned char count;
  202. unsigned char button;
  203. unsigned char device;
  204. } XkbDeviceBtnAction;
  205. typedef struct _XkbDeviceValuatorAction {
  206. unsigned char type;
  207. unsigned char device;
  208. unsigned char v1_what;
  209. unsigned char v1_ndx;
  210. unsigned char v1_value;
  211. unsigned char v2_what;
  212. unsigned char v2_ndx;
  213. unsigned char v2_value;
  214. } XkbDeviceValuatorAction;
  215. typedef union _XkbAction {
  216. XkbAnyAction any;
  217. XkbModAction mods;
  218. XkbGroupAction group;
  219. XkbISOAction iso;
  220. XkbPtrAction ptr;
  221. XkbPtrBtnAction btn;
  222. XkbPtrDfltAction dflt;
  223. XkbSwitchScreenAction screen;
  224. XkbCtrlsAction ctrls;
  225. XkbMessageAction msg;
  226. XkbRedirectKeyAction redirect;
  227. XkbDeviceBtnAction devbtn;
  228. XkbDeviceValuatorAction devval;
  229. unsigned char  type;
  230. } XkbAction;
  231. typedef struct _XkbControls {
  232. unsigned char mk_dflt_btn;
  233. unsigned char num_groups;
  234. unsigned char groups_wrap;
  235. XkbModsRec internal;
  236. XkbModsRec ignore_lock;
  237. unsigned int enabled_ctrls;
  238. unsigned short repeat_delay;
  239. unsigned short repeat_interval;
  240. unsigned short slow_keys_delay;
  241. unsigned short debounce_delay;
  242. unsigned short mk_delay;
  243. unsigned short mk_interval;
  244. unsigned short mk_time_to_max;
  245. unsigned short mk_max_speed;
  246.  short mk_curve;
  247. unsigned short ax_options;
  248. unsigned short ax_timeout;
  249. unsigned short axt_opts_mask;
  250. unsigned short axt_opts_values;
  251. unsigned int axt_ctrls_mask;
  252. unsigned int axt_ctrls_values;
  253. unsigned char per_key_repeat[XkbPerKeyBitArraySize];
  254. } XkbControlsRec, *XkbControlsPtr;
  255. #define XkbAX_AnyFeedback(c) ((c)->enabled_ctrls&XkbAccessXFeedbackMask)
  256. #define XkbAX_NeedOption(c,w) ((c)->ax_options&(w))
  257. #define XkbAX_NeedFeedback(c,w) (XkbAX_AnyFeedback(c)&&XkbAX_NeedOption(c,w))
  258. typedef struct _XkbServerMapRec {
  259. unsigned short  num_acts;
  260. unsigned short  size_acts;
  261. XkbAction *acts;
  262. XkbBehavior *behaviors;
  263. unsigned short *key_acts;
  264. #if defined(__cplusplus) || defined(c_plusplus)
  265. /* explicit is a C++ reserved word */
  266. unsigned char *c_explicit;
  267. #else
  268. unsigned char *explicit;
  269. #endif
  270. unsigned char  vmods[XkbNumVirtualMods];
  271. unsigned short *vmodmap;
  272. } XkbServerMapRec, *XkbServerMapPtr;
  273. #define XkbSMKeyActionsPtr(m,k) (&(m)->acts[(m)->key_acts[k]])
  274. /*
  275.  * Structures and access macros used primarily by clients
  276.  */
  277. typedef struct _XkbSymMapRec {
  278. unsigned char  kt_index[XkbNumKbdGroups];
  279. unsigned char  group_info;
  280. unsigned char  width;
  281. unsigned short  offset;
  282. } XkbSymMapRec, *XkbSymMapPtr;
  283. typedef struct _XkbClientMapRec {
  284. unsigned char  size_types;
  285. unsigned char  num_types;
  286. XkbKeyTypePtr  types;
  287. unsigned short  size_syms;
  288. unsigned short  num_syms;
  289. KeySym *syms;
  290. XkbSymMapPtr  key_sym_map;
  291. unsigned char *modmap;
  292. } XkbClientMapRec, *XkbClientMapPtr;
  293. #define XkbCMKeyGroupInfo(m,k)  ((m)->key_sym_map[k].group_info)
  294. #define XkbCMKeyNumGroups(m,k)  (XkbNumGroups((m)->key_sym_map[k].group_info))
  295. #define XkbCMKeyGroupWidth(m,k,g) (XkbCMKeyType(m,k,g)->num_levels)
  296. #define XkbCMKeyGroupsWidth(m,k) ((m)->key_sym_map[k].width)
  297. #define XkbCMKeyTypeIndex(m,k,g) ((m)->key_sym_map[k].kt_index[g&0x3])
  298. #define XkbCMKeyType(m,k,g)  (&(m)->types[XkbCMKeyTypeIndex(m,k,g)])
  299. #define XkbCMKeyNumSyms(m,k) (XkbCMKeyGroupsWidth(m,k)*XkbCMKeyNumGroups(m,k))
  300. #define XkbCMKeySymsOffset(m,k) ((m)->key_sym_map[k].offset)
  301. #define XkbCMKeySymsPtr(m,k) (&(m)->syms[XkbCMKeySymsOffset(m,k)])
  302. /*
  303.  * Compatibility structures and access macros
  304.  */
  305. typedef struct _XkbSymInterpretRec {
  306. KeySym sym;
  307. unsigned char flags;
  308. unsigned char match;
  309. unsigned char mods;
  310. unsigned char virtual_mod;
  311. XkbAnyAction act;
  312. } XkbSymInterpretRec,*XkbSymInterpretPtr;
  313. typedef struct _XkbCompatMapRec {
  314. XkbSymInterpretPtr  sym_interpret;
  315. XkbModsRec  groups[XkbNumKbdGroups];
  316. unsigned short  num_si;
  317. unsigned short  size_si;
  318. } XkbCompatMapRec, *XkbCompatMapPtr;
  319. typedef struct _XkbIndicatorMapRec {
  320. unsigned char flags;
  321. unsigned char which_groups;
  322. unsigned char groups;
  323. unsigned char which_mods;
  324. XkbModsRec mods;
  325. unsigned int ctrls;
  326. } XkbIndicatorMapRec, *XkbIndicatorMapPtr;
  327. #define XkbIM_IsAuto(i) ((((i)->flags&XkbIM_NoAutomatic)==0)&&
  328.     (((i)->which_groups&&(i)->groups)||
  329.      ((i)->which_mods&&(i)->mods.mask)||
  330.      ((i)->ctrls)))
  331. #define XkbIM_InUse(i) (((i)->flags)||((i)->which_groups)||
  332. ((i)->which_mods)||((i)->ctrls))
  333. typedef struct _XkbIndicatorRec {
  334. unsigned long    phys_indicators;
  335. XkbIndicatorMapRec maps[XkbNumIndicators];
  336. } XkbIndicatorRec,*XkbIndicatorPtr;
  337. typedef struct _XkbKeyNameRec {
  338. char name[XkbKeyNameLength];
  339. } XkbKeyNameRec,*XkbKeyNamePtr;
  340. typedef struct _XkbKeyAliasRec {
  341. char real[XkbKeyNameLength];
  342. char alias[XkbKeyNameLength];
  343. } XkbKeyAliasRec,*XkbKeyAliasPtr;
  344. /*
  345.  * Names for everything 
  346.  */
  347. typedef struct _XkbNamesRec {
  348. Atom   keycodes;
  349. Atom   geometry;
  350. Atom   symbols;
  351. Atom              types;
  352. Atom   compat;
  353. Atom   vmods[XkbNumVirtualMods];
  354. Atom   indicators[XkbNumIndicators];
  355. Atom   groups[XkbNumKbdGroups];
  356. XkbKeyNamePtr   keys;
  357. XkbKeyAliasPtr   key_aliases;
  358. Atom  *radio_groups;
  359. Atom   phys_symbols;
  360. unsigned char   num_keys;
  361. unsigned char   num_key_aliases;
  362. unsigned short   num_rg;
  363. } XkbNamesRec,*XkbNamesPtr;
  364. typedef struct _XkbGeometry *XkbGeometryPtr;
  365. /*
  366.  * Tie it all together into one big keyboard description
  367.  */
  368. typedef struct _XkbDesc {
  369. struct _XDisplay * dpy;
  370. unsigned short   flags;
  371. unsigned short device_spec;
  372. KeyCode min_key_code;
  373. KeyCode max_key_code;
  374. XkbControlsPtr ctrls;
  375. XkbServerMapPtr server;
  376. XkbClientMapPtr map;
  377. XkbIndicatorPtr indicators;
  378. XkbNamesPtr names;
  379. XkbCompatMapPtr compat;
  380. XkbGeometryPtr geom;
  381. } XkbDescRec, *XkbDescPtr;
  382. #define XkbKeyKeyTypeIndex(d,k,g) (XkbCMKeyTypeIndex((d)->map,k,g))
  383. #define XkbKeyKeyType(d,k,g) (XkbCMKeyType((d)->map,k,g))
  384. #define XkbKeyGroupWidth(d,k,g) (XkbCMKeyGroupWidth((d)->map,k,g))
  385. #define XkbKeyGroupsWidth(d,k) (XkbCMKeyGroupsWidth((d)->map,k))
  386. #define XkbKeyGroupInfo(d,k) (XkbCMKeyGroupInfo((d)->map,(k)))
  387. #define XkbKeyNumGroups(d,k) (XkbCMKeyNumGroups((d)->map,(k)))
  388. #define XkbKeyNumSyms(d,k) (XkbCMKeyNumSyms((d)->map,(k)))
  389. #define XkbKeySymsPtr(d,k) (XkbCMKeySymsPtr((d)->map,(k)))
  390. #define XkbKeySym(d,k,n) (XkbKeySymsPtr(d,k)[n])
  391. #define XkbKeySymEntry(d,k,sl,g) 
  392. (XkbKeySym(d,k,((XkbKeyGroupsWidth(d,k)*(g))+(sl))))
  393. #define XkbKeyAction(d,k,n) 
  394. (XkbKeyHasActions(d,k)?&XkbKeyActionsPtr(d,k)[n]:NULL)
  395. #define XkbKeyActionEntry(d,k,sl,g) 
  396. (XkbKeyHasActions(d,k)?
  397. XkbKeyAction(d,k,((XkbKeyGroupsWidth(d,k)*(g))+(sl))):NULL)
  398. #define XkbKeyHasActions(d,k) ((d)->server->key_acts[k]!=0)
  399. #define XkbKeyNumActions(d,k) (XkbKeyHasActions(d,k)?XkbKeyNumSyms(d,k):1)
  400. #define XkbKeyActionsPtr(d,k) (XkbSMKeyActionsPtr((d)->server,k))
  401. #define XkbKeycodeInRange(d,k) (((k)>=(d)->min_key_code)&&
  402.  ((k)<=(d)->max_key_code))
  403. #define XkbNumKeys(d) ((d)->max_key_code-(d)->min_key_code+1)
  404. /*
  405.  * The following structures can be used to track changes
  406.  * to a keyboard device
  407.  */
  408. typedef struct _XkbMapChanges {
  409. unsigned short  changed;
  410. KeyCode  min_key_code;
  411. KeyCode  max_key_code;
  412. unsigned char  first_type;
  413. unsigned char  num_types;
  414. KeyCode  first_key_sym;
  415. unsigned char  num_key_syms;
  416. KeyCode  first_key_act;
  417. unsigned char  num_key_acts;
  418. KeyCode  first_key_behavior;
  419. unsigned char  num_key_behaviors;
  420. KeyCode   first_key_explicit;
  421. unsigned char  num_key_explicit;
  422. KeyCode  first_modmap_key;
  423. unsigned char  num_modmap_keys;
  424. KeyCode  first_vmodmap_key;
  425. unsigned char  num_vmodmap_keys;
  426. unsigned char  pad;
  427. unsigned short  vmods;
  428. } XkbMapChangesRec,*XkbMapChangesPtr;
  429. typedef struct _XkbControlsChanges {
  430. unsigned int   changed_ctrls;
  431. unsigned int  enabled_ctrls_changes;
  432. Bool  num_groups_changed;
  433. } XkbControlsChangesRec,*XkbControlsChangesPtr;
  434. typedef struct _XkbIndicatorChanges {
  435. unsigned int  state_changes;
  436. unsigned int  map_changes;
  437. } XkbIndicatorChangesRec,*XkbIndicatorChangesPtr;
  438. typedef struct _XkbNameChanges {
  439. unsigned int  changed;
  440. unsigned char first_type;
  441. unsigned char num_types;
  442. unsigned char first_lvl;
  443. unsigned char num_lvls;
  444. unsigned char num_aliases;
  445. unsigned char num_rg;
  446. unsigned char first_key;
  447. unsigned char num_keys;
  448. unsigned short changed_vmods;
  449. unsigned long changed_indicators;
  450. unsigned char changed_groups;
  451. } XkbNameChangesRec,*XkbNameChangesPtr;
  452. typedef struct _XkbCompatChanges {
  453. unsigned char changed_groups;
  454. unsigned short first_si;
  455. unsigned short num_si;
  456. } XkbCompatChangesRec,*XkbCompatChangesPtr;
  457. typedef struct _XkbChanges {
  458. unsigned short  device_spec;
  459. unsigned short  state_changes;
  460. XkbMapChangesRec  map;
  461. XkbControlsChangesRec  ctrls;
  462. XkbIndicatorChangesRec  indicators;
  463. XkbNameChangesRec  names;
  464. XkbCompatChangesRec  compat;
  465. } XkbChangesRec, *XkbChangesPtr;
  466. /*
  467.  * These data structures are used to construct a keymap from 
  468.  * a set of components or to list components in the server
  469.  * database.
  470.  */
  471. typedef struct _XkbComponentNames {
  472. char *  keymap;
  473. char *  keycodes;
  474. char *  types;
  475. char *  compat;
  476. char *  symbols;
  477. char *  geometry;
  478. } XkbComponentNamesRec, *XkbComponentNamesPtr;
  479. typedef struct _XkbComponentName {
  480. unsigned short flags;
  481. char * name;
  482. } XkbComponentNameRec,*XkbComponentNamePtr;
  483. typedef struct _XkbComponentList {
  484. int num_keymaps;
  485. int num_keycodes;
  486. int num_types;
  487. int num_compat;
  488. int num_symbols;
  489. int num_geometry;
  490. XkbComponentNamePtr keymaps;
  491. XkbComponentNamePtr  keycodes;
  492. XkbComponentNamePtr types;
  493. XkbComponentNamePtr compat;
  494. XkbComponentNamePtr symbols;
  495. XkbComponentNamePtr geometry;
  496. } XkbComponentListRec, *XkbComponentListPtr;
  497. /*
  498.  * The following data structures describe and track changes to a 
  499.  * non-keyboard extension device 
  500.  */
  501. typedef struct _XkbDeviceLedInfo {
  502. unsigned short led_class;
  503. unsigned short led_id;
  504. unsigned int phys_indicators;
  505. unsigned int maps_present;
  506. unsigned int names_present;
  507. unsigned int state;
  508. Atom  names[XkbNumIndicators];
  509. XkbIndicatorMapRec maps[XkbNumIndicators];
  510. } XkbDeviceLedInfoRec,*XkbDeviceLedInfoPtr;
  511. typedef struct _XkbDeviceInfo {
  512. char * name;
  513. Atom type;
  514. unsigned short device_spec;
  515. Bool has_own_state;
  516. unsigned short supported;
  517. unsigned short unsupported;
  518. unsigned short num_btns;
  519. XkbAction * btn_acts;
  520. unsigned short sz_leds;
  521. unsigned short num_leds;
  522. unsigned short dflt_kbd_fb;
  523. unsigned short dflt_led_fb;
  524. XkbDeviceLedInfoPtr leds;
  525. } XkbDeviceInfoRec,*XkbDeviceInfoPtr;
  526. #define XkbXI_DevHasBtnActs(d) (((d)->num_btns>0)&&((d)->btn_acts!=NULL))
  527. #define XkbXI_LegalDevBtn(d,b) (XkbXI_DevHasBtnActs(d)&&((b)<(d)->num_btns))
  528. #define XkbXI_DevHasLeds(d) (((d)->num_leds>0)&&((d)->leds!=NULL))
  529. typedef struct _XkbDeviceLedChanges {
  530. unsigned short led_class;
  531. unsigned short led_id;
  532. unsigned int defined; /* names or maps changed */
  533. struct _XkbDeviceLedChanges *next;
  534. } XkbDeviceLedChangesRec,*XkbDeviceLedChangesPtr;
  535. typedef struct _XkbDeviceChanges {
  536. unsigned int changed;
  537. unsigned short first_btn;
  538. unsigned short num_btns;
  539. XkbDeviceLedChangesRec  leds;
  540. } XkbDeviceChangesRec,*XkbDeviceChangesPtr;
  541. #endif /* _XKBSTR_H_ */