summaryrefslogtreecommitdiff
path: root/src/gestures.c
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2010-05-14 01:14:04 +0200
committerHenrik Rydberg <rydberg@euromail.se>2010-05-14 01:41:39 +0200
commitebaf307ab1b22d4786cc5fb55170204759e887ce (patch)
tree933487729ab47354f29cb1fbda38e6438ca8d22c /src/gestures.c
parent2b271ed5348daec2bcf90b83da47781e2d8b964c (diff)
Introduce MTFinger structure
Switch from the FingerData structure to the MTFinger structure, making room for more computed finger details in MTState. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'src/gestures.c')
-rw-r--r--src/gestures.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gestures.c b/src/gestures.c
index a0ef5d4..9426226 100644
--- a/src/gestures.c
+++ b/src/gestures.c
@@ -31,18 +31,18 @@
31static const int FINGER_ATTACK_MS = 70; 31static const int FINGER_ATTACK_MS = 70;
32static const int FINGER_DECAY_MS = 120; 32static const int FINGER_DECAY_MS = 120;
33 33
34inline int dxval(const struct FingerState *a, const struct FingerState *b) 34inline int dxval(const struct MTFinger *a, const struct MTFinger *b)
35{ 35{
36 return a->hw.position_x - b->hw.position_x; 36 return a->hw.position_x - b->hw.position_x;
37} 37}
38inline int dyval(const struct FingerState *a, const struct FingerState *b) 38inline int dyval(const struct MTFinger *a, const struct MTFinger *b)
39{ 39{
40 return a->hw.position_y - b->hw.position_y; 40 return a->hw.position_y - b->hw.position_y;
41} 41}
42 42
43static void extract_finger_configuration(struct Gestures *gs, struct MTouch* mt) 43static void extract_finger_configuration(struct Gestures *gs, struct MTouch* mt)
44{ 44{
45 const struct FingerState *f = mt->state.finger; 45 const struct MTFinger *f = mt->state.finger;
46 int i, same = mt->state.nfinger == mt->prev_state.nfinger; 46 int i, same = mt->state.nfinger == mt->prev_state.nfinger;
47 for (i = 0; i < mt->state.nfinger; i++) 47 for (i = 0; i < mt->state.nfinger; i++)
48 same = same && find_finger(&mt->prev_state, f[i].id); 48 same = same && find_finger(&mt->prev_state, f[i].id);
@@ -51,7 +51,7 @@ static void extract_finger_configuration(struct Gestures *gs, struct MTouch* mt)
51 51
52static void extract_pointers(struct Gestures *gs, struct MTouch* mt) 52static void extract_pointers(struct Gestures *gs, struct MTouch* mt)
53{ 53{
54 const struct FingerState *f = mt->state.finger; 54 const struct MTFinger *f = mt->state.finger;
55 int i; 55 int i;
56 56
57 if (mt->state.nfinger < 2) { 57 if (mt->state.nfinger < 2) {
@@ -86,7 +86,7 @@ static void extract_pointers(struct Gestures *gs, struct MTouch* mt)
86 86
87static void extract_movement(struct Gestures *gs, struct MTouch* mt) 87static void extract_movement(struct Gestures *gs, struct MTouch* mt)
88{ 88{
89 const struct FingerState *prev, *f = mt->state.finger; 89 const struct MTFinger *prev, *f = mt->state.finger;
90 int i, x = 0, y = 0; 90 int i, x = 0, y = 0;
91 int dx, dy, xcut, ycut, xmax = 0, ymax = 0; 91 int dx, dy, xcut, ycut, xmax = 0, ymax = 0;
92 92