Get rid of struct xkb_key_name
Just embed it directly. Signed-off-by: Ran Benita <ran234@gmail.com>master
parent
e8a6a5f09a
commit
7d9f031341
|
@ -327,11 +327,11 @@ write_keycodes(struct xkb_keymap *keymap, char **buf, size_t *size,
|
|||
|
||||
for (kc = keymap->min_key_code; kc <= keymap->max_key_code; kc++) {
|
||||
key = XkbKey(keymap, kc);
|
||||
if (key->name.name[0] == '\0')
|
||||
if (key->name[0] == '\0')
|
||||
continue;
|
||||
|
||||
write_buf(keymap, buf, size, offset, "\t\t%6s = %d;\n",
|
||||
XkbcKeyNameText(key->name.name), kc);
|
||||
XkbcKeyNameText(key->name), kc);
|
||||
}
|
||||
|
||||
for (i = 0; i < XkbNumIndicators; i++) {
|
||||
|
@ -811,7 +811,7 @@ write_symbols(struct xkb_keymap *keymap, char **buf, size_t *size,
|
|||
continue;
|
||||
|
||||
write_buf(keymap, buf, size, offset, "\t\tkey %6s {",
|
||||
XkbcKeyNameText(key->name.name));
|
||||
XkbcKeyNameText(key->name));
|
||||
|
||||
if (key->explicit & XkbExplicitKeyTypesMask) {
|
||||
bool multi_type = false;
|
||||
|
@ -935,7 +935,7 @@ write_symbols(struct xkb_keymap *keymap, char **buf, size_t *size,
|
|||
write_buf(keymap, buf, size, offset,
|
||||
"\t\tmodifier_map %s { %s };\n",
|
||||
get_mod_index_text(mod),
|
||||
XkbcKeyNameText(key->name.name));
|
||||
XkbcKeyNameText(key->name));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -284,10 +284,6 @@ struct xkb_indicator_map {
|
|||
unsigned int ctrls;
|
||||
};
|
||||
|
||||
struct xkb_key_name {
|
||||
char name[XkbKeyNameLength];
|
||||
};
|
||||
|
||||
struct xkb_key_alias {
|
||||
char real[XkbKeyNameLength];
|
||||
char alias[XkbKeyNameLength];
|
||||
|
@ -310,7 +306,7 @@ struct xkb_controls {
|
|||
};
|
||||
|
||||
struct xkb_key {
|
||||
struct xkb_key_name name;
|
||||
char name[XkbKeyNameLength];
|
||||
unsigned char explicit;
|
||||
struct xkb_sym_map sym_map;
|
||||
unsigned char modmap;
|
||||
|
|
|
@ -812,11 +812,11 @@ HandleRedirectKey(struct xkb_keymap *keymap, struct xkb_any_action *action,
|
|||
case F_Keycode:
|
||||
if (!ExprResolveKeyName(keymap->ctx, value, &rtrn))
|
||||
return ReportMismatch(action->type, field, "key name");
|
||||
tmp = KeyNameToLong(rtrn.keyName.name);
|
||||
tmp = KeyNameToLong(rtrn.name);
|
||||
if (!FindNamedKey(keymap, tmp, &kc, true, CreateKeyNames(keymap),
|
||||
0)) {
|
||||
return ReportNotFound(action->type, field, "Key",
|
||||
XkbcKeyNameText(rtrn.keyName.name));
|
||||
XkbcKeyNameText(rtrn.name));
|
||||
}
|
||||
act->new_kc = kc;
|
||||
return true;
|
||||
|
|
|
@ -779,7 +779,7 @@ ExprResolveKeyName(struct xkb_context *ctx, ExprDef *expr,
|
|||
exprTypeText(expr->type));
|
||||
return false;
|
||||
}
|
||||
memcpy(val_rtrn->keyName.name, expr->value.keyName, XkbKeyNameLength);
|
||||
memcpy(val_rtrn->name, expr->value.keyName, XkbKeyNameLength);
|
||||
return true;
|
||||
|
||||
case ExprIdent:
|
||||
|
|
|
@ -33,7 +33,7 @@ typedef union _ExprResult {
|
|||
char *str;
|
||||
int ival;
|
||||
unsigned uval;
|
||||
struct xkb_key_name keyName;
|
||||
char name[XkbKeyNameLength];
|
||||
} ExprResult;
|
||||
|
||||
extern int
|
||||
|
|
|
@ -757,7 +757,7 @@ CompileKeycodes(XkbFile *file, struct xkb_keymap *keymap,
|
|||
darray_resize0(keymap->keys, keymap->max_key_code + 1);
|
||||
for (kc = info.computedMin; kc <= info.computedMax; kc++)
|
||||
LongToKeyName(darray_item(info.names, kc),
|
||||
XkbKey(keymap, kc)->name.name);
|
||||
XkbKey(keymap, kc)->name);
|
||||
|
||||
if (info.name)
|
||||
keymap->keycodes_section_name = strdup(info.name);
|
||||
|
|
|
@ -231,7 +231,7 @@ FindNamedKey(struct xkb_keymap *keymap, unsigned long name,
|
|||
unsigned long tmp;
|
||||
key = XkbKey(keymap, kc);
|
||||
|
||||
tmp = KeyNameToLong(key->name.name);
|
||||
tmp = KeyNameToLong(key->name);
|
||||
if (tmp == name) {
|
||||
*kc_rtrn = kc;
|
||||
return true;
|
||||
|
@ -252,10 +252,10 @@ FindNamedKey(struct xkb_keymap *keymap, unsigned long name,
|
|||
for (kc = keymap->min_key_code; kc <= keymap->max_key_code; kc++) {
|
||||
key = XkbKey(keymap, kc);
|
||||
|
||||
if (key->name.name[0] == '\0') {
|
||||
if (key->name[0] == '\0') {
|
||||
char buf[XkbKeyNameLength + 1];
|
||||
LongToKeyName(name, buf);
|
||||
memcpy(key->name.name, buf, XkbKeyNameLength);
|
||||
memcpy(key->name, buf, XkbKeyNameLength);
|
||||
*kc_rtrn = kc;
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1966,12 +1966,12 @@ CompileSymbols(XkbFile *file, struct xkb_keymap *keymap,
|
|||
if (warningLevel > 3) {
|
||||
for (kc = keymap->min_key_code; kc <= keymap->max_key_code; kc++) {
|
||||
key = XkbKey(keymap, kc);
|
||||
if (key->name.name[0] == '\0')
|
||||
if (key->name[0] == '\0')
|
||||
continue;
|
||||
|
||||
if (XkbKeyNumGroups(keymap, kc) < 1)
|
||||
WARN("No symbols defined for <%.4s> (keycode %d)\n",
|
||||
key->name.name, kc);
|
||||
key->name, kc);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue