diff options
author | Ran Benita <ran234@gmail.com> | 2014-04-22 11:33:47 +0300 |
---|---|---|
committer | Ran Benita <ran234@gmail.com> | 2014-04-22 14:56:01 +0300 |
commit | 0f6bca2b37cb67e9a76acd1c3117e19fb0a115df (patch) | |
tree | fb95f4b60d33ef16431b90d698e0150808506994 | |
parent | 9b1a68eca92cf964bbfbbe5bf9ee9c5ef2496c8f (diff) | |
download | libxkbcommon-0f6bca2b37cb67e9a76acd1c3117e19fb0a115df.tar.gz libxkbcommon-0f6bca2b37cb67e9a76acd1c3117e19fb0a115df.tar.bz2 libxkbcommon-0f6bca2b37cb67e9a76acd1c3117e19fb0a115df.zip |
keymap: rename xkb_foreach_key to xkb_keys_foreach
We'll use the format xkb_foos_foreach and xkb_foos_enumerate for the
various iterators.
Signed-off-by: Ran Benita <ran234@gmail.com>
-rw-r--r-- | src/keymap-priv.c | 2 | ||||
-rw-r--r-- | src/keymap.c | 4 | ||||
-rw-r--r-- | src/keymap.h | 2 | ||||
-rw-r--r-- | src/xkbcomp/keymap-dump.c | 6 | ||||
-rw-r--r-- | src/xkbcomp/keymap.c | 8 | ||||
-rw-r--r-- | src/xkbcomp/symbols.c | 4 |
6 files changed, 13 insertions, 13 deletions
diff --git a/src/keymap-priv.c b/src/keymap-priv.c index 15d2534..4b0c6ad 100644 --- a/src/keymap-priv.c +++ b/src/keymap-priv.c @@ -76,7 +76,7 @@ XkbKeyByName(struct xkb_keymap *keymap, xkb_atom_t name, bool use_aliases) { struct xkb_key *key; - xkb_foreach_key(key, keymap) + xkb_keys_foreach(key, keymap) if (key->name == name) return key; diff --git a/src/keymap.c b/src/keymap.c index 678bd01..dc2541c 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -68,7 +68,7 @@ xkb_keymap_unref(struct xkb_keymap *keymap) if (keymap->keys) { struct xkb_key *key; - xkb_foreach_key(key, keymap) { + xkb_keys_foreach(key, keymap) { if (key->groups) { for (unsigned i = 0; i < key->num_groups; i++) { if (key->groups[i].levels) { @@ -469,7 +469,7 @@ xkb_keymap_key_for_each(struct xkb_keymap *keymap, xkb_keymap_key_iter_t iter, { struct xkb_key *key; - xkb_foreach_key(key, keymap) + xkb_keys_foreach(key, keymap) iter(keymap, key->keycode, data); } diff --git a/src/keymap.h b/src/keymap.h index dd6bde6..ae86f6b 100644 --- a/src/keymap.h +++ b/src/keymap.h @@ -397,7 +397,7 @@ struct xkb_keymap { char *compat_section_name; }; -#define xkb_foreach_key(iter, keymap) \ +#define xkb_keys_foreach(iter, keymap) \ for ((iter) = (keymap)->keys + (keymap)->min_key_code; \ (iter) <= (keymap)->keys + (keymap)->max_key_code; \ (iter)++) diff --git a/src/xkbcomp/keymap-dump.c b/src/xkbcomp/keymap-dump.c index a5d7877..3b1573d 100644 --- a/src/xkbcomp/keymap-dump.c +++ b/src/xkbcomp/keymap-dump.c @@ -164,7 +164,7 @@ write_keycodes(struct xkb_keymap *keymap, struct buf *buf) write_buf(buf, "\tminimum = %u;\n", min(keymap->min_key_code, 8)); write_buf(buf, "\tmaximum = %u;\n", max(keymap->max_key_code, 255)); - xkb_foreach_key(key, keymap) { + xkb_keys_foreach(key, keymap) { if (key->name == XKB_ATOM_NONE) continue; @@ -613,11 +613,11 @@ write_symbols(struct xkb_keymap *keymap, struct buf *buf) if (group > 0) write_buf(buf, "\n"); - xkb_foreach_key(key, keymap) + xkb_keys_foreach(key, keymap) if (key->num_groups > 0) write_key(keymap, buf, key); - xkb_foreach_key(key, keymap) { + xkb_keys_foreach(key, keymap) { xkb_mod_index_t i; const struct xkb_mod *mod; diff --git a/src/xkbcomp/keymap.c b/src/xkbcomp/keymap.c index 3e067f7..281c6c0 100644 --- a/src/xkbcomp/keymap.c +++ b/src/xkbcomp/keymap.c @@ -187,12 +187,12 @@ UpdateDerivedKeymapFields(struct xkb_keymap *keymap) /* Find all the interprets for the key and bind them to actions, * which will also update the vmodmap. */ - xkb_foreach_key(key, keymap) + xkb_keys_foreach(key, keymap) if (!ApplyInterpsToKey(keymap, key)) return false; /* Update keymap->mods, the virtual -> real mod mapping. */ - xkb_foreach_key(key, keymap) + xkb_keys_foreach(key, keymap) darray_enumerate(i, mod, keymap->mods.mods) if (key->vmodmap & (1u << i)) mod->mapping |= key->modmap; @@ -208,7 +208,7 @@ UpdateDerivedKeymapFields(struct xkb_keymap *keymap) } /* Update action modifiers. */ - xkb_foreach_key(key, keymap) + xkb_keys_foreach(key, keymap) for (i = 0; i < key->num_groups; i++) for (j = 0; j < XkbKeyGroupWidth(key, i); j++) UpdateActionMods(keymap, &key->groups[i].levels[j].action, @@ -219,7 +219,7 @@ UpdateDerivedKeymapFields(struct xkb_keymap *keymap) ComputeEffectiveMask(keymap, &led->mods); /* Find maximum number of groups out of all keys in the keymap. */ - xkb_foreach_key(key, keymap) + xkb_keys_foreach(key, keymap) keymap->num_groups = MAX(keymap->num_groups, key->num_groups); return true; diff --git a/src/xkbcomp/symbols.c b/src/xkbcomp/symbols.c index dd9af4a..015f388 100644 --- a/src/xkbcomp/symbols.c +++ b/src/xkbcomp/symbols.c @@ -1247,7 +1247,7 @@ FindKeyForSymbol(struct xkb_keymap *keymap, xkb_keysym_t sym) xkb_layout_index_t group, min_group = UINT32_MAX; xkb_level_index_t level, min_level = UINT16_MAX; - xkb_foreach_key(key, keymap) { + xkb_keys_foreach(key, keymap) { for (group = 0; group < key->num_groups; group++) { for (level = 0; level < XkbKeyGroupWidth(key, group); level++) { if (key->groups[group].levels[level].num_syms != 1 || @@ -1552,7 +1552,7 @@ CopySymbolsToKeymap(struct xkb_keymap *keymap, SymbolsInfo *info) if (xkb_context_get_log_verbosity(keymap->ctx) > 3) { struct xkb_key *key; - xkb_foreach_key(key, keymap) { + xkb_keys_foreach(key, keymap) { if (key->name == XKB_ATOM_NONE) continue; |