kbproto unentanglement: action flags
Signed-off-by: Daniel Stone <daniel@fooishbar.org>master
parent
b6e0457195
commit
70c775f69d
|
@ -385,16 +385,16 @@ write_action(struct xkb_keymap *keymap, struct buf *buf,
|
||||||
case ACTION_TYPE_MOD_SET:
|
case ACTION_TYPE_MOD_SET:
|
||||||
case ACTION_TYPE_MOD_LATCH:
|
case ACTION_TYPE_MOD_LATCH:
|
||||||
case ACTION_TYPE_MOD_LOCK:
|
case ACTION_TYPE_MOD_LOCK:
|
||||||
if (action->mods.flags & XkbSA_UseModMapMods)
|
if (action->mods.flags & ACTION_MODS_LOOKUP_MODMAP)
|
||||||
args = "modMapMods";
|
args = "modMapMods";
|
||||||
else
|
else
|
||||||
args = VModMaskText(keymap, action->mods.mods.mods);
|
args = VModMaskText(keymap, action->mods.mods.mods);
|
||||||
write_buf(buf, "%s%s(modifiers=%s%s%s)%s", prefix, type, args,
|
write_buf(buf, "%s%s(modifiers=%s%s%s)%s", prefix, type, args,
|
||||||
(action->type != ACTION_TYPE_MOD_LOCK &&
|
(action->type != ACTION_TYPE_MOD_LOCK &&
|
||||||
(action->mods.flags & XkbSA_ClearLocks)) ?
|
(action->mods.flags & ACTION_LOCK_CLEAR)) ?
|
||||||
",clearLocks" : "",
|
",clearLocks" : "",
|
||||||
(action->type != ACTION_TYPE_MOD_LOCK &&
|
(action->type != ACTION_TYPE_MOD_LOCK &&
|
||||||
(action->mods.flags & XkbSA_LatchToLock)) ?
|
(action->mods.flags & ACTION_LATCH_TO_LOCK)) ?
|
||||||
",latchToLock" : "",
|
",latchToLock" : "",
|
||||||
suffix);
|
suffix);
|
||||||
break;
|
break;
|
||||||
|
@ -403,15 +403,15 @@ write_action(struct xkb_keymap *keymap, struct buf *buf,
|
||||||
case ACTION_TYPE_GROUP_LATCH:
|
case ACTION_TYPE_GROUP_LATCH:
|
||||||
case ACTION_TYPE_GROUP_LOCK:
|
case ACTION_TYPE_GROUP_LOCK:
|
||||||
write_buf(buf, "%s%s(group=%s%d%s%s)%s", prefix, type,
|
write_buf(buf, "%s%s(group=%s%d%s%s)%s", prefix, type,
|
||||||
(!(action->group.flags & XkbSA_GroupAbsolute) &&
|
(!(action->group.flags & ACTION_ABSOLUTE_SWITCH) &&
|
||||||
action->group.group > 0) ? "+" : "",
|
action->group.group > 0) ? "+" : "",
|
||||||
(action->group.flags & XkbSA_GroupAbsolute) ?
|
(action->group.flags & ACTION_ABSOLUTE_SWITCH) ?
|
||||||
action->group.group + 1 : action->group.group,
|
action->group.group + 1 : action->group.group,
|
||||||
(action->type != ACTION_TYPE_GROUP_LOCK &&
|
(action->type != ACTION_TYPE_GROUP_LOCK &&
|
||||||
(action->group.flags & XkbSA_ClearLocks)) ?
|
(action->group.flags & ACTION_LOCK_CLEAR)) ?
|
||||||
",clearLocks" : "",
|
",clearLocks" : "",
|
||||||
(action->type != ACTION_TYPE_GROUP_LOCK &&
|
(action->type != ACTION_TYPE_GROUP_LOCK &&
|
||||||
(action->group.flags & XkbSA_LatchToLock)) ?
|
(action->group.flags & ACTION_LATCH_TO_LOCK)) ?
|
||||||
",latchToLock" : "",
|
",latchToLock" : "",
|
||||||
suffix);
|
suffix);
|
||||||
break;
|
break;
|
||||||
|
@ -422,27 +422,28 @@ write_action(struct xkb_keymap *keymap, struct buf *buf,
|
||||||
|
|
||||||
case ACTION_TYPE_PTR_MOVE:
|
case ACTION_TYPE_PTR_MOVE:
|
||||||
write_buf(buf, "%s%s(x=%s%d,y=%s%d%s)%s", prefix, type,
|
write_buf(buf, "%s%s(x=%s%d,y=%s%d%s)%s", prefix, type,
|
||||||
(!(action->ptr.flags & XkbSA_MoveAbsoluteX) &&
|
(!(action->ptr.flags & ACTION_ABSOLUTE_X) &&
|
||||||
action->ptr.x >= 0) ? "+" : "",
|
action->ptr.x >= 0) ? "+" : "",
|
||||||
action->ptr.x,
|
action->ptr.x,
|
||||||
(!(action->ptr.flags & XkbSA_MoveAbsoluteY) &&
|
(!(action->ptr.flags & ACTION_ABSOLUTE_Y) &&
|
||||||
action->ptr.y >= 0) ? "+" : "",
|
action->ptr.y >= 0) ? "+" : "",
|
||||||
action->ptr.y,
|
action->ptr.y,
|
||||||
(action->ptr.flags & XkbSA_NoAcceleration) ? ",!accel" : "",
|
(action->ptr.flags & ACTION_NO_ACCEL) ? ",!accel" : "",
|
||||||
suffix);
|
suffix);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ACTION_TYPE_PTR_LOCK:
|
case ACTION_TYPE_PTR_LOCK:
|
||||||
switch (action->btn.flags & (XkbSA_LockNoUnlock | XkbSA_LockNoLock)) {
|
switch (action->btn.flags &
|
||||||
case XkbSA_LockNoUnlock:
|
(ACTION_LOCK_NO_LOCK | ACTION_LOCK_NO_UNLOCK)) {
|
||||||
|
case ACTION_LOCK_NO_UNLOCK:
|
||||||
args = ",affect=lock";
|
args = ",affect=lock";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case XkbSA_LockNoLock:
|
case ACTION_LOCK_NO_LOCK:
|
||||||
args = ",affect=unlock";
|
args = ",affect=unlock";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case XkbSA_LockNoLock | XkbSA_LockNoUnlock:
|
case ACTION_LOCK_NO_LOCK | ACTION_LOCK_NO_UNLOCK:
|
||||||
args = ",affect=neither";
|
args = ",affect=neither";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -467,7 +468,7 @@ write_action(struct xkb_keymap *keymap, struct buf *buf,
|
||||||
write_buf(buf, "%s%s(", prefix, type);
|
write_buf(buf, "%s%s(", prefix, type);
|
||||||
if (action->dflt.affect == XkbSA_AffectDfltBtn)
|
if (action->dflt.affect == XkbSA_AffectDfltBtn)
|
||||||
write_buf(buf, "affect=button,button=%s%d",
|
write_buf(buf, "affect=button,button=%s%d",
|
||||||
(!(action->dflt.flags & XkbSA_DfltBtnAbsolute) &&
|
(!(action->dflt.flags & ACTION_ABSOLUTE_SWITCH) &&
|
||||||
action->dflt.value >= 0) ? "+" : "",
|
action->dflt.value >= 0) ? "+" : "",
|
||||||
action->dflt.value);
|
action->dflt.value);
|
||||||
write_buf(buf, ")%s", suffix);
|
write_buf(buf, ")%s", suffix);
|
||||||
|
@ -475,10 +476,10 @@ write_action(struct xkb_keymap *keymap, struct buf *buf,
|
||||||
|
|
||||||
case ACTION_TYPE_SWITCH_VT:
|
case ACTION_TYPE_SWITCH_VT:
|
||||||
write_buf(buf, "%s%s(screen=%s%d,%ssame)%s", prefix, type,
|
write_buf(buf, "%s%s(screen=%s%d,%ssame)%s", prefix, type,
|
||||||
(!(action->screen.flags & XkbSA_SwitchAbsolute) &&
|
(!(action->screen.flags & ACTION_ABSOLUTE_SWITCH) &&
|
||||||
action->screen.screen >= 0) ? "+" : "",
|
action->screen.screen >= 0) ? "+" : "",
|
||||||
action->screen.screen,
|
action->screen.screen,
|
||||||
(action->screen.flags & XkbSA_SwitchApplication) ? "!" : "",
|
(action->screen.flags & ACTION_SAME_SCREEN) ? "!" : "",
|
||||||
suffix);
|
suffix);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
18
src/state.c
18
src/state.c
|
@ -161,7 +161,7 @@ xkb_filter_group_set_func(struct xkb_filter *filter, xkb_keycode_t kc,
|
||||||
enum xkb_key_direction direction)
|
enum xkb_key_direction direction)
|
||||||
{
|
{
|
||||||
if (kc != filter->kc) {
|
if (kc != filter->kc) {
|
||||||
filter->action.group.flags &= ~XkbSA_ClearLocks;
|
filter->action.group.flags &= ~ACTION_LOCK_CLEAR;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -173,11 +173,11 @@ xkb_filter_group_set_func(struct xkb_filter *filter, xkb_keycode_t kc,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (filter->action.group.flags & XkbSA_GroupAbsolute)
|
if (filter->action.group.flags & ACTION_ABSOLUTE_SWITCH)
|
||||||
filter->state->base_group = filter->action.group.group;
|
filter->state->base_group = filter->action.group.group;
|
||||||
else
|
else
|
||||||
filter->state->base_group = -filter->action.group.group;
|
filter->state->base_group = -filter->action.group.group;
|
||||||
if (filter->action.group.flags & XkbSA_ClearLocks)
|
if (filter->action.group.flags & ACTION_LOCK_CLEAR)
|
||||||
filter->state->locked_group = 0;
|
filter->state->locked_group = 0;
|
||||||
|
|
||||||
filter->func = NULL;
|
filter->func = NULL;
|
||||||
|
@ -197,7 +197,7 @@ xkb_filter_group_set_new(struct xkb_state *state, xkb_keycode_t kc,
|
||||||
filter->func = xkb_filter_group_set_func;
|
filter->func = xkb_filter_group_set_func;
|
||||||
filter->action = *action;
|
filter->action = *action;
|
||||||
|
|
||||||
if (action->group.flags & XkbSA_GroupAbsolute) {
|
if (action->group.flags & ACTION_ABSOLUTE_SWITCH) {
|
||||||
filter->action.group.group = filter->state->base_group;
|
filter->action.group.group = filter->state->base_group;
|
||||||
filter->state->base_group = action->group.group;
|
filter->state->base_group = action->group.group;
|
||||||
}
|
}
|
||||||
|
@ -239,7 +239,7 @@ xkb_filter_group_lock_new(struct xkb_state *state, xkb_keycode_t kc,
|
||||||
filter->func = xkb_filter_group_lock_func;
|
filter->func = xkb_filter_group_lock_func;
|
||||||
filter->action = *action;
|
filter->action = *action;
|
||||||
|
|
||||||
if (action->group.flags & XkbSA_GroupAbsolute)
|
if (action->group.flags & ACTION_ABSOLUTE_SWITCH)
|
||||||
filter->state->locked_group = action->group.group;
|
filter->state->locked_group = action->group.group;
|
||||||
else
|
else
|
||||||
filter->state->locked_group += action->group.group;
|
filter->state->locked_group += action->group.group;
|
||||||
|
@ -252,7 +252,7 @@ xkb_filter_mod_set_func(struct xkb_filter *filter, xkb_keycode_t kc,
|
||||||
enum xkb_key_direction direction)
|
enum xkb_key_direction direction)
|
||||||
{
|
{
|
||||||
if (kc != filter->kc) {
|
if (kc != filter->kc) {
|
||||||
filter->action.mods.flags &= ~XkbSA_ClearLocks;
|
filter->action.mods.flags &= ~ACTION_LOCK_CLEAR;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -265,7 +265,7 @@ xkb_filter_mod_set_func(struct xkb_filter *filter, xkb_keycode_t kc,
|
||||||
}
|
}
|
||||||
|
|
||||||
filter->state->clear_mods = filter->action.mods.mods.mask;
|
filter->state->clear_mods = filter->action.mods.mods.mask;
|
||||||
if (filter->action.mods.flags & XkbSA_ClearLocks)
|
if (filter->action.mods.flags & ACTION_LOCK_CLEAR)
|
||||||
filter->state->locked_mods &= ~filter->action.mods.mods.mask;
|
filter->state->locked_mods &= ~filter->action.mods.mods.mask;
|
||||||
|
|
||||||
filter->func = NULL;
|
filter->func = NULL;
|
||||||
|
@ -367,7 +367,7 @@ xkb_filter_mod_latch_func(struct xkb_filter *filter, xkb_keycode_t kc,
|
||||||
action->mods.flags == filter->action.mods.flags &&
|
action->mods.flags == filter->action.mods.flags &&
|
||||||
action->mods.mods.mask == filter->action.mods.mods.mask) {
|
action->mods.mods.mask == filter->action.mods.mods.mask) {
|
||||||
filter->action = *action;
|
filter->action = *action;
|
||||||
if (filter->action.mods.flags & XkbSA_LatchToLock) {
|
if (filter->action.mods.flags & ACTION_LATCH_TO_LOCK) {
|
||||||
filter->action.type = ACTION_TYPE_MOD_LOCK;
|
filter->action.type = ACTION_TYPE_MOD_LOCK;
|
||||||
filter->func = xkb_filter_mod_lock_func;
|
filter->func = xkb_filter_mod_lock_func;
|
||||||
filter->state->locked_mods |= filter->action.mods.mods.mask;
|
filter->state->locked_mods |= filter->action.mods.mods.mask;
|
||||||
|
@ -397,7 +397,7 @@ xkb_filter_mod_latch_func(struct xkb_filter *filter, xkb_keycode_t kc,
|
||||||
* stage, so set PENDING and move our modifier from base to
|
* stage, so set PENDING and move our modifier from base to
|
||||||
* latched. */
|
* latched. */
|
||||||
if (latch == NO_LATCH ||
|
if (latch == NO_LATCH ||
|
||||||
((filter->action.mods.flags & XkbSA_ClearLocks) &&
|
((filter->action.mods.flags & ACTION_LOCK_CLEAR) &&
|
||||||
(filter->state->locked_mods & filter->action.mods.mods.mask) ==
|
(filter->state->locked_mods & filter->action.mods.mods.mask) ==
|
||||||
filter->action.mods.mods.mask)) {
|
filter->action.mods.mods.mask)) {
|
||||||
/* XXX: We might be a bit overenthusiastic about clearing
|
/* XXX: We might be a bit overenthusiastic about clearing
|
||||||
|
|
|
@ -153,6 +153,19 @@ enum xkb_action_type {
|
||||||
ACTION_TYPE_LAST
|
ACTION_TYPE_LAST
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum xkb_action_flags {
|
||||||
|
ACTION_LOCK_CLEAR = (1 << 0),
|
||||||
|
ACTION_LATCH_TO_LOCK = (1 << 1),
|
||||||
|
ACTION_LOCK_NO_LOCK = (1 << 2),
|
||||||
|
ACTION_LOCK_NO_UNLOCK = (1 << 3),
|
||||||
|
ACTION_MODS_LOOKUP_MODMAP = (1 << 4),
|
||||||
|
ACTION_ABSOLUTE_SWITCH = (1 << 5),
|
||||||
|
ACTION_ABSOLUTE_X = (1 << 6),
|
||||||
|
ACTION_ABSOLUTE_Y = (1 << 7),
|
||||||
|
ACTION_NO_ACCEL = (1 << 8),
|
||||||
|
ACTION_SAME_SCREEN = (1 << 9),
|
||||||
|
};
|
||||||
|
|
||||||
struct xkb_mods {
|
struct xkb_mods {
|
||||||
xkb_mod_mask_t mods; /* original real+virtual mods in definition */
|
xkb_mod_mask_t mods; /* original real+virtual mods in definition */
|
||||||
xkb_mod_mask_t mask; /* computed effective mask */
|
xkb_mod_mask_t mask; /* computed effective mask */
|
||||||
|
@ -160,37 +173,38 @@ struct xkb_mods {
|
||||||
|
|
||||||
struct xkb_mod_action {
|
struct xkb_mod_action {
|
||||||
enum xkb_action_type type;
|
enum xkb_action_type type;
|
||||||
uint8_t flags;
|
enum xkb_action_flags flags;
|
||||||
struct xkb_mods mods;
|
struct xkb_mods mods;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct xkb_group_action {
|
struct xkb_group_action {
|
||||||
enum xkb_action_type type;
|
enum xkb_action_type type;
|
||||||
uint8_t flags;
|
enum xkb_action_flags flags;
|
||||||
int32_t group;
|
int32_t group;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct xkb_controls_action {
|
struct xkb_controls_action {
|
||||||
enum xkb_action_type type;
|
enum xkb_action_type type;
|
||||||
uint8_t flags;
|
enum xkb_action_flags flags;
|
||||||
uint32_t ctrls;
|
uint32_t ctrls;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct xkb_pointer_default_action {
|
struct xkb_pointer_default_action {
|
||||||
enum xkb_action_type type;
|
enum xkb_action_type type;
|
||||||
uint8_t flags;
|
enum xkb_action_flags flags;
|
||||||
uint8_t affect;
|
uint8_t affect;
|
||||||
int8_t value;
|
int8_t value;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct xkb_switch_screen_action {
|
struct xkb_switch_screen_action {
|
||||||
enum xkb_action_type type;
|
enum xkb_action_type type;
|
||||||
uint8_t flags;
|
enum xkb_action_flags flags;
|
||||||
int8_t screen;
|
int8_t screen;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct xkb_redirect_key_action {
|
struct xkb_redirect_key_action {
|
||||||
enum xkb_action_type type;
|
enum xkb_action_type type;
|
||||||
|
enum xkb_action_flags flags;
|
||||||
xkb_keycode_t new_kc;
|
xkb_keycode_t new_kc;
|
||||||
uint8_t mods_mask;
|
uint8_t mods_mask;
|
||||||
uint8_t mods;
|
uint8_t mods;
|
||||||
|
@ -200,20 +214,21 @@ struct xkb_redirect_key_action {
|
||||||
|
|
||||||
struct xkb_pointer_action {
|
struct xkb_pointer_action {
|
||||||
enum xkb_action_type type;
|
enum xkb_action_type type;
|
||||||
uint8_t flags;
|
enum xkb_action_flags flags;
|
||||||
int16_t x;
|
int16_t x;
|
||||||
int16_t y;
|
int16_t y;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct xkb_pointer_button_action {
|
struct xkb_pointer_button_action {
|
||||||
enum xkb_action_type type;
|
enum xkb_action_type type;
|
||||||
uint8_t flags;
|
enum xkb_action_flags flags;
|
||||||
uint8_t count;
|
uint8_t count;
|
||||||
int8_t button;
|
int8_t button;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct xkb_private_action {
|
struct xkb_private_action {
|
||||||
enum xkb_action_type type;
|
enum xkb_action_type type;
|
||||||
|
enum xkb_action_flags flags;
|
||||||
uint8_t data[7];
|
uint8_t data[7];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -213,15 +213,15 @@ HandleNoAction(struct xkb_keymap *keymap, union xkb_action *action,
|
||||||
static bool
|
static bool
|
||||||
CheckLatchLockFlags(struct xkb_keymap *keymap, enum xkb_action_type action,
|
CheckLatchLockFlags(struct xkb_keymap *keymap, enum xkb_action_type action,
|
||||||
enum action_field field, const ExprDef * value,
|
enum action_field field, const ExprDef * value,
|
||||||
unsigned *flags_inout)
|
enum xkb_action_flags *flags_inout)
|
||||||
{
|
{
|
||||||
unsigned tmp;
|
enum xkb_action_flags tmp;
|
||||||
bool result;
|
bool result;
|
||||||
|
|
||||||
if (field == ACTION_FIELD_CLEAR_LOCKS)
|
if (field == ACTION_FIELD_CLEAR_LOCKS)
|
||||||
tmp = XkbSA_ClearLocks;
|
tmp = ACTION_LOCK_CLEAR;
|
||||||
else if (field == ACTION_FIELD_LATCH_TO_LOCK)
|
else if (field == ACTION_FIELD_LATCH_TO_LOCK)
|
||||||
tmp = XkbSA_LatchToLock;
|
tmp = ACTION_LATCH_TO_LOCK;
|
||||||
else
|
else
|
||||||
return false; /* WSGO! */
|
return false; /* WSGO! */
|
||||||
|
|
||||||
|
@ -238,7 +238,7 @@ CheckLatchLockFlags(struct xkb_keymap *keymap, enum xkb_action_type action,
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
CheckModifierField(struct xkb_keymap *keymap, enum xkb_action_type action,
|
CheckModifierField(struct xkb_keymap *keymap, enum xkb_action_type action,
|
||||||
const ExprDef *value, unsigned *flags_inout,
|
const ExprDef *value, enum xkb_action_flags *flags_inout,
|
||||||
xkb_mod_mask_t *mods_rtrn)
|
xkb_mod_mask_t *mods_rtrn)
|
||||||
{
|
{
|
||||||
if (value->op == EXPR_IDENT) {
|
if (value->op == EXPR_IDENT) {
|
||||||
|
@ -248,7 +248,7 @@ CheckModifierField(struct xkb_keymap *keymap, enum xkb_action_type action,
|
||||||
istreq(valStr, "modmapmods"))) {
|
istreq(valStr, "modmapmods"))) {
|
||||||
|
|
||||||
*mods_rtrn = 0;
|
*mods_rtrn = 0;
|
||||||
*flags_inout |= XkbSA_UseModMapMods;
|
*flags_inout |= ACTION_MODS_LOOKUP_MODMAP;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -257,7 +257,7 @@ CheckModifierField(struct xkb_keymap *keymap, enum xkb_action_type action,
|
||||||
return ReportMismatch(keymap, action,
|
return ReportMismatch(keymap, action,
|
||||||
ACTION_FIELD_MODIFIERS, "modifier mask");
|
ACTION_FIELD_MODIFIERS, "modifier mask");
|
||||||
|
|
||||||
*flags_inout &= ~XkbSA_UseModMapMods;
|
*flags_inout &= ~ACTION_MODS_LOOKUP_MODMAP;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -267,8 +267,7 @@ HandleSetLatchMods(struct xkb_keymap *keymap, union xkb_action *action,
|
||||||
const ExprDef *value)
|
const ExprDef *value)
|
||||||
{
|
{
|
||||||
struct xkb_mod_action *act = &action->mods;
|
struct xkb_mod_action *act = &action->mods;
|
||||||
unsigned rtrn;
|
enum xkb_action_flags rtrn, t1;
|
||||||
unsigned t1;
|
|
||||||
xkb_mod_mask_t t2;
|
xkb_mod_mask_t t2;
|
||||||
|
|
||||||
if (array_ndx != NULL) {
|
if (array_ndx != NULL) {
|
||||||
|
@ -314,7 +313,7 @@ HandleLockMods(struct xkb_keymap *keymap, union xkb_action *action,
|
||||||
const ExprDef *value)
|
const ExprDef *value)
|
||||||
{
|
{
|
||||||
struct xkb_mod_action *act = &action->mods;
|
struct xkb_mod_action *act = &action->mods;
|
||||||
unsigned t1;
|
enum xkb_action_flags t1;
|
||||||
xkb_mod_mask_t t2;
|
xkb_mod_mask_t t2;
|
||||||
|
|
||||||
if (array_ndx && field == ACTION_FIELD_MODIFIERS)
|
if (array_ndx && field == ACTION_FIELD_MODIFIERS)
|
||||||
|
@ -339,17 +338,17 @@ HandleLockMods(struct xkb_keymap *keymap, union xkb_action *action,
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
CheckGroupField(struct xkb_keymap *keymap, unsigned action,
|
CheckGroupField(struct xkb_keymap *keymap, unsigned action,
|
||||||
const ExprDef *value, unsigned *flags_inout,
|
const ExprDef *value, enum xkb_action_flags *flags_inout,
|
||||||
xkb_group_index_t *grp_rtrn)
|
xkb_group_index_t *grp_rtrn)
|
||||||
{
|
{
|
||||||
const ExprDef *spec;
|
const ExprDef *spec;
|
||||||
|
|
||||||
if (value->op == EXPR_NEGATE || value->op == EXPR_UNARY_PLUS) {
|
if (value->op == EXPR_NEGATE || value->op == EXPR_UNARY_PLUS) {
|
||||||
*flags_inout &= ~XkbSA_GroupAbsolute;
|
*flags_inout &= ~ACTION_ABSOLUTE_SWITCH;
|
||||||
spec = value->value.child;
|
spec = value->value.child;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
*flags_inout |= XkbSA_GroupAbsolute;
|
*flags_inout |= ACTION_ABSOLUTE_SWITCH;
|
||||||
spec = value;
|
spec = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -371,8 +370,7 @@ HandleSetLatchGroup(struct xkb_keymap *keymap, union xkb_action *action,
|
||||||
const ExprDef *value)
|
const ExprDef *value)
|
||||||
{
|
{
|
||||||
struct xkb_group_action *act = &action->group;
|
struct xkb_group_action *act = &action->group;
|
||||||
unsigned rtrn;
|
enum xkb_action_flags rtrn, t1;
|
||||||
unsigned t1;
|
|
||||||
xkb_group_index_t t2;
|
xkb_group_index_t t2;
|
||||||
|
|
||||||
if (array_ndx != NULL) {
|
if (array_ndx != NULL) {
|
||||||
|
@ -419,7 +417,7 @@ HandleLockGroup(struct xkb_keymap *keymap, union xkb_action *action,
|
||||||
const ExprDef *value)
|
const ExprDef *value)
|
||||||
{
|
{
|
||||||
struct xkb_group_action *act = &action->group;
|
struct xkb_group_action *act = &action->group;
|
||||||
unsigned t1;
|
enum xkb_action_flags t1;
|
||||||
xkb_group_index_t t2;
|
xkb_group_index_t t2;
|
||||||
|
|
||||||
if ((array_ndx != NULL) && (field == ACTION_FIELD_GROUP))
|
if ((array_ndx != NULL) && (field == ACTION_FIELD_GROUP))
|
||||||
|
@ -460,12 +458,12 @@ HandleMovePtr(struct xkb_keymap *keymap, union xkb_action *action,
|
||||||
|
|
||||||
if (field == ACTION_FIELD_X) {
|
if (field == ACTION_FIELD_X) {
|
||||||
if (absolute)
|
if (absolute)
|
||||||
act->flags |= XkbSA_MoveAbsoluteX;
|
act->flags |= ACTION_ABSOLUTE_X;
|
||||||
act->x = val;
|
act->x = val;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (absolute)
|
if (absolute)
|
||||||
act->flags |= XkbSA_MoveAbsoluteY;
|
act->flags |= ACTION_ABSOLUTE_Y;
|
||||||
act->y = val;
|
act->y = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -478,9 +476,9 @@ HandleMovePtr(struct xkb_keymap *keymap, union xkb_action *action,
|
||||||
return ReportMismatch(keymap, action->type, field, "boolean");
|
return ReportMismatch(keymap, action->type, field, "boolean");
|
||||||
|
|
||||||
if (set)
|
if (set)
|
||||||
act->flags &= ~XkbSA_NoAcceleration;
|
act->flags &= ~ACTION_NO_ACCEL;
|
||||||
else
|
else
|
||||||
act->flags |= XkbSA_NoAcceleration;
|
act->flags |= ACTION_NO_ACCEL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ReportIllegal(keymap, action->type, field);
|
return ReportIllegal(keymap, action->type, field);
|
||||||
|
@ -488,9 +486,9 @@ HandleMovePtr(struct xkb_keymap *keymap, union xkb_action *action,
|
||||||
|
|
||||||
static const LookupEntry lockWhich[] = {
|
static const LookupEntry lockWhich[] = {
|
||||||
{ "both", 0 },
|
{ "both", 0 },
|
||||||
{ "lock", XkbSA_LockNoUnlock },
|
{ "lock", ACTION_LOCK_NO_UNLOCK },
|
||||||
{ "neither", (XkbSA_LockNoLock | XkbSA_LockNoUnlock) },
|
{ "neither", (ACTION_LOCK_NO_LOCK | ACTION_LOCK_NO_UNLOCK) },
|
||||||
{ "unlock", XkbSA_LockNoLock },
|
{ "unlock", ACTION_LOCK_NO_LOCK },
|
||||||
{ NULL, 0 }
|
{ NULL, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -523,7 +521,7 @@ HandlePtrBtn(struct xkb_keymap *keymap, union xkb_action *action,
|
||||||
}
|
}
|
||||||
else if (action->type == ACTION_TYPE_PTR_LOCK &&
|
else if (action->type == ACTION_TYPE_PTR_LOCK &&
|
||||||
field == ACTION_FIELD_AFFECT) {
|
field == ACTION_FIELD_AFFECT) {
|
||||||
unsigned int val;
|
enum xkb_action_flags val;
|
||||||
|
|
||||||
if (array_ndx)
|
if (array_ndx)
|
||||||
return ReportActionNotArray(keymap, action->type, field);
|
return ReportActionNotArray(keymap, action->type, field);
|
||||||
|
@ -532,7 +530,7 @@ HandlePtrBtn(struct xkb_keymap *keymap, union xkb_action *action,
|
||||||
return ReportMismatch(keymap, action->type, field,
|
return ReportMismatch(keymap, action->type, field,
|
||||||
"lock or unlock");
|
"lock or unlock");
|
||||||
|
|
||||||
act->flags &= ~(XkbSA_LockNoLock | XkbSA_LockNoUnlock);
|
act->flags &= ~(ACTION_LOCK_NO_LOCK | ACTION_LOCK_NO_UNLOCK);
|
||||||
act->flags |= val;
|
act->flags |= val;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -593,11 +591,11 @@ HandleSetPtrDflt(struct xkb_keymap *keymap, union xkb_action *action,
|
||||||
return ReportActionNotArray(keymap, action->type, field);
|
return ReportActionNotArray(keymap, action->type, field);
|
||||||
|
|
||||||
if (value->op == EXPR_NEGATE || value->op == EXPR_UNARY_PLUS) {
|
if (value->op == EXPR_NEGATE || value->op == EXPR_UNARY_PLUS) {
|
||||||
act->flags &= ~XkbSA_DfltBtnAbsolute;
|
act->flags &= ~ACTION_ABSOLUTE_SWITCH;
|
||||||
button = value->value.child;
|
button = value->value.child;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
act->flags |= XkbSA_DfltBtnAbsolute;
|
act->flags |= ACTION_ABSOLUTE_SWITCH;
|
||||||
button = value;
|
button = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -640,11 +638,11 @@ HandleSwitchScreen(struct xkb_keymap *keymap, union xkb_action *action,
|
||||||
return ReportActionNotArray(keymap, action->type, field);
|
return ReportActionNotArray(keymap, action->type, field);
|
||||||
|
|
||||||
if (value->op == EXPR_NEGATE || value->op == EXPR_UNARY_PLUS) {
|
if (value->op == EXPR_NEGATE || value->op == EXPR_UNARY_PLUS) {
|
||||||
act->flags &= ~XkbSA_SwitchAbsolute;
|
act->flags &= ~ACTION_ABSOLUTE_SWITCH;
|
||||||
scrn = value->value.child;
|
scrn = value->value.child;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
act->flags |= XkbSA_SwitchAbsolute;
|
act->flags |= ACTION_ABSOLUTE_SWITCH;
|
||||||
scrn = value;
|
scrn = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -672,9 +670,9 @@ HandleSwitchScreen(struct xkb_keymap *keymap, union xkb_action *action,
|
||||||
return ReportMismatch(keymap, action->type, field, "boolean");
|
return ReportMismatch(keymap, action->type, field, "boolean");
|
||||||
|
|
||||||
if (set)
|
if (set)
|
||||||
act->flags &= ~XkbSA_SwitchApplication;
|
act->flags &= ~ACTION_SAME_SCREEN;
|
||||||
else
|
else
|
||||||
act->flags |= XkbSA_SwitchApplication;
|
act->flags |= ACTION_SAME_SCREEN;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,7 @@ UpdateActionMods(struct xkb_keymap *keymap, union xkb_action *act,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flags & XkbSA_UseModMapMods) {
|
if (flags & ACTION_MODS_LOOKUP_MODMAP) {
|
||||||
/* XXX: what's that. */
|
/* XXX: what's that. */
|
||||||
mods->mods &= 0xff;
|
mods->mods &= 0xff;
|
||||||
mods->mods |= rmodmask;
|
mods->mods |= rmodmask;
|
||||||
|
|
Loading…
Reference in New Issue