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