From d07c43f9f19dc0ee38aaf44947cfc396f437490e Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Tue, 3 Aug 2010 15:01:50 +0200 Subject: Introduce zoom, rotate and combo gestures Introduce grail_mask bit functions, and add new gestures as separate functions, referring to the same move model. Signed-off-by: Henrik Rydberg --- test/Makefile.am | 4 ++-- test/grail.c | 13 ++++++++----- test/touch.c | 16 ++++++++-------- 3 files changed, 18 insertions(+), 15 deletions(-) (limited to 'test') diff --git a/test/Makefile.am b/test/Makefile.am index c8404f8..e0498ba 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -3,7 +3,7 @@ noinst_PROGRAMS = touch grail INCLUDES=-I$(top_srcdir)/include/ touch_SOURCES = touch.c -touch_LDFLAGS = -L$(top_builddir)/src/.libs/ -lgrail -lmtdev +touch_LDFLAGS = -L$(top_builddir)/src/.libs/ -lgrail -lmtdev -lm grail_SOURCES = grail.c -grail_LDFLAGS = -L$(top_builddir)/src/.libs/ -lgrail -lmtdev +grail_LDFLAGS = -L$(top_builddir)/src/.libs/ -lgrail -lmtdev -lm diff --git a/test/grail.c b/test/grail.c index 361fd22..795e88f 100644 --- a/test/grail.c +++ b/test/grail.c @@ -31,28 +31,31 @@ static int tp_get_clients(struct grail *ge, struct grail_client_info *clients, int max_clients, const struct grail_coord *coords, int num_coords, - const grail_mask_t *types) + const grail_mask_t *types, int ntypes) { memset(&clients[0], 0, sizeof(clients[0])); clients[0].id.client = 345; clients[0].id.root = 1; clients[0].id.event = 2; clients[0].id.child = 3; - clients[0].mask[0] = 3; + clients[0].mask[0] = 0xff; return 1; } static void tp_event(struct grail *ge, const struct input_event *ev) { - fprintf(stderr, "event %d %d %d\n", ev->type, ev->code, ev->value); + fprintf(stderr, "event %d 0x%x %d\n", ev->type, ev->code, ev->value); } static void tp_gesture(struct grail *ge, const struct grail_event *ev) { - fprintf(stderr, "gesture %d %d %d %d: %d %d\n", + int i; + fprintf(stderr, "gesture %d %d %d %d %f %f %d:\n", ev->type, ev->id, ev->client_id.client, ev->client_id.event, - ev->prop[0], ev->prop[1]); + ev->pos.x, ev->pos.y, ev->ntouch); + for (i = 0; i < ev->nprop; i++) + fprintf(stderr, "\t%d: %f\n", i, ev->prop[i]); } static void loop_device(struct grail *ge, int fd) diff --git a/test/touch.c b/test/touch.c index 1dd9cd4..9b2d38a 100644 --- a/test/touch.c +++ b/test/touch.c @@ -31,20 +31,20 @@ static void tp_event(struct touch_engine *engine, const struct input_event *ev) { - fprintf(stderr, "event %d %d %d\n", ev->type, ev->code, ev->value); + fprintf(stderr, "event %d 0x%x %d\n", ev->type, ev->code, ev->value); } static void tp_sync(struct touch_engine *engine, const struct input_event *syn) { struct touch_frame *frame = &engine->frame; - int slot, i; - fprintf(stderr, "sync %d %lld\n", frame->ntouch, frame->time); - for (slot = frame->slot; slot >= 0; slot = next_slot(frame, slot)) { - struct touch *touch = &frame->touch[slot]; - fprintf(stderr, "touch %d\n", slot); - for (i = 0; i < DIM_TOUCH_PROP; i++) - fprintf(stderr, " %d\n", touch->prop[i]); + int i, j; + fprintf(stderr, "sync %d %lld\n", frame->nactive, frame->time); + for (i = 0; i < frame->nactive; i++) { + struct touch *t = frame->active[i]; + fprintf(stderr, "touch %d %d\n", i, t->slot); + for (j = 0; j < DIM_TOUCH_PROP; j++) + fprintf(stderr, " %d\n", t->prop[j]); } } -- cgit v1.2.3