Remove KcCGST names from the map

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
master
Daniel Stone 2012-03-09 16:04:00 +00:00
parent ed18e65eac
commit b28823cc59
12 changed files with 16 additions and 80 deletions

View File

@ -329,18 +329,11 @@ struct xkb_key_alias {
}; };
struct xkb_names { struct xkb_names {
uint32_t keycodes;
uint32_t geometry;
uint32_t symbols;
uint32_t types;
uint32_t compat;
uint32_t vmods[XkbNumVirtualMods]; uint32_t vmods[XkbNumVirtualMods];
uint32_t indicators[XkbNumIndicators]; uint32_t indicators[XkbNumIndicators];
uint32_t groups[XkbNumKbdGroups]; uint32_t groups[XkbNumKbdGroups];
struct xkb_key_name * keys; struct xkb_key_name * keys;
struct xkb_key_alias * key_aliases; struct xkb_key_alias * key_aliases;
uint32_t *radio_groups;
uint32_t phys_symbols;
xkb_keycode_t num_keys; xkb_keycode_t num_keys;
xkb_keycode_t num_key_aliases; xkb_keycode_t num_key_aliases;

View File

@ -102,7 +102,7 @@ XkbcFreeCompatMap(struct xkb_desc * xkb)
} }
int 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; struct xkb_names * names;
@ -164,27 +164,6 @@ XkbcAllocNames(struct xkb_desc * xkb, unsigned which, int nTotalRG, int nTotalAl
names->num_key_aliases = nTotalAliases; 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; return Success;
} }
@ -212,7 +191,6 @@ XkbcFreeNames(struct xkb_desc * xkb)
free(names->keys); free(names->keys);
free(names->key_aliases); free(names->key_aliases);
free(names->radio_groups);
free(names); free(names);
xkb->names = NULL; xkb->names = NULL;
} }

View File

@ -35,8 +35,7 @@ extern int
XkbcAllocCompatMap(struct xkb_desc * xkb, unsigned which, unsigned nSI); XkbcAllocCompatMap(struct xkb_desc * xkb, unsigned which, unsigned nSI);
extern int extern int
XkbcAllocNames(struct xkb_desc * xkb, unsigned which, int nTotalRG, XkbcAllocNames(struct xkb_desc * xkb, unsigned which, int nTotalAliases);
int nTotalAliases);
extern int extern int
XkbcAllocControls(struct xkb_desc * xkb, unsigned which); XkbcAllocControls(struct xkb_desc * xkb, unsigned which);

View File

@ -246,7 +246,7 @@ ApplyAliases(struct xkb_desc * xkb, Bool toGeom, AliasInfo ** info_in)
} }
else else
{ {
status = XkbcAllocNames(xkb, XkbKeyAliasesMask, 0, nOld + nNew); status = XkbcAllocNames(xkb, XkbKeyAliasesMask, nOld + nNew);
if (xkb->names) if (xkb->names)
old = xkb->names->key_aliases; old = xkb->names->key_aliases;
} }

View File

