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/x11 | |
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/x11')
-rw-r--r-- | src/x11/keymap.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/x11/keymap.c b/src/x11/keymap.c index 76adf74..716fc51 100644 --- a/src/x11/keymap.c +++ b/src/x11/keymap.c @@ -508,13 +508,14 @@ get_vmods(struct xkb_keymap *keymap, xcb_connection_t *conn, { uint8_t *iter = xcb_xkb_get_map_map_vmods_rtrn(map); - darray_resize0(keymap->mods, + darray_resize0(keymap->mods.mods, NUM_REAL_MODS + msb_pos(reply->virtualMods)); for (unsigned i = 0; i < NUM_VMODS; i++) { if (reply->virtualMods & (1u << i)) { uint8_t wire = *iter; - struct xkb_mod *mod = &darray_item(keymap->mods, NUM_REAL_MODS + i); + struct xkb_mod *mod = &darray_item(keymap->mods.mods, + NUM_REAL_MODS + i); mod->type = MOD_VIRT; mod->mapping = translate_mods(wire, 0, 0); @@ -919,12 +920,14 @@ get_vmod_names(struct xkb_keymap *keymap, xcb_connection_t *conn, * tells us which vmods exist (a vmod must have a name), so we fix * up the size here. */ - darray_resize0(keymap->mods, NUM_REAL_MODS + msb_pos(reply->virtualMods)); + darray_resize0(keymap->mods.mods, + NUM_REAL_MODS + msb_pos(reply->virtualMods)); for (unsigned i = 0; i < NUM_VMODS; i++) { if (reply->virtualMods & (1u << i)) { xcb_atom_t wire = *iter; - struct xkb_mod *mod = &darray_item(keymap->mods, NUM_REAL_MODS + i); + struct xkb_mod *mod = &darray_item(keymap->mods.mods, + NUM_REAL_MODS + i); if (!adopt_atom(keymap->ctx, conn, wire, &mod->name)) return false; |