Debian Codegraph @

src/xkbcomp/action.h

raw
1 /*
2 * Copyright (c) 1994 by Silicon Graphics Computer Systems, Inc.
3 * SPDX-License-Identifier: HPND
4 */
5 #pragma once
6
7 #include "config.h"
8
9 #include "ast.h"
10 #include "keymap.h"
11
12 /*
13 * This struct contains the default values which every new action
14 * (e.g. in an interpret statement) starts off with. It can be
15 * modified within the files (see calls to SetDefaultActionField).
16 */
17 typedef struct {
18 union xkb_action actions[_ACTION_TYPE_NUM_ENTRIES];
19 } ActionsInfo;
20
21 void
22 InitActionsInfo(ActionsInfo *info);
23
24 bool
25 HandleActionDef(struct xkb_context *ctx, enum xkb_keymap_format format,
26 ActionsInfo *info, const struct xkb_mod_set *mods, ExprDef *def,
27 union xkb_action *action);
28
29 bool
30 SetDefaultActionField(struct xkb_context *ctx, enum xkb_keymap_format format,
31 ActionsInfo *info, struct xkb_mod_set *mods,
32 const char *elem, const char *field, ExprDef *array_ndx,
33 ExprDef *value, enum merge_mode merge);
34
35 static inline bool
36 isModsUnLockOnPressSupported(enum xkb_keymap_format format)
37 {
38 /* Lax bound */
39 return format >= XKB_KEYMAP_FORMAT_TEXT_V2;
40 }
41
42 static inline bool
43 isGroupLockOnReleaseSupported(enum xkb_keymap_format format)
44 {
45 /* Lax bound */
46 return format >= XKB_KEYMAP_FORMAT_TEXT_V2;
47 }
48
49 static inline bool
50 isModsLatchOnPressSupported(enum xkb_keymap_format format)
51 {
52 /* Lax bound */
53 return format >= XKB_KEYMAP_FORMAT_TEXT_V2;
54 }