2 * Copyright © 2012 Intel Corporation
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
23 * Author: Daniel Stone <daniel@fooishbar.org>
32 /* Don't use compat names in internal code. */
33 #define _XKBCOMMON_COMPAT_H
34 #include "xkbcommon/xkbcommon.h"
35 #include "xkbcommon/xkbcommon-compose.h"
37 #define ARRAY_SIZE(arr) ((sizeof(arr) / sizeof(*(arr))))
39 /* Fields that are printed in the interactive tools. */
40 enum print_state_fields {
41 #ifdef ENABLE_PRIVATE_APIS
42 PRINT_MODMAPS = (1u << 1),
44 PRINT_LAYOUT = (1u << 2),
45 PRINT_UNICODE = (1u << 3),
46 PRINT_ALL_FIELDS = ((PRINT_UNICODE << 1) - 1),
48 * Fields that can be hidden with the option --short.
49 * NOTE: If this value is modified, remember to update the documentation of
50 * the --short option in the corresponding tools.
52 PRINT_VERBOSE_FIELDS = (PRINT_LAYOUT | PRINT_UNICODE)
54 typedef uint32_t print_state_fields_mask_t;
56 #ifdef ENABLE_PRIVATE_APIS
58 print_keymap_modmaps(struct xkb_keymap *keymap);
60 print_keys_modmaps(struct xkb_keymap *keymap);
64 tools_print_keycode_state(struct xkb_state *state,
65 struct xkb_compose_state *compose_state,
66 xkb_keycode_t keycode,
67 enum xkb_consumed_mode consumed_mode,
68 print_state_fields_mask_t fields);
71 tools_print_state_changes(enum xkb_state_component changed);
74 tools_disable_stdin_echo(void);
77 tools_enable_stdin_echo(void);
80 tools_exec_command(const char *prefix, int argc, char **argv);
83 #define setenv(varname, value, overwrite) _putenv_s((varname), (value))
84 #define unsetenv(varname) _putenv_s(varname, "")