ohos_drawing_sys/path_effect/path_effect_ffi.rs
1// automatically generated by rust-bindgen 0.71.1
2
3#![allow(non_upper_case_globals)]
4#![allow(non_camel_case_types)]
5#![allow(non_snake_case)]
6use crate::types::*;
7
8#[cfg(feature = "api-18")]
9#[cfg_attr(docsrs, doc(cfg(feature = "api-18")))]
10impl OH_Drawing_PathDashStyle {
11 /// Indicates translation effect.
12 pub const DRAWING_PATH_DASH_STYLE_TRANSLATE: OH_Drawing_PathDashStyle =
13 OH_Drawing_PathDashStyle(0);
14 /// Indicates rotation effect.
15 pub const DRAWING_PATH_DASH_STYLE_ROTATE: OH_Drawing_PathDashStyle =
16 OH_Drawing_PathDashStyle(1);
17 /// Indicates morph effect.
18 pub const DRAWING_PATH_DASH_STYLE_MORPH: OH_Drawing_PathDashStyle = OH_Drawing_PathDashStyle(2);
19}
20#[repr(transparent)]
21/// Enumerate path dash style.
22///
23///
24/// Available since API-level: 18
25///
26/// Version: 1.0
27#[cfg(feature = "api-18")]
28#[cfg_attr(docsrs, doc(cfg(feature = "api-18")))]
29#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
30pub struct OH_Drawing_PathDashStyle(pub ::core::ffi::c_uint);
31extern "C" {
32 /// Creates an <b>OH_Drawing_PathEffect</b> object that is a combination of paths,
33 /// applying the inner path effect first and then the outer path effect.
34 ///
35 ///
36 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
37 /// # Arguments
38 ///
39 /// * `outer` - Indicates an <b>OH_Drawing_PathEffect</b> object
40 ///
41 /// * `inner` - Indicates an <b>OH_Drawing_PathEffect</b> object
42 ///
43 /// # Returns
44 ///
45 /// * Returns the pointer to the <b>OH_Drawing_PathEffect</b> object created.
46 ///
47 /// Available since API-level: 18
48 ///
49 /// Version: 1.0
50 #[cfg(feature = "api-18")]
51 #[cfg_attr(docsrs, doc(cfg(feature = "api-18")))]
52 pub fn OH_Drawing_CreateComposePathEffect(
53 outer: *mut OH_Drawing_PathEffect,
54 inner: *mut OH_Drawing_PathEffect,
55 ) -> *mut OH_Drawing_PathEffect;
56 /// Creates an <b>OH_Drawing_PathEffect</b> object
57 /// that turns the included angle of the path into a fillet of a specified radius.
58 ///
59 ///
60 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
61 /// # Arguments
62 ///
63 /// * `radius` - Indicates the degree of curvature of the arc, the radius must be greater than zero.
64 ///
65 /// # Returns
66 ///
67 /// * Returns the pointer to the <b>OH_Drawing_PathEffect</b> object created.
68 /// If nullptr is returned, the creation fails.
69 /// The possible cause of the failure is radius is zero or less.
70 ///
71 /// Available since API-level: 18
72 ///
73 /// Version: 1.0
74 #[cfg(feature = "api-18")]
75 #[cfg_attr(docsrs, doc(cfg(feature = "api-18")))]
76 pub fn OH_Drawing_CreateCornerPathEffect(radius: f32) -> *mut OH_Drawing_PathEffect;
77 /// Creates an <b>OH_Drawing_PathEffect</b> object.
78 ///
79 ///
80 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
81 /// # Arguments
82 ///
83 /// * `intervals` - Indicates a array which contain an even number of entries.
84 ///
85 /// * `count` - Indicates the number of elements of the intervals array.
86 ///
87 /// * `phase` - Indicates the offset into intervals array.
88 ///
89 /// # Returns
90 ///
91 /// * Returns the pointer to the <b>OH_Drawing_PathEffect</b> object created.
92 ///
93 /// Available since API-level: 12
94 ///
95 /// Version: 1.0
96 #[cfg(feature = "api-12")]
97 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
98 pub fn OH_Drawing_CreateDashPathEffect(
99 intervals: *mut f32,
100 count: ::core::ffi::c_int,
101 phase: f32,
102 ) -> *mut OH_Drawing_PathEffect;
103 /// Creates an <b>OH_Drawing_PathEffect</b> object
104 /// that breaks the path and creates an irregular distribution on the path.
105 ///
106 ///
107 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
108 /// # Arguments
109 ///
110 /// * `segLength` - Indicates the maximum segment length of the path.
111 ///
112 /// * `deviation` - Indicates the deviation during drawing.
113 ///
114 /// # Returns
115 ///
116 /// * Returns the pointer to the <b>OH_Drawing_PathEffect</b> object created.
117 ///
118 /// Available since API-level: 18
119 ///
120 /// Version: 1.0
121 #[cfg(feature = "api-18")]
122 #[cfg_attr(docsrs, doc(cfg(feature = "api-18")))]
123 pub fn OH_Drawing_CreateDiscretePathEffect(
124 segLength: f32,
125 deviation: f32,
126 ) -> *mut OH_Drawing_PathEffect;
127 /// Creates an <b>OH_Drawing_PathEffect</b> object and sets the path effect to a dash effect.
128 ///
129 ///
130 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
131 /// # Arguments
132 ///
133 /// * `path` - Indicates the pointer to an <b>OH_Drawing_Path</b> object.
134 ///
135 /// * `advance` - Indicates the distance between the dashed segments.
136 ///
137 /// * `phase` - Indicates the offset into intervals array.
138 ///
139 /// * `type` - Indicates the type of the path dash effect.
140 ///
141 /// # Returns
142 ///
143 /// * Returns the pointer to the <b>OH_Drawing_PathEffect</b> object created.
144 /// If nullptr is returned, the creation fails.
145 /// The possible cause of the failure is advance and phase are zero or less.
146 ///
147 /// Available since API-level: 18
148 ///
149 /// Version: 1.0
150 #[cfg(feature = "api-18")]
151 #[cfg_attr(docsrs, doc(cfg(feature = "api-18")))]
152 pub fn OH_Drawing_CreatePathDashEffect(
153 path: *const OH_Drawing_Path,
154 advance: f32,
155 phase: f32,
156 type_: OH_Drawing_PathDashStyle,
157 ) -> *mut OH_Drawing_PathEffect;
158 /// Creates an <b>OH_Drawing_PathEffect</b> object by overlaying two path effects.
159 ///
160 ///
161 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
162 /// # Arguments
163 ///
164 /// * `firstPathEffect` - Indicates the pointer to an <b>OH_Drawing_PathEffect</b> object.
165 ///
166 /// * `secondPathEffect` - Indicates the pointer to an <b>OH_Drawing_PathEffect</b> object.
167 ///
168 /// # Returns
169 ///
170 /// * Returns the pointer to the <b>OH_Drawing_PathEffect</b> object created.
171 ///
172 /// Available since API-level: 18
173 ///
174 /// Version: 1.0
175 #[cfg(feature = "api-18")]
176 #[cfg_attr(docsrs, doc(cfg(feature = "api-18")))]
177 pub fn OH_Drawing_CreateSumPathEffect(
178 firstPathEffect: *mut OH_Drawing_PathEffect,
179 secondPathEffect: *mut OH_Drawing_PathEffect,
180 ) -> *mut OH_Drawing_PathEffect;
181 /// Destroys an <b>OH_Drawing_PathEffect</b> object and reclaims the memory occupied by the object.
182 ///
183 ///
184 /// Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeDrawing
185 /// # Arguments
186 ///
187 /// * `pathEffect` - Indicates the pointer to an <b>OH_Drawing_PathEffect</b> object.
188 ///
189 /// Available since API-level: 12
190 ///
191 /// Version: 1.0
192 #[cfg(feature = "api-12")]
193 #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))]
194 pub fn OH_Drawing_PathEffectDestroy(pathEffect: *mut OH_Drawing_PathEffect);
195}