summaryrefslogtreecommitdiff
path: root/src/keymap.h
diff options
context:
space:
mode:
authorRan Benita <ran234@gmail.com>2012-09-24 14:41:09 +0200
committerRan Benita <ran234@gmail.com>2012-09-24 14:41:09 +0200
commitc955f8e2f9a915e3b7bced6f9b0c2b864f31e8ef (patch)
tree1a024893d91b4d9a167deb8cb6e455f69f883441 /src/keymap.h
parent01b00d75400fefc6f63e249b89b94d3a47368c96 (diff)
downloadlibxkbcommon-c955f8e2f9a915e3b7bced6f9b0c2b864f31e8ef.tar.gz
libxkbcommon-c955f8e2f9a915e3b7bced6f9b0c2b864f31e8ef.tar.bz2
libxkbcommon-c955f8e2f9a915e3b7bced6f9b0c2b864f31e8ef.zip
keymap: store a pointer to the type in xkb_group instead of index
Gets rid of some more unneeded indirection, including the XkbKeyType macro. Signed-off-by: Ran Benita <ran234@gmail.com>
Diffstat (limited to 'src/keymap.h')
-rw-r--r--src/keymap.h15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/keymap.h b/src/keymap.h
index 243a5cf..0829c39 100644
--- a/src/keymap.h
+++ b/src/keymap.h
@@ -331,7 +331,8 @@ struct xkb_level {
struct xkb_group {
bool explicit_type;
- unsigned type_index;
+ /* Points to a type in keymap->types. */
+ const struct xkb_key_type *type;
/* Use XkbKeyGroupWidth for the number of levels. */
struct xkb_level *levels;
};
@@ -406,18 +407,10 @@ XkbKey(struct xkb_keymap *keymap, xkb_keycode_t kc)
#define xkb_foreach_key(iter, keymap) \
darray_foreach(iter, keymap->keys)
-static inline struct xkb_key_type *
-XkbKeyType(struct xkb_keymap *keymap, const struct xkb_key *key,
- xkb_layout_index_t layout)
-{
- return &keymap->types[key->groups[layout].type_index];
-}
-
static inline xkb_level_index_t
-XkbKeyGroupWidth(struct xkb_keymap *keymap, const struct xkb_key *key,
- xkb_layout_index_t layout)
+XkbKeyGroupWidth(const struct xkb_key *key, xkb_layout_index_t layout)
{
- return XkbKeyType(keymap, key, layout)->num_levels;
+ return key->groups[layout].type->num_levels;
}
static inline unsigned int