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 * Defines the API ... | 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 | |
23 /** | |
24 * The PP_Rect struct contains the size and location of a 2D rectangle. | |
25 */ | |
22 struct PP_Rect { | 26 struct PP_Rect { |
27 | |
28 /** This value represents the x and y coordinates of the rectangle. */ | |
dmichael(do not use this one)
2011/02/02 23:36:51
of the upper left corner of the rectangle.
jond
2011/02/03 17:28:11
Done.
| |
23 struct PP_Point point; | 29 struct PP_Point point; |
30 | |
31 /** This value represents the width and height of the rectangle. */ | |
24 struct PP_Size size; | 32 struct PP_Size size; |
25 }; | 33 }; |
26 PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_Rect, 16); | 34 PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_Rect, 16); |
27 /** | 35 /** |
28 * @} | 36 * @} |
29 */ | 37 */ |
30 | 38 |
31 /** | 39 /** |
32 * @addtogroup Functions | 40 * @addtogroup Functions |
33 * @{ | 41 * @{ |
34 */ | 42 */ |
43 | |
44 /** | |
45 * PP_MakeRectFromXYWH() places four 32 bit integers inside a PP_Rect | |
dmichael(do not use this one)
2011/02/02 23:36:51
wording more like 'creates a PP_Rect from ...'
jond
2011/02/03 17:28:11
Done.
| |
46 * structure. | |
47 * @param[in] x A 32 bit value representing a horizontal coordinate on the | |
dmichael(do not use this one)
2011/02/02 23:36:51
s/'A 32 bit'/'An int32_t'
jond
2011/02/03 17:28:11
Done.
| |
48 * screen. | |
49 * @param[in] y A 32 bit value representing a vertical coordinate on the | |
50 * screen. | |
51 * @param[in] w A 32 bit value representing a width. | |
52 * @param[in] h A 32 bit value representing a height. | |
53 * @return A PP_Rect structure. | |
54 */ | |
35 PP_INLINE struct PP_Rect PP_MakeRectFromXYWH(int32_t x, int32_t y, | 55 PP_INLINE struct PP_Rect PP_MakeRectFromXYWH(int32_t x, int32_t y, |
36 int32_t w, int32_t h) { | 56 int32_t w, int32_t h) { |
37 struct PP_Rect ret; | 57 struct PP_Rect ret; |
38 ret.point.x = x; | 58 ret.point.x = x; |
39 ret.point.y = y; | 59 ret.point.y = y; |
40 ret.size.width = w; | 60 ret.size.width = w; |
41 ret.size.height = h; | 61 ret.size.height = h; |
42 return ret; | 62 return ret; |
43 } | 63 } |
44 /** | 64 /** |
45 * @} | 65 * @} |
46 */ | 66 */ |
47 #endif /* PPAPI_C_PP_RECT_H_ */ | 67 #endif /* PPAPI_C_PP_RECT_H_ */ |
48 | 68 |
OLD | NEW |