Add more *Text functions from xkbfile

This should cover all the usage in xkbcomp. The format arguments were
dropped except for the special case of XkbModMaskText, which needs to
write in XkbCFile format in HandleVModDef. This was just changed to a
Bool to avoid the need for the macros in XKBfile.h.

The function prefixes have been renamed to be unique from xkbfile.
master
Dan Nicholson 2009-03-28 14:06:26 -07:00
parent 8544cde52e
commit 2671b777cf
14 changed files with 397 additions and 152 deletions

View File

@ -159,10 +159,28 @@ extern Atom
XkbcInternAtom(char *name, Bool onlyIfExists); XkbcInternAtom(char *name, Bool onlyIfExists);
extern char * extern char *
XkbConfigText(unsigned config); XkbcAtomText(Atom atm);
extern char * extern char *
XkbActionTypeText(unsigned type); XkbcModMaskText(unsigned mask, Bool cFormat);
extern char *
XkbcConfigText(unsigned config);
extern char *
XkbcGeomFPText(int val);
extern char *
XkbcActionTypeText(unsigned type);
extern char *
XkbcKeysymText(KeySym sym);
extern char *
XkbcKeyNameText(char *name);
extern char *
XkbcSIMatchText(unsigned type);
_XFUNCPROTOEND _XFUNCPROTOEND

View File

@ -28,9 +28,177 @@
#include <config.h> #include <config.h>
#endif #endif
#include "X11/extensions/XKBcommon.h" #include "X11/extensions/XKBcommon.h"
#include "XKBcommonint.h"
#include <X11/extensions/XKM.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#define BUFFER_SIZE 512
static char textBuffer[BUFFER_SIZE];
static int tbNext = 0;
static char *
tbGetBuffer(unsigned size)
{
char *rtrn;
if (size >= BUFFER_SIZE)
return NULL;
if ((BUFFER_SIZE - tbNext) <= size)
tbNext = 0;
rtrn = &textBuffer[tbNext];
tbNext += size;
return rtrn;
}
static char *
XkbStringText(char *str)
{
char *buf, *in, *out;
int len;
Bool ok;
if (!str) {
buf = tbGetBuffer(2);
buf[0] = '\0';
return buf;
}
/* Find if there are any non-printable characters */
for (ok = True, len = 0, in = str; *in != '\0'; in++, len++) {
if (isprint(*in))
continue;
ok = False;
switch (*in) {
case '\n': case '\t': case '\v':
case '\b': case '\r': case '\f':
len++;
break;
default:
/* octal: \0ooo */
len += 4;
break;
}
}
if (ok)
return str;
/* Cleanup non-printable characters */
buf = tbGetBuffer(len + 1);
for (in = str, out = buf; *in != '\0'; in++) {
if (isprint(*in)) {
*out++ = *in;
continue;
}
*out++ = '\\';
switch (*in) {
case '\n':
*out++ = 'n';
break;
case '\t':
*out++ = 't';
break;
case '\v':
*out++ = 'v';
break;
case '\b':
*out++ = 'b';
break;
case '\r':
*out++ = 'r';
break;
case '\f':
*out++ = 'f';
break;
default:
*out++ = '0';
snprintf(out, 3, "%o", *in);
while (*out != '\0')
out++;
}
}
*out++ = '\0';
return buf;
}
char * char *
XkbConfigText(unsigned config) XkbcAtomText(Atom atm)
{
char *tmp, *rtrn;
int len;
tmp = XkbcAtomGetString(atm);
if (!tmp)
return "";
len = strlen(tmp) + 1;
if (len >= BUFFER_SIZE)
len = BUFFER_SIZE - 2;
rtrn = tbGetBuffer(len);
strncpy(rtrn, tmp, len);
rtrn[len] = '\0';
_XkbFree(tmp);
return XkbStringText(rtrn);
}
static char *modNames[XkbNumModifiers] = {
"Shift",
"Lock",
"Control",
"Mod1",
"Mod2",
"Mod3",
"Mod4",
"Mod5"
};
char *
XkbcModMaskText(unsigned mask, Bool cFormat)
{
int i, rem, bit;
char *str, *buf;
if ((mask & 0xff) == 0xff)
return (cFormat ? "0xff" : "all");
if ((mask & 0xff) == 0)
return (cFormat ? "0" : "none");
rem = 64;
buf = tbGetBuffer(rem);
str = buf;
buf[0] = '\0';
for (i = 0, bit = 1; i < XkbNumModifiers && rem > 1; i++, bit <<= 1) {
int len;
if (!(mask & bit))
continue;
len = snprintf(str, rem, "%s%s%s",
(str != buf) ? (cFormat ? "|" : "+") : "",
modNames[i],
cFormat ? "Mask" : "");
rem -= len;
str += len;
}
return buf;
}
char *
XkbcConfigText(unsigned config)
{ {
switch (config) { switch (config) {
case XkmSemanticsFile: case XkmSemanticsFile:
@ -59,6 +227,24 @@ XkbConfigText(unsigned config)
} }
} }
char *
XkbcGeomFPText(int val)
{
char *buf;
int whole, frac;
buf = tbGetBuffer(12);
whole = val / XkbGeomPtsPerMM;
frac = val % XkbGeomPtsPerMM;
if (frac != 0)
snprintf(buf, 12, "%d.%d", whole, frac);
else
snprintf(buf, 12, "%d", whole);
return buf;
}
static char *actionTypeNames[XkbSA_NumActions]= { static char *actionTypeNames[XkbSA_NumActions]= {
"NoAction", /* XkbSA_NoAction */ "NoAction", /* XkbSA_NoAction */
"SetMods", /* XkbSA_SetMods */ "SetMods", /* XkbSA_SetMods */
@ -84,9 +270,73 @@ static char *actionTypeNames[XkbSA_NumActions]= {
}; };
char * char *
XkbActionTypeText(unsigned type) XkbcActionTypeText(unsigned type)
{ {
if (type <= XkbSA_LastAction) if (type <= XkbSA_LastAction)
return actionTypeNames[type]; return actionTypeNames[type];
return "Private"; return "Private";
} }
char *
XkbcKeysymText(KeySym sym)
{
char *buf;
if (sym == NoSymbol)
return "NoSymbol";
if ((buf = XkbcKeysymToString(sym)))
return buf;
buf = tbGetBuffer(32);
snprintf(buf, 32, "0x%lx", (long)sym);
return buf;
}
char *
XkbcKeyNameText(char *name)
{
char *buf;
int len;
buf = tbGetBuffer(7);
buf[0] = '<';
strncpy(&buf[1], name, 4);
buf[5] = '\0';
len = strlen(buf);
buf[len++] = '>';
buf[len] = '\0';
return buf;
}
static char *siMatchText[5] = {
"NoneOf", /* XkbSI_NoneOf */
"AnyOfOrNone", /* XkbSI_AnyOfOrNone */
"AnyOf", /* XkbSI_AnyOf */
"AllOf", /* XkbSI_AllOf */
"Exactly" /* XkbSI_Exactly */
};
char *
XkbcSIMatchText(unsigned type)
{
char *buf;
switch (type & XkbSI_OpMask) {
case XkbSI_NoneOf:
return siMatchText[0];
case XkbSI_AnyOfOrNone:
return siMatchText[1];
case XkbSI_AnyOf:
return siMatchText[2];
case XkbSI_AllOf:
return siMatchText[3];
case XkbSI_Exactly:
return siMatchText[4];
default:
buf = tbGetBuffer(40);
snprintf(buf, 40, "0x%x", type & XkbSI_OpMask);
return buf;
}
}

View File

@ -300,7 +300,7 @@ static Bool
ReportMismatch(unsigned action, unsigned field, const char *type) ReportMismatch(unsigned action, unsigned field, const char *type)
{ {
ERROR2("Value of %s field must be of type %s\n", fieldText(field), type); ERROR2("Value of %s field must be of type %s\n", fieldText(field), type);
ACTION1("Action %s definition ignored\n", XkbActionTypeText(action)); ACTION1("Action %s definition ignored\n", XkbcActionTypeText(action));
return False; return False;
} }
@ -308,7 +308,7 @@ static Bool
ReportIllegal(unsigned action, unsigned field) ReportIllegal(unsigned action, unsigned field)
{ {
ERROR2("Field %s is not defined for an action of type %s\n", ERROR2("Field %s is not defined for an action of type %s\n",
fieldText(field), XkbActionTypeText(action)); fieldText(field), XkbcActionTypeText(action));
ACTION("Action definition ignored\n"); ACTION("Action definition ignored\n");
return False; return False;
} }
@ -317,7 +317,7 @@ static Bool
ReportActionNotArray(unsigned action, unsigned field) ReportActionNotArray(unsigned action, unsigned field)
{ {
ERROR2("The %s field in the %s action is not an array\n", ERROR2("The %s field in the %s action is not an array\n",
fieldText(field), XkbActionTypeText(action)); fieldText(field), XkbcActionTypeText(action));
ACTION("Action definition ignored\n"); ACTION("Action definition ignored\n");
return False; return False;
} }
@ -327,7 +327,7 @@ ReportNotFound(unsigned action, unsigned field, const char *what, char *bad)
{ {
ERROR2("%s named %s not found\n", what, bad); ERROR2("%s named %s not found\n", what, bad);
ACTION2("Ignoring the %s field of an %s action\n", fieldText(field), ACTION2("Ignoring the %s field of an %s action\n", fieldText(field),
XkbActionTypeText(action)); XkbcActionTypeText(action));
return False; return False;
} }
@ -499,7 +499,7 @@ CheckGroupField(unsigned action,
{ {
ERROR2("Illegal group %d (must be in the range 1..%d)\n", rtrn.ival, ERROR2("Illegal group %d (must be in the range 1..%d)\n", rtrn.ival,
XkbNumKbdGroups); XkbNumKbdGroups);
ACTION1("Action %s definition ignored\n", XkbActionTypeText(action)); ACTION1("Action %s definition ignored\n", XkbcActionTypeText(action));
return False; return False;
} }
if (value->op == OpNegate) if (value->op == OpNegate)
@ -1055,8 +1055,7 @@ HandleRedirectKey(XkbcDescPtr xkb,
if (!FindNamedKey(xkb, tmp, &t1, True, CreateKeyNames(xkb), 0)) if (!FindNamedKey(xkb, tmp, &t1, True, CreateKeyNames(xkb), 0))
{ {
return ReportNotFound(action->type, field, "Key", return ReportNotFound(action->type, field, "Key",
XkbKeyNameText(rtrn.keyName.name, XkbcKeyNameText(rtrn.keyName.name));
XkbMessage));
} }
act->new_key = t1; act->new_key = t1;
return True; return True;

View File

@ -40,8 +40,7 @@ HandleCollision(AliasInfo * old, AliasInfo * new)
(warningLevel > 9)) (warningLevel > 9))
{ {
WARN2("Alias of %s for %s declared more than once\n", WARN2("Alias of %s for %s declared more than once\n",
XkbKeyNameText(new->alias, XkbMessage), XkbcKeyNameText(new->alias), XkbcKeyNameText(new->real));
XkbKeyNameText(new->real, XkbMessage));
ACTION("First definition ignored\n"); ACTION("First definition ignored\n");
} }
} }
@ -62,10 +61,9 @@ HandleCollision(AliasInfo * old, AliasInfo * new)
(warningLevel > 9)) (warningLevel > 9))
{ {
WARN1("Multiple definitions for alias %s\n", WARN1("Multiple definitions for alias %s\n",
XkbKeyNameText(old->alias, XkbMessage)); XkbcKeyNameText(old->alias));
ACTION2("Using %s, ignoring %s\n", ACTION2("Using %s, ignoring %s\n",
XkbKeyNameText(use, XkbMessage), XkbcKeyNameText(use), XkbcKeyNameText(ignore));
XkbKeyNameText(ignore, XkbMessage));
} }
if (use != old->real) if (use != old->real)
memcpy(old->real, use, XkbKeyNameLength); memcpy(old->real, use, XkbKeyNameLength);
@ -188,8 +186,7 @@ ApplyAliases(XkbcDescPtr xkb, Bool toGeom, AliasInfo ** info_in)
if (warningLevel > 4) if (warningLevel > 4)
{ {
WARN2("Attempt to alias %s to non-existent key %s\n", WARN2("Attempt to alias %s to non-existent key %s\n",
XkbKeyNameText(info->alias, XkbMessage), XkbcKeyNameText(info->alias), XkbcKeyNameText(info->real));
XkbKeyNameText(info->real, XkbMessage));
ACTION("Ignored\n"); ACTION("Ignored\n");
} }
info->alias[0] = '\0'; info->alias[0] = '\0';
@ -202,8 +199,8 @@ ApplyAliases(XkbcDescPtr xkb, Bool toGeom, AliasInfo ** info_in)
{ {
WARN("Attempt to create alias with the name of a real key\n"); WARN("Attempt to create alias with the name of a real key\n");
ACTION2("Alias \"%s = %s\" ignored\n", ACTION2("Alias \"%s = %s\" ignored\n",
XkbKeyNameText(info->alias, XkbMessage), XkbcKeyNameText(info->alias),
XkbKeyNameText(info->real, XkbMessage)); XkbcKeyNameText(info->real));
} }
info->alias[0] = '\0'; info->alias[0] = '\0';
continue; continue;

