state: reorder new() functions before the set() functions in the code So that they may be read more naturally in chronological order. Signed-off-by: Ran Benita <ran234@gmail.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
diff --git a/src/state.c b/src/state.c
index 00495f7..24d1a9a 100644
--- a/src/state.c
+++ b/src/state.c
@@ -264,6 +264,16 @@ xkb_filter_new(struct xkb_state *state)
/***====================================================================***/
+static void
+xkb_filter_group_set_new(struct xkb_state *state, struct xkb_filter *filter)
+{
+ filter->priv = state->components.base_group;
+ if (filter->action.group.flags & ACTION_ABSOLUTE_SWITCH)
+ state->components.base_group = filter->action.group.group;
+ else
+ state->components.base_group += filter->action.group.group;
+}
+
static bool
xkb_filter_group_set_func(struct xkb_state *state,
struct xkb_filter *filter,
@@ -293,13 +303,12 @@ xkb_filter_group_set_func(struct xkb_state *state,
}
static void
-xkb_filter_group_set_new(struct xkb_state *state, struct xkb_filter *filter)
+xkb_filter_group_lock_new(struct xkb_state *state, struct xkb_filter *filter)
{
- filter->priv = state->components.base_group;
if (filter->action.group.flags & ACTION_ABSOLUTE_SWITCH)
- state->components.base_group = filter->action.group.group;
+ state->components.locked_group = filter->action.group.group;
else
- state->components.base_group += filter->action.group.group;
+ state->components.locked_group += filter->action.group.group;
}
static bool
@@ -323,12 +332,9 @@ xkb_filter_group_lock_func(struct xkb_state *state,
}
static void
-xkb_filter_group_lock_new(struct xkb_state *state, struct xkb_filter *filter)
+xkb_filter_mod_set_new(struct xkb_state *state, struct xkb_filter *filter)
{
- if (filter->action.group.flags & ACTION_ABSOLUTE_SWITCH)
- state->components.locked_group = filter->action.group.group;
- else
- state->components.locked_group += filter->action.group.group;
+ state->set_mods = filter->action.mods.mods.mask;
}
static bool
@@ -359,9 +365,13 @@ xkb_filter_mod_set_func(struct xkb_state *state,
}
static void
-xkb_filter_mod_set_new(struct xkb_state *state, struct xkb_filter *filter)
+xkb_filter_mod_lock_new(struct xkb_state *state, struct xkb_filter *filter)
{
- state->set_mods = filter->action.mods.mods.mask;
+ filter->priv = (state->components.locked_mods &
+ filter->action.mods.mods.mask);
+ state->set_mods |= filter->action.mods.mods.mask;
+ if (!(filter->action.mods.flags & ACTION_LOCK_NO_LOCK))
+ state->components.locked_mods |= filter->action.mods.mods.mask;
}
static bool
@@ -388,16 +398,6 @@ xkb_filter_mod_lock_func(struct xkb_state *state,
return true;
}
-static void
-xkb_filter_mod_lock_new(struct xkb_state *state, struct xkb_filter *filter)
-{
- filter->priv = (state->components.locked_mods &
- filter->action.mods.mods.mask);
- state->set_mods |= filter->action.mods.mods.mask;
- if (!(filter->action.mods.flags & ACTION_LOCK_NO_LOCK))
- state->components.locked_mods |= filter->action.mods.mods.mask;
-}
-
enum xkb_key_latch_state {
NO_LATCH,
LATCH_KEY_DOWN,
@@ -421,6 +421,13 @@ xkb_action_breaks_latch(const union xkb_action *action)
}
}
+static void
+xkb_filter_mod_latch_new(struct xkb_state *state, struct xkb_filter *filter)
+{
+ filter->priv = LATCH_KEY_DOWN;
+ state->set_mods = filter->action.mods.mods.mask;
+}
+
static bool
xkb_filter_mod_latch_func(struct xkb_state *state,
struct xkb_filter *filter,
@@ -502,13 +509,6 @@ xkb_filter_mod_latch_func(struct xkb_state *state,
return true;
}
-static void
-xkb_filter_mod_latch_new(struct xkb_state *state, struct xkb_filter *filter)
-{
- filter->priv = LATCH_KEY_DOWN;
- state->set_mods = filter->action.mods.mods.mask;
-}
-
static const struct {
void (*new)(struct xkb_state *state, struct xkb_filter *filter);
bool (*func)(struct xkb_state *state, struct xkb_filter *filter,