diff options
author | Ran Benita <ran234@gmail.com> | 2012-09-13 21:06:10 +0300 |
---|---|---|
committer | Ran Benita <ran234@gmail.com> | 2012-09-14 00:07:55 +0300 |
commit | 4c16b39f31134f41cc19538dd8a020ef7eeee063 (patch) | |
tree | f735fe927393be6f0481e921a89ed544f3315023 /src/xkbcomp | |
parent | 8862fd80823c9c418b5adb5c7c183446094368d9 (diff) | |
download | xorg-lib-libxkbcommon-4c16b39f31134f41cc19538dd8a020ef7eeee063.tar.gz |
symbols: FindAutomaticType only needs the context
Signed-off-by: Ran Benita <ran234@gmail.com>
Diffstat (limited to 'src/xkbcomp')
-rw-r--r-- | src/xkbcomp/symbols.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/xkbcomp/symbols.c b/src/xkbcomp/symbols.c index 0cfa71b..d26422f 100644 --- a/src/xkbcomp/symbols.c +++ b/src/xkbcomp/symbols.c @@ -1361,27 +1361,27 @@ FindNamedType(struct xkb_keymap *keymap, xkb_atom_t name, unsigned *type_rtrn) * symbol per level. */ static bool -FindAutomaticType(struct xkb_keymap *keymap, xkb_level_index_t width, +FindAutomaticType(struct xkb_context *ctx, xkb_level_index_t width, const xkb_keysym_t *syms, xkb_atom_t *typeNameRtrn, bool *autoType) { *autoType = false; if ((width == 1) || (width == 0)) { - *typeNameRtrn = xkb_atom_intern(keymap->ctx, "ONE_LEVEL"); + *typeNameRtrn = xkb_atom_intern(ctx, "ONE_LEVEL"); *autoType = true; } else if (width == 2) { if (syms && xkb_keysym_is_lower(syms[0]) && xkb_keysym_is_upper(syms[1])) { - *typeNameRtrn = xkb_atom_intern(keymap->ctx, "ALPHABETIC"); + *typeNameRtrn = xkb_atom_intern(ctx, "ALPHABETIC"); } else if (syms && (xkb_keysym_is_keypad(syms[0]) || xkb_keysym_is_keypad(syms[1]))) { - *typeNameRtrn = xkb_atom_intern(keymap->ctx, "KEYPAD"); + *typeNameRtrn = xkb_atom_intern(ctx, "KEYPAD"); *autoType = true; } else { - *typeNameRtrn = xkb_atom_intern(keymap->ctx, "TWO_LEVEL"); + *typeNameRtrn = xkb_atom_intern(ctx, "TWO_LEVEL"); *autoType = true; } } @@ -1390,16 +1390,16 @@ FindAutomaticType(struct xkb_keymap *keymap, xkb_level_index_t width, xkb_keysym_is_upper(syms[1])) if (xkb_keysym_is_lower(syms[2]) && xkb_keysym_is_upper(syms[3])) *typeNameRtrn = - xkb_atom_intern(keymap->ctx, "FOUR_LEVEL_ALPHABETIC"); + xkb_atom_intern(ctx, "FOUR_LEVEL_ALPHABETIC"); else - *typeNameRtrn = xkb_atom_intern(keymap->ctx, + *typeNameRtrn = xkb_atom_intern(ctx, "FOUR_LEVEL_SEMIALPHABETIC"); else if (syms && (xkb_keysym_is_keypad(syms[0]) || xkb_keysym_is_keypad(syms[1]))) - *typeNameRtrn = xkb_atom_intern(keymap->ctx, "FOUR_LEVEL_KEYPAD"); + *typeNameRtrn = xkb_atom_intern(ctx, "FOUR_LEVEL_KEYPAD"); else - *typeNameRtrn = xkb_atom_intern(keymap->ctx, "FOUR_LEVEL"); + *typeNameRtrn = xkb_atom_intern(ctx, "FOUR_LEVEL"); /* XXX: why not set autoType here? */ } return width <= 4; @@ -1525,7 +1525,8 @@ CopySymbolsDef(SymbolsInfo *info, KeyInfo *keyi) if (groupi->type == XKB_ATOM_NONE) { if (keyi->dfltType != XKB_ATOM_NONE) groupi->type = keyi->dfltType; - else if (FindAutomaticType(keymap, darray_size(groupi->levels), + else if (FindAutomaticType(keymap->ctx, + darray_size(groupi->levels), darray_mem(groupi->syms, 0), &groupi->type, &autoType)) { } else |