summaryrefslogtreecommitdiff
path: root/src/grail-event.c
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2011-04-28 15:41:49 +0200
committerHenrik Rydberg <rydberg@euromail.se>2011-04-28 16:58:51 +0200
commitb605a93a85d8ead753d87a2da5a0e40571d6f275 (patch)
treed67a4dcae7176e065da7e302503abf0934c07bc4 /src/grail-event.c
parentc3fdf90535e9e4a29d6d846071a50679d9646bcf (diff)
Expose utouch-frame through grail API
Start a gentle API change by exposing utouch-frame through grail, and deprecating the grail_contact struct. Old programs compile and run fine. To only use the new api, compile with -DGRAIL_NO_LEGACY_API. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'src/grail-event.c')
-rw-r--r--src/grail-event.c25
1 files changed, 0 insertions, 25 deletions
diff --git a/src/grail-event.c b/src/grail-event.c
index bb75a06..0c565ea 100644
--- a/src/grail-event.c
+++ b/src/grail-event.c
@@ -117,28 +117,3 @@ void gin_send_event(struct grail *ge, struct slot_state *s,
117 grailbuf_put(&impl->gbuf, &gev); 117 grailbuf_put(&impl->gbuf, &gev);
118 } 118 }
119} 119}
120
121int GRAIL_PUBLIC grail_get_contacts(const struct grail *ge,
122 struct grail_contact *touch, int max_touch)
123{
124 const struct gesture_inserter *gin = ge->gin;
125 const struct utouch_frame *frame = ge->impl->frame;
126 int i;
127 if (frame->num_active < max_touch)
128 max_touch = frame->num_active;
129 for (i = 0; i < max_touch; i++) {
130 struct grail_contact *t = &touch[i];
131 const struct utouch_contact *ct = frame->active[i];
132 t->id = ct->id;
133 t->tool_type = ct->tool_type;
134 t->pos.x = ct->x;
135 t->pos.y = ct->y;
136 t->touch_major = ct->touch_major;
137 t->touch_minor = ct->touch_minor;
138 t->width_major = ct->width_major;
139 t->width_minor = ct->width_minor;
140 t->angle = ct->orientation;
141 t->pressure = ct->pressure;
142 }
143 return max_touch;
144}