kbproto unentanglement: XkbLC_*
Signed-off-by: Daniel Stone <daniel@fooishbar.org>master
parent
830fe67132
commit
b6e0457195
|
@ -445,7 +445,7 @@ EnsureSafeMapName(char *name)
|
||||||
|
|
||||||
XkbFile *
|
XkbFile *
|
||||||
XkbFileCreate(struct xkb_context *ctx, enum xkb_file_type type, char *name,
|
XkbFileCreate(struct xkb_context *ctx, enum xkb_file_type type, char *name,
|
||||||
ParseCommon *defs, unsigned flags)
|
ParseCommon *defs, enum xkb_map_flags flags)
|
||||||
{
|
{
|
||||||
XkbFile *file;
|
XkbFile *file;
|
||||||
|
|
||||||
|
|
|
@ -249,6 +249,17 @@ typedef struct _IndicatorMapDef {
|
||||||
VarDef *body;
|
VarDef *body;
|
||||||
} IndicatorMapDef;
|
} IndicatorMapDef;
|
||||||
|
|
||||||
|
enum xkb_map_flags {
|
||||||
|
MAP_IS_DEFAULT = (1 << 0),
|
||||||
|
MAP_IS_PARTIAL = (1 << 1),
|
||||||
|
MAP_IS_HIDDEN = (1 << 2),
|
||||||
|
MAP_HAS_ALPHANUMERIC = (1 << 3),
|
||||||
|
MAP_HAS_MODIFIER = (1 << 4),
|
||||||
|
MAP_HAS_KEYPAD = (1 << 5),
|
||||||
|
MAP_HAS_FN = (1 << 6),
|
||||||
|
MAP_IS_ALTGR = (1 << 7),
|
||||||
|
};
|
||||||
|
|
||||||
typedef struct _XkbFile {
|
typedef struct _XkbFile {
|
||||||
ParseCommon common;
|
ParseCommon common;
|
||||||
enum xkb_file_type file_type;
|
enum xkb_file_type file_type;
|
||||||
|
@ -256,7 +267,7 @@ typedef struct _XkbFile {
|
||||||
char *name;
|
char *name;
|
||||||
ParseCommon *defs;
|
ParseCommon *defs;
|
||||||
int id;
|
int id;
|
||||||
unsigned flags;
|
enum xkb_map_flags flags;
|
||||||
} XkbFile;
|
} XkbFile;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -280,7 +280,7 @@ ProcessIncludeFile(struct xkb_context *ctx,
|
||||||
}
|
}
|
||||||
else if (rtrn->common.next) {
|
else if (rtrn->common.next) {
|
||||||
for (; mapToUse; mapToUse = (XkbFile *) mapToUse->common.next)
|
for (; mapToUse; mapToUse = (XkbFile *) mapToUse->common.next)
|
||||||
if (mapToUse->flags & XkbLC_Default)
|
if (mapToUse->flags & MAP_IS_DEFAULT)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (!mapToUse) {
|
if (!mapToUse) {
|
||||||
|
|
|
@ -125,6 +125,7 @@ yyerror(struct YYLTYPE *loc, struct parser_param *param, const char *msg)
|
||||||
char keyName[XKB_KEY_NAME_LENGTH];
|
char keyName[XKB_KEY_NAME_LENGTH];
|
||||||
xkb_atom_t sval;
|
xkb_atom_t sval;
|
||||||
enum merge_mode merge;
|
enum merge_mode merge;
|
||||||
|
enum xkb_map_flags mapFlags;
|
||||||
ParseCommon *any;
|
ParseCommon *any;
|
||||||
ExprDef *expr;
|
ExprDef *expr;
|
||||||
VarDef *var;
|
VarDef *var;
|
||||||
|
@ -148,7 +149,8 @@ yyerror(struct YYLTYPE *loc, struct parser_param *param, const char *msg)
|
||||||
%type <ival> Number Integer Float SignedNumber
|
%type <ival> Number Integer Float SignedNumber
|
||||||
%type <merge> MergeMode OptMergeMode
|
%type <merge> MergeMode OptMergeMode
|
||||||
%type <file_type> XkbCompositeType FileType
|
%type <file_type> XkbCompositeType FileType
|
||||||
%type <uval> DoodadType Flag Flags OptFlags KeyCode
|
%type <uval> DoodadType
|
||||||
|
%type <mapFlags> Flag Flags OptFlags KeyCode
|
||||||
%type <str> MapName OptMapName KeySym
|
%type <str> MapName OptMapName KeySym
|
||||||
%type <sval> FieldSpec Ident Element String
|
%type <sval> FieldSpec Ident Element String
|
||||||
%type <any> DeclList Decl
|
%type <any> DeclList Decl
|
||||||
|
@ -253,14 +255,14 @@ Flags : Flags Flag { $$ = ($1 | $2); }
|
||||||
| Flag { $$ = $1; }
|
| Flag { $$ = $1; }
|
||||||
;
|
;
|
||||||
|
|
||||||
Flag : PARTIAL { $$ = XkbLC_Partial; }
|
Flag : PARTIAL { $$ = MAP_IS_PARTIAL; }
|
||||||
| DEFAULT { $$ = XkbLC_Default; }
|
| DEFAULT { $$ = MAP_IS_DEFAULT; }
|
||||||
| HIDDEN { $$ = XkbLC_Hidden; }
|
| HIDDEN { $$ = MAP_IS_HIDDEN; }
|
||||||
| ALPHANUMERIC_KEYS { $$ = XkbLC_AlphanumericKeys; }
|
| ALPHANUMERIC_KEYS { $$ = MAP_HAS_ALPHANUMERIC; }
|
||||||
| MODIFIER_KEYS { $$ = XkbLC_ModifierKeys; }
|
| MODIFIER_KEYS { $$ = MAP_HAS_MODIFIER; }
|
||||||
| KEYPAD_KEYS { $$ = XkbLC_KeypadKeys; }
|
| KEYPAD_KEYS { $$ = MAP_HAS_KEYPAD; }
|
||||||
| FUNCTION_KEYS { $$ = XkbLC_FunctionKeys; }
|
| FUNCTION_KEYS { $$ = MAP_HAS_FN; }
|
||||||
| ALTERNATE_GROUP { $$ = XkbLC_AlternateGroup; }
|
| ALTERNATE_GROUP { $$ = MAP_IS_ALTGR; }
|
||||||
;
|
;
|
||||||
|
|
||||||
DeclList : DeclList Decl
|
DeclList : DeclList Decl
|
||||||
|
|
|
@ -234,7 +234,7 @@ CheckDefaultMap(struct xkb_context *ctx, XkbFile *maps, const char *fileName)
|
||||||
XkbFile *dflt = NULL, *tmp;
|
XkbFile *dflt = NULL, *tmp;
|
||||||
|
|
||||||
for (tmp = maps; tmp; tmp = (XkbFile *) tmp->common.next) {
|
for (tmp = maps; tmp; tmp = (XkbFile *) tmp->common.next) {
|
||||||
if (!(tmp->flags & XkbLC_Default))
|
if (!(tmp->flags & MAP_IS_DEFAULT))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!dflt) {
|
if (!dflt) {
|
||||||
|
@ -249,7 +249,7 @@ CheckDefaultMap(struct xkb_context *ctx, XkbFile *maps, const char *fileName)
|
||||||
(dflt->name ? dflt->name : "(first)"),
|
(dflt->name ? dflt->name : "(first)"),
|
||||||
(tmp->name ? tmp->name : "(subsequent)"));
|
(tmp->name ? tmp->name : "(subsequent)"));
|
||||||
|
|
||||||
tmp->flags &= (~XkbLC_Default);
|
tmp->flags &= (~MAP_IS_DEFAULT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue