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 {
147 struct _ParseCommon *next;
151 typedef struct _IncludeStmt {
153 enum merge_mode merge;
158 struct _IncludeStmt *next_incl;
163 enum expr_op_type op;
164 enum expr_value_type value_type;
167 typedef union ExprDef ExprDef;
226 darray(xkb_keysym_t) syms;
227 darray(unsigned int) symsMapIndex;
228 darray(unsigned int) symsNumEntries;
233 /* Maybe someday we can use C11 anonymous struct for ExprCommon here. */
239 ExprKeyName key_name;
242 ExprFieldRef field_ref;
243 ExprArrayRef array_ref;
245 ExprKeysymList keysym_list;
250 enum merge_mode merge;
257 enum merge_mode merge;
264 enum merge_mode merge;
271 enum merge_mode merge;
278 enum merge_mode merge;
285 enum merge_mode merge;
292 enum merge_mode merge;
299 enum merge_mode merge;
306 enum merge_mode merge;
314 enum merge_mode merge;
322 enum merge_mode merge;
328 MAP_IS_DEFAULT = (1 << 0),
329 MAP_IS_PARTIAL = (1 << 1),
330 MAP_IS_HIDDEN = (1 << 2),
331 MAP_HAS_ALPHANUMERIC = (1 << 3),
332 MAP_HAS_MODIFIER = (1 << 4),
333 MAP_HAS_KEYPAD = (1 << 5),
334 MAP_HAS_FN = (1 << 6),
335 MAP_IS_ALTGR = (1 << 7),
340 enum xkb_file_type file_type;
344 enum xkb_map_flags flags;