#define XKB_KEYCODE_INVALID (0xffffffff)
#define XKB_LED_INVALID (0xffffffff)
+#define XKB_KEYSYM_NO_SYMBOL 0
+
#define XKB_KEYCODE_MAX (0xffffffff - 1)
#define xkb_keycode_is_legal_ext(kc) (kc <= XKB_KEYCODE_MAX)
#define xkb_keycode_is_legal_x11(kc) (kc <= XKB_KEYCODE_MAX)
*/
-/* Constructs hash tables for XStringToKeysym and XKeysymToString. */
+/*
+ * Constructs hash tables for xkb_keysym_to_string and
+ * xkb_string_from_keysym.
+ */
#include "xkbcommon/xkbcommon.h"
fclose(fptr);
}
- /* Special case NoSymbol. */
+ /* Special case XKB_KEYSYM_NO_SYMBOL. */
info[ksnum].name = strdup("NoSymbol");
- info[ksnum].val = 0L;
+ info[ksnum].val = XKB_KEYSYM_NO_SYMBOL;
ksnum++;
printf("/* This file is generated from keysymdef.h. */\n");
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#include <X11/X.h>
#include <X11/keysymdef.h>
#include "xkbmisc.h"
#include "xkbcommon/xkbcommon.h"
}
/* Not listed in keysymdef.h for hysterical raisins. */
- if (ks == NoSymbol) {
+ if (ks == XKB_KEYSYM_NO_SYMBOL) {
snprintf(buffer, size, "NoSymbol");
return;
}
val = strtoul(&s[1], NULL, 16);
if (val < 0x20 || (val > 0x7e && val < 0xa0))
- return NoSymbol;
+ return XKB_KEYSYM_NO_SYMBOL;
if (val < 0x100)
return val;
if (val > 0x10ffff)
- return NoSymbol;
+ return XKB_KEYSYM_NO_SYMBOL;
return val | 0x01000000;
}
else if (s[0] == '0' && s[1] == 'x') {
xkb_keysym_t ret;
char *tmp = strdup(s);
if (!tmp)
- return NoSymbol;
+ return XKB_KEYSYM_NO_SYMBOL;
memmove(&tmp[4], &tmp[5], strlen(s) - 5 + 1);
ret = xkb_string_to_keysym(tmp);
free(tmp);
return ret;
}
- return NoSymbol;
+ return XKB_KEYSYM_NO_SYMBOL;
}
return BadAlloc;
}
map->num_syms = 1;
- map->syms[0] = NoSymbol;
+ map->syms[0] = XKB_KEYSYM_NO_SYMBOL;
}
if (!map->key_sym_map) {
if (!newSyms)
return NULL;
- newSyms[0] = NoSymbol;
+ newSyms[0] = XKB_KEYSYM_NO_SYMBOL;
nSyms = 1;
for (i = xkb->min_key_code; i <= xkb->max_key_code; i++) {
uint32_t nCopy;
unsigned int level, xkb_keysym_t **syms_out)
{
*syms_out = &(XkbKeySymEntry(xkb, key, level, group));
- if (**syms_out == NoSymbol)
+ if (**syms_out == XKB_KEYSYM_NO_SYMBOL)
goto err;
return 1;
#ifndef _XKBALLOC_H_
#define _XKBALLOC_H_
-#include <X11/Xdefs.h>
#include <X11/X.h>
#include "xkbcommon/xkbcommon.h"
#include "XKBcommonint.h"
********************************************************/
-#include <X11/X.h>
-
#include "xkbcomp.h"
#include "xkbmisc.h"
#include "expr.h"
********************************************************/
-#include <X11/Xos.h>
#include "xkbcomp.h"
#include "xkballoc.h"
#include "xkbmisc.h"
for (si = info->interps; si; si = (SymInterpInfo *) si->defs.next)
{
if (((si->interp.match & XkbSI_OpMask) != pred) ||
- (needSymbol && (si->interp.sym == NoSymbol)) ||
- ((!needSymbol) && (si->interp.sym != NoSymbol)))
+ (needSymbol && (si->interp.sym == XKB_KEYSYM_NO_SYMBOL)) ||
+ ((!needSymbol) && (si->interp.sym != XKB_KEYSYM_NO_SYMBOL)))
continue;
if (compat->num_si >= compat->size_si)
{
/**
* Find an interpretation which applies to this particular level, either by
* finding an exact match for the symbol and modifier combination, or a
- * generic NoSymbol match.
+ * generic XKB_KEYSYM_NO_SYMBOL match.
*/
static struct xkb_sym_interpret *
FindInterpForKey(struct xkb_desc *xkb, xkb_keycode_t key, uint32_t group, uint32_t level)
Bool found;
if ((num_syms != 1 || interp->sym != syms[0]) &&
- interp->sym != NoSymbol)
+ interp->sym != XKB_KEYSYM_NO_SYMBOL)
continue;
if (level == 0 || !(interp->match & XkbSI_LevelOneOnly))
break;
}
- if (found && interp->sym != NoSymbol)
+ if (found && interp->sym != XKB_KEYSYM_NO_SYMBOL)
return interp;
else if (found && !ret)
ret = interp;
#include "vmod.h"
#include <ctype.h>
-#include <X11/X.h>
/***====================================================================***/
{
const char *str;
str = XkbcAtomText(expr->value.str);
- if ((str != NULL) && ((sym = xkb_string_to_keysym(str)) != NoSymbol))
- {
- val_rtrn->uval = sym;
- return True;
+ if (str) {
+ sym = xkb_string_to_keysym(str);
+ if (sym != XKB_KEYSYM_NO_SYMBOL) {
+ val_rtrn->uval = sym;
+ return True;
+ }
}
}
ok = ExprResolveInteger(expr, val_rtrn);
if ((!str) || (strcasecmp(str, "any") == 0) ||
(strcasecmp(str, "nosymbol") == 0))
{
- *sym_rtrn = NoSymbol;
+ *sym_rtrn = XKB_KEYSYM_NO_SYMBOL;
return 1;
}
else if ((strcasecmp(str, "none") == 0) ||
return 1;
}
sym = xkb_string_to_keysym(str);
- if (sym != NoSymbol)
+ if (sym != XKB_KEYSYM_NO_SYMBOL)
{
*sym_rtrn = sym;
return 1;
if (from->syms[group] && (i < from->numLevels[group]))
fromSym = from->syms[group][i];
else
- fromSym = NoSymbol;
+ fromSym = XKB_KEYSYM_NO_SYMBOL;
if (into->syms[group] && (i < into->numLevels[group]))
toSym = into->syms[group][i];
else
- toSym = NoSymbol;
- if ((fromSym == NoSymbol) || (fromSym == toSym))
+ toSym = XKB_KEYSYM_NO_SYMBOL;
+ if ((fromSym == XKB_KEYSYM_NO_SYMBOL) || (fromSym == toSym))
resultSyms[i] = toSym;
- else if (toSym == NoSymbol)
+ else if (toSym == XKB_KEYSYM_NO_SYMBOL)
resultSyms[i] = fromSym;
else
{
WARN("Could not resolve keysym %s for key %s, group %d (%s), level %d\n",
value->value.list.syms[i], longText(key->name), ndx + 1,
XkbcAtomText(info->groupNames[ndx]), nSyms);
- key->syms[ndx][i] = NoSymbol;
+ key->syms[ndx][i] = XKB_KEYSYM_NO_SYMBOL;
}
}
for (j = key->numLevels[ndx] - 1;
- (j >= 0) && (key->syms[ndx][j] == NoSymbol); j--)
+ (j >= 0) && (key->syms[ndx][j] == XKB_KEYSYM_NO_SYMBOL); j--)
{
key->numLevels[ndx]--;
}
if (tmp < key->numLevels[i])
outSyms[tmp] = key->syms[i][tmp];
else
- outSyms[tmp] = NoSymbol;
+ outSyms[tmp] = XKB_KEYSYM_NO_SYMBOL;
if ((outActs != NULL) && (key->acts[i] != NULL))
{
if (tmp < key->numLevels[i])
#define _XKBPATH_H_ 1
#include <stdio.h>
-#include <X11/X.h>
#include <X11/Xdefs.h>
extern const char *XkbDirectoryForInclude(unsigned /* type */
#include <stdio.h>
#include <ctype.h>
-#include <X11/Xos.h>
#include "utils.h"
#include "parseutils.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
-#include <X11/X.h>
static void print_keysym(const char *s)
{
xkb_keysym_t ks = xkb_string_to_keysym(s);
- if (ks == NoSymbol)
+ if (ks == XKB_KEYSYM_NO_SYMBOL)
printf("NoSymbol\n");
else
printf("0x%lX\n", ks);