Remove KcCGST names from the map 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 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 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287
diff --git a/include/xkbcommon/xkbcommon.h b/include/xkbcommon/xkbcommon.h
index 881af46..f20c2b9 100644
--- a/include/xkbcommon/xkbcommon.h
+++ b/include/xkbcommon/xkbcommon.h
@@ -329,18 +329,11 @@ struct xkb_key_alias {
};
struct xkb_names {
- uint32_t keycodes;
- uint32_t geometry;
- uint32_t symbols;
- uint32_t types;
- uint32_t compat;
uint32_t vmods[XkbNumVirtualMods];
uint32_t indicators[XkbNumIndicators];
uint32_t groups[XkbNumKbdGroups];
struct xkb_key_name * keys;
struct xkb_key_alias * key_aliases;
- uint32_t *radio_groups;
- uint32_t phys_symbols;
xkb_keycode_t num_keys;
xkb_keycode_t num_key_aliases;
diff --git a/src/alloc.c b/src/alloc.c
index 76fc40f..de15031 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -102,7 +102,7 @@ XkbcFreeCompatMap(struct xkb_desc * xkb)
}
int
-XkbcAllocNames(struct xkb_desc * xkb, unsigned which, int nTotalRG, int nTotalAliases)
+XkbcAllocNames(struct xkb_desc * xkb, unsigned which, int nTotalAliases)
{
struct xkb_names * names;
@@ -164,27 +164,6 @@ XkbcAllocNames(struct xkb_desc * xkb, unsigned which, int nTotalRG, int nTotalAl
names->num_key_aliases = nTotalAliases;
}
- if ((which & XkbRGNamesMask) && (nTotalRG > 0)) {
- if (!names->radio_groups)
- names->radio_groups = _XkbTypedCalloc(nTotalRG, uint32_t);
- else if (nTotalRG > names->num_rg) {
- uint32_t *prev_radio_groups = names->radio_groups;
-
- names->radio_groups = _XkbTypedRealloc(names->radio_groups,
- nTotalRG, uint32_t);
- if (names->radio_groups)
- _XkbClearElems(names->radio_groups, names->num_rg,
- nTotalRG - 1, uint32_t);
- else
- free(prev_radio_groups);
- }
-
- if (!names->radio_groups)
- return BadAlloc;
-
- names->num_rg = nTotalRG;
- }
-
return Success;
}
@@ -212,7 +191,6 @@ XkbcFreeNames(struct xkb_desc * xkb)
free(names->keys);
free(names->key_aliases);
- free(names->radio_groups);
free(names);
xkb->names = NULL;
}
diff --git a/src/xkballoc.h b/src/xkballoc.h
index 56f4ad7..4d36e5a 100644
--- a/src/xkballoc.h
+++ b/src/xkballoc.h
@@ -35,8 +35,7 @@ extern int
XkbcAllocCompatMap(struct xkb_desc * xkb, unsigned which, unsigned nSI);
extern int
-XkbcAllocNames(struct xkb_desc * xkb, unsigned which, int nTotalRG,
- int nTotalAliases);
+XkbcAllocNames(struct xkb_desc * xkb, unsigned which, int nTotalAliases);
extern int
XkbcAllocControls(struct xkb_desc * xkb, unsigned which);
diff --git a/src/xkbcomp/alias.c b/src/xkbcomp/alias.c
index a1cf160..af3dc2f 100644
--- a/src/xkbcomp/alias.c
+++ b/src/xkbcomp/alias.c
@@ -246,7 +246,7 @@ ApplyAliases(struct xkb_desc * xkb, Bool toGeom, AliasInfo ** info_in)
}
else
{
- status = XkbcAllocNames(xkb, XkbKeyAliasesMask, 0, nOld + nNew);
+ status = XkbcAllocNames(xkb, XkbKeyAliasesMask, nOld + nNew);
if (xkb->names)
old = xkb->names->key_aliases;
}
diff --git a/src/xkbcomp/compat.c b/src/xkbcomp/compat.c
index b089443..c2e9609 100644
--- a/src/xkbcomp/compat.c
+++ b/src/xkbcomp/compat.c
@@ -817,18 +817,6 @@ CompileCompatMap(XkbFile *file, struct xkb_desc * xkb, unsigned merge,
WSGO("Couldn't allocate compatibility map\n");
return False;
}
- if (info.name != NULL)
- {
- if (XkbcAllocNames(xkb, XkbCompatNameMask, 0, 0) == Success)
- xkb->names->compat =
- xkb_intern_atom(info.name);
- else
- {
- WSGO("Couldn't allocate space for compat name\n");
- ACTION("Name \"%s\" (from %s) NOT assigned\n",
- scanFile, info.name);
- }
- }
size = info.nInterps * sizeof(struct xkb_sym_interpret);
if (size > 0)
{
diff --git a/src/xkbcomp/geometry.c b/src/xkbcomp/geometry.c
index ac72213..5657421 100644
--- a/src/xkbcomp/geometry.c
+++ b/src/xkbcomp/geometry.c
@@ -3650,8 +3650,7 @@ CompileGeometry(XkbFile *file, struct xkb_desc * xkb, unsigned merge)
if (info.name != NULL)
{
geom->name = xkb_intern_atom(info.name);
- if (XkbcAllocNames(xkb, XkbGeometryNameMask, 0, 0) == Success)
- xkb->names->geometry = geom->name;
+ XkbcAllocNames(xkb, XkbGeometryNameMask, 0);
}
if (info.fontSpec != None)
geom->label_font = XkbcAtomGetString(info.fontSpec);
diff --git a/src/xkbcomp/indicators.c b/src/xkbcomp/indicators.c
index 24ea8dd..e4df035 100644
--- a/src/xkbcomp/indicators.c
+++ b/src/xkbcomp/indicators.c
@@ -371,7 +371,7 @@ CopyIndicatorMapDefs(struct xkb_desc * xkb, LEDInfo *leds, LEDInfo **unboundRtrn
LEDInfo *led, *next;
LEDInfo *unbound, *last;
- if (XkbcAllocNames(xkb, XkbIndicatorNamesMask, 0, 0) != Success)
+ if (XkbcAllocNames(xkb, XkbIndicatorNamesMask, 0) != Success)
{
WSGO("Couldn't allocate names\n");
ACTION("Indicator names may be incorrect\n");
diff --git a/src/xkbcomp/keycodes.c b/src/xkbcomp/keycodes.c
index 91008fc..e1c90cf 100644
--- a/src/xkbcomp/keycodes.c
+++ b/src/xkbcomp/keycodes.c
@@ -891,15 +891,12 @@ CompileKeycodes(XkbFile *file, struct xkb_desc * xkb, unsigned merge)
xkb->max_key_code = info.explicitMax;
else
xkb->max_key_code = info.computedMax;
- if (XkbcAllocNames(xkb, XkbKeyNamesMask | XkbIndicatorNamesMask, 0, 0)
+ if (XkbcAllocNames(xkb, XkbKeyNamesMask | XkbIndicatorNamesMask, 0)
== Success)
{
int i;
- xkb->names->keycodes = xkb_intern_atom(info.name);
for (i = info.computedMin; i <= info.computedMax; i++)
- {
LongToKeyName(info.names[i], xkb->names->keys[i].name);
- }
}
else
{
diff --git a/src/xkbcomp/keytypes.c b/src/xkbcomp/keytypes.c
index 0204060..762ecf0 100644
--- a/src/xkbcomp/keytypes.c
+++ b/src/xkbcomp/keytypes.c
@@ -1155,17 +1155,6 @@ CompileKeyTypes(XkbFile *file, struct xkb_desc * xkb, unsigned merge)
KeyTypeInfo *def;
struct xkb_key_type *type, *next;
- if (info.name != NULL)
- {
- if (XkbcAllocNames(xkb, XkbTypesNameMask, 0, 0) == Success)
- xkb->names->types = xkb_intern_atom(info.name);
- else
- {
- WSGO("Couldn't allocate space for types name\n");
- ACTION("Name \"%s\" (from %s) NOT assigned\n",
- scanFile, info.name);
- }
- }
i = info.nTypes;
if ((info.stdPresent & XkbOneLevelMask) == 0)
i++;
diff --git a/src/xkbcomp/misc.c b/src/xkbcomp/misc.c
index 2f1fdd9..f303536 100644
--- a/src/xkbcomp/misc.c
+++ b/src/xkbcomp/misc.c
@@ -289,7 +289,7 @@ FindNamedKey(struct xkb_desc * xkb,
{
if ((!xkb->names) || (!xkb->names->keys))
{
- if (XkbcAllocNames(xkb, XkbKeyNamesMask, 0, 0) != Success)
+ if (XkbcAllocNames(xkb, XkbKeyNamesMask, 0) != Success)
{
if (warningLevel > 0)
{
diff --git a/src/xkbcomp/symbols.c b/src/xkbcomp/symbols.c
index e452b14..f0e2716 100644
--- a/src/xkbcomp/symbols.c
+++ b/src/xkbcomp/symbols.c
@@ -1883,9 +1883,7 @@ CopySymbolsDef(struct xkb_desc * xkb, KeyInfo *key, int start_from)
{
if ((start_from == 0) && (warningLevel >= 5))
{
- WARN("Key %s not found in %s keycodes\n",
- longText(key->name),
- XkbcAtomText(xkb->names->keycodes));
+ WARN("Key %s not found in keycodes\n", longText(key->name));
ACTION("Symbols ignored\n");
}
return False;
@@ -2035,9 +2033,8 @@ CopySymbolsDef(struct xkb_desc * xkb, KeyInfo *key, int start_from)
{
if (warningLevel >= 1)
{
- WARN("Key %s not found in %s keycodes\n",
- longText(key->nameForOverlayKey),
- XkbcAtomText(xkb->names->keycodes));
+ WARN("Key %s not found in keycodes\n",
+ longText(key->nameForOverlayKey));
ACTION("Not treating %s as an overlay key \n",
longText(key->name));
}
@@ -2083,9 +2080,8 @@ CopyModMapDef(struct xkb_desc * xkb, ModMapEntry *entry)
{
if (warningLevel >= 5)
{
- WARN("Key %s not found in %s keycodes\n",
- longText(entry->u.keyName),
- XkbcAtomText(xkb->names->keycodes));
+ WARN("Key %s not found in keycodes\n",
+ longText(entry->u.keyName));
ACTION("Modifier map entry for %s not updated\n",
XkbcModIndexText(entry->modifier));
}
@@ -2096,9 +2092,8 @@ CopyModMapDef(struct xkb_desc * xkb, ModMapEntry *entry)
{
if (warningLevel > 5)
{
- WARN("Key \"%s\" not found in %s symbol map\n",
- XkbcKeysymText(entry->u.keySym),
- XkbcAtomText(xkb->names->symbols));
+ WARN("Key \"%s\" not found in symbol map\n",
+ XkbcKeysymText(entry->u.keySym));
ACTION("Modifier map entry for %s not updated\n",
XkbcModIndexText(entry->modifier));
}
@@ -2136,8 +2131,7 @@ CompileSymbols(XkbFile *file, struct xkb_desc * xkb, unsigned merge)
KeyInfo *key;
/* alloc memory in the xkb struct */
- if (XkbcAllocNames(xkb, XkbSymbolsNameMask | XkbGroupNamesMask, 0, 0)
- != Success)
+ if (XkbcAllocNames(xkb, XkbGroupNamesMask, 0) != Success)
{
WSGO("Can not allocate names in CompileSymbols\n");
ACTION("Symbols not added\n");
@@ -2164,7 +2158,6 @@ CompileSymbols(XkbFile *file, struct xkb_desc * xkb, unsigned merge)
}
/* now copy info into xkb. */
- xkb->names->symbols = xkb_intern_atom(info.name);
if (info.aliases)
ApplyAliases(xkb, False, &info.aliases);
for (i = 0; i < XkbNumKbdGroups; i++)
diff --git a/src/xkbcomp/vmod.c b/src/xkbcomp/vmod.c
index b313cdd..b6476cb 100644
--- a/src/xkbcomp/vmod.c
+++ b/src/xkbcomp/vmod.c
@@ -48,7 +48,7 @@ ClearVModInfo(VModInfo * info, struct xkb_desc * xkb)
{
int i;
- if (XkbcAllocNames(xkb, XkbVirtualModNamesMask, 0, 0) != Success)
+ if (XkbcAllocNames(xkb, XkbVirtualModNamesMask, 0) != Success)
return;
if (XkbcAllocServerMap(xkb, XkbVirtualModsMask, 0) != Success)
return;