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 | /***====================================================================***/
|
---|
31 |
|
---|
32 | #define XkbXKMFile 0
|
---|
33 | #define XkbCFile 1
|
---|
34 | #define XkbXKBFile 2
|
---|
35 | #define XkbMessage 3
|
---|
36 |
|
---|
37 | #define XkbMapDefined (1<<0)
|
---|
38 | #define XkbStateDefined (1<<1)
|
---|
39 |
|
---|
40 | typedef void (*XkbFileAddOnFunc)(
|
---|
41 | FILE * /* file */,
|
---|
42 | XkbDescPtr /* result */,
|
---|
43 | Bool /* topLevel */,
|
---|
44 | Bool /* showImplicit */,
|
---|
45 | int /* fileSection */,
|
---|
46 | void * /* priv */
|
---|
47 | );
|
---|
48 |
|
---|
49 | /***====================================================================***/
|
---|
50 |
|
---|
51 | #define _XkbSuccess 0
|
---|
52 | #define _XkbErrMissingNames 1
|
---|
53 | #define _XkbErrMissingTypes 2
|
---|
54 | #define _XkbErrMissingReqTypes 3
|
---|
55 | #define _XkbErrMissingSymbols 4
|
---|
56 | #define _XkbErrMissingVMods 5
|
---|
57 | #define _XkbErrMissingIndicators 6
|
---|
58 | #define _XkbErrMissingCompatMap 7
|
---|
59 | #define _XkbErrMissingSymInterps 8
|
---|
60 | #define _XkbErrMissingGeometry 9
|
---|
61 | #define _XkbErrIllegalDoodad 10
|
---|
62 | #define _XkbErrIllegalTOCType 11
|
---|
63 | #define _XkbErrIllegalContents 12
|
---|
64 | #define _XkbErrEmptyFile 13
|
---|
65 | #define _XkbErrFileNotFound 14
|
---|
66 | #define _XkbErrFileCannotOpen 15
|
---|
67 | #define _XkbErrBadValue 16
|
---|
68 | #define _XkbErrBadMatch 17
|
---|
69 | #define _XkbErrBadTypeName 18
|
---|
70 | #define _XkbErrBadTypeWidth 19
|
---|
71 | #define _XkbErrBadFileType 20
|
---|
72 | #define _XkbErrBadFileVersion 21
|
---|
73 | #define _XkbErrBadFileFormat 22
|
---|
74 | #define _XkbErrBadAlloc 23
|
---|
75 | #define _XkbErrBadLength 24
|
---|
76 | #define _XkbErrXReqFailure 25
|
---|
77 | #define _XkbErrBadImplementation 26
|
---|
78 |
|
---|
79 | extern char * _XkbErrMessages[];
|
---|
80 | extern unsigned _XkbErrCode;
|
---|
81 | extern char * _XkbErrLocation;
|
---|
82 | extern unsigned _XkbErrData;
|
---|
83 |
|
---|
84 | /***====================================================================***/
|
---|
85 |
|
---|
86 | _XFUNCPROTOBEGIN
|
---|
87 |
|
---|
88 | extern char * XkbIndentText(
|
---|
89 | unsigned /* size */
|
---|
90 | );
|
---|
91 |
|
---|
92 | extern char * XkbAtomText(
|
---|
93 | Atom /* atm */,
|
---|
94 | unsigned /* format */
|
---|
95 | );
|
---|
96 |
|
---|
97 | extern char * XkbKeysymText(
|
---|
98 | KeySym /* sym */,
|
---|
99 | unsigned /* format */
|
---|
100 | );
|
---|
101 |
|
---|
102 | extern char * XkbStringText(
|
---|
103 | char * /* str */,
|
---|
104 | unsigned /* format */
|
---|
105 | );
|
---|
106 |
|
---|
107 | extern char * XkbKeyNameText(
|
---|
108 | char * /* name */,
|
---|
109 | unsigned /* format */
|
---|
110 | );
|
---|
111 |
|
---|
112 | extern char *
|
---|
113 | XkbModIndexText(
|
---|
114 | unsigned /* ndx */,
|
---|
115 | unsigned /* format */
|
---|
116 | );
|
---|
117 |
|
---|
118 | extern char *
|
---|
119 | XkbModMaskText(
|
---|
120 | unsigned /* mask */,
|
---|
121 | unsigned /* format */
|
---|
122 | );
|
---|
123 |
|
---|
124 | extern char * XkbVModIndexText(
|
---|
125 | XkbDescPtr /* xkb */,
|
---|
126 | unsigned /* ndx */,
|
---|
127 | unsigned /* format */
|
---|
128 | );
|
---|
129 |
|
---|
130 | extern char * XkbVModMaskText(
|
---|
131 | XkbDescPtr /* xkb */,
|
---|
132 | unsigned /* modMask */,
|
---|
133 | unsigned /* mask */,
|
---|
134 | unsigned /* format */
|
---|
135 | );
|
---|
136 |
|
---|
137 | extern char * XkbConfigText(
|
---|
138 | unsigned /* config */,
|
---|
139 | unsigned /* format */
|
---|
140 | );
|
---|
141 |
|
---|
142 | extern char * XkbSIMatchText(
|
---|
143 | unsigned /* type */,
|
---|
144 | unsigned /* format */
|
---|
145 | );
|
---|
146 |
|
---|
147 | extern char * XkbIMWhichStateMaskText(
|
---|
148 | unsigned /* use_which */,
|
---|
149 | unsigned /* format */
|
---|
150 | );
|
---|
151 |
|
---|
152 | extern char * XkbAccessXDetailText(
|
---|
153 | unsigned /* state */,
|
---|
154 | unsigned /* format */
|
---|
155 | );
|
---|
156 |
|
---|
157 | extern char * XkbNKNDetailMaskText(
|
---|
158 | unsigned /* detail */,
|
---|
159 | unsigned /* format */
|
---|
160 | );
|
---|
161 |
|
---|
162 | extern char * XkbControlsMaskText(
|
---|
163 | unsigned /* ctrls */,
|
---|
164 | unsigned /* format */
|
---|
165 | );
|
---|
166 |
|
---|
167 | extern char * XkbGeomFPText(
|
---|
168 | int /* val */,
|
---|
169 | unsigned /* format */
|
---|
170 | );
|
---|
171 |
|
---|
172 | extern char * XkbDoodadTypeText(
|
---|
173 | unsigned /* type */,
|
---|
174 | unsigned /* format */
|
---|
175 | );
|
---|
176 |
|
---|
177 | extern char * XkbActionTypeText(
|
---|
178 | unsigned /* type */,
|
---|
179 | unsigned /* format */
|
---|
180 | );
|
---|
181 |
|
---|
182 | extern char * XkbActionText(
|
---|
183 | XkbDescPtr /* xkb */,
|
---|
184 | XkbAction * /* action */,
|
---|
185 | unsigned /* format */
|
---|
186 | );
|
---|
187 |
|
---|
188 | extern char * XkbBehaviorText(
|
---|
189 | XkbDescPtr /* xkb */,
|
---|
190 | XkbBehavior * /* behavior */,
|
---|
191 | unsigned /* format */
|
---|
192 | );
|
---|
193 |
|
---|
194 | /***====================================================================***/
|
---|
195 |
|
---|
196 | #define _XkbKSLower (1<<0)
|
---|
197 | #define _XkbKSUpper (1<<1)
|
---|
198 |
|
---|
199 | #define XkbKSIsLower(k) (_XkbKSCheckCase(k)&_XkbKSLower)
|
---|
200 | #define XkbKSIsUpper(k) (_XkbKSCheckCase(k)&_XkbKSUpper)
|
---|
201 | #define XkbKSIsKeypad(k) (((k)>=XK_KP_Space)&&((k)<=XK_KP_Equal))
|
---|
202 | #define XkbKSIsDeadKey(k) \
|
---|
203 | (((k)>=XK_dead_grave)&&((k)<=XK_dead_semivoiced_sound))
|
---|
204 |
|
---|
205 | extern unsigned _XkbKSCheckCase(
|
---|
206 | KeySym /* sym */
|
---|
207 | );
|
---|
208 |
|
---|
209 | extern int XkbFindKeycodeByName(
|
---|
210 | XkbDescPtr /* xkb */,
|
---|
211 | char * /* name */,
|
---|
212 | Bool /* use_aliases */
|
---|
213 | );
|
---|
214 |
|
---|
215 | extern Bool XkbLookupGroupAndLevel(
|
---|
216 | XkbDescPtr /* xkb */,
|
---|
217 | int /* key */,
|
---|
218 | int * /* mods_inout */,
|
---|
219 | int * /* grp_inout */,
|
---|
220 | int * /* lvl_rtrn */
|
---|
221 | );
|
---|
222 |
|
---|
223 | /***====================================================================***/
|
---|
224 |
|
---|
225 | extern Atom XkbInternAtom(
|
---|
226 | char * /* name */,
|
---|
227 | Bool /* onlyIfExists */
|
---|
228 | );
|
---|
229 |
|
---|
230 | extern void XkbInitAtoms(void);
|
---|
231 |
|
---|
232 | /***====================================================================***/
|
---|
233 |
|
---|
234 | #ifdef _XKBGEOM_H_
|
---|
235 |
|
---|
236 | #define XkbDW_Unknown 0
|
---|
237 | #define XkbDW_Doodad 1
|
---|
238 | #define XkbDW_Section 2
|
---|
239 | typedef struct _XkbDrawable {
|
---|
240 | int type;
|
---|
241 | int priority;
|
---|
242 | union {
|
---|
243 | XkbDoodadPtr doodad;
|
---|
244 | XkbSectionPtr section;
|
---|
245 | } u;
|
---|
246 | struct _XkbDrawable * next;
|
---|
247 | } XkbDrawableRec,*XkbDrawablePtr;
|
---|
248 |
|
---|
249 | extern XkbDrawablePtr
|
---|
250 | XkbGetOrderedDrawables(
|
---|
251 | XkbGeometryPtr /* geom */,
|
---|
252 | XkbSectionPtr /* section */
|
---|
253 | );
|
---|
254 |
|
---|
255 | extern void
|
---|
256 | XkbFreeOrderedDrawables(
|
---|
257 | XkbDrawablePtr /* draw */
|
---|
258 | );
|
---|
259 |
|
---|
260 | #endif
|
---|
261 |
|
---|
262 | /***====================================================================***/
|
---|
263 |
|
---|
264 | extern unsigned XkbConvertGetByNameComponents(
|
---|
265 | Bool /* toXkm */,
|
---|
266 | unsigned /* orig */
|
---|
267 | );
|
---|
268 |
|
---|
269 | extern unsigned XkbConvertXkbComponents(
|
---|
270 | Bool /* toXkm */,
|
---|
271 | unsigned /* orig */
|
---|
272 | );
|
---|
273 |
|
---|
274 | extern Bool XkbNameMatchesPattern(
|
---|
275 | char * /* name */,
|
---|
276 | char * /* pattern */
|
---|
277 | );
|
---|
278 |
|
---|
279 | /***====================================================================***/
|
---|
280 |
|
---|
281 | extern Bool XkbWriteXKBKeycodes(
|
---|
282 | FILE * /* file */,
|
---|
283 | XkbDescPtr /* result */,
|
---|
284 | Bool /* topLevel */,
|
---|
285 | Bool /* showImplicit */,
|
---|
286 | XkbFileAddOnFunc /* addOn */,
|
---|
287 | void * /* priv */
|
---|
288 | );
|
---|
289 |
|
---|
290 | extern Bool XkbWriteXKBKeyTypes(
|
---|
291 | FILE * /* file */,
|
---|
292 | XkbDescPtr /* result */,
|
---|
293 | Bool /* topLevel */,
|
---|
294 | Bool /* showImplicit */,
|
---|
295 | XkbFileAddOnFunc /* addOn */,
|
---|
296 | void * /* priv */
|
---|
297 | );
|
---|
298 |
|
---|
299 | extern Bool XkbWriteXKBCompatMap(
|
---|
300 | FILE * /* file */,
|
---|
301 | XkbDescPtr /* result */,
|
---|
302 | Bool /* topLevel */,
|
---|
303 | Bool /* showImplicit */,
|
---|
304 | XkbFileAddOnFunc /* addOn */,
|
---|
305 | void * /* priv */
|
---|
306 | );
|
---|
307 |
|
---|
308 | extern Bool XkbWriteXKBSymbols(
|
---|
309 | FILE * /* file */,
|
---|
310 | XkbDescPtr /* result */,
|
---|
311 | Bool /* topLevel */,
|
---|
312 | Bool /* showImplicit */,
|
---|
313 | XkbFileAddOnFunc /* addOn */,
|
---|
314 | void * /* priv */
|
---|
315 | );
|
---|
316 |
|
---|
317 | extern Bool XkbWriteXKBGeometry(
|
---|
318 | FILE * /* file */,
|
---|
319 | XkbDescPtr /* result */,
|
---|
320 | Bool /* topLevel */,
|
---|
321 | Bool /* showImplicit */,
|
---|
322 | XkbFileAddOnFunc /* addOn */,
|
---|
323 | void * /* priv */
|
---|
324 | );
|
---|
325 |
|
---|
326 | extern Bool XkbWriteXKBSemantics(
|
---|
327 | FILE * /* file */,
|
---|
328 | XkbDescPtr /* result */,
|
---|
329 | Bool /* topLevel */,
|
---|
330 | Bool /* showImplicit */,
|
---|
331 | XkbFileAddOnFunc /* addOn */,
|
---|
332 | void * /* priv */
|
---|
333 | );
|
---|
334 |
|
---|
335 | extern Bool XkbWriteXKBLayout(
|
---|
336 | FILE * /* file */,
|
---|
337 | XkbDescPtr /* result */,
|
---|
338 | Bool /* topLevel */,
|
---|
339 | Bool /* showImplicit */,
|
---|
340 | XkbFileAddOnFunc /* addOn */,
|
---|
341 | void * /* priv */
|
---|
342 | );
|
---|
343 |
|
---|
344 | extern Bool XkbWriteXKBKeymap(
|
---|
345 | FILE * /* file */,
|
---|
346 | XkbDescPtr /* result */,
|
---|
347 | Bool /* topLevel */,
|
---|
348 | Bool /* showImplicit */,
|
---|
349 | XkbFileAddOnFunc /* addOn */,
|
---|
350 | void * /* priv */
|
---|
351 | );
|
---|
352 |
|
---|
353 | extern Bool XkbWriteXKBFile(
|
---|
354 | FILE * /* file */,
|
---|
355 | XkbDescPtr /* result */,
|
---|
356 | Bool /* showImplicit */,
|
---|
357 | XkbFileAddOnFunc /* addOn */,
|
---|
358 | void * /* priv */
|
---|
359 | );
|
---|
360 |
|
---|
361 | extern Bool XkbWriteCFile(
|
---|
362 | FILE * /* file */,
|
---|
363 | char * /* name */,
|
---|
364 | XkbDescPtr /* info */
|
---|
365 | );
|
---|
366 |
|
---|
367 | extern Bool XkbWriteXKMFile(
|
---|
368 | FILE * /* file */,
|
---|
369 | XkbDescPtr /* result */
|
---|
370 | );
|
---|
371 |
|
---|
372 | extern Bool XkbWriteToServer(
|
---|
373 | XkbDescPtr /* result */
|
---|
374 | );
|
---|
375 |
|
---|
376 | extern void XkbEnsureSafeMapName(
|
---|
377 | char * /* name */
|
---|
378 | );
|
---|
379 |
|
---|
380 | extern Bool XkbWriteXKBKeymapForNames(
|
---|
381 | FILE * /* file */,
|
---|
382 | XkbComponentNamesPtr /* names */,
|
---|
383 | XkbDescPtr /* xkb */,
|
---|
384 | unsigned /* want */,
|
---|
385 | unsigned /* need */
|
---|
386 | );
|
---|
387 |
|
---|
388 | extern Status XkbMergeFile(
|
---|
389 | XkbDescPtr /* xkb */
|
---|
390 | );
|
---|
391 |
|
---|
392 | /***====================================================================***/
|
---|
393 |
|
---|
394 | extern Bool XkmProbe(
|
---|
395 | FILE * /* file */
|
---|
396 | );
|
---|
397 |
|
---|
398 | extern unsigned XkmReadFile(
|
---|
399 | FILE * /* file */,
|
---|
400 | unsigned /* need */,
|
---|
401 | unsigned /* want */,
|
---|
402 | XkbDescPtr * /* result */
|
---|
403 | );
|
---|
404 |
|
---|
405 | #ifdef _XKMFORMAT_H_
|
---|
406 |
|
---|
407 | extern Bool XkmReadTOC(
|
---|
408 | FILE * /* file */,
|
---|
409 | xkmFileInfo * /* file_info */,
|
---|
410 | int /* max_toc */,
|
---|
411 | xkmSectionInfo * /* toc */
|
---|
412 | );
|
---|
413 |
|
---|
414 | extern xkmSectionInfo *XkmFindTOCEntry(
|
---|
415 | xkmFileInfo * /* finfo */,
|
---|
416 | xkmSectionInfo * /* toc */,
|
---|
417 | unsigned /* type */
|
---|
418 | );
|
---|
419 |
|
---|
420 | extern Bool XkmReadFileSection(
|
---|
421 | FILE * /* file */,
|
---|
422 | xkmSectionInfo * /* toc */,
|
---|
423 | XkbDescPtr /* result */,
|
---|
424 | unsigned * /* loaded_rtrn */
|
---|
425 | );
|
---|
426 |
|
---|
427 | extern char * XkmReadFileSectionName(
|
---|
428 | FILE * /* file */,
|
---|
429 | xkmSectionInfo * /* toc */
|
---|
430 | );
|
---|
431 |
|
---|
432 | #endif /* _XKMFORMAT_H */
|
---|
433 |
|
---|
434 | _XFUNCPROTOEND
|
---|
435 |
|
---|
436 | #endif /* _XKBFILE_H_ */
|
---|