1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
use crate::drawing::types::{
OH_Drawing_Bitmap, OH_Drawing_Canvas, OH_Drawing_Path, OH_Drawing_Point, OH_Drawing_Rect,
OH_Drawing_RoundRect, OH_Drawing_TextBlob,
};
extern "C" {
/** @brief Gets the number of the canvas status (canvas matrix) saved in the stack.
@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
@param OH_Drawing_Canvas Indicates the pointer to an <b>OH_Drawing_Canvas</b> object.
@return Returns a 32-bit variable that describes the number of canvas status.
@since 11
@version 1.0*/
pub fn OH_Drawing_CanvasGetSaveCount(arg1: *mut OH_Drawing_Canvas) -> u32;
/** @brief Restores the specific number of the canvas status (canvas matrix) saved in the stack.
@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
@param OH_Drawing_Canvas Indicates the pointer to an <b>OH_Drawing_Canvas</b> object.
@param saveCount Indicates the specific number of canvas status.
@since 11
@version 1.0*/
pub fn OH_Drawing_CanvasRestoreToCount(arg1: *mut OH_Drawing_Canvas, saveCount: u32);
}
extern "C" {
/** @brief Draws a bitmap.
@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
@param OH_Drawing_Canvas Indicates the pointer to an <b>OH_Drawing_Canvas</b> object.
@param OH_Drawing_Bitmap Indicates the pointer to an <b>OH_Drawing_Bitmap</b> object.
@param left Indicates the left position of the <b>OH_Drawing_Bitmap</b>.
@param top Indicates the top position of the <b>OH_Drawing_Bitmap</b>.
@since 11
@version 1.0*/
pub fn OH_Drawing_CanvasDrawBitmap(
arg1: *mut OH_Drawing_Canvas,
arg2: *const OH_Drawing_Bitmap,
left: f32,
top: f32,
);
/** @brief Draws a rect.
@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
@param OH_Drawing_Canvas Indicates the pointer to an <b>OH_Drawing_Canvas</b> object.
@param OH_Drawing_Rect Indicates the pointer to an <b>OH_Drawing_Rect</b> object.
@since 11
@version 1.0*/
pub fn OH_Drawing_CanvasDrawRect(arg1: *mut OH_Drawing_Canvas, arg2: *const OH_Drawing_Rect);
/** @brief Draws a circle.
@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
@param OH_Drawing_Canvas Indicates the pointer to an <b>OH_Drawing_Canvas</b> object.
@param OH_Drawing_Point Indicates the pointer to an <b>OH_Drawing_Point</b> object.
@param radius Indicates the radius of the circle.
@since 11
@version 1.0*/
pub fn OH_Drawing_CanvasDrawCircle(
arg1: *mut OH_Drawing_Canvas,
arg2: *const OH_Drawing_Point,
radius: f32,
);
/** @brief Draws an oval.
@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
@param OH_Drawing_Canvas Indicates the pointer to an <b>OH_Drawing_Canvas</b> object.
@param OH_Drawing_Rect Indicates the pointer to an <b>OH_Drawing_Rect</b> object.
@since 11
@version 1.0*/
pub fn OH_Drawing_CanvasDrawOval(arg1: *mut OH_Drawing_Canvas, arg2: *const OH_Drawing_Rect);
/** @brief Draws an arc.
@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
@param OH_Drawing_Canvas Indicates the pointer to an <b>OH_Drawing_Canvas</b> object.
@param OH_Drawing_Rect Indicates the pointer to an <b>OH_Drawing_Rect</b> object.
@param startAngle Indicates the startAngle of the arc.
@param sweepAngle Indicates the sweepAngle of the arc.
@since 11
@version 1.0*/
pub fn OH_Drawing_CanvasDrawArc(
arg1: *mut OH_Drawing_Canvas,
arg2: *const OH_Drawing_Rect,
startAngle: f32,
sweepAngle: f32,
);
/** @brief Draws a roundrect.
@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
@param OH_Drawing_Canvas Indicates the pointer to an <b>OH_Drawing_Canvas</b> object.
@param OH_Drawing_RoundRect Indicates the pointer to an <b>OH_Drawing_RoundRect</b> object.
@since 11
@version 1.0*/
pub fn OH_Drawing_CanvasDrawRoundRect(
arg1: *mut OH_Drawing_Canvas,
arg2: *const OH_Drawing_RoundRect,
);
/** @brief Draws a textblob.
@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
@param OH_Drawing_Canvas Indicates the pointer to an <b>OH_Drawing_Canvas</b> object.
@param OH_Drawing_TextBlob Indicates the pointer to an <b>OH_Drawing_TextBlob</b> object.
@param x Indicates the horizontal offset applied to blob.
@param y Indicates the vertical offset applied to blob.
@since 11
@version 1.0*/
pub fn OH_Drawing_CanvasDrawTextBlob(
arg1: *mut OH_Drawing_Canvas,
arg2: *const OH_Drawing_TextBlob,
x: f32,
y: f32,
);
}
impl OH_Drawing_CanvasClipOp {
/// Clip with difference.
pub const DIFFERENCE: OH_Drawing_CanvasClipOp = OH_Drawing_CanvasClipOp(0);
}
impl OH_Drawing_CanvasClipOp {
/// Clip with intersection.
pub const INTERSECT: OH_Drawing_CanvasClipOp = OH_Drawing_CanvasClipOp(1);
}
#[repr(transparent)]
/** @brief Enumerates clip op.
@since 11
@version 1.0*/
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct OH_Drawing_CanvasClipOp(pub ::core::ffi::c_uint);
extern "C" {
/** @brief Clip a rect.
@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
@param OH_Drawing_Canvas Indicates the pointer to an <b>OH_Drawing_Canvas</b> object.
@param OH_Drawing_Rect Indicates the pointer to an <b>OH_Drawing_Rect</b> object.
@param clipOp Indicates the operation to apply to clip.
@param doAntiAlias Indicates whether clip operation requires anti-aliased.
@since 11
@version 1.0*/
pub fn OH_Drawing_CanvasClipRect(
arg1: *mut OH_Drawing_Canvas,
arg2: *const OH_Drawing_Rect,
clipOp: OH_Drawing_CanvasClipOp,
doAntiAlias: bool,
);
/** @brief Clip a path.
@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
@param OH_Drawing_Canvas Indicates the pointer to an <b>OH_Drawing_Canvas</b> object.
@param OH_Drawing_Path Indicates the pointer to an <b>OH_Drawing_Path</b> object.
@param clipOp Indicates the operation to apply to clip.
@param doAntiAlias Indicates whether clip operation requires anti-aliased.
@since 11
@version 1.0*/
pub fn OH_Drawing_CanvasClipPath(
arg1: *mut OH_Drawing_Canvas,
arg2: *const OH_Drawing_Path,
clipOp: OH_Drawing_CanvasClipOp,
doAntiAlias: bool,
);
/** @brief Rotates by degrees. Positive degrees rotates clockwise.
@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
@param OH_Drawing_Canvas Indicates the pointer to an <b>OH_Drawing_Canvas</b> object.
@param degrees Indicates the amount to rotate, in degrees.
@param px Indicates the x-axis value of the point to rotate about.
@param py Indicates the y-axis value of the point to rotate about.
@since 11
@version 1.0*/
pub fn OH_Drawing_CanvasRotate(arg1: *mut OH_Drawing_Canvas, degrees: f32, px: f32, py: f32);
/** @brief Translates by dx along the x-axis and dy along the y-axis.
@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
@param OH_Drawing_Canvas Indicates the pointer to an <b>OH_Drawing_Canvas</b> object.
@param dx Indicates the distance to translate on x-axis.
@param dy Indicates the distance to translate on y-axis.
@since 11
@version 1.0*/
pub fn OH_Drawing_CanvasTranslate(arg1: *mut OH_Drawing_Canvas, dx: f32, dy: f32);
/** @brief Scales by sx on the x-axis and sy on the y-axis.
@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
@param OH_Drawing_Canvas Indicates the pointer to an <b>OH_Drawing_Canvas</b> object.
@param sx Indicates the amount to scale on x-axis.
@param sy Indicates the amount to scale on y-axis.
@since 11
@version 1.0*/
pub fn OH_Drawing_CanvasScale(arg1: *mut OH_Drawing_Canvas, sx: f32, sy: f32);
}