summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/grail.c11
-rw-r--r--test/touch.c12
2 files changed, 17 insertions, 6 deletions
diff --git a/test/grail.c b/test/grail.c
index 3fe20ee..82de65f 100644
--- a/test/grail.c
+++ b/test/grail.c
@@ -128,11 +128,16 @@ static void gh_destroy(struct gesture_handler *gh)
128 gedev_destroy(&gh->dev); 128 gedev_destroy(&gh->dev);
129} 129}
130 130
131static void tp_sync(struct touch_engine *engine, touch_time_t time) 131static void tp_event(struct touch_engine *engine,
132 const struct input_event *ev)
133{
134}
135
136static void tp_sync(struct touch_engine *engine)
132{ 137{
133 struct gesture_handler *gh = engine->priv; 138 struct gesture_handler *gh = engine->priv;
134 struct touch_frame *frame = &engine->frame; 139 struct touch_frame *frame = &engine->frame;
135 gh_handle(gh, frame, time); 140 gh_handle(gh, frame, frame->time);
136} 141}
137 142
138static void loop_device(struct touch_dev *dev, int fd) 143static void loop_device(struct touch_dev *dev, int fd)
@@ -140,7 +145,7 @@ static void loop_device(struct touch_dev *dev, int fd)
140 struct gesture_handler gh; 145 struct gesture_handler gh;
141 struct touch_engine engine; 146 struct touch_engine engine;
142 gh_init(&gh); 147 gh_init(&gh);
143 touch_engine_init(&engine, tp_sync, &gh); 148 touch_engine_init(&engine, tp_event, tp_sync, &gh);
144 touch_engine_attach(&engine, dev); 149 touch_engine_attach(&engine, dev);
145 while (!touch_dev_idle(dev, fd, 5000)) 150 while (!touch_dev_idle(dev, fd, 5000))
146 touch_dev_pull(dev, fd); 151 touch_dev_pull(dev, fd);
diff --git a/test/touch.c b/test/touch.c
index 48b2f12..1f9213d 100644
--- a/test/touch.c
+++ b/test/touch.c
@@ -28,11 +28,17 @@
28#include <unistd.h> 28#include <unistd.h>
29#include <fcntl.h> 29#include <fcntl.h>
30 30
31static void tp_sync(struct touch_engine *engine, touch_time_t time) 31static void tp_event(struct touch_engine *engine,
32 const struct input_event *ev)
33{
34 fprintf(stderr, "event %d %d %d\n", ev->type, ev->code, ev->value);
35}
36
37static void tp_sync(struct touch_engine *engine)
32{ 38{
33 struct touch_frame *frame = &engine->frame; 39 struct touch_frame *frame = &engine->frame;
34 int slot, i; 40 int slot, i;
35 fprintf(stderr, "sync %d %lld\n", frame->ntouch, time); 41 fprintf(stderr, "sync %d %lld\n", frame->ntouch, frame->time);
36 for (slot = frame->slot; slot >= 0; slot = next_slot(frame, slot)) { 42 for (slot = frame->slot; slot >= 0; slot = next_slot(frame, slot)) {
37 struct touch *touch = &frame->touch[slot]; 43 struct touch *touch = &frame->touch[slot];
38 fprintf(stderr, "touch %d\n", slot); 44 fprintf(stderr, "touch %d\n", slot);
@@ -44,7 +50,7 @@ static void tp_sync(struct touch_engine *engine, touch_time_t time)
44static void loop_device(struct touch_dev *dev, int fd) 50static void loop_device(struct touch_dev *dev, int fd)
45{ 51{
46 struct touch_engine engine; 52 struct touch_engine engine;
47 touch_engine_init(&engine, tp_sync, 0); 53 touch_engine_init(&engine, tp_event, tp_sync, 0);
48 touch_engine_attach(&engine, dev); 54 touch_engine_attach(&engine, dev);
49 while (!touch_dev_idle(dev, fd, 5000)) 55 while (!touch_dev_idle(dev, fd, 5000))
50 touch_dev_pull(dev, fd); 56 touch_dev_pull(dev, fd);