From b76660d71e2ea77752025089bd71deffad64e325 Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Mon, 26 Jul 2010 13:51:34 +0200 Subject: Test implementation of grail api This patch introduces the grail API, and a program to test it (evlink). Signed-off-by: Henrik Rydberg --- src/touch-engine.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/touch-engine.c') diff --git a/src/touch-engine.c b/src/touch-engine.c index 6174e0d..8e43faf 100644 --- a/src/touch-engine.c +++ b/src/touch-engine.c @@ -94,13 +94,15 @@ static void tp_destroy(struct touch_dev *dev, int slot) } } -static void tp_sync(struct touch_dev *dev, touch_time_t time) +static void tp_sync(struct touch_dev *dev, const struct input_event *syn) { + static const touch_time_t ms = 1000; struct touch_engine *engine = dev->priv; + touch_time_t time = syn->time.tv_usec / ms + syn->time.tv_sec * ms; if (engine) { finalize_frame(&engine->frame, time); if (engine->sync) - engine->sync(engine); + engine->sync(engine, syn); engine->frame.ncreate = 0; engine->frame.nmodify = 0; engine->frame.ndestroy = 0; @@ -110,7 +112,8 @@ static void tp_sync(struct touch_dev *dev, touch_time_t time) void touch_engine_init(struct touch_engine *engine, void (*event)(struct touch_engine *engine, const struct input_event *ev), - void (*sync)(struct touch_engine *engine), + void (*sync)(struct touch_engine *engine, + const struct input_event *ev), void *priv) { memset(engine, 0, sizeof(*engine)); -- cgit v1.2.3