From baf35a3b761172aeeefd7e761b7e29995a37a9e8 Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Thu, 19 Aug 2010 21:17:42 +0200 Subject: Add grail_contact and a method to retrieve the current contacts This patch adds the possibility to extract the current set of contacts from the grail state. Signed-off-by: Henrik Rydberg --- test/grail-gesture.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/grail-gesture.c b/test/grail-gesture.c index 762d3df..d30e713 100644 --- a/test/grail-gesture.c +++ b/test/grail-gesture.c @@ -53,11 +53,21 @@ static void tp_event(struct grail *ge, const struct input_event *ev) static void tp_gesture(struct grail *ge, const struct grail_event *ev) { - int i; + struct grail_contact touch[32]; + int i, ntouch; fprintf(stderr, "gesture %d %d %d %d - %f %f %d - %d\n", ev->type, ev->id, ev->client_id.client, ev->client_id.event, ev->pos.x, ev->pos.y, ev->ntouch, ev->status); + ntouch = grail_get_contacts(ge, touch, 32); + for (i = 0; i < ntouch; i++) { + const struct grail_contact *t = &touch[i]; + fprintf(stderr, "\t%d: %d %d\n", i, t->id, t->tool_type); + fprintf(stderr, "\t %f %f\n", t->pos.x, t->pos.y); + fprintf(stderr, "\t %f %f %f %f\n", t->touch_major, + t->touch_minor, t->width_major, t->width_minor); + fprintf(stderr, "\t %f %f\n", t->angle, t->pressure); + } for (i = 0; i < ev->nprop; i++) fprintf(stderr, "\t%d: %f\n", i, ev->prop[i]); } -- cgit v1.2.3