diff options
author | Ran Benita <ran234@gmail.com> | 2013-02-08 13:09:33 +0200 |
---|---|---|
committer | Ran Benita <ran234@gmail.com> | 2014-04-19 16:20:09 +0300 |
commit | ca3170ad3813389a3325513130c37e8038fa02f9 (patch) | |
tree | f743e6b3f056bcdcfab7f8b029a03c9818cb2dd7 /src/text.c | |
parent | 3d7aff5fcdad501856662e6b84a76ef883b35784 (diff) | |
download | xorg-lib-libxkbcommon-ca3170ad3813389a3325513130c37e8038fa02f9.tar.gz |
Add struct xkb_mod_set
The only thing that the compilation phase needs the keymap for currently
is for access to the modifier information (it also modifies it in
place!). We want to only pass along the neccessary information, to make
it more tractable and testable, so instead of passing the entire keymap
we add a new 'mod_set' object and pass a (const) reference to that.
The new object is just the old array of 'struct xkb_mod'.
Signed-off-by: Ran Benita <ran234@gmail.com>
Diffstat (limited to 'src/text.c')
-rw-r--r-- | src/text.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -212,10 +212,11 @@ ModIndexText(const struct xkb_keymap *keymap, xkb_mod_index_t ndx) if (ndx == XKB_MOD_INVALID) return "none"; - if (ndx >= darray_size(keymap->mods)) + if (ndx >= darray_size(keymap->mods.mods)) return NULL; - return xkb_atom_text(keymap->ctx, darray_item(keymap->mods, ndx).name); + return xkb_atom_text(keymap->ctx, + darray_item(keymap->mods.mods, ndx).name); } const char * @@ -263,7 +264,7 @@ ModMaskText(const struct xkb_keymap *keymap, xkb_mod_mask_t mask) if (mask == MOD_REAL_MASK_ALL) return "all"; - darray_enumerate(i, mod, keymap->mods) { + darray_enumerate(i, mod, keymap->mods.mods) { int ret; if (!(mask & (1u << i))) |