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_RECT_H_ | 5 #ifndef PPAPI_C_PP_RECT_H_ |
6 #define PPAPI_C_PP_RECT_H_ | 6 #define PPAPI_C_PP_RECT_H_ |
7 | 7 |
8 /** | 8 /** |
9 * @file | 9 * @file |
10 * This file defines the APIs for creating a 2 dimensional rectangle. | 10 * This file defines the APIs for creating a 2 dimensional rectangle. |
11 */ | 11 */ |
12 | 12 |
13 #include "ppapi/c/pp_macros.h" | 13 #include "ppapi/c/pp_macros.h" |
14 #include "ppapi/c/pp_point.h" | 14 #include "ppapi/c/pp_point.h" |
15 #include "ppapi/c/pp_size.h" | 15 #include "ppapi/c/pp_size.h" |
16 #include "ppapi/c/pp_stdint.h" | 16 #include "ppapi/c/pp_stdint.h" |
17 | 17 |
18 /** | 18 /** |
19 * @addtogroup Structs | 19 * @addtogroup Structs |
20 * @{ | 20 * @{ |
21 */ | 21 */ |
22 | 22 |
23 /** | 23 /** |
24 * The PP_Rect struct contains the size and location of a 2D rectangle. | 24 * The <code>PP_Rect</code> struct contains the size and location of a 2D |
| 25 * rectangle. |
25 */ | 26 */ |
26 struct PP_Rect { | 27 struct PP_Rect { |
27 | 28 |
28 /** | 29 /** |
29 * This value represents the x and y coordinates of the upper-left corner of | 30 * This value represents the x and y coordinates of the upper-left corner of |
30 * the rectangle. | 31 * the rectangle. |
31 */ | 32 */ |
32 struct PP_Point point; | 33 struct PP_Point point; |
33 | 34 |
34 /** This value represents the width and height of the rectangle. */ | 35 /** This value represents the width and height of the rectangle. */ |
35 struct PP_Size size; | 36 struct PP_Size size; |
36 }; | 37 }; |
37 PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_Rect, 16); | 38 PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_Rect, 16); |
38 /** | 39 /** |
39 * @} | 40 * @} |
40 */ | 41 */ |
41 | 42 |
42 /** | 43 /** |
43 * @addtogroup Functions | 44 * @addtogroup Functions |
44 * @{ | 45 * @{ |
45 */ | 46 */ |
46 | 47 |
47 /** | 48 /** |
48 * PP_MakeRectFromXYWH() creates a PP_Rect given x and y coordinates and width | 49 * This function creates a <code>PP_Rect</code> given x and y coordinates and |
49 * and height dimensions as int32_t values. | 50 * width and height dimensions as int32_t values. |
50 * @param[in] x An int32_t value representing a horizontal coordinate of a | 51 * @param[in] x An int32_t value representing a horizontal coordinate of a |
51 * point, starting with 0 as the left-most coordinate. | 52 * point, starting with 0 as the left-most coordinate. |
52 * @param[in] y An int32_t value representing a vertical coordinate of a point, | 53 * @param[in] y An int32_t value representing a vertical coordinate of a point, |
53 * starting with 0 as the top-most coordinate. | 54 * starting with 0 as the top-most coordinate. |
54 * @param[in] w An int32_t value representing a width. | 55 * @param[in] w An int32_t value representing a width. |
55 * @param[in] h An int32_t value representing a height. | 56 * @param[in] h An int32_t value representing a height. |
56 * @return A PP_Rect structure. | 57 * @return A <code>PP_Rect</code> structure. |
57 */ | 58 */ |
58 PP_INLINE struct PP_Rect PP_MakeRectFromXYWH(int32_t x, int32_t y, | 59 PP_INLINE struct PP_Rect PP_MakeRectFromXYWH(int32_t x, int32_t y, |
59 int32_t w, int32_t h) { | 60 int32_t w, int32_t h) { |
60 struct PP_Rect ret; | 61 struct PP_Rect ret; |
61 ret.point.x = x; | 62 ret.point.x = x; |
62 ret.point.y = y; | 63 ret.point.y = y; |
63 ret.size.width = w; | 64 ret.size.width = w; |
64 ret.size.height = h; | 65 ret.size.height = h; |
65 return ret; | 66 return ret; |
66 } | 67 } |
67 /** | 68 /** |
68 * @} | 69 * @} |
69 */ | 70 */ |
70 #endif /* PPAPI_C_PP_RECT_H_ */ | 71 #endif /* PPAPI_C_PP_RECT_H_ */ |
71 | 72 |
OLD | NEW |