1 | /* |
2 | * Copyright © 2012 Daniel Stone |
3 | * |
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: |
10 | * |
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 |
13 | * Software. |
14 | * |
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. |
22 | * |
23 | * Author: Daniel Stone <daniel@fooishbar.org> |
24 | */ |
25 | |
26 | #ifndef _XKBCOMMON_COMPAT_H |
27 | #define _XKBCOMMON_COMPAT_H |
28 | |
29 | /** |
30 | * Renamed keymap API. |
31 | */ |
32 | #define xkb_group_index_t xkb_layout_index_t |
33 | #define xkb_group_mask_t xkb_layout_mask_t |
34 | #define xkb_map_compile_flags xkb_keymap_compile_flags |
35 | #define XKB_GROUP_INVALID XKB_LAYOUT_INVALID |
36 | |
37 | #define XKB_STATE_DEPRESSED \ |
38 | (XKB_STATE_MODS_DEPRESSED | XKB_STATE_LAYOUT_DEPRESSED) |
39 | #define XKB_STATE_LATCHED \ |
40 | (XKB_STATE_MODS_LATCHED | XKB_STATE_LAYOUT_LATCHED) |
41 | #define XKB_STATE_LOCKED \ |
42 | (XKB_STATE_MODS_LOCKED | XKB_STATE_LAYOUT_LOCKED) |
43 | #define XKB_STATE_EFFECTIVE \ |
44 | (XKB_STATE_DEPRESSED | XKB_STATE_LATCHED | XKB_STATE_LOCKED | \ |
45 | XKB_STATE_MODS_EFFECTIVE | XKB_STATE_LAYOUT_EFFECTIVE) |
46 | |
47 | #define xkb_map_new_from_names(context, names, flags) \ |
48 | xkb_keymap_new_from_names(context, names, flags) |
49 | #define xkb_map_new_from_file(context, file, format, flags) \ |
50 | xkb_keymap_new_from_file(context, file, format, flags) |
51 | #define xkb_map_new_from_string(context, string, format, flags) \ |
52 | xkb_keymap_new_from_string(context, string, format, flags) |
53 | #define xkb_map_get_as_string(keymap) \ |
54 | xkb_keymap_get_as_string(keymap, XKB_KEYMAP_FORMAT_TEXT_V1) |
55 | #define xkb_map_ref(keymap) xkb_keymap_ref(keymap) |
56 | #define xkb_map_unref(keymap) xkb_keymap_unref(keymap) |
57 | |
58 | #define xkb_map_num_mods(keymap) xkb_keymap_num_mods(keymap) |
59 | #define xkb_map_mod_get_name(keymap, idx) xkb_keymap_mod_get_name(keymap, idx) |
60 | #define xkb_map_mod_get_index(keymap, str) xkb_keymap_mod_get_index(keymap, str) |
61 | #define xkb_key_mod_index_is_consumed(state, key, mod) \ |
62 | xkb_state_mod_index_is_consumed(state, key, mod) |
63 | #define xkb_key_mod_mask_remove_consumed(state, key, modmask) \ |
64 | xkb_state_mod_mask_remove_consumed(state, key, modmask) |
65 | |
66 | #define xkb_map_num_groups(keymap) xkb_keymap_num_layouts(keymap) |
67 | #define xkb_key_num_groups(keymap, key) \ |
68 | xkb_keymap_num_layouts_for_key(keymap, key) |
69 | #define xkb_map_group_get_name(keymap, idx) \ |
70 | xkb_keymap_layout_get_name(keymap, idx) |
71 | #define xkb_map_group_get_index(keymap, str) \ |
72 | xkb_keymap_layout_get_index(keymap, str) |
73 | |
74 | #define xkb_map_num_leds(keymap) xkb_keymap_num_leds(keymap) |
75 | #define xkb_map_led_get_name(keymap, idx) xkb_keymap_led_get_name(keymap, idx) |
76 | #define xkb_map_led_get_index(keymap, str) \ |
77 | xkb_keymap_led_get_index(keymap, str) |
78 | |
79 | #define xkb_key_repeats(keymap, key) xkb_keymap_key_repeats(keymap, key) |
80 | |
81 | #define xkb_key_get_syms(state, key, syms_out) \ |
82 | xkb_state_key_get_syms(state, key, syms_out) |
83 | |
84 | #define xkb_state_group_name_is_active(state, name, type) \ |
85 | xkb_state_layout_name_is_active(state, name, type) |
86 | #define xkb_state_group_index_is_active(state, idx, type) \ |
87 | xkb_state_layout_index_is_active(state, idx, type) |
88 | |
89 | #define xkb_state_serialize_group(state, component) \ |
90 | xkb_state_serialize_layout(state, component) |
91 | |
92 | #define xkb_state_get_map(state) xkb_state_get_keymap(state) |
93 | |
94 | /* Not needed anymore, since there's NO_FLAGS. */ |
95 | #define XKB_MAP_COMPILE_PLACEHOLDER XKB_KEYMAP_COMPILE_NO_FLAGS |
96 | #define XKB_MAP_COMPILE_NO_FLAGS XKB_KEYMAP_COMPILE_NO_FLAGS |
97 | |
98 | #endif |
99 | |