@ -817,18 +817,6 @@ CompileCompatMap(XkbFile *file, struct xkb_desc * xkb, unsigned merge,
WSGO("Couldn't allocate compatibility map\n"); WSGO("Couldn't allocate compatibility map\n");
return False; 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); size = info.nInterps * sizeof(struct xkb_sym_interpret);
if (size > 0) if (size > 0)
{ {

View File

@ -3650,8 +3650,7 @@ CompileGeometry(XkbFile *file, struct xkb_desc * xkb, unsigned merge)
if (info.name != NULL) if (info.name != NULL)
{ {
geom->name = xkb_intern_atom(info.name); geom->name = xkb_intern_atom(info.name);
if (XkbcAllocNames(xkb, XkbGeometryNameMask, 0, 0) == Success) XkbcAllocNames(xkb, XkbGeometryNameMask, 0);
xkb->names->geometry = geom->name;
} }
if (info.fontSpec != None) if (info.fontSpec != None)
geom->label_font = XkbcAtomGetString(info.fontSpec); geom->label_font = XkbcAtomGetString(info.fontSpec);

View File

@ -371,7 +371,7 @@ CopyIndicatorMapDefs(struct xkb_desc * xkb, LEDInfo *leds, LEDInfo **unboundRtrn
LEDInfo *led, *next; LEDInfo *led, *next;
LEDInfo *unbound, *last; LEDInfo *unbound, *last;
if (XkbcAllocNames(xkb, XkbIndicatorNamesMask, 0, 0) != Success) if (XkbcAllocNames(xkb, XkbIndicatorNamesMask, 0) != Success)
{ {
WSGO("Couldn't allocate names\n"); WSGO("Couldn't allocate names\n");
ACTION("Indicator names may be incorrect\n"); ACTION("Indicator names may be incorrect\n");

View File

@ -891,15 +891,12 @@ CompileKeycodes(XkbFile *file, struct xkb_desc * xkb, unsigned merge)
xkb->max_key_code = info.explicitMax; xkb->max_key_code = info.explicitMax;
else else
xkb->max_key_code = info.computedMax; xkb->max_key_code = info.computedMax;
if (XkbcAllocNames(xkb, XkbKeyNamesMask | XkbIndicatorNamesMask, 0, 0) if (XkbcAllocNames(xkb, XkbKeyNamesMask | XkbIndicatorNamesMask, 0)
== Success) == Success)
{ {
int i; int i;
xkb->names->keycodes = xkb_intern_atom(info.name);
for (i = info.computedMin; i <= info.computedMax; i++) for (i = info.computedMin; i <= info.computedMax; i++)
{
LongToKeyName(info.names[i], xkb->names->keys[i].name); LongToKeyName(info.names[i], xkb->names->keys[i].name);
}
} }
else else
{ {

View File

@ -1155,17 +1155,6 @@ CompileKeyTypes(XkbFile *file, struct xkb_desc * xkb, unsigned merge)
KeyTypeInfo *def; KeyTypeInfo *def;
struct xkb_key_type *type, *next; 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; i = info.nTypes;
if ((info.stdPresent & XkbOneLevelMask) == 0) if ((info.stdPresent & XkbOneLevelMask) == 0)
i++; i++;

View File

@ -289,7 +289,7 @@ FindNamedKey(struct xkb_desc * xkb,
{ {
if ((!xkb->names) || (!xkb->names->keys)) if ((!xkb->names) || (!xkb->names->keys))
{ {
if (XkbcAllocNames(xkb, XkbKeyNamesMask, 0, 0) != Success) if (XkbcAllocNames(xkb, XkbKeyNamesMask, 0) != Success)
{ {
if (warningLevel > 0) if (warningLevel > 0)
{ {

View File

@ -1883,9 +1883,7 @@ CopySymbolsDef(struct xkb_desc * xkb, KeyInfo *key, int start_from)
{ {
if ((start_from == 0) && (warningLevel >= 5)) if ((start_from == 0) && (warningLevel >= 5))
{ {
WARN("Key %s not found in %s keycodes\n", WARN("Key %s not found in keycodes\n", longText(key->name));
longText(key->name),
XkbcAtomText(xkb->names->keycodes));
ACTION("Symbols ignored\n"); ACTION("Symbols ignored\n");
} }
return False; return False;
@ -2035,9 +2033,8 @@ CopySymbolsDef(struct xkb_desc * xkb, KeyInfo *key, int start_from)
{ {
if (warningLevel >= 1) if (warningLevel >= 1)
{ {
WARN("Key %s not found in %s keycodes\n", WARN("Key %s not found in keycodes\n",
longText(key->nameForOverlayKey), longText(key->nameForOverlayKey));
XkbcAtomText(xkb->names->keycodes));
ACTION("Not treating %s as an overlay key \n", ACTION("Not treating %s as an overlay key \n",
longText(key->name)); longText(key->name));
} }
@ -2083,9 +2080,8 @@ CopyModMapDef(struct xkb_desc * xkb, ModMapEntry *entry)
{ {
if (warningLevel >= 5) if (warningLevel >= 5)
{ {
WARN("Key %s not found in %s keycodes\n", WARN("Key %s not found in keycodes\n",
longText(entry->u.keyName), longText(entry->u.keyName));
XkbcAtomText(xkb->names->keycodes));
ACTION("Modifier map entry for %s not updated\n", ACTION("Modifier map entry for %s not updated\n",
XkbcModIndexText(entry->modifier)); XkbcModIndexText(entry->modifier));
} }
@ -2096,9 +2092,8 @@ CopyModMapDef(struct xkb_desc * xkb, ModMapEntry *entry)
{ {
if (warningLevel > 5) if (warningLevel > 5)
{ {
WARN("Key \"%s\" not found in %s symbol map\n", WARN("Key \"%s\" not found in symbol map\n",
XkbcKeysymText(entry->u.keySym), XkbcKeysymText(entry->u.keySym));
XkbcAtomText(xkb->names->symbols));
ACTION("Modifier map entry for %s not updated\n", ACTION("Modifier map entry for %s not updated\n",
XkbcModIndexText(entry->modifier)); XkbcModIndexText(entry->modifier));
} }
@ -2136,8 +2131,7 @@ CompileSymbols(XkbFile *file, struct xkb_desc * xkb, unsigned merge)
KeyInfo *key; KeyInfo *key;
/* alloc memory in the xkb struct */ /* alloc memory in the xkb struct */
if (XkbcAllocNames(xkb, XkbSymbolsNameMask | XkbGroupNamesMask, 0, 0) if (XkbcAllocNames(xkb, XkbGroupNamesMask, 0) != Success)
!= Success)
{ {
WSGO("Can not allocate names in CompileSymbols\n"); WSGO("Can not allocate names in CompileSymbols\n");
ACTION("Symbols not added\n"); ACTION("Symbols not added\n");
@ -2164,7 +2158,6 @@ CompileSymbols(XkbFile *file, struct xkb_desc * xkb, unsigned merge)
} }
/* now copy info into xkb. */ /* now copy info into xkb. */
xkb->names->symbols = xkb_intern_atom(info.name);
if (info.aliases) if (info.aliases)
ApplyAliases(xkb, False, &info.aliases); ApplyAliases(xkb, False, &info.aliases);
for (i = 0; i < XkbNumKbdGroups; i++) for (i = 0; i < XkbNumKbdGroups; i++)

View File

@ -48,7 +48,7 @@ ClearVModInfo(VModInfo * info, struct xkb_desc * xkb)
{ {
int i; int i;
if (XkbcAllocNames(xkb, XkbVirtualModNamesMask, 0, 0) != Success) if (XkbcAllocNames(xkb, XkbVirtualModNamesMask, 0) != Success)
return; return;
if (XkbcAllocServerMap(xkb, XkbVirtualModsMask, 0) != Success) if (XkbcAllocServerMap(xkb, XkbVirtualModsMask, 0) != Success)
return; return;