2009-03-27 07:55:32 -06:00
|
|
|
/************************************************************
|
|
|
|
Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc.
|
|
|
|
|
|
|
|
Permission to use, copy, modify, and distribute this
|
|
|
|
software and its documentation for any purpose and without
|
|
|
|
fee is hereby granted, provided that the above copyright
|
|
|
|
notice appear in all copies and that both that copyright
|
|
|
|
notice and this permission notice appear in supporting
|
2009-04-04 10:19:51 -06:00
|
|
|
documentation, and that the name of Silicon Graphics not be
|
|
|
|
used in advertising or publicity pertaining to distribution
|
2009-03-27 07:55:32 -06:00
|
|
|
of the software without specific prior written permission.
|
2009-04-04 10:19:51 -06:00
|
|
|
Silicon Graphics makes no representation about the suitability
|
2009-03-27 07:55:32 -06:00
|
|
|
of this software for any purpose. It is provided "as is"
|
|
|
|
without any express or implied warranty.
|
2009-04-04 10:19:51 -06:00
|
|
|
|
|
|
|
SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
|
|
|
|
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
2009-03-27 07:55:32 -06:00
|
|
|
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
|
2009-04-04 10:19:51 -06:00
|
|
|
GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
|
|
|
|
DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
|
|
|
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
2009-03-27 07:55:32 -06:00
|
|
|
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
|
|
|
|
THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
|
|
|
|
********************************************************/
|
|
|
|
|
|
|
|
#ifndef XKBCOMP_H
|
|
|
|
#define XKBCOMP_H 1
|
|
|
|
|
|
|
|
#include "utils.h"
|
|
|
|
|
2012-02-15 04:49:10 -07:00
|
|
|
#include "xkbcommon/xkbcommon.h"
|
2009-04-05 21:27:35 -06:00
|
|
|
#include "XKBcommonint.h"
|
2012-03-09 12:09:25 -07:00
|
|
|
#include "xkbmisc.h"
|
2009-03-27 07:55:32 -06:00
|
|
|
|
|
|
|
#define TypeUnknown 0
|
|
|
|
#define TypeBoolean 1
|
|
|
|
#define TypeInt 2
|
|
|
|
#define TypeString 4
|
|
|
|
#define TypeAction 5
|
|
|
|
#define TypeKeyName 6
|
|
|
|
#define TypeSymbols 7
|
|
|
|
|
|
|
|
#define StmtUnknown 0
|
|
|
|
#define StmtInclude 1
|
|
|
|
#define StmtKeycodeDef 2
|
|
|
|
#define StmtKeyAliasDef 3
|
|
|
|
#define StmtExpr 4
|
|
|
|
#define StmtVarDef 5
|
|
|
|
#define StmtKeyTypeDef 6
|
|
|
|
#define StmtInterpDef 7
|
|
|
|
#define StmtVModDef 8
|
|
|
|
#define StmtSymbolsDef 9
|
|
|
|
#define StmtModMapDef 10
|
|
|
|
#define StmtGroupCompatDef 11
|
|
|
|
#define StmtIndicatorMapDef 12
|
|
|
|
#define StmtIndicatorNameDef 13
|
|
|
|
|
|
|
|
#define FileSymInterp 100
|
|
|
|
|
|
|
|
typedef struct _ParseCommon
|
|
|
|
{
|
|
|
|
unsigned stmtType;
|
|
|
|
struct _ParseCommon *next;
|
|
|
|
} ParseCommon;
|
|
|
|
|
|
|
|
#define ExprValue 0
|
|
|
|
#define ExprIdent 1
|
|
|
|
#define ExprActionDecl 2
|
|
|
|
#define ExprFieldRef 3
|
|
|
|
#define ExprArrayRef 4
|
|
|
|
#define ExprKeysymList 5
|
|
|
|
#define ExprActionList 6
|
|
|
|
|
|
|
|
#define OpAdd 20
|
|
|
|
#define OpSubtract 21
|
|
|
|
#define OpMultiply 22
|
|
|
|
#define OpDivide 23
|
|
|
|
#define OpAssign 24
|
|
|
|
#define OpNot 25
|
|
|
|
#define OpNegate 26
|
|
|
|
#define OpInvert 27
|
|
|
|
#define OpUnaryPlus 28
|
|
|
|
|
|
|
|
#define MergeDefault 0
|
|
|
|
#define MergeAugment 1
|
|
|
|
#define MergeOverride 2
|
|
|
|
#define MergeReplace 3
|
|
|
|
#define MergeAltForm 4
|
|
|
|
|
|
|
|
#define AutoKeyNames (1L << 0)
|
|
|
|
#define CreateKeyNames(x) ((x)->flags&AutoKeyNames)
|
|
|
|
|
|
|
|
extern unsigned warningLevel;
|
|
|
|
|
|
|
|
typedef struct _IncludeStmt
|
|
|
|
{
|
|
|
|
ParseCommon common;
|
|
|
|
unsigned merge;
|
|
|
|
char *stmt;
|
|
|
|
char *file;
|
|
|
|
char *map;
|
|
|
|
char *modifier;
|
|
|
|
char *path;
|
|
|
|
struct _IncludeStmt *next;
|
|
|
|
} IncludeStmt;
|
|
|
|
|
|
|
|
typedef struct _Expr
|
|
|
|
{
|
|
|
|
ParseCommon common;
|
|
|
|
unsigned op;
|
|
|
|
unsigned type;
|
|
|
|
union
|
|
|
|
{
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
struct _Expr *left;
|
|
|
|
struct _Expr *right;
|
|
|
|
} binary;
|
|
|
|
struct
|
|
|
|
{
|
2012-03-09 12:09:25 -07:00
|
|
|
xkb_atom_t element;
|
|
|
|
xkb_atom_t field;
|
2009-03-27 07:55:32 -06:00
|
|
|
} field;
|
|
|
|
struct
|
|
|
|
{
|
2012-03-09 12:09:25 -07:00
|
|
|
xkb_atom_t element;
|
|
|
|
xkb_atom_t field;
|
2009-03-27 07:55:32 -06:00
|
|
|
struct _Expr *entry;
|
|
|
|
} array;
|
|
|
|
struct
|
|
|
|
{
|
2012-03-09 12:09:25 -07:00
|
|
|
xkb_atom_t name;
|
2009-03-27 07:55:32 -06:00
|
|
|
struct _Expr *args;
|
|
|
|
} action;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
int nSyms;
|
|
|
|
int szSyms;
|
2010-06-15 12:38:16 -06:00
|
|
|
char **syms;
|
2009-03-27 07:55:32 -06:00
|
|
|
} list;
|
|
|
|
struct _Expr *child;
|
2012-03-09 12:09:25 -07:00
|
|
|
xkb_atom_t str;
|
2009-03-27 07:55:32 -06:00
|
|
|
unsigned uval;
|
|
|
|
int ival;
|
|
|
|
char keyName[5];
|
|
|
|
} value;
|
|
|
|
} ExprDef;
|
|
|
|
|
|
|
|
typedef struct _VarDef
|
|
|
|
{
|
|
|
|
ParseCommon common;
|
|
|
|
unsigned merge;
|
|
|
|
ExprDef *name;
|
|
|
|
ExprDef *value;
|
|
|
|
} VarDef;
|
|
|
|
|
|
|
|
typedef struct _VModDef
|
|
|
|
{
|
|
|
|
ParseCommon common;
|
|
|
|
unsigned merge;
|
2012-03-09 12:09:25 -07:00
|
|
|
xkb_atom_t name;
|
2009-03-27 07:55:32 -06:00
|
|
|
ExprDef *value;
|
|
|
|
} VModDef;
|
|
|
|
|
|
|
|
typedef struct _KeycodeDef
|
|
|
|
{
|
|
|
|
ParseCommon common;
|
|
|
|
unsigned merge;
|
|
|
|
char name[5];
|
2012-02-15 12:39:33 -07:00
|
|
|
unsigned long value;
|
2009-03-27 07:55:32 -06:00
|
|
|
} KeycodeDef;
|
|
|
|
|
|
|
|
typedef struct _KeyAliasDef
|
|
|
|
{
|
|
|
|
ParseCommon common;
|
|
|
|
unsigned merge;
|
|
|
|
char alias[5];
|
|
|
|
char real[5];
|
|
|
|
} KeyAliasDef;
|
|
|
|
|
|
|
|
typedef struct _KeyTypeDef
|
|
|
|
{
|
|
|
|
ParseCommon common;
|
|
|
|
unsigned merge;
|
2012-03-09 12:09:25 -07:00
|
|
|
xkb_atom_t name;
|
2009-03-27 07:55:32 -06:00
|
|
|
VarDef *body;
|
|
|
|
} KeyTypeDef;
|
|
|
|
|
|
|
|
typedef struct _SymbolsDef
|
|
|
|
{
|
|
|
|
ParseCommon common;
|
|
|
|
unsigned merge;
|
|
|
|
char keyName[5];
|
|
|
|
ExprDef *symbols;
|
|
|
|
} SymbolsDef;
|
|
|
|
|
|
|
|
typedef struct _ModMapDef
|
|
|
|
{
|
|
|
|
ParseCommon common;
|
|
|
|
unsigned merge;
|
2012-03-09 12:09:25 -07:00
|
|
|
xkb_atom_t modifier;
|
2009-03-27 07:55:32 -06:00
|
|
|
ExprDef *keys;
|
|
|
|
} ModMapDef;
|
|
|
|
|
|
|
|
typedef struct _GroupCompatDef
|
|
|
|
{
|
|
|
|
ParseCommon common;
|
|
|
|
unsigned merge;
|
|
|
|
int group;
|
|
|
|
ExprDef *def;
|
|
|
|
} GroupCompatDef;
|
|
|
|
|
|
|
|
typedef struct _InterpDef
|
|
|
|
{
|
|
|
|
ParseCommon common;
|
|
|
|
unsigned merge;
|
2010-06-21 07:28:34 -06:00
|
|
|
char *sym;
|
2009-03-27 07:55:32 -06:00
|
|
|
ExprDef *match;
|
|
|
|
VarDef *def;
|
|
|
|
} InterpDef;
|
|
|
|
|
|
|
|
typedef struct _IndicatorNameDef
|
|
|
|
{
|
|
|
|
ParseCommon common;
|
|
|
|
unsigned merge;
|
|
|
|
int ndx;
|
|
|
|
ExprDef *name;
|
|
|
|
Bool virtual;
|
|
|
|
} IndicatorNameDef;
|
|
|
|
|
2012-03-09 12:29:29 -07:00
|
|
|
typedef struct _IndicatorMapDef
|
2009-03-27 07:55:32 -06:00
|
|
|
{
|
|
|
|
ParseCommon common;
|
|
|
|
unsigned merge;
|
|
|
|
unsigned type;
|
2012-03-09 12:09:25 -07:00
|
|
|
xkb_atom_t name;
|
2009-03-27 07:55:32 -06:00
|
|
|
VarDef *body;
|
2012-03-09 12:29:29 -07:00
|
|
|
} IndicatorMapDef;
|
2009-03-27 07:55:32 -06:00
|
|
|
|
|
|
|
typedef struct _XkbFile
|
|
|
|
{
|
|
|
|
ParseCommon common;
|
2012-03-23 18:36:11 -06:00
|
|
|
unsigned type;
|
2009-03-27 07:55:32 -06:00
|
|
|
char *topName;
|
|
|
|
char *name;
|
|
|
|
ParseCommon *defs;
|
|
|
|
int id;
|
|
|
|
unsigned flags;
|
|
|
|
Bool compiled;
|
|
|
|
} XkbFile;
|
|
|
|
|
2012-03-10 06:48:13 -07:00
|
|
|
extern struct xkb_desc *
|
2012-03-27 10:22:35 -06:00
|
|
|
CompileKeymap(struct xkb_context *context, XkbFile *file, unsigned merge);
|
2009-03-27 07:55:32 -06:00
|
|
|
|
2009-03-27 20:54:50 -06:00
|
|
|
extern Bool
|
2010-07-01 12:35:24 -06:00
|
|
|
CompileKeycodes(XkbFile *file, struct xkb_desc * xkb, unsigned merge);
|
2009-03-27 07:55:32 -06:00
|
|
|
|
2009-03-27 20:54:50 -06:00
|
|
|
extern Bool
|
2010-07-01 12:35:24 -06:00
|
|
|
CompileKeyTypes(XkbFile *file, struct xkb_desc * xkb, unsigned merge);
|
2009-03-27 07:55:32 -06:00
|
|
|
|
|
|
|
typedef struct _LEDInfo *LEDInfoPtr;
|
|
|
|
|
2009-03-27 20:54:50 -06:00
|
|
|
extern Bool
|
2010-07-01 12:35:24 -06:00
|
|
|
CompileCompatMap(XkbFile *file, struct xkb_desc * xkb, unsigned merge,
|
2009-03-27 20:54:50 -06:00
|
|
|
LEDInfoPtr *unboundLEDs);
|
2009-03-27 07:55:32 -06:00
|
|
|
|
2009-03-27 20:54:50 -06:00
|
|
|
extern Bool
|
2010-07-01 12:35:24 -06:00
|
|
|
CompileSymbols(XkbFile *file, struct xkb_desc * xkb, unsigned merge);
|
2009-03-27 07:55:32 -06:00
|
|
|
|
2012-03-14 12:24:37 -06:00
|
|
|
extern Bool
|
|
|
|
UpdateModifiersFromCompat(struct xkb_desc *xkb);
|
|
|
|
|
2009-03-27 07:55:32 -06:00
|
|
|
#endif /* XKBCOMP_H */
|