kbproto unentanglement: XkbIM_* Signed-off-by: Daniel Stone <daniel@fooishbar.org>
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 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
diff --git a/src/keymap-dump.c b/src/keymap-dump.c
index 9217877..cca6313 100644
--- a/src/keymap-dump.c
+++ b/src/keymap-dump.c
@@ -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));
}
diff --git a/src/state.c b/src/state.c
index 99ad6dc..d62677c 100644
--- a/src/state.c
+++ b/src/state.c
@@ -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);
diff --git a/src/text.c b/src/text.c
index dca89e3..2422e02 100644
--- a/src/text.c
+++ b/src/text.c
@@ -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}
};
diff --git a/src/xkb-priv.h b/src/xkb-priv.h
index c79e64a..d9ec6a0 100644
--- a/src/xkb-priv.h
+++ b/src/xkb-priv.h
@@ -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;
};
diff --git a/src/xkbcomp/compat.c b/src/xkbcomp/compat.c
index 5ae80ab..f0a61b3 100644
--- a/src/xkbcomp/compat.c
+++ b/src/xkbcomp/compat.c
@@ -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;
}
}