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

  1. #ifndef _XKBFILE_H_
  2. #define    _XKBFILE_H_ 1
  3.  
  4. /* $XConsortium: XKBfile.h /main/5 1996/03/01 14:30:21 kaleb $ */
  5. /************************************************************
  6.  Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc.
  7.  
  8.  Permission to use, copy, modify, and distribute this
  9.  software and its documentation for any purpose and without
  10.  fee is hereby granted, provided that the above copyright
  11.  notice appear in all copies and that both that copyright
  12.  notice and this permission notice appear in supporting
  13.  documentation, and that the name of Silicon Graphics not be 
  14.  used in advertising or publicity pertaining to distribution 
  15.  of the software without specific prior written permission.
  16.  Silicon Graphics makes no representation about the suitability 
  17.  of this software for any purpose. It is provided "as is"
  18.  without any express or implied warranty.
  19.  
  20.  SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS 
  21.  SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 
  22.  AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
  23.  GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL 
  24.  DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 
  25.  DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 
  26.  OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION  WITH
  27.  THE USE OR PERFORMANCE OF THIS SOFTWARE.
  28.  
  29.  ********************************************************/
  30.  
  31. /***====================================================================***/
  32.  
  33. #define    XkbXKMFile    0
  34. #define    XkbCFile    1
  35. #define    XkbXKBFile    2
  36. #define    XkbMessage    3
  37.  
  38. #define    XkbMapDefined        (1<<0)
  39. #define    XkbStateDefined        (1<<1)
  40.  
  41. typedef struct _XkbFileInfo {
  42.     unsigned        type;
  43.     unsigned        defined;
  44.     XkbDescPtr         xkb;
  45. } XkbFileInfo,*XkbFileInfoPtr;
  46.  
  47. typedef void    (*XkbFileAddOnFunc)(
  48. #if NeedFunctionPrototypes
  49.     FILE *        /* file */,
  50.     XkbFileInfo *    /* result */,
  51.     Bool        /* topLevel */,
  52.     Bool        /* showImplicit */,
  53.     int            /* fileSection */,
  54.     void *        /* priv */
  55. #endif
  56. );
  57.  
  58. /***====================================================================***/
  59.  
  60. #define    _XkbSuccess            0
  61. #define    _XkbErrMissingNames        1
  62. #define    _XkbErrMissingTypes        2
  63. #define    _XkbErrMissingReqTypes        3
  64. #define    _XkbErrMissingSymbols        4
  65. #define    _XkbErrMissingVMods        5
  66. #define    _XkbErrMissingIndicators    6
  67. #define    _XkbErrMissingCompatMap        7
  68. #define    _XkbErrMissingSymInterps    8
  69. #define    _XkbErrMissingGeometry        9
  70. #define    _XkbErrIllegalDoodad        10
  71. #define    _XkbErrIllegalTOCType        11
  72. #define    _XkbErrIllegalContents        12
  73. #define    _XkbErrEmptyFile        13
  74. #define    _XkbErrFileNotFound        14
  75. #define    _XkbErrFileCannotOpen        15
  76. #define    _XkbErrBadValue            16
  77. #define    _XkbErrBadMatch            17
  78. #define    _XkbErrBadTypeName        18
  79. #define    _XkbErrBadTypeWidth        19
  80. #define    _XkbErrBadFileType        20
  81. #define    _XkbErrBadFileVersion        21
  82. #define    _XkbErrBadFileFormat        22
  83. #define    _XkbErrBadAlloc            23
  84. #define    _XkbErrBadLength        24
  85. #define    _XkbErrBadImplementation    25
  86.  
  87. extern char *        _XkbErrMessages[];
  88. extern unsigned        _XkbErrCode;
  89. extern char *        _XkbErrLocation;
  90. extern unsigned        _XkbErrData;
  91.  
  92. /***====================================================================***/
  93.  
  94. _XFUNCPROTOBEGIN
  95.  
  96. extern    char *    XkbIndentText(
  97. #if NeedFunctionPrototypes
  98.     unsigned    /* size */
  99. #endif
  100. );
  101.  
  102. extern    char *    XkbAtomText(
  103. #if NeedFunctionPrototypes
  104.     Display *    /* dpy */,
  105.     Atom     /* atm */,
  106.     unsigned    /* format */
  107. #endif
  108. );
  109.  
  110. extern char *    XkbKeysymText(
  111. #if NeedFunctionPrototypes
  112.     KeySym    /* sym */,
  113.     unsigned    /* format */
  114. #endif
  115. );
  116.  
  117. extern char *    XkbStringText(
  118. #if NeedFunctionPrototypes
  119.     char *    /* str */,
  120.     unsigned    /* format */
  121. #endif
  122. );
  123.  
  124. extern char *    XkbKeyNameText(
  125. #if NeedFunctionPrototypes
  126.     char *    /* name */,
  127.     unsigned    /* format */
  128. #endif
  129. );
  130.  
  131. extern char *
  132. XkbModIndexText(
  133. #if NeedFunctionPrototypes
  134.     unsigned    /* ndx */,
  135.     unsigned    /* format */
  136. #endif
  137. );
  138.  
  139. extern char *
  140. XkbModMaskText(
  141. #if NeedFunctionPrototypes
  142.     unsigned    /* mask */,
  143.     unsigned    /* format */
  144. #endif
  145. );
  146.  
  147. extern char *    XkbVModIndexText(
  148. #if NeedFunctionPrototypes
  149.     Display *    /* dpy */,
  150.     XkbDescPtr    /* xkb */,
  151.     unsigned    /* ndx */,
  152.     unsigned    /* format */
  153. #endif
  154. );
  155.  
  156. extern    char *    XkbVModMaskText(
  157. #if NeedFunctionPrototypes
  158.     Display *    /* dpy */,
  159.     XkbDescPtr    /* xkb */,
  160.     unsigned    /* modMask */,
  161.     unsigned    /* mask */,
  162.     unsigned    /* format */
  163. #endif
  164. );
  165.  
  166. extern char *    XkbConfigText(
  167. #if NeedFunctionPrototypes
  168.     unsigned     /* config */,
  169.     unsigned     /* format */
  170. #endif
  171. );
  172.  
  173. extern char *    XkbSIMatchText(
  174. #if NeedFunctionPrototypes
  175.     unsigned    /* type */,
  176.     unsigned    /* format */
  177. #endif
  178. );
  179.  
  180. extern char *    XkbIMWhichStateMaskText(
  181. #if NeedFunctionPrototypes
  182.     unsigned    /* use_which */,
  183.     unsigned    /* format */
  184. #endif
  185. );
  186.  
  187. extern char *    XkbAccessXDetailText(
  188. #if NeedFunctionPrototypes
  189.     unsigned    /* state */,
  190.     unsigned    /* format */
  191. #endif
  192. );
  193.  
  194. extern char *    XkbNKNDetailMaskText(
  195. #if NeedFunctionPrototypes
  196.     unsigned    /* detail */,
  197.     unsigned    /* format */
  198. #endif
  199. );
  200.  
  201. extern char *    XkbControlsMaskText(
  202. #if NeedFunctionPrototypes
  203.     unsigned    /* ctrls */,
  204.     unsigned    /* format */
  205. #endif
  206. );
  207.  
  208. extern char *    XkbGeomFPText(
  209. #if NeedFunctionPrototypes
  210.     int        /* val */,
  211.     unsigned     /* format */
  212. #endif
  213. );
  214.  
  215. extern char *    XkbDoodadTypeText(
  216. #if NeedFunctionPrototypes
  217.     unsigned    /* type */,
  218.     unsigned    /* format */
  219. #endif
  220. );
  221.  
  222. extern char *    XkbActionTypeText(
  223. #if NeedFunctionPrototypes
  224.     unsigned    /* type */,
  225.     unsigned    /* format */
  226. #endif
  227. );
  228.  
  229. extern char *    XkbActionText(
  230. #if NeedFunctionPrototypes
  231.     Display *    /* dpy */,
  232.     XkbDescPtr    /* xkb */,
  233.     XkbAction *    /* action */,
  234.     unsigned    /* format */
  235. #endif
  236. );
  237.  
  238. extern char *    XkbBehaviorText(
  239. #if NeedFunctionPrototypes
  240.     XkbDescPtr         /* xkb */,
  241.     XkbBehavior *    /* behavior */,
  242.     unsigned        /* format */
  243. #endif
  244. );
  245.  
  246. /***====================================================================***/
  247.  
  248. #define    _XkbKSLower    (1<<0)
  249. #define    _XkbKSUpper    (1<<1)
  250.  
  251. #define    XkbKSIsLower(k)        (_XkbKSCheckCase(k)&_XkbKSLower)
  252. #define    XkbKSIsUpper(k)        (_XkbKSCheckCase(k)&_XkbKSUpper)
  253. #define XkbKSIsKeypad(k)    (((k)>=XK_KP_Space)&&((k)<=XK_KP_Equal))
  254. #define    XkbKSIsDeadKey(k)    \
  255.         (((k)>=XK_dead_grave)&&((k)<=XK_dead_semivoiced_sound))
  256.  
  257. extern    unsigned _XkbKSCheckCase(
  258. #if NeedFunctionPrototypes
  259.    KeySym    /* sym */
  260. #endif
  261. );
  262.  
  263. extern    int     XkbFindKeycodeByName(
  264. #if NeedFunctionPrototypes
  265.     XkbDescPtr    /* xkb */,
  266.     char *    /* name */,
  267.     Bool    /* use_aliases */
  268. #endif
  269. );
  270.  
  271. extern    Bool    XkbLookupGroupAndLevel(
  272. #if NeedFunctionPrototypes
  273.     XkbDescPtr    /* xkb */,
  274.     int        /* key */,
  275.     int    *    /* mods_inout */,
  276.     int *    /* grp_inout */,
  277.     int    *    /* lvl_rtrn */
  278. #endif
  279. );
  280.  
  281. /***====================================================================***/
  282.  
  283. extern    char *    XkbAtomGetString(
  284. #if NeedFunctionPrototypes
  285.     Display *    /* dpy */,
  286.     Atom     /* atm */
  287. #endif
  288. );
  289.  
  290. extern    Atom    XkbInternAtom(
  291. #if NeedFunctionPrototypes
  292.     Display *    /* dpy */,
  293.     char *    /* name */,
  294.     Bool    /* onlyIfExists */
  295. #endif
  296. );
  297.  
  298. extern    Status    XkbChangeKbdDisplay(
  299. #if NeedFunctionPrototypes
  300.     Display *        /* newDpy */,
  301.     XkbFileInfo *    /* result */
  302. #endif
  303. );
  304.  
  305. extern    Atom    XkbChangeAtomDisplay(
  306. #if NeedFunctionPrototypes
  307.     Display *    /* oldDpy */,
  308.     Display *    /* newDpy */,
  309.     Atom    /* atm */
  310. #endif
  311. );
  312.  
  313. extern    void    XkbInitAtoms(
  314. #if NeedFunctionPrototypes
  315.     Display *    /* dpy */
  316. #endif
  317. );
  318.  
  319. /***====================================================================***/
  320.  
  321. #ifdef _XKBGEOM_H_
  322.  
  323. #define    XkbDW_Unknown    0
  324. #define    XkbDW_Doodad    1
  325. #define    XkbDW_Section    2
  326. typedef struct _XkbDrawable {
  327.     int        type;
  328.     int        priority;
  329.     union {
  330.         XkbDoodadPtr    doodad;
  331.         XkbSectionPtr    section;
  332.     } u;
  333.     struct _XkbDrawable *    next;
  334. } XkbDrawableRec,*XkbDrawablePtr; 
  335.  
  336. extern    XkbDrawablePtr
  337. XkbGetOrderedDrawables(
  338. #if NeedFunctionPrototypes
  339.     XkbGeometryPtr    /* geom */,
  340.     XkbSectionPtr    /* section */
  341. #endif
  342. );
  343.  
  344. extern    void
  345. XkbFreeOrderedDrawables(
  346. #if NeedFunctionPrototypes
  347.     XkbDrawablePtr    /* draw */
  348. #endif
  349. );
  350.  
  351. #endif
  352.  
  353. /***====================================================================***/
  354.  
  355. extern    unsigned    XkbConvertGetByNameComponents(
  356. #if NeedFunctionPrototypes
  357.     Bool        /* toXkm */,
  358.     unsigned         /* orig */
  359. #endif
  360. );
  361.  
  362. extern    unsigned    XkbConvertXkbComponents(
  363. #if NeedFunctionPrototypes
  364.     Bool        /* toXkm */,
  365.     unsigned         /* orig */
  366. #endif
  367. );
  368.  
  369. extern    Bool    XkbDetermineFileType(
  370. #if NeedFunctionPrototypes
  371.     XkbFileInfo *    /* xkb */,
  372.     int            /* format */,
  373.     int *        /* opts_missing */
  374. #endif
  375. );
  376.  
  377. extern    Bool    XkbNameMatchesPattern(
  378. #if NeedFunctionPrototypes
  379.     char *        /* name */,
  380.     char *        /* pattern */
  381. #endif
  382. );
  383.  
  384. /***====================================================================***/
  385.  
  386. extern    Bool    XkbWriteXKBKeycodes(
  387. #if NeedFunctionPrototypes
  388.     FILE *        /* file */,
  389.     XkbFileInfo *    /* result */,
  390.     Bool        /* topLevel */,
  391.     Bool        /* showImplicit */,
  392.     XkbFileAddOnFunc    /* addOn */,
  393.     void *        /* priv */
  394. #endif
  395. );
  396.  
  397. extern    Bool    XkbWriteXKBKeyTypes(
  398. #if NeedFunctionPrototypes
  399.     FILE *        /* file */,
  400.     XkbFileInfo *    /* result */,
  401.     Bool        /* topLevel */,
  402.     Bool        /* showImplicit */,
  403.     XkbFileAddOnFunc    /* addOn */,
  404.     void *        /* priv */
  405. #endif
  406. );
  407.  
  408. extern    Bool    XkbWriteXKBCompatMap(
  409. #if NeedFunctionPrototypes
  410.     FILE *        /* file */,
  411.     XkbFileInfo *    /* result */,
  412.     Bool        /* topLevel */,
  413.     Bool        /* showImplicit */,
  414.     XkbFileAddOnFunc    /* addOn */,
  415.     void *        /* priv */
  416. #endif
  417. );
  418.  
  419. extern    Bool    XkbWriteXKBSymbols(
  420. #if NeedFunctionPrototypes
  421.     FILE *        /* file */,
  422.     XkbFileInfo *    /* result */,
  423.     Bool        /* topLevel */,
  424.     Bool        /* showImplicit */,
  425.     XkbFileAddOnFunc    /* addOn */,
  426.     void *        /* priv */
  427. #endif
  428. );
  429.  
  430. extern    Bool    XkbWriteXKBGeometry(
  431. #if NeedFunctionPrototypes
  432.     FILE *        /* file */,
  433.     XkbFileInfo *    /* result */,
  434.     Bool        /* topLevel */,
  435.     Bool        /* showImplicit */,
  436.     XkbFileAddOnFunc    /* addOn */,
  437.     void *        /* priv */
  438. #endif
  439. );
  440.  
  441. extern    Bool    XkbWriteXKBSemantics(
  442. #if NeedFunctionPrototypes
  443.     FILE *        /* file */,
  444.     XkbFileInfo *    /* result */,
  445.     Bool        /* topLevel */,
  446.     Bool        /* showImplicit */,
  447.     XkbFileAddOnFunc    /* addOn */,
  448.     void *        /* priv */
  449. #endif
  450. );
  451.  
  452. extern    Bool    XkbWriteXKBLayout(
  453. #if NeedFunctionPrototypes
  454.     FILE *        /* file */,
  455.     XkbFileInfo *    /* result */,
  456.     Bool        /* topLevel */,
  457.     Bool        /* showImplicit */,
  458.     XkbFileAddOnFunc    /* addOn */,
  459.     void *        /* priv */
  460. #endif
  461. );
  462.  
  463. extern    Bool    XkbWriteXKBKeymap(
  464. #if NeedFunctionPrototypes
  465.     FILE *        /* file */,
  466.     XkbFileInfo *    /* result */,
  467.     Bool        /* topLevel */,
  468.     Bool        /* showImplicit */,
  469.     XkbFileAddOnFunc    /* addOn */,
  470.     void *        /* priv */
  471. #endif
  472. );
  473.  
  474. extern    Bool    XkbWriteXKBFile(
  475. #if NeedFunctionPrototypes
  476.     FILE *        /* file */,
  477.     XkbFileInfo *    /* result */,
  478.     Bool        /* showImplicit */,
  479.     XkbFileAddOnFunc    /* addOn */,
  480.     void *        /* priv */
  481. #endif
  482. );
  483.  
  484. extern    Bool    XkbWriteCFile(
  485. #if NeedFunctionPrototypes
  486.     FILE *        /* file */,
  487.     char *        /* name */,
  488.     XkbFileInfo *    /* info */
  489. #endif
  490. );
  491.  
  492. extern    Bool    XkbWriteXKMFile(
  493. #if NeedFunctionPrototypes
  494.     FILE *        /* file */,
  495.     XkbFileInfo *    /* result */
  496. #endif
  497. );
  498.  
  499. extern    Bool    XkbWriteToServer(
  500. #if NeedFunctionPrototypes
  501.     XkbFileInfo *    /* result */
  502. #endif
  503. );
  504.  
  505. extern    void    XkbEnsureSafeMapName(
  506. #if NeedFunctionPrototypes
  507.     char *        /* name */
  508. #endif
  509. );
  510.  
  511. extern    Bool    XkbWriteXKBKeymapForNames(
  512. #if NeedFunctionPrototypes
  513.     FILE *            /* file */,
  514.     XkbComponentNamesPtr    /* names */,
  515.     Display *            /* dpy */,
  516.     XkbDescPtr            /* xkb */,
  517.     unsigned            /* want */,
  518.     unsigned            /* need */
  519. #endif
  520. );
  521.  
  522. /***====================================================================***/
  523.  
  524. extern Bool    XkmProbe(
  525. #if NeedFunctionPrototypes
  526.     FILE *        /* file */
  527. #endif
  528. );
  529.  
  530. extern unsigned XkbReadFromServer(
  531. #if NeedFunctionPrototypes
  532.     Display *        /* dpy */,
  533.     unsigned        /* need */,
  534.     unsigned        /* want */,
  535.     XkbFileInfo *    /* result */
  536. #endif
  537. );
  538.  
  539. extern unsigned    XkmReadFile(
  540. #if NeedFunctionPrototypes
  541.     FILE *        /* file */,
  542.     unsigned        /* need */,
  543.     unsigned        /* want */,
  544.     XkbFileInfo *    /* result */
  545. #endif
  546. );
  547.  
  548. #ifdef _XKMFORMAT_H_
  549.  
  550. extern Bool    XkmReadTOC(
  551. #if NeedFunctionPrototypes
  552.     FILE *              /* file */,
  553.     xkmFileInfo *       /* file_info */,
  554.     int                 /* max_toc */,
  555.     xkmSectionInfo *    /* toc */
  556. #endif
  557. );
  558.  
  559. extern xkmSectionInfo *XkmFindTOCEntry(
  560. #if NeedFunctionPrototypes
  561.     xkmFileInfo *       /* finfo */,
  562.     xkmSectionInfo *    /* toc */,
  563.     unsigned            /* type */
  564. #endif
  565. );
  566.  
  567. extern Bool    XkmReadFileSection(
  568. #if NeedFunctionPrototypes
  569.     FILE *              /* file */,
  570.     xkmSectionInfo *    /* toc */,
  571.     XkbFileInfo *       /* result */,
  572.     unsigned *          /* loaded_rtrn */
  573. #endif
  574. );
  575.  
  576. extern char *    XkmReadFileSectionName(
  577. #if NeedFunctionPrototypes
  578.     FILE *        /* file */,
  579.     xkmSectionInfo *    /* toc */
  580. #endif
  581. );
  582.  
  583. #endif /* _XKMFORMAT_H  */
  584.  
  585. _XFUNCPROTOEND
  586.  
  587. #endif /* _XKBFILE_H_ */
  588.