kbproto unentanglement: XkbIM_*

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
master
Daniel Stone 2012-09-10 20:07:54 +01:00
parent 0b2506db12
commit 830fe67132
5 changed files with 35 additions and 43 deletions

View File

@ -169,8 +169,6 @@ get_indicator_state_text(uint8_t which)
memset(ret, 0, GET_TEXT_BUF_SIZE);
which &= XkbIM_UseAnyMods;
if (which == 0) {
strcpy(ret, "0");
return NULL;
@ -343,7 +341,7 @@ write_indicator_map(struct xkb_keymap *keymap, struct buf *buf, int num)
xkb_atom_text(keymap->ctx, keymap->indicators[num].name));
if (led->which_groups) {
if (led->which_groups != XkbIM_UseEffective) {
if (led->which_groups != XKB_STATE_EFFECTIVE) {
write_buf(buf, "\t\t\twhichGroupState= %s;\n",
get_indicator_state_text(led->which_groups));
}
@ -352,7 +350,7 @@ write_indicator_map(struct xkb_keymap *keymap, struct buf *buf, int num)
}
if (led->which_mods) {
if (led->which_mods != XkbIM_UseEffective) {
if (led->which_mods != XKB_STATE_EFFECTIVE) {
write_buf(buf, "\t\t\twhichModState= %s;\n",
get_indicator_state_text(led->which_mods));
}

View File

@ -555,30 +555,24 @@ xkb_state_led_update_all(struct xkb_state *state)
xkb_mod_mask_t mod_mask = 0;
uint32_t group_mask = 0;
if (map->which_mods & XkbIM_UseAnyMods) {
if (map->which_mods & XkbIM_UseBase)
mod_mask |= state->base_mods;
if (map->which_mods & XkbIM_UseLatched)
mod_mask |= state->latched_mods;
if (map->which_mods & XkbIM_UseLocked)
mod_mask |= state->locked_mods;
if (map->which_mods & XkbIM_UseEffective)
mod_mask |= state->mods;
if ((map->mods.mask & mod_mask))
state->leds |= (1 << led);
}
if (map->which_groups & XkbIM_UseAnyGroup) {
if (map->which_groups & XkbIM_UseBase)
group_mask |= (1 << state->base_group);
if (map->which_groups & XkbIM_UseLatched)
group_mask |= (1 << state->latched_group);
if (map->which_groups & XkbIM_UseLocked)
group_mask |= (1 << state->locked_group);
if (map->which_groups & XkbIM_UseEffective)
group_mask |= (1 << state->group);
if ((map->groups & group_mask))
state->leds |= (1 << led);
}
if (map->which_mods & XKB_STATE_DEPRESSED)
mod_mask |= state->base_mods;
if (map->which_mods & XKB_STATE_LATCHED)
mod_mask |= state->latched_mods;
if (map->which_mods & XKB_STATE_LOCKED)
mod_mask |= state->locked_mods;
if ((map->mods.mask & mod_mask))
state->leds |= (1 << led);
if (map->which_groups & XKB_STATE_DEPRESSED)
group_mask |= (1 << state->base_group);
if (map->which_groups & XKB_STATE_LATCHED)
group_mask |= (1 << state->latched_group);
if (map->which_groups & XKB_STATE_LOCKED)
group_mask |= (1 << state->locked_group);
if ((map->groups & group_mask))
state->leds |= (1 << led);
if (map->ctrls) {
if ((map->ctrls & state->keymap->enabled_ctrls))
state->leds |= (1 << led);

View File

@ -79,22 +79,22 @@ const LookupEntry ctrlMaskNames[] = {
};
const LookupEntry modComponentMaskNames[] = {
{"base", XkbIM_UseBase},
{"latched", XkbIM_UseLatched},
{"locked", XkbIM_UseLocked},
{"effective", XkbIM_UseEffective},
{"compat", XkbIM_UseCompat},
{"any", XkbIM_UseAnyMods},
{"base", XKB_STATE_DEPRESSED},
{"latched", XKB_STATE_LATCHED},
{"locked", XKB_STATE_LOCKED},
{"effective", XKB_STATE_EFFECTIVE},
{"compat", XKB_STATE_EFFECTIVE},
{"any", XKB_STATE_EFFECTIVE},
{"none", 0},
{NULL, 0}
};
const LookupEntry groupComponentMaskNames[] = {
{"base", XkbIM_UseBase},
{"latched", XkbIM_UseLatched},
{"locked", XkbIM_UseLocked},
{"effective", XkbIM_UseEffective},
{"any", XkbIM_UseAnyGroup},
{"base", XKB_STATE_DEPRESSED},
{"latched", XKB_STATE_LATCHED},
{"locked", XKB_STATE_LOCKED},
{"effective", XKB_STATE_EFFECTIVE},
{"any", XKB_STATE_EFFECTIVE},
{"none", 0},
{NULL, 0}
};

View File

@ -256,9 +256,9 @@ struct xkb_sym_interpret {
struct xkb_indicator_map {
xkb_atom_t name;
unsigned char which_groups;
enum xkb_state_component which_groups;
uint32_t groups;
unsigned char which_mods;
enum xkb_state_component which_mods;
struct xkb_mods mods;
unsigned int ctrls;
};

View File

@ -976,9 +976,9 @@ CopyIndicatorMapDefs(CompatInfo *info)
im = &keymap->indicators[i];
*im = led->im;
if (im->groups != 0 && im->which_groups == 0)
im->which_groups = XkbIM_UseEffective;
im->which_groups = XKB_STATE_EFFECTIVE;
if (im->mods.mods != 0 && im->which_mods == 0)
im->which_mods = XkbIM_UseEffective;
im->which_mods = XKB_STATE_EFFECTIVE;
}
}