View File

@ -91,9 +91,9 @@ siText(SymInterpInfo * si, CompatInfo * info)
else else
{ {
snprintf(buf, sizeof(buf), "%s+%s(%s)", snprintf(buf, sizeof(buf), "%s+%s(%s)",
XkbKeysymText(si->interp.sym, XkbMessage), XkbcKeysymText(si->interp.sym),
XkbSIMatchText(si->interp.match, XkbMessage), XkbcSIMatchText(si->interp.match),
XkbModMaskText(si->interp.mods, XkbMessage)); XkbcModMaskText(si->interp.mods, False));
} }
return buf; return buf;
} }
@ -304,8 +304,7 @@ ResolveStateAndPredicate(ExprDef * expr,
*pred_rtrn = XkbSI_Exactly; *pred_rtrn = XkbSI_Exactly;
if (expr->op == ExprActionDecl) if (expr->op == ExprActionDecl)
{ {
char *pred_txt = char *pred_txt = XkbcAtomText(expr->value.action.name);
XkbAtomText(NULL, expr->value.action.name, XkbMessage);
if (uStrCaseCmp(pred_txt, "noneof") == 0) if (uStrCaseCmp(pred_txt, "noneof") == 0)
*pred_rtrn = XkbSI_NoneOf; *pred_rtrn = XkbSI_NoneOf;
else if (uStrCaseCmp(pred_txt, "anyofornone") == 0) else if (uStrCaseCmp(pred_txt, "anyofornone") == 0)
@ -326,7 +325,7 @@ ResolveStateAndPredicate(ExprDef * expr,
} }
else if (expr->op == ExprIdent) else if (expr->op == ExprIdent)
{ {
char *pred_txt = XkbAtomText(NULL, expr->value.str, XkbMessage); char *pred_txt = XkbcAtomText(expr->value.str);
if ((pred_txt) && (uStrCaseCmp(pred_txt, "any") == 0)) if ((pred_txt) && (uStrCaseCmp(pred_txt, "any") == 0))
{ {
*pred_rtrn = XkbSI_AnyOf; *pred_rtrn = XkbSI_AnyOf;

View File

@ -326,7 +326,7 @@ ExprResolveModIndex(ExprDef * expr,
} }
if (!ok) if (!ok)
ERROR1("Cannot determine modifier index for \"%s\"\n", ERROR1("Cannot determine modifier index for \"%s\"\n",
XkbAtomText(NULL, expr->value.str, XkbMessage)); XkbcAtomText(expr->value.str));
break; break;
case ExprFieldRef: case ExprFieldRef:
bogus = "field reference"; bogus = "field reference";
@ -422,7 +422,7 @@ ExprResolveBoolean(ExprDef * expr,
} }
if (!ok) if (!ok)
ERROR1("Identifier \"%s\" of type int is unknown\n", ERROR1("Identifier \"%s\" of type int is unknown\n",
XkbAtomText(NULL, expr->value.str, XkbMessage)); XkbcAtomText(expr->value.str));
return ok; return ok;
case ExprFieldRef: case ExprFieldRef:
if (lookup) if (lookup)
@ -433,8 +433,8 @@ ExprResolveBoolean(ExprDef * expr,
} }
if (!ok) if (!ok)
ERROR2("Default \"%s.%s\" of type boolean is unknown\n", ERROR2("Default \"%s.%s\" of type boolean is unknown\n",
XkbAtomText(NULL, expr->value.field.element, XkbMessage), XkbcAtomText(expr->value.field.element),
XkbAtomText(NULL, expr->value.field.field, XkbMessage)); XkbcAtomText(expr->value.field.field));
return ok; return ok;
case OpInvert: case OpInvert:
case OpNot: case OpNot:
@ -512,7 +512,7 @@ ExprResolveFloat(ExprDef * expr,
} }
if (!ok) if (!ok)
ERROR1("Numeric identifier \"%s\" unknown\n", ERROR1("Numeric identifier \"%s\" unknown\n",
XkbAtomText(NULL, expr->value.str, XkbMessage)); XkbcAtomText(expr->value.str));
return ok; return ok;
case ExprFieldRef: case ExprFieldRef:
if (lookup) if (lookup)
@ -523,8 +523,8 @@ ExprResolveFloat(ExprDef * expr,
} }
if (!ok) if (!ok)
ERROR2("Numeric default \"%s.%s\" unknown\n", ERROR2("Numeric default \"%s.%s\" unknown\n",
XkbAtomText(NULL, expr->value.field.element, XkbMessage), XkbcAtomText(expr->value.field.element),
XkbAtomText(NULL, expr->value.field.field, XkbMessage)); XkbcAtomText(expr->value.field.field));
return ok; return ok;
case OpAdd: case OpAdd:
case OpSubtract: case OpSubtract:
@ -633,7 +633,7 @@ ExprResolveInteger(ExprDef * expr,
} }
if (!ok) if (!ok)
ERROR1("Identifier \"%s\" of type int is unknown\n", ERROR1("Identifier \"%s\" of type int is unknown\n",
XkbAtomText(NULL, expr->value.str, XkbMessage)); XkbcAtomText(expr->value.str));
return ok; return ok;
case ExprFieldRef: case ExprFieldRef:
if (lookup) if (lookup)
@ -644,8 +644,8 @@ ExprResolveInteger(ExprDef * expr,
} }
if (!ok) if (!ok)
ERROR2("Default \"%s.%s\" of type int is unknown\n", ERROR2("Default \"%s.%s\" of type int is unknown\n",
XkbAtomText(NULL, expr->value.field.element, XkbMessage), XkbcAtomText(expr->value.field.element),
XkbAtomText(NULL, expr->value.field.field, XkbMessage)); XkbcAtomText(expr->value.field.field));
return ok; return ok;
case OpAdd: case OpAdd:
case OpSubtract: case OpSubtract:
@ -741,7 +741,7 @@ ExprResolveString(ExprDef * expr,
} }
if (!ok) if (!ok)
ERROR1("Identifier \"%s\" of type string not found\n", ERROR1("Identifier \"%s\" of type string not found\n",
XkbAtomText(NULL, expr->value.str, XkbMessage)); XkbcAtomText(expr->value.str));
return ok; return ok;
case ExprFieldRef: case ExprFieldRef:
if (lookup) if (lookup)
@ -752,8 +752,8 @@ ExprResolveString(ExprDef * expr,
} }
if (!ok) if (!ok)
ERROR2("Default \"%s.%s\" of type string not found\n", ERROR2("Default \"%s.%s\" of type string not found\n",
XkbAtomText(NULL, expr->value.field.element, XkbMessage), XkbcAtomText(expr->value.field.element),
XkbAtomText(NULL, expr->value.field.field, XkbMessage)); XkbcAtomText(expr->value.field.field));
return ok; return ok;
case OpAdd: case OpAdd:
left = expr->value.binary.left; left = expr->value.binary.left;
@ -843,7 +843,7 @@ ExprResolveKeyName(ExprDef * expr,
} }
if (!ok) if (!ok)
ERROR1("Identifier \"%s\" of type string not found\n", ERROR1("Identifier \"%s\" of type string not found\n",
XkbAtomText(NULL, expr->value.str, XkbMessage)); XkbcAtomText(expr->value.str));
return ok; return ok;
case ExprFieldRef: case ExprFieldRef:
if (lookup) if (lookup)
@ -854,8 +854,8 @@ ExprResolveKeyName(ExprDef * expr,
} }
if (!ok) if (!ok)
ERROR2("Default \"%s.%s\" of type key name not found\n", ERROR2("Default \"%s.%s\" of type key name not found\n",
XkbAtomText(NULL, expr->value.field.element, XkbMessage), XkbcAtomText(expr->value.field.element),
XkbAtomText(NULL, expr->value.field.field, XkbMessage)); XkbcAtomText(expr->value.field.field));
return ok; return ok;
case OpAdd: case OpAdd:
if (bogus == NULL) if (bogus == NULL)
@ -917,7 +917,7 @@ ExprResolveEnum(ExprDef * expr, ExprResult * val_rtrn, LookupEntry * values)
{ {
int nOut = 0; int nOut = 0;
ERROR1("Illegal identifier %s (expected one of: ", ERROR1("Illegal identifier %s (expected one of: ",
XkbAtomText(NULL, expr->value.str, XkbMessage)); XkbcAtomText(expr->value.str));
while (values && values->name) while (values && values->name)
{ {
if (nOut != 0) if (nOut != 0)
@ -963,7 +963,7 @@ ExprResolveMask(ExprDef * expr,
} }
if (!ok) if (!ok)
ERROR1("Identifier \"%s\" of type int is unknown\n", ERROR1("Identifier \"%s\" of type int is unknown\n",
XkbAtomText(NULL, expr->value.str, XkbMessage)); XkbcAtomText(expr->value.str));
return ok; return ok;
case ExprFieldRef: case ExprFieldRef:
if (lookup) if (lookup)
@ -974,8 +974,8 @@ ExprResolveMask(ExprDef * expr,
} }
if (!ok) if (!ok)
ERROR2("Default \"%s.%s\" of type int is unknown\n", ERROR2("Default \"%s.%s\" of type int is unknown\n",
XkbAtomText(NULL, expr->value.field.element, XkbMessage), XkbcAtomText(expr->value.field.element),
XkbAtomText(NULL, expr->value.field.field, XkbMessage)); XkbcAtomText(expr->value.field.field));
return ok; return ok;
case ExprArrayRef: case ExprArrayRef:
bogus = "array reference"; bogus = "array reference";

View File

@ -67,8 +67,8 @@ typedef struct _ShapeInfo
int dfltCornerRadius; int dfltCornerRadius;
} ShapeInfo; } ShapeInfo;
#define shText(d,s) \ #define shText(d, s) \
((s)?XkbAtomText((d),(s)->name,XkbMessage):"default shape") ((s) ? XkbcAtomText((s)->name) : "default shape")
#define _GD_Priority (1<<0) #define _GD_Priority (1<<0)
#define _GD_Top (1<<1) #define _GD_Top (1<<1)
@ -158,8 +158,8 @@ typedef struct _RowInfo
KeyInfo dfltKey; KeyInfo dfltKey;
struct _SectionInfo *section; struct _SectionInfo *section;
} RowInfo; } RowInfo;
#define rowText(d,r) \ #define rowText(d, r) \
((r)?XkbAtomText((d),(r)->section->name,XkbMessage):"default") ((r) ? XkbcAtomText((r)->section->name) : "default")
#define _GOK_UnknownRow -1 #define _GOK_UnknownRow -1
typedef struct _OverlayKeyInfo typedef struct _OverlayKeyInfo
@ -179,7 +179,8 @@ typedef struct _OverlayInfo
unsigned short nKeys; unsigned short nKeys;
OverlayKeyInfo *keys; OverlayKeyInfo *keys;
} OverlayInfo; } OverlayInfo;
#define oiText(d,o) ((o)?XkbAtomText((d),(o)->name,XkbMessage):"default") #define oiText(d, o) \
((o) ? XkbcAtomText((o)->name) : "default")
#define _GS_Default (1<<0) #define _GS_Default (1<<0)
@ -211,7 +212,8 @@ typedef struct _SectionInfo
OverlayInfo *overlays; OverlayInfo *overlays;
struct _GeometryInfo *geometry; struct _GeometryInfo *geometry;
} SectionInfo; } SectionInfo;
#define scText(d,s) ((s)?XkbAtomText((d),(s)->name,XkbMessage):"default") #define scText(d, s) \
((s) ? XkbcAtomText((s)->name) : "default")
typedef struct _GeometryInfo typedef struct _GeometryInfo
{ {
@ -260,11 +262,10 @@ ddText(Display * dpy, DoodadInfo * di)
if (di->section) if (di->section)
{ {
sprintf(buf, "%s in section %s", sprintf(buf, "%s in section %s",
XkbAtomText(dpy, di->name, XkbMessage), scText(dpy, XkbcAtomText(di->name), scText(dpy, di->section));
di->section));
return buf; return buf;
} }
return XkbAtomText(dpy, di->name, XkbMessage); return XkbcAtomText(di->name);
} }
/***====================================================================***/ /***====================================================================***/
@ -806,7 +807,7 @@ FindShape(GeometryInfo * info, Atom name, const char *type, const char *which)
{ {
old = info->shapes; old = info->shapes;
WARN3("Unknown shape \"%s\" for %s %s\n", WARN3("Unknown shape \"%s\" for %s %s\n",
XkbAtomText(info->dpy, name, XkbMessage), type, which); XkbcAtomText(name), type, which);
if (old) if (old)
{ {
ACTION1("Using default shape %s instead\n", ACTION1("Using default shape %s instead\n",
@ -942,7 +943,7 @@ AddDoodad(SectionInfo * si, GeometryInfo * info, DoodadInfo * new)
&& (warningLevel > 0)) || (warningLevel > 9)) && (warningLevel > 0)) || (warningLevel > 9))
{ {
WARN1("Multiple doodads named \"%s\"\n", WARN1("Multiple doodads named \"%s\"\n",
XkbAtomText(info->dpy, old->name, XkbMessage)); XkbcAtomText(old->name));
ACTION("Using last definition\n"); ACTION("Using last definition\n");
} }
ReplaceDoodad(old, new); ReplaceDoodad(old, new);
@ -953,7 +954,7 @@ AddDoodad(SectionInfo * si, GeometryInfo * info, DoodadInfo * new)
|| (warningLevel > 9)) || (warningLevel > 9))
{ {
WARN1("Multiple doodads named \"%s\"\n", WARN1("Multiple doodads named \"%s\"\n",
XkbAtomText(info->dpy, old->name, XkbMessage)); XkbcAtomText(old->name));
ACTION("Using first definition\n"); ACTION("Using first definition\n");
} }
return True; return True;
@ -1026,8 +1027,7 @@ AddOverlay(SectionInfo * si, GeometryInfo * info, OverlayInfo * new)
{ {
WARN2 WARN2
("Multiple overlays named \"%s\" for section \"%s\"\n", ("Multiple overlays named \"%s\" for section \"%s\"\n",
XkbAtomText(info->dpy, old->name, XkbMessage), XkbcAtomText(old->name), XkbcAtomText(si->name));
XkbAtomText(info->dpy, si->name, XkbMessage));
ACTION("Using last definition\n"); ACTION("Using last definition\n");
} }
ClearOverlayInfo(old); ClearOverlayInfo(old);
@ -1041,8 +1041,7 @@ AddOverlay(SectionInfo * si, GeometryInfo * info, OverlayInfo * new)
|| (warningLevel > 9)) || (warningLevel > 9))
{ {
WARN2("Multiple doodads named \"%s\" in section \"%s\"\n", WARN2("Multiple doodads named \"%s\" in section \"%s\"\n",
XkbAtomText(info->dpy, old->name, XkbMessage), XkbcAtomText(old->name), XkbcAtomText(si->name));
XkbAtomText(info->dpy, si->name, XkbMessage));
ACTION("Using first definition\n"); ACTION("Using first definition\n");
} }
return True; return True;
@ -1056,8 +1055,7 @@ AddOverlay(SectionInfo * si, GeometryInfo * info, OverlayInfo * new)
WSGO("Couldn't allocate a new OverlayInfo\n"); WSGO("Couldn't allocate a new OverlayInfo\n");
ACTION2 ACTION2
("Overlay \"%s\" in section \"%s\" will be incomplete\n", ("Overlay \"%s\" in section \"%s\" will be incomplete\n",
XkbAtomText(info->dpy, old->name, XkbMessage), XkbcAtomText(old->name), XkbcAtomText(si->name));
XkbAtomText(info->dpy, si->name, XkbMessage));
} }
return False; return False;
} }
@ -2242,16 +2240,14 @@ HandleGeometryVar(VarDef * stmt, XkbcDescPtr xkb, GeometryInfo * info)
{ {
WARN("Keyboard width must be positive\n"); WARN("Keyboard width must be positive\n");
ACTION1("Ignoring illegal keyboard width %s\n", ACTION1("Ignoring illegal keyboard width %s\n",
XkbGeomFPText(tmp.ival, XkbMessage)); XkbcGeomFPText(tmp.ival));
return True; return True;
} }
if (info->widthMM != 0) if (info->widthMM != 0)
{ {
WARN("Keyboard width multiply defined\n"); WARN("Keyboard width multiply defined\n");
ACTION1("Using last definition (%s),", ACTION1("Using last definition (%s),", XkbcGeomFPText(tmp.ival));
XkbGeomFPText(tmp.ival, XkbMessage)); INFO1(" ignoring first (%s)\n", XkbcGeomFPText(info->widthMM));
INFO1(" ignoring first (%s)\n",
XkbGeomFPText(info->widthMM, XkbMessage));
} }
info->widthMM = tmp.ival; info->widthMM = tmp.ival;
return True; return True;
@ -2273,16 +2269,14 @@ HandleGeometryVar(VarDef * stmt, XkbcDescPtr xkb, GeometryInfo * info)
{ {
WARN("Keyboard height must be positive\n"); WARN("Keyboard height must be positive\n");
ACTION1("Ignoring illegal keyboard height %s\n", ACTION1("Ignoring illegal keyboard height %s\n",
XkbGeomFPText(tmp.ival, XkbMessage)); XkbcGeomFPText(tmp.ival));
return True; return True;
} }
if (info->heightMM != 0) if (info->heightMM != 0)
{ {
WARN("Keyboard height multiply defined\n"); WARN("Keyboard height multiply defined\n");
ACTION1("Using last definition (%s),", ACTION1("Using last definition (%s),", XkbcGeomFPText(tmp.ival));
XkbGeomFPText(tmp.ival, XkbMessage)); INFO1(" ignoring first (%s)\n", XkbcGeomFPText(info->heightMM));
INFO1(" ignoring first (%s)\n",
XkbGeomFPText(info->heightMM, XkbMessage));
} }
info->heightMM = tmp.ival; info->heightMM = tmp.ival;
return True; return True;
@ -2446,7 +2440,7 @@ HandleShapeBody(ShapeDef * def, ShapeInfo * si, unsigned merge,
} }
if (ol->field != None) if (ol->field != None)
{ {
char *str = XkbAtomText(NULL, ol->field, XkbMessage); char *str = XkbcAtomText(ol->field);
if ((uStrCaseCmp(str, "approximation") == 0) || if ((uStrCaseCmp(str, "approximation") == 0) ||
(uStrCaseCmp(str, "approx") == 0)) (uStrCaseCmp(str, "approx") == 0))
{ {
@ -2559,8 +2553,7 @@ HandleOverlayDef(OverlayDef * def,
if ((def->nKeys < 1) && (warningLevel > 3)) if ((def->nKeys < 1) && (warningLevel > 3))
{ {
WARN2("Overlay \"%s\" in section \"%s\" has no keys\n", WARN2("Overlay \"%s\" in section \"%s\" has no keys\n",
XkbAtomText(NULL, def->name, XkbMessage), scText(info->dpy, XkbcAtomText(def->name), scText(info->dpy, si));
si));
ACTION("Overlay ignored\n"); ACTION("Overlay ignored\n");
return True; return True;
} }
@ -3118,8 +3111,7 @@ VerifyDoodadInfo(DoodadInfo * di, GeometryInfo * info)
{ {
WARN1("No font size for text doodad %s\n", WARN1("No font size for text doodad %s\n",
ddText(info->dpy, di)); ddText(info->dpy, di));
ACTION1("Using %s point text\n", ACTION1("Using %s point text\n", XkbcGeomFPText(DFLT_SIZE));
XkbGeomFPText(DFLT_SIZE, XkbMessage));
} }
di->fontSize = DFLT_SIZE; di->fontSize = DFLT_SIZE;
} }
@ -3141,7 +3133,7 @@ VerifyDoodadInfo(DoodadInfo * di, GeometryInfo * info)
WARN1("No height for text doodad %s\n", WARN1("No height for text doodad %s\n",
ddText(info->dpy, di)); ddText(info->dpy, di));
ACTION1("Using calculated height %s millimeters\n", ACTION1("Using calculated height %s millimeters\n",
XkbGeomFPText(size, XkbMessage)); XkbcGeomFPText(size));
} }
di->height = size; di->height = size;
} }
@ -3168,7 +3160,7 @@ VerifyDoodadInfo(DoodadInfo * di, GeometryInfo * info)
{ {
WARN1("No width for text doodad %s\n", ddText(info->dpy, di)); WARN1("No width for text doodad %s\n", ddText(info->dpy, di));
ACTION1("Using calculated width %s millimeters\n", ACTION1("Using calculated width %s millimeters\n",
XkbGeomFPText(width, XkbMessage)); XkbcGeomFPText(width));
} }
di->width = width; di->width = width;
} }
@ -3426,11 +3418,9 @@ VerifyOverlayInfo(XkbGeometryPtr geom,
{ {
WARN3 WARN3
("Key %s in section \"%s\" and overlay \"%s\"\n", ("Key %s in section \"%s\" and overlay \"%s\"\n",
XkbKeyNameText(key->name.name, XkbcKeyNameText(key->name.name),
XkbMessage), XkbcAtomText(section->name),
XkbAtomText(info->dpy, section->name, XkbcAtomText(oi->name));
XkbMessage),
XkbAtomText(info->dpy, oi->name, XkbMessage));
ACTION("Overlay definition ignored\n"); ACTION("Overlay definition ignored\n");
} }
oKey = 0; oKey = 0;
@ -3446,9 +3436,9 @@ VerifyOverlayInfo(XkbGeometryPtr geom,
{ {
WARN3 WARN3
("Key %s not in \"%s\", but has an overlay key in \"%s\"\n", ("Key %s not in \"%s\", but has an overlay key in \"%s\"\n",
XkbKeyNameText(ki->under, XkbMessage), XkbcKeyNameText(ki->under),
XkbAtomText(info->dpy, section->name, XkbMessage), XkbcAtomText(section->name),
XkbAtomText(info->dpy, oi->name, XkbMessage)); XkbcAtomText(oi->name));
ACTION("Definition ignored\n"); ACTION("Definition ignored\n");
} }
} }
@ -3474,8 +3464,7 @@ VerifyOverlayInfo(XkbGeometryPtr geom,
if (oi->nKeys < 1) if (oi->nKeys < 1)
{ {
ERROR2("Overlay \"%s\" for section \"%s\" has no legal keys\n", ERROR2("Overlay \"%s\" for section \"%s\" has no legal keys\n",
XkbAtomText(info->dpy, oi->name, XkbMessage), XkbcAtomText(oi->name), XkbcAtomText(section->name));
XkbAtomText(info->dpy, section->name, XkbMessage));
ACTION("Overlay definition ignored\n"); ACTION("Overlay definition ignored\n");
return False; return False;
} }
@ -3515,8 +3504,7 @@ CopyOverlayDef(XkbGeometryPtr geom,
if (!ol) if (!ol)
{ {
WSGO2("Couldn't add overlay \"%s\" to section \"%s\"\n", WSGO2("Couldn't add overlay \"%s\" to section \"%s\"\n",
XkbAtomText(info->dpy, name, XkbMessage), XkbcAtomText(name), XkbcAtomText(section->name));
XkbAtomText(info->dpy, section->name, XkbMessage));
return False; return False;
} }
for (i = 0; i < oi->nRows; i++) for (i = 0; i < oi->nRows; i++)
@ -3532,8 +3520,7 @@ CopyOverlayDef(XkbGeometryPtr geom,
{ {
WSGO3 WSGO3
("Can't add row %d to overlay \"%s\" of section \"%s\"\n", ("Can't add row %d to overlay \"%s\" of section \"%s\"\n",
i, XkbAtomText(info->dpy, name, XkbMessage), i, XkbcAtomText(name), XkbcAtomText(section->name));
XkbAtomText(info->dpy, section->name, XkbMessage));
return False; return False;
} }
} }

View File

@ -36,11 +36,9 @@
/***====================================================================***/ /***====================================================================***/
#define ReportIndicatorBadType(d,l,f,w) \ #define ReportIndicatorBadType(d,l,f,w) \
ReportBadType("indicator map",(f),\ ReportBadType("indicator map", (f), XkbcAtomText((l)->name), (w))
XkbAtomText((d),(l)->name,XkbMessage),(w))
#define ReportIndicatorNotArray(d,l,f) \ #define ReportIndicatorNotArray(d,l,f) \
ReportNotArray("indicator map",(f),\ ReportNotArray("indicator map", (f), XkbcAtomText((l)->name))
XkbAtomText((d),(l)->name,XkbMessage))
/***====================================================================***/ /***====================================================================***/
@ -84,7 +82,7 @@ AddIndicatorMap(LEDInfo * oldLEDs, LEDInfo * new)
&& (warningLevel > 0)) || (warningLevel > 9)) && (warningLevel > 0)) || (warningLevel > 9))
{ {
WARN1("Map for indicator %s redefined\n", WARN1("Map for indicator %s redefined\n",
XkbAtomText(NULL, old->name, XkbMessage)); XkbcAtomText(old->name));
ACTION("Earlier definition ignored\n"); ACTION("Earlier definition ignored\n");
} }
*old = *new; *old = *new;
@ -136,7 +134,7 @@ AddIndicatorMap(LEDInfo * oldLEDs, LEDInfo * new)
if (collide) if (collide)
{ {
WARN1("Map for indicator %s redefined\n", WARN1("Map for indicator %s redefined\n",
XkbAtomText(NULL, old->name, XkbMessage)); XkbcAtomText(old->name));
ACTION1("Using %s definition for duplicate fields\n", ACTION1("Using %s definition for duplicate fields\n",
(new->defs.merge == MergeAugment ? "first" : "last")); (new->defs.merge == MergeAugment ? "first" : "last"));
} }
@ -151,7 +149,7 @@ AddIndicatorMap(LEDInfo * oldLEDs, LEDInfo * new)
{ {
WSGO("Couldn't allocate indicator map\n"); WSGO("Couldn't allocate indicator map\n");
ACTION1("Map for indicator %s not compiled\n", ACTION1("Map for indicator %s not compiled\n",
XkbAtomText(NULL, new->name, XkbMessage)); XkbcAtomText(new->name));
return NULL; return NULL;
} }
*old = *new; *old = *new;
@ -306,7 +304,7 @@ SetIndicatorMapField(LEDInfo * led,
ERROR2("Illegal indicator index %d (range 1..%d)\n", ERROR2("Illegal indicator index %d (range 1..%d)\n",
rtrn.uval, XkbNumIndicators); rtrn.uval, XkbNumIndicators);
ACTION1("Index definition for %s indicator ignored\n", ACTION1("Index definition for %s indicator ignored\n",
XkbAtomText(NULL, led->name, XkbMessage)); XkbcAtomText(led->name));
return False; return False;
} }
led->indicator = rtrn.uval; led->indicator = rtrn.uval;
@ -315,7 +313,7 @@ SetIndicatorMapField(LEDInfo * led,
else else
{ {
ERROR2("Unknown field %s in map for %s indicator\n", field, ERROR2("Unknown field %s in map for %s indicator\n", field,
XkbAtomText(NULL, led->name, XkbMessage)); XkbcAtomText(led->name));
ACTION("Definition ignored\n"); ACTION("Definition ignored\n");
ok = False; ok = False;
} }

View File

@ -37,7 +37,7 @@ longText(unsigned long val, unsigned format)
char buf[4]; char buf[4];
LongToKeyName(val, buf); LongToKeyName(val, buf);
return XkbKeyNameText(buf, format); return XkbcKeyNameText(buf);
} }
/***====================================================================***/ /***====================================================================***/
@ -168,8 +168,7 @@ AddIndicatorName(KeyNamesInfo * info, IndicatorNameInfo * new)
if (((old->defs.fileID == new->defs.fileID) && (warningLevel > 0)) if (((old->defs.fileID == new->defs.fileID) && (warningLevel > 0))
|| (warningLevel > 9)) || (warningLevel > 9))
{ {
WARN1("Multiple indicators named %s\n", WARN1("Multiple indicators named %s\n", XkbcAtomText(new->name));
XkbAtomText(NULL, new->name, XkbMessage));
if (old->ndx == new->ndx) if (old->ndx == new->ndx)
{ {
if (old->virtual != new->virtual) if (old->virtual != new->virtual)
@ -248,8 +247,8 @@ AddIndicatorName(KeyNamesInfo * info, IndicatorNameInfo * new)
ignoring = new->name; ignoring = new->name;
} }
ACTION4("Using %s %s, ignoring %s %s\n", ACTION4("Using %s %s, ignoring %s %s\n",
oldType, XkbAtomText(NULL, using, XkbMessage), oldType, XkbcAtomText(using),
newType, XkbAtomText(NULL, ignoring, XkbMessage)); newType, XkbcAtomText(ignoring));
} }
} }
if (replace) if (replace)
@ -852,7 +851,7 @@ CompileKeycodes(XkbFile *file, XkbcDescPtr xkb, unsigned merge)
{ {
LongToKeyName(info.names[i], xkb->names->keys[i].name); LongToKeyName(info.names[i], xkb->names->keys[i].name);
uDEBUG2(2, "key %d = %s\n", i, uDEBUG2(2, "key %d = %s\n", i,
XkbKeyNameText(xkb->names->keys[i].name, XkbMessage)); XkbcKeyNameText(xkb->names->keys[i].name));
} }
} }
else else

