Remove KcCGST names from the map
Signed-off-by: Daniel Stone <daniel@fooishbar.org>master
parent
ed18e65eac
commit
b28823cc59
|
@ -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;
|
||||
|
|
24
src/alloc.c
24
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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -891,16 +891,13 @@ 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
|
||||
{
|
||||
WSGO("Cannot create struct xkb_names in CompileKeycodes\n");
|
||||
|
|
|
@ -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++;
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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++)
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue