summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.am4
-rw-r--r--test/grail.c13
-rw-r--r--test/touch.c16
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
3INCLUDES=-I$(top_srcdir)/include/ 3INCLUDES=-I$(top_srcdir)/include/
4 4
5touch_SOURCES = touch.c 5touch_SOURCES = touch.c
6touch_LDFLAGS = -L$(top_builddir)/src/.libs/ -lgrail -lmtdev 6touch_LDFLAGS = -L$(top_builddir)/src/.libs/ -lgrail -lmtdev -lm
7 7
8grail_SOURCES = grail.c 8grail_SOURCES = grail.c
9grail_LDFLAGS = -L$(top_builddir)/src/.libs/ -lgrail -lmtdev 9grail_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 @@
31static int tp_get_clients(struct grail *ge, 31static 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
45static void tp_event(struct grail *ge, const struct input_event *ev) 45static 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
50static void tp_gesture(struct grail *ge, const struct grail_event *ev) 50static 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
58static void loop_device(struct grail *ge, int fd) 61static 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 @@
31static void tp_event(struct touch_engine *engine, 31static 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
37static void tp_sync(struct touch_engine *engine, 37static 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