View File

@ -75,7 +75,7 @@ CompileKeymap(XkbFile *file, XkbcDescPtr xkb, unsigned merge)
break; break;
default: default:
ERROR1("Cannot compile %s alone into an XKM file\n", ERROR1("Cannot compile %s alone into an XKM file\n",
XkbConfigText(mainType)); XkbcConfigText(mainType));
return False; return False;
} }
have = 0; have = 0;
@ -88,14 +88,14 @@ CompileKeymap(XkbFile *file, XkbcDescPtr xkb, unsigned merge)
if ((have & (1 << file->type)) != 0) if ((have & (1 << file->type)) != 0)
{ {
ERROR2("More than one %s section in a %s file\n", ERROR2("More than one %s section in a %s file\n",
XkbConfigText(file->type), XkbConfigText(mainType)); XkbcConfigText(file->type), XkbcConfigText(mainType));
ACTION("All sections after the first ignored\n"); ACTION("All sections after the first ignored\n");
ok = False; ok = False;
} }
else if ((1 << file->type) & (~legal)) else if ((1 << file->type) & (~legal))
{ {
ERROR2("Cannot define %s in a %s file\n", ERROR2("Cannot define %s in a %s file\n",
XkbConfigText(file->type), XkbConfigText(mainType)); XkbcConfigText(file->type), XkbcConfigText(mainType));
ok = False; ok = False;
} }
else else
@ -105,7 +105,7 @@ CompileKeymap(XkbFile *file, XkbcDescPtr xkb, unsigned merge)
case XkmLayoutFile: case XkmLayoutFile:
case XkmKeymapFile: case XkmKeymapFile:
WSGO2("Illegal %s configuration in a %s file\n", WSGO2("Illegal %s configuration in a %s file\n",
XkbConfigText(file->type), XkbConfigText(mainType)); XkbcConfigText(file->type), XkbcConfigText(mainType));
ACTION("Ignored\n"); ACTION("Ignored\n");
ok = False; ok = False;
break; break;
@ -128,7 +128,7 @@ CompileKeymap(XkbFile *file, XkbcDescPtr xkb, unsigned merge)
case XkmVirtualModsIndex: case XkmVirtualModsIndex:
case XkmIndicatorsIndex: case XkmIndicatorsIndex:
WSGO1("Found an isolated %s section\n", WSGO1("Found an isolated %s section\n",
XkbConfigText(file->type)); XkbcConfigText(file->type));
break; break;
default: default:
WSGO1("Unknown file type %d\n", file->type); WSGO1("Unknown file type %d\n", file->type);
@ -166,12 +166,12 @@ CompileKeymap(XkbFile *file, XkbcDescPtr xkb, unsigned merge)
if (missing & bit) if (missing & bit)
{ {
ERROR2("Missing %s section in a %s file\n", ERROR2("Missing %s section in a %s file\n",
XkbConfigText(i), XkbConfigText(mainType)); XkbcConfigText(i), XkbcConfigText(mainType));
missing &= ~bit; missing &= ~bit;
} }
} }
ACTION1("Description of %s not compiled\n", ACTION1("Description of %s not compiled\n",
XkbConfigText(mainType)); XkbcConfigText(mainType));
ok = False; ok = False;
} }
ok = BindIndicators(xkb, True, unbound, NULL); ok = BindIndicators(xkb, True, unbound, NULL);

