xkb_mod_index_t i;
const struct xkb_mod *mod;
- darray_enumerate(i, mod, mods->mods)
+ xkb_mods_enumerate(i, mod, mods)
if ((mod->type & type) && name == mod->name)
return i;
(iter) <= (keymap)->keys + (keymap)->max_key_code; \
(iter)++)
+#define xkb_mods_foreach(iter, mods_) \
+ darray_foreach((iter), (mods_)->mods)
+
+#define xkb_mods_enumerate(idx, iter, mods_) \
+ darray_enumerate((idx), (iter), (mods_)->mods)
+
static inline const struct xkb_key *
XkbKey(struct xkb_keymap *keymap, xkb_keycode_t kc)
{
if (mask == MOD_REAL_MASK_ALL)
return "all";
- darray_enumerate(i, mod, mods->mods) {
+ xkb_mods_enumerate(i, mod, mods) {
int ret;
if (!(mask & (1u << i)))
const struct xkb_mod *mod;
xkb_mod_index_t num_vmods = 0;
- darray_foreach(mod, keymap->mods.mods) {
+ xkb_mods_foreach(mod, &keymap->mods) {
if (mod->type != MOD_VIRT)
continue;
if (key->modmap == 0)
continue;
- darray_enumerate(i, mod, keymap->mods.mods)
+ xkb_mods_enumerate(i, mod, &keymap->mods)
if (key->modmap & (1u << i))
write_buf(buf, "\tmodifier_map %s { %s };\n",
xkb_atom_text(keymap->ctx, mod->name),
/* The effective mask is only real mods for now. */
mods->mask = mods->mods & MOD_REAL_MASK_ALL;
- darray_enumerate(i, mod, keymap->mods.mods)
+ xkb_mods_enumerate(i, mod, &keymap->mods)
if (mods->mods & (1u << i))
mods->mask |= mod->mapping;
}
/* Update keymap->mods, the virtual -> real mod mapping. */
xkb_keys_foreach(key, keymap)
- darray_enumerate(i, mod, keymap->mods.mods)
+ xkb_mods_enumerate(i, mod, &keymap->mods)
if (key->vmodmap & (1u << i))
mod->mapping |= key->modmap;
mapping = 0;
}
- darray_enumerate(i, mod, mods->mods) {
+ xkb_mods_enumerate(i, mod, mods) {
if (mod->name == stmt->name) {
if (mod->type != MOD_VIRT) {
log_err(ctx,