}
Bool
-CompileCompatMap(XkbFile * file,
- XkbFileInfo * result, unsigned merge, LEDInfo ** unboundLEDs)
+CompileCompatMap(XkbFile *file, XkbcDescPtr xkb, unsigned merge,
+ LEDInfoPtr *unboundLEDs)
{
int i;
CompatInfo info;
- XkbDescPtr xkb;
GroupCompatInfo *gcm;
- xkb = result->xkb;
InitCompatInfo(&info, xkb);
info.dflt.defs.merge = merge;
info.ledDflt.defs.merge = merge;
}
if (info.leds != NULL)
{
- if (!CopyIndicatorMapDefs(result, info.leds, unboundLEDs))
+ if (!CopyIndicatorMapDefs(xkb, info.leds, unboundLEDs))
info.errorCount++;
info.leds = NULL;
}
/***====================================================================***/
Bool
-CompileGeometry(XkbFile * file, XkbFileInfo * result, unsigned merge)
+CompileGeometry(XkbFile *file, XkbcDescPtr xkb, unsigned merge)
{
GeometryInfo info;
- XkbDescPtr xkb;
- xkb = result->xkb;
InitGeometryInfo(&info, file->id, merge);
info.dpy = xkb->dpy;
HandleGeometryFile(file, xkb, merge, &info);
}
Bool
-CopyIndicatorMapDefs(XkbFileInfo * result, LEDInfo * leds,
- LEDInfo ** unboundRtrn)
+CopyIndicatorMapDefs(XkbcDescPtr xkb, LEDInfo *leds, LEDInfo **unboundRtrn)
{
LEDInfo *led, *next;
LEDInfo *unbound, *last;
- XkbDescPtr xkb;
- xkb = result->xkb;
if (XkbAllocNames(xkb, XkbIndicatorNamesMask, 0, 0) != Success)
{
WSGO("Couldn't allocate names\n");
}
Bool
-BindIndicators(XkbFileInfo * result,
- Bool force, LEDInfo * unbound, LEDInfo ** unboundRtrn)
+BindIndicators(XkbcDescPtr xkb, Bool force, LEDInfo *unbound,
+ LEDInfo **unboundRtrn)
{
- XkbDescPtr xkb;
register int i;
register LEDInfo *led, *next, *last;
- xkb = result->xkb;
if (xkb->names != NULL)
{
for (led = unbound; led != NULL; led = (LEDInfo *) led->defs.next)
unsigned /* mergeMode */
);
-extern Bool CopyIndicatorMapDefs(XkbFileInfo * /* result */ ,
- LEDInfo * /* leds */ ,
- LEDInfo ** /* unboundRtrn */
- );
+extern Bool
+CopyIndicatorMapDefs(XkbcDescPtr xkb, LEDInfo *leds, LEDInfo **unboundRtrn);
-extern Bool BindIndicators(XkbFileInfo * /* result */ ,
- Bool /* force */ ,
- LEDInfo * /* unbound */ ,
- LEDInfo ** /* unboundRtrn */
- );
+extern Bool
+BindIndicators(XkbcDescPtr xkb, Bool force, LEDInfo *unbound,
+ LEDInfo **unboundRtrn);
#endif /* INDICATORS_H */
* @return True on success, False otherwise.
*/
Bool
-CompileKeycodes(XkbFile * file, XkbFileInfo * result, unsigned merge)
+CompileKeycodes(XkbFile *file, XkbcDescPtr xkb, unsigned merge)
{
KeyNamesInfo info; /* contains all the info after parsing */
- XkbDescPtr xkb;
- xkb = result->xkb;
InitKeyNamesInfo(&info);
HandleKeycodesFile(file, xkb, merge, &info);
static XkbFile *sections[MAX_SECTIONS];
/**
- * Compile the given file and store the output in result.
+ * Compile the given file and store the output in xkb.
* @param file A list of XkbFiles, each denoting one type (e.g.
* XkmKeyNamesIdx, etc.)
*/
Bool
-CompileKeymap(XkbFile * file, XkbFileInfo * result, unsigned merge)
+CompileKeymap(XkbFile *file, XkbcDescPtr xkb, unsigned merge)
{
unsigned have;
Bool ok;
if (ok)
{
if (ok && (sections[KEYCODES] != NULL))
- ok = CompileKeycodes(sections[KEYCODES], result, MergeOverride);
+ ok = CompileKeycodes(sections[KEYCODES], xkb, MergeOverride);
if (ok && (sections[GEOMETRY] != NULL))
- ok = CompileGeometry(sections[GEOMETRY], result, MergeOverride);
+ ok = CompileGeometry(sections[GEOMETRY], xkb, MergeOverride);
if (ok && (sections[TYPES] != NULL))
- ok = CompileKeyTypes(sections[TYPES], result, MergeOverride);
+ ok = CompileKeyTypes(sections[TYPES], xkb, MergeOverride);
if (ok && (sections[COMPAT] != NULL))
- ok = CompileCompatMap(sections[COMPAT], result, MergeOverride,
+ ok = CompileCompatMap(sections[COMPAT], xkb, MergeOverride,
&unbound);
if (ok && (sections[SYMBOLS] != NULL))
- ok = CompileSymbols(sections[SYMBOLS], result, MergeOverride);
+ ok = CompileSymbols(sections[SYMBOLS], xkb, MergeOverride);
}
if (!ok)
return False;
- result->defined = have;
+ xkb->defined = have;
if (required & (~have))
{
register int i, bit;
XkbConfigText(mainType, XkbMessage));
ok = False;
}
- ok = BindIndicators(result, True, unbound, NULL);
+ ok = BindIndicators(xkb, True, unbound, NULL);
return ok;
}
}
Bool
-CompileKeyTypes(XkbFile * file, XkbFileInfo * result, unsigned merge)
+CompileKeyTypes(XkbFile *file, XkbcDescPtr xkb, unsigned merge)
{
KeyTypesInfo info;
- XkbDescPtr xkb;
- xkb = result->xkb;
InitKeyTypesInfo(&info, xkb, NULL);
info.fileID = file->id;
HandleKeyTypesFile(file, xkb, merge, &info);
}
/**
- * Copy the KeyInfo into result.
+ * Copy the KeyInfo into the keyboard description.
*
* This function recurses.
*/
static Bool
-CopySymbolsDef(XkbFileInfo * result, KeyInfo * key, int start_from)
+CopySymbolsDef(XkbcDescPtr xkb, KeyInfo *key, int start_from)
{
register int i;
unsigned okc, kc, width, tmp, nGroups;
Bool haveActions, autoType, useAlias;
KeySym *outSyms;
XkbAction *outActs;
- XkbDescPtr xkb;
unsigned types[XkbNumKbdGroups];
- xkb = result->xkb;
useAlias = (start_from == 0);
/* get the keycode for the key. */
}
/* do the same thing for the next key */
- CopySymbolsDef(result, key, kc + 1);
+ CopySymbolsDef(xkb, key, kc + 1);
return True;
}
static Bool
-CopyModMapDef(XkbFileInfo * result, ModMapEntry * entry)
+CopyModMapDef(XkbcDescPtr xkb, ModMapEntry *entry)
{
unsigned kc;
- XkbDescPtr xkb;
- xkb = result->xkb;
if ((!entry->haveSymbol)
&&
(!FindNamedKey
* Handle the xkb_symbols section of an xkb file.
*
* @param file The parsed xkb_symbols section of the xkb file.
- * @param result Handle to the data to store the result in.
+ * @param xkb Handle to the keyboard description to store the symbols in.
* @param merge Merge strategy (e.g. MergeOverride).
*/
Bool
-CompileSymbols(XkbFile * file, XkbFileInfo * result, unsigned merge)
+CompileSymbols(XkbFile *file, XkbcDescPtr xkb, unsigned merge)
{
register int i;
SymbolsInfo info;
- XkbDescPtr xkb;
- xkb = result->xkb;
InitSymbolsInfo(&info, xkb);
info.dflt.defs.fileID = file->id;
info.dflt.defs.merge = merge;
/* copy! */
for (key = info.keys, i = 0; i < info.nKeys; i++, key++)
{
- if (!CopySymbolsDef(result, key, 0))
+ if (!CopySymbolsDef(xkb, key, 0))
info.errorCount++;
}
if (warningLevel > 3)
ModMapEntry *mm, *next;
for (mm = info.modMap; mm != NULL; mm = next)
{
- if (!CopyModMapDef(result, mm))
+ if (!CopyModMapDef(xkb, mm))
info.errorCount++;
next = (ModMapEntry *) mm->defs.next;
}
Bool compiled;
} XkbFile;
-extern Bool CompileKeymap(XkbFile * /* file */ ,
- XkbFileInfo * /* result */ ,
- unsigned /* merge */
- );
+extern Bool
+CompileKeymap(XkbFile *file, XkbcDescPtr xkb, unsigned merge);
-extern Bool CompileKeycodes(XkbFile * /* file */ ,
- XkbFileInfo * /* result */ ,
- unsigned /* merge */
- );
+extern Bool
+CompileKeycodes(XkbFile *file, XkbcDescPtr xkb, unsigned merge);
-extern Bool CompileGeometry(XkbFile * /* file */ ,
- XkbFileInfo * /* result */ ,
- unsigned /* merge */
- );
+extern Bool
+CompileGeometry(XkbFile *file, XkbcDescPtr xkb, unsigned merge);
-extern Bool CompileKeyTypes(XkbFile * /* file */ ,
- XkbFileInfo * /* result */ ,
- unsigned /* merge */
- );
+extern Bool
+CompileKeyTypes(XkbFile *file, XkbcDescPtr xkb, unsigned merge);
typedef struct _LEDInfo *LEDInfoPtr;
-extern Bool CompileCompatMap(XkbFile * /* file */ ,
- XkbFileInfo * /* result */ ,
- unsigned /* merge */ ,
- LEDInfoPtr * /* unboundLEDs */
- );
+extern Bool
+CompileCompatMap(XkbFile *file, XkbcDescPtr xkb, unsigned merge,
+ LEDInfoPtr *unboundLEDs);
-extern Bool CompileSymbols(XkbFile * /* file */ ,
- XkbFileInfo * /* result */ ,
- unsigned /* merge */
- );
+extern Bool
+CompileSymbols(XkbFile *file, XkbcDescPtr xkb, unsigned merge);
#define WantLongListing (1<<0)
#define WantPartialMaps (1<<1)