From 1fb331ca738e92e5815fe8b7ce503c187f52fecc Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Mon, 14 Mar 2011 15:17:01 +0100 Subject: Convert to utouch-frame mapping Remove the grail-internal mapping code and rely directly on utouch-frame instead. Passes the unit test designed for this change. Signed-off-by: Henrik Rydberg --- src/grail-event.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'src/grail-event.c') diff --git a/src/grail-event.c b/src/grail-event.c index 9c0e437..504ed10 100644 --- a/src/grail-event.c +++ b/src/grail-event.c @@ -62,15 +62,15 @@ int gin_add_contact_props(const struct gesture_inserter *gin, if (ntouch > 5) ntouch = 5; compute_bbox(&min, &max, frame); - prop[n++] = gin_prop_x(gin, min.x); - prop[n++] = gin_prop_y(gin, min.y); - prop[n++] = gin_prop_x(gin, max.x); - prop[n++] = gin_prop_y(gin, max.y); + prop[n++] = min.x; + prop[n++] = min.y; + prop[n++] = max.x; + prop[n++] = max.y; for (i = 0; i < ntouch; i++) { const struct utouch_contact *ct = frame->active[i]; prop[n++] = ct->id; - prop[n++] = gin_prop_x(gin, ct->x); - prop[n++] = gin_prop_y(gin, ct->y); + prop[n++] = ct->x; + prop[n++] = ct->y; } return n; } @@ -86,8 +86,8 @@ int gin_get_clients(struct grail *ge, if (!ge->get_clients) return 0; grail_mask_foreach(i, span, bspan) { - pos[npos].x = gin_prop_x(ge->gin, frame->slots[i]->x); - pos[npos].y = gin_prop_y(ge->gin, frame->slots[i]->y); + pos[npos].x = frame->slots[i]->x; + pos[npos].y = frame->slots[i]->y; npos++; } return ge->get_clients(ge, info, maxinfo, pos, npos, types, btypes); @@ -109,8 +109,8 @@ void gin_send_event(struct grail *ge, struct slot_state *s, gev.ntouch = ev->ntouch; gev.nprop = ev->nprop; gev.time = ev->time; - gev.pos.x = gin_prop_x(gin, ev->pos.x); - gev.pos.y = gin_prop_y(gin, ev->pos.y); + gev.pos.x = ev->pos.x; + gev.pos.y = ev->pos.y; memcpy(gev.prop, ev->prop, ev->nprop * sizeof(grail_prop_t)); for (i = 0; i < s->nclient; i++) { gev.client_id = s->client_id[i]; @@ -131,12 +131,12 @@ int grail_get_contacts(const struct grail *ge, const struct utouch_contact *ct = frame->active[i]; t->id = ct->id; t->tool_type = ct->tool_type; - t->pos.x = gin_prop_x(gin, ct->x); - t->pos.y = gin_prop_y(gin, ct->y); - t->touch_major = gin->scale_r * ct->touch_major; - t->touch_minor = gin->scale_r * ct->touch_minor; - t->width_major = gin->scale_r * ct->width_major; - t->width_minor = gin->scale_r * ct->width_minor; + t->pos.x = ct->x; + t->pos.y = ct->y; + t->touch_major = ct->touch_major; + t->touch_minor = ct->touch_minor; + t->width_major = ct->width_major; + t->width_minor = ct->width_minor; t->angle = ct->orientation; t->pressure = ct->pressure; } -- cgit v1.2.3