summaryrefslogtreecommitdiff
path: root/test/grail.c
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@bitmath.org>2010-08-03 15:01:50 +0200
committerHenrik Rydberg <rydberg@euromail.se>2010-08-05 22:48:38 +0200
commitd07c43f9f19dc0ee38aaf44947cfc396f437490e (patch)
tree2f9af561594a1de5553ba85b69b50bee421d5507 /test/grail.c
parent342a43e7b2ceec1dd200bffa24b052fec33f5bdc (diff)
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 <rydberg@bitmath.org>
Diffstat (limited to 'test/grail.c')
-rw-r--r--test/grail.c13
1 files changed, 8 insertions, 5 deletions
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)