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
/* automatically generated by rust-bindgen 0.69.4 */
#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
use crate::drawing::types::*;
impl OH_Drawing_PenLineCapStyle {
/// There is no cap style. Both ends of the line segment are cut off square.
pub const LINE_FLAT_CAP: OH_Drawing_PenLineCapStyle = OH_Drawing_PenLineCapStyle(0);
}
impl OH_Drawing_PenLineCapStyle {
/** Square cap style. Both ends have a square, the height of which
is half of the width of the line segment, with the same width.*/
pub const LINE_SQUARE_CAP: OH_Drawing_PenLineCapStyle = OH_Drawing_PenLineCapStyle(1);
}
impl OH_Drawing_PenLineCapStyle {
/** Round cap style. Both ends have a semicircle centered, the diameter of which
is the same as the width of the line segment.*/
pub const LINE_ROUND_CAP: OH_Drawing_PenLineCapStyle = OH_Drawing_PenLineCapStyle(2);
}
#[repr(transparent)]
/** @brief Enumerates line cap styles of a pen. The line cap style defines
the style of both ends of a line segment drawn by the pen.
@since 8
@version 1.0*/
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct OH_Drawing_PenLineCapStyle(pub ::core::ffi::c_uint);
impl OH_Drawing_PenLineJoinStyle {
/** Mitered corner. If the angle of a polyline is small, its miter length may be inappropriate.
In this case, you need to use the miter limit to limit the miter length.*/
pub const LINE_MITER_JOIN: OH_Drawing_PenLineJoinStyle = OH_Drawing_PenLineJoinStyle(0);
}
impl OH_Drawing_PenLineJoinStyle {
/// Round corner.
pub const LINE_ROUND_JOIN: OH_Drawing_PenLineJoinStyle = OH_Drawing_PenLineJoinStyle(1);
}
impl OH_Drawing_PenLineJoinStyle {
/// Beveled corner.
pub const LINE_BEVEL_JOIN: OH_Drawing_PenLineJoinStyle = OH_Drawing_PenLineJoinStyle(2);
}
#[repr(transparent)]
/** @brief Enumerates pen line join styles. The line join style defines
the shape of the joints of a polyline segment drawn by the pen.
@since 8
@version 1.0*/
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct OH_Drawing_PenLineJoinStyle(pub ::core::ffi::c_uint);
extern "C" {
/** @brief Creates an <b>OH_Drawing_Pen</b> object.
@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
@return Returns the pointer to the <b>OH_Drawing_Pen</b> object created.
@since 8
@version 1.0*/
pub fn OH_Drawing_PenCreate() -> *mut OH_Drawing_Pen;
/** @brief Destroys an <b>OH_Drawing_Pen</b> object and reclaims the memory occupied by the object.
@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
@param OH_Drawing_Pen Indicates the pointer to an <b>OH_Drawing_Pen</b> object.
@since 8
@version 1.0*/
pub fn OH_Drawing_PenDestroy(arg1: *mut OH_Drawing_Pen);
/** @brief Checks whether anti-aliasing is enabled for a pen. If anti-aliasing is enabled,
edges will be drawn with partial transparency.
@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
@param OH_Drawing_Pen Indicates the pointer to an <b>OH_Drawing_Pen</b> object.
@return Returns <b>true</b> if anti-aliasing is enabled; returns <b>false</b> otherwise.
@since 8
@version 1.0*/
pub fn OH_Drawing_PenIsAntiAlias(arg1: *const OH_Drawing_Pen) -> bool;
/** @brief Enables or disables anti-aliasing for a pen. If anti-aliasing is enabled,
edges will be drawn with partial transparency.
@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
@param OH_Drawing_Pen Indicates the pointer to an <b>OH_Drawing_Pen</b> object.
@param bool Specifies whether to enable anti-aliasing. The value <b>true</b> means
to enable anti-aliasing, and <b>false</b> means the opposite.
@since 8
@version 1.0*/
pub fn OH_Drawing_PenSetAntiAlias(arg1: *mut OH_Drawing_Pen, arg2: bool);
/** @brief Obtains the color of a pen. The color is used by the pen to outline a shape.
@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
@param OH_Drawing_Pen Indicates the pointer to an <b>OH_Drawing_Pen</b> object.
@return Returns a 32-bit (ARGB) variable that describes the color.
@since 8
@version 1.0*/
pub fn OH_Drawing_PenGetColor(arg1: *const OH_Drawing_Pen) -> u32;
/** @brief Sets the color for a pen. The color is used by the pen to outline a shape.
@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
@param OH_Drawing_Pen Indicates the pointer to an <b>OH_Drawing_Pen</b> object.
@param color Indicates the color to set, which is a 32-bit (ARGB) variable.
@since 8
@version 1.0*/
pub fn OH_Drawing_PenSetColor(arg1: *mut OH_Drawing_Pen, color: u32);
/** @brief Obtains the thickness of a pen. This thickness determines the width of the outline of a shape.
@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
@param OH_Drawing_Pen Indicates the pointer to an <b>OH_Drawing_Pen</b> object.
@return Returns the thickness.
@since 8
@version 1.0*/
pub fn OH_Drawing_PenGetWidth(arg1: *const OH_Drawing_Pen) -> f32;
/** @brief Sets the thickness for a pen. This thickness determines the width of the outline of a shape.
@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
@param OH_Drawing_Pen Indicates the pointer to an <b>OH_Drawing_Pen</b> object.
@param width Indicates the thickness to set, which is a variable.
@since 8
@version 1.0*/
pub fn OH_Drawing_PenSetWidth(arg1: *mut OH_Drawing_Pen, width: f32);
/** @brief Obtains the stroke miter limit of a polyline drawn by a pen.
When the corner type is bevel, a beveled corner is displayed if the miter limit is exceeded,
and a mitered corner is displayed if the miter limit is not exceeded.
@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
@param OH_Drawing_Pen Indicates the pointer to an <b>OH_Drawing_Pen</b> object.
@return Returns the miter limit.
@since 8
@version 1.0*/
pub fn OH_Drawing_PenGetMiterLimit(arg1: *const OH_Drawing_Pen) -> f32;
/** @brief Sets the stroke miter limit for a polyline drawn by a pen.
When the corner type is bevel, a beveled corner is displayed if the miter limit is exceeded,
and a mitered corner is displayed if the miter limit is not exceeded.
@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
@param OH_Drawing_Pen Indicates the pointer to an <b>OH_Drawing_Pen</b> object.
@param miter Indicates a variable that describes the miter limit.
@since 8
@version 1.0*/
pub fn OH_Drawing_PenSetMiterLimit(arg1: *mut OH_Drawing_Pen, miter: f32);
/** @brief Obtains the line cap style of a pen.
@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
@param OH_Drawing_Pen Indicates the pointer to an <b>OH_Drawing_Pen</b> object.
@return Returns the line cap style.
@since 8
@version 1.0*/
pub fn OH_Drawing_PenGetCap(arg1: *const OH_Drawing_Pen) -> OH_Drawing_PenLineCapStyle;
/** @brief Sets the line cap style for a pen.
@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
@param OH_Drawing_Pen Indicates the pointer to an <b>OH_Drawing_Pen</b> object.
@param OH_Drawing_PenLineCapStyle Indicates a variable that describes the line cap style.
@since 8
@version 1.0*/
pub fn OH_Drawing_PenSetCap(arg1: *mut OH_Drawing_Pen, arg2: OH_Drawing_PenLineCapStyle);
/** @brief Obtains the line join style of a pen.
@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
@param OH_Drawing_Pen Indicates the pointer to an <b>OH_Drawing_Pen</b> object.
@return Returns the line join style.
@since 8
@version 1.0*/
pub fn OH_Drawing_PenGetJoin(arg1: *const OH_Drawing_Pen) -> OH_Drawing_PenLineJoinStyle;
/** @brief Sets the line join style for a pen.
@syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
@param OH_Drawing_Pen Indicates the pointer to an <b>OH_Drawing_Pen</b> object.
@param OH_Drawing_PenLineJoinStyle Indicates a variable that describes the line join style.
@since 8
@version 1.0*/
pub fn OH_Drawing_PenSetJoin(arg1: *mut OH_Drawing_Pen, arg2: OH_Drawing_PenLineJoinStyle);
}