diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/Makefile.am | 4 | ||||
| -rw-r--r-- | test/grail.c | 13 | ||||
| -rw-r--r-- | test/touch.c | 16 |
3 files changed, 18 insertions, 15 deletions
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 | |||
| 3 | INCLUDES=-I$(top_srcdir)/include/ | 3 | INCLUDES=-I$(top_srcdir)/include/ |
| 4 | 4 | ||
| 5 | touch_SOURCES = touch.c | 5 | touch_SOURCES = touch.c |
| 6 | touch_LDFLAGS = -L$(top_builddir)/src/.libs/ -lgrail -lmtdev | 6 | touch_LDFLAGS = -L$(top_builddir)/src/.libs/ -lgrail -lmtdev -lm |
| 7 | 7 | ||
| 8 | grail_SOURCES = grail.c | 8 | grail_SOURCES = grail.c |
| 9 | grail_LDFLAGS = -L$(top_builddir)/src/.libs/ -lgrail -lmtdev | 9 | 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 @@ | |||
| 31 | static int tp_get_clients(struct grail *ge, | 31 | static int tp_get_clients(struct grail *ge, |
| 32 | struct grail_client_info *clients, int max_clients, | 32 | struct grail_client_info *clients, int max_clients, |
| 33 | const struct grail_coord *coords, int num_coords, | 33 | const struct grail_coord *coords, int num_coords, |
| 34 | const grail_mask_t *types) | 34 | const grail_mask_t *types, int ntypes) |
| 35 | { | 35 | { |
| 36 | memset(&clients[0], 0, sizeof(clients[0])); | 36 | memset(&clients[0], 0, sizeof(clients[0])); |
| 37 | clients[0].id.client = 345; | 37 | clients[0].id.client = 345; |
| 38 | clients[0].id.root = 1; | 38 | clients[0].id.root = 1; |
| 39 | clients[0].id.event = 2; | 39 | clients[0].id.event = 2; |
| 40 | clients[0].id.child = 3; | 40 | clients[0].id.child = 3; |
| 41 | clients[0].mask[0] = 3; | 41 | clients[0].mask[0] = 0xff; |
| 42 | return 1; | 42 | return 1; |
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | static void tp_event(struct grail *ge, const struct input_event *ev) | 45 | static void tp_event(struct grail *ge, const struct input_event *ev) |
| 46 | { | 46 | { |
| 47 | fprintf(stderr, "event %d %d %d\n", ev->type, ev->code, ev->value); | 47 | fprintf(stderr, "event %d 0x%x %d\n", ev->type, ev->code, ev->value); |
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | static void tp_gesture(struct grail *ge, const struct grail_event *ev) | 50 | static void tp_gesture(struct grail *ge, const struct grail_event *ev) |
| 51 | { | 51 | { |
| 52 | fprintf(stderr, "gesture %d %d %d %d: %d %d\n", | 52 | int i; |
| 53 | fprintf(stderr, "gesture %d %d %d %d %f %f %d:\n", | ||
| 53 | ev->type, ev->id, | 54 | ev->type, ev->id, |
| 54 | ev->client_id.client, ev->client_id.event, | 55 | ev->client_id.client, ev->client_id.event, |
| 55 | ev->prop[0], ev->prop[1]); | 56 | ev->pos.x, ev->pos.y, ev->ntouch); |
| 57 | for (i = 0; i < ev->nprop; i++) | ||
| 58 | fprintf(stderr, "\t%d: %f\n", i, ev->prop[i]); | ||
| 56 | } | 59 | } |
| 57 | 60 | ||
| 58 | static void loop_device(struct grail *ge, int fd) | 61 | 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 @@ | |||
| 31 | static void tp_event(struct touch_engine *engine, | 31 | static void tp_event(struct touch_engine *engine, |
| 32 | const struct input_event *ev) | 32 | const struct input_event *ev) |
| 33 | { | 33 | { |
| 34 | fprintf(stderr, "event %d %d %d\n", ev->type, ev->code, ev->value); | 34 | fprintf(stderr, "event %d 0x%x %d\n", ev->type, ev->code, ev->value); |
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | static void tp_sync(struct touch_engine *engine, | 37 | static void tp_sync(struct touch_engine *engine, |
| 38 | const struct input_event *syn) | 38 | const struct input_event *syn) |
| 39 | { | 39 | { |
| 40 | struct touch_frame *frame = &engine->frame; | 40 | struct touch_frame *frame = &engine->frame; |
| 41 | int slot, i; | 41 | int i, j; |
| 42 | fprintf(stderr, "sync %d %lld\n", frame->ntouch, frame->time); | 42 | fprintf(stderr, "sync %d %lld\n", frame->nactive, frame->time); |
| 43 | for (slot = frame->slot; slot >= 0; slot = next_slot(frame, slot)) { | 43 | for (i = 0; i < frame->nactive; i++) { |
| 44 | struct touch *touch = &frame->touch[slot]; | 44 | struct touch *t = frame->active[i]; |
| 45 | fprintf(stderr, "touch %d\n", slot); | 45 | fprintf(stderr, "touch %d %d\n", i, t->slot); |
| 46 | for (i = 0; i < DIM_TOUCH_PROP; i++) | 46 | for (j = 0; j < DIM_TOUCH_PROP; j++) |
| 47 | fprintf(stderr, " %d\n", touch->prop[i]); | 47 | fprintf(stderr, " %d\n", t->prop[j]); |
| 48 | } | 48 | } |
| 49 | } | 49 | } |
| 50 | 50 | ||
