2 * Copyright © 2012 Daniel Stone
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>
26 #define _XKBCOMMON_COMPAT_H /* don't mangle our legacy names! */
28 #include "xkbcommon/xkbcommon.h"
31 /* We don't carry any prototypes for these functions, as we #define them
32 * to their newer versions so people link against those. */
33 #pragma GCC diagnostic ignored "-Wmissing-prototypes"
35 XKB_EXPORT struct xkb_keymap *
36 xkb_map_new_from_names(struct xkb_context *context,
37 const struct xkb_rule_names *names,
38 enum xkb_keymap_compile_flags flags)
40 return xkb_keymap_new_from_names(context, names, flags);
43 XKB_EXPORT struct xkb_keymap *
44 xkb_map_new_from_file(struct xkb_context *context, FILE *file,
45 enum xkb_keymap_format format,
46 enum xkb_keymap_compile_flags flags)
48 return xkb_keymap_new_from_file(context, file, format, flags);
51 XKB_EXPORT struct xkb_keymap *
52 xkb_map_new_from_string(struct xkb_context *context, const char *string,
53 enum xkb_keymap_format format,
54 enum xkb_keymap_compile_flags flags)
56 return xkb_keymap_new_from_string(context, string, format, flags);
60 xkb_map_get_as_string(struct xkb_keymap *keymap)
62 return xkb_keymap_get_as_string(keymap, XKB_KEYMAP_FORMAT_TEXT_V1);
65 XKB_EXPORT struct xkb_keymap *
66 xkb_map_ref(struct xkb_keymap *keymap)
68 return xkb_keymap_ref(keymap);
72 xkb_map_unref(struct xkb_keymap *keymap)
74 xkb_keymap_unref(keymap);
77 XKB_EXPORT xkb_mod_index_t
78 xkb_map_num_mods(struct xkb_keymap *keymap)
80 return xkb_keymap_num_mods(keymap);
83 XKB_EXPORT const char *
84 xkb_map_mod_get_name(struct xkb_keymap *keymap, xkb_mod_index_t idx)
86 return xkb_keymap_mod_get_name(keymap, idx);
89 XKB_EXPORT xkb_mod_index_t
90 xkb_map_mod_get_index(struct xkb_keymap *keymap, const char *name)
92 return xkb_keymap_mod_get_index(keymap, name);
96 xkb_key_mod_index_is_consumed(struct xkb_state *state, xkb_keycode_t kc,
99 return xkb_state_mod_index_is_consumed(state, kc, idx);
102 XKB_EXPORT xkb_mod_mask_t
103 xkb_key_mod_mask_remove_consumed(struct xkb_state *state, xkb_keycode_t kc,
106 return xkb_state_mod_mask_remove_consumed(state, kc, mask);
109 XKB_EXPORT xkb_layout_index_t
110 xkb_map_num_groups(struct xkb_keymap *keymap)
112 return xkb_keymap_num_layouts(keymap);
115 XKB_EXPORT xkb_layout_index_t
116 xkb_key_num_groups(struct xkb_keymap *keymap, xkb_keycode_t kc)
118 return xkb_keymap_num_layouts_for_key(keymap, kc);
121 XKB_EXPORT const char *
122 xkb_map_group_get_name(struct xkb_keymap *keymap, xkb_layout_index_t idx)
124 return xkb_keymap_layout_get_name(keymap, idx);
127 XKB_EXPORT xkb_layout_index_t
128 xkb_map_group_get_index(struct xkb_keymap *keymap, const char *name)
130 return xkb_keymap_layout_get_index(keymap, name);
133 XKB_EXPORT xkb_led_index_t
134 xkb_map_num_leds(struct xkb_keymap *keymap)
136 return xkb_keymap_num_leds(keymap);
139 XKB_EXPORT const char *
140 xkb_map_led_get_name(struct xkb_keymap *keymap, xkb_led_index_t idx)
142 return xkb_keymap_led_get_name(keymap, idx);
145 XKB_EXPORT xkb_led_index_t
146 xkb_map_led_get_index(struct xkb_keymap *keymap, const char *name)
148 return xkb_keymap_led_get_index(keymap, name);
152 xkb_key_repeats(struct xkb_keymap *keymap, xkb_keycode_t kc)
154 return xkb_keymap_key_repeats(keymap, kc);
158 xkb_key_get_syms(struct xkb_state *state, xkb_keycode_t kc,
159 const xkb_keysym_t **syms_out)
161 return xkb_state_key_get_syms(state, kc, syms_out);
165 xkb_state_group_name_is_active(struct xkb_state *state, const char *name,
166 enum xkb_state_component type)
168 return xkb_state_layout_name_is_active(state, name, type);
172 xkb_state_group_index_is_active(struct xkb_state *state, xkb_layout_index_t idx,
173 enum xkb_state_component type)
175 return xkb_state_layout_index_is_active(state, idx, type);
178 XKB_EXPORT xkb_layout_index_t
179 xkb_state_serialize_group(struct xkb_state *state,
180 enum xkb_state_component type)
182 return xkb_state_serialize_layout(state, type);
185 XKB_EXPORT struct xkb_keymap *
186 xkb_state_get_map(struct xkb_state *state)
188 return xkb_state_get_keymap(state);