Add XkbModIndexText replacement Now, I think we should have all the *Text functions we need.
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
diff --git a/include/X11/extensions/XKBcommon.h b/include/X11/extensions/XKBcommon.h
index d857ff2..b207219 100644
--- a/include/X11/extensions/XKBcommon.h
+++ b/include/X11/extensions/XKBcommon.h
@@ -248,6 +248,9 @@ extern char *
XkbcVModMaskText(XkbcDescPtr xkb, unsigned modMask, unsigned mask);
extern char *
+XkbcModIndexText(unsigned ndx);
+
+extern char *
XkbcModMaskText(unsigned mask, Bool cFormat);
extern char *
diff --git a/src/text.c b/src/text.c
index 1b24cf6..207177e 100644
--- a/src/text.c
+++ b/src/text.c
@@ -248,6 +248,22 @@ static char *modNames[XkbNumModifiers] = {
};
char *
+XkbcModIndexText(unsigned ndx)
+{
+ char *buf;
+
+ if (ndx < XkbNumModifiers)
+ return modNames[ndx];
+ else if (ndx == XkbNoModifier)
+ return "none";
+
+ buf = tbGetBuffer(32);
+ snprintf(buf, 32, "ILLEGAL_%02x", ndx);
+
+ return buf;
+}
+
+char *
XkbcModMaskText(unsigned mask, Bool cFormat)
{
int i, rem, bit;
diff --git a/src/xkbcomp/symbols.c b/src/xkbcomp/symbols.c
index 0f5ae27..f8d8ddf 100644
--- a/src/xkbcomp/symbols.c
+++ b/src/xkbcomp/symbols.c
@@ -662,8 +662,8 @@ AddModMapEntry(SymbolsInfo * info, ModMapEntry * new)
("%s added to symbol map for multiple modifiers\n",
XkbcKeysymText(new->u.keySym));
ACTION2("Using %s, ignoring %s.\n",
- XkbModIndexText(use, XkbMessage),
- XkbModIndexText(ignore, XkbMessage));
+ XkbcModIndexText(use),
+ XkbcModIndexText(ignore));
mm->modifier = use;
}
return True;
@@ -687,8 +687,8 @@ AddModMapEntry(SymbolsInfo * info, ModMapEntry * new)
ERROR1("Key %s added to map for multiple modifiers\n",
longText(new->u.keyName));
ACTION2("Using %s, ignoring %s.\n",
- XkbModIndexText(use, XkbMessage),
- XkbModIndexText(ignore, XkbMessage));
+ XkbcModIndexText(use),
+ XkbcModIndexText(ignore));
mm->modifier = use;
}
return True;
@@ -699,7 +699,7 @@ AddModMapEntry(SymbolsInfo * info, ModMapEntry * new)
{
WSGO("Could not allocate modifier map entry\n");
ACTION1("Modifier map for %s will be incomplete\n",
- XkbModIndexText(new->modifier, XkbMessage));
+ XkbcModIndexText(new->modifier));
return False;
}
*mm = *new;
@@ -1623,7 +1623,7 @@ HandleModMapDef(ModMapDef * def,
{
ERROR("Modmap entries may contain only key names or keysyms\n");
ACTION1("Illegal definition for %s modifier ignored\n",
- XkbModIndexText(tmp.modifier, XkbMessage));
+ XkbcModIndexText(tmp.modifier));
continue;
}
@@ -2166,7 +2166,7 @@ CopyModMapDef(XkbcDescPtr xkb, ModMapEntry *entry)
longText(entry->u.keyName),
XkbcAtomText(xkb->names->keycodes));
ACTION1("Modifier map entry for %s not updated\n",
- XkbModIndexText(entry->modifier, XkbMessage));
+ XkbcModIndexText(entry->modifier));
}
return False;
}
@@ -2179,7 +2179,7 @@ CopyModMapDef(XkbcDescPtr xkb, ModMapEntry *entry)
XkbcKeysymText(entry->u.keySym),
XkbcAtomText(xkb->names->symbols));
ACTION1("Modifier map entry for %s not updated\n",
- XkbModIndexText(entry->modifier, XkbMessage));
+ XkbcModIndexText(entry->modifier));
}
return False;
}