From baf35a3b761172aeeefd7e761b7e29995a37a9e8 Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Thu, 19 Aug 2010 21:17:42 +0200 Subject: Add grail_contact and a method to retrieve the current contacts This patch adds the possibility to extract the current set of contacts from the grail state. Signed-off-by: Henrik Rydberg --- include/grail.h | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'include/grail.h') diff --git a/include/grail.h b/include/grail.h index ae3a73f..40cf22f 100644 --- a/include/grail.h +++ b/include/grail.h @@ -49,6 +49,32 @@ struct grail_coord { float x, y; }; +/** + * struct grail_contact - MT event information in bounding box units + * @id: Contact tracking id + * @tool_type: Tool type (ABS_MT_TOOL_TYPE) + * @pos: Position of contact (bbox units) + * @touch_major: Major axis of contact shape (bbox units) + * @touch_minor: Minor axis of contact shape (bbox units) + * @width_major: Major axis of perimeter (bbox units) + * @width_minor: Minor axis of perimeter (bbox units) + * @angle: Angle of orientation (vertical: 0 horizontal: +-M_PI_2) + * @pressure: Pressure of contact (min: 0 max: 1) + * + * Depending on the native support of the underlying device, some or all of + * the listed properties may be computed. + */ +struct grail_contact { + int id; + int tool_type; + struct grail_coord pos; + float touch_major; + float touch_minor; + float width_major; + float width_minor; + float angle; + float pressure; +}; /** * struct grail_client_id - Gesture client information @@ -228,4 +254,16 @@ void grail_filter_abs_events(struct grail *ge, int usage); void grail_get_units(const struct grail *ge, struct grail_coord *min, struct grail_coord *max); +/** + * grail_get_contacts - get current contact state + * @ge: the grail device in use + * @touch: array of contacts to be filled in + * @max_touch: maximum number of contacts supported by the array + * + * Extract the contact state as currently seen by grail. + * + */ +int grail_get_contacts(const struct grail *ge, + struct grail_contact *touch, int max_touch); + #endif -- cgit v1.2.3