| 1 | /************************************************************ |
| 2 | Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc. |
| 3 | |
| 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 | |
| 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 | ********************************************************/ |
| 26 | |
| 27 | #ifndef _XKBFILE_H_ |
| 28 | #define _XKBFILE_H_ 1 |
| 29 | |
| 30 | #include "xkbstr.h" |
| 31 | |
| 32 | /***====================================================================***/ |
| 33 | |
| 34 | #define XkbXKMFile 0 |
| 35 | #define XkbCFile 1 |
| 36 | #define XkbXKBFile 2 |
| 37 | #define XkbMessage 3 |
| 38 | |
| 39 | #define XkbMapDefined (1<<0) |
| 40 | #define XkbStateDefined (1<<1) |
| 41 | |
| 42 | typedef void (*XkbFileAddOnFunc) (FILE * /* file */ , |
| 43 | XkbDescPtr /* result */ , |
| 44 | Bool /* topLevel */ , |
| 45 | Bool /* showImplicit */ , |
| 46 | int /* fileSection */ , |
| 47 | void * /* priv */ |
| 48 | ); |
| 49 | |
| 50 | /***====================================================================***/ |
| 51 | |
| 52 | #define _XkbSuccess 0 |
| 53 | #define _XkbErrMissingNames 1 |
| 54 | #define _XkbErrMissingTypes 2 |
| 55 | #define _XkbErrMissingReqTypes 3 |
| 56 | #define _XkbErrMissingSymbols 4 |
| 57 | #define _XkbErrMissingVMods 5 |
| 58 | #define _XkbErrMissingIndicators 6 |
| 59 | #define _XkbErrMissingCompatMap 7 |
| 60 | #define _XkbErrMissingSymInterps 8 |
| 61 | #define _XkbErrMissingGeometry 9 |
| 62 | #define _XkbErrIllegalDoodad 10 |
| 63 | #define _XkbErrIllegalTOCType 11 |
| 64 | #define _XkbErrIllegalContents 12 |
| 65 | #define _XkbErrEmptyFile 13 |
| 66 | #define _XkbErrFileNotFound 14 |
| 67 | #define _XkbErrFileCannotOpen 15 |
| 68 | #define _XkbErrBadValue 16 |
| 69 | #define _XkbErrBadMatch 17 |
| 70 | #define _XkbErrBadTypeName 18 |
| 71 | #define _XkbErrBadTypeWidth 19 |
| 72 | #define _XkbErrBadFileType 20 |
| 73 | #define _XkbErrBadFileVersion 21 |
| 74 | #define _XkbErrBadFileFormat 22 |
| 75 | #define _XkbErrBadAlloc 23 |
| 76 | #define _XkbErrBadLength 24 |
| 77 | #define _XkbErrXReqFailure 25 |
| 78 | #define _XkbErrBadImplementation 26 |
| 79 | |
| 80 | /***====================================================================***/ |
| 81 | |
| 82 | _XFUNCPROTOBEGIN |
| 83 | |
| 84 | extern _X_EXPORT char *XkbIndentText(unsigned /* size */ |
| 85 | ); |
| 86 | |
| 87 | extern _X_EXPORT char *XkbAtomText(Atom /* atm */ , |
| 88 | unsigned /* format */ |
| 89 | ); |
| 90 | |
| 91 | extern _X_EXPORT char *XkbKeysymText(KeySym /* sym */ , |
| 92 | unsigned /* format */ |
| 93 | ); |
| 94 | |
| 95 | extern _X_EXPORT char *XkbStringText(char * /* str */ , |
| 96 | unsigned /* format */ |
| 97 | ); |
| 98 | |
| 99 | extern _X_EXPORT char *XkbKeyNameText(char * /* name */ , |
| 100 | unsigned /* format */ |
| 101 | ); |
| 102 | |
| 103 | extern _X_EXPORT char *XkbModIndexText(unsigned /* ndx */ , |
| 104 | unsigned /* format */ |
| 105 | ); |
| 106 | |
| 107 | extern _X_EXPORT char *XkbModMaskText(unsigned /* mask */ , |
| 108 | unsigned /* format */ |
| 109 | ); |
| 110 | |
| 111 | extern _X_EXPORT char *XkbVModIndexText(XkbDescPtr /* xkb */ , |
| 112 | unsigned /* ndx */ , |
| 113 | unsigned /* format */ |
| 114 | ); |
| 115 | |
| 116 | extern _X_EXPORT char *XkbVModMaskText(XkbDescPtr /* xkb */ , |
| 117 | unsigned /* modMask */ , |
| 118 | unsigned /* mask */ , |
| 119 | unsigned /* format */ |
| 120 | ); |
| 121 | |
| 122 | extern _X_EXPORT char *XkbConfigText(unsigned /* config */ , |
| 123 | unsigned /* format */ |
| 124 | ); |
| 125 | |
| 126 | extern _X_EXPORT const char *XkbSIMatchText(unsigned /* type */ , |
| 127 | unsigned /* format */ |
| 128 | ); |
| 129 | |
| 130 | extern _X_EXPORT char *XkbIMWhichStateMaskText(unsigned /* use_which */ , |
| 131 | unsigned /* format */ |
| 132 | ); |
| 133 | |
| 134 | extern _X_EXPORT char *XkbControlsMaskText(unsigned /* ctrls */ , |
| 135 | unsigned /* format */ |
| 136 | ); |
| 137 | |
| 138 | extern _X_EXPORT char *XkbGeomFPText(int /* val */ , |
| 139 | unsigned /* format */ |
| 140 | ); |
| 141 | |
| 142 | extern _X_EXPORT char *XkbDoodadTypeText(unsigned /* type */ , |
| 143 | unsigned /* format */ |
| 144 | ); |
| 145 | |
| 146 | extern _X_EXPORT const char *XkbActionTypeText(unsigned /* type */ , |
| 147 | unsigned /* format */ |
| 148 | ); |
| 149 | |
| 150 | extern _X_EXPORT char *XkbActionText(XkbDescPtr /* xkb */ , |
| 151 | XkbAction * /* action */ , |
| 152 | unsigned /* format */ |
| 153 | ); |
| 154 | |
| 155 | extern _X_EXPORT char *XkbBehaviorText(XkbDescPtr /* xkb */ , |
| 156 | XkbBehavior * /* behavior */ , |
| 157 | unsigned /* format */ |
| 158 | ); |
| 159 | |
| 160 | /***====================================================================***/ |
| 161 | |
| 162 | #define _XkbKSLower (1<<0) |
| 163 | #define _XkbKSUpper (1<<1) |
| 164 | |
| 165 | #define XkbKSIsLower(k) (_XkbKSCheckCase(k)&_XkbKSLower) |
| 166 | #define XkbKSIsUpper(k) (_XkbKSCheckCase(k)&_XkbKSUpper) |
| 167 | #define XkbKSIsKeypad(k) (((k)>=XK_KP_Space)&&((k)<=XK_KP_Equal)) |
| 168 | #define XkbKSIsDeadKey(k) \ |
| 169 | (((k)>=XK_dead_grave)&&((k)<=XK_dead_semivoiced_sound)) |
| 170 | |
| 171 | extern _X_EXPORT unsigned _XkbKSCheckCase(KeySym /* sym */ |
| 172 | ); |
| 173 | |
| 174 | extern _X_EXPORT int XkbFindKeycodeByName(XkbDescPtr /* xkb */ , |
| 175 | char * /* name */ , |
| 176 | Bool /* use_aliases */ |
| 177 | ); |
| 178 | |
| 179 | /***====================================================================***/ |
| 180 | |
| 181 | extern _X_EXPORT Atom XkbInternAtom(char * /* name */ , |
| 182 | Bool /* onlyIfExists */ |
| 183 | ); |
| 184 | |
| 185 | /***====================================================================***/ |
| 186 | |
| 187 | #ifdef _XKBGEOM_H_ |
| 188 | |
| 189 | #define XkbDW_Unknown 0 |
| 190 | #define XkbDW_Doodad 1 |
| 191 | #define XkbDW_Section 2 |
| 192 | typedef struct _XkbDrawable { |
| 193 | int type; |
| 194 | int priority; |
| 195 | union { |
| 196 | XkbDoodadPtr doodad; |
| 197 | XkbSectionPtr section; |
| 198 | } u; |
| 199 | struct _XkbDrawable *next; |
| 200 | } XkbDrawableRec, *XkbDrawablePtr; |
| 201 | |
| 202 | #endif |
| 203 | |
| 204 | /***====================================================================***/ |
| 205 | |
| 206 | extern _X_EXPORT unsigned XkbConvertGetByNameComponents(Bool /* toXkm */ , |
| 207 | unsigned /* orig */ |
| 208 | ); |
| 209 | |
| 210 | extern _X_EXPORT Bool XkbNameMatchesPattern(char * /* name */ , |
| 211 | char * /* pattern */ |
| 212 | ); |
| 213 | |
| 214 | /***====================================================================***/ |
| 215 | |
| 216 | extern _X_EXPORT Bool XkbWriteXKBKeycodes(FILE * /* file */ , |
| 217 | XkbDescPtr /* result */ , |
| 218 | Bool /* topLevel */ , |
| 219 | Bool /* showImplicit */ , |
| 220 | XkbFileAddOnFunc /* addOn */ , |
| 221 | void * /* priv */ |
| 222 | ); |
| 223 | |
| 224 | extern _X_EXPORT Bool XkbWriteXKBKeyTypes(FILE * /* file */ , |
| 225 | XkbDescPtr /* result */ , |
| 226 | Bool /* topLevel */ , |
| 227 | Bool /* showImplicit */ , |
| 228 | XkbFileAddOnFunc /* addOn */ , |
| 229 | void * /* priv */ |
| 230 | ); |
| 231 | |
| 232 | extern _X_EXPORT Bool XkbWriteXKBCompatMap(FILE * /* file */ , |
| 233 | XkbDescPtr /* result */ , |
| 234 | Bool /* topLevel */ , |
| 235 | Bool /* showImplicit */ , |
| 236 | XkbFileAddOnFunc /* addOn */ , |
| 237 | void * /* priv */ |
| 238 | ); |
| 239 | |
| 240 | extern _X_EXPORT Bool XkbWriteXKBSymbols(FILE * /* file */ , |
| 241 | XkbDescPtr /* result */ , |
| 242 | Bool /* topLevel */ , |
| 243 | Bool /* showImplicit */ , |
| 244 | XkbFileAddOnFunc /* addOn */ , |
| 245 | void * /* priv */ |
| 246 | ); |
| 247 | |
| 248 | extern _X_EXPORT Bool XkbWriteXKBGeometry(FILE * /* file */ , |
| 249 | XkbDescPtr /* result */ , |
| 250 | Bool /* topLevel */ , |
| 251 | Bool /* showImplicit */ , |
| 252 | XkbFileAddOnFunc /* addOn */ , |
| 253 | void * /* priv */ |
| 254 | ); |
| 255 | |
| 256 | extern _X_EXPORT Bool XkbWriteXKBKeymapForNames(FILE * /* file */ , |
| 257 | XkbComponentNamesPtr /* names */ |
| 258 | , |
| 259 | XkbDescPtr /* xkb */ , |
| 260 | unsigned /* want */ , |
| 261 | unsigned /* need */ |
| 262 | ); |
| 263 | |
| 264 | /***====================================================================***/ |
| 265 | |
| 266 | extern _X_EXPORT Bool XkmProbe(FILE * /* file */ |
| 267 | ); |
| 268 | |
| 269 | extern _X_EXPORT unsigned XkmReadFile(FILE * /* file */ , |
| 270 | unsigned /* need */ , |
| 271 | unsigned /* want */ , |
| 272 | XkbDescPtr * /* result */ |
| 273 | ); |
| 274 | |
| 275 | _XFUNCPROTOEND |
| 276 | #endif /* _XKBFILE_H_ */ |