blob: 42c08097df2fc72afec86f61cda11e2ee37b1897 [file] [log] [blame]
[email protected]cdf4e912012-06-21 23:15:101/* 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]af0bb0642012-09-25 15:47:118 * This file defines the API to create a touch point or position where fingers
9 * makes contact with touch screen device.
[email protected]cdf4e912012-06-21 23:15:1010 */
11
12/**
[email protected]af0bb0642012-09-25 15:47:1113 * The <code>PP_TouchPoint</code> struct represents all information about a
[email protected]935d00fd2013-03-29 22:26:1514 * single touch point, such as position, id, rotation angle, and pressure.
[email protected]cdf4e912012-06-21 23:15:1015 */
16[assert_size(28), returnByValue]
17struct PP_TouchPoint {
18 /**
[email protected]af0bb0642012-09-25 15:47:1119 * 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]cdf4e912012-06-21 23:15:1025 */
26 uint32_t id;
27
28 /**
[email protected]af0bb0642012-09-25 15:47:1129 * 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]cdf4e912012-06-21 23:15:1031 */
32 PP_FloatPoint position;
33
34 /**
[email protected]af0bb0642012-09-25 15:47:1135 * This value represents the elliptical radii, in screen pixels, in the x
36 * and y direction of this TouchPoint.
[email protected]cdf4e912012-06-21 23:15:1037 */
38 PP_FloatPoint radius;
39
40 /**
[email protected]af0bb0642012-09-25 15:47:1141 * This value represents the angle of rotation in degrees of the elliptical
42 * model of this TouchPoint clockwise from "up."
[email protected]cdf4e912012-06-21 23:15:1043 */
44 float_t rotation_angle;
45
46 /**
[email protected]af0bb0642012-09-25 15:47:1147 * 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]cdf4e912012-06-21 23:15:1051 */
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]e4a47422013-02-15 11:46:3566PP_INLINE struct PP_TouchPoint PP_MakeTouchPoint(void) {
[email protected]cdf4e912012-06-21 23:15:1067 struct PP_TouchPoint result = { 0, {0, 0}, {0, 0}, 0, 0 };
68 return result;
69}
70/**
71 * @}
72 */
73
74#endinl