diff options
| author | Henrik Rydberg <rydberg@euromail.se> | 2011-02-14 12:51:01 +0100 |
|---|---|---|
| committer | Henrik Rydberg <rydberg@euromail.se> | 2011-02-15 12:42:41 +0100 |
| commit | 93e1a5a3904ef2f14110d8b807bcd7d107b3b2a4 (patch) | |
| tree | a50e22d57ae77bcaa7674b4ff4bf8b2b1c3f690f /include/utouch/frame.h | |
| parent | a06bde2b7aec991b798de9a8e0d7972adaabb40d (diff) | |
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 <rydberg@euromail.se>
Diffstat (limited to 'include/utouch/frame.h')
| -rw-r--r-- | include/utouch/frame.h | 30 |
1 files changed, 24 insertions, 6 deletions
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" { | |||
| 28 | 28 | ||
| 29 | #include <stdint.h> | 29 | #include <stdint.h> |
| 30 | 30 | ||
| 31 | #define UTOUCH_FRAME_VERSION 0x00001000 | 31 | #define UTOUCH_FRAME_VERSION 0x00001010 |
| 32 | 32 | ||
| 33 | /** | 33 | /** |
| 34 | * struct utouch_surface - device surface details | 34 | * struct utouch_surface - device surface details |
| @@ -46,11 +46,23 @@ extern "C" { | |||
| 46 | * @phys_width: physical width in millimeters (mm) | 46 | * @phys_width: physical width in millimeters (mm) |
| 47 | * @phys_height: physical height in millimeters (mm) | 47 | * @phys_height: physical height in millimeters (mm) |
| 48 | * @phys_pressure: maximal physical pressure (N/cm^2) | 48 | * @phys_pressure: maximal physical pressure (N/cm^2) |
| 49 | * @min_x: minimum horizontal coordinate value | 49 | * @min_x: minimum horizontal device coordinate |
| 50 | * @min_y: minimum vertical coordinate value | 50 | * @min_y: minimum vertical device coordinate |
| 51 | * @max_x: maximum horizontal coordinate value | 51 | * @max_x: maximum horizontal device coordinate |
| 52 | * @max_y: maximum vertical coordinate value | 52 | * @max_y: maximum vertical device coordinate |
| 53 | * @max_pressure: maximum pressure coordinate value | 53 | * @max_pressure: maximum pressure device coordinate |
| 54 | * @max_orient: maximum orientation device coordinate | ||
| 55 | * @mapped_min_x: minimum horizontal mapped coordinate | ||
| 56 | * @mapped_min_y: minimum vertical mapped coordinate | ||
| 57 | * @mapped_max_x: maximum horizontal mapped coordinate | ||
| 58 | * @mapped_max_y: maximum vertical mapped coordinate | ||
| 59 | * @mapped_max_pressure: maximum pressure mapped coordinate | ||
| 60 | * | ||
| 61 | * The mutable contact given by utouch_frame_get_current_slot() should | ||
| 62 | * be set in device coordinates. The contact data is subsequently | ||
| 63 | * transformed to mapped (e.g., screen) coordinates in | ||
| 64 | * utouch_frame_sync(). To a frame user, all data will appear in | ||
| 65 | * mapped coordinates. | ||
| 54 | * | 66 | * |
| 55 | * Device properties and touch surface details. Later versions of this | 67 | * Device properties and touch surface details. Later versions of this |
| 56 | * struct may grow in size, but will remain binary compatible with | 68 | * struct may grow in size, but will remain binary compatible with |
| @@ -76,6 +88,12 @@ struct utouch_surface { | |||
| 76 | float max_x; | 88 | float max_x; |
| 77 | float max_y; | 89 | float max_y; |
| 78 | float max_pressure; | 90 | float max_pressure; |
| 91 | float max_orient; | ||
| 92 | float mapped_min_x; | ||
| 93 | float mapped_min_y; | ||
| 94 | float mapped_max_x; | ||
| 95 | float mapped_max_y; | ||
| 96 | float mapped_max_pressure; | ||
| 79 | }; | 97 | }; |
| 80 | 98 | ||
| 81 | #define UTOUCH_TOOL_FINGER 0 | 99 | #define UTOUCH_TOOL_FINGER 0 |
