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,
105 _EXPR_TYPE_NUM_VALUES
137 xkb_file_type_to_string(enum xkb_file_type type);
140 stmt_type_to_string(enum stmt_type type);
143 expr_op_type_to_string(enum expr_op_type type);
146 expr_value_type_to_string(enum expr_value_type type);
148 typedef struct _ParseCommon {
149 struct _ParseCommon *next;
153 typedef struct _IncludeStmt {
155 enum merge_mode merge;
160 struct _IncludeStmt *next_incl;
165 enum expr_op_type op;
166 enum expr_value_type value_type;
169 typedef union ExprDef ExprDef;
193 /* We don't support floats, but we still represnt them in the AST, in
194 * order to provide proper error messages. */
239 darray(xkb_keysym_t) syms;
240 darray(unsigned int) symsMapIndex;
241 darray(unsigned int) symsNumEntries;
251 ExprKeyName key_name;
254 ExprFieldRef field_ref;
255 ExprArrayRef array_ref;
257 ExprActionList actions;
258 ExprKeysymList keysym_list;
263 enum merge_mode merge;
270 enum merge_mode merge;
277 enum merge_mode merge;
284 enum merge_mode merge;
291 enum merge_mode merge;
298 enum merge_mode merge;
305 enum merge_mode merge;
312 enum merge_mode merge;
319 enum merge_mode merge;
327 enum merge_mode merge;
335 enum merge_mode merge;
341 MAP_IS_DEFAULT = (1 << 0),
342 MAP_IS_PARTIAL = (1 << 1),
343 MAP_IS_HIDDEN = (1 << 2),
344 MAP_HAS_ALPHANUMERIC = (1 << 3),
345 MAP_HAS_MODIFIER = (1 << 4),
346 MAP_HAS_KEYPAD = (1 << 5),
347 MAP_HAS_FN = (1 << 6),
348 MAP_IS_ALTGR = (1 << 7),
353 enum xkb_file_type file_type;
356 enum xkb_map_flags flags;