From 93e1a5a3904ef2f14110d8b807bcd7d107b3b2a4 Mon Sep 17 00:00:00 2001 From: Henrik Rydberg Date: Mon, 14 Feb 2011 12:51:01 +0100 Subject: Map device coordinates onto target surface The current implementation outputs most touch attributes in device coordinates. However, the primary use case is to map the input device onto an area on the screen, needed in particular for multihead setups. Moreover, the XI2.1 backend works with screen coordinates, creating an unnecessary discrepancy between backends. This patch adds the basic transformation layer to the utouch surface, thus serving as the master point of device-to-surface mapping. Signed-off-by: Henrik Rydberg --- include/utouch/frame.h | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) (limited to 'include/utouch/frame.h') diff --git a/include/utouch/frame.h b/include/utouch/frame.h index f136eb1..5b5f4d2 100644 --- a/include/utouch/frame.h +++ b/include/utouch/frame.h @@ -28,7 +28,7 @@ extern "C" { #include -#define UTOUCH_FRAME_VERSION 0x00001000 +#define UTOUCH_FRAME_VERSION 0x00001010 /** * struct utouch_surface - device surface details @@ -46,11 +46,23 @@ extern "C" { * @phys_width: physical width in millimeters (mm) * @phys_height: physical height in millimeters (mm) * @phys_pressure: maximal physical pressure (N/cm^2) - * @min_x: minimum horizontal coordinate value - * @min_y: minimum vertical coordinate value - * @max_x: maximum horizontal coordinate value - * @max_y: maximum vertical coordinate value - * @max_pressure: maximum pressure coordinate value + * @min_x: minimum horizontal device coordinate + * @min_y: minimum vertical device coordinate + * @max_x: maximum horizontal device coordinate + * @max_y: maximum vertical device coordinate + * @max_pressure: maximum pressure device coordinate + * @max_orient: maximum orientation device coordinate + * @mapped_min_x: minimum horizontal mapped coordinate + * @mapped_min_y: minimum vertical mapped coordinate + * @mapped_max_x: maximum horizontal mapped coordinate + * @mapped_max_y: maximum vertical mapped coordinate + * @mapped_max_pressure: maximum pressure mapped coordinate + * + * The mutable contact given by utouch_frame_get_current_slot() should + * be set in device coordinates. The contact data is subsequently + * transformed to mapped (e.g., screen) coordinates in + * utouch_frame_sync(). To a frame user, all data will appear in + * mapped coordinates. * * Device properties and touch surface details. Later versions of this * struct may grow in size, but will remain binary compatible with @@ -76,6 +88,12 @@ struct utouch_surface { float max_x; float max_y; float max_pressure; + float max_orient; + float mapped_min_x; + float mapped_min_y; + float mapped_max_x; + float mapped_max_y; + float mapped_max_pressure; }; #define UTOUCH_TOOL_FINGER 0 -- cgit v1.2.3