1 /************************************************************
2 * Copyright (c) 1994 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.
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.
25 ********************************************************/
28 * Copyright © 2012 Ran Benita <ran234@gmail.com>
30 * Permission is hereby granted, free of charge, to any person obtaining a
31 * copy of this software and associated documentation files (the "Software"),
32 * to deal in the Software without restriction, including without limitation
33 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
34 * and/or sell copies of the Software, and to permit persons to whom the
35 * Software is furnished to do so, subject to the following conditions:
37 * The above copyright notice and this permission notice (including the next
38 * paragraph) shall be included in all copies or substantial portions of the
41 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
42 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
43 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
44 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
45 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
46 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
47 * DEALINGS IN THE SOFTWARE.
54 /* Component files, by order of compilation. */
55 FILE_TYPE_KEYCODES = 0,
58 FILE_TYPE_SYMBOLS = 3,
59 /* Geometry is not compiled any more. */
60 FILE_TYPE_GEOMETRY = 4,
62 /* A top level file which includes the above files. */
65 /* File types which must be found in a keymap file. */
66 #define FIRST_KEYMAP_FILE_TYPE FILE_TYPE_KEYCODES
67 #define LAST_KEYMAP_FILE_TYPE FILE_TYPE_SYMBOLS
69 /* This one doesn't mix with the others, but useful here as well. */
72 _FILE_TYPE_NUM_ENTRIES
94 enum expr_value_type {
95 EXPR_TYPE_UNKNOWN = 0,
103 _EXPR_TYPE_NUM_VALUES
135 xkb_file_type_to_string(enum xkb_file_type type);
138 stmt_type_to_string(enum stmt_type type);
141 expr_op_type_to_string(enum expr_op_type type);
144 expr_value_type_to_string(enum expr_value_type type);
146 typedef struct _ParseCommon {
148 struct _ParseCommon *next;
151 typedef struct _IncludeStmt {
153 enum merge_mode merge;
158 struct _IncludeStmt *next_incl;
161 typedef struct _Expr {
163 enum expr_op_type op;
164 enum expr_value_type value_type;
185 darray(int) symsMapIndex;
186 darray(unsigned int) symsNumEntries;
192 char keyName[XKB_KEY_NAME_LENGTH];
196 typedef struct _VarDef {
198 enum merge_mode merge;
203 typedef struct _VModDef {
205 enum merge_mode merge;
210 typedef struct _KeycodeDef {
212 enum merge_mode merge;
213 char name[XKB_KEY_NAME_LENGTH];
217 typedef struct _KeyAliasDef {
219 enum merge_mode merge;
220 char alias[XKB_KEY_NAME_LENGTH];
221 char real[XKB_KEY_NAME_LENGTH];
224 typedef struct _KeyTypeDef {
226 enum merge_mode merge;
231 typedef struct _SymbolsDef {
233 enum merge_mode merge;
234 char keyName[XKB_KEY_NAME_LENGTH];
238 typedef struct _ModMapDef {
240 enum merge_mode merge;
245 typedef struct _GroupCompatDef {
247 enum merge_mode merge;
252 typedef struct _InterpDef {
254 enum merge_mode merge;
260 typedef struct _IndicatorNameDef {
262 enum merge_mode merge;
268 typedef struct _IndicatorMapDef {
270 enum merge_mode merge;
276 MAP_IS_DEFAULT = (1 << 0),
277 MAP_IS_PARTIAL = (1 << 1),
278 MAP_IS_HIDDEN = (1 << 2),
279 MAP_HAS_ALPHANUMERIC = (1 << 3),
280 MAP_HAS_MODIFIER = (1 << 4),
281 MAP_HAS_KEYPAD = (1 << 5),
282 MAP_HAS_FN = (1 << 6),
283 MAP_IS_ALTGR = (1 << 7),
286 typedef struct _XkbFile {
288 enum xkb_file_type file_type;
293 enum xkb_map_flags flags;