OLD | NEW |
1 /* Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 * Use of this source code is governed by a BSD-style license that can be | 2 * Use of this source code is governed by a BSD-style license that can be |
3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
4 */ | 4 */ |
5 #ifndef PPAPI_C_PP_POINT_H_ | 5 #ifndef PPAPI_C_PP_POINT_H_ |
6 #define PPAPI_C_PP_POINT_H_ | 6 #define PPAPI_C_PP_POINT_H_ |
7 | 7 |
8 /** | 8 /** |
9 * @file | 9 * @file |
10 * Defines the API ... | 10 * This file defines the API to create a 2 dimensional point. |
| 11 * 0,0 is the upper-left starting coordinate. |
11 */ | 12 */ |
12 | 13 |
13 #include "ppapi/c/pp_macros.h" | 14 #include "ppapi/c/pp_macros.h" |
14 #include "ppapi/c/pp_stdint.h" | 15 #include "ppapi/c/pp_stdint.h" |
15 | 16 |
16 /** | 17 /** |
17 * | 18 * |
18 * @addtogroup Structs | 19 * @addtogroup Structs |
19 * @{ | 20 * @{ |
20 */ | 21 */ |
| 22 |
| 23 /** |
| 24 * The PP_Point structure defines the x and y coordinates of a point. |
| 25 */ |
21 struct PP_Point { | 26 struct PP_Point { |
| 27 /** |
| 28 * This value represents the horizontal coordinate of a point, starting with 0 |
| 29 * as the left-most coordinate. |
| 30 */ |
22 int32_t x; | 31 int32_t x; |
| 32 |
| 33 /** |
| 34 * This value represents the vertical coordinate of a point, starting with 0 |
| 35 * as the top-most coordinate. |
| 36 */ |
23 int32_t y; | 37 int32_t y; |
24 }; | 38 }; |
25 PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_Point, 8); | 39 PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_Point, 8); |
26 /** | 40 /** |
27 * @} | 41 * @} |
28 */ | 42 */ |
29 | 43 |
30 /** | 44 /** |
31 * @addtogroup Functions | 45 * @addtogroup Functions |
32 * @{ | 46 * @{ |
33 */ | 47 */ |
| 48 |
| 49 /** |
| 50 * PP_MakePoint() creates a PP_Point given the x and y coordinates as int32_t |
| 51 * values. |
| 52 * @param[in] x An int32_t value representing a horizontal coordinate of a |
| 53 * point, starting with 0 as the left-most coordinate. |
| 54 * @param[in] y An int32_t value representing a vertical coordinate of a point, |
| 55 * starting with 0 as the top-most coordinate. |
| 56 * @return A PP_Point structure. |
| 57 */ |
34 PP_INLINE struct PP_Point PP_MakePoint(int32_t x, int32_t y) { | 58 PP_INLINE struct PP_Point PP_MakePoint(int32_t x, int32_t y) { |
35 struct PP_Point ret; | 59 struct PP_Point ret; |
36 ret.x = x; | 60 ret.x = x; |
37 ret.y = y; | 61 ret.y = y; |
38 return ret; | 62 return ret; |
39 } | 63 } |
40 /** | 64 /** |
41 * @} | 65 * @} |
42 */ | 66 */ |
43 | 67 |
44 #endif /* PPAPI_C_PP_POINT_H_ */ | 68 #endif /* PPAPI_C_PP_POINT_H_ */ |
45 | 69 |
OLD | NEW |