summaryrefslogtreecommitdiff
path: root/src/memory.h
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2010-05-14 01:29:38 +0200
committerHenrik Rydberg <rydberg@euromail.se>2010-05-14 01:41:39 +0200
commitc8c74659d27b9eb0d45342db9a4969389e20f26a (patch)
treececd1876745b2288cb45007522a046f12d144f31 /src/memory.h
parentbfd266660d69e13263e3895fb059040b65255a72 (diff)
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.h20
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 @@
29 * 29 *
30 * @btdata: logical finger state 30 * @btdata: logical finger state
31 * @same: true if the finger configuration is unchanged 31 * @same: true if the finger configuration is unchanged
32 * @fingers: bitmask of fingers on the pad
33 * @added: bitmask of new fingers on the pad
32 * @pointing: bitmask of pointing fingers 34 * @pointing: bitmask of pointing fingers
33 * @pending: bitmask of tentatively moving fingers 35 * @pending: bitmask of tentatively moving fingers
34 * @moving: bitmask of moving fingers 36 * @moving: bitmask of moving fingers
35 * @ybar: vertical position on pad marking the clicking area 37 * @ybar: vertical position on pad marking the clicking area
36 * @move_time: movement before this point in time is accumulated 38 * @mvhold: movement before this point in time is accumulated
39 * @mvforget: movement before this point in time is discarded
37 * @dx: array of accumulated horiontal movement per finger 40 * @dx: array of accumulated horiontal movement per finger
38 * @dy: array of accumulated vertical movement per finger 41 * @dy: array of accumulated vertical movement per finger
39 * 42 *
40 */ 43 */
41struct Memory { 44struct Memory {
42 unsigned btdata, same; 45 unsigned btdata, same;
46 unsigned fingers, added;
43 unsigned pointing, pending, moving; 47 unsigned pointing, pending, moving;
44 int ybar; 48 int ybar;
45 mstime_t move_time; 49 mstime_t mvhold, mvforget;
46 int dx[DIM_FINGER], dy[DIM_FINGER]; 50 int dx[DIM_FINGER], dy[DIM_FINGER];
47}; 51};
48 52
@@ -53,4 +57,16 @@ void refresh_memory(struct Memory *m,
53 const struct Capabilities *caps); 57 const struct Capabilities *caps);
54void output_memory(const struct Memory *m); 58void output_memory(const struct Memory *m);
55 59
60static inline void mem_hold_movement(struct Memory *m, mstime_t t)
61{
62 if (t > m->mvhold)
63 m->mvhold = t;
64}
65
66static inline void mem_forget_movement(struct Memory *m, mstime_t t)
67{
68 if (t > m->mvforget)
69 m->mvforget = t;
70}
71
56#endif 72#endif