keymap: rename xkb_kt_map_entry to xkb_key_type_entry That's a better name and fits more nicely. Also change type->map to type->entries. 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 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200
diff --git a/src/keymap.c b/src/keymap.c
index 480a4ce..8404c03 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -102,7 +102,7 @@ xkb_keymap_unref(struct xkb_keymap *keymap)
free(keymap->keys);
}
for (i = 0; i < keymap->num_types; i++) {
- free(keymap->types[i].map);
+ free(keymap->types[i].entries);
free(keymap->types[i].level_names);
}
free(keymap->types);
diff --git a/src/keymap.h b/src/keymap.h
index 0f3d6bb..12a2771 100644
--- a/src/keymap.h
+++ b/src/keymap.h
@@ -256,19 +256,19 @@ union xkb_action {
struct xkb_private_action priv;
};
-struct xkb_kt_map_entry {
+struct xkb_key_type_entry {
xkb_level_index_t level;
struct xkb_mods mods;
struct xkb_mods preserve;
};
struct xkb_key_type {
+ xkb_atom_t name;
struct xkb_mods mods;
xkb_level_index_t num_levels;
- struct xkb_kt_map_entry *map;
- unsigned int num_entries;
- xkb_atom_t name;
xkb_atom_t *level_names;
+ unsigned int num_entries;
+ struct xkb_key_type_entry *entries;
};
struct xkb_sym_interpret {
diff --git a/src/state.c b/src/state.c
index 79a6794..d61bed7 100644
--- a/src/state.c
+++ b/src/state.c
@@ -114,7 +114,7 @@ struct xkb_state {
struct xkb_keymap *keymap;
};
-static const struct xkb_kt_map_entry *
+static const struct xkb_key_type_entry *
get_entry_for_key_state(struct xkb_state *state, const struct xkb_key *key,
xkb_layout_index_t group)
{
@@ -128,11 +128,11 @@ get_entry_for_key_state(struct xkb_state *state, const struct xkb_key *key,
* supposed to skip the entry (xserver does this with cached
* entry->active field).
*/
- if (!type->map[i].mods.mask)
+ if (!type->entries[i].mods.mask)
continue;
- if (type->map[i].mods.mask == active_mods)
- return &type->map[i];
+ if (type->entries[i].mods.mask == active_mods)
+ return &type->entries[i];
}
return NULL;
@@ -147,7 +147,7 @@ xkb_state_key_get_level(struct xkb_state *state, xkb_keycode_t kc,
xkb_layout_index_t layout)
{
const struct xkb_key *key = XkbKey(state->keymap, kc);
- const struct xkb_kt_map_entry *entry;
+ const struct xkb_key_type_entry *entry;
if (!key || layout >= key->num_groups)
return XKB_LEVEL_INVALID;
@@ -1085,7 +1085,7 @@ xkb_state_led_name_is_active(struct xkb_state *state, const char *name)
static xkb_mod_mask_t
key_get_consumed(struct xkb_state *state, const struct xkb_key *key)
{
- const struct xkb_kt_map_entry *entry;
+ const struct xkb_key_type_entry *entry;
xkb_layout_index_t group;
group = xkb_state_key_get_layout(state, key->keycode);
diff --git a/src/xkbcomp/keymap-dump.c b/src/xkbcomp/keymap-dump.c
index 5c57e17..034a8c1 100644
--- a/src/xkbcomp/keymap-dump.c
+++ b/src/xkbcomp/keymap-dump.c
@@ -202,7 +202,7 @@ write_types(struct xkb_keymap *keymap, struct buf *buf)
for (unsigned j = 0; j < type->num_entries; j++) {
const char *str;
- const struct xkb_kt_map_entry *entry = &type->map[j];
+ const struct xkb_key_type_entry *entry = &type->entries[j];
/*
* Printing level 1 entries is redundant, it's the default,
diff --git a/src/xkbcomp/keymap.c b/src/xkbcomp/keymap.c
index 6686948..5f4bfb6 100644
--- a/src/xkbcomp/keymap.c
+++ b/src/xkbcomp/keymap.c
@@ -201,8 +201,8 @@ UpdateDerivedKeymapFields(struct xkb_keymap *keymap)
ComputeEffectiveMask(keymap, &keymap->types[i].mods);
for (j = 0; j < keymap->types[i].num_entries; j++) {
- ComputeEffectiveMask(keymap, &keymap->types[i].map[j].mods);
- ComputeEffectiveMask(keymap, &keymap->types[i].map[j].preserve);
+ ComputeEffectiveMask(keymap, &keymap->types[i].entries[j].mods);
+ ComputeEffectiveMask(keymap, &keymap->types[i].entries[j].preserve);
}
}
diff --git a/src/xkbcomp/types.c b/src/xkbcomp/types.c
index 26eb3e7..1eb1b73 100644
--- a/src/xkbcomp/types.c
+++ b/src/xkbcomp/types.c
@@ -149,7 +149,7 @@ typedef struct {
xkb_atom_t name;
xkb_mod_mask_t mods;
xkb_level_index_t num_levels;
- darray(struct xkb_kt_map_entry) entries;
+ darray(struct xkb_key_type_entry) entries;
darray(xkb_atom_t) level_names;
} KeyTypeInfo;
@@ -164,7 +164,7 @@ typedef struct {
/***====================================================================***/
static inline const char *
-MapEntryTxt(KeyTypesInfo *info, struct xkb_kt_map_entry *entry)
+MapEntryTxt(KeyTypesInfo *info, struct xkb_key_type_entry *entry)
{
return ModMaskText(info->keymap, entry->mods.mods);
}
@@ -379,10 +379,10 @@ SetModifiers(KeyTypesInfo *info, KeyTypeInfo *type, ExprDef *arrayNdx,
/***====================================================================***/
-static struct xkb_kt_map_entry *
+static struct xkb_key_type_entry *
FindMatchingMapEntry(KeyTypeInfo *type, xkb_mod_mask_t mods)
{
- struct xkb_kt_map_entry *entry;
+ struct xkb_key_type_entry *entry;
darray_foreach(entry, type->entries)
if (entry->mods.mods == mods)
@@ -393,9 +393,9 @@ FindMatchingMapEntry(KeyTypeInfo *type, xkb_mod_mask_t mods)
static bool
AddMapEntry(KeyTypesInfo *info, KeyTypeInfo *type,
- struct xkb_kt_map_entry *new, bool clobber, bool report)
+ struct xkb_key_type_entry *new, bool clobber, bool report)
{
- struct xkb_kt_map_entry *old;
+ struct xkb_key_type_entry *old;
old = FindMatchingMapEntry(type, new->mods.mods);
if (old) {
@@ -435,7 +435,7 @@ static bool
SetMapEntry(KeyTypesInfo *info, KeyTypeInfo *type, ExprDef *arrayNdx,
ExprDef *value)
{
- struct xkb_kt_map_entry entry;
+ struct xkb_key_type_entry entry;
if (arrayNdx == NULL)
return ReportTypeShouldBeArray(info, type, "map entry");
@@ -471,8 +471,8 @@ static bool
AddPreserve(KeyTypesInfo *info, KeyTypeInfo *type,
xkb_mod_mask_t mods, xkb_mod_mask_t preserve_mods)
{
- struct xkb_kt_map_entry *entry;
- struct xkb_kt_map_entry new;
+ struct xkb_key_type_entry *entry;
+ struct xkb_key_type_entry new;
darray_foreach(entry, type->entries) {
if (entry->mods.mods != mods)
@@ -791,7 +791,7 @@ CopyKeyTypesToKeymap(struct xkb_keymap *keymap, KeyTypesInfo *info)
type->mods.mods = 0;
type->num_levels = 1;
- type->map = NULL;
+ type->entries = NULL;
type->num_entries = 0;
type->name = xkb_atom_intern(keymap->ctx, "default");
type->level_names = NULL;
@@ -805,7 +805,7 @@ CopyKeyTypesToKeymap(struct xkb_keymap *keymap, KeyTypesInfo *info)
type->mods.mods = def->mods;
type->num_levels = def->num_levels;
- type->map = darray_mem(def->entries, 0);
+ type->entries = darray_mem(def->entries, 0);
type->num_entries = darray_size(def->entries);
darray_init(def->entries);
type->name = def->name;