OLD | NEW |
(Empty) | |
| 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 /** |
| 8 * This file defines the API to create a touch-point. |
| 9 */ |
| 10 |
| 11 /** |
| 12 * The <code>PP_TouchPoint</code> represents all information about a single |
| 13 * touch point, such ase position, id, rotation angle, and pressure. |
| 14 */ |
| 15 [assert_size(28), returnByValue] |
| 16 struct PP_TouchPoint { |
| 17 /** |
| 18 * The identifier for this TouchPoint. This corresponds to the order |
| 19 * in which the points were pressed. For example, the first point to be |
| 20 * pressed has an id of 0, the second has an id of 1, and so on. An id can be |
| 21 * reused when a touch point is released. For example, if two fingers are |
| 22 * down, with id 0 and 1, and finger 0 releases, the next finger to be |
| 23 * pressed can be assigned to id 0. |
| 24 */ |
| 25 uint32_t id; |
| 26 |
| 27 /** |
| 28 * The x-y pixel position of this TouchPoint, relative to the upper-left of |
| 29 * the instance receiving the event. |
| 30 */ |
| 31 PP_FloatPoint position; |
| 32 |
| 33 /** |
| 34 * The elliptical radii, in screen pixels, in the x and y direction of this |
| 35 * TouchPoint. |
| 36 */ |
| 37 PP_FloatPoint radius; |
| 38 |
| 39 /** |
| 40 * The angle of rotation in degrees of the elliptical model of this TouchPoint |
| 41 * clockwise from "up." |
| 42 */ |
| 43 float_t rotation_angle; |
| 44 |
| 45 /** |
| 46 * The pressure applied to this TouchPoint. This is typically a |
| 47 * value between 0 and 1, with 0 indicating no pressure and 1 indicating |
| 48 * some maximum pressure, but scaling differs depending on the hardware and |
| 49 * the value is not guaranteed to stay within that range. |
| 50 */ |
| 51 float_t pressure; |
| 52 }; |
| 53 |
| 54 #inline c |
| 55 /** |
| 56 * @addtogroup Functions |
| 57 * @{ |
| 58 */ |
| 59 |
| 60 /** |
| 61 * PP_MakeTouchPoint() creates a <code>PP_TouchPoint</code>. |
| 62 * |
| 63 * @return A <code>PP_TouchPoint</code> structure. |
| 64 */ |
| 65 PP_INLINE struct PP_TouchPoint PP_MakeTouchPoint() { |
| 66 struct PP_TouchPoint result = { 0, {0, 0}, {0, 0}, 0, 0 }; |
| 67 return result; |
| 68 } |
| 69 /** |
| 70 * @} |
| 71 */ |
| 72 |
| 73 #endinl |
OLD | NEW |