XkbcResizeKeyActions(struct xkb_keymap *keymap, xkb_keycode_t kc,
uint32_t needed)
{
+ struct xkb_key *key;
size_t old_ndx, old_num_acts, new_ndx;
key = XkbKey(keymap, kc);
return NULL;
}
- if (XkbKeyHasActions(keymap, kc) &&
- XkbKeyGroupsWidth(keymap, kc) >= needed)
+ key = XkbKey(keymap, kc);
+
+ if (XkbKeyHasActions(keymap, kc) && key->width >= needed)
return XkbKeyActionsPtr(keymap, kc);
/*
return XkbKeyType(keymap, kc, group)->num_levels;
}
-static inline unsigned char
-XkbKeyGroupsWidth(struct xkb_keymap *keymap, xkb_keycode_t kc)
-{
- return XkbKey(keymap, kc)->width;
-}
-
static inline unsigned int
XkbKeyNumSyms(struct xkb_keymap *keymap, xkb_keycode_t kc,
unsigned int group, unsigned int level)
{
- unsigned char width = XkbKeyGroupsWidth(keymap, kc);
- return XkbKey(keymap, kc)->num_syms[group * width + level];
+ struct xkb_key *key = XkbKey(keymap, kc);
+ return key->num_syms[group * key->width + level];
}
static inline xkb_keysym_t *
XkbKeySymOffset(struct xkb_keymap *keymap, xkb_keycode_t kc,
unsigned group, unsigned int level)
{
- unsigned char width = XkbKeyGroupsWidth(keymap, kc);
- return XkbKey(keymap, kc)->sym_index[group * width + level];
+ struct xkb_key *key = XkbKey(keymap, kc);
+ return key->sym_index[group * key->width + level];
}
static inline xkb_keysym_t *
XkbKeyActionEntry(struct xkb_keymap *keymap, xkb_keycode_t kc,
unsigned int group, unsigned int level)
{
- unsigned char width = XkbKeyGroupsWidth(keymap, kc);
+ struct xkb_key *key = XkbKey(keymap, kc);
if (XkbKeyHasActions(keymap, kc))
- return &XkbKeyActionsPtr(keymap, kc)[width * group + level];
+ return &XkbKeyActionsPtr(keymap, kc)[key->width * group + level];
return NULL;
}
uint32_t vmodmask = 0;
int num_acts = 0;
int group, level;
- int width = XkbKeyGroupsWidth(keymap, kc);
struct xkb_key *key;
int i;
for (group = 0; group < key->num_groups; group++) {
for (level = 0; level < XkbKeyGroupWidth(keymap, kc, group);
level++) {
- i = (group * width) + level;
+ i = (group * key->width) + level;
if (i >= INTERP_SIZE) /* XXX FIXME */
return false;
interps[i] = FindInterpForKey(keymap, kc, group, level);
}
if (num_acts)
- num_acts = key->num_groups * width;
+ num_acts = key->num_groups * key->width;
acts = XkbcResizeKeyActions(keymap, kc, num_acts);
if (num_acts && !acts)
return false;
level++) {
struct xkb_sym_interpret *interp;
- i = (group * width) + level;
+ i = (group * key->width) + level;
interp = interps[i];
/* Infer default key behaviours from the base level. */