diff options
author | Henrik Rydberg <rydberg@euromail.se> | 2010-05-14 01:29:38 +0200 |
---|---|---|
committer | Henrik Rydberg <rydberg@euromail.se> | 2010-05-14 01:41:39 +0200 |
commit | c8c74659d27b9eb0d45342db9a4969389e20f26a (patch) | |
tree | cecd1876745b2288cb45007522a046f12d144f31 /src/memory.h | |
parent | bfd266660d69e13263e3895fb059040b65255a72 (diff) | |
download | xorg-input-kobomultitouch-c8c74659d27b9eb0d45342db9a4969389e20f26a.tar.gz xorg-input-kobomultitouch-c8c74659d27b9eb0d45342db9a4969389e20f26a.tar.bz2 xorg-input-kobomultitouch-c8c74659d27b9eb0d45342db9a4969389e20f26a.zip |
Refactor parsor memory usage
Add the bitmasks "fingers" and "added" to parsor memory, and extend
time handling to use a hold time and a forget time.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'src/memory.h')
-rw-r--r-- | src/memory.h | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/memory.h b/src/memory.h index 9810b81..cc7bf55 100644 --- a/src/memory.h +++ b/src/memory.h @@ -29,20 +29,24 @@ * * @btdata: logical finger state * @same: true if the finger configuration is unchanged + * @fingers: bitmask of fingers on the pad + * @added: bitmask of new fingers on the pad * @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 + * @mvhold: movement before this point in time is accumulated + * @mvforget: movement before this point in time is discarded * @dx: array of accumulated horiontal movement per finger * @dy: array of accumulated vertical movement per finger * */ struct Memory { unsigned btdata, same; + unsigned fingers, added; unsigned pointing, pending, moving; int ybar; - mstime_t move_time; + mstime_t mvhold, mvforget; int dx[DIM_FINGER], dy[DIM_FINGER]; }; @@ -53,4 +57,16 @@ void refresh_memory(struct Memory *m, const struct Capabilities *caps); void output_memory(const struct Memory *m); +static inline void mem_hold_movement(struct Memory *m, mstime_t t) +{ + if (t > m->mvhold) + m->mvhold = t; +} + +static inline void mem_forget_movement(struct Memory *m, mstime_t t) +{ + if (t > m->mvforget) + m->mvforget = t; +} + #endif |