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>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134
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;