From 8bbf06f8d0056ae30fdfaf260000e763fad2345c Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Thu, 5 Aug 2010 15:26:16 +0200 Subject: 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 --- src/grail-gestures.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/grail-gestures.c') 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) return m->active; } -void gru_init_motion(struct grail *ge, const struct touch_dev_caps *caps) +void gru_init_motion(struct grail *ge) { struct gesture_recognizer *gru = ge->gru; struct move_model *state = &gru->move; - float x = caps->info[TP_POS_X].maximum - caps->info[TP_POS_X].minimum; - float y = caps->info[TP_POS_Y].maximum - caps->info[TP_POS_Y].minimum; + struct grail_coord min, max; + grail_get_units(&min, &max, ge); + float x = max.x - min.x; + float y = max.y - min.y; float r = sqrt(x * x + y * y); state->x.fuzz = x / SN_MOVE; state->y.fuzz = y / SN_MOVE; -- cgit v1.2.3