View File

@ -119,7 +119,7 @@ extern Bool AddLevelName(KeyTypeInfo * /* type */ ,
XkbVModMaskText((t)->dpy,(x),(p)->indexMods,(p)->indexVMods,XkbMessage) XkbVModMaskText((t)->dpy,(x),(p)->indexMods,(p)->indexVMods,XkbMessage)
#define PreserveTxt(t,x,p) \ #define PreserveTxt(t,x,p) \
XkbVModMaskText((t)->dpy,(x),(p)->preMods,(p)->preVMods,XkbMessage) XkbVModMaskText((t)->dpy,(x),(p)->preMods,(p)->preVMods,XkbMessage)
#define TypeTxt(t) XkbAtomText((t)->dpy,(t)->name,XkbMessage) #define TypeTxt(t) XkbcAtomText((t)->name)
#define TypeMaskTxt(t,x) \ #define TypeMaskTxt(t,x) \
XkbVModMaskText((t)->dpy,(x),(t)->mask,(t)->vmask,XkbMessage) XkbVModMaskText((t)->dpy,(x),(t)->mask,(t)->vmask,XkbMessage)
@ -819,8 +819,8 @@ AddLevelName(KeyTypeInfo * type,
if (warningLevel > 0) if (warningLevel > 0)
{ {
char *old, *new; char *old, *new;
old = XkbAtomText(type->dpy, type->lvlNames[level], XkbMessage); old = XkbcAtomText(type->lvlNames[level]);
new = XkbAtomText(type->dpy, name, XkbMessage); new = XkbcAtomText(name);
WARN2("Multiple names for level %d of key type %s\n", WARN2("Multiple names for level %d of key type %s\n",
level + 1, TypeTxt(type)); level + 1, TypeTxt(type));
if (clobber) if (clobber)
@ -852,7 +852,7 @@ SetLevelName(KeyTypeInfo * type, ExprDef * arrayNdx, ExprDef * value)
ERROR3("Level name %d out of range (1..%d) in key type %s\n", ERROR3("Level name %d out of range (1..%d) in key type %s\n",
rtrn.ival, rtrn.ival,
XkbMaxShiftLevel + 1, XkbMaxShiftLevel + 1,
XkbAtomText(type->dpy, type->name, XkbMessage)); XkbcAtomText(type->name));
ACTION("Ignoring illegal level name definition\n"); ACTION("Ignoring illegal level name definition\n");
return False; return False;
} }
@ -860,7 +860,7 @@ SetLevelName(KeyTypeInfo * type, ExprDef * arrayNdx, ExprDef * value)
if (!ExprResolveString(value, &rtrn, NULL, NULL)) if (!ExprResolveString(value, &rtrn, NULL, NULL))
{ {
ERROR2("Non-string name for level %d in key type %s\n", level + 1, ERROR2("Non-string name for level %d in key type %s\n", level + 1,
XkbAtomText(type->dpy, type->name, XkbMessage)); XkbcAtomText(type->name));
ACTION("Ignoring illegal level name definition\n"); ACTION("Ignoring illegal level name definition\n");
return False; return False;
} }
@ -904,7 +904,7 @@ SetKeyTypeField(KeyTypeInfo * type,
if (type->defs.defined & _KT_Mask) if (type->defs.defined & _KT_Mask)
{ {
WARN1("Multiple modifier mask definitions for key type %s\n", WARN1("Multiple modifier mask definitions for key type %s\n",
XkbAtomText(type->dpy, type->name, XkbMessage)); XkbcAtomText(type->name));
ACTION1("Using %s, ", TypeMaskTxt(type, xkb)); ACTION1("Using %s, ", TypeMaskTxt(type, xkb));
INFO1("ignoring %s\n", XkbVModMaskText(type->dpy, xkb, mods, INFO1("ignoring %s\n", XkbVModMaskText(type->dpy, xkb, mods,
vmods, XkbMessage)); vmods, XkbMessage));
@ -1167,7 +1167,7 @@ CopyDefToKeyType(XkbcDescPtr xkb, XkbKeyTypePtr type, KeyTypeInfo * def)
{ {
WARN("Couldn't allocate preserve array in CopyDefToKeyType\n"); WARN("Couldn't allocate preserve array in CopyDefToKeyType\n");
ACTION1("Preserve setting for type %s lost\n", ACTION1("Preserve setting for type %s lost\n",
XkbAtomText(def->dpy, def->name, XkbMessage)); XkbcAtomText(def->name));
} }
else else
{ {

View File

@ -99,7 +99,7 @@ ProcessIncludeFile(IncludeStmt * stmt,
if (!mapToUse) if (!mapToUse)
{ {
ERROR3("No %s named \"%s\" in the include file \"%s\"\n", ERROR3("No %s named \"%s\" in the include file \"%s\"\n",
XkbConfigText(file_type), stmt->map, stmt->file); XkbcConfigText(file_type), stmt->map, stmt->file);
ACTION("Exiting\n"); ACTION("Exiting\n");
return False; return False;
} }
@ -114,7 +114,7 @@ ProcessIncludeFile(IncludeStmt * stmt,
if (mapToUse->type != file_type) if (mapToUse->type != file_type)
{ {
ERROR2("Include file wrong type (expected %s, got %s)\n", ERROR2("Include file wrong type (expected %s, got %s)\n",
XkbConfigText(file_type), XkbConfigText(mapToUse->type)); XkbcConfigText(file_type), XkbcConfigText(mapToUse->type));
ACTION1("Include file \"%s\" ignored\n", stmt->file); ACTION1("Include file \"%s\" ignored\n", stmt->file);
return False; return False;
} }
@ -424,7 +424,7 @@ ComputeKbdDefaults(XkbcDescPtr xkb)
{ {
WARN1 WARN1
("Several keys match pattern for %s\n", ("Several keys match pattern for %s\n",
XkbKeyNameText(name->name, XkbMessage)); XkbcKeyNameText(name->name));
ACTION2("Using <U%03d> for key %d\n", ACTION2("Using <U%03d> for key %d\n",
nUnknown, i); nUnknown, i);
} }

View File

@ -410,8 +410,7 @@ MergeKeyGroups(SymbolsInfo * info,
("Multiple symbols for level %d/group %d on key %s\n", ("Multiple symbols for level %d/group %d on key %s\n",
i + 1, group + 1, longText(into->name, XkbMessage)); i + 1, group + 1, longText(into->name, XkbMessage));
ACTION2("Using %s, ignoring %s\n", ACTION2("Using %s, ignoring %s\n",
XkbKeysymText(use, XkbMessage), XkbcKeysymText(use), XkbcKeysymText(ignore));
XkbKeysymText(ignore, XkbMessage));
} }
resultSyms[i] = use; resultSyms[i] = use;
} }
@ -449,8 +448,8 @@ MergeKeyGroups(SymbolsInfo * info,
("Multiple actions for level %d/group %d on key %s\n", ("Multiple actions for level %d/group %d on key %s\n",
i + 1, group + 1, longText(into->name, XkbMessage)); i + 1, group + 1, longText(into->name, XkbMessage));
ACTION2("Using %s, ignoring %s\n", ACTION2("Using %s, ignoring %s\n",
XkbActionTypeText(use->type), XkbcActionTypeText(use->type),
XkbActionTypeText(ignore->type)); XkbcActionTypeText(ignore->type));
} }
resultActs[i] = *use; resultActs[i] = *use;
} }
@ -554,8 +553,8 @@ MergeKeys(SymbolsInfo * info, KeyInfo * into, KeyInfo * from)
("Multiple definitions for group %d type of key %s\n", ("Multiple definitions for group %d type of key %s\n",
i, longText(into->name, XkbMessage)); i, longText(into->name, XkbMessage));
ACTION2("Using %s, ignoring %s\n", ACTION2("Using %s, ignoring %s\n",
XkbAtomText(NULL, use, XkbMessage), XkbcAtomText(use),
XkbAtomText(NULL, ignore, XkbMessage)); XkbcAtomText(ignore));
} }
if ((from->defs.merge != MergeAugment) if ((from->defs.merge != MergeAugment)
|| (into->types[i] == None)) || (into->types[i] == None))
@ -661,7 +660,7 @@ AddModMapEntry(SymbolsInfo * info, ModMapEntry * new)
} }
ERROR1 ERROR1
("%s added to symbol map for multiple modifiers\n", ("%s added to symbol map for multiple modifiers\n",
XkbKeysymText(new->u.keySym, XkbMessage)); XkbcKeysymText(new->u.keySym));
ACTION2("Using %s, ignoring %s.\n", ACTION2("Using %s, ignoring %s.\n",
XkbModIndexText(use, XkbMessage), XkbModIndexText(use, XkbMessage),
XkbModIndexText(ignore, XkbMessage)); XkbModIndexText(ignore, XkbMessage));
@ -1603,7 +1602,7 @@ HandleModMapDef(ModMapDef * def,
{ {
ERROR("Illegal modifier map definition\n"); ERROR("Illegal modifier map definition\n");
ACTION1("Ignoring map for non-modifier \"%s\"\n", ACTION1("Ignoring map for non-modifier \"%s\"\n",
XkbAtomText(NULL, def->modifier, XkbMessage)); XkbcAtomText(def->modifier));
return False; return False;
} }
ok = True; ok = True;
@ -1968,7 +1967,7 @@ CopySymbolsDef(XkbcDescPtr xkb, KeyInfo *key, int start_from)
{ {
WARN2("Key %s not found in %s keycodes\n", WARN2("Key %s not found in %s keycodes\n",
longText(key->name, XkbMessage), longText(key->name, XkbMessage),
XkbAtomText(NULL, xkb->names->keycodes, XkbMessage)); XkbcAtomText(xkb->names->keycodes));
ACTION("Symbols ignored\n"); ACTION("Symbols ignored\n");
} }
return False; return False;
@ -2000,8 +1999,7 @@ CopySymbolsDef(XkbcDescPtr xkb, KeyInfo *key, int start_from)
WARN1("No automatic type for %d symbols\n", WARN1("No automatic type for %d symbols\n",
(unsigned int) key->numLevels[i]); (unsigned int) key->numLevels[i]);
ACTION3("Using %s for the %s key (keycode %d)\n", ACTION3("Using %s for the %s key (keycode %d)\n",
XkbAtomText(NULL, key->types[i], XkbcAtomText(key->types[i]),
XkbMessage),
longText(key->name, XkbMessage), kc); longText(key->name, XkbMessage), kc);
} }
} }
@ -2016,7 +2014,7 @@ CopySymbolsDef(XkbcDescPtr xkb, KeyInfo *key, int start_from)
if (warningLevel >= 3) if (warningLevel >= 3)
{ {
WARN1("Type \"%s\" is not defined\n", WARN1("Type \"%s\" is not defined\n",
XkbAtomText(NULL, key->types[i], XkbMessage)); XkbcAtomText(key->types[i]));
ACTION2("Using TWO_LEVEL for the %s key (keycode %d)\n", ACTION2("Using TWO_LEVEL for the %s key (keycode %d)\n",
longText(key->name, XkbMessage), kc); longText(key->name, XkbMessage), kc);
} }
@ -2030,7 +2028,7 @@ CopySymbolsDef(XkbcDescPtr xkb, KeyInfo *key, int start_from)
{ {
WARN4 WARN4
("Type \"%s\" has %d levels, but %s has %d symbols\n", ("Type \"%s\" has %d levels, but %s has %d symbols\n",
XkbAtomText(NULL, type->name, XkbMessage), XkbcAtomText(type->name),
(unsigned int) type->num_levels, (unsigned int) type->num_levels,
longText(key->name, XkbMessage), longText(key->name, XkbMessage),
(unsigned int) key->numLevels[i]); (unsigned int) key->numLevels[i]);
@ -2121,7 +2119,7 @@ CopySymbolsDef(XkbcDescPtr xkb, KeyInfo *key, int start_from)
{ {
WARN2("Key %s not found in %s keycodes\n", WARN2("Key %s not found in %s keycodes\n",
longText(key->nameForOverlayKey, XkbMessage), longText(key->nameForOverlayKey, XkbMessage),
XkbAtomText(NULL, xkb->names->keycodes, XkbMessage)); XkbcAtomText(xkb->names->keycodes));
ACTION1("Not treating %s as an overlay key \n", ACTION1("Not treating %s as an overlay key \n",
longText(key->name, XkbMessage)); longText(key->name, XkbMessage));
} }
@ -2166,7 +2164,7 @@ CopyModMapDef(XkbcDescPtr xkb, ModMapEntry *entry)
{ {
WARN2("Key %s not found in %s keycodes\n", WARN2("Key %s not found in %s keycodes\n",
longText(entry->u.keyName, XkbMessage), longText(entry->u.keyName, XkbMessage),
XkbAtomText(NULL, xkb->names->keycodes, XkbMessage)); XkbcAtomText(xkb->names->keycodes));
ACTION1("Modifier map entry for %s not updated\n", ACTION1("Modifier map entry for %s not updated\n",
XkbModIndexText(entry->modifier, XkbMessage)); XkbModIndexText(entry->modifier, XkbMessage));
} }
@ -2178,8 +2176,8 @@ CopyModMapDef(XkbcDescPtr xkb, ModMapEntry *entry)
if (warningLevel > 5) if (warningLevel > 5)
{ {
WARN2("Key \"%s\" not found in %s symbol map\n", WARN2("Key \"%s\" not found in %s symbol map\n",
XkbKeysymText(entry->u.keySym, XkbMessage), XkbcKeysymText(entry->u.keySym),
XkbAtomText(NULL, xkb->names->symbols, XkbMessage)); XkbcAtomText(xkb->names->symbols));
ACTION1("Modifier map entry for %s not updated\n", ACTION1("Modifier map entry for %s not updated\n",
XkbModIndexText(entry->modifier, XkbMessage)); XkbModIndexText(entry->modifier, XkbMessage));
} }

View File

@ -104,20 +104,20 @@ HandleVModDef(VModDef * stmt, unsigned mergeMode, VModInfo * info)
const char *str2 = ""; const char *str2 = "";
if (!ExprResolveModMask(stmt->value, &mod, NULL, NULL)) if (!ExprResolveModMask(stmt->value, &mod, NULL, NULL))
{ {
str1 = XkbAtomText(NULL, stmt->name, XkbMessage); str1 = XkbcAtomText(stmt->name);
ACTION1("Declaration of %s ignored\n", str1); ACTION1("Declaration of %s ignored\n", str1);
return False; return False;
} }
if (mod.uval == srv->vmods[i]) if (mod.uval == srv->vmods[i])
return True; return True;
str1 = XkbAtomText(NULL, stmt->name, XkbMessage); str1 = XkbcAtomText(stmt->name);
WARN1("Virtual modifier %s multiply defined\n", str1); WARN1("Virtual modifier %s multiply defined\n", str1);
str1 = XkbModMaskText(srv->vmods[i], XkbCFile); str1 = XkbcModMaskText(srv->vmods[i], True);
if (mergeMode == MergeOverride) if (mergeMode == MergeOverride)
{ {
str2 = str1; str2 = str1;
str1 = XkbModMaskText(mod.uval, XkbCFile); str1 = XkbcModMaskText(mod.uval, True);
} }
ACTION2("Using %s, ignoring %s\n", str1, str2); ACTION2("Using %s, ignoring %s\n", str1, str2);
if (mergeMode == MergeOverride) if (mergeMode == MergeOverride)
@ -148,7 +148,7 @@ HandleVModDef(VModDef * stmt, unsigned mergeMode, VModInfo * info)
return True; return True;
} }
ACTION1("Declaration of %s ignored\n", ACTION1("Declaration of %s ignored\n",
XkbAtomText(NULL, stmt->name, XkbMessage)); XkbcAtomText(stmt->name));
return False; return False;
} }