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.
8 * This file defines the API to create a touch point or position where fingers
9 * makes contact with touch screen device.
13 * The <code>PP_TouchPoint</code> struct represents all information about a
14 * single touch point, such ase position, id, rotation angle, and pressure.
16 [assert_size
(28), returnByValue
]
17 struct PP_TouchPoint
{
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.
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.
32 PP_FloatPoint position
;
35 * This value represents the elliptical radii, in screen pixels, in the x
36 * and y direction of this TouchPoint.
41 * This value represents the angle of rotation in degrees of the elliptical
42 * model of this TouchPoint clockwise from "up."
44 float_t rotation_angle
;
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.
57 * @addtogroup Functions
62 * PP_MakeTouchPoint() creates a <code>PP_TouchPoint</code>.
64 * @return A <code>PP_TouchPoint</code> structure.
66 PP_INLINE
struct PP_TouchPoint PP_MakeTouchPoint
() {
67 struct PP_TouchPoint result
= { 0, {0, 0}, {0, 0}, 0, 0 };