Pepper_47_C_interfaces
Main Page
Modules
Classes
Files
File List
File Members
pp_rect.h
Go to the documentation of this file.
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_rect.idl modified Thu Oct 20 13:57:04 2016. */
7
8
#ifndef PPAPI_C_PP_RECT_H_
9
#define PPAPI_C_PP_RECT_H_
10
11
#include "
ppapi/c/pp_macros.h
"
12
#include "
ppapi/c/pp_point.h
"
13
#include "
ppapi/c/pp_size.h
"
14
#include "
ppapi/c/pp_stdint.h
"
15
16
/**
17
* @file
18
* This file defines the APIs for creating a 2 dimensional rectangle.
19
*/
20
21
22
/**
23
* @addtogroup Structs
24
* @{
25
*/
26
/**
27
* The <code>PP_Rect</code> struct contains the size and location of a 2D
28
* rectangle.
29
*/
30
struct
PP_Rect
{
31
/**
32
* This value represents the x and y coordinates of the upper-left corner of
33
* the rectangle.
34
*/
35
struct
PP_Point
point
;
36
/** This value represents the width and height of the rectangle. */
37
struct
PP_Size
size
;
38
};
39
PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES
(
PP_Rect
, 16);
40
41
/**
42
* The <code>PP_FloatRect</code> struct contains the size and location of a 2D
43
* rectangle.
44
*/
45
struct
PP_FloatRect
{
46
/**
47
* This value represents the x and y coordinates of the upper-left corner of
48
* the rectangle.
49
*/
50
struct
PP_FloatPoint
point
;
51
/** This value represents the width and height of the rectangle. */
52
struct
PP_FloatSize
size
;
53
};
54
/**
55
* @}
56
*/
57
58
59
/**
60
* @addtogroup Functions
61
* @{
62
*/
63
64
/**
65
* PP_MakeRectFromXYWH() creates a <code>PP_Rect</code> given x and y
66
* coordinates and width and height dimensions as int32_t values.
67
*
68
* @param[in] x An int32_t value representing a horizontal coordinate of a
69
* point, starting with 0 as the left-most coordinate.
70
* @param[in] y An int32_t value representing a vertical coordinate of a point,
71
* starting with 0 as the top-most coordinate.
72
* @param[in] w An int32_t value representing a width.
73
* @param[in] h An int32_t value representing a height.
74
*
75
* @return A <code>PP_Rect</code> structure.
76
*/
77
PP_INLINE
struct
PP_Rect
PP_MakeRectFromXYWH
(int32_t x, int32_t y,
78
int32_t w, int32_t h) {
79
struct
PP_Rect
ret;
80
ret.
point
.
x
= x;
81
ret.
point
.
y
= y;
82
ret.
size
.
width
= w;
83
ret.
size
.
height
= h;
84
return
ret;
85
}
86
87
/**
88
* PP_MakeFloatRectFromXYWH() creates a <code>PP_FloatRect</code> given x and y
89
* coordinates and width and height dimensions as float values.
90
*
91
* @param[in] x An float value representing a horizontal coordinate of a
92
* point, starting with 0 as the left-most coordinate.
93
* @param[in] y An float value representing a vertical coordinate of a point,
94
* starting with 0 as the top-most coordinate.
95
* @param[in] w An float value representing a width.
96
* @param[in] h An float value representing a height.
97
*
98
* @return A <code>PP_FloatRect</code> structure.
99
*/
100
PP_INLINE
struct
PP_FloatRect
PP_MakeFloatRectFromXYWH
(float x, float y,
101
float w, float h) {
102
struct
PP_FloatRect
ret;
103
ret.
point
.
x
= x;
104
ret.
point
.
y
= y;
105
ret.
size
.
width
= w;
106
ret.
size
.
height
= h;
107
return
ret;
108
}
109
110
/**
111
* @}
112
*/
113
114
#endif
/* PPAPI_C_PP_RECT_H_ */
115
PP_MakeRectFromXYWH
PP_INLINE struct PP_Rect PP_MakeRectFromXYWH(int32_t x, int32_t y, int32_t w, int32_t h)
Definition:
pp_rect.h:77
pp_macros.h
PP_INLINE
#define PP_INLINE
Definition:
pp_macros.h:46
PP_FloatSize::width
float width
Definition:
pp_size.h:40
PP_Point::y
int32_t y
Definition:
pp_point.h:38
PP_FloatPoint
Definition:
pp_point.h:46
PP_FloatRect::point
struct PP_FloatPoint point
Definition:
pp_rect.h:50
pp_point.h
PP_FloatSize
Definition:
pp_size.h:38
pp_size.h
PP_Rect::point
struct PP_Point point
Definition:
pp_rect.h:35
PP_Size::height
int32_t height
Definition:
pp_size.h:31
PP_MakeFloatRectFromXYWH
PP_INLINE struct PP_FloatRect PP_MakeFloatRectFromXYWH(float x, float y, float w, float h)
Definition:
pp_rect.h:100
PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES
PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_Rect, 16)
PP_Point
Definition:
pp_point.h:28
PP_Rect::size
struct PP_Size size
Definition:
pp_rect.h:37
PP_Rect
Definition:
pp_rect.h:30
PP_FloatRect::size
struct PP_FloatSize size
Definition:
pp_rect.h:52
PP_FloatRect
Definition:
pp_rect.h:45
PP_FloatPoint::x
float x
Definition:
pp_point.h:47
PP_FloatPoint::y
float y
Definition:
pp_point.h:48
pp_stdint.h
PP_FloatSize::height
float height
Definition:
pp_size.h:42
PP_Size::width
int32_t width
Definition:
pp_size.h:29
PP_Point::x
int32_t x
Definition:
pp_point.h:33
PP_Size
Definition:
pp_size.h:27
Generated on Wed Apr 5 2017 11:09:16 for Pepper_47_C_interfaces by
1.8.6