Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/xkbcommon/xkbcommon-compat.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*
0002  * Copyright © 2012 Daniel Stone
0003  *
0004  * Permission is hereby granted, free of charge, to any person obtaining a
0005  * copy of this software and associated documentation files (the "Software"),
0006  * to deal in the Software without restriction, including without limitation
0007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
0008  * and/or sell copies of the Software, and to permit persons to whom the
0009  * Software is furnished to do so, subject to the following conditions:
0010  *
0011  * The above copyright notice and this permission notice (including the next
0012  * paragraph) shall be included in all copies or substantial portions of the
0013  * Software.
0014  *
0015  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0016  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0017  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
0018  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
0019  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
0020  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
0021  * DEALINGS IN THE SOFTWARE.
0022  *
0023  * Author: Daniel Stone <daniel@fooishbar.org>
0024  */
0025 
0026 #ifndef _XKBCOMMON_COMPAT_H
0027 #define _XKBCOMMON_COMPAT_H
0028 
0029 /**
0030  * Renamed keymap API.
0031  */
0032 #define xkb_group_index_t xkb_layout_index_t
0033 #define xkb_group_mask_t xkb_layout_mask_t
0034 #define xkb_map_compile_flags xkb_keymap_compile_flags
0035 #define XKB_GROUP_INVALID XKB_LAYOUT_INVALID
0036 
0037 #define XKB_STATE_DEPRESSED \
0038     (XKB_STATE_MODS_DEPRESSED | XKB_STATE_LAYOUT_DEPRESSED)
0039 #define XKB_STATE_LATCHED \
0040     (XKB_STATE_MODS_LATCHED | XKB_STATE_LAYOUT_LATCHED)
0041 #define XKB_STATE_LOCKED \
0042     (XKB_STATE_MODS_LOCKED | XKB_STATE_LAYOUT_LOCKED)
0043 #define XKB_STATE_EFFECTIVE \
0044     (XKB_STATE_DEPRESSED | XKB_STATE_LATCHED | XKB_STATE_LOCKED | \
0045      XKB_STATE_MODS_EFFECTIVE | XKB_STATE_LAYOUT_EFFECTIVE)
0046 
0047 #define xkb_map_new_from_names(context, names, flags) \
0048         xkb_keymap_new_from_names(context, names, flags)
0049 #define xkb_map_new_from_file(context, file, format, flags) \
0050         xkb_keymap_new_from_file(context, file, format, flags)
0051 #define xkb_map_new_from_string(context, string, format, flags) \
0052         xkb_keymap_new_from_string(context, string, format, flags)
0053 #define xkb_map_get_as_string(keymap) \
0054         xkb_keymap_get_as_string(keymap, XKB_KEYMAP_FORMAT_TEXT_V1)
0055 #define xkb_map_ref(keymap) xkb_keymap_ref(keymap)
0056 #define xkb_map_unref(keymap) xkb_keymap_unref(keymap)
0057 
0058 #define xkb_map_num_mods(keymap) xkb_keymap_num_mods(keymap)
0059 #define xkb_map_mod_get_name(keymap, idx) xkb_keymap_mod_get_name(keymap, idx)
0060 #define xkb_map_mod_get_index(keymap, str) xkb_keymap_mod_get_index(keymap, str)
0061 #define xkb_key_mod_index_is_consumed(state, key, mod) \
0062         xkb_state_mod_index_is_consumed(state, key, mod)
0063 #define xkb_key_mod_mask_remove_consumed(state, key, modmask) \
0064         xkb_state_mod_mask_remove_consumed(state, key, modmask)
0065 
0066 #define xkb_map_num_groups(keymap) xkb_keymap_num_layouts(keymap)
0067 #define xkb_key_num_groups(keymap, key) \
0068         xkb_keymap_num_layouts_for_key(keymap, key)
0069 #define xkb_map_group_get_name(keymap, idx) \
0070         xkb_keymap_layout_get_name(keymap, idx)
0071 #define xkb_map_group_get_index(keymap, str) \
0072         xkb_keymap_layout_get_index(keymap, str)
0073 
0074 #define xkb_map_num_leds(keymap) xkb_keymap_num_leds(keymap)
0075 #define xkb_map_led_get_name(keymap, idx) xkb_keymap_led_get_name(keymap, idx)
0076 #define xkb_map_led_get_index(keymap, str) \
0077         xkb_keymap_led_get_index(keymap, str)
0078 
0079 #define xkb_key_repeats(keymap, key) xkb_keymap_key_repeats(keymap, key)
0080 
0081 #define xkb_key_get_syms(state, key, syms_out) \
0082         xkb_state_key_get_syms(state, key, syms_out)
0083 
0084 #define xkb_state_group_name_is_active(state, name, type) \
0085         xkb_state_layout_name_is_active(state, name, type)
0086 #define xkb_state_group_index_is_active(state, idx, type) \
0087         xkb_state_layout_index_is_active(state, idx, type)
0088 
0089 #define xkb_state_serialize_group(state, component) \
0090         xkb_state_serialize_layout(state, component)
0091 
0092 #define xkb_state_get_map(state) xkb_state_get_keymap(state)
0093 
0094 /* Not needed anymore, since there's NO_FLAGS. */
0095 #define XKB_MAP_COMPILE_PLACEHOLDER XKB_KEYMAP_COMPILE_NO_FLAGS
0096 #define XKB_MAP_COMPILE_NO_FLAGS XKB_KEYMAP_COMPILE_NO_FLAGS
0097 
0098 #endif