From bfd266660d69e13263e3895fb059040b65255a72 Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Fri, 14 May 2010 01:29:05 +0200 Subject: janitor: Split gesture code into memory refresh and parse Split the gesture code into a lexical part, which updates the filtered motion state, and a parsing part, which translates the motion state to gestures. Signed-off-by: Henrik Rydberg --- src/memory.h | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'src/memory.h') diff --git a/src/memory.h b/src/memory.h index 23d2ce6..9810b81 100644 --- a/src/memory.h +++ b/src/memory.h @@ -24,17 +24,33 @@ #include "mtstate.h" +/** + * struct Memory - parsing state + * + * @btdata: logical finger state + * @same: true if the finger configuration is unchanged + * @pointing: bitmask of pointing fingers + * @pending: bitmask of tentatively moving fingers + * @moving: bitmask of moving fingers + * @ybar: vertical position on pad marking the clicking area + * @move_time: movement before this point in time is accumulated + * @dx: array of accumulated horiontal movement per finger + * @dy: array of accumulated vertical movement per finger + * + */ struct Memory { - unsigned btdata, pointing, moving; + unsigned btdata, same; + unsigned pointing, pending, moving; int ybar; mstime_t move_time; int dx[DIM_FINGER], dy[DIM_FINGER]; - - - }; void init_memory(struct Memory *mem); +void refresh_memory(struct Memory *m, + const struct MTState *prev_state, + const struct MTState *state, + const struct Capabilities *caps); void output_memory(const struct Memory *m); #endif -- cgit v1.2.3