Since we define our own xkb_atom_t type, it makes sense not to use the
X11/X.h None value. This way we can also remove a lot of X11 includes.
Signed-off-by: Ran Benita <ran234@gmail.com>
18 files changed:
#define BAD_RESOURCE 0xe0000000
#define BAD_RESOURCE 0xe0000000
-static xkb_atom_t lastAtom = None;
+static xkb_atom_t lastAtom = XKB_ATOM_NONE;
static NodePtr atomRoot = NULL;
static unsigned long tableLength;
static NodePtr *nodeTable = NULL;
static NodePtr atomRoot = NULL;
static unsigned long tableLength;
static NodePtr *nodeTable = NULL;
- if ((atom == None) || (atom > lastAtom))
+ if ((atom == XKB_ATOM_NONE) || (atom > lastAtom))
return NULL;
if (!(node = nodeTable[atom]))
return NULL;
return NULL;
if (!(node = nodeTable[atom]))
return NULL;
int makeit = True;
if (!string)
int makeit = True;
if (!string)
len = strlen(string);
np = &atomRoot;
len = strlen(string);
np = &atomRoot;
return BAD_RESOURCE;
}
tableLength = newLength;
return BAD_RESOURCE;
}
tableLength = newLength;
+ table[XKB_ATOM_NONE] = NULL;
atomRoot = NULL;
free(nodeTable);
nodeTable = NULL;
atomRoot = NULL;
free(nodeTable);
nodeTable = NULL;
+ lastAtom = XKB_ATOM_NONE;
#include "xkbcommon/xkbcommon.h"
#include "XKBcommonint.h"
#include "xkballoc.h"
#include "xkbcommon/xkbcommon.h"
#include "XKBcommonint.h"
#include "xkballoc.h"
/**
* Returns the total number of modifiers active in the keymap.
/**
* Returns the total number of modifiers active in the keymap.
#define XOS_USE_NO_LOCKING
#include <X11/Xos_r.h>
#define XOS_USE_NO_LOCKING
#include <X11/Xos_r.h>
-#include <X11/Xproto.h>
-#include <X11/X.h>
-#include <X11/Xos.h>
-#include <X11/Xfuncs.h>
-
#ifdef DEBUG
#define PR_DEBUG(s) fprintf(stderr,s)
#define PR_DEBUG1(s,a) fprintf(stderr,s,a)
#ifdef DEBUG
#define PR_DEBUG(s) fprintf(stderr,s)
#define PR_DEBUG1(s,a) fprintf(stderr,s,a)
1, /* num_levels */
0, /* map_count */
NULL, NULL,
1, /* num_levels */
0, /* map_count */
NULL, NULL,
},
{ { ShiftMask, ShiftMask, 0 },
2, /* num_levels */
mapSize(map2Level), /* map_count */
map2Level, NULL,
},
{ { ShiftMask, ShiftMask, 0 },
2, /* num_levels */
mapSize(map2Level), /* map_count */
map2Level, NULL,
},
{ { ShiftMask|LockMask, ShiftMask|LockMask, 0 },
2, /* num_levels */
mapSize(mapAlpha), /* map_count */
mapAlpha, preAlpha,
},
{ { ShiftMask|LockMask, ShiftMask|LockMask, 0 },
2, /* num_levels */
mapSize(mapAlpha), /* map_count */
mapAlpha, preAlpha,
},
{ { ShiftMask, ShiftMask, NL_VMOD_MASK },
2, /* num_levels */
mapSize(mapKeypad), /* map_count */
mapKeypad, NULL,
},
{ { ShiftMask, ShiftMask, NL_VMOD_MASK },
2, /* num_levels */
mapSize(mapKeypad), /* map_count */
mapKeypad, NULL,
#ifndef _XKBALLOC_H_
#define _XKBALLOC_H_
#ifndef _XKBALLOC_H_
#define _XKBALLOC_H_
#include "xkbcommon/xkbcommon.h"
#include "XKBcommonint.h"
#include "xkbcommon/xkbcommon.h"
#include "XKBcommonint.h"
********************************************************/
********************************************************/
#include "xkbcomp.h"
#include "xkbmisc.h"
#include "expr.h"
#include "xkbcomp.h"
#include "xkbmisc.h"
#include "expr.h"
#include "vmod.h"
#include <ctype.h>
#include "vmod.h"
#include <ctype.h>
/***====================================================================***/
/***====================================================================***/
const LookupEntry *entry;
const char *str;
const LookupEntry *entry;
const char *str;
- if ((priv == NULL) || (field == None) || (type != TypeInt))
+ if ((priv == NULL) || (field == XKB_ATOM_NONE) || (type != TypeInt))
ii->defs.fileID = info->fileID;
ii->defs.next = NULL;
ii->ndx = 0;
ii->defs.fileID = info->fileID;
ii->defs.next = NULL;
ii->ndx = 0;
+ ii->name = XKB_ATOM_NONE;
info->dflt.defs.fileID = 0;
info->dflt.defs.merge = MergeOverride;
info->dflt.defs.next = NULL;
info->dflt.defs.fileID = 0;
info->dflt.defs.merge = MergeOverride;
info->dflt.defs.next = NULL;
- info->dflt.name = None;
+ info->dflt.name = XKB_ATOM_NONE;
info->dflt.mask = 0;
info->dflt.vmask = 0;
info->dflt.groupInfo = False;
info->dflt.mask = 0;
info->dflt.vmask = 0;
info->dflt.groupInfo = False;
- else if (type->lvlNames[level] != None)
+ else if (type->lvlNames[level] != XKB_ATOM_NONE)
{
if (warningLevel > 0)
{
{
if (warningLevel > 0)
{
}
for (i = 0; i < info->dflt.szNames; i++)
{
}
for (i = 0; i < info->dflt.szNames; i++)
{
- if ((i < type.numLevels) && (info->dflt.lvlNames[i] != None))
+ if ((i < type.numLevels) && (info->dflt.lvlNames[i] != XKB_ATOM_NONE))
{
AddLevelName(&type, i, info->dflt.lvlNames[i], False, False);
}
{
AddLevelName(&type, i, info->dflt.lvlNames[i], False, False);
}
for (i = 0; i < XkbNumKbdGroups; i++)
{
info->numLevels[i] = 0;
for (i = 0; i < XkbNumKbdGroups; i++)
{
info->numLevels[i] = 0;
+ info->types[i] = XKB_ATOM_NONE;
info->syms[i] = NULL;
info->acts[i] = NULL;
}
info->syms[i] = NULL;
info->acts[i] = NULL;
}
+ info->dfltType = XKB_ATOM_NONE;
info->behavior.type = XkbKB_Default;
info->behavior.data = 0;
info->vmodmap = 0;
info->behavior.type = XkbKB_Default;
info->behavior.data = 0;
info->vmodmap = 0;
for (i = 0; i < XkbNumKbdGroups; i++)
{
info->numLevels[i] = 0;
for (i = 0; i < XkbNumKbdGroups; i++)
{
info->numLevels[i] = 0;
+ info->types[i] = XKB_ATOM_NONE;
free(info->syms[i]);
info->syms[i] = NULL;
free(info->acts[i]);
info->acts[i] = NULL;
}
free(info->syms[i]);
info->syms[i] = NULL;
free(info->acts[i]);
info->acts[i] = NULL;
}
+ info->dfltType = XKB_ATOM_NONE;
info->behavior.type = XkbKB_Default;
info->behavior.data = 0;
info->vmodmap = 0;
info->behavior.type = XkbKB_Default;
info->behavior.data = 0;
info->vmodmap = 0;
info->keys = uTypedCalloc(SYMBOLS_INIT_SIZE, KeyInfo);
info->modMap = NULL;
for (i = 0; i < XkbNumKbdGroups; i++)
info->keys = uTypedCalloc(SYMBOLS_INIT_SIZE, KeyInfo);
info->modMap = NULL;
for (i = 0; i < XkbNumKbdGroups; i++)
- info->groupNames[i] = None;
+ info->groupNames[i] = XKB_ATOM_NONE;
InitKeyInfo(&info->dflt);
InitVModInfo(&info->vmods, xkb);
info->action = NULL;
InitKeyInfo(&info->dflt);
InitVModInfo(&info->vmods, xkb);
info->action = NULL;
MergeKeyGroups(info, into, from, (unsigned) i);
}
}
MergeKeyGroups(info, into, from, (unsigned) i);
}
}
- if (from->types[i] != None)
+ if (from->types[i] != XKB_ATOM_NONE)
- if ((into->types[i] != None) && (report) &&
+ if ((into->types[i] != XKB_ATOM_NONE) && report &&
(into->types[i] != from->types[i]))
{
xkb_atom_t use, ignore;
(into->types[i] != from->types[i]))
{
xkb_atom_t use, ignore;
XkbcAtomText(ignore));
}
if ((from->defs.merge != MergeAugment)
XkbcAtomText(ignore));
}
if ((from->defs.merge != MergeAugment)
- || (into->types[i] == None))
+ || (into->types[i] == XKB_ATOM_NONE))
{
into->types[i] = from->types[i];
}
{
into->types[i] = from->types[i];
}
}
for (i = 0; i < XkbNumKbdGroups; i++)
{
}
for (i = 0; i < XkbNumKbdGroups; i++)
{
- if (from->groupNames[i] != None)
+ if (from->groupNames[i] != XKB_ATOM_NONE)
- if ((merge != MergeAugment) || (into->groupNames[i] == None))
+ if ((merge != MergeAugment) ||
+ (into->groupNames[i] == XKB_ATOM_NONE))
into->groupNames[i] = from->groupNames[i];
}
}
into->groupNames[i] = from->groupNames[i];
}
}
haveActions = True;
autoType = False;
/* Assign the type to the key, if it is missing. */
haveActions = True;
autoType = False;
/* Assign the type to the key, if it is missing. */
- if (key->types[i] == None)
+ if (key->types[i] == XKB_ATOM_NONE)
- if (key->dfltType != None)
+ if (key->dfltType != XKB_ATOM_NONE)
key->types[i] = key->dfltType;
else if (FindAutomaticType(key->numLevels[i], key->syms[i],
&key->types[i], &autoType))
key->types[i] = key->dfltType;
else if (FindAutomaticType(key->numLevels[i], key->syms[i],
&key->types[i], &autoType))
ApplyAliases(xkb, &info.aliases);
for (i = 0; i < XkbNumKbdGroups; i++)
{
ApplyAliases(xkb, &info.aliases);
for (i = 0; i < XkbNumKbdGroups; i++)
{
- if (info.groupNames[i] != None)
+ if (info.groupNames[i] != XKB_ATOM_NONE)
{
free(UNCONSTIFY(xkb->names->groups[i]));
xkb->names->groups[i] = XkbcAtomGetString(info.groupNames[i]);
{
free(UNCONSTIFY(xkb->names->groups[i]));
xkb->names->groups[i] = XkbcAtomGetString(info.groupNames[i]);
#ifndef XKBCOMP_H
#define XKBCOMP_H 1
#ifndef XKBCOMP_H
#define XKBCOMP_H 1
-#include <X11/X.h>
-#include <X11/Xdefs.h>
-
#include "utils.h"
#include "xkbcommon/xkbcommon.h"
#include "utils.h"
#include "xkbcommon/xkbcommon.h"
| SHAPE
{ $$= xkb_intern_atom("shape"); }
| ROW
| SHAPE
{ $$= xkb_intern_atom("shape"); }
| ROW
;
OptMergeMode : MergeMode { $$= $1; }
;
OptMergeMode : MergeMode { $$= $1; }
{
ExprDef *expr;
expr= ExprCreate(ExprArrayRef,TypeUnknown);
{
ExprDef *expr;
expr= ExprCreate(ExprArrayRef,TypeUnknown);
- expr->value.array.element= None;
+ expr->value.array.element= XKB_ATOM_NONE;
expr->value.array.field= $1;
expr->value.array.entry= $3;
$$= expr;
expr->value.array.field= $1;
expr->value.array.entry= $3;
$$= expr;
#ifndef _XKBMISC_H_
#define _XKBMISC_H_
#ifndef _XKBMISC_H_
#define _XKBMISC_H_
#include <X11/Xdefs.h>
#include "xkbcommon/xkbcommon.h"
#include "XKBcommonint.h"
typedef uint32_t xkb_atom_t;
#include <X11/Xdefs.h>
#include "xkbcommon/xkbcommon.h"
#include "XKBcommonint.h"
typedef uint32_t xkb_atom_t;
+#define XKB_ATOM_NONE 0
+
/***====================================================================***/
extern Bool
/***====================================================================***/
extern Bool
#ifndef _XKBRULES_H_
#define _XKBRULES_H_
#ifndef _XKBRULES_H_
#define _XKBRULES_H_
-#include <stdio.h>
-#include <X11/X.h>
#include <X11/Xdefs.h>
#include "xkbcommon/xkbcommon.h"
#include <X11/Xdefs.h>
#include "xkbcommon/xkbcommon.h"
/* From filecommon */
#define XkbXKMFile 0
/* From filecommon */
#define XkbXKMFile 0
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
-#include <X11/X.h>
-#include <X11/Xdefs.h>
#include "xkbcommon/xkbcommon.h"
#include "utils.h"
#include "xkbcommon/xkbcommon.h"
#include "utils.h"
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
-#include <X11/X.h>
-#include <X11/Xdefs.h>
#include "xkbcommon/xkbcommon.h"
#include "utils.h"
#include "xkbcommon/xkbcommon.h"
#include "utils.h"
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <X11/Xdefs.h>
#include "xkbcommon/xkbcommon.h"
#include "utils.h"
#include <X11/Xdefs.h>
#include "xkbcommon/xkbcommon.h"
#include "utils.h"
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
-#include <X11/X.h>
-#include <X11/Xdefs.h>
#include <X11/keysym.h>
#include <linux/input.h>
#include "xkbcommon/xkbcommon.h"
#include <X11/keysym.h>
#include <linux/input.h>
#include "xkbcommon/xkbcommon.h"