26 #ifndef _XKBCOMMON_COMPAT_H
27 #define _XKBCOMMON_COMPAT_H
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
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)
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)
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)
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)
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)
79 #define xkb_key_repeats(keymap, key) xkb_keymap_key_repeats(keymap, key)
81 #define xkb_key_get_syms(state, key, syms_out) \
82 xkb_state_key_get_syms(state, key, syms_out)
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)
89 #define xkb_state_serialize_group(state, component) \
90 xkb_state_serialize_layout(state, component)
92 #define xkb_state_get_map(state) xkb_state_get_keymap(state)