summaryrefslogtreecommitdiff
path: root/src/grail-gestures.c
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@bitmath.org>2010-08-05 15:26:16 +0200
committerHenrik Rydberg <rydberg@euromail.se>2010-08-05 22:48:38 +0200
commit8bbf06f8d0056ae30fdfaf260000e763fad2345c (patch)
treeb52bae6d7250a31755726ec4a96f33863d3f5f7c /src/grail-gestures.c
parentd5f810a0d3e0013a76136750eaff825ceec099a2 (diff)
make event units public in the api
Add grail_get_units() to the api, so so that applications can extract the min/max coordinates used in the gesture events. Signed-off-by: Henrik Rydberg <rydberg@bitmath.org>
Diffstat (limited to 'src/grail-gestures.c')
-rw-r--r--src/grail-gestures.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/grail-gestures.c b/src/grail-gestures.c
index 5ab12a8..e1bf622 100644
--- a/src/grail-gestures.c
+++ b/src/grail-gestures.c
@@ -119,12 +119,14 @@ static int move_update(struct filter_model *m, float val)
119 return m->active; 119 return m->active;
120} 120}
121 121
122void gru_init_motion(struct grail *ge, const struct touch_dev_caps *caps) 122void gru_init_motion(struct grail *ge)
123{ 123{
124 struct gesture_recognizer *gru = ge->gru; 124 struct gesture_recognizer *gru = ge->gru;
125 struct move_model *state = &gru->move; 125 struct move_model *state = &gru->move;
126 float x = caps->info[TP_POS_X].maximum - caps->info[TP_POS_X].minimum; 126 struct grail_coord min, max;
127 float y = caps->info[TP_POS_Y].maximum - caps->info[TP_POS_Y].minimum; 127 grail_get_units(&min, &max, ge);
128 float x = max.x - min.x;
129 float y = max.y - min.y;
128 float r = sqrt(x * x + y * y); 130 float r = sqrt(x * x + y * y);
129 state->x.fuzz = x / SN_MOVE; 131 state->x.fuzz = x / SN_MOVE;
130 state->y.fuzz = y / SN_MOVE; 132 state->y.fuzz = y / SN_MOVE;