Add rules file parsing from xkbfile

Copy over the Xkb_RF* rules parsing functions from xkbfile's maprules.c.
Eventually, this will be tied into xkbcomp's path searching utilities so
you don't need to supply a full path to the rules file. Also, it this
should eventually incorporate the server's RMLVOSet.
master
Dan Nicholson 2009-03-29 11:25:44 -07:00
parent 3fc0dcc816
commit 94fd317463
4 changed files with 1370 additions and 0 deletions

View File

@ -28,12 +28,14 @@ authorization from the authors.
#ifndef _XKBCOMMON_H_
#define _XKBCOMMON_H_
#include <stdio.h>
#include <X11/X.h>
#include <X11/Xdefs.h>
#include <X11/Xfuncproto.h>
#include <X11/keysym.h>
#include <X11/extensions/XKBstrcommon.h>
#include <X11/extensions/XKBgeomcommon.h>
#include <X11/extensions/XKBrulescommon.h>
/* Common keyboard description structure */
typedef struct _XkbcDesc {
@ -316,6 +318,46 @@ XkbcComputeRowBounds(XkbGeometryPtr geom, XkbSectionPtr section, XkbRowPtr row);
extern Bool
XkbcComputeSectionBounds(XkbGeometryPtr geom, XkbSectionPtr section);
extern Bool
XkbcRF_GetComponents(XkbRF_RulesPtr rules, XkbRF_VarDefsPtr defs,
XkbComponentNamesPtr names);
extern XkbRF_RulePtr
XkbcRF_AddRule(XkbRF_RulesPtr rules);
extern XkbRF_GroupPtr
XkbcRF_AddGroup(XkbRF_RulesPtr rules);
extern Bool
XkbcRF_LoadRules(FILE *file, XkbRF_RulesPtr rules);
extern Bool
XkbcRF_LoadRulesByName(char *base, char *locale, XkbRF_RulesPtr rules);
extern XkbRF_VarDescPtr
XkbcRF_AddVarDesc(XkbRF_DescribeVarsPtr vars);
extern XkbRF_VarDescPtr
XkbcRF_AddVarDescCopy(XkbRF_DescribeVarsPtr vars, XkbRF_VarDescPtr from);
extern XkbRF_DescribeVarsPtr
XkbcRF_AddVarToDescribe(XkbRF_RulesPtr rules, char *name);
extern Bool
XkbcRF_LoadDescriptions(FILE *file, XkbRF_RulesPtr rules);
extern Bool
XkbcRF_LoadDescriptionsByName(char *base, char *locale, XkbRF_RulesPtr rules);
extern XkbRF_RulesPtr
XkbcRF_Load(char *base, char *locale, Bool wantDesc, Bool wantRules);
extern XkbRF_RulesPtr
XkbcRF_Create(int szRules, int szExtra);
extern void
XkbcRF_Free(XkbRF_RulesPtr rules, Bool freeRules);
extern int
XkbcInitCanonicalKeyTypes(XkbcDescPtr xkb, unsigned which, int keypadVMod);

View File

@ -13,6 +13,7 @@ libxkbcommon_la_SOURCES = \
geom.c \
keysym.c \
malloc.c \
maprules.c \
misc.c \
text.c \
xkb.c

View File

@ -55,4 +55,7 @@ authorization from the authors.
#define _XkbClearElems(a,f,l,t) bzero(&(a)[f],((l)-(f)+1)*sizeof(t))
#define _XkbFree(p) free((p))
#define _XkbDupString(s) ((s) ? strdup(s) : NULL)
#define _XkbStrCaseCmp strcasecmp
#endif /* _XKBCOMMONINT_H_ */

1324
src/maprules.c Normal file

File diff suppressed because it is too large Load Diff