[email protected] | cdf4e91 | 2012-06-21 23:15:10 | [diff] [blame] | 1 | /* Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 | * Use of this source code is governed by a BSD-style license that can be |
| 3 | * found in the LICENSE file. |
| 4 | */ |
| 5 | |
| 6 | |
| 7 | /** |
[email protected] | af0bb064 | 2012-09-25 15:47:11 | [diff] [blame] | 8 | * This file defines the API to create a touch point or position where fingers |
| 9 | * makes contact with touch screen device. |
[email protected] | cdf4e91 | 2012-06-21 23:15:10 | [diff] [blame] | 10 | */ |
| 11 | |
| 12 | /** |
[email protected] | af0bb064 | 2012-09-25 15:47:11 | [diff] [blame] | 13 | * The <code>PP_TouchPoint</code> struct represents all information about a |
[email protected] | 935d00fd | 2013-03-29 22:26:15 | [diff] [blame] | 14 | * single touch point, such as position, id, rotation angle, and pressure. |
[email protected] | cdf4e91 | 2012-06-21 23:15:10 | [diff] [blame] | 15 | */ |
| 16 | [assert_size(28), returnByValue] |
| 17 | struct PP_TouchPoint { |
| 18 | /** |
[email protected] | af0bb064 | 2012-09-25 15:47:11 | [diff] [blame] | 19 | * This value represents the identifier for this TouchPoint. The id |
| 20 | * corresponds to the order in which the points were pressed. For example, |
| 21 | * the first point to be pressed has an id of 0, the second has an id of 1, |
| 22 | * and so on. An id can be reused when a touch point is released. For |
| 23 | * example, if two fingers are down, with id 0 and 1, and finger 0 releases, |
| 24 | * the next finger to be pressed can be assigned to id 0. |
[email protected] | cdf4e91 | 2012-06-21 23:15:10 | [diff] [blame] | 25 | */ |
| 26 | uint32_t id; |
| 27 | |
| 28 | /** |
[email protected] | af0bb064 | 2012-09-25 15:47:11 | [diff] [blame] | 29 | * This value represents the x and y pixel position of this TouchPoint |
| 30 | * relative to the upper-left of the module instance receiving the event. |
[email protected] | cdf4e91 | 2012-06-21 23:15:10 | [diff] [blame] | 31 | */ |
| 32 | PP_FloatPoint position; |
| 33 | |
| 34 | /** |
[email protected] | af0bb064 | 2012-09-25 15:47:11 | [diff] [blame] | 35 | * This value represents the elliptical radii, in screen pixels, in the x |
| 36 | * and y direction of this TouchPoint. |
[email protected] | cdf4e91 | 2012-06-21 23:15:10 | [diff] [blame] | 37 | */ |
| 38 | PP_FloatPoint radius; |
| 39 | |
| 40 | /** |
[email protected] | af0bb064 | 2012-09-25 15:47:11 | [diff] [blame] | 41 | * This value represents the angle of rotation in degrees of the elliptical |
| 42 | * model of this TouchPoint clockwise from "up." |
[email protected] | cdf4e91 | 2012-06-21 23:15:10 | [diff] [blame] | 43 | */ |
| 44 | float_t rotation_angle; |
| 45 | |
| 46 | /** |
[email protected] | af0bb064 | 2012-09-25 15:47:11 | [diff] [blame] | 47 | * This value represents the pressure applied to this TouchPoint. This value |
| 48 | * is typically between 0 and 1, with 0 indicating no pressure and 1 |
| 49 | * indicating some maximum pressure. Scaling differs depending on the |
| 50 | * hardware and the value is not guaranteed to stay within that range. |
[email protected] | cdf4e91 | 2012-06-21 23:15:10 | [diff] [blame] | 51 | */ |
| 52 | float_t pressure; |
| 53 | }; |
| 54 | |
| 55 | #inline c |
| 56 | /** |
| 57 | * @addtogroup Functions |
| 58 | * @{ |
| 59 | */ |
| 60 | |
| 61 | /** |
| 62 | * PP_MakeTouchPoint() creates a <code>PP_TouchPoint</code>. |
| 63 | * |
| 64 | * @return A <code>PP_TouchPoint</code> structure. |
| 65 | */ |
[email protected] | e4a4742 | 2013-02-15 11:46:35 | [diff] [blame] | 66 | PP_INLINE struct PP_TouchPoint PP_MakeTouchPoint(void) { |
[email protected] | cdf4e91 | 2012-06-21 23:15:10 | [diff] [blame] | 67 | struct PP_TouchPoint result = { 0, {0, 0}, {0, 0}, 0, 0 }; |
| 68 | return result; |
| 69 | } |
| 70 | /** |
| 71 | * @} |
| 72 | */ |
| 73 | |
| 74 | #endinl |