1#![allow(non_snake_case)]
4#![allow(non_upper_case_globals)]
5#![allow(non_camel_case_types)]
6#![allow(clippy::missing_safety_doc)]
7#![allow(clippy::useless_transmute)]
9#![allow(clippy::unnecessary_cast)]
10
11#[allow(unused_imports)]
12use ohos_image_native_sys::*;
13use ohos_image_sys::*;
14
15#[link(name = "native_drawing")]
16unsafe extern "C" {}
17
18#[repr(C)]
19#[derive(Debug, Copy, Clone)]
20pub struct OH_Drawing_Canvas {
21 _unused: [u8; 0],
22}
23#[repr(C)]
24#[derive(Debug, Copy, Clone)]
25pub struct OH_Drawing_Pen {
26 _unused: [u8; 0],
27}
28#[repr(C)]
29#[derive(Debug, Copy, Clone)]
30pub struct OH_Drawing_Region {
31 _unused: [u8; 0],
32}
33#[repr(C)]
34#[derive(Debug, Copy, Clone)]
35pub struct OH_Drawing_Brush {
36 _unused: [u8; 0],
37}
38#[repr(C)]
39#[derive(Debug, Copy, Clone)]
40pub struct OH_Drawing_Path {
41 _unused: [u8; 0],
42}
43#[cfg(feature = "api-23")]
44#[repr(C)]
45#[derive(Debug, Copy, Clone)]
46pub struct OH_Drawing_PathIterator {
47 _unused: [u8; 0],
48}
49#[cfg(feature = "api-23")]
50#[repr(C)]
51#[derive(Debug, Copy, Clone)]
52pub struct OH_Drawing_Lattice {
53 _unused: [u8; 0],
54}
55#[repr(C)]
56#[derive(Debug, Copy, Clone)]
57pub struct OH_Drawing_Bitmap {
58 _unused: [u8; 0],
59}
60#[repr(C)]
61#[derive(Debug, Copy, Clone)]
62pub struct OH_Drawing_Point {
63 _unused: [u8; 0],
64}
65#[repr(C)]
66#[derive(Debug, Copy, Clone)]
67pub struct OH_Drawing_PixelMap {
68 _unused: [u8; 0],
69}
70#[repr(C)]
71#[derive(Debug, Copy, Clone)]
72pub struct OH_Drawing_ColorSpace {
73 _unused: [u8; 0],
74}
75#[doc = " @brief **OH_Drawing_Point2D** defines a two-dimensional coordinate point.<br>**OH_Drawing_Corner_Radii** defines\n rounded corner radii, consisting of an x-axis radius and a y-axis radius.\n\n @since 12\n @version 1.0"]
76#[repr(C)]
77#[derive(Debug, Copy, Clone)]
78pub struct OH_Drawing_Point2D {
79 pub x: f32,
80 pub y: f32,
81}
82#[doc = " @brief Defines corner radii, which is on x-axis and y-axis.\n\n @since 12\n @version 1.0"]
83pub type OH_Drawing_Corner_Radii = OH_Drawing_Point2D;
84#[doc = " @brief This struct describes a three-dimensional coordinate point.\n\n @since 12\n @version 1.0"]
85#[repr(C)]
86#[derive(Debug, Copy, Clone)]
87pub struct OH_Drawing_Point3D {
88 pub x: f32,
89 pub y: f32,
90 pub z: f32,
91}
92#[repr(C)]
93#[derive(Debug, Copy, Clone)]
94pub struct OH_Drawing_PathEffect {
95 _unused: [u8; 0],
96}
97#[repr(C)]
98#[derive(Debug, Copy, Clone)]
99pub struct OH_Drawing_Rect {
100 _unused: [u8; 0],
101}
102#[repr(C)]
103#[derive(Debug, Copy, Clone)]
104pub struct OH_Drawing_RoundRect {
105 _unused: [u8; 0],
106}
107#[repr(C)]
108#[derive(Debug, Copy, Clone)]
109pub struct OH_Drawing_Matrix {
110 _unused: [u8; 0],
111}
112#[repr(C)]
113#[derive(Debug, Copy, Clone)]
114pub struct OH_Drawing_ShaderEffect {
115 _unused: [u8; 0],
116}
117#[repr(C)]
118#[derive(Debug, Copy, Clone)]
119pub struct OH_Drawing_ShadowLayer {
120 _unused: [u8; 0],
121}
122#[repr(C)]
123#[derive(Debug, Copy, Clone)]
124pub struct OH_Drawing_Filter {
125 _unused: [u8; 0],
126}
127#[repr(C)]
128#[derive(Debug, Copy, Clone)]
129pub struct OH_Drawing_MaskFilter {
130 _unused: [u8; 0],
131}
132#[repr(C)]
133#[derive(Debug, Copy, Clone)]
134pub struct OH_Drawing_ColorFilter {
135 _unused: [u8; 0],
136}
137#[repr(C)]
138#[derive(Debug, Copy, Clone)]
139pub struct OH_Drawing_Font {
140 _unused: [u8; 0],
141}
142#[cfg(feature = "api-20")]
143#[repr(C)]
144#[derive(Debug, Copy, Clone)]
145pub struct OH_Drawing_FontFeatures {
146 _unused: [u8; 0],
147}
148#[repr(C)]
149#[derive(Debug, Copy, Clone)]
150pub struct OH_Drawing_MemoryStream {
151 _unused: [u8; 0],
152}
153#[cfg(feature = "api-13")]
154#[repr(C)]
155#[derive(Debug, Copy, Clone)]
156pub struct OH_Drawing_FontArguments {
157 _unused: [u8; 0],
158}
159#[repr(C)]
160#[derive(Debug, Copy, Clone)]
161pub struct OH_Drawing_Typeface {
162 _unused: [u8; 0],
163}
164#[repr(C)]
165#[derive(Debug, Copy, Clone)]
166pub struct OH_Drawing_TextBlob {
167 _unused: [u8; 0],
168}
169#[repr(C)]
170#[derive(Debug, Copy, Clone)]
171pub struct OH_Drawing_Image {
172 _unused: [u8; 0],
173}
174#[repr(C)]
175#[derive(Debug, Copy, Clone)]
176pub struct OH_Drawing_ImageFilter {
177 _unused: [u8; 0],
178}
179#[repr(C)]
180#[derive(Debug, Copy, Clone)]
181pub struct OH_Drawing_SamplingOptions {
182 _unused: [u8; 0],
183}
184#[repr(C)]
185#[derive(Debug, Copy, Clone)]
186pub struct OH_Drawing_TextBlobBuilder {
187 _unused: [u8; 0],
188}
189#[repr(C)]
190#[derive(Debug, Copy, Clone)]
191pub struct OH_Drawing_GpuContext {
192 _unused: [u8; 0],
193}
194#[repr(C)]
195#[derive(Debug, Copy, Clone)]
196pub struct OH_Drawing_Surface {
197 _unused: [u8; 0],
198}
199#[doc = " Unknown format.\n\n @since 8"]
200pub const OH_Drawing_ColorFormat_COLOR_FORMAT_UNKNOWN: OH_Drawing_ColorFormat = 0;
201#[doc = " Each pixel is represented by 8 bits, which together indicate alpha.\n\n @since 8"]
202pub const OH_Drawing_ColorFormat_COLOR_FORMAT_ALPHA_8: OH_Drawing_ColorFormat = 1;
203#[doc = " Each pixel is represented by 16 bits. From the most significant bit to the least significant bit, the first 5\n bits indicate red, the subsequent 6 bits indicate green, and the last 5 bits indicate blue.\n\n @since 8"]
204pub const OH_Drawing_ColorFormat_COLOR_FORMAT_RGB_565: OH_Drawing_ColorFormat = 2;
205#[doc = " Each pixel is represented by 16 bits. From the most significant bit to the least significant bit, every 4 bits\n indicate alpha, red, green, and blue, respectively.\n\n @since 8"]
206pub const OH_Drawing_ColorFormat_COLOR_FORMAT_ARGB_4444: OH_Drawing_ColorFormat = 3;
207#[doc = " Each pixel is represented by 32 bits. From the most significant bit to the least significant bit, every 8 bits\n indicate alpha, red, green, and blue, respectively.\n\n @since 8"]
208pub const OH_Drawing_ColorFormat_COLOR_FORMAT_RGBA_8888: OH_Drawing_ColorFormat = 4;
209#[doc = " Each pixel is represented by 32 bits. From the most significant bit to the least significant bit, every 8 bits\n indicate blue, green, red, and alpha, respectively.\n\n @since 8"]
210pub const OH_Drawing_ColorFormat_COLOR_FORMAT_BGRA_8888: OH_Drawing_ColorFormat = 5;
211#[doc = " @brief Defines an enum for the storage formats of bitmap pixels.\n\n @since 8\n @version 1.0"]
212pub type OH_Drawing_ColorFormat = u32;
213#[doc = " Unknown format.\n\n @since 8"]
214pub const OH_Drawing_AlphaFormat_ALPHA_FORMAT_UNKNOWN: OH_Drawing_AlphaFormat = 0;
215#[doc = " The bitmap does not have the alpha component.\n\n @since 8"]
216pub const OH_Drawing_AlphaFormat_ALPHA_FORMAT_OPAQUE: OH_Drawing_AlphaFormat = 1;
217#[doc = " The color component of each pixel is premultiplied by the alpha component.\n\n @since 8"]
218pub const OH_Drawing_AlphaFormat_ALPHA_FORMAT_PREMUL: OH_Drawing_AlphaFormat = 2;
219#[doc = " The color component of each pixel is not premultiplied by the alpha component.\n\n @since 8"]
220pub const OH_Drawing_AlphaFormat_ALPHA_FORMAT_UNPREMUL: OH_Drawing_AlphaFormat = 3;
221#[doc = " @brief Defines an enum for the alpha formats of bitmap pixels.\n\n @since 8\n @version 1.0"]
222pub type OH_Drawing_AlphaFormat = u32;
223#[doc = " Clear mode. r = 0.\n\n @since 11"]
224pub const OH_Drawing_BlendMode_BLEND_MODE_CLEAR: OH_Drawing_BlendMode = 0;
225#[doc = " r = s (The four channels of **result** are equal to the four channels of **source**, that is, the result is\n equal to the source.)\n\n @since 11"]
226pub const OH_Drawing_BlendMode_BLEND_MODE_SRC: OH_Drawing_BlendMode = 1;
227#[doc = " r = d (The four channels of **result** are equal to the four channels of **destination**, that is, the result is\n equal to the destination.)\n\n @since 11"]
228pub const OH_Drawing_BlendMode_BLEND_MODE_DST: OH_Drawing_BlendMode = 2;
229#[doc = " r = s + (1 - sa) * d.\n\n @since 11"]
230pub const OH_Drawing_BlendMode_BLEND_MODE_SRC_OVER: OH_Drawing_BlendMode = 3;
231#[doc = " r = d + (1 - da) * s.\n\n @since 11"]
232pub const OH_Drawing_BlendMode_BLEND_MODE_DST_OVER: OH_Drawing_BlendMode = 4;
233#[doc = " r = s * da.\n\n @since 11"]
234pub const OH_Drawing_BlendMode_BLEND_MODE_SRC_IN: OH_Drawing_BlendMode = 5;
235#[doc = " r = d * sa.\n\n @since 11"]
236pub const OH_Drawing_BlendMode_BLEND_MODE_DST_IN: OH_Drawing_BlendMode = 6;
237#[doc = " r = s * (1 - da).\n\n @since 11"]
238pub const OH_Drawing_BlendMode_BLEND_MODE_SRC_OUT: OH_Drawing_BlendMode = 7;
239#[doc = " r = d * (1 - sa).\n\n @since 11"]
240pub const OH_Drawing_BlendMode_BLEND_MODE_DST_OUT: OH_Drawing_BlendMode = 8;
241#[doc = " r = s * da + d * (1 - sa).\n\n @since 11"]
242pub const OH_Drawing_BlendMode_BLEND_MODE_SRC_ATOP: OH_Drawing_BlendMode = 9;
243#[doc = " r = d * sa + s * (1 - da).\n\n @since 11"]
244pub const OH_Drawing_BlendMode_BLEND_MODE_DST_ATOP: OH_Drawing_BlendMode = 10;
245#[doc = " r = s * (1 - da) + d * (1 - sa).\n\n @since 11"]
246pub const OH_Drawing_BlendMode_BLEND_MODE_XOR: OH_Drawing_BlendMode = 11;
247#[doc = " r = min(s + d, 1).\n\n @since 11"]
248pub const OH_Drawing_BlendMode_BLEND_MODE_PLUS: OH_Drawing_BlendMode = 12;
249#[doc = " r = s * d.\n\n @since 11"]
250pub const OH_Drawing_BlendMode_BLEND_MODE_MODULATE: OH_Drawing_BlendMode = 13;
251#[doc = " Screen mode. r = s + d - s * d.\n\n @since 11"]
252pub const OH_Drawing_BlendMode_BLEND_MODE_SCREEN: OH_Drawing_BlendMode = 14;
253#[doc = " Overlay mode.\n\n @since 11"]
254pub const OH_Drawing_BlendMode_BLEND_MODE_OVERLAY: OH_Drawing_BlendMode = 15;
255#[doc = " Darken mode. rc = s + d - max(s * da, d * sa), ra = s + (1 - sa) * d.\n\n @since 11"]
256pub const OH_Drawing_BlendMode_BLEND_MODE_DARKEN: OH_Drawing_BlendMode = 16;
257#[doc = " Lighten mode. rc = rc = s + d - min(s * da, d * sa), ra = s + (1 - sa) * d.\n\n @since 11"]
258pub const OH_Drawing_BlendMode_BLEND_MODE_LIGHTEN: OH_Drawing_BlendMode = 17;
259#[doc = " Color dodge mode.\n\n @since 11"]
260pub const OH_Drawing_BlendMode_BLEND_MODE_COLOR_DODGE: OH_Drawing_BlendMode = 18;
261#[doc = " Color burn mode.\n\n @since 11"]
262pub const OH_Drawing_BlendMode_BLEND_MODE_COLOR_BURN: OH_Drawing_BlendMode = 19;
263#[doc = " Hard light mode.\n\n @since 11"]
264pub const OH_Drawing_BlendMode_BLEND_MODE_HARD_LIGHT: OH_Drawing_BlendMode = 20;
265#[doc = " Soft light mode.\n\n @since 11"]
266pub const OH_Drawing_BlendMode_BLEND_MODE_SOFT_LIGHT: OH_Drawing_BlendMode = 21;
267#[doc = " Difference mode. rc = s + d - 2 * (min(s * da, d * sa)), ra = s + (1 - sa) * d.\n\n @since 11"]
268pub const OH_Drawing_BlendMode_BLEND_MODE_DIFFERENCE: OH_Drawing_BlendMode = 22;
269#[doc = " Exclusion mode. rc = s + d - two(s * d), ra = s + (1 - sa) * d.\n\n @since 11"]
270pub const OH_Drawing_BlendMode_BLEND_MODE_EXCLUSION: OH_Drawing_BlendMode = 23;
271#[doc = " Multiply mode. r = s * (1 - da) + d * (1 - sa) + s * d.\n\n @since 11"]
272pub const OH_Drawing_BlendMode_BLEND_MODE_MULTIPLY: OH_Drawing_BlendMode = 24;
273#[doc = " Hue mode.\n\n @since 11"]
274pub const OH_Drawing_BlendMode_BLEND_MODE_HUE: OH_Drawing_BlendMode = 25;
275#[doc = " Saturation mode.\n\n @since 11"]
276pub const OH_Drawing_BlendMode_BLEND_MODE_SATURATION: OH_Drawing_BlendMode = 26;
277#[doc = " Color mode.\n\n @since 11"]
278pub const OH_Drawing_BlendMode_BLEND_MODE_COLOR: OH_Drawing_BlendMode = 27;
279#[doc = " Luminosity mode.\n\n @since 11"]
280pub const OH_Drawing_BlendMode_BLEND_MODE_LUMINOSITY: OH_Drawing_BlendMode = 28;
281#[doc = " @brief Defines an enum for blend modes. In blend mode, each operation generates a new color from two colors (source\n color and destination color).\n These operations are the same for the red, green, and blue color channels (the alpha channel follows a different\n rule).\n For simplicity, the following description uses the alpha channel as an example rather than naming each channel\n individually. For brevity, the following abbreviations are used:\n **s**: source.\n **d**: destination.\n **sa**: source alpha.\n **da**: destination alpha.\n The following abbreviations are used in the calculation result:\n **r**: The calculation methods of the four channels are the same.\n **ra**: used when only the alpha channel is manipulated.\n **rc**: used when the other three color channels are manipulated.\n\n @since 11\n @version 1.0"]
282pub type OH_Drawing_BlendMode = u32;
283#[doc = " One byte used to indicate UTF-8 or ASCII characters.\n\n @since 12"]
284pub const OH_Drawing_TextEncoding_TEXT_ENCODING_UTF8: OH_Drawing_TextEncoding = 0;
285#[doc = " Two bytes used to indicate most Unicode characters.\n\n @since 12"]
286pub const OH_Drawing_TextEncoding_TEXT_ENCODING_UTF16: OH_Drawing_TextEncoding = 1;
287#[doc = " Four bytes used to indicate all Unicode characters.\n\n @since 12"]
288pub const OH_Drawing_TextEncoding_TEXT_ENCODING_UTF32: OH_Drawing_TextEncoding = 2;
289#[doc = " Two bytes used to indicate the glyph index.\n\n @since 12"]
290pub const OH_Drawing_TextEncoding_TEXT_ENCODING_GLYPH_ID: OH_Drawing_TextEncoding = 3;
291#[doc = " @brief Defines an enum for the text encoding types.\n\n @since 12\n @version 1.0"]
292pub type OH_Drawing_TextEncoding = u32;
293#[repr(C)]
294#[derive(Debug, Copy, Clone)]
295pub struct OH_Drawing_FontMgr {
296 _unused: [u8; 0],
297}
298#[repr(C)]
299#[derive(Debug, Copy, Clone)]
300pub struct OH_Drawing_FontStyleSet {
301 _unused: [u8; 0],
302}
303#[cfg(feature = "api-13")]
304#[repr(C)]
305#[derive(Debug, Copy, Clone)]
306pub struct OH_Drawing_RecordCmdUtils {
307 _unused: [u8; 0],
308}
309#[cfg(feature = "api-13")]
310#[repr(C)]
311#[derive(Debug, Copy, Clone)]
312pub struct OH_Drawing_RecordCmd {
313 _unused: [u8; 0],
314}
315#[cfg(feature = "api-14")]
316#[repr(C)]
317#[derive(Debug, Copy, Clone)]
318pub struct OH_Drawing_Array {
319 _unused: [u8; 0],
320}
321#[doc = " @brief This struct describes the style of a rectangle.\n\n @since 12\n @version 1.0"]
322#[repr(C)]
323#[derive(Debug, Copy, Clone)]
324pub struct OH_Drawing_RectStyle_Info {
325 #[doc = " Color of the rectangle.\n\n @since 12"]
326 pub color: u32,
327 #[doc = " Left top radius of the rectangle.\n\n @since 12"]
328 pub leftTopRadius: f64,
329 #[doc = " Right top radius of the rectangle.\n\n @since 12"]
330 pub rightTopRadius: f64,
331 #[doc = " Right bottom radius of the rectangle.\n\n @since 12"]
332 pub rightBottomRadius: f64,
333 #[doc = " Left bottom radius of the rectangle.\n\n @since 12"]
334 pub leftBottomRadius: f64,
335}
336#[doc = " @brief This struct describes the image information.\n\n @since 12\n @version 1.0"]
337#[repr(C)]
338#[derive(Debug, Copy, Clone)]
339pub struct OH_Drawing_Image_Info {
340 #[doc = " Width, in pixels.\n\n @since 12"]
341 pub width: i32,
342 #[doc = " Height, in pixels.\n\n @since 12"]
343 pub height: i32,
344 #[doc = " Color type.\n\n @since 12"]
345 pub colorType: OH_Drawing_ColorFormat,
346 #[doc = " Alpha type.\n\n @since 12"]
347 pub alphaType: OH_Drawing_AlphaFormat,
348}
349#[doc = " @brief This struct describes a string of characters encoded in UTF-16.\n\n @since 14\n @version 1.0"]
350#[cfg(feature = "api-14")]
351#[repr(C)]
352#[derive(Debug, Copy, Clone)]
353pub struct OH_Drawing_String {
354 #[doc = " Pointer to a byte array that stores characters in the UTF-16 encoding format.\n\n @since 14"]
355 pub strData: *mut u8,
356 #[doc = " Actual length of the string that **strData** points to, in bytes.\n\n @since 14"]
357 pub strLen: u32,
358}
359#[doc = " Operation successful.\n\n @since 12"]
360pub const OH_Drawing_ErrorCode_OH_DRAWING_SUCCESS: OH_Drawing_ErrorCode = 0;
361#[doc = " Permission denied.\n\n @since 12"]
362pub const OH_Drawing_ErrorCode_OH_DRAWING_ERROR_NO_PERMISSION: OH_Drawing_ErrorCode = 201;
363#[doc = " Invalid input parameter. For example, NULL is passed in.\n\n @since 12"]
364pub const OH_Drawing_ErrorCode_OH_DRAWING_ERROR_INVALID_PARAMETER: OH_Drawing_ErrorCode = 401;
365#[doc = " The input parameter is not in the valid range.\n\n @since 12"]
366pub const OH_Drawing_ErrorCode_OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE: OH_Drawing_ErrorCode =
367 26200001;
368#[doc = " Failed to allocate memory.\n\n @since 13"]
369#[cfg(feature = "api-13")]
370pub const OH_Drawing_ErrorCode_OH_DRAWING_ERROR_ALLOCATION_FAILED: OH_Drawing_ErrorCode = 26200002;
371#[doc = " No function matches the input attribute ID.\n\n @since 21"]
372#[cfg(feature = "api-21")]
373pub const OH_Drawing_ErrorCode_OH_DRAWING_ERROR_ATTRIBUTE_ID_MISMATCH: OH_Drawing_ErrorCode =
374 26200003;
375#[doc = " The input parameter is incorrect. For example, the pointer of the input parameter is null.\n\n @since 22"]
376#[cfg(feature = "api-22")]
377pub const OH_Drawing_ErrorCode_OH_DRAWING_ERROR_INCORRECT_PARAMETER: OH_Drawing_ErrorCode =
378 26200004;
379#[doc = " File not found. The specified file does not exist or the path is incorrect.\n\n @since 23"]
380#[cfg(feature = "api-23")]
381pub const OH_Drawing_ErrorCode_OH_DRAWING_ERROR_FILE_NOT_FOUND: OH_Drawing_ErrorCode = 26200005;
382#[doc = " Failed to open the file, which is caused by insufficient permissions or I/O issues.\n\n @since 23"]
383#[cfg(feature = "api-23")]
384pub const OH_Drawing_ErrorCode_OH_DRAWING_ERROR_OPEN_FILE_FAILED: OH_Drawing_ErrorCode = 26200006;
385#[doc = " Fails to seek the file. The system cannot reposition the file read pointer.\n\n @since 23"]
386#[cfg(feature = "api-23")]
387pub const OH_Drawing_ErrorCode_OH_DRAWING_ERROR_FILE_SEEK_FAILED: OH_Drawing_ErrorCode = 26200007;
388#[doc = " Failed to obtain the file size. The system cannot obtain the file size information.\n\n @since 23"]
389#[cfg(feature = "api-23")]
390pub const OH_Drawing_ErrorCode_OH_DRAWING_ERROR_GET_FILE_SIZE_FAILED: OH_Drawing_ErrorCode =
391 26200008;
392#[doc = " Failed to read the file. The file cannot be read completely or contains unreadable data.\n\n @since 23"]
393#[cfg(feature = "api-23")]
394pub const OH_Drawing_ErrorCode_OH_DRAWING_ERROR_READ_FILE_FAILED: OH_Drawing_ErrorCode = 26200009;
395#[doc = " Empty file. The specified font file is empty and does not contain valid data.\n\n @since 23"]
396#[cfg(feature = "api-23")]
397pub const OH_Drawing_ErrorCode_OH_DRAWING_ERROR_EMPTY_FILE: OH_Drawing_ErrorCode = 26200010;
398#[doc = " Corrupted file. The file content is invalid or corrupted, and cannot be parsed.\n\n @since 23"]
399#[cfg(feature = "api-23")]
400pub const OH_Drawing_ErrorCode_OH_DRAWING_ERROR_FILE_CORRUPTED: OH_Drawing_ErrorCode = 26200011;
401#[doc = " @brief Defines an enum for the error codes that may be generated by the module.\n\n @since 12"]
402pub type OH_Drawing_ErrorCode = u32;
403extern "C" {
404 #[doc = " @brief Obtains the error code of the module.\n\n @return Returns the error code.\n @since 12\n @version 1.0"]
405 pub fn OH_Drawing_ErrorCodeGet() -> OH_Drawing_ErrorCode;
406}
407extern "C" {
408 #[doc = " @brief Resets the error code of this module to **OH_DRAWING_SUCCESS**.\n When a function that does not return an error code fails, the error code obtained through\n {@link OH_Drawing_ErrorCodeGet} is reset to the corresponding error number. However, it is not reset to\n **OH_DRAWING_SUCCESS** for a successful operation. By calling this function, you can manually reset the\n error code to **OH_DRAWING_SUCCESS**, avoiding interference between different functions and simplifying the\n debugging process.\n\n @since 18\n @version 1.0"]
409 #[cfg(feature = "api-18")]
410 pub fn OH_Drawing_ErrorCodeReset();
411}
412#[doc = " @brief This struct describes the pixel format of a bitmap, including the color type and alpha type.\n\n @since 8\n @version 1.0"]
413#[repr(C)]
414#[derive(Debug, Copy, Clone)]
415pub struct OH_Drawing_BitmapFormat {
416 #[doc = " Storage format of bitmap pixels."]
417 pub colorFormat: OH_Drawing_ColorFormat,
418 #[doc = " Alpha format of bitmap pixels."]
419 pub alphaFormat: OH_Drawing_AlphaFormat,
420}
421extern "C" {
422 #[doc = " @brief Creates an **OH_Drawing_Bitmap** object.\n\n @return Returns the pointer to the **OH_Drawing_Bitmap** object created.\n @since 8\n @version 1.0"]
423 pub fn OH_Drawing_BitmapCreate() -> *mut OH_Drawing_Bitmap;
424}
425extern "C" {
426 #[doc = " @brief Destroys an **OH_Drawing_Bitmap** object and reclaims the memory occupied by the object.\n\n @param bitmap Pointer to an **OH_Drawing_Bitmap** object.\n @since 8\n @version 1.0"]
427 pub fn OH_Drawing_BitmapDestroy(bitmap: *mut OH_Drawing_Bitmap);
428}
429extern "C" {
430 #[doc = " @brief Creates an **OH_Drawing_Bitmap** object, with the address of the memory for storing the bitmap pixels set to\n the memory address that you applied for.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **imageInfo** or **pixels** is NULL or **rowBytes** is **0**, **OH_DRAWING_ERROR_INVALID_PARAMETER** is\n returned.\n\n @param imageInfo Pointer to an {@link OH_Drawing_Image_Info} object.\n @param pixels Pointer to the start address of the memory for storing the bitmap pixels. You need to apply for the\n memory and ensure its validity.\n @param rowBytes Number of bytes in each row of pixels. The value is invalid if it is less than or equal to 0.\n @return Returns a pointer to the {@link OH_Drawing_Bitmap} object created.\n @since 12\n @version 1.0"]
431 pub fn OH_Drawing_BitmapCreateFromPixels(
432 imageInfo: *mut OH_Drawing_Image_Info,
433 pixels: *mut ::std::os::raw::c_void,
434 rowBytes: u32,
435 ) -> *mut OH_Drawing_Bitmap;
436}
437extern "C" {
438 #[doc = " @brief Initializes the width and height of a bitmap and sets the pixel format for the bitmap.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **bitmap** or **bitmapFormat** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param bitmap Pointer to an **OH_Drawing_Bitmap** object.\n @param width Width of the bitmap to be initialized.\n @param height Height of the bitmap to be initialized.\n @param bitmapFormat Pointer to the pixel format of the bitmap to be initialized, including the pixel color type and\n alpha type.\n @since 8\n @version 1.0"]
439 pub fn OH_Drawing_BitmapBuild(
440 bitmap: *mut OH_Drawing_Bitmap,
441 width: u32,
442 height: u32,
443 bitmapFormat: *const OH_Drawing_BitmapFormat,
444 );
445}
446extern "C" {
447 #[doc = " @brief Obtains the width of a bitmap.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **bitmap** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param bitmap Pointer to an **OH_Drawing_Bitmap** object.\n @return Returns the width.\n @since 8\n @version 1.0"]
448 pub fn OH_Drawing_BitmapGetWidth(bitmap: *mut OH_Drawing_Bitmap) -> u32;
449}
450extern "C" {
451 #[doc = " @brief Obtains the height of a bitmap.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **bitmap** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param bitmap Pointer to an **OH_Drawing_Bitmap** object.\n @return Returns the height.\n @since 8\n @version 1.0"]
452 pub fn OH_Drawing_BitmapGetHeight(bitmap: *mut OH_Drawing_Bitmap) -> u32;
453}
454extern "C" {
455 #[doc = " @brief Obtains the pixel format of a bitmap.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **bitmap** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param bitmap Pointer to an **OH_Drawing_Bitmap** object.\n @return Returns the pixel format. For details about the supported formats, see {@link OH_Drawing_ColorFormat}.\n @since 12\n @version 1.0"]
456 pub fn OH_Drawing_BitmapGetColorFormat(
457 bitmap: *mut OH_Drawing_Bitmap,
458 ) -> OH_Drawing_ColorFormat;
459}
460extern "C" {
461 #[doc = " @brief Obtains the alpha component of a bitmap.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **bitmap** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param bitmap Pointer to an **OH_Drawing_Bitmap** object.\n @return Returns the alpha component. For details about the supported formats, see {@link OH_Drawing_AlphaFormat}.\n @since 12\n @version 1.0"]
462 pub fn OH_Drawing_BitmapGetAlphaFormat(
463 bitmap: *mut OH_Drawing_Bitmap,
464 ) -> OH_Drawing_AlphaFormat;
465}
466extern "C" {
467 #[doc = " @brief Obtains the pixel address of a bitmap. You can use this address to obtain the pixel data of the bitmap.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **bitmap** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param bitmap Pointer to an **OH_Drawing_Bitmap** object.\n @return Returns the pixel address.\n @since 8\n @version 1.0"]
468 pub fn OH_Drawing_BitmapGetPixels(
469 bitmap: *mut OH_Drawing_Bitmap,
470 ) -> *mut ::std::os::raw::c_void;
471}
472extern "C" {
473 #[doc = " @brief Obtains the image information of a bitmap.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **bitmap** or **imageInfo** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param bitmap Pointer to the {@link OH_Drawing_Bitmap} object.\n @param imageInfo Pointer to an {@link OH_Drawing_Image_Info} object.\n @since 12\n @version 1.0"]
474 pub fn OH_Drawing_BitmapGetImageInfo(
475 bitmap: *mut OH_Drawing_Bitmap,
476 imageInfo: *mut OH_Drawing_Image_Info,
477 );
478}
479extern "C" {
480 #[doc = " @brief Reads pixels of a rectangle in a bitmap to the specified buffer.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If any of **bitmap**, **dstInfo**, and **dstPixels** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param bitmap Pointer to the {@link OH_Drawing_Bitmap} object.\n @param dstInfo Pointer to an {@link OH_Drawing_Image_Info} object.\n @param dstPixels Pointer to the buffer for storing the pixels read.\n @param dstRowBytes Number of bytes in each row of the pixel data read. The value must be greater than or equal to\n the minimum number of bytes in each row in the **OH_Drawing_Image_Info** object.\n @param srcX Start X coordinate of the pixel data to read from the bitmap. The value must be less than the width of\n the bitmap.\n @param srcY Start Y coordinate of the pixel data to read from the bitmap. The value must be less than the height of\n the bitmap.\n @return Returns **true** if the pixels are read; returns **false** otherwise.\n @since 12\n @version 1.0"]
481 pub fn OH_Drawing_BitmapReadPixels(
482 bitmap: *mut OH_Drawing_Bitmap,
483 dstInfo: *const OH_Drawing_Image_Info,
484 dstPixels: *mut ::std::os::raw::c_void,
485 dstRowBytes: usize,
486 srcX: i32,
487 srcY: i32,
488 ) -> bool;
489}
490extern "C" {
491 #[doc = " @brief Gets the row bytes of the bitmap.\n\n @param bitmap Indicates the pointer to an <b>OH_Drawing_Bitmap</b> object.\n @param bytes Indicates the row bytes of the bitmap.\n @return Returns the error code.\n Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.\n Returns {@link OH_DRAWING_ERROR_INCORRECT_PARAMETER} if bitmap or bytes is nullptr.\n @since 26.0.0"]
492 #[cfg(feature = "api-26")]
493 pub fn OH_Drawing_BitmapGetRowBytes(
494 bitmap: *mut OH_Drawing_Bitmap,
495 bytes: *mut u32,
496 ) -> OH_Drawing_ErrorCode;
497}
498extern "C" {
499 #[doc = " @brief Creates an **OH_Drawing_Brush** object.\n\n @return Returns the pointer to the **OH_Drawing_Brush** object created.\n @since 8\n @version 1.0"]
500 pub fn OH_Drawing_BrushCreate() -> *mut OH_Drawing_Brush;
501}
502extern "C" {
503 #[doc = " @brief Copies an existing {@link OH_Drawing_Brush} object to create a new one.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param brush Pointer to an **OH_Drawing_Brush** object.\n @return Returns a pointer to the {@link OH_Drawing_Brush} object created. If NULL is returned, the creation fails.\n The possible failure cause is that no memory is available or **brush** is NULL.\n @since 12\n @version 1.0"]
504 pub fn OH_Drawing_BrushCopy(brush: *mut OH_Drawing_Brush) -> *mut OH_Drawing_Brush;
505}
506extern "C" {
507 #[doc = " @brief Destroys an **OH_Drawing_Brush** object and reclaims the memory occupied by the object.\n\n @param brush Pointer to an **OH_Drawing_Brush** object.\n @since 8\n @version 1.0"]
508 pub fn OH_Drawing_BrushDestroy(brush: *mut OH_Drawing_Brush);
509}
510extern "C" {
511 #[doc = " @brief Checks whether anti-aliasing is enabled for a brush. Anti-aliasing makes the pixels around the shape edges\n semi-transparent.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param brush Pointer to an **OH_Drawing_Brush** object.\n @return Returns **true** if anti-aliasing is enabled; returns **false** otherwise.\n @since 8\n @version 1.0"]
512 pub fn OH_Drawing_BrushIsAntiAlias(brush: *const OH_Drawing_Brush) -> bool;
513}
514extern "C" {
515 #[doc = " @brief Enables or disables anti-aliasing for a brush. Anti-aliasing makes the pixels around the shape edges semi-\n transparent.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param brush Pointer to an **OH_Drawing_Brush** object.\n @param antiAlias Whether to enable anti-aliasing. The value **true** means to enable anti-aliasing, and **false**\n means the opposite.\n @since 8\n @version 1.0"]
516 pub fn OH_Drawing_BrushSetAntiAlias(brush: *mut OH_Drawing_Brush, antiAlias: bool);
517}
518extern "C" {
519 #[doc = " @brief Obtains the color of a brush. The color is used by the brush to fill in a shape.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param brush Pointer to an **OH_Drawing_Brush** object.\n @return Returns a 32-bit (ARGB) variable that describes the color.\n @since 8\n @version 1.0"]
520 pub fn OH_Drawing_BrushGetColor(brush: *const OH_Drawing_Brush) -> u32;
521}
522extern "C" {
523 #[doc = " @brief Sets the color for a brush. The color is used by the brush to fill in a shape.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param brush Pointer to an **OH_Drawing_Brush** object.\n @param color Color, which is a 32-bit (ARGB) variable.\n @since 8\n @version 1.0"]
524 pub fn OH_Drawing_BrushSetColor(brush: *mut OH_Drawing_Brush, color: u32);
525}
526extern "C" {
527 #[doc = " @brief Obtains the alpha value of a brush. This value is used by the alpha channel when the brush fills in a shape.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param brush Pointer to an **OH_Drawing_Brush** object.\n @return Returns an 8-bit variable that describes the alpha value.\n @since 11\n @version 1.0"]
528 pub fn OH_Drawing_BrushGetAlpha(brush: *const OH_Drawing_Brush) -> u8;
529}
530extern "C" {
531 #[doc = " @brief Sets the alpha value for a brush. This value is used by the alpha channel when the brush fills in a shape.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param brush Pointer to an **OH_Drawing_Brush** object.\n @param alpha Alpha value, which is an 8-bit variable.\n @since 11\n @version 1.0"]
532 pub fn OH_Drawing_BrushSetAlpha(brush: *mut OH_Drawing_Brush, alpha: u8);
533}
534extern "C" {
535 #[doc = " @brief Sets a color for this brush. The color will be used by the brush to fill in a shape.\n The color is in ARGB format represented by floating-point numbers. The color space is specified by\n {@link OH_NativeColorSpaceManager}.\n If **colorSpaceManager** is a null pointer, the SRGB (standard red, green, and blue color space based on IEC 61966-2.\n 1:1999) color space is used as the default value.\n\n @param brush Pointer to an {@link OH_Drawing_Brush} object.\n @param a Alpha value of the color, which is a floating-point number ranging from 0.0 to 1.0. Values above 1.0\n default to 1.0, while values below 0.0 default to 0.0.\n @param r Red component of the color, which is a floating-point number ranging from 0.0 to 1.0. Values above 1.0\n default to 1.0, while values below 0.0 default to 0.0.\n @param g Green component of the color, which is a floating-point number ranging from 0.0 to 1.0. Values above 1.0\n default to 1.0, while values below 0.0 default to 0.0.\n @param b Blue component of the color, which is a floating-point number ranging from 0.0 to 1.0. Values above 1.0\n default to 1.0, while values below 0.0 default to 0.0.\n @param colorSpaceManager Pointer to an {@link OH_NativeColorSpaceManager} object.\n @return Execution result.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if **brush** is NULL.\n @since 20\n @version 1.0"]
536 #[cfg(feature = "api-20")]
537 pub fn OH_Drawing_BrushSetColor4f(
538 brush: *mut OH_Drawing_Brush,
539 a: f32,
540 r: f32,
541 g: f32,
542 b: f32,
543 colorSpaceManager: *mut OH_NativeColorSpaceManager,
544 ) -> OH_Drawing_ErrorCode;
545}
546extern "C" {
547 #[doc = " @brief Obtains the alpha value of the brush color.\n\n @param brush Pointer to an {@link OH_Drawing_Brush} object.\n @param a Alpha value of the color. The value is a floating-point number ranging from 0.0 to 1.0.\n @return Execution result.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if **brush** or **a** is NULL.\n @since 20\n @version 1.0"]
548 #[cfg(feature = "api-20")]
549 pub fn OH_Drawing_BrushGetAlphaFloat(
550 brush: *const OH_Drawing_Brush,
551 a: *mut f32,
552 ) -> OH_Drawing_ErrorCode;
553}
554extern "C" {
555 #[doc = " @brief Obtains the red component of the brush color.\n\n @param brush Pointer to an {@link OH_Drawing_Brush} object.\n @param r Red component of the pen color. The value is a floating-point number ranging from 0.0 to 1.0.\n @return Execution result.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if **brush** or **r** is NULL.\n @since 20\n @version 1.0"]
556 #[cfg(feature = "api-20")]
557 pub fn OH_Drawing_BrushGetRedFloat(
558 brush: *const OH_Drawing_Brush,
559 r: *mut f32,
560 ) -> OH_Drawing_ErrorCode;
561}
562extern "C" {
563 #[doc = " @brief Obtains the green component of the brush color.\n\n @param brush Pointer to an {@link OH_Drawing_Brush} object.\n @param g Green component of the pen color. The value is a floating-point number ranging from 0.0 to 1.0.\n @return Execution result.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if **brush** or **g** is NULL.\n @since 20\n @version 1.0"]
564 #[cfg(feature = "api-20")]
565 pub fn OH_Drawing_BrushGetGreenFloat(
566 brush: *const OH_Drawing_Brush,
567 g: *mut f32,
568 ) -> OH_Drawing_ErrorCode;
569}
570extern "C" {
571 #[doc = " @brief Obtains the blue component of the brush color.\n\n @param brush Pointer to an {@link OH_Drawing_Brush} object.\n @param b Blue component of the pen color. The value is a floating-point number ranging from 0.0 to 1.0.\n @return Execution result.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if **brush** or **b** is NULL.\n @since 20\n @version 1.0"]
572 #[cfg(feature = "api-20")]
573 pub fn OH_Drawing_BrushGetBlueFloat(
574 brush: *const OH_Drawing_Brush,
575 b: *mut f32,
576 ) -> OH_Drawing_ErrorCode;
577}
578extern "C" {
579 #[doc = " @brief Sets the shader effect for a brush.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param brush Pointer to an **OH_Drawing_Brush** object.\n @param shaderEffect Pointer to an **OH_Drawing_ShaderEffect** object. If NULL is passed in, the shader effect of the\n brush will be cleared.\n @since 11\n @version 1.0"]
580 pub fn OH_Drawing_BrushSetShaderEffect(
581 brush: *mut OH_Drawing_Brush,
582 shaderEffect: *mut OH_Drawing_ShaderEffect,
583 );
584}
585extern "C" {
586 #[doc = " @brief Sets the shadow layer for a brush. The shadow layer effect takes effect only when text is drawn.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param brush Pointer to an **OH_Drawing_Brush** object.\n @param shadowLayer Pointer to an **OH_Drawing_ShadowLayer** object. If NULL is passed in, the shadow layer effect of\n the brush will be cleared.\n @since 12\n @version 1.0"]
587 pub fn OH_Drawing_BrushSetShadowLayer(
588 brush: *mut OH_Drawing_Brush,
589 shadowLayer: *mut OH_Drawing_ShadowLayer,
590 );
591}
592extern "C" {
593 #[doc = " @brief Sets the filter {@link OH_Drawing_Filter} for a brush. The filter is a container that holds a mask filter and\n color filter.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param brush Pointer to an **OH_Drawing_Brush** object.\n @param filter Pointer to an **OH_Drawing_Filter** object. If null is passed in, the filter will be cleared.\n @since 11\n @version 1.0"]
594 pub fn OH_Drawing_BrushSetFilter(brush: *mut OH_Drawing_Brush, filter: *mut OH_Drawing_Filter);
595}
596extern "C" {
597 #[doc = " @brief Obtains the {@link OH_Drawing_Filter} object from the brush. The filter is a container that holds a mask\n filter and color filter.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **brush** or **filter** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param brush Pointer to the {@link OH_Drawing_Brush} object.\n @param filter Pointer to an {@link OH_Drawing_Filter} object.\n @since 12\n @version 1.0"]
598 pub fn OH_Drawing_BrushGetFilter(brush: *mut OH_Drawing_Brush, filter: *mut OH_Drawing_Filter);
599}
600extern "C" {
601 #[doc = " @brief Sets a blender for a brush. The blender implements the specified blend mode.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n If **blendMode** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.\n\n @param brush Pointer to the {@link OH_Drawing_Brush} object.\n @param blendMode Enumeration of blend modes.\n @since 12\n @version 1.0"]
602 pub fn OH_Drawing_BrushSetBlendMode(
603 brush: *mut OH_Drawing_Brush,
604 blendMode: OH_Drawing_BlendMode,
605 );
606}
607extern "C" {
608 #[doc = " @brief Resets a brush to the initial state. All configured attributes are cleared.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param brush Pointer to the {@link OH_Drawing_Brush} object.\n @since 12\n @version 1.0"]
609 pub fn OH_Drawing_BrushReset(brush: *mut OH_Drawing_Brush);
610}
611#[doc = " Nearest filter mode."]
612pub const OH_Drawing_FilterMode_FILTER_MODE_NEAREST: OH_Drawing_FilterMode = 0;
613#[doc = " Linear filter mode."]
614pub const OH_Drawing_FilterMode_FILTER_MODE_LINEAR: OH_Drawing_FilterMode = 1;
615#[doc = " @brief Defines an enum for the filter modes.\n\n @since 12\n @version 1.0"]
616pub type OH_Drawing_FilterMode = u32;
617#[doc = " Mipmap level ignored."]
618pub const OH_Drawing_MipmapMode_MIPMAP_MODE_NONE: OH_Drawing_MipmapMode = 0;
619#[doc = " Nearest sampling from two adjacent mipmap levels."]
620pub const OH_Drawing_MipmapMode_MIPMAP_MODE_NEAREST: OH_Drawing_MipmapMode = 1;
621#[doc = " Linear interpolation sampling between two adjacent mipmap levels."]
622pub const OH_Drawing_MipmapMode_MIPMAP_MODE_LINEAR: OH_Drawing_MipmapMode = 2;
623#[doc = " @brief Defines an enum for the mipmap modes.\n\n @since 12\n @version 1.0"]
624pub type OH_Drawing_MipmapMode = u32;
625extern "C" {
626 #[doc = " @brief Creates an **OH_Drawing_SamplingOptions** object.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **mipmapMode** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is\n returned.\n\n @param filterMode Filter sampling mode.\n @param mipmapMode Mipmap mode.\n @return Returns a pointer to the created {@link OH_Drawing_SamplingOptions} object.\n @since 12\n @version 1.0"]
627 pub fn OH_Drawing_SamplingOptionsCreate(
628 filterMode: OH_Drawing_FilterMode,
629 mipmapMode: OH_Drawing_MipmapMode,
630 ) -> *mut OH_Drawing_SamplingOptions;
631}
632extern "C" {
633 #[doc = " @brief Creates a copy of an {@link OH_Drawing_SamplingOptions} object.\n\n @param samplingOptions Pointer to the {@link OH_Drawing_SamplingOptions} object.\n @return Returns a pointer to the created {@link OH_Drawing_SamplingOptions} object copy. If NULL is returned, the\n creation fails. The possible failure cause is that no memory is available or **samplingOptions** is NULL.\n @since 20\n @version 1.0"]
634 #[cfg(feature = "api-20")]
635 pub fn OH_Drawing_SamplingOptionsCopy(
636 samplingOptions: *mut OH_Drawing_SamplingOptions,
637 ) -> *mut OH_Drawing_SamplingOptions;
638}
639extern "C" {
640 #[doc = " @brief Destroys an **OH_Drawing_SamplingOptions** object and reclaims the memory occupied by the object.\n\n @param samplingOptions Pointer to the {@link OH_Drawing_SamplingOptions} object.\n @since 12\n @version 1.0"]
641 pub fn OH_Drawing_SamplingOptionsDestroy(samplingOptions: *mut OH_Drawing_SamplingOptions);
642}
643#[doc = " The source rectangle must be completely contained in the image."]
644pub const OH_Drawing_SrcRectConstraint_STRICT_SRC_RECT_CONSTRAINT: OH_Drawing_SrcRectConstraint = 0;
645#[doc = " The source rectangle can be partly outside the image."]
646pub const OH_Drawing_SrcRectConstraint_FAST_SRC_RECT_CONSTRAINT: OH_Drawing_SrcRectConstraint = 1;
647#[doc = " @brief Enumerates the constraint types of the source rectangle.\n\n @since 12\n @version 1.0"]
648pub type OH_Drawing_SrcRectConstraint = u32;
649extern "C" {
650 #[doc = " @brief Creates an **OH_Drawing_Canvas** object.\n\n @return Returns the pointer to the **OH_Drawing_Canvas** object created.\n @since 8\n @version 1.0"]
651 pub fn OH_Drawing_CanvasCreate() -> *mut OH_Drawing_Canvas;
652}
653extern "C" {
654 #[doc = " @brief Binds a pixel map to a canvas so that the content drawn on the canvas is output to the pixel map. (This\n process is called CPU rendering.) A canvas bound to a pixel map is a non-recording canvas.\n You should unbind the pixel map object by calling {@link OH_Drawing_PixelMapDissolve} after the canvas object is\n destroyed.\n\n @param pixelMap Pointer to the {@link OH_Drawing_PixelMap} object.\n @return Pointer to the created canvas object {@link OH_Drawing_Canvas}. If the returned object is NULL, the creation\n fails due to insufficient memory or an empty pixel map object.\n @since 20\n @version 1.0"]
655 #[cfg(feature = "api-20")]
656 pub fn OH_Drawing_CanvasCreateWithPixelMap(
657 pixelMap: *mut OH_Drawing_PixelMap,
658 ) -> *mut OH_Drawing_Canvas;
659}
660extern "C" {
661 #[doc = " @brief Destroys an **OH_Drawing_Canvas** object and reclaims the memory occupied by the object.\n\n @param canvas Pointer to an **OH_Drawing_Canvas** object.\n @since 8\n @version 1.0"]
662 pub fn OH_Drawing_CanvasDestroy(canvas: *mut OH_Drawing_Canvas);
663}
664extern "C" {
665 #[doc = " @brief Binds a bitmap to a canvas so that the content drawn on the canvas is output to the bitmap. (This process is\n called CPU rendering.) A canvas bound to a bitmap is a non-recording canvas.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **canvas** or **bitmap** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param canvas Pointer to an **OH_Drawing_Canvas** object.\n @param bitmap Pointer to an **OH_Drawing_Bitmap** object.\n @since 8\n @version 1.0"]
666 pub fn OH_Drawing_CanvasBind(canvas: *mut OH_Drawing_Canvas, bitmap: *mut OH_Drawing_Bitmap);
667}
668extern "C" {
669 #[doc = " @brief Attaches a pen to a canvas so that the canvas can use the style and color of the pen to outline a shape. If\n the pen effect changes after this function is called, you must call the function again to use the new effect in the\n subsequent drawing.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **canvas** or **pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param canvas Pointer to an **OH_Drawing_Canvas** object.\n @param pen Pointer to an **OH_Drawing_Pen** object.\n @since 8\n @version 1.0"]
670 pub fn OH_Drawing_CanvasAttachPen(canvas: *mut OH_Drawing_Canvas, pen: *const OH_Drawing_Pen);
671}
672extern "C" {
673 #[doc = " @brief Detaches the pen from a canvas so that the canvas can no longer use the style and color of the pen to outline\n a shape.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param canvas Pointer to an **OH_Drawing_Canvas** object.\n @since 8\n @version 1.0"]
674 pub fn OH_Drawing_CanvasDetachPen(canvas: *mut OH_Drawing_Canvas);
675}
676extern "C" {
677 #[doc = " @brief Attaches a brush to a canvas so that the canvas can use the style and color of the brush to fill in a shape.\n If the brush effect changes after this function is called, you must call the function again to use the new effect in\n the subsequent drawing.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **canvas** or **brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param canvas Pointer to an **OH_Drawing_Canvas** object.\n @param brush Pointer to an **OH_Drawing_Brush** object.\n @since 8\n @version 1.0"]
678 pub fn OH_Drawing_CanvasAttachBrush(
679 canvas: *mut OH_Drawing_Canvas,
680 brush: *const OH_Drawing_Brush,
681 );
682}
683extern "C" {
684 #[doc = " @brief Detaches the brush from a canvas so that the canvas can no longer use the previously set brush to fill in a\n shape.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param canvas Pointer to an **OH_Drawing_Canvas** object.\n @since 8\n @version 1.0"]
685 pub fn OH_Drawing_CanvasDetachBrush(canvas: *mut OH_Drawing_Canvas);
686}
687extern "C" {
688 #[doc = " @brief Saves the current canvas status (canvas matrix) to the top of the stack. This function works with\n {@link OH_Drawing_CanvasRestore}.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param canvas Pointer to an **OH_Drawing_Canvas** object.\n @since 8\n @version 1.0"]
689 pub fn OH_Drawing_CanvasSave(canvas: *mut OH_Drawing_Canvas);
690}
691extern "C" {
692 #[doc = " @brief Saves the matrix and cropping region, and allocates a bitmap for subsequent drawing. If you call\n {@link OH_Drawing_CanvasRestore}, changes made to the matrix and clipping region are discarded,\n and the bitmap is drawn.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param canvas Pointer to the {@link OH_Drawing_Canvas} object.\n @param rect Pointer to the {@link OH_Drawing_Rect} object, which is used to limit the layer size. A null pointer\n means no limit.\n @param brush Pointer to an {@link OH_Drawing_Brush} object. The alpha value, filter effect, and blend mode of the\n brush are applied when the bitmap is drawn. If NULL is passed in, no effect is applied.\n @since 12\n @version 1.0"]
693 pub fn OH_Drawing_CanvasSaveLayer(
694 canvas: *mut OH_Drawing_Canvas,
695 rect: *const OH_Drawing_Rect,
696 brush: *const OH_Drawing_Brush,
697 );
698}
699extern "C" {
700 #[doc = " @brief Restores the canvas status (canvas matrix) saved on the top of the stack.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param canvas Pointer to an **OH_Drawing_Canvas** object.\n @since 8\n @version 1.0"]
701 pub fn OH_Drawing_CanvasRestore(canvas: *mut OH_Drawing_Canvas);
702}
703extern "C" {
704 #[doc = " @brief Obtains the number of canvas statuses (canvas matrices) saved in the stack.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param canvas Pointer to an **OH_Drawing_Canvas** object.\n @return Returns a 32-bit value that describes the number of canvas statuses (canvas matrices). The initial number is\n **1**.\n @since 11\n @version 1.0"]
705 pub fn OH_Drawing_CanvasGetSaveCount(canvas: *mut OH_Drawing_Canvas) -> u32;
706}
707extern "C" {
708 #[doc = " @brief Restores to a given number of canvas statuses (canvas matrices).\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param canvas Pointer to an **OH_Drawing_Canvas** object.\n @param saveCount Number of canvas statuses (canvas matrices). If the value is less than or equal to 1, the canvas is\n restored to the initial state. If the value is greater than the number of canvas statuses that have been saved, no\n operation is performed.\n @since 11\n @version 1.0"]
709 pub fn OH_Drawing_CanvasRestoreToCount(canvas: *mut OH_Drawing_Canvas, saveCount: u32);
710}
711extern "C" {
712 #[doc = " @brief Draws a line segment.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param canvas Pointer to an **OH_Drawing_Canvas** object.\n @param x1 X coordinate of the start point of the line segment.\n @param y1 Y coordinate of the start point of the line segment.\n @param x2 X coordinate of the end point of the line segment.\n @param y2 Y coordinate of the end point of the line segment.\n @since 8\n @version 1.0"]
713 pub fn OH_Drawing_CanvasDrawLine(
714 canvas: *mut OH_Drawing_Canvas,
715 x1: f32,
716 y1: f32,
717 x2: f32,
718 y2: f32,
719 );
720}
721extern "C" {
722 #[doc = " @brief Draws a path.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **canvas** or **path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param canvas Pointer to an **OH_Drawing_Canvas** object.\n @param path Pointer to an **OH_Drawing_Path** object.\n @since 8\n @version 1.0"]
723 pub fn OH_Drawing_CanvasDrawPath(canvas: *mut OH_Drawing_Canvas, path: *const OH_Drawing_Path);
724}
725extern "C" {
726 #[doc = " @brief Draws a PixelMap based on a mesh, where mesh vertices are evenly distributed across the PixelMap. (This API\n works with brushes but not pens.)\n\n @param cCanvas Pointer to the {@link OH_Drawing_Canvas} object.\n @param pixelMap Pointer to the {@link OH_Drawing_PixelMap} object.\n @param meshWidth Number of columns in the mesh. The value is an integer greater than 0.\n @param meshHeight Number of rows in the mesh. The value is an integer greater than 0.\n @param vertices Pointer to the mesh vertex array.\n @param verticesSize Size of the mesh vertex array. The value must be ((meshWidth + 1) * (meshHeight + 1) +\n vertoffset) * 2.\n @param vertOffset Number of vertices to skip before drawing. The value is an integer greater than or equal to 0.\n @param colors Pointer to the mesh color array, which can be null.\n @param colorsSize Size of the mesh color array. If the array exists, the size must be (meshWidth + 1) * (meshHeight +\n 1) + colorOffset.\n @param colorOffset Number of colors to skip before drawing. The value is an integer greater than or equal to 0.\n @return Returns one of the following result codes:\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INCORRECT_PARAMETER** if any of the parameters, such as **cCanvas**, **pixelMap**, and **vertices*\n *, is empty or the input parameter does not meet the value rule.\n @since 23\n @version 1.0"]
727 #[cfg(feature = "api-23")]
728 pub fn OH_Drawing_CanvasDrawPixelMapMesh(
729 cCanvas: *mut OH_Drawing_Canvas,
730 pixelMap: *mut OH_Drawing_PixelMap,
731 meshWidth: u32,
732 meshHeight: u32,
733 vertices: *const f32,
734 verticesSize: u32,
735 vertOffset: u32,
736 colors: *const u32,
737 colorsSize: u32,
738 colorOffset: u32,
739 ) -> OH_Drawing_ErrorCode;
740}
741extern "C" {
742 #[doc = " @brief Splits a pixel map into nine sections using two horizontal and two vertical lines: four edge sections, four\n corner sections, and a central section.\n If the four corner sections are smaller than the target rectangle, they will be drawn in the target rectangle\n without scaling. Otherwise, they will be scaled to fit the target rectangle.\n Any remaining space will be filled by stretching or compressing the other five sections to cover the entire target\n rectangle.\n\n @param canvas Pointer to the {@link OH_Drawing_Canvas} object.\n @param pixelMap Pointer to the {@link OH_Drawing_PixelMap} object.\n @param center Pointer to the {@link OH_Drawing_Rect} object, which indicates the central rectangle splitting the\n pixel map. It divides the image into nine sections by extending its four edges.\n @param dst Pointer to the {@link OH_Drawing_Rect} object, which indicates the target region on the canvas.\n @param mode Enumeration of filter modes.\n @return Returns one of the following result codes:\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if **canvas**, **pixelMap**, or **dst** is NULL.\n @since 18\n @version 1.0"]
743 #[cfg(feature = "api-18")]
744 pub fn OH_Drawing_CanvasDrawPixelMapNine(
745 canvas: *mut OH_Drawing_Canvas,
746 pixelMap: *mut OH_Drawing_PixelMap,
747 center: *const OH_Drawing_Rect,
748 dst: *const OH_Drawing_Rect,
749 mode: OH_Drawing_FilterMode,
750 ) -> OH_Drawing_ErrorCode;
751}
752extern "C" {
753 #[doc = " @brief Draws a portion of a pixel map onto a specified area of the canvas.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If one of **canvas**, **pixelMap**, or **dst** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param canvas Pointer to the {@link OH_Drawing_Canvas} object.\n @param pixelMap Pointer to the {@link OH_Drawing_PixelMap} object.\n @param src Pointer to a rectangle on the pixel map. If NULL is passed in, it refers to the entire pixel map.\n @param dst Pointer to a rectangle on the canvas.\n @param samplingOptions Pointer to the {@link OH_Drawing_SamplingOptions} object. A null pointer means that the\n default sampling options are used.\n @since 12\n @version 1.0"]
754 pub fn OH_Drawing_CanvasDrawPixelMapRect(
755 canvas: *mut OH_Drawing_Canvas,
756 pixelMap: *mut OH_Drawing_PixelMap,
757 src: *const OH_Drawing_Rect,
758 dst: *const OH_Drawing_Rect,
759 samplingOptions: *const OH_Drawing_SamplingOptions,
760 );
761}
762extern "C" {
763 #[doc = " @brief Draws a portion of a pixel map onto a specified area of the canvas.\n\n @param canvas Pointer to the {@link OH_Drawing_Canvas} object.\n @param pixelMap Pointer to the {@link OH_Drawing_PixelMap} object.\n @param src Pointer to a rectangle on the pixel map. If NULL is passed in, it refers to the entire pixel map.\n @param dst Pointer to a rectangle on the canvas.\n @param samplingOptions Pointer to the {@link OH_Drawing_SamplingOptions} object. A null pointer means that the\n default sampling options are used.\n @param constraint Constraint type. For details about the available options, see {@link OH_Drawing_SrcRectConstraint}.\n @return Execution result.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if **canvas**, **pixelMap**, or **dst** is NULL.\n @since 20\n @version 1.0"]
764 #[cfg(feature = "api-20")]
765 pub fn OH_Drawing_CanvasDrawPixelMapRectConstraint(
766 canvas: *mut OH_Drawing_Canvas,
767 pixelMap: *mut OH_Drawing_PixelMap,
768 src: *const OH_Drawing_Rect,
769 dst: *const OH_Drawing_Rect,
770 samplingOptions: *const OH_Drawing_SamplingOptions,
771 constraint: OH_Drawing_SrcRectConstraint,
772 ) -> OH_Drawing_ErrorCode;
773}
774extern "C" {
775 #[doc = " @brief Draws a background filled with a brush.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **canvas** or **brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param canvas Pointer to an **OH_Drawing_Canvas** object.\n @param brush Pointer to an **OH_Drawing_Brush** object.\n @since 12\n @version 1.0"]
776 pub fn OH_Drawing_CanvasDrawBackground(
777 canvas: *mut OH_Drawing_Canvas,
778 brush: *const OH_Drawing_Brush,
779 );
780}
781extern "C" {
782 #[doc = " @brief Draws a region.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **canvas** or **region** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param canvas Pointer to an **OH_Drawing_Canvas** object.\n @param region Pointer to an **OH_Drawing_Region** object.\n @since 12\n @version 1.0"]
783 pub fn OH_Drawing_CanvasDrawRegion(
784 canvas: *mut OH_Drawing_Canvas,
785 region: *const OH_Drawing_Region,
786 );
787}
788#[doc = " Draws each point separately."]
789pub const OH_Drawing_PointMode_POINT_MODE_POINTS: OH_Drawing_PointMode = 0;
790#[doc = " Draws every two points as a line segment."]
791pub const OH_Drawing_PointMode_POINT_MODE_LINES: OH_Drawing_PointMode = 1;
792#[doc = " Draws an array of points as an open polygon."]
793pub const OH_Drawing_PointMode_POINT_MODE_POLYGON: OH_Drawing_PointMode = 2;
794#[doc = " @brief Enumerates the modes of drawing multiple points. The modes include discrete points, line segments, and open\n polygons.\n\n @since 12\n @version 1.0"]
795pub type OH_Drawing_PointMode = u32;
796extern "C" {
797 #[doc = " @brief Draws a point.\n\n @param canvas Pointer to the {@link OH_Drawing_Canvas} object.\n @param point Pointer to the {@link OH_Drawing_Point2D} object.\n @return Returns one of the following result codes:\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **canvas** or **point** is NULL.\n @since 12\n @version 1.0"]
798 pub fn OH_Drawing_CanvasDrawPoint(
799 canvas: *mut OH_Drawing_Canvas,
800 point: *const OH_Drawing_Point2D,
801 ) -> OH_Drawing_ErrorCode;
802}
803extern "C" {
804 #[doc = " @brief Draws multiple points. You can draw a single point, a line segment, or an open polygon.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **canvas** or **point2D** is NULL, or **count** is **0**, **OH_DRAWING_ERROR_INVALID_PARAMETER** is\n returned. If **mode** is not within the enumerated range, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.\n\n @param canvas Pointer to an **OH_Drawing_Canvas** object.\n @param mode Mode for drawing multiple points. For details, see {@link OH_Drawing_PointMode}.\n @param count Number of vertices, that is, the number of vertices in the vertex array.\n @param point2D Pointer to an array holding the vertices.\n @since 12\n @version 1.0"]
805 pub fn OH_Drawing_CanvasDrawPoints(
806 canvas: *mut OH_Drawing_Canvas,
807 mode: OH_Drawing_PointMode,
808 count: u32,
809 point2D: *const OH_Drawing_Point2D,
810 );
811}
812extern "C" {
813 #[doc = " @brief Draws a bitmap. A bitmap, also referred to as a dot matrix image, a pixel map image, or a grid image,\n includes single points called pixels (image elements).\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **canvas** or **bitmap** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param canvas Pointer to an **OH_Drawing_Canvas** object.\n @param bitmap Pointer to an **OH_Drawing_Bitmap** object.\n @param left X coordinate of the upper left corner of the bitmap.\n @param top Y coordinate of the upper left corner of the bitmap.\n @since 11\n @version 1.0"]
814 pub fn OH_Drawing_CanvasDrawBitmap(
815 canvas: *mut OH_Drawing_Canvas,
816 bitmap: *const OH_Drawing_Bitmap,
817 left: f32,
818 top: f32,
819 );
820}
821extern "C" {
822 #[doc = " @brief Draws a portion of a bitmap onto a specified area of the canvas.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If one of **canvas**, **bitmap**, or **dst** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param canvas Pointer to the {@link OH_Drawing_Canvas} object.\n @param bitmap Pointer to the {@link OH_Drawing_Bitmap} object.\n @param src Pointer to a rectangle on the bitmap. If NULL is passed in, it refers to the entire bitmap.\n @param dst Pointer to a rectangle on the canvas.\n @param samplingOptions Pointer to the {@link OH_Drawing_SamplingOptions} object. A null pointer means that the\n default sampling options are used.\n @since 12\n @version 1.0"]
823 pub fn OH_Drawing_CanvasDrawBitmapRect(
824 canvas: *mut OH_Drawing_Canvas,
825 bitmap: *const OH_Drawing_Bitmap,
826 src: *const OH_Drawing_Rect,
827 dst: *const OH_Drawing_Rect,
828 samplingOptions: *const OH_Drawing_SamplingOptions,
829 );
830}
831extern "C" {
832 #[doc = " @brief Draws a rectangle.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **canvas** or **OH_Drawing_Rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param canvas Pointer to an **OH_Drawing_Canvas** object.\n @param rect Pointer to an **OH_Drawing_Rect** object.\n @since 11\n @version 1.0"]
833 pub fn OH_Drawing_CanvasDrawRect(canvas: *mut OH_Drawing_Canvas, rect: *const OH_Drawing_Rect);
834}
835extern "C" {
836 #[doc = " @brief Draws a circle. This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. If\n either **canvas** or **point** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n If **radius** is less than or equal to 0, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.\n\n @param canvas Pointer to an **OH_Drawing_Canvas** object.\n @param point Pointer to an **OH_Drawing_Point** object, which indicates the center of the circle.\n @param radius Radius of the circle. The value is invalid if it is less than or equal to 0.\n @since 11\n @version 1.0"]
837 pub fn OH_Drawing_CanvasDrawCircle(
838 canvas: *mut OH_Drawing_Canvas,
839 point: *const OH_Drawing_Point,
840 radius: f32,
841 );
842}
843extern "C" {
844 #[doc = " @brief Fills the entire canvas with the specified color and blend mode.\n\n @param canvas Pointer to the {@link OH_Drawing_Canvas} object.\n @param color Color, represented by a 32-bit (ARGB) variable.\n @param blendMode Blend mode.\n @return Returns one of the following result codes:\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if **canvas** is NULL.\n **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** if **blendMode** is not set to one of the enumerated values.\n @since 12\n @version 1.0"]
845 pub fn OH_Drawing_CanvasDrawColor(
846 canvas: *mut OH_Drawing_Canvas,
847 color: u32,
848 blendMode: OH_Drawing_BlendMode,
849 ) -> OH_Drawing_ErrorCode;
850}
851extern "C" {
852 #[doc = " @brief Draws an oval. This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. If\n either **canvas** or **rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param canvas Pointer to an **OH_Drawing_Canvas** object.\n @param rect Pointer to an **OH_Drawing_Rect** object.\n @since 11\n @version 1.0"]
853 pub fn OH_Drawing_CanvasDrawOval(canvas: *mut OH_Drawing_Canvas, rect: *const OH_Drawing_Rect);
854}
855extern "C" {
856 #[doc = " @brief Draws an arc. If the absolute value of the sweep angle exceeds 360 degrees, an ellipse is drawn.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **canvas** or **rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param canvas Pointer to an **OH_Drawing_Canvas** object.\n @param rect Pointer to an **OH_Drawing_Rect** object.\n @param startAngle Start angle. When the degree is 0, the start point is located at the right end of the oval. A\n positive number indicates that the start point is placed clockwise, and a negative number indicates that the start\n point is placed counterclockwise.\n @param sweepAngle Angle to sweep, in degrees. A positive number indicates a clockwise sweep, and a negative value\n indicates a counterclockwise swipe. The valid range is from -360 degrees to 360 degrees. If the absolute value of\n the sweep angle exceeds 360 degrees, an ellipse is drawn.\n @since 11\n @version 1.0"]
857 pub fn OH_Drawing_CanvasDrawArc(
858 canvas: *mut OH_Drawing_Canvas,
859 rect: *const OH_Drawing_Rect,
860 startAngle: f32,
861 sweepAngle: f32,
862 );
863}
864extern "C" {
865 #[doc = " @brief Draws an arc. It enables you to define the start angle, sweep angle, and whether the arc's endpoints should\n connect to its center.\n\n @param canvas Pointer to the {@link OH_Drawing_Canvas} object.\n @param rect Pointer to the {@link OH_Drawing_Rect} object.\n @param startAngle Start angle, in degrees. The value is a floating point number. When the degree is 0, the start\n point is located at the right end of the oval. A positive number indicates that the start point is placed clockwise,\n and a negative number indicates that the start point is placed counterclockwise.\n @param sweepAngle Angle to sweep, in degrees. The value is a floating point number. A positive number indicates a\n clockwise sweep, and a negative value indicates a counterclockwise swipe. The swipe angle can exceed 360 degrees,\n and a complete ellipse is drawn.\n @param useCenter Whether the start point and end point of the arc are connected to its center. The value **true**\n means that they are connected to the center; the value **false** means the opposite.\n @return Returns one of the following result codes:\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **canvas** or **rect** is NULL.\n @since 18\n @version 1.0"]
866 #[cfg(feature = "api-18")]
867 pub fn OH_Drawing_CanvasDrawArcWithCenter(
868 canvas: *mut OH_Drawing_Canvas,
869 rect: *const OH_Drawing_Rect,
870 startAngle: f32,
871 sweepAngle: f32,
872 useCenter: bool,
873 ) -> OH_Drawing_ErrorCode;
874}
875extern "C" {
876 #[doc = " @brief Draws a rounded rectangle. This API may return an error code. For details, call\n {@link OH_Drawing_ErrorCodeGet}. If either **canvas** or **roundRect** is NULL,\n **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param canvas Pointer to an **OH_Drawing_Canvas** object.\n @param roundRect Pointer to an **OH_Drawing_RoundRect** object.\n @since 11\n @version 1.0"]
877 pub fn OH_Drawing_CanvasDrawRoundRect(
878 canvas: *mut OH_Drawing_Canvas,
879 roundRect: *const OH_Drawing_RoundRect,
880 );
881}
882extern "C" {
883 #[doc = " @brief Draws two nested rounded rectangles. The outer rectangle boundary must contain the inner rectangle boundary.\n Otherwise, there is no drawing effect.\n\n @param canvas Pointer to the {@link OH_Drawing_Canvas} object.\n @param outer Pointer to the {@link OH_Drawing_RoundRect} object, indicating the outer rounded rectangle.\n @param inner Pointer to the {@link OH_Drawing_RoundRect} object, indicating the inner rounded rectangle.\n @return Returns one of the following result codes:\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if **canvas**, **outer**, or **inner** is NULL.\n @since 18\n @version 1.0"]
884 #[cfg(feature = "api-18")]
885 pub fn OH_Drawing_CanvasDrawNestedRoundRect(
886 canvas: *mut OH_Drawing_Canvas,
887 outer: *const OH_Drawing_RoundRect,
888 inner: *const OH_Drawing_RoundRect,
889 ) -> OH_Drawing_ErrorCode;
890}
891extern "C" {
892 #[doc = " @brief Draws a single character. If the typeface of the current font does not support the character to draw, the\n system typeface is used to draw the character.\n\n @param canvas Pointer to the {@link OH_Drawing_Canvas} object.\n @param str Pointer to the single character to draw. A string can be passed in, but only the first character in the\n string is parsed and drawn in UTF-8 encoding.\n @param font Pointer to the {@link OH_Drawing_Font} object.\n @param x X coordinate of the left point of the character baseline.\n @param y Y coordinate of the left point of the character baseline.\n @return Returns one of the following result codes:\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if at least one of the parameters **canvas**, **str**, or **font** is NULL,\n or the length of **str** is **0**.\n @since 12\n @version 1.0"]
893 pub fn OH_Drawing_CanvasDrawSingleCharacter(
894 canvas: *mut OH_Drawing_Canvas,
895 str_: *const ::std::os::raw::c_char,
896 font: *const OH_Drawing_Font,
897 x: f32,
898 y: f32,
899 ) -> OH_Drawing_ErrorCode;
900}
901extern "C" {
902 #[doc = " @brief Draws a single character with font features. If the typeface of the current font does not support the\n character to draw, the system typeface is used to draw the character.\n\n @param canvas Pointer to the {@link OH_Drawing_Canvas} object.\n @param str Pointer to the single character to draw. A string can be passed in, but only the first character in the\n string is parsed and drawn in UTF-8 encoding.\n @param font Pointer to the {@link OH_Drawing_Font} object.\n @param x X coordinate of the left point of the character baseline.\n @param y Y coordinate of the left point of the character baseline.\n @param fontFeatures Pointer to the {@link OH_Drawing_FontFeatures} object. If no font feature is set, the preset\n font feature in the TrueType fonts (TTF) file is used.\n @return Execution result.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if at least one of the parameters **canvas**, **str**, **font**, or **\n fontFeatures** is NULL, or the length of **str** is **0**.\n @since 20\n @version 1.0"]
903 #[cfg(feature = "api-20")]
904 pub fn OH_Drawing_CanvasDrawSingleCharacterWithFeatures(
905 canvas: *mut OH_Drawing_Canvas,
906 str_: *const ::std::os::raw::c_char,
907 font: *const OH_Drawing_Font,
908 x: f32,
909 y: f32,
910 fontFeatures: *mut OH_Drawing_FontFeatures,
911 ) -> OH_Drawing_ErrorCode;
912}
913extern "C" {
914 #[doc = " @brief Draws a text blob. If the typeface used to construct **OH_Drawing_TextBlob** does not support a character,\n that character will not be drawn.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **canvas** or **textBlob** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param canvas Pointer to an **OH_Drawing_Canvas** object.\n @param textBlob Pointer to an **OH_Drawing_TextBlob** object.\n @param x X coordinate of the left point of the text baseline.\n @param y Y coordinate of the left point of the text baseline.\n @since 11\n @version 1.0"]
915 pub fn OH_Drawing_CanvasDrawTextBlob(
916 canvas: *mut OH_Drawing_Canvas,
917 textBlob: *const OH_Drawing_TextBlob,
918 x: f32,
919 y: f32,
920 );
921}
922extern "C" {
923 #[doc = " @brief Draws the array of glyphs with specified font. Nothing is drawn if glyphCount is smaller than or equals to 0.\n\n @param canvas Indicates the pointer to an <b>OH_Drawing_Canvas</b> object.\n @param glyphIds Indicates an array of glyph IDs.\n @param glyphIdCount Indicates the size of glyphId array.\n @param glyphIdOffset Indicates the number of elements to skip before drawing in glyphIds array.\n @param positions Indicates an array of positions.\n @param positionCount Indicates the size of position array.\n @param positionOffset Indicates the number of elements to skip before drawing in positions array.\n @param glyphCount Indicates the number of glyphs to be drawn.\n @param font Indicates the font used for drawing.\n @return Returns the error code.\n Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.\n Returns {@link OH_DRAWING_ERROR_INCORRECT_PARAMETER} if any of canvas, glyphIds, positions and font is nullptr.\n Returns {@link OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE} if glyphIdOffset or positionOffset is less than 0, or if\n glyphIdCount is less than (glyphIdOffset + glyphCount) or positionCount is less than (positionOffset + glyphCount).\n @since 26.0.0"]
924 #[cfg(feature = "api-26")]
925 pub fn OH_Drawing_CanvasDrawGlyphs(
926 canvas: *const OH_Drawing_Canvas,
927 glyphIds: *const ::std::os::raw::c_int,
928 glyphIdCount: ::std::os::raw::c_int,
929 glyphIdOffset: ::std::os::raw::c_int,
930 positions: *const OH_Drawing_Point2D,
931 positionCount: ::std::os::raw::c_int,
932 positionOffset: ::std::os::raw::c_int,
933 glyphCount: ::std::os::raw::c_int,
934 font: *const OH_Drawing_Font,
935 ) -> OH_Drawing_ErrorCode;
936}
937#[doc = " Clips a specified area. That is, the difference set is obtained."]
938pub const OH_Drawing_CanvasClipOp_DIFFERENCE: OH_Drawing_CanvasClipOp = 0;
939#[doc = " Retains a specified area. That is, the intersection is obtained."]
940pub const OH_Drawing_CanvasClipOp_INTERSECT: OH_Drawing_CanvasClipOp = 1;
941#[doc = " @brief Enumerates the canvas clipping modes.\n\n @since 11\n @version 1.0"]
942pub type OH_Drawing_CanvasClipOp = u32;
943extern "C" {
944 #[doc = " @brief Clips a rectangle.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **canvas** or **rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n If **clipOp** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.\n\n @param canvas Pointer to an **OH_Drawing_Canvas** object.\n @param rect Pointer to an **OH_Drawing_Rect** object.\n @param clipOp Clip mode. For details about the available options, see {@link OH_Drawing_CanvasClipOp}.\n @param doAntiAlias Whether to enable anti-aliasing. The value **true** means to enable anti-aliasing, and **false**\n means the opposite.\n @since 11\n @version 1.0"]
945 pub fn OH_Drawing_CanvasClipRect(
946 canvas: *mut OH_Drawing_Canvas,
947 rect: *const OH_Drawing_Rect,
948 clipOp: OH_Drawing_CanvasClipOp,
949 doAntiAlias: bool,
950 );
951}
952extern "C" {
953 #[doc = " @brief Clips a rounded rectangle.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **canvas** or **roundRect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n If **clipOp** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.\n\n @param canvas Pointer to an **OH_Drawing_Canvas** object.\n @param roundRect Pointer to an **OH_Drawing_RoundRect** object.\n @param clipOp Clip mode. For details about the available options, see {@link OH_Drawing_CanvasClipOp}.\n @param doAntiAlias Whether to perform anti-aliasing. The value **true** means to perform anti-aliasing, and **false**\n means the opposite.\n @since 12\n @version 1.0"]
954 pub fn OH_Drawing_CanvasClipRoundRect(
955 canvas: *mut OH_Drawing_Canvas,
956 roundRect: *const OH_Drawing_RoundRect,
957 clipOp: OH_Drawing_CanvasClipOp,
958 doAntiAlias: bool,
959 );
960}
961extern "C" {
962 #[doc = " @brief Clips a path.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **canvas** or **path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n If **clipOp** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.\n\n @param canvas Pointer to an **OH_Drawing_Canvas** object.\n @param path Pointer to an **OH_Drawing_Path** object.\n @param clipOp Clip mode. For details about the available options, see {@link OH_Drawing_CanvasClipOp}.\n @param doAntiAlias Whether to enable anti-aliasing. The value **true** means to enable anti-aliasing, and **false**\n means the opposite.\n @since 11\n @version 1.0"]
963 pub fn OH_Drawing_CanvasClipPath(
964 canvas: *mut OH_Drawing_Canvas,
965 path: *const OH_Drawing_Path,
966 clipOp: OH_Drawing_CanvasClipOp,
967 doAntiAlias: bool,
968 );
969}
970extern "C" {
971 #[doc = " @brief Clips a rectangle.\n\n @param canvas Pointer to the {@link OH_Drawing_Canvas} object.\n @param region Pointer to the {@link OH_Drawing_Region} object.\n @param clipOp Clip mode. For details about the available options, see {@link OH_Drawing_CanvasClipOp}.\n @return Returns one of the following result codes:\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **canvas** or **region** is NULL.\n **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** if **clipOp** is not set to one of the enumerated values.\n @since 12\n @version 1.0"]
972 pub fn OH_Drawing_CanvasClipRegion(
973 canvas: *mut OH_Drawing_Canvas,
974 region: *const OH_Drawing_Region,
975 clipOp: OH_Drawing_CanvasClipOp,
976 ) -> OH_Drawing_ErrorCode;
977}
978extern "C" {
979 #[doc = " @brief Rotates a canvas by a given angle. A positive value indicates a clockwise rotation, and a negative value\n indicates a counterclockwise rotation.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param canvas Pointer to an **OH_Drawing_Canvas** object.\n @param degrees Rotation angle.\n @param px X coordinate of the rotation point.\n @param py Y coordinate of the rotation point.\n @since 11\n @version 1.0"]
980 pub fn OH_Drawing_CanvasRotate(canvas: *mut OH_Drawing_Canvas, degrees: f32, px: f32, py: f32);
981}
982extern "C" {
983 #[doc = " @brief Translates a canvas by a given distance.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param canvas Pointer to an **OH_Drawing_Canvas** object.\n @param dx Distance to translate on the X axis.\n @param dy Distance to translate on the Y axis.\n @since 11\n @version 1.0"]
984 pub fn OH_Drawing_CanvasTranslate(canvas: *mut OH_Drawing_Canvas, dx: f32, dy: f32);
985}
986extern "C" {
987 #[doc = " @brief Scales a canvas.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param canvas Pointer to an **OH_Drawing_Canvas** object.\n @param sx Scale ratio on the X axis.\n @param sy Scale ratio on the Y axis.\n @since 11\n @version 1.0"]
988 pub fn OH_Drawing_CanvasScale(canvas: *mut OH_Drawing_Canvas, sx: f32, sy: f32);
989}
990extern "C" {
991 #[doc = " @brief Skews a canvas. This function premultiplies the current canvas matrix by a skew transformation matrix and\n applies the resulting matrix to the canvas. The skew transformation matrix is as follows:\n |1 sx 0|\n |sy 1 0|\n |0 0 1|\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param canvas Pointer to an **OH_Drawing_Canvas** object.\n @param sx Amount of tilt on the X axis. A positive number tilts the drawing rightwards along the positive direction\n of the Y axis, and a negative number tilts the drawing leftwards along the positive direction of the Y axis.\n @param sy Amount of tilt on the Y axis. A positive number tilts the drawing downwards along the positive direction\n of the X axis, and a negative number tilts the drawing upwards along the positive direction of the X axis.\n @since 12\n @version 1.0"]
992 pub fn OH_Drawing_CanvasSkew(canvas: *mut OH_Drawing_Canvas, sx: f32, sy: f32);
993}
994extern "C" {
995 #[doc = " @brief Obtains the canvas width.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param canvas Pointer to the {@link OH_Drawing_Canvas} object.\n @return Returns the width.\n @since 12\n @version 1.0"]
996 pub fn OH_Drawing_CanvasGetWidth(canvas: *mut OH_Drawing_Canvas) -> i32;
997}
998extern "C" {
999 #[doc = " @brief Obtains the canvas height.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param canvas Pointer to the {@link OH_Drawing_Canvas} object.\n @return Returns the height.\n @since 12\n @version 1.0"]
1000 pub fn OH_Drawing_CanvasGetHeight(canvas: *mut OH_Drawing_Canvas) -> i32;
1001}
1002extern "C" {
1003 #[doc = " @brief Obtains the bounds of the cropping region of the canvas. This function cannot be used for a canvas of the\n recording type.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **canvas** or **rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param canvas Pointer to the {@link OH_Drawing_Canvas} object.\n @param rect Pointer to the {@link OH_Drawing_Rect} object. You can call {@link OH_Drawing_RectCreate} to create a\n rectangle object.\n @since 12\n @version 1.0"]
1004 pub fn OH_Drawing_CanvasGetLocalClipBounds(
1005 canvas: *mut OH_Drawing_Canvas,
1006 rect: *mut OH_Drawing_Rect,
1007 );
1008}
1009extern "C" {
1010 #[doc = " @brief Obtains the 3x3 matrix of a canvas.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **canvas** or **matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param canvas Pointer to the {@link OH_Drawing_Canvas} object.\n @param matrix Pointer to the {@link OH_Drawing_Matrix} object. You can call {@link OH_Drawing_MatrixCreate} to\n create a matrix object.\n @since 12\n @version 1.0"]
1011 pub fn OH_Drawing_CanvasGetTotalMatrix(
1012 canvas: *mut OH_Drawing_Canvas,
1013 matrix: *mut OH_Drawing_Matrix,
1014 );
1015}
1016extern "C" {
1017 #[doc = " @brief Preconcats the existing matrix of the canvas with the passed-in matrix. The drawing operation triggered\n before this API is called is not affected.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **canvas** or **matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param canvas Pointer to the {@link OH_Drawing_Canvas} object.\n @param matrix Pointer to the {@link OH_Drawing_Matrix} object.\n @since 12\n @version 1.0"]
1018 pub fn OH_Drawing_CanvasConcatMatrix(
1019 canvas: *mut OH_Drawing_Canvas,
1020 matrix: *mut OH_Drawing_Matrix,
1021 );
1022}
1023#[doc = " There is no shadow flag."]
1024pub const OH_Drawing_CanvasShadowFlags_SHADOW_FLAGS_NONE: OH_Drawing_CanvasShadowFlags = 0;
1025#[doc = " The occluding object is transparent."]
1026pub const OH_Drawing_CanvasShadowFlags_SHADOW_FLAGS_TRANSPARENT_OCCLUDER:
1027 OH_Drawing_CanvasShadowFlags = 1;
1028#[doc = " No analysis on the shadows is required."]
1029pub const OH_Drawing_CanvasShadowFlags_SHADOW_FLAGS_GEOMETRIC_ONLY: OH_Drawing_CanvasShadowFlags =
1030 2;
1031#[doc = " All the preceding shadow flags are used."]
1032pub const OH_Drawing_CanvasShadowFlags_SHADOW_FLAGS_ALL: OH_Drawing_CanvasShadowFlags = 3;
1033#[doc = " @brief Enumerates the shadow flags.\n\n @since 12\n @version 1.0"]
1034pub type OH_Drawing_CanvasShadowFlags = u32;
1035extern "C" {
1036 #[doc = " @brief Draws a spot shadow and uses a given path to outline the ambient shadow.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **canvas** or **path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n If **flag** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.\n\n @param canvas Pointer to the {@link OH_Drawing_Canvas} object.\n @param path Pointer to the {@link OH_Drawing_Path} object, which is used to generate shadows.\n @param planeParams Z-axis offset of an occluder relative to the canvas, based on its x and y coordinates.\n @param devLightPos Position of the light relative to the canvas.\n @param lightRadius Radius of the light source. The value must be greater than or equal to 0.\n @param ambientColor Ambient shadow color, which is represented by a 32-bit (ARGB) variable.\n @param spotColor Point shadow color, which is represented by a 32-bit (ARGB) variable.\n @param flag Enumeration of shadow flags.\n @since 12\n @version 1.0"]
1037 pub fn OH_Drawing_CanvasDrawShadow(
1038 canvas: *mut OH_Drawing_Canvas,
1039 path: *mut OH_Drawing_Path,
1040 planeParams: OH_Drawing_Point3D,
1041 devLightPos: OH_Drawing_Point3D,
1042 lightRadius: f32,
1043 ambientColor: u32,
1044 spotColor: u32,
1045 flag: OH_Drawing_CanvasShadowFlags,
1046 );
1047}
1048extern "C" {
1049 #[doc = " @brief Clears a canvas by using a given color.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param canvas Pointer to an **OH_Drawing_Canvas** object.\n @param color Color, which is a 32-bit (ARGB) variable.\n @since 8\n @version 1.0"]
1050 pub fn OH_Drawing_CanvasClear(canvas: *mut OH_Drawing_Canvas, color: u32);
1051}
1052extern "C" {
1053 #[doc = " @brief Sets the matrix status for a canvas.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **canvas** or **matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param canvas Pointer to the {@link OH_Drawing_Canvas} object.\n @param matrix Pointer to the {@link OH_Drawing_Matrix} object. You can call {@link OH_Drawing_MatrixCreate} to\n create a matrix object.\n @since 12\n @version 1.0"]
1054 pub fn OH_Drawing_CanvasSetMatrix(
1055 canvas: *mut OH_Drawing_Canvas,
1056 matrix: *mut OH_Drawing_Matrix,
1057 );
1058}
1059extern "C" {
1060 #[doc = " @brief Resets the matrix of this canvas to an identity matrix.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param canvas Pointer to the {@link OH_Drawing_Canvas} object.\n @since 12\n @version 1.0"]
1061 pub fn OH_Drawing_CanvasResetMatrix(canvas: *mut OH_Drawing_Canvas);
1062}
1063extern "C" {
1064 #[doc = " @brief Reset the clip status.\n\n @param canvas Indicates the pointer to an <b>OH_Drawing_Canvas</b> object.\n @return Returns the error code.\n Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.\n Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if canvas is nullptr.\n @since 26.0.0"]
1065 #[cfg(feature = "api-26")]
1066 pub fn OH_Drawing_CanvasResetClip(canvas: *mut OH_Drawing_Canvas) -> OH_Drawing_ErrorCode;
1067}
1068extern "C" {
1069 #[doc = " @brief Draws a portion of an image onto a specified area of the canvas. The area selected by the source rectangle is\n scaled and translated to the destination rectangle.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If one of **canvas**, **image**, **src**, or **dst** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param canvas Pointer to the {@link OH_Drawing_Canvas} object.\n @param image Pointer to the {@link OH_Drawing_Image} object.\n @param src Pointer to the {@link OH_Drawing_Rect} object.\n @param dst Pointer to the {@link OH_Drawing_Rect} object.\n @param samplingOptions Pointer to the {@link OH_Drawing_SamplingOptions} object. A null pointer means that the\n default sampling options are used.\n @param srcRectConstraint Constraint type. For details about the available options, see\n {@link OH_Drawing_SrcRectConstraint}.\n @since 12\n @version 1.0"]
1070 pub fn OH_Drawing_CanvasDrawImageRectWithSrc(
1071 canvas: *mut OH_Drawing_Canvas,
1072 image: *const OH_Drawing_Image,
1073 src: *const OH_Drawing_Rect,
1074 dst: *const OH_Drawing_Rect,
1075 samplingOptions: *const OH_Drawing_SamplingOptions,
1076 srcRectConstraint: OH_Drawing_SrcRectConstraint,
1077 );
1078}
1079extern "C" {
1080 #[doc = " @brief Draws an image onto a specified area of the canvas.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If one of **canvas**, **image**, or **dst** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param canvas Pointer to the {@link OH_Drawing_Canvas} object.\n @param image Pointer to the {@link OH_Drawing_Image} object.\n @param rect Pointer to the {@link OH_Drawing_Rect} object.\n @param samplingOptions Pointer to the {@link OH_Drawing_SamplingOptions} object. A null pointer means that the\n default sampling options are used.\n @since 12\n @version 1.0"]
1081 pub fn OH_Drawing_CanvasDrawImageRect(
1082 canvas: *mut OH_Drawing_Canvas,
1083 image: *mut OH_Drawing_Image,
1084 rect: *mut OH_Drawing_Rect,
1085 samplingOptions: *mut OH_Drawing_SamplingOptions,
1086 );
1087}
1088#[doc = " Draws a triangle list. Specifically, a list of isolated triangles are drawn using every three vertices. If the\n number of vertices is not a multiple of 3, the extra vertices will be ignored."]
1089pub const OH_Drawing_VertexMode_VERTEX_MODE_TRIANGLES: OH_Drawing_VertexMode = 0;
1090#[doc = " Draws a triangle strip. Specifically, the first triangle is drawn between the first 3 vertices, and all\n subsequent triangles use the previous 2 vertices plus the next additional vertex."]
1091pub const OH_Drawing_VertexMode_VERTEX_MODE_TRIANGLES_STRIP: OH_Drawing_VertexMode = 1;
1092#[doc = " Draws a triangle fan. A triangle fan is similar to a triangle strip, except that all the triangles share one\n vertex (the first vertex)."]
1093pub const OH_Drawing_VertexMode_VERTEX_MODE_TRIANGLE_FAN: OH_Drawing_VertexMode = 2;
1094#[doc = " @brief Enumerates the modes of interpreting the geometry of a given vertex.\n\n @since 12\n @version 1.0"]
1095pub type OH_Drawing_VertexMode = u32;
1096extern "C" {
1097 #[doc = " @brief Draws a triangular grid described by a vertex array.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **canvas** or **positions** is NULL, **vertexCount** is less than 3, or **indexCount** is less than 3 but\n not 0, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n If either **vertexMmode** or **mode** is not set to one of the enumerated values, **\n OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.\n\n @param canvas Pointer to an **OH_Drawing_Canvas** object.\n @param vertexMmode Mode for drawing vertices. For details about the available options, see\n {@link OH_Drawing_VertexMode}.\n @param vertexCount Number of elements in the vertex array. The value must be greater than or equal to 3.\n @param positions Pointer to the array that holds the position of every vertex. The array cannot be null and its\n length must be equal to the value of **vertexCount**.\n @param texs Pointer to the array that holds the texture space coordinate corresponding to each vertex. The array can\n be null. If the array is not null, its length must be equal to the value of **vertexCount**.\n @param colors Pointer to the array that holds the color corresponding to each vertex. It is used for interpolation\n in a triangle. The array can be null. If the array is not null, its length must be equal to the value of **\n vertexCount**.\n @param indexCount Number of indices. The value can be 0 or a value greater than or equal to 3.\n @param indices Pointer to the array that holds the index of each vertex. The array can be null. If the array is not\n null, its length must be equal to the value of **indexCount**.\n @param mode Enumeration of blend modes. For details about the available options, see {@link OH_Drawing_BlendMode}.\n @since 12\n @version 1.0"]
1098 pub fn OH_Drawing_CanvasDrawVertices(
1099 canvas: *mut OH_Drawing_Canvas,
1100 vertexMmode: OH_Drawing_VertexMode,
1101 vertexCount: i32,
1102 positions: *const OH_Drawing_Point2D,
1103 texs: *const OH_Drawing_Point2D,
1104 colors: *const u32,
1105 indexCount: i32,
1106 indices: *const u16,
1107 mode: OH_Drawing_BlendMode,
1108 );
1109}
1110extern "C" {
1111 #[doc = " @brief Copies pixel data from a canvas to a specified address. This function cannot be used for a canvas of the\n recording type.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If one of **canvas**, **imageInfo**, or **dstPixels** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param canvas Pointer to the {@link OH_Drawing_Canvas} object.\n @param imageInfo Pointer to the {@link OH_Drawing_Image_Info} object.\n @param dstPixels Pointer to the start address for storing the pixel data.\n @param dstRowBytes Number of bytes in each row of pixels. The value is invalid if it is less than or equal to 0.\n @param srcX X offset of the pixels on the canvas, in px.\n @param srcY Y offset of the pixels on the canvas, in px.\n @return Returns **true** if the pixel data is copied to the start address of the storage; returns **false**\n otherwise.\n @since 12\n @version 1.0"]
1112 pub fn OH_Drawing_CanvasReadPixels(
1113 canvas: *mut OH_Drawing_Canvas,
1114 imageInfo: *mut OH_Drawing_Image_Info,
1115 dstPixels: *mut ::std::os::raw::c_void,
1116 dstRowBytes: u32,
1117 srcX: i32,
1118 srcY: i32,
1119 ) -> bool;
1120}
1121extern "C" {
1122 #[doc = " @brief Copies pixel data from a canvas to an image. This function cannot be used for a canvas of the recording type.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **canvas** or **bitmap** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param canvas Pointer to the {@link OH_Drawing_Canvas} object.\n @param bitmap Pointer to the {@link OH_Drawing_Bitmap} object.\n @param srcX X offset of the pixels on the canvas, in px.\n @param srcY Y offset of the pixels on the canvas, in px.\n @return Returns **true** if the pixel data is copied to the image; returns **false** otherwise.\n @since 12\n @version 1.0"]
1123 pub fn OH_Drawing_CanvasReadPixelsToBitmap(
1124 canvas: *mut OH_Drawing_Canvas,
1125 bitmap: *mut OH_Drawing_Bitmap,
1126 srcX: i32,
1127 srcY: i32,
1128 ) -> bool;
1129}
1130extern "C" {
1131 #[doc = " @brief Checks whether the region that can be drawn is empty after clipping.\n\n @param canvas Pointer to the {@link OH_Drawing_Canvas} object.\n @param isClipEmpty Pointer to the variable that specifies whether the region is empty. The value **true** means that\n the region is empty, and **false** means the opposite.\n @return Returns one of the following result codes:\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **canvas** or **isClipEmpty** is NULL.\n @since 12\n @version 1.0"]
1132 pub fn OH_Drawing_CanvasIsClipEmpty(
1133 canvas: *mut OH_Drawing_Canvas,
1134 isClipEmpty: *mut bool,
1135 ) -> OH_Drawing_ErrorCode;
1136}
1137extern "C" {
1138 #[doc = " @brief Obtains the image information of a canvas.\n\n @param canvas Pointer to the {@link OH_Drawing_Canvas} object.\n @param imageInfo Pointer to the {@link OH_Drawing_Image_Info} object.\n @return Returns one of the following result codes:\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **canvas** or **imageInfo** is NULL.\n @since 12\n @version 1.0"]
1139 pub fn OH_Drawing_CanvasGetImageInfo(
1140 canvas: *mut OH_Drawing_Canvas,
1141 imageInfo: *mut OH_Drawing_Image_Info,
1142 ) -> OH_Drawing_ErrorCode;
1143}
1144extern "C" {
1145 #[doc = " @brief Draws an **OH_Drawing_RecordCmd** object.\n\n @param canvas Pointer to the {@link OH_Drawing_Canvas} object. Only the canvas of the recording type is supported.\n @param recordCmd Pointer to the {@link OH_Drawing_RecordCmd} object.\n @return Returns one of the following result codes:\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **canvas** or **recordCmd** is NULL.\n @since 13\n @version 1.0"]
1146 #[cfg(feature = "api-13")]
1147 pub fn OH_Drawing_CanvasDrawRecordCmd(
1148 canvas: *mut OH_Drawing_Canvas,
1149 recordCmd: *mut OH_Drawing_RecordCmd,
1150 ) -> OH_Drawing_ErrorCode;
1151}
1152extern "C" {
1153 #[doc = " @brief Draws an **OH_Drawing_RecordCmd** object. This API supports nesting.\n\n @param canvas Pointer to the {@link OH_Drawing_Canvas} object. Only the canvas of the recording type is supported.\n @param recordCmd Pointer to the {@link OH_Drawing_RecordCmd} object.\n @return Operation code.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **canvas** or **recordCmd** is NULL.\n @since 19\n @version 1.0"]
1154 #[cfg(feature = "api-19")]
1155 pub fn OH_Drawing_CanvasDrawRecordCmdNesting(
1156 canvas: *mut OH_Drawing_Canvas,
1157 recordCmd: *mut OH_Drawing_RecordCmd,
1158 ) -> OH_Drawing_ErrorCode;
1159}
1160extern "C" {
1161 #[doc = " @brief Checks whether the path is not intersecting with the canvas area. The canvas area includes its boundaries.\n\n @param canvas Pointer to the {@link OH_Drawing_Canvas} object.\n @param path Pointer to the {@link OH_Drawing_Path} object.\n @param quickReject Pointer to the check result. The value **true** means that the path is not intersecting with the\n canvas area, and **false** means the opposite.\n @return Returns one of the following result codes:\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if **canvas**, **path**, or **quickReject** is NULL.\n @since 18\n @version 1.0"]
1162 #[cfg(feature = "api-18")]
1163 pub fn OH_Drawing_CanvasQuickRejectPath(
1164 canvas: *mut OH_Drawing_Canvas,
1165 path: *const OH_Drawing_Path,
1166 quickReject: *mut bool,
1167 ) -> OH_Drawing_ErrorCode;
1168}
1169extern "C" {
1170 #[doc = " @brief Checks whether the rectangle is not intersecting with the canvas area. The canvas area includes its\n boundaries.\n\n @param canvas Pointer to the {@link OH_Drawing_Canvas} object.\n @param rect Pointer to the {@link OH_Drawing_Rect} object.\n @param quickReject Pointer to the check result. The value **true** means that the rectangle is not intersecting with\n the canvas area, and **false** means the opposite.\n @return Returns one of the following result codes:\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if **canvas**, **rect**, or **quickReject** is NULL.\n @since 18\n @version 1.0"]
1171 #[cfg(feature = "api-18")]
1172 pub fn OH_Drawing_CanvasQuickRejectRect(
1173 canvas: *mut OH_Drawing_Canvas,
1174 rect: *const OH_Drawing_Rect,
1175 quickReject: *mut bool,
1176 ) -> OH_Drawing_ErrorCode;
1177}
1178extern "C" {
1179 #[doc = " @brief Checks if the current layer that drawn into the device is opaque.\n\n @param canvas Indicates the pointer to an <b>OH_Drawing_Canvas</b> object.\n @param isOpaque Indicates if the canvas is opaque.\n @return Returns the error code.\n Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.\n Returns {@link OH_DRAWING_ERROR_INCORRECT_PARAMETER} if canvas or isOpaque is nullptr.\n @since 26.0.0"]
1180 #[cfg(feature = "api-26")]
1181 pub fn OH_Drawing_CanvasIsOpaque(
1182 canvas: *const OH_Drawing_Canvas,
1183 isOpaque: *mut bool,
1184 ) -> OH_Drawing_ErrorCode;
1185}
1186extern "C" {
1187 #[doc = " @brief Converts four variables (alpha, red, green, and blue) into a 32-bit (ARGB) variable that describes a color.\n\n @param alpha Alpha, which is a variable ranging from 0x00 to 0xFF.\n @param red Read, which is a variable ranging from 0x00 to 0xFF.\n @param green Green, which is a variable ranging from 0x00 to 0xFF.\n @param blue Blue, which is a variable ranging from 0x00 to 0xFF.\n @return Returns a 32-bit (ARGB) variable that describes the color.\n @since 8\n @version 1.0"]
1188 pub fn OH_Drawing_ColorSetArgb(alpha: u32, red: u32, green: u32, blue: u32) -> u32;
1189}
1190extern "C" {
1191 #[doc = " @brief Creates an **OH_Drawing_ColorFilter** object with a given blend mode.\n\n @param color Color, which is a 32-bit (ARGB) variable.\n @param blendMode Blend mode. For details about the available options, see {@link OH_Drawing_BlendMode}.\n @return Returns the pointer to the **OH_Drawing_ColorFilter** object created.\n @since 11\n @version 1.0"]
1192 pub fn OH_Drawing_ColorFilterCreateBlendMode(
1193 color: u32,
1194 blendMode: OH_Drawing_BlendMode,
1195 ) -> *mut OH_Drawing_ColorFilter;
1196}
1197extern "C" {
1198 #[doc = " @brief Creates an **OH_Drawing_ColorFilter** object by combining another two color filters.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **outerColorFilter** or **innerColorFilter** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param outerColorFilter Pointer to the first color filter.\n @param innerColorFilter Pointer to the second color filter.\n @return Returns the pointer to the **OH_Drawing_ColorFilter** object created.\n @since 11\n @version 1.0"]
1199 pub fn OH_Drawing_ColorFilterCreateCompose(
1200 outerColorFilter: *mut OH_Drawing_ColorFilter,
1201 innerColorFilter: *mut OH_Drawing_ColorFilter,
1202 ) -> *mut OH_Drawing_ColorFilter;
1203}
1204extern "C" {
1205 #[doc = " @brief Creates an **OH_Drawing_ColorFilter** object with a given 5x4 color matrix.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param matrix Matrix, which is represented by a floating-point array with a length of 20.\n @return Returns the pointer to the **OH_Drawing_ColorFilter** object created.\n @since 11\n @version 1.0"]
1206 pub fn OH_Drawing_ColorFilterCreateMatrix(matrix: *const f32) -> *mut OH_Drawing_ColorFilter;
1207}
1208extern "C" {
1209 #[doc = " @brief Creates an **OH_Drawing_ColorFilter** object that applies the sRGB gamma curve to the RGB channels.\n\n @return Returns the pointer to the **OH_Drawing_ColorFilter** object created.\n @since 11\n @version 1.0"]
1210 pub fn OH_Drawing_ColorFilterCreateLinearToSrgbGamma() -> *mut OH_Drawing_ColorFilter;
1211}
1212extern "C" {
1213 #[doc = " @brief Creates an **OH_Drawing_ColorFilter** object that applies the RGB channels to the sRGB gamma curve.\n\n @return Returns the pointer to the **OH_Drawing_ColorFilter** object created.\n @since 11\n @version 1.0"]
1214 pub fn OH_Drawing_ColorFilterCreateSrgbGammaToLinear() -> *mut OH_Drawing_ColorFilter;
1215}
1216extern "C" {
1217 #[doc = " @brief Creates a **ColorFilter** object that multiplies the luma into the alpha channel and sets the RGB channels to\n zero.\n\n @return Returns the pointer to the **OH_Drawing_ColorFilter** object created.\n @since 11\n @version 1.0"]
1218 pub fn OH_Drawing_ColorFilterCreateLuma() -> *mut OH_Drawing_ColorFilter;
1219}
1220extern "C" {
1221 #[doc = " @brief Creates a lighting color filter. It multiplies the RGB channel values by one color and then adds another\n color value. The final output stays between 0 and 255.\n\n @param mulColor Color value used for multiplication.\n @param addColor Color value used for addition.\n @return Returns the pointer to the **OH_Drawing_ColorFilter** object created.\n @since 20\n @version 1.0"]
1222 #[cfg(feature = "api-20")]
1223 pub fn OH_Drawing_ColorFilterCreateLighting(
1224 mulColor: u32,
1225 addColor: u32,
1226 ) -> *mut OH_Drawing_ColorFilter;
1227}
1228extern "C" {
1229 #[doc = " @brief Destroys an **OH_Drawing_ColorFilter** object and reclaims the memory occupied by the object.\n\n @param colorFilter Pointer to an **OH_Drawing_ColorFilter** object.\n @since 11\n @version 1.0"]
1230 pub fn OH_Drawing_ColorFilterDestroy(colorFilter: *mut OH_Drawing_ColorFilter);
1231}
1232extern "C" {
1233 #[doc = " @brief Creates an sRGB color space.\n\n @return Returns a pointer to the {@link OH_Drawing_ColorSpace} object created.\n @since 12\n @version 1.0"]
1234 pub fn OH_Drawing_ColorSpaceCreateSrgb() -> *mut OH_Drawing_ColorSpace;
1235}
1236extern "C" {
1237 #[doc = " @brief Creates an sRGB linear (Gamma 1.0) color space.\n\n @return Returns a pointer to the {@link OH_Drawing_ColorSpace} object created.\n @since 12\n @version 1.0"]
1238 pub fn OH_Drawing_ColorSpaceCreateSrgbLinear() -> *mut OH_Drawing_ColorSpace;
1239}
1240extern "C" {
1241 #[doc = " @brief Destroys an **OH_Drawing_ColorSpace** object and reclaims the memory occupied by the object.\n\n @param colorSpace Pointer to an {@link OH_Drawing_ColorSpace} object.\n @since 12\n @version 1.0"]
1242 pub fn OH_Drawing_ColorSpaceDestroy(colorSpace: *mut OH_Drawing_ColorSpace);
1243}
1244extern "C" {
1245 #[doc = " @brief Creates an **OH_Drawing_Filter** object.\n\n @return Returns the pointer to the <b>OH_Drawing_Filter</b> object created.\n @since 11\n @version 1.0"]
1246 pub fn OH_Drawing_FilterCreate() -> *mut OH_Drawing_Filter;
1247}
1248extern "C" {
1249 #[doc = " @brief Sets an **OH_Drawing_ImageFilter** object for an **OH_Drawing_Filter** object.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **filter** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param filter Pointer to an {@link OH_Drawing_Filter} object.\n @param imageFilter Pointer to an {@link OH_Drawing_ImageFilter} object. If NULL is passed in, the image filter\n effect of the object will be cleared.\n @since 12\n @version 1.0"]
1250 pub fn OH_Drawing_FilterSetImageFilter(
1251 filter: *mut OH_Drawing_Filter,
1252 imageFilter: *mut OH_Drawing_ImageFilter,
1253 );
1254}
1255extern "C" {
1256 #[doc = " @brief Sets an **OH_Drawing_MaskFilter** object for an **OH_Drawing_Filter** object.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **filter** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param filter Pointer to an {@link OH_Drawing_Filter} object.\n @param maskFilter Pointer to an {@link OH_Drawing_ColorFilter} object. If NULL is passed in, the mask filter effect\n of the object will be cleared.\n @since 11\n @version 1.0"]
1257 pub fn OH_Drawing_FilterSetMaskFilter(
1258 filter: *mut OH_Drawing_Filter,
1259 maskFilter: *mut OH_Drawing_MaskFilter,
1260 );
1261}
1262extern "C" {
1263 #[doc = " @brief Sets an **OH_Drawing_ColorFilter** object for an **OH_Drawing_Filter** object.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **filter** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param filter Pointer to an {@link OH_Drawing_Filter} object.\n @param colorFilter Pointer to an {@link OH_Drawing_ColorFilter} object. If NULL is passed in, the color filter\n effect of the object will be cleared.\n @since 11\n @version 1.0"]
1264 pub fn OH_Drawing_FilterSetColorFilter(
1265 filter: *mut OH_Drawing_Filter,
1266 colorFilter: *mut OH_Drawing_ColorFilter,
1267 );
1268}
1269extern "C" {
1270 #[doc = " @brief Obtains an **OH_Drawing_ColorFilter** object from an **OH_Drawing_Filter** object.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **filter** or **colorFilter** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param filter Pointer to an {@link OH_Drawing_Filter} object.\n @param colorFilter Pointer to an {@link OH_Drawing_ColorFilter} object.\n @since 12\n @version 1.0"]
1271 pub fn OH_Drawing_FilterGetColorFilter(
1272 filter: *mut OH_Drawing_Filter,
1273 colorFilter: *mut OH_Drawing_ColorFilter,
1274 );
1275}
1276extern "C" {
1277 #[doc = " @brief Destroys an **OH_Drawing_Filter** object and reclaims the memory occupied by the object.\n\n @param filter Pointer to an {@link OH_Drawing_Filter} object.\n @since 11\n @version 1.0"]
1278 pub fn OH_Drawing_FilterDestroy(filter: *mut OH_Drawing_Filter);
1279}
1280extern "C" {
1281 #[doc = " @brief Creates an **OH_Drawing_Font** object.\n\n @return Returns the pointer to the **OH_Drawing_Font** object created.\n @since 11\n @version 1.0"]
1282 pub fn OH_Drawing_FontCreate() -> *mut OH_Drawing_Font;
1283}
1284#[doc = " No font hinting is used.\n\n @since 12"]
1285pub const OH_Drawing_FontHinting_FONT_HINTING_NONE: OH_Drawing_FontHinting = 0;
1286#[doc = " Slight font hinting is used to improve contrast.\n\n @since 12"]
1287pub const OH_Drawing_FontHinting_FONT_HINTING_SLIGHT: OH_Drawing_FontHinting = 1;
1288#[doc = " Normal font hinting is used to improve contrast.\n\n @since 12"]
1289pub const OH_Drawing_FontHinting_FONT_HINTING_NORMAL: OH_Drawing_FontHinting = 2;
1290#[doc = " Full font hinting is used to improve contrast.\n\n @since 12"]
1291pub const OH_Drawing_FontHinting_FONT_HINTING_FULL: OH_Drawing_FontHinting = 3;
1292#[doc = " @brief Defines an enum for the font hinting types.\n\n @since 12\n @version 1.0"]
1293pub type OH_Drawing_FontHinting = u32;
1294#[doc = " No anti-aliasing processing is used.\n\n @since 12"]
1295pub const OH_Drawing_FontEdging_FONT_EDGING_ALIAS: OH_Drawing_FontEdging = 0;
1296#[doc = " Uses anti-aliasing to smooth the jagged edges.\n\n @since 12"]
1297pub const OH_Drawing_FontEdging_FONT_EDGING_ANTI_ALIAS: OH_Drawing_FontEdging = 1;
1298#[doc = " Uses sub-pixel anti-aliasing to provide a smoother effect for jagged edges.\n\n @since 12"]
1299pub const OH_Drawing_FontEdging_FONT_EDGING_SUBPIXEL_ANTI_ALIAS: OH_Drawing_FontEdging = 2;
1300#[doc = " @brief Enumerates the font edging types.\n\n @since 12\n @version 1.0"]
1301pub type OH_Drawing_FontEdging = u32;
1302extern "C" {
1303 #[doc = " @brief Sets whether the font baselines and pixels alignment when the transformation matrix is axis aligned.\n\n @param font Indicates the pointer to an <b>OH_Drawing_Font</b> object.\n @param baselineSnap Indicates whether the font baselines and pixels alignment.\n @since 12\n @version 1.0"]
1304 pub fn OH_Drawing_FontSetBaselineSnap(font: *mut OH_Drawing_Font, baselineSnap: bool);
1305}
1306extern "C" {
1307 #[doc = " @brief Gets whether the font baselines and pixels alignment when the transformation matrix is axis aligned.\n\n @param font Indicates the pointer to an <b>OH_Drawing_Font</b> object.\n @return Returns <b>true</b> if the font baselines and pixels alignment; returns <b>false</b> otherwise.\n @since 12\n @version 1.0"]
1308 pub fn OH_Drawing_FontIsBaselineSnap(font: *const OH_Drawing_Font) -> bool;
1309}
1310extern "C" {
1311 #[doc = " @brief Sets whether to use sub-pixel rendering for a font.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param font Pointer to the {@link OH_Drawing_Font} object.\n @param isSubpixel Whether sub-pixel rendering is used for a font. **true** means yes; **false** otherwise.\n @since 12\n @version 1.0"]
1312 pub fn OH_Drawing_FontSetSubpixel(font: *mut OH_Drawing_Font, isSubpixel: bool);
1313}
1314extern "C" {
1315 #[doc = " @brief Checks whether sub-pixel rendering is used for a font.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param font Pointer to the {@link OH_Drawing_Font} object.\n @return Whether sub-pixel rendering is used for a font. **true** means yes; **false** otherwise.\n @since 12\n @version 1.0"]
1316 pub fn OH_Drawing_FontIsSubpixel(font: *const OH_Drawing_Font) -> bool;
1317}
1318extern "C" {
1319 #[doc = " @brief Sets whether to forcibly use auto hinting, that is, whether to always hint glyphs.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param font Pointer to the {@link OH_Drawing_Font} object.\n @param isForceAutoHinting Whether to forcibly use auto hinting, that is, whether to always hint glyphs. **true**\n means yes; **false** otherwise.\n @since 12\n @version 1.0"]
1320 pub fn OH_Drawing_FontSetForceAutoHinting(font: *mut OH_Drawing_Font, isForceAutoHinting: bool);
1321}
1322extern "C" {
1323 #[doc = " @brief Checks whether auto hinting is forcibly used.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param font Pointer to the {@link OH_Drawing_Font} object.\n @return Whether auto hinting is forcibly used. **true** means yes; **false** otherwise.\n @since 12\n @version 1.0"]
1324 pub fn OH_Drawing_FontIsForceAutoHinting(font: *const OH_Drawing_Font) -> bool;
1325}
1326extern "C" {
1327 #[doc = " @brief Sets a typeface for a font.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param font Pointer to an **OH_Drawing_Font** object.\n @param typeface Pointer to an **OH_Drawing_Typeface** object. If NULL is passed in, the default **\n OH_Drawing_Typeface** object is used.\n @since 11\n @version 1.0"]
1328 pub fn OH_Drawing_FontSetTypeface(
1329 font: *mut OH_Drawing_Font,
1330 typeface: *mut OH_Drawing_Typeface,
1331 );
1332}
1333extern "C" {
1334 #[doc = " @brief Obtains the typeface of a font.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param font Pointer to the {@link OH_Drawing_Font} object.\n @return Returns a pointer to the {@link OH_Drawing_Typeface} object.\n @since 12\n @version 1.0"]
1335 pub fn OH_Drawing_FontGetTypeface(font: *mut OH_Drawing_Font) -> *mut OH_Drawing_Typeface;
1336}
1337extern "C" {
1338 #[doc = " @brief Sets the text size for a font object.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param font Pointer to an **OH_Drawing_Font** object.\n @param textSize Text size. The value is a floating point number. If a negative number is passed in, the size is set\n to 0. If the size is 0, the text drawn will not be displayed.\n @since 11\n @version 1.0"]
1339 pub fn OH_Drawing_FontSetTextSize(font: *mut OH_Drawing_Font, textSize: f32);
1340}
1341extern "C" {
1342 #[doc = " @brief Obtains the text size of a font object.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param font Pointer to the {@link OH_Drawing_Font} object.\n @return Returns a floating point number representing the text size.\n @since 12\n @version 1.0"]
1343 pub fn OH_Drawing_FontGetTextSize(font: *const OH_Drawing_Font) -> f32;
1344}
1345extern "C" {
1346 #[doc = " @brief Obtains the number of glyphs represented by text.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **font** or **text** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param font Pointer to the {@link OH_Drawing_Font} object.\n @param text Pointer to the start address of the storage.\n @param byteLength Text length, in bytes.\n @param encoding Text encoding type {@link OH_Drawing_TextEncoding}.\n @return Returns the number of characters represented by the text (non-negative integer) on success;\n @since 12\n @version 1.0"]
1347 pub fn OH_Drawing_FontCountText(
1348 font: *mut OH_Drawing_Font,
1349 text: *const ::std::os::raw::c_void,
1350 byteLength: usize,
1351 encoding: OH_Drawing_TextEncoding,
1352 ) -> ::std::os::raw::c_int;
1353}
1354extern "C" {
1355 #[doc = " @brief Converts text into glyph indices.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If any of **font**, **text**, and **glyphs** is NULL, **byteLength** is **0**, or **maxGlyphCount** is less than or\n equal to 0, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param font Pointer to the {@link OH_Drawing_Font} object.\n @param text Pointer to the start address of the storage.\n @param byteLength Text length, in bytes.\n @param encoding Text encoding type {@link OH_Drawing_TextEncoding}.\n @param glyphs Pointer to the start address for storing the glyph indices.\n @param maxGlyphCount Maximum number of glyphs.\n @return Returns the number of glyph indices.\n @since 12\n @version 1.0"]
1356 pub fn OH_Drawing_FontTextToGlyphs(
1357 font: *const OH_Drawing_Font,
1358 text: *const ::std::os::raw::c_void,
1359 byteLength: u32,
1360 encoding: OH_Drawing_TextEncoding,
1361 glyphs: *mut u16,
1362 maxGlyphCount: ::std::os::raw::c_int,
1363 ) -> u32;
1364}
1365extern "C" {
1366 #[doc = " @brief Obtains the width of each glyph in a string of text.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If any of **font**, **glyphs**, and **widths** is NULL, or **count** is **0**, **OH_DRAWING_ERROR_INVALID_PARAMETER**\n is returned.\n\n @param font Pointer to the {@link OH_Drawing_Font} object.\n @param glyphs Pointer to the start address for storing the glyph indices.\n @param count Number of glyph indices.\n @param widths Pointer to the start address for storing the glyph widths.\n @since 12\n @version 1.0"]
1367 pub fn OH_Drawing_FontGetWidths(
1368 font: *const OH_Drawing_Font,
1369 glyphs: *const u16,
1370 count: ::std::os::raw::c_int,
1371 widths: *mut f32,
1372 );
1373}
1374extern "C" {
1375 #[doc = " @brief Measures the width of a single character. If the typeface of the current font does not support the character\n to measure, the system typeface is used to measure the character width.\n\n @param font Pointer to the {@link OH_Drawing_Font} object.\n @param str Pointer to the single character to measure. A string can be passed in, but only the first character in\n the string is parsed and measured in UTF-8 encoding.\n @param textWidth Pointer to the character width obtained.\n @return Returns one of the following result codes:\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if at least one of the parameters **font**, **str**, or **textWidth** is NULL,\n or the length of **str** is **0**.\n @since 12\n @version 1.0"]
1376 pub fn OH_Drawing_FontMeasureSingleCharacter(
1377 font: *const OH_Drawing_Font,
1378 str_: *const ::std::os::raw::c_char,
1379 textWidth: *mut f32,
1380 ) -> OH_Drawing_ErrorCode;
1381}
1382extern "C" {
1383 #[doc = " @brief Measures the width of a single character with font features. If the typeface of the current font does not\n support the character to measure, the system typeface is used to measure the character width.\n\n @param font Pointer to the {@link OH_Drawing_Font} object.\n @param str Pointer to the single character to measure. A string can be passed in, but only the first character in\n the string is parsed and measured in UTF-8 encoding.\n @param fontFeatures Pointer to the {@link OH_Drawing_FontFeatures} object. If no font feature is set, the preset\n font feature in the TrueType fonts (TTF) file is used.\n @param textWidth Pointer to the obtained text width, which is used as an output parameter.\n @return Execution result.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n Returns **OH_DRAWING_ERROR_INVALID_PARAMETER** if at least one of the parameters **font**, **str**, **fontFeatures**,\n or **textWidth** is NULL, or the length of **str** is **0**.\n @since 20\n @version 1.0"]
1384 #[cfg(feature = "api-20")]
1385 pub fn OH_Drawing_FontMeasureSingleCharacterWithFeatures(
1386 font: *const OH_Drawing_Font,
1387 str_: *const ::std::os::raw::c_char,
1388 fontFeatures: *const OH_Drawing_FontFeatures,
1389 textWidth: *mut f32,
1390 ) -> OH_Drawing_ErrorCode;
1391}
1392extern "C" {
1393 #[doc = " @brief Obtains the text width and bounding box.\n\n @param font Pointer to the {@link OH_Drawing_Font} object.\n @param text Pointer to the text.\n @param byteLength Length of the text, in bytes.\n @param encoding Encoding type of the text.\n @param bounds Pointer to the bounding box. The value can be NULL.\n @param textWidth Pointer to the text width.\n @return Returns one of the following result codes:\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if at least one of the parameters **font**, **text**, and **textWidth** is\n NULL, or **byteLength** is **0**.\n @since 12\n @version 1.0"]
1394 pub fn OH_Drawing_FontMeasureText(
1395 font: *const OH_Drawing_Font,
1396 text: *const ::std::os::raw::c_void,
1397 byteLength: usize,
1398 encoding: OH_Drawing_TextEncoding,
1399 bounds: *mut OH_Drawing_Rect,
1400 textWidth: *mut f32,
1401 ) -> OH_Drawing_ErrorCode;
1402}
1403extern "C" {
1404 #[doc = " @brief Obtains the width and bounding box of the text with a brush or pen.\n\n @param font Pointer to the {@link OH_Drawing_Font} object.\n @param text Pointer to the text.\n @param byteLength Length of the text, in bytes.\n @param encoding Encoding type of the text.\n @param brush Pointer to the {@link OH_Drawing_Brush} object.\n @param pen Pointer to the {@link OH_Drawing_Pen} object.\n @param bounds Pointer to the bounding box. The value can be NULL.\n @param textWidth Pointer to the text width.\n @return Operation code.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n Returns **OH_DRAWING_ERROR_INVALID_PARAMETER** if any of **font**, **text**, or **textWidth** is NULL, **byteLength**\n is **0**, or a brush and a pen both exist.\n @since 19\n @version 1.0"]
1405 #[cfg(feature = "api-19")]
1406 pub fn OH_Drawing_FontMeasureTextWithBrushOrPen(
1407 font: *const OH_Drawing_Font,
1408 text: *const ::std::os::raw::c_void,
1409 byteLength: usize,
1410 encoding: OH_Drawing_TextEncoding,
1411 brush: *const OH_Drawing_Brush,
1412 pen: *const OH_Drawing_Pen,
1413 bounds: *mut OH_Drawing_Rect,
1414 textWidth: *mut f32,
1415 ) -> OH_Drawing_ErrorCode;
1416}
1417extern "C" {
1418 #[doc = " @brief Obtains the width and bounding box of each glyph in a glyph array.\n\n @param font Pointer to the {@link OH_Drawing_Font} object.\n @param glyphs Pointer to the start address for storing the glyph indices.\n @param count Number of glyph indices, which must be the same as the size of glyphs array.\n @param brush Pointer to the {@link OH_Drawing_Brush} object.\n @param pen Pointer to the {@link OH_Drawing_Pen} object.\n @param widths Start address for storing the glyph width.\n @param bounds Start address for storing the glyph bounding box.\n @return Operation code.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n Returns **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **font** or **glyphs** is NULL, **count** is not greater\n than **0**, a brush and a pen both exist, or both **widths** and **bounds** are NULL.\n @since 19\n @version 1.0"]
1419 #[cfg(feature = "api-19")]
1420 pub fn OH_Drawing_FontGetWidthsBounds(
1421 font: *const OH_Drawing_Font,
1422 glyphs: *const u16,
1423 count: ::std::os::raw::c_int,
1424 brush: *const OH_Drawing_Brush,
1425 pen: *const OH_Drawing_Pen,
1426 widths: *mut f32,
1427 bounds: *mut OH_Drawing_Array,
1428 ) -> OH_Drawing_ErrorCode;
1429}
1430extern "C" {
1431 #[doc = " @brief Obtains the relative position of each glyph from the specified origin.\n\n @param font Pointer to the {@link OH_Drawing_Font} object.\n @param glyphs Pointer to the start address for storing the glyph indices.\n @param count Number of glyph indices, which must be the same as the size of glyphs array.\n @param origin Position of the first glyph. The value can be NULL, which means that the default value **(0, 0)** is\n used.\n @param points Start address for storing the relative position of a glyph.\n @return Operation code.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n Returns **OH_DRAWING_ERROR_INVALID_PARAMETER** if any of **font**, **glyphs**, and **points** is NULL, or **count**\n is less than or equal to **0**.\n @since 19\n @version 1.0"]
1432 #[cfg(feature = "api-19")]
1433 pub fn OH_Drawing_FontGetPos(
1434 font: *const OH_Drawing_Font,
1435 glyphs: *const u16,
1436 count: ::std::os::raw::c_int,
1437 origin: *const OH_Drawing_Point,
1438 points: *mut OH_Drawing_Point2D,
1439 ) -> OH_Drawing_ErrorCode;
1440}
1441extern "C" {
1442 #[doc = " @brief Obtains the recommended line spacing for a font.\n\n @param font Pointer to the {@link OH_Drawing_Font} object.\n @param spacing Recommended line spacing for a font.\n @return Operation code.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n Returns **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **font** or **spacing** is NULL.\n @since 19\n @version 1.0"]
1443 #[cfg(feature = "api-19")]
1444 pub fn OH_Drawing_FontGetSpacing(
1445 font: *const OH_Drawing_Font,
1446 spacing: *mut f32,
1447 ) -> OH_Drawing_ErrorCode;
1448}
1449extern "C" {
1450 #[doc = " @brief Sets linear scaling for a font.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param font Pointer to an **OH_Drawing_Font** object.\n @param isLinearText Whether to enable linear scaling. The value **true** means to enable linear scaling, and **false*\n * means the opposite.\n @since 11\n @version 1.0"]
1451 pub fn OH_Drawing_FontSetLinearText(font: *mut OH_Drawing_Font, isLinearText: bool);
1452}
1453extern "C" {
1454 #[doc = " @brief Checks whether linear scaling is used for a font object.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param font Pointer to the {@link OH_Drawing_Font} object.\n @return Returns **true** if linear scaling is used; returns **false** otherwise.\n @since 12\n @version 1.0"]
1455 pub fn OH_Drawing_FontIsLinearText(font: *const OH_Drawing_Font) -> bool;
1456}
1457extern "C" {
1458 #[doc = " @brief Sets a horizontal skew factor for a font.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param font Pointer to an **OH_Drawing_Font** object.\n @param skewX Skew of the X axis relative to the Y axis.\n @since 11\n @version 1.0"]
1459 pub fn OH_Drawing_FontSetTextSkewX(font: *mut OH_Drawing_Font, skewX: f32);
1460}
1461extern "C" {
1462 #[doc = " @brief Obtains the horizontal skew factor of a font.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param font Pointer to the {@link OH_Drawing_Font} object.\n @return Returns a floating point number representing the horizontal skew factor.\n @since 12\n @version 1.0"]
1463 pub fn OH_Drawing_FontGetTextSkewX(font: *const OH_Drawing_Font) -> f32;
1464}
1465extern "C" {
1466 #[doc = " @brief Sets fake bold for a font by increasing the stroke width.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param font Pointer to an **OH_Drawing_Font** object.\n @param isFakeBoldText Whether to set fake bold. The value **true** means to set fake bold, and **false** means the\n opposite.\n @since 11\n @version 1.0"]
1467 pub fn OH_Drawing_FontSetFakeBoldText(font: *mut OH_Drawing_Font, isFakeBoldText: bool);
1468}
1469extern "C" {
1470 #[doc = " @brief Checks whether fake bold is used for a font.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param font Pointer to the {@link OH_Drawing_Font} object.\n @return Whether fake bold is used for a font. **true** means yes; **false** otherwise.\n @since 12\n @version 1.0"]
1471 pub fn OH_Drawing_FontIsFakeBoldText(font: *const OH_Drawing_Font) -> bool;
1472}
1473extern "C" {
1474 #[doc = " @brief Sets a horizontal scale factor for a font.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param font Pointer to the {@link OH_Drawing_Font} object.\n @param scaleX Horizontal scale factor.\n @since 12\n @version 1.0"]
1475 pub fn OH_Drawing_FontSetScaleX(font: *mut OH_Drawing_Font, scaleX: f32);
1476}
1477extern "C" {
1478 #[doc = " @brief Obtains the horizontal scale ratio of this font.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param font Pointer to the {@link OH_Drawing_Font} object.\n @return Returns the horizontal scale factor.\n @since 12\n @version 1.0"]
1479 pub fn OH_Drawing_FontGetScaleX(font: *const OH_Drawing_Font) -> f32;
1480}
1481extern "C" {
1482 #[doc = " @brief Sets a font hinting effect.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n If **fontHinting** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is\n returned.\n\n @param font Pointer to the {@link OH_Drawing_Font} object.\n @param fontHinting Enumeration of font hinting types {@link OH_Drawing_FontHinting}.\n @since 12\n @version 1.0"]
1483 pub fn OH_Drawing_FontSetHinting(
1484 font: *mut OH_Drawing_Font,
1485 fontHinting: OH_Drawing_FontHinting,
1486 );
1487}
1488extern "C" {
1489 #[doc = " @brief Obtains the font hinting effect.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param font Pointer to the {@link OH_Drawing_Font} object.\n @return Returns the enumeration of font hinting types {@link OH_Drawing_FontHinting}.\n @since 12\n @version 1.0"]
1490 pub fn OH_Drawing_FontGetHinting(font: *const OH_Drawing_Font) -> OH_Drawing_FontHinting;
1491}
1492extern "C" {
1493 #[doc = " @brief Sets whether to use bitmaps in a font.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param font Pointer to the {@link OH_Drawing_Font} object.\n @param isEmbeddedBitmaps Whether to use bitmaps in the font. The value **true** means to use bitmaps in the font,\n and **false** means the opposite.\n @since 12\n @version 1.0"]
1494 pub fn OH_Drawing_FontSetEmbeddedBitmaps(font: *mut OH_Drawing_Font, isEmbeddedBitmaps: bool);
1495}
1496extern "C" {
1497 #[doc = " @brief Checks whether bitmaps are used in a font.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param font Pointer to the {@link OH_Drawing_Font} object.\n @return Returns **true** if bitmaps are used; returns **false** otherwise.\n @since 12\n @version 1.0"]
1498 pub fn OH_Drawing_FontIsEmbeddedBitmaps(font: *const OH_Drawing_Font) -> bool;
1499}
1500extern "C" {
1501 #[doc = " @brief Sets a font edging effect.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n If **fontEdging** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is\n returned.\n\n @param font Pointer to the {@link OH_Drawing_Font} object.\n @param fontEdging Font edging effect.\n @since 12\n @version 1.0"]
1502 pub fn OH_Drawing_FontSetEdging(font: *mut OH_Drawing_Font, fontEdging: OH_Drawing_FontEdging);
1503}
1504extern "C" {
1505 #[doc = " @brief Obtains the font edging effect.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param font Pointer to the {@link OH_Drawing_Font} object.\n @return Font edging effect.\n @since 12\n @version 1.0"]
1506 pub fn OH_Drawing_FontGetEdging(font: *const OH_Drawing_Font) -> OH_Drawing_FontEdging;
1507}
1508extern "C" {
1509 #[doc = " @brief Destroys an **OH_Drawing_Font** object and reclaims the memory occupied by the object.\n\n @param font Pointer to an **OH_Drawing_Font** object.\n @since 11\n @version 1.0"]
1510 pub fn OH_Drawing_FontDestroy(font: *mut OH_Drawing_Font);
1511}
1512#[doc = " @brief This struct describes the measurement information about a font.\n\n @since 12\n @version 1.0"]
1513#[repr(C)]
1514#[derive(Debug, Copy, Clone)]
1515pub struct OH_Drawing_Font_Metrics {
1516 #[doc = " Measurement information that is valid.\n\n @since 12"]
1517 pub flags: u32,
1518 #[doc = " Maximum distance from the baseline to the highest coordinate of a character.\n\n @since 12"]
1519 pub top: f32,
1520 #[doc = " Recommended distance from the baseline to the highest coordinate of a character.\n\n @since 12"]
1521 pub ascent: f32,
1522 #[doc = " Recommended distance from the baseline to the lowest coordinate of a character.\n\n @since 12"]
1523 pub descent: f32,
1524 #[doc = " Maximum distance from the baseline to the lowest coordinate of a character.\n\n @since 12"]
1525 pub bottom: f32,
1526 #[doc = " Gap between rows.\n\n @since 12"]
1527 pub leading: f32,
1528 #[doc = " Average character width, or zero if unknown.\n\n @since 12"]
1529 pub avgCharWidth: f32,
1530 #[doc = " Maximum character width, or zero if unknown.\n\n @since 12"]
1531 pub maxCharWidth: f32,
1532 #[doc = " Maximum distance to the leftmost of the font bounding box. Generally, the value is a negative value. Variable\n fonts are not recommended.\n\n @since 12"]
1533 pub xMin: f32,
1534 #[doc = " Maximum distance to the rightmost of the font bounding box. Generally, the value is a negative value. Variable\n fonts are not recommended.\n\n @since 12"]
1535 pub xMax: f32,
1536 #[doc = " Height of a lowercase letter, or zero if unknown. Generally, the value is a negative value.\n\n @since 12"]
1537 pub xHeight: f32,
1538 #[doc = " Height of an uppercase letter, or zero if unknown. Generally, the value is a negative value.\n\n @since 12"]
1539 pub capHeight: f32,
1540 #[doc = " @brief Thickness of the underline.\n\n @since 12"]
1541 pub underlineThickness: f32,
1542 #[doc = " Position of the underline, that is, vertical distance from the baseline to the top of the underline. Generally,\n the value is a positive value.\n\n @since 12"]
1543 pub underlinePosition: f32,
1544 #[doc = " Thickness of the strikethrough.\n\n @since 12"]
1545 pub strikeoutThickness: f32,
1546 #[doc = " Position of the strikethrough, that is, vertical distance from the baseline to the bottom of the strikethrough.\n Generally, the value is a negative value.\n\n @since 12"]
1547 pub strikeoutPosition: f32,
1548}
1549extern "C" {
1550 #[doc = " @brief Obtains the measurement information about a font.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **font** or **fontMetrics** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param font Pointer to the {@link OH_Drawing_Font} object.\n @param fontMetrics Pointer to the {@link OH_Drawing_Font_Metrics} object.\n @return Returns a floating-point variable that indicates the recommended interline spacing.\n @since 12\n @version 1.0"]
1551 pub fn OH_Drawing_FontGetMetrics(
1552 font: *mut OH_Drawing_Font,
1553 fontMetrics: *mut OH_Drawing_Font_Metrics,
1554 ) -> f32;
1555}
1556extern "C" {
1557 #[doc = " @brief Obtains the rectangular bounding box for each glyph in the glyph array.\n\n @param font Pointer to the {@link OH_Drawing_Font} object.\n @param glyphs Pointer to a glyph array.\n @param count Length of the glyph array.\n @param bounds Pointer to a rectangular bounding box array.\n @return Returns one of the following result codes:\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if any of **font**, **glyphs**, or **bounds** is NULL or **count** is **0**.\n @since 18\n @version 1.0"]
1558 #[cfg(feature = "api-18")]
1559 pub fn OH_Drawing_FontGetBounds(
1560 font: *const OH_Drawing_Font,
1561 glyphs: *const u16,
1562 count: u32,
1563 bounds: *mut OH_Drawing_Array,
1564 ) -> OH_Drawing_ErrorCode;
1565}
1566extern "C" {
1567 #[doc = " @brief Obtains the path of a glyph.\n\n @param font Pointer to the {@link OH_Drawing_Font} object.\n @param glyph Glyph index.\n @param path Pointer to the {@link OH_Drawing_Path} object, which is used to store the glyph path.\n @return Returns one of the following result codes:\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if **font** or **path** is NULL or the specified glyph does not exist.\n @since 18\n @version 1.0"]
1568 #[cfg(feature = "api-18")]
1569 pub fn OH_Drawing_FontGetPathForGlyph(
1570 font: *const OH_Drawing_Font,
1571 glyph: u16,
1572 path: *mut OH_Drawing_Path,
1573 ) -> OH_Drawing_ErrorCode;
1574}
1575extern "C" {
1576 #[doc = " @brief Obtains the text outline path.\n\n @param font Pointer to the {@link OH_Drawing_Font} object.\n @param text Pointer to the text string.\n @param byteLength Length of the text path. If the length is greater than the length of the text string, undefined\n behavior occurs.\n @param encoding Text encoding format. UTF-8, UTF-16, UTF-32, and glyph indices are supported. For details about the\n format, see {@link OH_Drawing_TextEncoding}.\n @param x X coordinate of the text in the drawing area, with the origin as the start point.\n @param y Y coordinate of the text in the drawing area, with the origin as the start point.\n @param path Pointer to the text outline path.\n @return Returns one of the following error codes:\n Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.\n Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if any of **font**, **text**, or **path** is NULL.\n @since 18"]
1577 #[cfg(feature = "api-18")]
1578 pub fn OH_Drawing_FontGetTextPath(
1579 font: *const OH_Drawing_Font,
1580 text: *const ::std::os::raw::c_void,
1581 byteLength: usize,
1582 encoding: OH_Drawing_TextEncoding,
1583 x: f32,
1584 y: f32,
1585 path: *mut OH_Drawing_Path,
1586 ) -> OH_Drawing_ErrorCode;
1587}
1588extern "C" {
1589 #[doc = " @brief Gets the path outline for the given text with font fallback support.\n\n @param font Indicates the pointer to an <b>OH_Drawing_Font</b> object.\n @param text Indicates the pointer to the text data.\n @param byteLength Indicates the length of the text in bytes.\n @param encoding Indicates the text encoding type.\n @param x Indicates the x coordinate for the text path.\n @param y Indicates the y coordinate for the text path.\n @param path Indicates the pointer to an <b>OH_Drawing_Path</b> object to store the text path outline.\n @return Returns the error code.\n Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.\n Returns {@link OH_DRAWING_ERROR_INCORRECT_PARAMETER} if any of font, text or path is nullptr, or\n byteLength is 0.\n @since 26.0.0"]
1590 #[cfg(feature = "api-26")]
1591 pub fn OH_Drawing_FontGetTextPathWithFallback(
1592 font: *const OH_Drawing_Font,
1593 text: *const ::std::os::raw::c_void,
1594 byteLength: usize,
1595 encoding: OH_Drawing_TextEncoding,
1596 x: f32,
1597 y: f32,
1598 path: *mut OH_Drawing_Path,
1599 ) -> OH_Drawing_ErrorCode;
1600}
1601extern "C" {
1602 #[doc = " @brief Creates an **OH_Drawing_FontFeatures** object.\n\n @return Returns a pointer to the created {@link OH_Drawing_FontFeatures} object.\n If a null pointer is returned, the creation fails. A possible cause is that no memory is available.\n @since 20\n @version 1.0"]
1603 #[cfg(feature = "api-20")]
1604 pub fn OH_Drawing_FontFeaturesCreate() -> *mut OH_Drawing_FontFeatures;
1605}
1606extern "C" {
1607 #[doc = " @brief Adds a font feature to an **OH_Drawing_FontFeatures** object.\n\n @param fontFeatures Pointer to the {@link OH_Drawing_FontFeatures} object.\n @param name Name of a font feature. Common font feature names include **liga**, **frac**, and **case**. A font\n feature needs a TTF file to work.\n @param value Value of the font feature. You are advised to determine the valid value range by using a font viewing\n tool or referring to the font document.\n @return Execution result.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n Returns **OH_DRAWING_ERROR_INVALID_PARAMETER** if **fontFeatures** or **name** is a null pointer.\n @since 20\n @version 1.0"]
1608 #[cfg(feature = "api-20")]
1609 pub fn OH_Drawing_FontFeaturesAddFeature(
1610 fontFeatures: *mut OH_Drawing_FontFeatures,
1611 name: *const ::std::os::raw::c_char,
1612 value: f32,
1613 ) -> OH_Drawing_ErrorCode;
1614}
1615extern "C" {
1616 #[doc = " @brief Destroys an **OH_Drawing_FontFeatures** object and reclaims the memory occupied by the object.\n\n @param fontFeatures Pointer to the {@link OH_Drawing_FontFeatures} object.\n @return Execution result.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n Returns **OH_DRAWING_ERROR_INVALID_PARAMETER** if **fontFeatures** is NULL.\n @since 20\n @version 1.0"]
1617 #[cfg(feature = "api-20")]
1618 pub fn OH_Drawing_FontFeaturesDestroy(
1619 fontFeatures: *mut OH_Drawing_FontFeatures,
1620 ) -> OH_Drawing_ErrorCode;
1621}
1622extern "C" {
1623 #[doc = " @brief Sets whether to follow the theme font. When **followed** is set to **true**, the theme font is used if it is\n enabled by the system and no typeface is set.\n\n @param font Pointer to the {@link OH_Drawing_Font} object.\n @param followed Whether to follow the theme font. The value **true** means to follow the theme font, and **false**\n means the opposite.\n @return Returns one of the following result codes:\n **OH_DRAWING_SUCCESS** if the operation is successful.\n Returns **OH_DRAWING_ERROR_INVALID_PARAMETER** if **font** is NULL.\n @since 15"]
1624 #[cfg(feature = "api-15")]
1625 pub fn OH_Drawing_FontSetThemeFontFollowed(
1626 font: *mut OH_Drawing_Font,
1627 followed: bool,
1628 ) -> OH_Drawing_ErrorCode;
1629}
1630extern "C" {
1631 #[doc = " @brief Checks whether the font follows the theme font. By default, the theme font is not followed.\n\n @param font Pointer to the {@link OH_Drawing_Font} object.\n @param followed Check result. The value **true** means that the theme font is followed, and **false** means the\n opposite. It is used as an output parameter.\n @return Returns one of the following result codes:\n **OH_DRAWING_SUCCESS** if the operation is successful.\n Returns **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **font** or **followed** is NULL.\n @since 15"]
1632 #[cfg(feature = "api-15")]
1633 pub fn OH_Drawing_FontIsThemeFontFollowed(
1634 font: *const OH_Drawing_Font,
1635 followed: *mut bool,
1636 ) -> OH_Drawing_ErrorCode;
1637}
1638#[repr(C)]
1639#[derive(Debug, Copy, Clone)]
1640pub struct OH_Drawing_FontCollection {
1641 _unused: [u8; 0],
1642}
1643#[repr(C)]
1644#[derive(Debug, Copy, Clone)]
1645pub struct OH_Drawing_Typography {
1646 _unused: [u8; 0],
1647}
1648#[cfg(feature = "api-18")]
1649#[repr(C)]
1650#[derive(Debug, Copy, Clone)]
1651pub struct OH_Drawing_LineTypography {
1652 _unused: [u8; 0],
1653}
1654#[repr(C)]
1655#[derive(Debug, Copy, Clone)]
1656pub struct OH_Drawing_TextStyle {
1657 _unused: [u8; 0],
1658}
1659#[repr(C)]
1660#[derive(Debug, Copy, Clone)]
1661pub struct OH_Drawing_TypographyStyle {
1662 _unused: [u8; 0],
1663}
1664#[repr(C)]
1665#[derive(Debug, Copy, Clone)]
1666pub struct OH_Drawing_TypographyCreate {
1667 _unused: [u8; 0],
1668}
1669#[repr(C)]
1670#[derive(Debug, Copy, Clone)]
1671pub struct OH_Drawing_TextBox {
1672 _unused: [u8; 0],
1673}
1674#[repr(C)]
1675#[derive(Debug, Copy, Clone)]
1676pub struct OH_Drawing_PositionAndAffinity {
1677 _unused: [u8; 0],
1678}
1679#[repr(C)]
1680#[derive(Debug, Copy, Clone)]
1681pub struct OH_Drawing_Range {
1682 _unused: [u8; 0],
1683}
1684#[repr(C)]
1685#[derive(Debug, Copy, Clone)]
1686pub struct OH_Drawing_FontParser {
1687 _unused: [u8; 0],
1688}
1689#[repr(C)]
1690#[derive(Debug, Copy, Clone)]
1691pub struct OH_Drawing_TextShadow {
1692 _unused: [u8; 0],
1693}
1694#[cfg(feature = "api-18")]
1695#[repr(C)]
1696#[derive(Debug, Copy, Clone)]
1697pub struct OH_Drawing_TextTab {
1698 _unused: [u8; 0],
1699}
1700#[cfg(feature = "api-18")]
1701#[repr(C)]
1702#[derive(Debug, Copy, Clone)]
1703pub struct OH_Drawing_TextLine {
1704 _unused: [u8; 0],
1705}
1706#[cfg(feature = "api-18")]
1707#[repr(C)]
1708#[derive(Debug, Copy, Clone)]
1709pub struct OH_Drawing_Run {
1710 _unused: [u8; 0],
1711}
1712#[cfg(feature = "api-22")]
1713#[repr(C)]
1714#[derive(Debug, Copy, Clone)]
1715pub struct OH_Drawing_FontFullDescriptor {
1716 _unused: [u8; 0],
1717}
1718#[cfg(feature = "api-24")]
1719#[repr(C)]
1720#[derive(Debug, Copy, Clone)]
1721pub struct OH_Drawing_FontVariationAxis {
1722 _unused: [u8; 0],
1723}
1724#[cfg(feature = "api-24")]
1725#[repr(C)]
1726#[derive(Debug, Copy, Clone)]
1727pub struct OH_Drawing_FontVariationInstance {
1728 _unused: [u8; 0],
1729}
1730extern "C" {
1731 #[doc = " @brief Creates an {@link OH_Drawing_FontCollection} object.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @return Pointer to the created font collection object. The font collection pointer object created by this function\n can only be used by one {@link OH_Drawing_TypographyCreate} object and does not support shared use among\n multiple OH_Drawing_TypographyCreate objects. To share the same OH_Drawing_FontCollection among multiple\n OH_Drawing_TypographyCreate objects, use the {@link OH_Drawing_CreateSharedFontCollection} function to create\n the OH_Drawing_FontCollection object.\n @since 8\n @version 1.0"]
1732 pub fn OH_Drawing_CreateFontCollection() -> *mut OH_Drawing_FontCollection;
1733}
1734extern "C" {
1735 #[doc = " @brief Destroys an **OH_Drawing_FontCollection** object and reclaims the memory occupied by the object.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param fontCollection Pointer to an **OH_Drawing_FontCollection** object.\n @since 8\n @version 1.0"]
1736 pub fn OH_Drawing_DestroyFontCollection(fontCollection: *mut OH_Drawing_FontCollection);
1737}
1738extern "C" {
1739 #[doc = " @brief Disables the system fonts.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param fontCollection Pointer to an {@link OH_Drawing_FontCollection} object.\n @since 12\n @version 1.0\n @deprecated since 18\n @useinstead OH_Drawing_DisableFontCollectionSystemFont"]
1740 pub fn OH_Drawing_DisableFontCollectionFallback(fontCollection: *mut OH_Drawing_FontCollection);
1741}
1742extern "C" {
1743 #[doc = " @brief Disables system fonts. After disabling, the font collection object can only use registered custom fonts for\n text rendering.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param fontCollection Pointer to the font collection object {@link OH_Drawing_FontCollection} for which system fonts\n are to be disabled.\n @since 12\n @version 1.0"]
1744 pub fn OH_Drawing_DisableFontCollectionSystemFont(
1745 fontCollection: *mut OH_Drawing_FontCollection,
1746 );
1747}
1748extern "C" {
1749 #[doc = " @brief Creates a shareable {@link OH_Drawing_FontCollection} object.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @return Pointer to the created font collection object, which can be used by multiple\n {@link OH_Drawing_TypographyCreate} objects.\n @since 12\n @version 1.0"]
1750 pub fn OH_Drawing_CreateSharedFontCollection() -> *mut OH_Drawing_FontCollection;
1751}
1752extern "C" {
1753 #[doc = " @brief Clears the font cache. (The font cache has a memory limit and a clearing mechanism. It occupies limited\n memory. You are not advised to clear it unless otherwise required.)\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param fontCollection Pointer to an {@link OH_Drawing_FontCollection} object.\n @since 12\n @version 1.0"]
1754 pub fn OH_Drawing_ClearFontCaches(fontCollection: *mut OH_Drawing_FontCollection);
1755}
1756extern "C" {
1757 #[doc = " @brief Obtains the global font collection object {@link OH_Drawing_FontCollection}, which can be used to obtain\n theme font information. This object is prohibited from being released.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @return Pointer to the global font collection object, which can be used by multiple\n {@link OH_Drawing_TypographyCreate} objects and is prohibited from being released.\n @since 14\n @version 1.0"]
1758 #[cfg(feature = "api-14")]
1759 pub fn OH_Drawing_GetFontCollectionGlobalInstance() -> *mut OH_Drawing_FontCollection;
1760}
1761#[doc = " Right to left (RTL)."]
1762pub const OH_Drawing_TextDirection_TEXT_DIRECTION_RTL: OH_Drawing_TextDirection = 0;
1763#[doc = " Left to right (LTR)."]
1764pub const OH_Drawing_TextDirection_TEXT_DIRECTION_LTR: OH_Drawing_TextDirection = 1;
1765#[doc = " @brief Enumerates the text directions.\n\n @since 8\n @version 1.0"]
1766pub type OH_Drawing_TextDirection = u32;
1767#[doc = " Left-aligned."]
1768pub const OH_Drawing_TextAlign_TEXT_ALIGN_LEFT: OH_Drawing_TextAlign = 0;
1769#[doc = " Right-aligned."]
1770pub const OH_Drawing_TextAlign_TEXT_ALIGN_RIGHT: OH_Drawing_TextAlign = 1;
1771#[doc = " Center-aligned."]
1772pub const OH_Drawing_TextAlign_TEXT_ALIGN_CENTER: OH_Drawing_TextAlign = 2;
1773#[doc = " Justified, which means that each line (except the last line) is stretched so that every line has equal width,\n and the left and right margins are straight."]
1774pub const OH_Drawing_TextAlign_TEXT_ALIGN_JUSTIFY: OH_Drawing_TextAlign = 3;
1775#[doc = " When **OH_Drawing_TextDirection** is set to **TEXT_DIRECTION_LTR**, **TEXT_ALIGN_START** and **TEXT_ALIGN_LEFT**\n are the same.<br>Similarly, when **OH_Drawing_TextDirection** is set to **TEXT_DIRECTION_RTL**, **\n TEXT_ALIGN_START** and **TEXT_ALIGN_RIGHT** are the same."]
1776pub const OH_Drawing_TextAlign_TEXT_ALIGN_START: OH_Drawing_TextAlign = 4;
1777#[doc = " When **OH_Drawing_TextDirection** is set to **TEXT_DIRECTION_LTR**, **TEXT_ALIGN_END** and **TEXT_ALIGN_RIGHT**\n are the same.<br>Similarly, when **OH_Drawing_TextDirection** is set to **TEXT_DIRECTION_RTL**, **TEXT_ALIGN_END*\n * and **TEXT_ALIGN_LEFT** are the same."]
1778pub const OH_Drawing_TextAlign_TEXT_ALIGN_END: OH_Drawing_TextAlign = 5;
1779#[doc = " @brief Enumerates the text alignment modes.\n\n @since 8\n @version 1.0"]
1780pub type OH_Drawing_TextAlign = u32;
1781#[doc = " Thin."]
1782pub const OH_Drawing_FontWeight_FONT_WEIGHT_100: OH_Drawing_FontWeight = 0;
1783#[doc = " Extra-light."]
1784pub const OH_Drawing_FontWeight_FONT_WEIGHT_200: OH_Drawing_FontWeight = 1;
1785#[doc = " Light."]
1786pub const OH_Drawing_FontWeight_FONT_WEIGHT_300: OH_Drawing_FontWeight = 2;
1787#[doc = " Normal/Regular."]
1788pub const OH_Drawing_FontWeight_FONT_WEIGHT_400: OH_Drawing_FontWeight = 3;
1789#[doc = " Medium."]
1790pub const OH_Drawing_FontWeight_FONT_WEIGHT_500: OH_Drawing_FontWeight = 4;
1791#[doc = " Semi-bold."]
1792pub const OH_Drawing_FontWeight_FONT_WEIGHT_600: OH_Drawing_FontWeight = 5;
1793#[doc = " Bold."]
1794pub const OH_Drawing_FontWeight_FONT_WEIGHT_700: OH_Drawing_FontWeight = 6;
1795#[doc = " Extra-bold."]
1796pub const OH_Drawing_FontWeight_FONT_WEIGHT_800: OH_Drawing_FontWeight = 7;
1797#[doc = " Black."]
1798pub const OH_Drawing_FontWeight_FONT_WEIGHT_900: OH_Drawing_FontWeight = 8;
1799#[doc = " @brief Enumerates the font weights.\n\n @since 8\n @version 1.0"]
1800pub type OH_Drawing_FontWeight = u32;
1801#[doc = " Alphabetic, where the letters in alphabets like English sit on."]
1802pub const OH_Drawing_TextBaseline_TEXT_BASELINE_ALPHABETIC: OH_Drawing_TextBaseline = 0;
1803#[doc = " Ideographic, where the baseline is at the bottom of the text area."]
1804pub const OH_Drawing_TextBaseline_TEXT_BASELINE_IDEOGRAPHIC: OH_Drawing_TextBaseline = 1;
1805#[doc = " @brief Enumerates the text baselines.\n\n @since 8\n @version 1.0"]
1806pub type OH_Drawing_TextBaseline = u32;
1807#[doc = " No decoration."]
1808pub const OH_Drawing_TextDecoration_TEXT_DECORATION_NONE: OH_Drawing_TextDecoration = 0;
1809#[doc = " An underline is used for decoration."]
1810pub const OH_Drawing_TextDecoration_TEXT_DECORATION_UNDERLINE: OH_Drawing_TextDecoration = 1;
1811#[doc = " An overline is used for decoration."]
1812pub const OH_Drawing_TextDecoration_TEXT_DECORATION_OVERLINE: OH_Drawing_TextDecoration = 2;
1813#[doc = " A strikethrough is used for decoration."]
1814pub const OH_Drawing_TextDecoration_TEXT_DECORATION_LINE_THROUGH: OH_Drawing_TextDecoration = 4;
1815#[doc = " @brief Enumerates the text decorations.\n\n @since 8\n @version 1.0"]
1816pub type OH_Drawing_TextDecoration = u32;
1817#[doc = " Normal style."]
1818pub const OH_Drawing_FontStyle_FONT_STYLE_NORMAL: OH_Drawing_FontStyle = 0;
1819#[doc = " Italic."]
1820pub const OH_Drawing_FontStyle_FONT_STYLE_ITALIC: OH_Drawing_FontStyle = 1;
1821#[doc = " Oblique."]
1822pub const OH_Drawing_FontStyle_FONT_STYLE_OBLIQUE: OH_Drawing_FontStyle = 2;
1823#[doc = " @brief Font styles, including non-italic, italic, and oblique.\n\n @since 8\n @version 1.0"]
1824pub type OH_Drawing_FontStyle = u32;
1825#[doc = " Aligned to the baseline."]
1826pub const OH_Drawing_PlaceholderVerticalAlignment_ALIGNMENT_OFFSET_AT_BASELINE:
1827 OH_Drawing_PlaceholderVerticalAlignment = 0;
1828#[doc = " Aligned above the baseline."]
1829pub const OH_Drawing_PlaceholderVerticalAlignment_ALIGNMENT_ABOVE_BASELINE:
1830 OH_Drawing_PlaceholderVerticalAlignment = 1;
1831#[doc = " Aligned below the baseline."]
1832pub const OH_Drawing_PlaceholderVerticalAlignment_ALIGNMENT_BELOW_BASELINE:
1833 OH_Drawing_PlaceholderVerticalAlignment = 2;
1834#[doc = " Aligned to the top of the row box."]
1835pub const OH_Drawing_PlaceholderVerticalAlignment_ALIGNMENT_TOP_OF_ROW_BOX:
1836 OH_Drawing_PlaceholderVerticalAlignment = 3;
1837#[doc = " Aligned to the bottom of the row box."]
1838pub const OH_Drawing_PlaceholderVerticalAlignment_ALIGNMENT_BOTTOM_OF_ROW_BOX:
1839 OH_Drawing_PlaceholderVerticalAlignment = 4;
1840#[doc = " Aligned to the center of the row box."]
1841pub const OH_Drawing_PlaceholderVerticalAlignment_ALIGNMENT_CENTER_OF_ROW_BOX:
1842 OH_Drawing_PlaceholderVerticalAlignment = 5;
1843#[doc = " Follows the text vertical alignment.\n @since 20"]
1844#[cfg(feature = "api-20")]
1845pub const OH_Drawing_PlaceholderVerticalAlignment_ALIGNMENT_FOLLOW_PARAGRAPH:
1846 OH_Drawing_PlaceholderVerticalAlignment = 6;
1847#[doc = " @brief Enumerates the vertical alignment modes of placeholders.\n\n @since 11\n @version 1.0"]
1848pub type OH_Drawing_PlaceholderVerticalAlignment = u32;
1849#[doc = " @brief This struct describes the placeholder that acts as a span.\n\n @since 11\n @version 1.0"]
1850#[repr(C)]
1851#[derive(Debug, Copy, Clone)]
1852pub struct OH_Drawing_PlaceholderSpan {
1853 #[doc = " Width of a placeholder."]
1854 pub width: f64,
1855 #[doc = " Height of a placeholder."]
1856 pub height: f64,
1857 #[doc = " Alignment mode of a placeholder."]
1858 pub alignment: OH_Drawing_PlaceholderVerticalAlignment,
1859 #[doc = " Baseline of a placeholder."]
1860 pub baseline: OH_Drawing_TextBaseline,
1861 #[doc = " Baseline offset of a placeholder."]
1862 pub baselineOffset: f64,
1863}
1864#[doc = " Solid style."]
1865pub const OH_Drawing_TextDecorationStyle_TEXT_DECORATION_STYLE_SOLID:
1866 OH_Drawing_TextDecorationStyle = 0;
1867#[doc = " Double style."]
1868pub const OH_Drawing_TextDecorationStyle_TEXT_DECORATION_STYLE_DOUBLE:
1869 OH_Drawing_TextDecorationStyle = 1;
1870#[doc = " Dotted style."]
1871pub const OH_Drawing_TextDecorationStyle_TEXT_DECORATION_STYLE_DOTTED:
1872 OH_Drawing_TextDecorationStyle = 2;
1873#[doc = " Dashed style."]
1874pub const OH_Drawing_TextDecorationStyle_TEXT_DECORATION_STYLE_DASHED:
1875 OH_Drawing_TextDecorationStyle = 3;
1876#[doc = " Wavy style."]
1877pub const OH_Drawing_TextDecorationStyle_TEXT_DECORATION_STYLE_WAVY:
1878 OH_Drawing_TextDecorationStyle = 4;
1879#[doc = " @brief Enumerates the text decoration styles.\n\n @since 11\n @version 1.0"]
1880pub type OH_Drawing_TextDecorationStyle = u32;
1881#[doc = " Header ellipsis mode, that is, the ellipsis appears at the beginning of a line. This enumerated value is valid\n only when the maximum number of text lines is set to **1** by calling\n {@link OH_Drawing_SetTypographyTextMaxLines}."]
1882pub const OH_Drawing_EllipsisModal_ELLIPSIS_MODAL_HEAD: OH_Drawing_EllipsisModal = 0;
1883#[doc = " Middle ellipsis mode, that is, the ellipsis appears in the middle of a line. This enumerated value is valid only\n when the maximum number of text lines is set to **1** by calling {@link OH_Drawing_SetTypographyTextMaxLines}."]
1884pub const OH_Drawing_EllipsisModal_ELLIPSIS_MODAL_MIDDLE: OH_Drawing_EllipsisModal = 1;
1885#[doc = " End ellipsis mode, that is, the ellipsis appears at the end of a line. This enumerated value is valid when the\n maximum number of text lines is set to any value by calling {@link OH_Drawing_SetTypographyTextMaxLines}."]
1886pub const OH_Drawing_EllipsisModal_ELLIPSIS_MODAL_TAIL: OH_Drawing_EllipsisModal = 2;
1887#[doc = " Header ellipsis mode, that is, the ellipsis appears at the beginning of a line. This enumerated value is valid\n when the maximum number of text lines is set to any value by calling\n {@link OH_Drawing_SetTypographyTextMaxLines}.\n @since 24"]
1888#[cfg(feature = "api-24")]
1889pub const OH_Drawing_EllipsisModal_ELLIPSIS_MODAL_MULTILINE_HEAD: OH_Drawing_EllipsisModal = 3;
1890#[doc = " Middle ellipsis mode, that is, the ellipsis appears in the middle of a line. This enumerated value is valid when\n the maximum number of text lines is set to any value by calling {@link OH_Drawing_SetTypographyTextMaxLines}.\n @since 24"]
1891#[cfg(feature = "api-24")]
1892pub const OH_Drawing_EllipsisModal_ELLIPSIS_MODAL_MULTILINE_MIDDLE: OH_Drawing_EllipsisModal = 4;
1893#[doc = " @brief Enumerates the ellipsis styles.\n\n @since 11\n @version 1.0"]
1894pub type OH_Drawing_EllipsisModal = u32;
1895#[doc = " Each line is filled as much as possible during line break."]
1896pub const OH_Drawing_BreakStrategy_BREAK_STRATEGY_GREEDY: OH_Drawing_BreakStrategy = 0;
1897#[doc = " Text continuity is preferentially considered during line break."]
1898pub const OH_Drawing_BreakStrategy_BREAK_STRATEGY_HIGH_QUALITY: OH_Drawing_BreakStrategy = 1;
1899#[doc = " Line breaks are performed at the word boundary."]
1900pub const OH_Drawing_BreakStrategy_BREAK_STRATEGY_BALANCED: OH_Drawing_BreakStrategy = 2;
1901#[doc = " @brief Enumerates the text break strategies.\n\n @since 11\n @version 1.0"]
1902pub type OH_Drawing_BreakStrategy = u32;
1903#[doc = " Normal mode."]
1904pub const OH_Drawing_WordBreakType_WORD_BREAK_TYPE_NORMAL: OH_Drawing_WordBreakType = 0;
1905#[doc = " Breaks the words at any character to prevent overflow."]
1906pub const OH_Drawing_WordBreakType_WORD_BREAK_TYPE_BREAK_ALL: OH_Drawing_WordBreakType = 1;
1907#[doc = " Breaks the words at arbitrary points to prevent overflow."]
1908pub const OH_Drawing_WordBreakType_WORD_BREAK_TYPE_BREAK_WORD: OH_Drawing_WordBreakType = 2;
1909#[doc = " Attempts to break words at the end of each line by inserting a hyphen (\"-\"). If a hyphen cannot be added, the\n behavior is the same as `WORD_BREAK_TYPE_BREAK_WORD`.\n @since 18"]
1910#[cfg(feature = "api-18")]
1911pub const OH_Drawing_WordBreakType_WORD_BREAK_TYPE_BREAK_HYPHEN: OH_Drawing_WordBreakType = 3;
1912#[doc = " @brief Enumerates the word break types.\n\n @since 11\n @version 1.0"]
1913pub type OH_Drawing_WordBreakType = u32;
1914#[doc = " Tight style. The text box height closely fits the text content boundary."]
1915pub const OH_Drawing_RectHeightStyle_RECT_HEIGHT_STYLE_TIGHT: OH_Drawing_RectHeightStyle = 0;
1916#[doc = " Max style. The text box height takes the maximum height among all lines."]
1917pub const OH_Drawing_RectHeightStyle_RECT_HEIGHT_STYLE_MAX: OH_Drawing_RectHeightStyle = 1;
1918#[doc = " Include line spacing middle style. The text box height includes the middle portion of the line spacing."]
1919pub const OH_Drawing_RectHeightStyle_RECT_HEIGHT_STYLE_INCLUDELINESPACEMIDDLE:
1920 OH_Drawing_RectHeightStyle = 2;
1921#[doc = " Include line spacing top style. The text box height includes the top portion of the line spacing."]
1922pub const OH_Drawing_RectHeightStyle_RECT_HEIGHT_STYLE_INCLUDELINESPACETOP:
1923 OH_Drawing_RectHeightStyle = 3;
1924#[doc = " Include line spacing bottom style. The text box height includes the bottom portion of the line spacing."]
1925pub const OH_Drawing_RectHeightStyle_RECT_HEIGHT_STYLE_INCLUDELINESPACEBOTTOM:
1926 OH_Drawing_RectHeightStyle = 4;
1927#[doc = " Struct style. The Strut Style determines the text box height."]
1928pub const OH_Drawing_RectHeightStyle_RECT_HEIGHT_STYLE_STRUCT: OH_Drawing_RectHeightStyle = 5;
1929#[doc = " @brief Enumerates the rectangle height styles.\n\n @since 11\n @version 1.0"]
1930pub type OH_Drawing_RectHeightStyle = u32;
1931#[doc = " Tight style. The text box height closely fits the text content boundary."]
1932pub const OH_Drawing_RectWidthStyle_RECT_WIDTH_STYLE_TIGHT: OH_Drawing_RectWidthStyle = 0;
1933#[doc = " Max style. The text box height takes the maximum height among all lines."]
1934pub const OH_Drawing_RectWidthStyle_RECT_WIDTH_STYLE_MAX: OH_Drawing_RectWidthStyle = 1;
1935#[doc = " @brief Enumerates the rectangle width styles.\n\n @since 11\n @version 1.0"]
1936pub type OH_Drawing_RectWidthStyle = u32;
1937#[doc = " Operation successful."]
1938pub const OH_Drawing_FontConfigInfoErrorCode_SUCCESS_FONT_CONFIG_INFO:
1939 OH_Drawing_FontConfigInfoErrorCode = 0;
1940#[doc = " Unknown error."]
1941pub const OH_Drawing_FontConfigInfoErrorCode_ERROR_FONT_CONFIG_INFO_UNKNOWN:
1942 OH_Drawing_FontConfigInfoErrorCode = 1;
1943#[doc = " Failed to parse the system configuration file."]
1944pub const OH_Drawing_FontConfigInfoErrorCode_ERROR_FONT_CONFIG_INFO_PARSE_FILE:
1945 OH_Drawing_FontConfigInfoErrorCode = 2;
1946#[doc = " Memory allocation fails."]
1947pub const OH_Drawing_FontConfigInfoErrorCode_ERROR_FONT_CONFIG_INFO_ALLOC_MEMORY:
1948 OH_Drawing_FontConfigInfoErrorCode = 3;
1949#[doc = " Failed to copy the string data."]
1950pub const OH_Drawing_FontConfigInfoErrorCode_ERROR_FONT_CONFIG_INFO_COPY_STRING_DATA:
1951 OH_Drawing_FontConfigInfoErrorCode = 4;
1952#[doc = " @brief Enumerates the error codes for the system font configuration information list.\n\n @since 12\n @version 1.0"]
1953pub type OH_Drawing_FontConfigInfoErrorCode = u32;
1954#[doc = " @brief This struct describes the information about a font fallback.\n\n @since 12\n @version 1.0"]
1955#[repr(C)]
1956#[derive(Debug, Copy, Clone)]
1957pub struct OH_Drawing_FontFallbackInfo {
1958 #[doc = " Pointer to the language supported by the font fallback. The language format is bcp47."]
1959 pub language: *mut ::std::os::raw::c_char,
1960 #[doc = " Pointer to the name of a font family."]
1961 pub familyName: *mut ::std::os::raw::c_char,
1962}
1963#[doc = " @brief This struct describes the information about a font fallback group.\n\n @since 12\n @version 1.0"]
1964#[repr(C)]
1965#[derive(Debug, Copy, Clone)]
1966pub struct OH_Drawing_FontFallbackGroup {
1967 #[doc = " Name of the font set corresponding to the fallback font group. If the value is empty, all fonts in the fallback\n font set list can be used."]
1968 pub groupName: *mut ::std::os::raw::c_char,
1969 #[doc = " Number of font fallbacks."]
1970 pub fallbackInfoSize: usize,
1971 #[doc = " List of fallback font sets."]
1972 pub fallbackInfoSet: *mut OH_Drawing_FontFallbackInfo,
1973}
1974#[doc = " @brief This struct describes the information about a font weight mapping.\n\n @since 12\n @version 1.0"]
1975#[repr(C)]
1976#[derive(Debug, Copy, Clone)]
1977pub struct OH_Drawing_FontAdjustInfo {
1978 #[doc = " Original font weight."]
1979 pub weight: ::std::os::raw::c_int,
1980 #[doc = " Font weight displayed in the application."]
1981 pub to: ::std::os::raw::c_int,
1982}
1983#[doc = " @brief This struct describes the information about a font alias.\n\n @since 12\n @version 1.0"]
1984#[repr(C)]
1985#[derive(Debug, Copy, Clone)]
1986pub struct OH_Drawing_FontAliasInfo {
1987 #[doc = " Pointer to the name of a font family."]
1988 pub familyName: *mut ::std::os::raw::c_char,
1989 #[doc = " Font weight value. If the value is greater than 0, the font family contains only the font with the specified\n weight. If the value is 0, the font family contains all fonts."]
1990 pub weight: ::std::os::raw::c_int,
1991}
1992#[doc = " @brief This struct describes the information about generic fonts supported by the system.\n\n @since 12\n @version 1.0"]
1993#[repr(C)]
1994#[derive(Debug, Copy, Clone)]
1995pub struct OH_Drawing_FontGenericInfo {
1996 #[doc = " Pointer to the name of a font family."]
1997 pub familyName: *mut ::std::os::raw::c_char,
1998 #[doc = " Number of font aliases."]
1999 pub aliasInfoSize: usize,
2000 #[doc = " Number of font weight mappings."]
2001 pub adjustInfoSize: usize,
2002 #[doc = " Pointer to a set of font aliases."]
2003 pub aliasInfoSet: *mut OH_Drawing_FontAliasInfo,
2004 #[doc = " Pointer to a set of font weight mappings."]
2005 pub adjustInfoSet: *mut OH_Drawing_FontAdjustInfo,
2006}
2007#[doc = " @brief This struct describes the information about a system font configuration.\n\n @since 12\n @version 1.0"]
2008#[repr(C)]
2009#[derive(Debug, Copy, Clone)]
2010pub struct OH_Drawing_FontConfigInfo {
2011 #[doc = " Number of system font file paths."]
2012 pub fontDirSize: usize,
2013 #[doc = " Number of generic fonts."]
2014 pub fontGenericInfoSize: usize,
2015 #[doc = " Number of font fallbacks."]
2016 pub fallbackGroupSize: usize,
2017 #[doc = " Double pointer to the system font file paths."]
2018 pub fontDirSet: *mut *mut ::std::os::raw::c_char,
2019 #[doc = " Pointer to a set of generic fonts."]
2020 pub fontGenericInfoSet: *mut OH_Drawing_FontGenericInfo,
2021 #[doc = " Pointer to a set of font fallbacks."]
2022 pub fallbackGroupSet: *mut OH_Drawing_FontFallbackGroup,
2023}
2024#[doc = " @brief This struct describes the detailed information about a system font.\n\n @since 12\n @version 1.0"]
2025#[repr(C)]
2026#[derive(Debug, Copy, Clone)]
2027pub struct OH_Drawing_FontDescriptor {
2028 #[doc = " File path of the system font."]
2029 pub path: *mut ::std::os::raw::c_char,
2030 #[doc = " PostScript name that uniquely identifies the system font."]
2031 pub postScriptName: *mut ::std::os::raw::c_char,
2032 #[doc = " Full name of the system font."]
2033 pub fullName: *mut ::std::os::raw::c_char,
2034 #[doc = " Family of the system font."]
2035 pub fontFamily: *mut ::std::os::raw::c_char,
2036 #[doc = " Subfamily of the system font."]
2037 pub fontSubfamily: *mut ::std::os::raw::c_char,
2038 #[doc = " Weight of the system font."]
2039 pub weight: ::std::os::raw::c_int,
2040 #[doc = " Width of the system font."]
2041 pub width: ::std::os::raw::c_int,
2042 #[doc = " Slope of the system font."]
2043 pub italic: ::std::os::raw::c_int,
2044 #[doc = " Whether the system font is monospace. The value true means the font is monospace, and false means the opposite."]
2045 pub monoSpace: bool,
2046 #[doc = " Whether the system font supports symbols. **true** means yes; **false** otherwise."]
2047 pub symbolic: bool,
2048}
2049#[doc = " @brief This struct describes the measurement information about a line of text.\n\n @since 12\n @version 1.0"]
2050#[repr(C)]
2051#[derive(Debug, Copy, Clone)]
2052pub struct OH_Drawing_LineMetrics {
2053 #[doc = " Height of a character above the baseline, after taking the absolute value."]
2054 pub ascender: f64,
2055 #[doc = " Height of a character below the baseline, after taking the absolute value."]
2056 pub descender: f64,
2057 #[doc = " Height of an uppercase letter above the baseline."]
2058 pub capHeight: f64,
2059 #[doc = " Height of a lowercase letter, specifically the lowercase x, not including ascenders and descenders."]
2060 pub xHeight: f64,
2061 #[doc = " Horizontal space taken up by a character."]
2062 pub width: f64,
2063 #[doc = " Line height."]
2064 pub height: f64,
2065 #[doc = " Distance from the left edge of the leftmost character to the left edge of the container. For left alignment, the\n value is 0. For right alignment, the value is the container width minus the text width."]
2066 pub x: f64,
2067 #[doc = " Height from the top edge of the character to the top of the container. The first line is 0, and the second line\n is the height of the first line."]
2068 pub y: f64,
2069 #[doc = " Index of the first character in the line."]
2070 pub startIndex: usize,
2071 #[doc = " Index of the last character in the line."]
2072 pub endIndex: usize,
2073 #[doc = " Measurement information of the first character."]
2074 pub firstCharMetrics: OH_Drawing_Font_Metrics,
2075}
2076#[doc = " Enables the height set by calling {@link OH_Drawing_SetTextStyleFontHeight} for the top of the first line and\n the bottom of the last line in a paragraph."]
2077pub const OH_Drawing_TextHeightBehavior_TEXT_HEIGHT_ALL: OH_Drawing_TextHeightBehavior = 0;
2078#[doc = " Disables the height set by calling {@link OH_Drawing_SetTextStyleFontHeight} for the top of the first line in a\n paragraph."]
2079pub const OH_Drawing_TextHeightBehavior_TEXT_HEIGHT_DISABLE_FIRST_ASCENT:
2080 OH_Drawing_TextHeightBehavior = 1;
2081#[doc = " Disables the height set by calling {@link OH_Drawing_SetTextStyleFontHeight} for the bottom of the last line in\n a paragraph."]
2082pub const OH_Drawing_TextHeightBehavior_TEXT_HEIGHT_DISABLE_LAST_ASCENT:
2083 OH_Drawing_TextHeightBehavior = 2;
2084#[doc = " Disables the height set by calling {@link OH_Drawing_SetTextStyleFontHeight} for both the top of the first line\n and the bottom of the last line in a paragraph."]
2085pub const OH_Drawing_TextHeightBehavior_TEXT_HEIGHT_DISABLE_ALL: OH_Drawing_TextHeightBehavior = 3;
2086#[doc = " @brief Enumerates the text height modifier patterns.\n\n @since 12\n @version 1.0"]
2087pub type OH_Drawing_TextHeightBehavior = u32;
2088#[doc = " No text style."]
2089pub const OH_Drawing_TextStyleType_TEXT_STYLE_NONE: OH_Drawing_TextStyleType = 0;
2090#[doc = " All text styles."]
2091pub const OH_Drawing_TextStyleType_TEXT_STYLE_ALL_ATTRIBUTES: OH_Drawing_TextStyleType = 1;
2092#[doc = " Font style."]
2093pub const OH_Drawing_TextStyleType_TEXT_STYLE_FONT: OH_Drawing_TextStyleType = 2;
2094#[doc = " Text foreground style."]
2095pub const OH_Drawing_TextStyleType_TEXT_STYLE_FOREGROUND: OH_Drawing_TextStyleType = 3;
2096#[doc = " Text background style."]
2097pub const OH_Drawing_TextStyleType_TEXT_STYLE_BACKGROUND: OH_Drawing_TextStyleType = 4;
2098#[doc = " Text shadow style."]
2099pub const OH_Drawing_TextStyleType_TEXT_STYLE_SHADOW: OH_Drawing_TextStyleType = 5;
2100#[doc = " Text decoration style."]
2101pub const OH_Drawing_TextStyleType_TEXT_STYLE_DECORATIONS: OH_Drawing_TextStyleType = 6;
2102#[doc = " Text letter spacing style."]
2103pub const OH_Drawing_TextStyleType_TEXT_STYLE_LETTER_SPACING: OH_Drawing_TextStyleType = 7;
2104#[doc = " Text word spacing style."]
2105pub const OH_Drawing_TextStyleType_TEXT_STYLE_WORD_SPACING: OH_Drawing_TextStyleType = 8;
2106#[doc = " @brief Enumerates the text style types.\n\n @since 12\n @version 1.0"]
2107pub type OH_Drawing_TextStyleType = u32;
2108#[doc = " Ultra condensed font."]
2109pub const OH_Drawing_FontWidth_FONT_WIDTH_ULTRA_CONDENSED: OH_Drawing_FontWidth = 1;
2110#[doc = " Extra condensed font."]
2111pub const OH_Drawing_FontWidth_FONT_WIDTH_EXTRA_CONDENSED: OH_Drawing_FontWidth = 2;
2112#[doc = " Condensed font."]
2113pub const OH_Drawing_FontWidth_FONT_WIDTH_CONDENSED: OH_Drawing_FontWidth = 3;
2114#[doc = " Semi-condensed font."]
2115pub const OH_Drawing_FontWidth_FONT_WIDTH_SEMI_CONDENSED: OH_Drawing_FontWidth = 4;
2116#[doc = " Normal font."]
2117pub const OH_Drawing_FontWidth_FONT_WIDTH_NORMAL: OH_Drawing_FontWidth = 5;
2118#[doc = " Semi-expanded font."]
2119pub const OH_Drawing_FontWidth_FONT_WIDTH_SEMI_EXPANDED: OH_Drawing_FontWidth = 6;
2120#[doc = " Expanded font."]
2121pub const OH_Drawing_FontWidth_FONT_WIDTH_EXPANDED: OH_Drawing_FontWidth = 7;
2122#[doc = " Extra expanded font."]
2123pub const OH_Drawing_FontWidth_FONT_WIDTH_EXTRA_EXPANDED: OH_Drawing_FontWidth = 8;
2124#[doc = " Ultra expanded font."]
2125pub const OH_Drawing_FontWidth_FONT_WIDTH_ULTRA_EXPANDED: OH_Drawing_FontWidth = 9;
2126#[doc = " @brief Enumerates the font widths.\n\n @since 12\n @version 1.0"]
2127pub type OH_Drawing_FontWidth = u32;
2128#[doc = " Maximum line height.<br>If line height scaling is enabled, the maximum line height takes effect only when **\n FontHeight** (which can be obtained from {@link OH_Drawing_TextStyleGetFontHeight}) is greater than 0.<br>The\n value is the positive part of a single-precision floating point number."]
2129#[cfg(feature = "api-21")]
2130pub const OH_Drawing_TextStyleAttributeId_TEXT_STYLE_ATTR_D_LINE_HEIGHT_MAXIMUM:
2131 OH_Drawing_TextStyleAttributeId = 0;
2132#[doc = " Minimum line height.<br>If line height scaling is enabled, the minimum line height takes effect only when **\n FontHeight** (which can be obtained from {@link OH_Drawing_TextStyleGetFontHeight}) is greater than 0.<br>The\n value is the non-negative part of a single-precision floating point number. The default value is **0**."]
2133#[cfg(feature = "api-21")]
2134pub const OH_Drawing_TextStyleAttributeId_TEXT_STYLE_ATTR_D_LINE_HEIGHT_MINIMUM:
2135 OH_Drawing_TextStyleAttributeId = 1;
2136#[doc = " Scaling base style of the line height. For details, see {@link OH_Drawing_LineHeightStyle}."]
2137#[cfg(feature = "api-21")]
2138pub const OH_Drawing_TextStyleAttributeId_TEXT_STYLE_ATTR_I_LINE_HEIGHT_STYLE:
2139 OH_Drawing_TextStyleAttributeId = 2;
2140#[doc = " Font width."]
2141#[cfg(feature = "api-21")]
2142pub const OH_Drawing_TextStyleAttributeId_TEXT_STYLE_ATTR_I_FONT_WIDTH:
2143 OH_Drawing_TextStyleAttributeId = 3;
2144#[doc = " Font edge processing mode. Anti-aliasing is used by default. For details about how to process font edges, see\n {@link OH_Drawing_FontEdging}.\n @since 24"]
2145#[cfg(feature = "api-24")]
2146pub const OH_Drawing_TextStyleAttributeId_TEXT_STYLE_ATTR_I_FONT_EDGING:
2147 OH_Drawing_TextStyleAttributeId = 4;
2148#[doc = " @brief Enumerates the text style attributes.\n\n @since 21"]
2149#[cfg(feature = "api-21")]
2150pub type OH_Drawing_TextStyleAttributeId = u32;
2151#[doc = " Uses the font size as the scaling base.<br>Formula for calculating the line height: **FontSize** x **FontHeight**\n .<br>**FontSize** can be obtained from the {@link OH_Drawing_TextStyleGetFontSize} API.<br>**FontHeight** can be\n obtained from the {@link OH_Drawing_TextStyleGetFontHeight} API."]
2152#[cfg(feature = "api-21")]
2153pub const OH_Drawing_LineHeightStyle_TEXT_LINE_HEIGHT_BY_FONT_SIZE: OH_Drawing_LineHeightStyle = 0;
2154#[doc = " Uses the font height as the scaling base.<br>Formula for calculating the line height: font height x **FontHeight*\n *.<br>The font height is obtained after the text is shaped using the font file.<br>**FontHeight** can be\n obtained from the {@link OH_Drawing_TextStyleGetFontHeight} API."]
2155#[cfg(feature = "api-21")]
2156pub const OH_Drawing_LineHeightStyle_TEXT_LINE_HEIGHT_BY_FONT_HEIGHT: OH_Drawing_LineHeightStyle =
2157 1;
2158#[doc = " @brief Enumerates the scaling base styles of the line height. The default style is **TEXT_LINE_HEIGHT_BY_FONT_SIZE**.\n\n @since 21"]
2159#[cfg(feature = "api-21")]
2160pub type OH_Drawing_LineHeightStyle = u32;
2161#[doc = " Maximum line height.<br>If line height scaling is enabled, the maximum line height takes effect only when **\n FontHeight** (which can be obtained from {@link OH_Drawing_TextStyleGetFontHeight}) is greater than 0.<br>The\n value is the positive part of a single-precision floating point number."]
2162#[cfg(feature = "api-21")]
2163pub const OH_Drawing_TypographyStyleAttributeId_TYPOGRAPHY_STYLE_ATTR_D_LINE_HEIGHT_MAXIMUM:
2164 OH_Drawing_TypographyStyleAttributeId = 0;
2165#[doc = " Minimum line height.<br>If line height scaling is enabled, the minimum line height takes effect only when **\n FontHeight** (which can be obtained from {@link OH_Drawing_TextStyleGetFontHeight}) is greater than 0.<br>The\n value is the non-negative part of a single-precision floating point number. The default value is **0**."]
2166#[cfg(feature = "api-21")]
2167pub const OH_Drawing_TypographyStyleAttributeId_TYPOGRAPHY_STYLE_ATTR_D_LINE_HEIGHT_MINIMUM:
2168 OH_Drawing_TypographyStyleAttributeId = 1;
2169#[doc = " Interline spacing.<br>**lineSpacing** is not restricted by the maximum and minimum line heights.<br>By default,\n line spacing is added to the last line.<br>You can set **textHeightBehavior** to **DISABLE_LAST_ASCENT** in\n {@link OH_Drawing_TypographyTextSetHeightBehavior} to disable the line spacing of the last line.<br>The default\n value is **0**."]
2170#[cfg(feature = "api-21")]
2171pub const OH_Drawing_TypographyStyleAttributeId_TYPOGRAPHY_STYLE_ATTR_D_LINE_SPACING:
2172 OH_Drawing_TypographyStyleAttributeId = 2;
2173#[doc = " Scaling base style of the line height. For details, see {@link OH_Drawing_LineHeightStyle}."]
2174#[cfg(feature = "api-21")]
2175pub const OH_Drawing_TypographyStyleAttributeId_TYPOGRAPHY_STYLE_ATTR_I_LINE_HEIGHT_STYLE:
2176 OH_Drawing_TypographyStyleAttributeId = 3;
2177#[doc = " Font width."]
2178#[cfg(feature = "api-21")]
2179pub const OH_Drawing_TypographyStyleAttributeId_TYPOGRAPHY_STYLE_ATTR_I_FONT_WIDTH:
2180 OH_Drawing_TypographyStyleAttributeId = 4;
2181#[doc = " Whether to enable line-start punctuation compression during text typography.<br>**NOTE**<br>1. The font file\n must support the \"ss08\" feature in {@link OH_Drawing_FontFeature}; otherwise, compression cannot be applied.<br>\n 2. Only punctuation within the line-start punctuation compression range is affected by this feature.\n @since 23"]
2182#[cfg(feature = "api-23")]
2183pub const OH_Drawing_TypographyStyleAttributeId_TYPOGRAPHY_STYLE_ATTR_B_COMPRESS_HEAD_PUNCTUATION : OH_Drawing_TypographyStyleAttributeId = 5 ;
2184#[doc = " Whether to enable the internal padding of the font during text typography.\n @since 23"]
2185#[cfg(feature = "api-23")]
2186pub const OH_Drawing_TypographyStyleAttributeId_TYPOGRAPHY_STYLE_ATTR_B_INCLUDE_FONT_PADDING:
2187 OH_Drawing_TypographyStyleAttributeId = 6;
2188#[doc = " Whether to enable the line spacing fallback mechanism during text typography.\n @since 23"]
2189#[cfg(feature = "api-23")]
2190pub const OH_Drawing_TypographyStyleAttributeId_TYPOGRAPHY_STYLE_ATTR_B_FALLBACK_LINE_SPACING:
2191 OH_Drawing_TypographyStyleAttributeId = 7;
2192#[doc = " Ellipsis style. For details about the ellipsis style, see {@link OH_Drawing_EllipsisModal}.\n @since 24"]
2193#[cfg(feature = "api-24")]
2194pub const OH_Drawing_TypographyStyleAttributeId_TYPOGRAPHY_STYLE_ATTR_I_ELLIPSIS_MODAL:
2195 OH_Drawing_TypographyStyleAttributeId = 8;
2196#[doc = " First-line indent array.<br>All values in the indent array must be greater than or equal to 0. Each element in\n the array represents the indentation value of a single line. If the actual number of text lines exceeds the\n length of the indent array, the last value of the array is applied to the extra lines.\n @since 26.0.0"]
2197#[cfg(feature = "api-26")]
2198pub const OH_Drawing_TypographyStyleAttributeId_TYPOGRAPHY_STYLE_ATTR_DA_LINE_HEAD_INDENT:
2199 OH_Drawing_TypographyStyleAttributeId = 9;
2200#[doc = " First-line indent of a paragraph. The indent value must be greater than or equal to 0.\n @since 26.0.0"]
2201#[cfg(feature = "api-26")]
2202pub const OH_Drawing_TypographyStyleAttributeId_TYPOGRAPHY_STYLE_ATTR_D_FIRST_LINE_HEAD_INDENT:
2203 OH_Drawing_TypographyStyleAttributeId = 10;
2204#[doc = " Last-line indent array.<br>All values in the indent array must be greater than or equal to 0. Each element in\n the array represents the indentation value of a single line. If the actual number of text lines exceeds the\n length of the indent array, the last value of the array is applied to the extra lines.\n @since 26.0.0"]
2205#[cfg(feature = "api-26")]
2206pub const OH_Drawing_TypographyStyleAttributeId_TYPOGRAPHY_STYLE_ATTR_DA_LINE_TAIL_INDENT:
2207 OH_Drawing_TypographyStyleAttributeId = 11;
2208#[doc = " @brief Enumerates the typography style attributes.\n <br>For the common attributes of the typography styles and text styles, you are advised to use the text style\n attributes, which can be obtained from {@link OH_Drawing_TextStyleAttributeId}.\n\n @since 21"]
2209#[cfg(feature = "api-21")]
2210pub type OH_Drawing_TypographyStyleAttributeId = u32;
2211#[doc = " Whether to force reuse the rasterization result.\n True means to force reuse of the rasterization result. False means to allow updates to the rasterization result.\n The default value is false.\n @since 26.0.0"]
2212#[cfg(feature = "api-26")]
2213pub const OH_Drawing_TypographyAttributeId_TYPOGRAPHY_ATTR_B_FORCE_REUSE_RASTER_RESULT:
2214 OH_Drawing_TypographyAttributeId = 0;
2215#[doc = " @brief Enumerates the typography attributes.\n\n @since 26.0.0"]
2216#[cfg(feature = "api-26")]
2217pub type OH_Drawing_TypographyAttributeId = u32;
2218extern "C" {
2219 #[doc = " @brief Obtains a bool-type typography attribute.\n\n @param typography Pointer to the typography object {@link OH_Drawing_Typography}, which is obtained from\n {@link OH_Drawing_CreateTypography}.\n @param id Typography style attribute ID.\n @param value Pointer to the bool-type attribute. Used as an output parameter.\n @return Result code.\n <br>Returns OH_DRAWING_SUCCESS, indicating that the execution is successful.\n <br>Returns OH_DRAWING_ERROR_INCORRECT_PARAMETER, indicating that the typography or value parameter is a null\n pointer.\n <br>Returns OH_DRAWING_ERROR_ATTRIBUTE_ID_MISMATCH, indicating that the attribute ID passed in does not match\n the called function.\n @since 26.0.0"]
2220 #[cfg(feature = "api-26")]
2221 pub fn OH_Drawing_GetTypographyAttributeBool(
2222 typography: *const OH_Drawing_Typography,
2223 id: OH_Drawing_TypographyAttributeId,
2224 value: *mut bool,
2225 ) -> OH_Drawing_ErrorCode;
2226}
2227extern "C" {
2228 #[doc = " @brief Sets a bool-type typography attribute.\n\n @param typography Pointer to the typography object {@link OH_Drawing_Typography}, which is obtained from\n {@link OH_Drawing_CreateTypography}.\n @param id Typography attribute ID, which specifies the bool-type attribute to set.\n @param value Bool value to set.\n @return Result code.\n <br>Returns OH_DRAWING_SUCCESS, indicating that the execution is successful.\n <br>Returns OH_DRAWING_ERROR_INCORRECT_PARAMETER, indicating that the typography parameter is a null pointer.\n <br>Returns OH_DRAWING_ERROR_ATTRIBUTE_ID_MISMATCH, indicating that the attribute ID passed in does not match\n the called function.\n @since 26.0.0"]
2229 #[cfg(feature = "api-26")]
2230 pub fn OH_Drawing_SetTypographyAttributeBool(
2231 typography: *mut OH_Drawing_Typography,
2232 id: OH_Drawing_TypographyAttributeId,
2233 value: bool,
2234 ) -> OH_Drawing_ErrorCode;
2235}
2236extern "C" {
2237 #[doc = " @brief Sets the text style attribute of the **double** type.\n\n @param style Pointer to an {@link OH_Drawing_TextStyle} object.\n @param id Text style attribute ID.\n @param value Text style attribute value.\n @return Returns the execution result.\n <br>**OH_DRAWING_SUCCESS** if the operation is successful.\n <br>**OH_DRAWING_ERROR_INVALID_PARAMETER** if **style** is NULL.\n <br>**OH_DRAWING_ERROR_ATTRIBUTE_ID_MISMATCH** if the input attribute ID does not match the called function.\n <br>**OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** if the value corresponding to the attribute id exceeds the\n allowable range.\n @since 21"]
2238 #[cfg(feature = "api-21")]
2239 pub fn OH_Drawing_SetTextStyleAttributeDouble(
2240 style: *mut OH_Drawing_TextStyle,
2241 id: OH_Drawing_TextStyleAttributeId,
2242 value: f64,
2243 ) -> OH_Drawing_ErrorCode;
2244}
2245extern "C" {
2246 #[doc = " @brief Obtains the text style attribute of the **double** type.\n\n @param style Pointer to an {@link OH_Drawing_TextStyle} object.\n @param id Text style attribute ID.\n @param value Pointer to the attribute of the **double** type. It is used as an output parameter.\n @return Returns the execution result.\n <br>**OH_DRAWING_SUCCESS** if the operation is successful.\n <br>**OH_DRAWING_ERROR_INVALID_PARAMETER** if **style** is NULL.\n <br>**OH_DRAWING_ERROR_ATTRIBUTE_ID_MISMATCH** if the input attribute ID does not match the called function.\n @since 21"]
2247 #[cfg(feature = "api-21")]
2248 pub fn OH_Drawing_GetTextStyleAttributeDouble(
2249 style: *mut OH_Drawing_TextStyle,
2250 id: OH_Drawing_TextStyleAttributeId,
2251 value: *mut f64,
2252 ) -> OH_Drawing_ErrorCode;
2253}
2254extern "C" {
2255 #[doc = " @brief Sets the text style attribute of the **int** type.\n\n @param style Pointer to an {@link OH_Drawing_TextStyle} object.\n @param id Text style attribute ID.\n @param value Attribute value to set.\n @return Returns the execution result.\n <br>**OH_DRAWING_SUCCESS** if the operation is successful.\n <br>**OH_DRAWING_ERROR_INVALID_PARAMETER** if **style** is NULL.\n <br>**OH_DRAWING_ERROR_ATTRIBUTE_ID_MISMATCH** if the input attribute ID does not match the called function.\n <br>**OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** if the input value exceeds the value range of the attribute to\n be set.\n @since 21"]
2256 #[cfg(feature = "api-21")]
2257 pub fn OH_Drawing_SetTextStyleAttributeInt(
2258 style: *mut OH_Drawing_TextStyle,
2259 id: OH_Drawing_TextStyleAttributeId,
2260 value: ::std::os::raw::c_int,
2261 ) -> OH_Drawing_ErrorCode;
2262}
2263extern "C" {
2264 #[doc = " @brief Obtains the text style attribute of the **int** type.\n\n @param style Pointer to an {@link OH_Drawing_TextStyle} object.\n @param id Text style attribute ID.\n @param value Pointer to the attribute of the **int** type. It is used as an output parameter.\n @return Returns the execution result.\n <br>**OH_DRAWING_SUCCESS** if the operation is successful.\n <br>**OH_DRAWING_ERROR_INVALID_PARAMETER** if **style** is NULL.\n <br>**OH_DRAWING_ERROR_ATTRIBUTE_ID_MISMATCH** if the input attribute ID does not match the called function.\n @since 21"]
2265 #[cfg(feature = "api-21")]
2266 pub fn OH_Drawing_GetTextStyleAttributeInt(
2267 style: *mut OH_Drawing_TextStyle,
2268 id: OH_Drawing_TextStyleAttributeId,
2269 value: *mut ::std::os::raw::c_int,
2270 ) -> OH_Drawing_ErrorCode;
2271}
2272extern "C" {
2273 #[doc = " @brief Sets the typography style attribute of the **double** type.\n\n @param style Pointer to an {@link OH_Drawing_TypographyStyle} object.\n @param id Attribute ID of the text style.\n @param value Attribute value to set.\n @return Returns the execution result.\n <br>**OH_DRAWING_SUCCESS** if the operation is successful.\n <br>**OH_DRAWING_ERROR_INVALID_PARAMETER** if **style** is NULL.\n <br>**OH_DRAWING_ERROR_ATTRIBUTE_ID_MISMATCH** if the input attribute ID does not match the called function.\n <br>**OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** if the value corresponding to the attribute id\n exceeds the allowable range.\n @since 21"]
2274 #[cfg(feature = "api-21")]
2275 pub fn OH_Drawing_SetTypographyStyleAttributeDouble(
2276 style: *mut OH_Drawing_TypographyStyle,
2277 id: OH_Drawing_TypographyStyleAttributeId,
2278 value: f64,
2279 ) -> OH_Drawing_ErrorCode;
2280}
2281extern "C" {
2282 #[doc = " @brief Obtains the typography style attribute of the **double** type.\n\n @param style Pointer to an {@link OH_Drawing_TypographyStyle} object.\n @param id Attribute ID of the text style.\n @param value Pointer to the attribute of the **double** type. It is used as an output parameter.\n @return Returns the execution result.\n <br>**OH_DRAWING_SUCCESS** if the operation is successful.\n <br>**OH_DRAWING_ERROR_INVALID_PARAMETER** if **style** is NULL.\n <br>**OH_DRAWING_ERROR_ATTRIBUTE_ID_MISMATCH** if the input attribute ID does not match the called function.\n @since 21"]
2283 #[cfg(feature = "api-21")]
2284 pub fn OH_Drawing_GetTypographyStyleAttributeDouble(
2285 style: *mut OH_Drawing_TypographyStyle,
2286 id: OH_Drawing_TypographyStyleAttributeId,
2287 value: *mut f64,
2288 ) -> OH_Drawing_ErrorCode;
2289}
2290extern "C" {
2291 #[doc = " @brief Sets the typography style attribute of the **int** type.\n\n @param style Pointer to an {@link OH_Drawing_TypographyStyle} object.\n @param id Attribute ID of the text style.\n @param value Attribute value to set.\n @return Returns the execution result.\n <br>**OH_DRAWING_SUCCESS** if the operation is successful.\n <br>**OH_DRAWING_ERROR_INVALID_PARAMETER** if **style** is NULL.\n <br>**OH_DRAWING_ERROR_ATTRIBUTE_ID_MISMATCH** if the input attribute ID does not match the called function.\n <br>**OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** if the input value exceeds the value range of the attribute to\n be set.\n @since 21"]
2292 #[cfg(feature = "api-21")]
2293 pub fn OH_Drawing_SetTypographyStyleAttributeInt(
2294 style: *mut OH_Drawing_TypographyStyle,
2295 id: OH_Drawing_TypographyStyleAttributeId,
2296 value: ::std::os::raw::c_int,
2297 ) -> OH_Drawing_ErrorCode;
2298}
2299extern "C" {
2300 #[doc = " @brief Obtains the typography style attribute of the **int** type.\n\n @param style Pointer to an {@link OH_Drawing_TypographyStyle} object.\n @param id Attribute ID of the text style.\n @param value Pointer to the attribute of the **int** type. It is used as an output parameter.\n @return Returns the execution result.\n <br>**OH_DRAWING_SUCCESS** if the operation is successful.\n <br>**OH_DRAWING_ERROR_INVALID_PARAMETER** if **style** is NULL.\n <br>**OH_DRAWING_ERROR_ATTRIBUTE_ID_MISMATCH** if the input attribute ID does not match the called function.\n @since 21"]
2301 #[cfg(feature = "api-21")]
2302 pub fn OH_Drawing_GetTypographyStyleAttributeInt(
2303 style: *mut OH_Drawing_TypographyStyle,
2304 id: OH_Drawing_TypographyStyleAttributeId,
2305 value: *mut ::std::os::raw::c_int,
2306 ) -> OH_Drawing_ErrorCode;
2307}
2308extern "C" {
2309 #[doc = " @brief Sets the typography style attribute of the **bool** type.\n\n @param style Pointer to an {@link OH_Drawing_TypographyStyle} object.\n @param id Attribute ID of the text style.\n @param value Attribute value to set.\n @return Returns the execution result.\n <br>**OH_DRAWING_SUCCESS** if the operation is successful.\n <br>**OH_DRAWING_ERROR_INCORRECT_PARAMETER** if **style** is NULL.\n <br>**OH_DRAWING_ERROR_ATTRIBUTE_ID_MISMATCH** if the input attribute ID does not match the called function.\n @since 23"]
2310 #[cfg(feature = "api-23")]
2311 pub fn OH_Drawing_SetTypographyStyleAttributeBool(
2312 style: *mut OH_Drawing_TypographyStyle,
2313 id: OH_Drawing_TypographyStyleAttributeId,
2314 value: bool,
2315 ) -> OH_Drawing_ErrorCode;
2316}
2317extern "C" {
2318 #[doc = " @brief Obtains the typography style attribute of the **bool** type.\n\n @param style Pointer to an {@link OH_Drawing_TypographyStyle} object.\n @param id Attribute ID of the text style.\n @param value Pointer to the bool attribute. It is used as an output parameter.\n @return Returns the execution result.\n <br>**OH_DRAWING_SUCCESS** if the operation is successful.\n <br>**OH_DRAWING_ERROR_INCORRECT_PARAMETER** if **style** or **value** is NULL.\n <br>**OH_DRAWING_ERROR_ATTRIBUTE_ID_MISMATCH** if the input attribute ID does not match the called function.\n @since 23"]
2319 #[cfg(feature = "api-23")]
2320 pub fn OH_Drawing_GetTypographyStyleAttributeBool(
2321 style: *mut OH_Drawing_TypographyStyle,
2322 id: OH_Drawing_TypographyStyleAttributeId,
2323 value: *mut bool,
2324 ) -> OH_Drawing_ErrorCode;
2325}
2326extern "C" {
2327 #[doc = " @brief Sets the typography style attribute of the floating-point array type.\n\n @param style Pointer to an {@link OH_Drawing_TypographyStyle} object.\n @param id Attribute ID of the text style.\n @param arrayValue Pointer to the floating-point array.\n @param arrayLength Length of the floating-point array.\n @return Returns the execution result.\n <br>**OH_DRAWING_SUCCESS** if the operation is successful.\n <br>**OH_DRAWING_ERROR_INCORRECT_PARAMETER** if the parameter **style** or **arrayValue** is a null pointer or\n **arrayLength** is 0.\n <br>**OH_DRAWING_ERROR_ATTRIBUTE_ID_MISMATCH** if the input attribute ID does not match the called function.\n @since 26.0.0"]
2328 #[cfg(feature = "api-26")]
2329 pub fn OH_Drawing_SetTypographyStyleAttributeDoubleArray(
2330 style: *mut OH_Drawing_TypographyStyle,
2331 id: OH_Drawing_TypographyStyleAttributeId,
2332 arrayValue: *mut f64,
2333 arrayLength: usize,
2334 ) -> OH_Drawing_ErrorCode;
2335}
2336extern "C" {
2337 #[doc = " @brief Obtains the typography style attribute of the floating-point array type.\n\n @param style Pointer to an {@link OH_Drawing_TypographyStyle} object.\n @param id Attribute ID of the text style.\n @param arrayValue Pointer to the floating-point array. It is used as an output parameter.\n @param arrayLength Length of the floating-point array. It is used as an output parameter.\n @return Returns the execution result.\n <br>**OH_DRAWING_SUCCESS** if the operation is successful.\n <br>**OH_DRAWING_ERROR_INCORRECT_PARAMETER** if the parameter **style** or **arrayValue** is a null pointer or **\n arrayLength** is 0.\n <br>**OH_DRAWING_ERROR_ATTRIBUTE_ID_MISMATCH** if the input attribute ID does not match the called function.\n @since 26.0.0"]
2338 #[cfg(feature = "api-26")]
2339 pub fn OH_Drawing_GetTypographyStyleAttributeDoubleArray(
2340 style: *const OH_Drawing_TypographyStyle,
2341 id: OH_Drawing_TypographyStyleAttributeId,
2342 arrayValue: *mut *mut f64,
2343 arrayLength: *mut usize,
2344 ) -> OH_Drawing_ErrorCode;
2345}
2346#[doc = " Disable superscript or subscript."]
2347#[cfg(feature = "api-20")]
2348pub const OH_Drawing_TextBadgeType_TEXT_BADGE_NONE: OH_Drawing_TextBadgeType = 0;
2349#[doc = " Enable superscript."]
2350#[cfg(feature = "api-20")]
2351pub const OH_Drawing_TextBadgeType_TEXT_SUPERSCRIPT: OH_Drawing_TextBadgeType = 1;
2352#[doc = " Enable subscript."]
2353#[cfg(feature = "api-20")]
2354pub const OH_Drawing_TextBadgeType_TEXT_SUBSCRIPT: OH_Drawing_TextBadgeType = 2;
2355#[doc = " @brief Enumerates the text badge styles.\n\n @since 20\n @version 1.0"]
2356#[cfg(feature = "api-20")]
2357pub type OH_Drawing_TextBadgeType = u32;
2358#[doc = " Aligned to the baseline."]
2359#[cfg(feature = "api-20")]
2360pub const OH_Drawing_TextVerticalAlignment_TEXT_VERTICAL_ALIGNMENT_BASELINE:
2361 OH_Drawing_TextVerticalAlignment = 0;
2362#[doc = " Bottom aligned."]
2363#[cfg(feature = "api-20")]
2364pub const OH_Drawing_TextVerticalAlignment_TEXT_VERTICAL_ALIGNMENT_BOTTOM:
2365 OH_Drawing_TextVerticalAlignment = 1;
2366#[doc = " Center-aligned."]
2367#[cfg(feature = "api-20")]
2368pub const OH_Drawing_TextVerticalAlignment_TEXT_VERTICAL_ALIGNMENT_CENTER:
2369 OH_Drawing_TextVerticalAlignment = 2;
2370#[doc = " Top aligned."]
2371#[cfg(feature = "api-20")]
2372pub const OH_Drawing_TextVerticalAlignment_TEXT_VERTICAL_ALIGNMENT_TOP:
2373 OH_Drawing_TextVerticalAlignment = 3;
2374#[doc = " @brief Enumerates the vertical alignment modes.\n\n @since 20\n @version 1.0"]
2375#[cfg(feature = "api-20")]
2376pub type OH_Drawing_TextVerticalAlignment = u32;
2377#[doc = " @brief This struct describes a font style.\n\n @since 12\n @version 1.0"]
2378#[repr(C)]
2379#[derive(Debug, Copy, Clone)]
2380pub struct OH_Drawing_FontStyleStruct {
2381 #[doc = " Font weight."]
2382 pub weight: OH_Drawing_FontWeight,
2383 #[doc = " Font width."]
2384 pub width: OH_Drawing_FontWidth,
2385 #[doc = " Font slant."]
2386 pub slant: OH_Drawing_FontStyle,
2387}
2388#[doc = " @brief This struct describes a font feature.\n\n @since 12\n @version 1.0"]
2389#[repr(C)]
2390#[derive(Debug, Copy, Clone)]
2391pub struct OH_Drawing_FontFeature {
2392 #[doc = " Tag of the font feature."]
2393 pub tag: *mut ::std::os::raw::c_char,
2394 #[doc = " Value of the font feature."]
2395 pub value: ::std::os::raw::c_int,
2396}
2397#[doc = " @brief This struct describes a strut style. The strut style determines the line spacing, baseline alignment mode,\n and other properties related to the line height when drawing text.\n\n @since 12\n @version 1.0"]
2398#[repr(C)]
2399#[derive(Debug, Copy, Clone)]
2400pub struct OH_Drawing_StrutStyle {
2401 #[doc = " Font weight used for calculating the strut."]
2402 pub weight: OH_Drawing_FontWeight,
2403 #[doc = " Font style used when calculating the strut."]
2404 pub style: OH_Drawing_FontStyle,
2405 #[doc = " Size of the ascent plus descent in the logical pixels."]
2406 pub size: f64,
2407 #[doc = " Scale factor of the line height."]
2408 pub heightScale: f64,
2409 #[doc = " Whether to enable height override. **true**: enabled; **false**: disabled."]
2410 pub heightOverride: bool,
2411 #[doc = " Whether to enable half leading. **true**: enabled; **false**: disabled."]
2412 pub halfLeading: bool,
2413 #[doc = " Custom leading to be applied to the strut."]
2414 pub leading: f64,
2415 #[doc = " Whether to forcibly use the strut height for all rows. **true** means yes; **false** otherwise."]
2416 pub forceStrutHeight: bool,
2417 #[doc = " Number of font families."]
2418 pub familiesSize: usize,
2419 #[doc = " Double pointer to the font families used for calculating the strut."]
2420 pub families: *mut *mut ::std::os::raw::c_char,
2421}
2422#[doc = " @brief Defines a text rectangle structure.\n\n @since 24"]
2423#[cfg(feature = "api-24")]
2424#[repr(C)]
2425#[derive(Debug, Copy, Clone)]
2426pub struct OH_Drawing_RectSize {
2427 #[doc = " Rectangle width."]
2428 pub width: f64,
2429 #[doc = " Rectangle height."]
2430 pub height: f64,
2431}
2432extern "C" {
2433 #[doc = " @brief Creates an **OH_Drawing_TypographyStyle** object. Release this pointer by calling\n {@link OH_Drawing_DestroyTypographyStyle} when this object is no longer needed.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @return Pointer to the created {@link OH_Drawing_TypographyStyle} object.\n @since 8\n @version 1.0"]
2434 pub fn OH_Drawing_CreateTypographyStyle() -> *mut OH_Drawing_TypographyStyle;
2435}
2436extern "C" {
2437 #[doc = " @brief Destroys an **OH_Drawing_TypographyStyle** object and reclaims the memory occupied by the object.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TypographyStyle} object, which is obtained from\n {@link OH_Drawing_CreateTypographyStyle}.\n @since 8\n @version 1.0"]
2438 pub fn OH_Drawing_DestroyTypographyStyle(style: *mut OH_Drawing_TypographyStyle);
2439}
2440extern "C" {
2441 #[doc = " @brief Sets the text direction in a typography style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TypographyStyle} object, which is obtained from\n {@link OH_Drawing_CreateTypographyStyle}.\n @param direction Text direction. For details about the available options, see {@link OH_Drawing_TextDirection}.\n @since 8\n @version 1.0"]
2442 pub fn OH_Drawing_SetTypographyTextDirection(
2443 style: *mut OH_Drawing_TypographyStyle,
2444 direction: ::std::os::raw::c_int,
2445 );
2446}
2447extern "C" {
2448 #[doc = " @brief Text alignment mode.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TypographyStyle} object, which is obtained from\n {@link OH_Drawing_CreateTypographyStyle}.\n @param align Text alignment mode. For details about the available options, see {@link OH_Drawing_TextAlign}.\n @since 8\n @version 1.0"]
2449 pub fn OH_Drawing_SetTypographyTextAlign(
2450 style: *mut OH_Drawing_TypographyStyle,
2451 align: ::std::os::raw::c_int,
2452 );
2453}
2454extern "C" {
2455 #[doc = " @brief Sets the maximum number of lines in the text.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TypographyStyle} object, which is obtained from\n {@link OH_Drawing_CreateTypographyStyle}.\n @param lineNumber Max lines, which is an integer. If 0 or a negative number is passed, no text is displayed.\n @since 8\n @version 1.0"]
2456 pub fn OH_Drawing_SetTypographyTextMaxLines(
2457 style: *mut OH_Drawing_TypographyStyle,
2458 lineNumber: ::std::os::raw::c_int,
2459 );
2460}
2461extern "C" {
2462 #[doc = " @brief Creates a pointer to an **OH_Drawing_TextStyle** object. When the {@link OH_Drawing_TextStyle} is no longer\n needed, use {@link OH_Drawing_DestroyTextStyle} to release the pointer to the object.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @return Pointer to the created {@link OH_Drawing_TextStyle} object.\n @since 8\n @version 1.0"]
2463 pub fn OH_Drawing_CreateTextStyle() -> *mut OH_Drawing_TextStyle;
2464}
2465extern "C" {
2466 #[doc = " @brief Destroys an **OH_Drawing_TextStyle** object and reclaims the memory occupied by the object.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the **OH_Drawing_TextStyle** object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @since 8\n @version 1.0"]
2467 pub fn OH_Drawing_DestroyTextStyle(style: *mut OH_Drawing_TextStyle);
2468}
2469extern "C" {
2470 #[doc = " @brief Sets the color for a text style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TextStyle} object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @param color Text color in ARGB format. For example, an input parameter of 0xFFFF0000 indicates opaque red.\n @since 8\n @version 1.0"]
2471 pub fn OH_Drawing_SetTextStyleColor(style: *mut OH_Drawing_TextStyle, color: u32);
2472}
2473extern "C" {
2474 #[doc = " @brief Sets the font size for a text style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TextStyle} object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @param fontSize Font size, in physical pixels (px).\n @since 8\n @version 1.0"]
2475 pub fn OH_Drawing_SetTextStyleFontSize(style: *mut OH_Drawing_TextStyle, fontSize: f64);
2476}
2477extern "C" {
2478 #[doc = " @brief Sets the font weight. Before <!--RP1-->OpenHarmony 6.1<!--RP1End-->, only variable fonts in system fonts\n support font weight adjustment. Starting from <!--RP1-->OpenHarmony 6.1<!--RP1End-->, both system fonts and variable\n fonts in third-party registered fonts support font weight adjustment. For non-variable fonts, the font weight does\n not change when the weight value is set to less than semi-bold, and a pseudo-bold effect may be triggered when the\n weight value is set to semi-bold or greater.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the **OH_Drawing_TextStyle** object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @param fontWeight Font weight.\n <br>For details about the available options, see {@link OH_Drawing_FontWeight}.\n @since 8\n @version 1.0"]
2479 pub fn OH_Drawing_SetTextStyleFontWeight(
2480 style: *mut OH_Drawing_TextStyle,
2481 fontWeight: ::std::os::raw::c_int,
2482 );
2483}
2484extern "C" {
2485 #[doc = " @brief Sets the baseline for a text style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the **OH_Drawing_TextStyle** object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @param baseline Text baseline. For details about the available options, see {@link OH_Drawing_TextBaseline}.\n @since 8\n @version 1.0"]
2486 pub fn OH_Drawing_SetTextStyleBaseLine(
2487 style: *mut OH_Drawing_TextStyle,
2488 baseline: ::std::os::raw::c_int,
2489 );
2490}
2491extern "C" {
2492 #[doc = " @brief Sets the decoration for a text style. Only one decoration can be set. To add multiple decorations, use\n {@link OH_Drawing_AddTextStyleDecoration}.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the **OH_Drawing_TextStyle** object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @param decoration Text decoration. For details about the available options, see {@link OH_Drawing_TextDecoration}.\n @since 8\n @version 1.0"]
2493 pub fn OH_Drawing_SetTextStyleDecoration(
2494 style: *mut OH_Drawing_TextStyle,
2495 decoration: ::std::os::raw::c_int,
2496 );
2497}
2498extern "C" {
2499 #[doc = " @brief Adds the decoration for a text style. Multiple decoration lines can be displayed.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TextStyle} object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @param decoration Decoration to add. The value **1** means to add an underline, **2** means to add an overline, and *\n *4** means to add a strikethrough. You can add various decoration lines at a time via bitwise OR operations.\n <br>If a decoration style that is not in the {@link OH_Drawing_TextDecoration} enumeration is set, the original\n decoration is retained.\n @since 18\n @version 1.0"]
2500 #[cfg(feature = "api-18")]
2501 pub fn OH_Drawing_AddTextStyleDecoration(
2502 style: *mut OH_Drawing_TextStyle,
2503 decoration: ::std::os::raw::c_int,
2504 );
2505}
2506extern "C" {
2507 #[doc = " @brief Removes the decoration for a text style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TextStyle} object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @param decoration Decoration to remove. The value **1** means to remove an underline, **2** means to remove an\n overline, and **4** means to remove a strikethrough. You can remove various text decorations at a time via\n bitwise OR operations.\n <br>If a decoration style that is not in the {@link OH_Drawing_TextDecoration} enumeration is set, the original\n decoration is retained.\n @since 18\n @version 1.0"]
2508 #[cfg(feature = "api-18")]
2509 pub fn OH_Drawing_RemoveTextStyleDecoration(
2510 style: *mut OH_Drawing_TextStyle,
2511 decoration: ::std::os::raw::c_int,
2512 );
2513}
2514extern "C" {
2515 #[doc = " @brief Sets the decoration color for a text style. If this API is not called or **color** is set to **0**, the\n decoration color follows the text color.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the **OH_Drawing_TextStyle** object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @param color Color of the decoration line, in ARGB format. For example, 0xFFFF0000 indicates opaque red. If this API\n is not called or color is set to 0, the decoration line color follows the text color.\n @since 8\n @version 1.0"]
2516 pub fn OH_Drawing_SetTextStyleDecorationColor(style: *mut OH_Drawing_TextStyle, color: u32);
2517}
2518extern "C" {
2519 #[doc = " @brief Sets the line height based on the multiple of the font size.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the **OH_Drawing_TextStyle** object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @param fontHeight Multiple of the font size.\n @since 8\n @version 1.0"]
2520 pub fn OH_Drawing_SetTextStyleFontHeight(style: *mut OH_Drawing_TextStyle, fontHeight: f64);
2521}
2522extern "C" {
2523 #[doc = " @brief Sets the font families for a text style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the **OH_Drawing_TextStyle** object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @param fontFamiliesNumber Number of font families. A negative number is not allowed.\n @param fontFamilies Pointer to the font families.\n @since 8\n @version 1.0"]
2524 pub fn OH_Drawing_SetTextStyleFontFamilies(
2525 style: *mut OH_Drawing_TextStyle,
2526 fontFamiliesNumber: ::std::os::raw::c_int,
2527 fontFamilies: *mut *const ::std::os::raw::c_char,
2528 );
2529}
2530extern "C" {
2531 #[doc = " @brief Sets the font style for a text style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the **OH_Drawing_TextStyle** object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @param fontStyle Font style. The value **1** indicates italic, **2** indicates oblique, and **0** or other values\n indicate non-italic. For details, see the {@link OH_Drawing_FontStyle} enum.\n @since 8\n @version 1.0"]
2532 pub fn OH_Drawing_SetTextStyleFontStyle(
2533 style: *mut OH_Drawing_TextStyle,
2534 fontStyle: ::std::os::raw::c_int,
2535 );
2536}
2537extern "C" {
2538 #[doc = " @brief Sets the locale for a text style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the **OH_Drawing_TextStyle** object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @param locale Language type. The data type is a pointer to char. The format follows the BCP 47 language tag standard.\n For example, 'en' represents English, 'zh-Hans' represents Simplified Chinese, and 'zh-Hant' represents\n Traditional Chinese. If not specified, the default locale is 'zh-Hans'.\n @since 8\n @version 1.0"]
2539 pub fn OH_Drawing_SetTextStyleLocale(
2540 style: *mut OH_Drawing_TextStyle,
2541 locale: *const ::std::os::raw::c_char,
2542 );
2543}
2544extern "C" {
2545 #[doc = " @brief Sets the foreground brush for a text style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TextStyle} object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @param foregroundBrush Pointer to the {@link OH_Drawing_Brush} object, which is obtained from\n {@link OH_Drawing_BrushCreate}.\n @since 12\n @version 1.0"]
2546 pub fn OH_Drawing_SetTextStyleForegroundBrush(
2547 style: *mut OH_Drawing_TextStyle,
2548 foregroundBrush: *mut OH_Drawing_Brush,
2549 );
2550}
2551extern "C" {
2552 #[doc = " @brief Obtains the foreground brush of a text style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TextStyle} object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @param foregroundBrush Pointer to the {@link OH_Drawing_Brush} object, which is obtained from\n {@link OH_Drawing_BrushCreate}.\n @since 12\n @version 1.0"]
2553 pub fn OH_Drawing_TextStyleGetForegroundBrush(
2554 style: *mut OH_Drawing_TextStyle,
2555 foregroundBrush: *mut OH_Drawing_Brush,
2556 );
2557}
2558extern "C" {
2559 #[doc = " @brief Sets the foreground pen for a text style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TextStyle} object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @param foregroundPen Pointer to the {@link OH_Drawing_Pen} object, which is obtained from\n {@link OH_Drawing_PenCreate}.\n @since 12\n @version 1.0"]
2560 pub fn OH_Drawing_SetTextStyleForegroundPen(
2561 style: *mut OH_Drawing_TextStyle,
2562 foregroundPen: *mut OH_Drawing_Pen,
2563 );
2564}
2565extern "C" {
2566 #[doc = " @brief Obtains the foreground pen of a text style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TextStyle} object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @param foregroundPen Pointer to the {@link OH_Drawing_Pen} object, which is obtained from\n {@link OH_Drawing_PenCreate}.\n @since 12\n @version 1.0"]
2567 pub fn OH_Drawing_TextStyleGetForegroundPen(
2568 style: *mut OH_Drawing_TextStyle,
2569 foregroundPen: *mut OH_Drawing_Pen,
2570 );
2571}
2572extern "C" {
2573 #[doc = " @brief Sets the background brush for a text style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TextStyle} object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @param backgroundBrush Pointer to the {@link OH_Drawing_Brush} object, which is obtained from\n {@link OH_Drawing_BrushCreate}.\n @since 12\n @version 1.0"]
2574 pub fn OH_Drawing_SetTextStyleBackgroundBrush(
2575 style: *mut OH_Drawing_TextStyle,
2576 backgroundBrush: *mut OH_Drawing_Brush,
2577 );
2578}
2579extern "C" {
2580 #[doc = " @brief Obtains the background brush of a text style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TextStyle} object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @param backgroundBrush Pointer to the {@link OH_Drawing_Brush} object, which is obtained from\n {@link OH_Drawing_BrushCreate}.\n @since 12\n @version 1.0"]
2581 pub fn OH_Drawing_TextStyleGetBackgroundBrush(
2582 style: *mut OH_Drawing_TextStyle,
2583 backgroundBrush: *mut OH_Drawing_Brush,
2584 );
2585}
2586extern "C" {
2587 #[doc = " @brief Sets the background pen for a text style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TextStyle} object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @param backgroundPen Pointer to the {@link OH_Drawing_Pen} object, which is obtained from\n {@link OH_Drawing_PenCreate}.\n @since 12\n @version 1.0"]
2588 pub fn OH_Drawing_SetTextStyleBackgroundPen(
2589 style: *mut OH_Drawing_TextStyle,
2590 backgroundPen: *mut OH_Drawing_Pen,
2591 );
2592}
2593extern "C" {
2594 #[doc = " @brief Obtains the background pen of a text style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TextStyle} object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @param backgroundPen Pointer to the {@link OH_Drawing_Pen} object, which is obtained from\n {@link OH_Drawing_PenCreate}.\n @since 12\n @version 1.0"]
2595 pub fn OH_Drawing_TextStyleGetBackgroundPen(
2596 style: *mut OH_Drawing_TextStyle,
2597 backgroundPen: *mut OH_Drawing_Pen,
2598 );
2599}
2600extern "C" {
2601 #[doc = " @brief Creates an **OH_Drawing_TypographyCreate** object. Release this pointer by calling\n {@link OH_Drawing_DestroyTypographyHandler} when this object is no longer needed. You are advised to use the\n {@link OH_Drawing_CreateSharedFontCollection} function to create an {@link OH_Drawing_FontCollection} object.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TypographyStyle} object, which is obtained from\n {@link OH_Drawing_CreateTypographyStyle}.\n @param fontCollection Pointer to the {@link OH_Drawing_FontCollection} object, which is obtained from\n {@link OH_Drawing_CreateFontCollection}.\n @return Pointer to the **OH_Drawing_TypographyCreate** object created.\n @since 8\n @version 1.0"]
2602 pub fn OH_Drawing_CreateTypographyHandler(
2603 style: *mut OH_Drawing_TypographyStyle,
2604 fontCollection: *mut OH_Drawing_FontCollection,
2605 ) -> *mut OH_Drawing_TypographyCreate;
2606}
2607extern "C" {
2608 #[doc = " @brief Destroys an **OH_Drawing_TypographyCreate** object and reclaims the memory occupied by the object.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param handler Pointer to the {@link OH_Drawing_TypographyCreate} object, which is obtained from\n {@link OH_Drawing_CreateTypographyHandler}.\n @since 8\n @version 1.0"]
2609 pub fn OH_Drawing_DestroyTypographyHandler(handler: *mut OH_Drawing_TypographyCreate);
2610}
2611extern "C" {
2612 #[doc = " @brief Pushes a text style into the text style stack. Any text added afterward will use the style currently on top\n of the stack.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param handler Pointer to the {@link OH_Drawing_TypographyCreate} object, which is obtained from\n {@link OH_Drawing_CreateTypographyHandler}.\n @param style Pointer to the {@link OH_Drawing_TextStyle} object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @since 8\n @version 1.0"]
2613 pub fn OH_Drawing_TypographyHandlerPushTextStyle(
2614 handler: *mut OH_Drawing_TypographyCreate,
2615 style: *mut OH_Drawing_TextStyle,
2616 );
2617}
2618extern "C" {
2619 #[doc = " @brief Adds text.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param handler Pointer to the {@link OH_Drawing_TypographyCreate} object, which is obtained from\n {@link OH_Drawing_CreateTypographyHandler}.\n @param text Pointer to the text content.\n @since 8\n @version 1.0"]
2620 pub fn OH_Drawing_TypographyHandlerAddText(
2621 handler: *mut OH_Drawing_TypographyCreate,
2622 text: *const ::std::os::raw::c_char,
2623 );
2624}
2625extern "C" {
2626 #[doc = " @brief Pops the top text style out of the text style stack.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param handler Pointer to the {@link OH_Drawing_TypographyCreate} object, which is obtained from\n {@link OH_Drawing_CreateTypographyHandler}.\n @since 8\n @version 1.0"]
2627 pub fn OH_Drawing_TypographyHandlerPopTextStyle(handler: *mut OH_Drawing_TypographyCreate);
2628}
2629extern "C" {
2630 #[doc = " @brief Creates an **OH_Drawing_Typography** object. Release this pointer by calling\n {@link OH_Drawing_DestroyTypography} when this object is no longer needed.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param handler Pointer to the {@link OH_Drawing_TypographyCreate} object, which is obtained from\n {@link OH_Drawing_CreateTypographyHandler}.\n @return Pointer to the **OH_Drawing_Typography** object created.\n @since 8\n @version 1.0"]
2631 pub fn OH_Drawing_CreateTypography(
2632 handler: *mut OH_Drawing_TypographyCreate,
2633 ) -> *mut OH_Drawing_Typography;
2634}
2635extern "C" {
2636 #[doc = " @brief Destroys an **OH_Drawing_Typography** object and reclaims the memory occupied by the object.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param typography Pointer to the {@link OH_Drawing_Typography} object, which is obtained from\n {@link OH_Drawing_CreateTypography}.\n @since 8\n @version 1.0"]
2637 pub fn OH_Drawing_DestroyTypography(typography: *mut OH_Drawing_Typography);
2638}
2639extern "C" {
2640 #[doc = " @brief Performs layout calculation on the typography object and wraps text based on the specified maximum width.\n After this API is called, the properties of the typography object can be correctly obtained.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param typography Pointer to the {@link OH_Drawing_Typography} object, which is obtained from\n {@link OH_Drawing_CreateTypography}.\n @param maxWidth Maximum width of a single line in text typography, in physical pixels (px). The value must be\n greater than 0.\n @since 8\n @version 1.0"]
2641 pub fn OH_Drawing_TypographyLayout(typography: *mut OH_Drawing_Typography, maxWidth: f64);
2642}
2643extern "C" {
2644 #[doc = " @brief Draws text from the upper left corner at a specified position. This function must be called after\n {@link OH_Drawing_TypographyLayout} is called and applied.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param typography Pointer to the **OH_Drawing_Typography** object, which is obtained from\n {@link OH_Drawing_CreateTypography}.\n @param canvas Pointer to the **OH_Drawing_Canvas** object, which is obtained from {@link OH_Drawing_CanvasCreate}.\n @param positionX Horizontal coordinate of the starting position for text drawing (that is, the x-coordinate of the\n upper left corner of the text area), in physical pixels (px). The upper left corner of the canvas serves as the\n coordinate origin, with the positive direction to the right.\n @param positionY Vertical coordinate of the starting position for text drawing (that is, the y-coordinate of the\n upper left corner of the text area), in physical pixels (px). The upper left corner of the canvas serves as the\n coordinate origin, with the positive direction downward.\n @since 8\n @version 1.0"]
2645 pub fn OH_Drawing_TypographyPaint(
2646 typography: *mut OH_Drawing_Typography,
2647 canvas: *mut OH_Drawing_Canvas,
2648 positionX: f64,
2649 positionY: f64,
2650 );
2651}
2652extern "C" {
2653 #[doc = " @brief Draws text along a specified path. This API must be called after {@link OH_Drawing_TypographyLayout} is\n called and takes effect. It is recommended to use {@link OH_Drawing_SetTypographyTextMaxLines} to set the maximum\n number of lines to 1 to avoid overlapping issues caused by text width exceeding the typography width.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param typography Pointer to the **OH_Drawing_Typography** object, which is obtained from\n {@link OH_Drawing_CreateTypography}.\n @param canvas Pointer to the **OH_Drawing_Canvas** object, which is obtained from {@link OH_Drawing_CanvasCreate}.\n @param path Pointer to the **OH_Drawing_Path** object, which is obtained from {@link OH_Drawing_PathCreate}.\n @param hOffset Horizontal offset, in physical pixels (px). The horizontal offset of the text along the path (X-axis),\n positive to the right and negative to the left.\n @param vOffset Vertical offset, in physical pixels (px). The vertical offset of the text along the path (Y-axis),\n positive downward and negative upward.\n @since 12\n @version 1.0"]
2654 pub fn OH_Drawing_TypographyPaintOnPath(
2655 typography: *mut OH_Drawing_Typography,
2656 canvas: *mut OH_Drawing_Canvas,
2657 path: *mut OH_Drawing_Path,
2658 hOffset: f64,
2659 vOffset: f64,
2660 );
2661}
2662extern "C" {
2663 #[doc = " @brief Arranges the text in the constraint rectangle.\n\n @param typography Pointer to the {@link OH_Drawing_Typography} object, which is obtained from\n {@link OH_Drawing_CreateTypography}.\n @param constraintsRect Height and width of the constrained layout.\n @param fitStrRangeArr As an output parameter, it contains the character range of the paragraph text that is actually\n contained. Pointer to array object {@link OH_Drawing_Array}.\n <br>Releases the memory through {@link OH_Drawing_ReleaseArrayBuffer}.\n @param fitStrRangeArrayLen As an output parameter, it indicates the size of the contained string array.\n @return Actual text size after layout, including width and height information.\n @since 24"]
2664 #[cfg(feature = "api-24")]
2665 pub fn OH_Drawing_TypographyLayoutWithConstraintsWithBuffer(
2666 typography: *mut OH_Drawing_Typography,
2667 constraintsRect: OH_Drawing_RectSize,
2668 fitStrRangeArr: *mut *mut OH_Drawing_Array,
2669 fitStrRangeArrayLen: *mut usize,
2670 ) -> OH_Drawing_RectSize;
2671}
2672extern "C" {
2673 #[doc = " @brief Obtains the pointer to the OH_Drawing_Range object based on the array index.\n\n @param array Pointer to array object {@link OH_Drawing_Array}.\n @param index Index of the target {@link OH_Drawing_Range} object in the array.\n @return Returns the pointer to the OH_Drawing_Range object.\n @since 24"]
2674 #[cfg(feature = "api-24")]
2675 pub fn OH_Drawing_GetRangeByArrayIndex(
2676 array: *mut OH_Drawing_Array,
2677 index: usize,
2678 ) -> *mut OH_Drawing_Range;
2679}
2680extern "C" {
2681 #[doc = " @brief Releases the memory occupied by the {@link OH_Drawing_Array} object.\n\n @param array Pointer to array object {@link OH_Drawing_Array}.\n <br>Supported array types:\n <br>Array of full font names, which is obtained through {@link OH_Drawing_GetSystemFontFullNamesByType}.\n <br>Array of text lines, which is obtained through {@link OH_Drawing_TypographyGetTextLines}.\n <br>Array of string indexes, which is obtained through {@link OH_Drawing_GetRunStringIndices}.\n <br>Array of rectangles, which is obtained through {@link OH_Drawing_RectCreateArray}.\n <br>Array of font descriptors, which is obtained through {@link OH_Drawing_GetFontFullDescriptorsFromStream} or\n {@link OH_Drawing_GetFontFullDescriptorsFromPath}.\n <br>Array of text ranges, which is obtained through {@link OH_Drawing_TypographyLayoutWithConstraintsWithBuffer}.\n @link OH_Drawing_GetFontFullDescriptorsFromPath}.\n <br>Array of text ranges, which is obtained through {@link OH_Drawing_TypographyLayoutWithConstraintsWithBuffer}.\n @return Returns the execution result.\n <br>**OH_DRAWING_SUCCESS** if the operation is successful.\n <br>**OH_DRAWING_ERROR_INCORRECT_PARAMETER** if array is a null pointer or the type is not supported.\n @since 24"]
2682 #[cfg(feature = "api-24")]
2683 pub fn OH_Drawing_ReleaseArrayBuffer(array: *mut OH_Drawing_Array) -> OH_Drawing_ErrorCode;
2684}
2685extern "C" {
2686 #[doc = " @brief Obtains the typography width set by the user. This function must be called after\n {@link OH_Drawing_TypographyLayout} is called.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param typography Pointer to the **OH_Drawing_Typography** object, which is obtained from\n {@link OH_Drawing_CreateTypography}.\n @return Maximum width, in physical pixels (px).\n @since 9\n @version 1.1"]
2687 pub fn OH_Drawing_TypographyGetMaxWidth(typography: *mut OH_Drawing_Typography) -> f64;
2688}
2689extern "C" {
2690 #[doc = " @brief Obtains the overall height of a typography object. This function must be called after\n {@link OH_Drawing_TypographyLayout} is called.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param typography Pointer to the **OH_Drawing_Typography** object, which is obtained from\n {@link OH_Drawing_CreateTypography}.\n @return Returns the height, in physical pixels (px).\n @since 9\n @version 1.1"]
2691 pub fn OH_Drawing_TypographyGetHeight(typography: *mut OH_Drawing_Typography) -> f64;
2692}
2693extern "C" {
2694 #[doc = " @brief Obtains the width of the longest line in a typography object. This function must be called after\n {@link OH_Drawing_TypographyLayout} is called. You are advised to round up the return value. If the text content is\n empty, **0.0** is returned.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param typography Pointer to the **OH_Drawing_Typography** object, which is obtained from\n {@link OH_Drawing_CreateTypography}.\n @return Longest line width, in physical pixels (px).\n @since 9\n @version 1.1"]
2695 pub fn OH_Drawing_TypographyGetLongestLine(typography: *mut OH_Drawing_Typography) -> f64;
2696}
2697extern "C" {
2698 #[doc = " @brief Obtains the width of the longest line of a typography object, including its indentation. This function must\n be called after {@link OH_Drawing_TypographyLayout} is called. You are advised to round up the return value. If the\n text content is empty, **0.0** is returned.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param typography Pointer to the {@link OH_Drawing_Typography} object, which is obtained from\n {@link OH_Drawing_CreateTypography}.\n @return Returns the width of the longest line (including the current line indent), in physical pixels (px).\n @since 13\n @version 1.1"]
2699 #[cfg(feature = "api-13")]
2700 pub fn OH_Drawing_TypographyGetLongestLineWithIndent(
2701 typography: *mut OH_Drawing_Typography,
2702 ) -> f64;
2703}
2704extern "C" {
2705 #[doc = " @brief Obtains the minimum intrinsic width in a typography object. This function must be called after\n {@link OH_Drawing_TypographyLayout} is called.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param typography Pointer to the **OH_Drawing_Typography** object, which is obtained from\n {@link OH_Drawing_CreateTypography}.\n @return Minimum intrinsic width, in physical pixels (px).\n @since 9\n @version 1.1"]
2706 pub fn OH_Drawing_TypographyGetMinIntrinsicWidth(typography: *mut OH_Drawing_Typography)
2707 -> f64;
2708}
2709extern "C" {
2710 #[doc = " @brief Obtains the maximum intrinsic width in a typography object. This function must be called after\n {@link OH_Drawing_TypographyLayout} is called.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param typography Pointer to the **OH_Drawing_Typography** object, which is obtained from\n {@link OH_Drawing_CreateTypography}.\n @return Maximum intrinsic width, in physical pixels (px).\n @since 9\n @version 1.1"]
2711 pub fn OH_Drawing_TypographyGetMaxIntrinsicWidth(typography: *mut OH_Drawing_Typography)
2712 -> f64;
2713}
2714extern "C" {
2715 #[doc = " @brief Obtains the alphabetic baseline position of the typography object. This API must be called after\n {@link OH_Drawing_TypographyLayout} is called.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param typography Pointer to the **OH_Drawing_Typography** object, which is obtained from\n {@link OH_Drawing_CreateTypography}.\n @return Alphabetic baseline, in physical pixels (px).\n @since 9\n @version 1.1"]
2716 pub fn OH_Drawing_TypographyGetAlphabeticBaseline(
2717 typography: *mut OH_Drawing_Typography,
2718 ) -> f64;
2719}
2720extern "C" {
2721 #[doc = " @brief Obtains the ideographic baseline position of the typography object. This API must be called after\n {@link OH_Drawing_TypographyLayout} is called.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param typography Pointer to the **OH_Drawing_Typography** object, which is obtained from\n {@link OH_Drawing_CreateTypography}.\n @return Returns the ideographic baseline, in physical pixel px.\n @since 9\n @version 1.1"]
2722 pub fn OH_Drawing_TypographyGetIdeographicBaseline(
2723 typography: *mut OH_Drawing_Typography,
2724 ) -> f64;
2725}
2726extern "C" {
2727 #[doc = " @brief Adds a placeholder.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param handler Pointer to the {@link OH_Drawing_TypographyCreate} object, which is obtained from\n {@link OH_Drawing_CreateTypographyHandler}.\n @param span Pointer to the {@link OH_Drawing_PlaceholderSpan} object.\n @since 11\n @version 1.0"]
2728 pub fn OH_Drawing_TypographyHandlerAddPlaceholder(
2729 handler: *mut OH_Drawing_TypographyCreate,
2730 span: *mut OH_Drawing_PlaceholderSpan,
2731 );
2732}
2733extern "C" {
2734 #[doc = " @brief Checks whether the text in the typography object exceeds the line limit. This function must be called after\n {@link OH_Drawing_TypographyLayout} is called. It returns **false** if the line limit is not set using\n {@link OH_Drawing_SetTypographyTextMaxLines}.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param typography Pointer to the **OH_Drawing_Typography** object, which is obtained from\n {@link OH_Drawing_CreateTypography}.\n @return Returns **true** if the maximum number of lines is exceeded; returns **false** otherwise.\n @since 11\n @version 1.0"]
2735 pub fn OH_Drawing_TypographyDidExceedMaxLines(typography: *mut OH_Drawing_Typography) -> bool;
2736}
2737extern "C" {
2738 #[doc = " @brief Obtains text boxes in a given range of a typography object. This function must be called after\n {@link OH_Drawing_TypographyLayout} is called. Release this pointer by calling\n {@link OH_Drawing_TypographyDestroyTextBox} when this object is no longer needed.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param typography Pointer to the **OH_Drawing_Typography** object, which is obtained from\n {@link OH_Drawing_CreateTypography}.\n @param start Start position. The value ranges from 0 to the text length, counted in UTF-16 code units. Must be less\n than end; otherwise, an empty result is returned.\n @param end End position. The value ranges from 0 to the text length, counted in UTF-16 code units. If the value\n exceeds the text length, the text length is used. If the value is 0, an empty result is returned.\n @param heightStyle Height style. For details about the available options, see {@link OH_Drawing_RectHeightStyle}.\n @param widthStyle Width style. For details about the available options, see {@link OH_Drawing_RectWidthStyle}.\n @return Text box in the specified range. For details, see {@link OH_Drawing_TextBox}.\n @since 11\n @version 1.0"]
2739 pub fn OH_Drawing_TypographyGetRectsForRange(
2740 typography: *mut OH_Drawing_Typography,
2741 start: usize,
2742 end: usize,
2743 heightStyle: OH_Drawing_RectHeightStyle,
2744 widthStyle: OH_Drawing_RectWidthStyle,
2745 ) -> *mut OH_Drawing_TextBox;
2746}
2747extern "C" {
2748 #[doc = " @brief Obtains text boxes for placeholders in a typography object. This function must be called after\n {@link OH_Drawing_TypographyLayout} is called. Release this pointer by calling\n {@link OH_Drawing_TypographyDestroyTextBox} when this object is no longer needed.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param typography Pointer to the **OH_Drawing_Typography** object, which is obtained from\n {@link OH_Drawing_CreateTypography}.\n @return Placeholder text box. The return type is {@link OH_Drawing_TextBox}.\n @since 11\n @version 1.0"]
2749 pub fn OH_Drawing_TypographyGetRectsForPlaceholders(
2750 typography: *mut OH_Drawing_Typography,
2751 ) -> *mut OH_Drawing_TextBox;
2752}
2753extern "C" {
2754 #[doc = " @brief Obtains the left position of a text box.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param textbox Pointer to the **OH_Drawing_TextBox** object, which is obtained from\n {@link OH_Drawing_TypographyGetRectsForRange} or {@link OH_Drawing_TypographyGetRectsForPlaceholders}.\n @param index Index of the text box. The value ranges from 0 to the number of text boxes minus 1. The number of text\n boxes can be obtained through {@link OH_Drawing_GetSizeOfTextBox}. 0.0 is returned when the index is out of\n range.\n @return Left position.\n @since 11\n @version 1.0"]
2755 pub fn OH_Drawing_GetLeftFromTextBox(
2756 textbox: *mut OH_Drawing_TextBox,
2757 index: ::std::os::raw::c_int,
2758 ) -> f32;
2759}
2760extern "C" {
2761 #[doc = " @brief Obtains the right position of a text box.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param textbox Pointer to the **OH_Drawing_TextBox** object, which is obtained from\n {@link OH_Drawing_TypographyGetRectsForRange} or {@link OH_Drawing_TypographyGetRectsForPlaceholders}.\n @param index Index of the text box. The value ranges from 0 to the number of text boxes minus 1. The number of text\n boxes can be obtained through {@link OH_Drawing_GetSizeOfTextBox}. 0.0 is returned when the value is out of\n range.\n @return Right position.\n @since 11\n @version 1.0"]
2762 pub fn OH_Drawing_GetRightFromTextBox(
2763 textbox: *mut OH_Drawing_TextBox,
2764 index: ::std::os::raw::c_int,
2765 ) -> f32;
2766}
2767extern "C" {
2768 #[doc = " @brief Obtains the top position of a text box.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param textbox Pointer to the **OH_Drawing_TextBox** object, which is obtained from\n {@link OH_Drawing_TypographyGetRectsForRange} or {@link OH_Drawing_TypographyGetRectsForPlaceholders}.\n @param index Index of the text box. The value ranges from 0 to the number of text boxes minus 1. The number of text\n boxes can be obtained through {@link OH_Drawing_GetSizeOfTextBox}. 0.0 is returned when the value is out of\n range.\n @return Top position.\n @since 11\n @version 1.0"]
2769 pub fn OH_Drawing_GetTopFromTextBox(
2770 textbox: *mut OH_Drawing_TextBox,
2771 index: ::std::os::raw::c_int,
2772 ) -> f32;
2773}
2774extern "C" {
2775 #[doc = " @brief Obtains the bottom position of a text box.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param textbox Pointer to the **OH_Drawing_TextBox** object, which is obtained from\n {@link OH_Drawing_TypographyGetRectsForRange} or {@link OH_Drawing_TypographyGetRectsForPlaceholders}.\n @param index Index of the text box. The value ranges from 0 to the number of text boxes minus 1. The number of text\n boxes can be obtained through {@link OH_Drawing_GetSizeOfTextBox}. 0.0 is returned when the value is out of\n range.\n @return Bottom position.\n @since 11\n @version 1.0"]
2776 pub fn OH_Drawing_GetBottomFromTextBox(
2777 textbox: *mut OH_Drawing_TextBox,
2778 index: ::std::os::raw::c_int,
2779 ) -> f32;
2780}
2781extern "C" {
2782 #[doc = " @brief Obtains the text direction of a text box.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param textbox Pointer to the {@link OH_Drawing_TextBox} object, which is obtained from\n {@link OH_Drawing_TypographyGetRectsForRange} or {@link OH_Drawing_TypographyGetRectsForPlaceholders}.\n @param index Index of the text box. The value ranges from 0 to the number of text boxes minus 1. The number of text\n boxes can be obtained through {@link OH_Drawing_GetSizeOfTextBox}. If the index is out of range, 0 is returned.\n @return Text direction.\n @since 11\n @version 1.0"]
2783 pub fn OH_Drawing_GetTextDirectionFromTextBox(
2784 textbox: *mut OH_Drawing_TextBox,
2785 index: ::std::os::raw::c_int,
2786 ) -> ::std::os::raw::c_int;
2787}
2788extern "C" {
2789 #[doc = " @brief Obtains the number of text boxes.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param textBox Pointer to the **OH_Drawing_TextBox** object, which is obtained from\n {@link OH_Drawing_TypographyGetRectsForRange} or {@link OH_Drawing_TypographyGetRectsForPlaceholders}.\n @return Number of text boxes.\n @since 11\n @version 1.0"]
2790 pub fn OH_Drawing_GetSizeOfTextBox(textBox: *mut OH_Drawing_TextBox) -> usize;
2791}
2792extern "C" {
2793 #[doc = " @brief Obtains the position and affinity of the glyph at the given coordinates.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param typography Pointer to the **OH_Drawing_Typography** object, which is obtained from\n {@link OH_Drawing_CreateTypography}.\n @param dx X coordinate.\n @param dy Y coordinate.\n @return {@link OH_Drawing_PositionAndAffinity} struct that holds the position and affinity of the glyph cluster.\n @since 11\n @version 1.0\n @deprecated since 18\n @useinstead OH_Drawing_TypographyGetGlyphPositionAtCoordinateWithCluster"]
2794 pub fn OH_Drawing_TypographyGetGlyphPositionAtCoordinate(
2795 typography: *mut OH_Drawing_Typography,
2796 dx: f64,
2797 dy: f64,
2798 ) -> *mut OH_Drawing_PositionAndAffinity;
2799}
2800extern "C" {
2801 #[doc = " @brief Obtains the index position and affinity of the character cluster to which the text at the coordinate belongs.\n A character cluster refers to a group of one or more characters. When the {@link OH_Drawing_PositionAndAffinity} is\n no longer needed, use {@link OH_Drawing_DestroyPositionAndAffinity} to release the pointer to the object.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param typography Pointer to the **OH_Drawing_Typography** object, which is obtained from\n {@link OH_Drawing_CreateTypography}.\n @param dx X coordinate of the cursor, in px.\n @param dy Y coordinate of the cursor, in px.\n @return {@link OH_Drawing_PositionAndAffinity} struct that holds the position and affinity of the glyph cluster.\n @since 11\n @version 1.0"]
2802 pub fn OH_Drawing_TypographyGetGlyphPositionAtCoordinateWithCluster(
2803 typography: *mut OH_Drawing_Typography,
2804 dx: f64,
2805 dy: f64,
2806 ) -> *mut OH_Drawing_PositionAndAffinity;
2807}
2808extern "C" {
2809 #[doc = " @brief Obtains the position attribute of an **OH_Drawing_PositionAndAffinity** object.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param positionAndAffinity Pointer to the OH_Drawing_PositionAndAffinity object, obtained by\n {@link OH_Drawing_TypographyGetGlyphPositionAtCoordinateWithCluster}.\n @return Position attribute.\n @since 11\n @version 1.0"]
2810 pub fn OH_Drawing_GetPositionFromPositionAndAffinity(
2811 positionAndAffinity: *mut OH_Drawing_PositionAndAffinity,
2812 ) -> usize;
2813}
2814extern "C" {
2815 #[doc = " @brief Obtains the affinity attribute of an **OH_Drawing_PositionAndAffinity** object. The affinity determines\n whether the font is close to the front text or rear text.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param positionAndAffinity Pointer to the OH_Drawing_PositionAndAffinity object, obtained by\n {@link OH_Drawing_TypographyGetGlyphPositionAtCoordinateWithCluster}.\n @return Affinity attribute.\n @since 11\n @version 1.0"]
2816 pub fn OH_Drawing_GetAffinityFromPositionAndAffinity(
2817 positionAndAffinity: *mut OH_Drawing_PositionAndAffinity,
2818 ) -> ::std::os::raw::c_int;
2819}
2820extern "C" {
2821 #[doc = " @brief Obtains the word boundary in the typography object. When the {@link OH_Drawing_Range} is no longer needed,\n use {@link OH_Drawing_ReleaseRangeBuffer} to release the pointer to the object.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param typography Pointer to the **OH_Drawing_Typography** object, which is obtained from\n {@link OH_Drawing_CreateTypography}.\n @param offset Word index. The value ranges from 0 to n-1, where n is the text length. If the value is out of range,\n the default value is returned or an exception is thrown.\n @return {@link OH_Drawing_Range} struct that holds the word boundary.\n @since 11\n @version 1.0"]
2822 pub fn OH_Drawing_TypographyGetWordBoundary(
2823 typography: *mut OH_Drawing_Typography,
2824 offset: usize,
2825 ) -> *mut OH_Drawing_Range;
2826}
2827extern "C" {
2828 #[doc = " @brief Obtains the start position of an **OH_Drawing_Range** object.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param range Pointer to the **OH_Drawing_Range** object, which is obtained from\n {@link OH_Drawing_TypographyGetWordBoundary}.\n @return Start position.\n @since 11\n @version 1.0"]
2829 pub fn OH_Drawing_GetStartFromRange(range: *mut OH_Drawing_Range) -> usize;
2830}
2831extern "C" {
2832 #[doc = " @brief Obtains the end position of an **OH_Drawing_Range** object.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param range Pointer to the **OH_Drawing_Range** object, which is obtained from\n {@link OH_Drawing_TypographyGetWordBoundary}.\n @return End position.\n @since 11\n @version 1.0"]
2833 pub fn OH_Drawing_GetEndFromRange(range: *mut OH_Drawing_Range) -> usize;
2834}
2835extern "C" {
2836 #[doc = " @brief Obtains the number of lines in a typography object. This function must be called after\n {@link OH_Drawing_TypographyLayout} is called.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param typography Pointer to the **OH_Drawing_Typography** object, which is obtained from\n {@link OH_Drawing_CreateTypography}.\n @return Number of rows obtained.\n @since 11\n @version 1.0"]
2837 pub fn OH_Drawing_TypographyGetLineCount(typography: *mut OH_Drawing_Typography) -> usize;
2838}
2839extern "C" {
2840 #[doc = " @brief Sets the decoration style for a text style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the **OH_Drawing_TextStyle** object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @param decorationStyle Text decoration style. For details about the available options, see\n {@link OH_Drawing_TextDecorationStyle}.\n @since 11\n @version 1.0"]
2841 pub fn OH_Drawing_SetTextStyleDecorationStyle(
2842 style: *mut OH_Drawing_TextStyle,
2843 decorationStyle: ::std::os::raw::c_int,
2844 );
2845}
2846extern "C" {
2847 #[doc = " @brief Sets the thickness scale factor for the decoration style of a text style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the **OH_Drawing_TextStyle** object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @param decorationThicknessScale Thickness scaling ratio. The default value is **1**. If the value is less than or\n equal to 0, no decoration line is drawn.\n @since 11\n @version 1.0"]
2848 pub fn OH_Drawing_SetTextStyleDecorationThicknessScale(
2849 style: *mut OH_Drawing_TextStyle,
2850 decorationThicknessScale: f64,
2851 );
2852}
2853extern "C" {
2854 #[doc = " @brief Sets the letter spacing for a text style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the **OH_Drawing_TextStyle** object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @param letterSpacing Letter spacing value. A positive value increases the spacing, a negative value decreases it.\n The default value is **0**, in px.\n @since 11\n @version 1.0"]
2855 pub fn OH_Drawing_SetTextStyleLetterSpacing(
2856 style: *mut OH_Drawing_TextStyle,
2857 letterSpacing: f64,
2858 );
2859}
2860extern "C" {
2861 #[doc = " @brief Sets the word spacing for a text style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the **OH_Drawing_TextStyle** object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @param wordSpacing Spacing size. A positive value increases the spacing, and a negative value decreases the spacing.\n The default value is **0**, in px.\n @since 11\n @version 1.0"]
2862 pub fn OH_Drawing_SetTextStyleWordSpacing(style: *mut OH_Drawing_TextStyle, wordSpacing: f64);
2863}
2864extern "C" {
2865 #[doc = " @brief Sets whether to enable half leading for a text style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the **OH_Drawing_TextStyle** object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @param halfLeading Whether the half leading takes effect. **true** means yes; **false** otherwise.\n @since 11\n @version 1.0"]
2866 pub fn OH_Drawing_SetTextStyleHalfLeading(style: *mut OH_Drawing_TextStyle, halfLeading: bool);
2867}
2868extern "C" {
2869 #[doc = " @brief Sets the ellipsis content for a text style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the **OH_Drawing_TextStyle** object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @param ellipsis Pointer to the ellipsis content. The data type is a pointer pointing to char.\n @since 11\n @version 1.0\n @deprecated since 18\n @useinstead OH_Drawing_SetTypographyTextEllipsis"]
2870 pub fn OH_Drawing_SetTextStyleEllipsis(
2871 style: *mut OH_Drawing_TextStyle,
2872 ellipsis: *const ::std::os::raw::c_char,
2873 );
2874}
2875extern "C" {
2876 #[doc = " @brief Sets the ellipsis style for a text style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the **OH_Drawing_TextStyle** object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @param ellipsisModal Ellipsis style. For details about the available options, see {@link OH_Drawing_EllipsisModal}.\n @since 11\n @version 1.0\n @deprecated since 18\n @useinstead OH_Drawing_SetTypographyTextEllipsisModal"]
2877 pub fn OH_Drawing_SetTextStyleEllipsisModal(
2878 style: *mut OH_Drawing_TextStyle,
2879 ellipsisModal: ::std::os::raw::c_int,
2880 );
2881}
2882extern "C" {
2883 #[doc = " @brief Sets the text break strategy.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TypographyStyle} object, which is obtained from\n {@link OH_Drawing_CreateTypographyStyle}.\n @param breakStrategy Break strategy. For details about the available options, see {@link OH_Drawing_BreakStrategy}.\n @since 11\n @version 1.0"]
2884 pub fn OH_Drawing_SetTypographyTextBreakStrategy(
2885 style: *mut OH_Drawing_TypographyStyle,
2886 breakStrategy: ::std::os::raw::c_int,
2887 );
2888}
2889extern "C" {
2890 #[doc = " @brief Sets the word break type.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TypographyStyle} object, which is obtained from\n {@link OH_Drawing_CreateTypographyStyle}.\n @param wordBreakType Word break type. For details about the available options, see {@link OH_Drawing_WordBreakType}.\n @since 11\n @version 1.0"]
2891 pub fn OH_Drawing_SetTypographyTextWordBreakType(
2892 style: *mut OH_Drawing_TypographyStyle,
2893 wordBreakType: ::std::os::raw::c_int,
2894 );
2895}
2896extern "C" {
2897 #[doc = " @brief Sets the ellipsis style for a text style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the **OH_Drawing_TypographyStyle** object, which is obtained from\n {@link OH_Drawing_CreateTypographyStyle}.\n @param ellipsisModal Ellipsis style. For details about the available options, see {@link OH_Drawing_EllipsisModal}.\n @since 11\n @version 1.0"]
2898 pub fn OH_Drawing_SetTypographyTextEllipsisModal(
2899 style: *mut OH_Drawing_TypographyStyle,
2900 ellipsisModal: ::std::os::raw::c_int,
2901 );
2902}
2903extern "C" {
2904 #[doc = " @brief Obtains the line height in a typography object. This function must be called after\n {@link OH_Drawing_TypographyLayout} is called.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param typography Pointer to the **OH_Drawing_Typography** object, which is obtained from\n {@link OH_Drawing_CreateTypography}.\n @param lineNumber Index of the line number to obtain, starting from 0, with a maximum value of\n {@link OH_Drawing_TypographyGetLineCount} - 1. 0.0 is returned when the index is out of range.\n @return Line height of the specified line, in physical pixels (px).\n @since 11\n @version 1.0"]
2905 pub fn OH_Drawing_TypographyGetLineHeight(
2906 typography: *mut OH_Drawing_Typography,
2907 lineNumber: ::std::os::raw::c_int,
2908 ) -> f64;
2909}
2910extern "C" {
2911 #[doc = " @brief Obtains the line width of a specified line. This function must be called after\n {@link OH_Drawing_TypographyLayout} is called.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param typography Pointer to the **OH_Drawing_Typography** object, which is obtained from\n {@link OH_Drawing_CreateTypography}.\n @param lineNumber Index of the line to obtain, starting from 0. The maximum value is\n {@link OH_Drawing_TypographyGetLineCount} - 1. Returns 0.0 when the index is out of range.\n @return Width of the specified line, in physical pixels (px).\n @since 11\n @version 1.0"]
2912 pub fn OH_Drawing_TypographyGetLineWidth(
2913 typography: *mut OH_Drawing_Typography,
2914 lineNumber: ::std::os::raw::c_int,
2915 ) -> f64;
2916}
2917extern "C" {
2918 #[doc = " @brief Obtains the line bounds in a typography object. This function must be called after\n {@link OH_Drawing_TypographyLayout} is called. This function can only be used to obtain the bounds of existing lines.\n That is, the line index must start from 0, and the maximum index is {@link OH_Drawing_TypographyGetLineCount} – 1.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param typography Pointer to the {@link OH_Drawing_Typography} object, which is obtained from\n {@link OH_Drawing_CreateTypography}.\n @param lineNumber Row index.\n @param includeSpaces Whether the returned bounds contain spaces. The value **true** means that the bounds contain\n spaces, and **false** means the opposite.\n @return Pointer to the {@link OH_Drawing_Range} object. If the line index is invalid, **start** and **end** in the\n result value are both **0**.\n @since 12\n @version 1.0"]
2919 pub fn OH_Drawing_TypographyGetLineTextRange(
2920 typography: *mut OH_Drawing_Typography,
2921 lineNumber: ::std::os::raw::c_int,
2922 includeSpaces: bool,
2923 ) -> *mut OH_Drawing_Range;
2924}
2925extern "C" {
2926 #[doc = " @brief Constructs a font descriptor object for describing detailed information about a system font. When the\n {@link OH_Drawing_FontDescriptor} is no longer needed, use {@link OH_Drawing_DestroyFontDescriptor} to release the\n pointer to the object.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @return Pointer to the created {@link OH_Drawing_FontDescriptor} object.\n @since 12\n @version 1.0"]
2927 pub fn OH_Drawing_CreateFontDescriptor() -> *mut OH_Drawing_FontDescriptor;
2928}
2929extern "C" {
2930 #[doc = " @brief Destroys an **OH_Drawing_FontDescriptor** object and reclaims the memory occupied by the object.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param descriptor Pointer to the {@link OH_Drawing_FontDescriptor} object, which is obtained from\n {@link OH_Drawing_CreateFontDescriptor}.\n @since 12\n @version 1.0"]
2931 pub fn OH_Drawing_DestroyFontDescriptor(descriptor: *mut OH_Drawing_FontDescriptor);
2932}
2933extern "C" {
2934 #[doc = " @brief Constructs a font parser object for parsing system fonts. When the {@link OH_Drawing_FontParser} is no longer\n needed, use {@link OH_Drawing_DestroyFontParser} to release the pointer to the object.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @return Pointer to the created {@link OH_Drawing_FontParser} object.\n @since 12\n @version 1.0"]
2935 pub fn OH_Drawing_CreateFontParser() -> *mut OH_Drawing_FontParser;
2936}
2937extern "C" {
2938 #[doc = " @brief Destroys an **OH_Drawing_FontParser** object and reclaims the memory occupied by the object.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param parser Pointer to the {@link OH_Drawing_FontParser} object, which is obtained from\n {@link OH_Drawing_CreateFontParser}.\n @since 12\n @version 1.0"]
2939 pub fn OH_Drawing_DestroyFontParser(parser: *mut OH_Drawing_FontParser);
2940}
2941extern "C" {
2942 #[doc = " @brief Obtains the list of system font names. When the list is no longer needed, use\n {@link OH_Drawing_DestroySystemFontList} to release the memory. This API is supported only on phones and PC/2-in-1\n devices.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param fontParser Pointer to the {@link OH_Drawing_FontParser} object, which is obtained from\n {@link OH_Drawing_CreateFontParser}.\n @param num Pointer to the number of system font names.\n @return System font list.\n @since 12\n @version 1.0"]
2943 pub fn OH_Drawing_FontParserGetSystemFontList(
2944 fontParser: *mut OH_Drawing_FontParser,
2945 num: *mut usize,
2946 ) -> *mut *mut ::std::os::raw::c_char;
2947}
2948extern "C" {
2949 #[doc = " @brief Reclaims the memory occupied by the system font list.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param fontList Double pointer to the list of system font names.\n @param num Number of system font names.\n @since 12\n @version 1.0"]
2950 pub fn OH_Drawing_DestroySystemFontList(fontList: *mut *mut ::std::os::raw::c_char, num: usize);
2951}
2952extern "C" {
2953 #[doc = " @brief Obtains the information about a system font based on the given system font name. This API is supported only\n on phones and PC/2-in-1 devices.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param fontParser Pointer to the {@link OH_Drawing_FontParser} object, which is obtained from\n {@link OH_Drawing_CreateFontParser}.\n @param name Name of the system font. For details about valid system font names, see\n {@link OH_Drawing_FontParserGetSystemFontList}.\n @return Pointer to the system font descriptor object. When no longer needed, use\n {@link OH_Drawing_DestroyFontDescriptor} to release the pointer.\n @since 12\n @version 1.0"]
2954 pub fn OH_Drawing_FontParserGetFontByName(
2955 fontParser: *mut OH_Drawing_FontParser,
2956 name: *const ::std::os::raw::c_char,
2957 ) -> *mut OH_Drawing_FontDescriptor;
2958}
2959extern "C" {
2960 #[doc = " @brief Obtains the line metrics in a typography object. This function must be called after\n {@link OH_Drawing_TypographyLayout} is called. Release this pointer by calling {@link OH_Drawing_DestroyLineMetrics}\n when this object is no longer needed.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param typography Pointer to the {@link OH_Drawing_Typography} object, which is obtained from\n {@link OH_Drawing_CreateTypography}.\n @return Pointer to the {@link OH_Drawing_LineMetrics} object.\n @since 12\n @version 1.0"]
2961 pub fn OH_Drawing_TypographyGetLineMetrics(
2962 typography: *mut OH_Drawing_Typography,
2963 ) -> *mut OH_Drawing_LineMetrics;
2964}
2965extern "C" {
2966 #[doc = " @brief Obtains the number of lines.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param lineMetrics Pointer to the {@link OH_Drawing_LineMetrics} object, which is obtained from\n {@link OH_Drawing_LineMetrics}.\n @return Number of lines.\n @since 12\n @version 1.0"]
2967 pub fn OH_Drawing_LineMetricsGetSize(lineMetrics: *mut OH_Drawing_LineMetrics) -> usize;
2968}
2969extern "C" {
2970 #[doc = " @brief Destroys an **OH_Drawing_LineMetrics** object and reclaims the memory occupied by the object.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param lineMetrics Pointer to the {@link OH_Drawing_LineMetrics} object, which is obtained from\n {@link OH_Drawing_LineMetrics}.\n @since 12\n @version 1.0"]
2971 pub fn OH_Drawing_DestroyLineMetrics(lineMetrics: *mut OH_Drawing_LineMetrics);
2972}
2973extern "C" {
2974 #[doc = " @brief Obtains the position information of a specified line in the typography object. For details, see the\n {@link OH_Drawing_LineMetrics} struct. This API must be called after {@link OH_Drawing_TypographyLayout} is called.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param typography Pointer to the {@link OH_Drawing_Typography} object, which is obtained from\n {@link OH_Drawing_CreateTypography}.\n @param lineNumber Index of the line to obtain, starting from 0 and up to {@link OH_Drawing_TypographyGetLineCount} -\n 1. Returns false when the index is out of range.\n @param lineMetric Pointer to the line metrics object {@link OH_Drawing_LineMetrics}, used as an output parameter.\n @return Whether the metrics of the given line is obtained. **true** means yes; **false** otherwise.\n @since 12\n @version 1.0"]
2975 pub fn OH_Drawing_TypographyGetLineMetricsAt(
2976 typography: *mut OH_Drawing_Typography,
2977 lineNumber: ::std::os::raw::c_int,
2978 lineMetric: *mut OH_Drawing_LineMetrics,
2979 ) -> bool;
2980}
2981extern "C" {
2982 #[doc = " @brief Sets the ellipsis text for a typography style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TypographyStyle} object, which is obtained from\n {@link OH_Drawing_CreateTypographyStyle}.\n @param ellipsis Ellipsis text.\n @since 12\n @version 1.0"]
2983 pub fn OH_Drawing_SetTypographyTextEllipsis(
2984 style: *mut OH_Drawing_TypographyStyle,
2985 ellipsis: *const ::std::os::raw::c_char,
2986 );
2987}
2988extern "C" {
2989 #[doc = " @brief Sets the locale for a typography style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TypographyStyle} object, which is obtained from\n {@link OH_Drawing_CreateTypographyStyle}.\n @param locale Locale. The data type is a pointer to char. The format follows the BCP 47 language tag standard, for\n example, 'en' for English, 'zh-Hans' for Simplified Chinese, and 'zh-Hant' for Traditional Chinese. If not\n specified, the default locale is 'zh-Hans'.\n @since 12\n @version 1.0"]
2990 pub fn OH_Drawing_SetTypographyTextLocale(
2991 style: *mut OH_Drawing_TypographyStyle,
2992 locale: *const ::std::os::raw::c_char,
2993 );
2994}
2995extern "C" {
2996 #[doc = " @brief Sets the text division ratio, which is used to determine the cursor position within a glyph when tapping to\n locate a character.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TypographyStyle} object, which is obtained from\n {@link OH_Drawing_CreateTypographyStyle}.\n @param textSplitRatio Text split ratio. The value range is [0, 1], and the default value is 0.5. When mapping click\n coordinates to character positions, this is the threshold within a glyph for determining whether the position\n belongs to the current character or the next character. A larger value favors the current character, and a\n smaller value favors the next character.\n @since 12\n @version 1.0"]
2997 pub fn OH_Drawing_SetTypographyTextSplitRatio(
2998 style: *mut OH_Drawing_TypographyStyle,
2999 textSplitRatio: f32,
3000 );
3001}
3002extern "C" {
3003 #[doc = " @brief Obtains the default text style of a typography style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TypographyStyle} object, which is obtained from\n {@link OH_Drawing_CreateTypographyStyle}.\n @return Pointer to the {@link OH_Drawing_TextStyle} object. Release this pointer by calling\n {@link OH_Drawing_DestroyTextStyle} when this object is no longer needed.\n @since 12\n @version 1.0"]
3004 pub fn OH_Drawing_TypographyGetTextStyle(
3005 style: *mut OH_Drawing_TypographyStyle,
3006 ) -> *mut OH_Drawing_TextStyle;
3007}
3008extern "C" {
3009 #[doc = " @brief Obtains the text alignment mode.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TypographyStyle} object, which is obtained from\n {@link OH_Drawing_CreateTypographyStyle}.\n @return Text alignment mode.\n @since 12\n @version 1.0\n @deprecated since 18\n @useinstead OH_Drawing_TypographyStyleGetEffectiveAlignment"]
3010 pub fn OH_Drawing_TypographyGetEffectiveAlignment(
3011 style: *mut OH_Drawing_TypographyStyle,
3012 ) -> ::std::os::raw::c_int;
3013}
3014extern "C" {
3015 #[doc = " @brief Checks whether the maximum number of lines is limited for text.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TypographyStyle} object, which is obtained from\n {@link OH_Drawing_CreateTypographyStyle}.\n @return Whether the text has a maximum line limit. The value **true** means there is no maximum line limit, and **\n false** means there is a maximum line limit.\n @since 12\n @version 1.0"]
3016 pub fn OH_Drawing_TypographyIsLineUnlimited(style: *mut OH_Drawing_TypographyStyle) -> bool;
3017}
3018extern "C" {
3019 #[doc = " @brief Checks whether an ellipsis is configured for a typography style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TypographyStyle} object, which is obtained from\n {@link OH_Drawing_CreateTypographyStyle}.\n @return Whether ellipsis is configured for the specified typography style. **true** means yes; **false** otherwise.\n @since 12\n @version 1.0"]
3020 pub fn OH_Drawing_TypographyIsEllipsized(style: *mut OH_Drawing_TypographyStyle) -> bool;
3021}
3022extern "C" {
3023 #[doc = " @brief Sets a text style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param handler Pointer to the {@link OH_Drawing_TypographyStyle} object, which is obtained from\n {@link OH_Drawing_CreateTypographyStyle}.\n @param style Pointer to the {@link OH_Drawing_TextStyle} object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @since 12\n @version 1.0"]
3024 pub fn OH_Drawing_SetTypographyTextStyle(
3025 handler: *mut OH_Drawing_TypographyStyle,
3026 style: *mut OH_Drawing_TextStyle,
3027 );
3028}
3029extern "C" {
3030 #[doc = " @brief Obtains the font metrics of a text style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param typography Pointer to the {@link OH_Drawing_Typography} object, which is obtained from\n {@link OH_Drawing_CreateTypography}.\n @param style Pointer to the {@link OH_Drawing_TextStyle} object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @param fontmetrics Pointer to the {@link OH_Drawing_Font_Metrics} object, which is obtained from\n {@link OH_Drawing_Font_Metrics}.\n @return Whether the font attributes are obtained. **true** means yes; **false** otherwise.\n @since 12\n @version 1.0"]
3031 pub fn OH_Drawing_TextStyleGetFontMetrics(
3032 typography: *mut OH_Drawing_Typography,
3033 style: *mut OH_Drawing_TextStyle,
3034 fontmetrics: *mut OH_Drawing_Font_Metrics,
3035 ) -> bool;
3036}
3037extern "C" {
3038 #[doc = " @brief Obtains the metrics of a given line or the metrics of the first character in a given line in a typography\n object. This function must be called after {@link OH_Drawing_TypographyLayout} is called.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param typography Pointer to the {@link OH_Drawing_Typography} object, which is obtained from\n {@link OH_Drawing_CreateTypography}.\n @param lineNumber Index of the line number to obtain, starting from 0 and up to\n {@link OH_Drawing_TypographyGetLineCount} - 1. Returns false when out of range.\n @param oneLine Whether to obtain the metrics of the entire line. The value **true** means to obtain the metrics of\n the entire line, and **false** means to obtain the metrics of the first character in the line.\n @param includeWhitespace Whether the text width includes whitespace. The value true means whitespace is included,\n and false means whitespace is not included.\n @param drawingLineMetrics Pointer to the {@link OH_Drawing_LineMetrics} object, which is obtained from\n {@link OH_Drawing_LineMetrics}.\n @return Returns **true** if the metrics of the given line or the metrics of the first character in the given line is\n obtained; returns **false** otherwise.\n @since 12\n @version 1.0"]
3039 pub fn OH_Drawing_TypographyGetLineInfo(
3040 typography: *mut OH_Drawing_Typography,
3041 lineNumber: ::std::os::raw::c_int,
3042 oneLine: bool,
3043 includeWhitespace: bool,
3044 drawingLineMetrics: *mut OH_Drawing_LineMetrics,
3045 ) -> bool;
3046}
3047extern "C" {
3048 #[doc = " @brief Sets the default font weight of the typography style. Before <!--RP1-->OpenHarmony 6.1<!--RP1End-->, only\n variable fonts in system fonts support font weight adjustment. Starting from <!--RP1-->OpenHarmony 6.1<!--RP1End-->,\n both system fonts and variable fonts in third-party registered fonts support font weight adjustment. For non-\n variable fonts, the font weight does not change when the weight value is set to less than semi-bold, and a pseudo-\n bold effect may be triggered when the weight value is set to semi-bold or greater.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TypographyStyle} object, which is obtained from\n {@link OH_Drawing_CreateTypographyStyle}.\n @param weight Font weight.\n <br>For details about the available options, see {@link OH_Drawing_FontWeight}.\n @since 12\n @version 1.0"]
3049 pub fn OH_Drawing_SetTypographyTextFontWeight(
3050 style: *mut OH_Drawing_TypographyStyle,
3051 weight: ::std::os::raw::c_int,
3052 );
3053}
3054extern "C" {
3055 #[doc = " @brief Sets the default font style for a typography style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the typography style object {@link OH_Drawing_TypographyStyle}, obtained by\n {@link OH_Drawing_CreateTypographyStyle}.\n @param fontStyle Font style. The value **1** indicates italic, and **0** or other values indicate non-italic. For\n details about the available options, see {@link OH_Drawing_FontStyle}.\n @since 12\n @version 1.0"]
3056 pub fn OH_Drawing_SetTypographyTextFontStyle(
3057 style: *mut OH_Drawing_TypographyStyle,
3058 fontStyle: ::std::os::raw::c_int,
3059 );
3060}
3061extern "C" {
3062 #[doc = " @brief Sets the font family name for text.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TypographyStyle} object, which is obtained from\n {@link OH_Drawing_CreateTypographyStyle}.\n @param fontFamily Pointer to the name of the font family.\n @since 12\n @version 1.0"]
3063 pub fn OH_Drawing_SetTypographyTextFontFamily(
3064 style: *mut OH_Drawing_TypographyStyle,
3065 fontFamily: *const ::std::os::raw::c_char,
3066 );
3067}
3068extern "C" {
3069 #[doc = " @brief Sets the font size for text.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the typography style {@link OH_Drawing_TypographyStyle}, which is obtained from\n {@link OH_Drawing_CreateTypographyStyle}.\n @param fontSize Font size (greater than 0), in px.\n @since 12\n @version 1.0"]
3070 pub fn OH_Drawing_SetTypographyTextFontSize(
3071 style: *mut OH_Drawing_TypographyStyle,
3072 fontSize: f64,
3073 );
3074}
3075extern "C" {
3076 #[doc = " @brief Sets the font height for text typography as a multiple of the current font size.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TypographyStyle} object, which is obtained from\n {@link OH_Drawing_CreateTypographyStyle}.\n @param fontHeight Font height, which is a multiple of the current font size. If the value is less than 0, it is\n treated as 0.\n @since 12\n @version 1.0"]
3077 pub fn OH_Drawing_SetTypographyTextFontHeight(
3078 style: *mut OH_Drawing_TypographyStyle,
3079 fontHeight: f64,
3080 );
3081}
3082extern "C" {
3083 #[doc = " @brief Sets whether to enable half leading for text.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TypographyStyle} object, which is obtained from\n {@link OH_Drawing_CreateTypographyStyle}.\n @param halfLeading Whether to enable half leading. The value **true** means to enable half leading, and **false**\n means the opposite.\n @since 12\n @version 1.0"]
3084 pub fn OH_Drawing_SetTypographyTextHalfLeading(
3085 style: *mut OH_Drawing_TypographyStyle,
3086 halfLeading: bool,
3087 );
3088}
3089extern "C" {
3090 #[doc = " @brief Sets whether to enable the text line style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the typography style object {@link OH_Drawing_TypographyStyle}, obtained by\n {@link OH_Drawing_CreateTypographyStyle}.\n @param useLineStyle Whether to enable the line style. The value **true** means to enable the line style, and **false*\n * means the opposite.\n @since 12\n @version 1.0"]
3091 pub fn OH_Drawing_SetTypographyTextUseLineStyle(
3092 style: *mut OH_Drawing_TypographyStyle,
3093 useLineStyle: bool,
3094 );
3095}
3096extern "C" {
3097 #[doc = " @brief Sets the font weight of the text style in the strut style of the typography style. Before <!--RP1-->\n OpenHarmony 6.1<!--RP1End-->, only variable fonts in system fonts support font weight adjustment. Starting from <!--\n RP1-->OpenHarmony 6.1<!--RP1End-->, both system fonts and variable fonts in third-party registered fonts support\n font weight adjustment. For non-variable fonts, the font weight does not change when the weight value is set to less\n than semi-bold, and a pseudo-bold effect may be triggered when the weight value is set to semi-bold or greater.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TypographyStyle} object, which is obtained from\n {@link OH_Drawing_CreateTypographyStyle}.\n @param weight Font weight. For details about the available options, see {@link OH_Drawing_FontWeight}.\n @since 12\n @version 1.0"]
3098 pub fn OH_Drawing_SetTypographyTextLineStyleFontWeight(
3099 style: *mut OH_Drawing_TypographyStyle,
3100 weight: ::std::os::raw::c_int,
3101 );
3102}
3103extern "C" {
3104 #[doc = " @brief Sets the font style of the strut style in a typography style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the typography style object {@link OH_Drawing_TypographyStyle}, obtained by\n {@link OH_Drawing_CreateTypographyStyle}.\n @param fontStyle Font style. For details about the available options, see {@link OH_Drawing_FontStyle}.\n @since 12\n @version 1.0"]
3105 pub fn OH_Drawing_SetTypographyTextLineStyleFontStyle(
3106 style: *mut OH_Drawing_TypographyStyle,
3107 fontStyle: ::std::os::raw::c_int,
3108 );
3109}
3110extern "C" {
3111 #[doc = " @brief Sets the font family of the line style for text typography.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to a typography style object {@link OH_Drawing_TypographyStyle}, obtained by\n {@link OH_Drawing_CreateTypographyStyle}.\n @param fontFamiliesNumber Number of font family names. Negative values are not allowed.\n @param fontFamilies Pointer to an array of font family types.\n @since 12\n @version 1.0"]
3112 pub fn OH_Drawing_SetTypographyTextLineStyleFontFamilies(
3113 style: *mut OH_Drawing_TypographyStyle,
3114 fontFamiliesNumber: ::std::os::raw::c_int,
3115 fontFamilies: *mut *const ::std::os::raw::c_char,
3116 );
3117}
3118extern "C" {
3119 #[doc = " @brief Sets the font size for a text line style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the typography style object {@link OH_Drawing_TypographyStyle}, obtained by\n {@link OH_Drawing_CreateTypographyStyle}.\n @param lineStyleFontSize Font size (greater than 0), in physical pixels (px).\n @since 12\n @version 1.0"]
3120 pub fn OH_Drawing_SetTypographyTextLineStyleFontSize(
3121 style: *mut OH_Drawing_TypographyStyle,
3122 lineStyleFontSize: f64,
3123 );
3124}
3125extern "C" {
3126 #[doc = " @brief Sets the font height of the line style for text typography as a multiple of the current font size.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the typography style object {@link OH_Drawing_TypographyStyle}, obtained by\n {@link OH_Drawing_CreateTypographyStyle}.\n @param lineStyleFontHeight Font height. The value must be greater than 0.\n @since 12\n @version 1.0"]
3127 pub fn OH_Drawing_SetTypographyTextLineStyleFontHeight(
3128 style: *mut OH_Drawing_TypographyStyle,
3129 lineStyleFontHeight: f64,
3130 );
3131}
3132extern "C" {
3133 #[doc = " @brief Sets whether to enable half leading for a text line style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the typography style object {@link OH_Drawing_TypographyStyle}, obtained by\n {@link OH_Drawing_CreateTypographyStyle}.\n @param lineStyleHalfLeading Whether the half leading takes effect. **true** means yes; **false** otherwise.\n @since 12\n @version 1.0"]
3134 pub fn OH_Drawing_SetTypographyTextLineStyleHalfLeading(
3135 style: *mut OH_Drawing_TypographyStyle,
3136 lineStyleHalfLeading: bool,
3137 );
3138}
3139extern "C" {
3140 #[doc = " @brief Sets the spacing scale factor for a text line style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the typography style object {@link OH_Drawing_TypographyStyle}, obtained by\n {@link OH_Drawing_CreateTypographyStyle}.\n @param spacingScale Line style spacing scale for scaling line spacing. A value greater than 1.0 increases the line\n spacing, a value less than 1.0 decreases it, and 1.0 indicates the original spacing.\n @since 12\n @version 1.0"]
3141 pub fn OH_Drawing_SetTypographyTextLineStyleSpacingScale(
3142 style: *mut OH_Drawing_TypographyStyle,
3143 spacingScale: f64,
3144 );
3145}
3146extern "C" {
3147 #[doc = " @brief Sets whether to enable the text line style only.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the typography style object {@link OH_Drawing_TypographyStyle}, obtained by\n {@link OH_Drawing_CreateTypographyStyle}.\n @param lineStyleOnly Whether to enable the line style only. **true** means yes; **false** otherwise.\n @since 12\n @version 1.0"]
3148 pub fn OH_Drawing_SetTypographyTextLineStyleOnly(
3149 style: *mut OH_Drawing_TypographyStyle,
3150 lineStyleOnly: bool,
3151 );
3152}
3153extern "C" {
3154 #[doc = " @brief Creates a pointer to a text shadow object. When the {@link OH_Drawing_TextShadow} is no longer needed, use\n {@link OH_Drawing_DestroyTextShadow} to release the pointer to the object.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @return Pointer to the created text shadow object.\n @since 12\n @version 1.0"]
3155 pub fn OH_Drawing_CreateTextShadow() -> *mut OH_Drawing_TextShadow;
3156}
3157extern "C" {
3158 #[doc = " @brief Releases the memory occupied by the text shadow object.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param shadow Pointer to the text shadow object {@link OH_Drawing_TextShadow}, obtained by\n {@link OH_Drawing_CreateTextShadow}.\n @since 12\n @version 1.0"]
3159 pub fn OH_Drawing_DestroyTextShadow(shadow: *mut OH_Drawing_TextShadow);
3160}
3161extern "C" {
3162 #[doc = " @brief Obtains the text shadow container. When the {@link OH_Drawing_TextShadow} is no longer needed, use\n {@link OH_Drawing_DestroyTextShadows} to release the pointer to the object.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TextStyle} object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @return Pointer to the text shadow container {@link OH_Drawing_TextShadow}.\n @since 12\n @version 1.0"]
3163 pub fn OH_Drawing_TextStyleGetShadows(
3164 style: *mut OH_Drawing_TextStyle,
3165 ) -> *mut OH_Drawing_TextShadow;
3166}
3167extern "C" {
3168 #[doc = " @brief Obtains the size of the text shadow container.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TextStyle} object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @return Size of the text shadow container.\n @since 12\n @version 1.0"]
3169 pub fn OH_Drawing_TextStyleGetShadowCount(
3170 style: *mut OH_Drawing_TextStyle,
3171 ) -> ::std::os::raw::c_int;
3172}
3173extern "C" {
3174 #[doc = " @brief Adds a text shadow element to the text shadow container.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TextStyle} object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @param shadow Pointer to the text shadow object {@link OH_Drawing_TextShadow}, created by\n {@link OH_Drawing_CreateTextShadow}.\n @since 12\n @version 1.0"]
3175 pub fn OH_Drawing_TextStyleAddShadow(
3176 style: *mut OH_Drawing_TextStyle,
3177 shadow: *const OH_Drawing_TextShadow,
3178 );
3179}
3180extern "C" {
3181 #[doc = " @brief Clears all elements in the text shadow container.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TextStyle} object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @since 12\n @version 1.0"]
3182 pub fn OH_Drawing_TextStyleClearShadows(style: *mut OH_Drawing_TextStyle);
3183}
3184extern "C" {
3185 #[doc = " @brief Obtains the element at the specified index in the text shadow container.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TextStyle} object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @param index Subscript index, ranging from 0 to the number of shadows minus 1. The number of shadows can be obtained\n via {@link OH_Drawing_TextStyleGetShadowCount}.\n @return Pointer to the text shadow object {@link OH_Drawing_TextShadow}.\n @since 12\n @version 1.0"]
3186 pub fn OH_Drawing_TextStyleGetShadowWithIndex(
3187 style: *mut OH_Drawing_TextStyle,
3188 index: ::std::os::raw::c_int,
3189 ) -> *mut OH_Drawing_TextShadow;
3190}
3191extern "C" {
3192 #[doc = " @brief Sets indents for typography. If this function is not called, texts will have no indentation applied.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param typography Pointer to the {@link OH_Drawing_Typography} object, which is obtained from\n {@link OH_Drawing_CreateTypography}.\n @param indentsNumber Number of indents. The value must be less than or equal to the length of the indents array to\n avoid display exceptions caused by access to the out-of-bounds array.\n @param indents Pointer to a floating-point array, in which each element indicates an indentation width, in px.\n Before calling {@link OH_Drawing_Typography} API, you need to declare and initialize the floating-point array.\n @since 12\n @version 1.0"]
3193 pub fn OH_Drawing_TypographySetIndents(
3194 typography: *mut OH_Drawing_Typography,
3195 indentsNumber: ::std::os::raw::c_int,
3196 indents: *const f32,
3197 );
3198}
3199extern "C" {
3200 #[doc = " @brief Obtains indents with a given index in a typography object. The line index starts from 0.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param typography Pointer to the {@link OH_Drawing_Typography} object, which is obtained from\n {@link OH_Drawing_CreateTypography}.\n @param index Subscript index of the indentation value. Returns 0.0 if index is less than 0. Returns the last\n indentation value if index is greater than or equal to the number of indentation values.\n @return Value of the element corresponding to the index.\n @since 12\n @version 1.0"]
3201 pub fn OH_Drawing_TypographyGetIndentsWithIndex(
3202 typography: *mut OH_Drawing_Typography,
3203 index: ::std::os::raw::c_int,
3204 ) -> f32;
3205}
3206extern "C" {
3207 #[doc = " @brief Releases the memory occupied by the vector composed of **OH_Drawing_TextShadow** objects.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param shadow Pointer to the text shadow object {@link OH_Drawing_TextShadow}, obtained by\n {@link OH_Drawing_CreateTextShadow}.\n @since 12\n @version 1.0"]
3208 pub fn OH_Drawing_DestroyTextShadows(shadow: *mut OH_Drawing_TextShadow);
3209}
3210extern "C" {
3211 #[doc = " @brief Sets a text height modifier pattern.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TypographyStyle} object, which is obtained from\n {@link OH_Drawing_CreateTypographyStyle}.\n @param heightMode Text height modifier mode. The value is an enumerated value of the\n {@link OH_Drawing_TextHeightBehavior} type.\n @since 12\n @version 1.0"]
3212 pub fn OH_Drawing_TypographyTextSetHeightBehavior(
3213 style: *mut OH_Drawing_TypographyStyle,
3214 heightMode: OH_Drawing_TextHeightBehavior,
3215 );
3216}
3217extern "C" {
3218 #[doc = " @brief Obtains the text height modifier pattern.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TypographyStyle} object, which is obtained from\n {@link OH_Drawing_CreateTypographyStyle}.\n @return Text height modifier mode, which is an enumerated value of the {@link OH_Drawing_TextHeightBehavior} type.\n @since 12\n @version 1.0"]
3219 pub fn OH_Drawing_TypographyTextGetHeightBehavior(
3220 style: *mut OH_Drawing_TypographyStyle,
3221 ) -> OH_Drawing_TextHeightBehavior;
3222}
3223extern "C" {
3224 #[doc = " @brief Sets a background rectangle and style ID for a text style. The style ID is valid only when the background box\n is a rounded rectangle.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the **OH_Drawing_TextStyle** object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @param rectStyleInfo Pointer to the {@link OH_Drawing_RectStyle_Info} object.\n @param styleId Style ID. The style ID is valid only when the background box is a rounded rectangle. Text processing\n is divided into multiple segments. Each segment has its own text style. **id** indicates the sequence number of\n the background box in which the segment is drawn.\n <br>If the ID of each segment in a row is **0**, all segments are drawn in the same background box. If a row\n contains segments with IDs **0** and **1**, the segment with ID **0** is drawn in a background box, and the\n segment with ID **1** is drawn in another background box. Other cases can be deduced in the same way.\n @since 12\n @version 1.0"]
3225 pub fn OH_Drawing_TextStyleSetBackgroundRect(
3226 style: *mut OH_Drawing_TextStyle,
3227 rectStyleInfo: *const OH_Drawing_RectStyle_Info,
3228 styleId: ::std::os::raw::c_int,
3229 );
3230}
3231extern "C" {
3232 #[doc = " @brief Adds the symbol to use in the typography creation process.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param handler Pointer to the {@link OH_Drawing_TypographyCreate} object, which is obtained from\n {@link OH_Drawing_CreateTypographyHandler}.\n @param symbol Symbol value. For details, see the Unicode value in the {@link HarmonyOS Symbol library}.\n @since 12\n @version 1.0"]
3233 pub fn OH_Drawing_TypographyHandlerAddSymbol(
3234 handler: *mut OH_Drawing_TypographyCreate,
3235 symbol: u32,
3236 );
3237}
3238extern "C" {
3239 #[doc = " @brief Adds a font feature for a text style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the **OH_Drawing_TextStyle** object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @param tag Pointer to the string identified by the keyword in the font feature key-value pair.\n @param value Value of the font feature key-value pair.\n @since 12\n @version 1.0"]
3240 pub fn OH_Drawing_TextStyleAddFontFeature(
3241 style: *mut OH_Drawing_TextStyle,
3242 tag: *const ::std::os::raw::c_char,
3243 value: ::std::os::raw::c_int,
3244 );
3245}
3246extern "C" {
3247 #[doc = " @brief Adds a font variation. This function takes effect only when the corresponding font file (.ttf file) supports\n variable adjustment. Otherwise, calling this function does not take effect.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the **OH_Drawing_TextStyle** object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @param axis Pointer to the key in the font variation key-value pair. Currently, only **'wght'** is supported,\n indicating the font weight.\n @param value Value of the font variation key-value pair. Currently, the value range of **'wght'** for the default\n font is \\[0,900\\].\n @since 12\n @version 1.0"]
3248 pub fn OH_Drawing_TextStyleAddFontVariation(
3249 style: *mut OH_Drawing_TextStyle,
3250 axis: *const ::std::os::raw::c_char,
3251 value: f32,
3252 );
3253}
3254extern "C" {
3255 #[doc = " @brief Adds the normalized variable font attributes. This function takes effect only when the corresponding font\n file (.ttf file) supports variable adjustment.\n\n @param style Pointer to the **OH_Drawing_TextStyle** object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @param axis Pointer to the key in the font variation key-value pair.\n @param normalizedValue Value of the font variation key-value pair. The normalized value range is [-1,1], mapping the\n range from the minimum value to the maximum value configured in the font file. **0** indicates the default value\n configured in the font file.\n @since 24"]
3256 #[cfg(feature = "api-24")]
3257 pub fn OH_Drawing_TextStyleAddFontVariationWithNormalization(
3258 style: *mut OH_Drawing_TextStyle,
3259 axis: *const ::std::os::raw::c_char,
3260 normalizedValue: f32,
3261 );
3262}
3263extern "C" {
3264 #[doc = " @brief Obtains all the contents in a font feature map container of a text style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the **OH_Drawing_TextStyle** object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @return Pointer to the font feature struct, which stores all the contents obtained.\n @since 12\n @version 1.0"]
3265 pub fn OH_Drawing_TextStyleGetFontFeatures(
3266 style: *mut OH_Drawing_TextStyle,
3267 ) -> *mut OH_Drawing_FontFeature;
3268}
3269extern "C" {
3270 #[doc = " @brief Reclaims the memory occupied by the struct array that holds all the font features.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param fontFeature Pointer to the struct array that holds all the font features, which is obtained from\n {@link OH_Drawing_TextStyleGetFontFeatures}.\n @param fontFeatureSize Size of the struct array that holds all the font features.\n @since 12\n @version 1.0"]
3271 pub fn OH_Drawing_TextStyleDestroyFontFeatures(
3272 fontFeature: *mut OH_Drawing_FontFeature,
3273 fontFeatureSize: usize,
3274 );
3275}
3276extern "C" {
3277 #[doc = " @brief Obtains the size of a font feature map container in a text style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the **OH_Drawing_TextStyle** object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @return Size of a font feature map container.\n @since 12\n @version 1.0"]
3278 pub fn OH_Drawing_TextStyleGetFontFeatureSize(style: *mut OH_Drawing_TextStyle) -> usize;
3279}
3280extern "C" {
3281 #[doc = " @brief Clears all the contents in a font feature map container of a text style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the **OH_Drawing_TextStyle** object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @since 12\n @version 1.0"]
3282 pub fn OH_Drawing_TextStyleClearFontFeature(style: *mut OH_Drawing_TextStyle);
3283}
3284extern "C" {
3285 #[doc = " @brief Sets a baseline drift for a text style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the **OH_Drawing_TextStyle** object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @param lineShift Baseline offset of the text. A positive value shifts upward, and a negative value shifts downward,\n in px.\n @since 12\n @version 1.0"]
3286 pub fn OH_Drawing_TextStyleSetBaselineShift(style: *mut OH_Drawing_TextStyle, lineShift: f64);
3287}
3288extern "C" {
3289 #[doc = " @brief Obtains the baseline drift of a text style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the **OH_Drawing_TextStyle** object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @return Baseline shift.\n @since 12\n @version 1.0"]
3290 pub fn OH_Drawing_TextStyleGetBaselineShift(style: *mut OH_Drawing_TextStyle) -> f64;
3291}
3292extern "C" {
3293 #[doc = " @brief Obtains the color of a text style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TextStyle} object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @return Text color.\n @since 12\n @version 1.0"]
3294 pub fn OH_Drawing_TextStyleGetColor(style: *mut OH_Drawing_TextStyle) -> u32;
3295}
3296extern "C" {
3297 #[doc = " @brief Obtains the decoration style of a text style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TextStyle} object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @return Text decoration style. For details, see {@link OH_Drawing_TextDecorationStyle}.\n @since 12\n @version 1.0"]
3298 pub fn OH_Drawing_TextStyleGetDecorationStyle(
3299 style: *mut OH_Drawing_TextStyle,
3300 ) -> OH_Drawing_TextDecorationStyle;
3301}
3302extern "C" {
3303 #[doc = " @brief Obtains the font weight of a text style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TextStyle} object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @return Font weight. For details, see {@link OH_Drawing_FontWeight}.\n @since 12\n @version 1.0"]
3304 pub fn OH_Drawing_TextStyleGetFontWeight(
3305 style: *mut OH_Drawing_TextStyle,
3306 ) -> OH_Drawing_FontWeight;
3307}
3308extern "C" {
3309 #[doc = " @brief Obtains the font style of a text style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TextStyle} object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @return Font style. For details, see {@link OH_Drawing_FontStyle}.\n @since 12\n @version 1.0"]
3310 pub fn OH_Drawing_TextStyleGetFontStyle(
3311 style: *mut OH_Drawing_TextStyle,
3312 ) -> OH_Drawing_FontStyle;
3313}
3314extern "C" {
3315 #[doc = " @brief Obtains the baseline of a text style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TextStyle} object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @return Font baseline position. For details, see {@link OH_Drawing_TextBaseline}.\n @since 12\n @version 1.0"]
3316 pub fn OH_Drawing_TextStyleGetBaseline(
3317 style: *mut OH_Drawing_TextStyle,
3318 ) -> OH_Drawing_TextBaseline;
3319}
3320extern "C" {
3321 #[doc = " @brief Obtains the font family name list.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TextStyle} object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @param num Pointer to the number of font families.\n @return Pointer to the obtained font family name list.\n @since 12\n @version 1.0"]
3322 pub fn OH_Drawing_TextStyleGetFontFamilies(
3323 style: *mut OH_Drawing_TextStyle,
3324 num: *mut usize,
3325 ) -> *mut *mut ::std::os::raw::c_char;
3326}
3327extern "C" {
3328 #[doc = " @brief Reclaims the memory occupied by the font families, where **num** specifies the number of font families.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param fontFamilies Double pointer to the font families.\n @param num Number of font families.\n @since 12\n @version 1.0"]
3329 pub fn OH_Drawing_TextStyleDestroyFontFamilies(
3330 fontFamilies: *mut *mut ::std::os::raw::c_char,
3331 num: usize,
3332 );
3333}
3334extern "C" {
3335 #[doc = " @brief Obtains the font size of a text style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TextStyle} object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @return Font size.\n @since 12\n @version 1.0"]
3336 pub fn OH_Drawing_TextStyleGetFontSize(style: *mut OH_Drawing_TextStyle) -> f64;
3337}
3338extern "C" {
3339 #[doc = " @brief Obtains the letter spacing of a text style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TextStyle} object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @return Letter spacing.\n @since 12\n @version 1.0"]
3340 pub fn OH_Drawing_TextStyleGetLetterSpacing(style: *mut OH_Drawing_TextStyle) -> f64;
3341}
3342extern "C" {
3343 #[doc = " @brief Obtains the word spacing of a text style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TextStyle} object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @return Word spacing.\n @since 12\n @version 1.0"]
3344 pub fn OH_Drawing_TextStyleGetWordSpacing(style: *mut OH_Drawing_TextStyle) -> f64;
3345}
3346extern "C" {
3347 #[doc = " @brief Obtains the font height of a text style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TextStyle} object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @return Font height of a text style.\n @since 12\n @version 1.0"]
3348 pub fn OH_Drawing_TextStyleGetFontHeight(style: *mut OH_Drawing_TextStyle) -> f64;
3349}
3350extern "C" {
3351 #[doc = " @brief Checks whether half leading is enabled for a text style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TextStyle} object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @return Whether half leading is enabled for a text style. **true** means enabled; **false** otherwise.\n @since 12\n @version 1.0"]
3352 pub fn OH_Drawing_TextStyleGetHalfLeading(style: *mut OH_Drawing_TextStyle) -> bool;
3353}
3354extern "C" {
3355 #[doc = " @brief Vertical alignment mode of the text.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TypographyStyle} object, which is obtained from\n {@link OH_Drawing_CreateTypographyStyle}.\n @param align Vertical alignment mode of the text. The default mode is baseline alignment. For details about other\n options, see {@link OH_Drawing_TextVerticalAlignment}.\n @since 20\n @version 1.0"]
3356 #[cfg(feature = "api-20")]
3357 pub fn OH_Drawing_SetTypographyVerticalAlignment(
3358 style: *mut OH_Drawing_TypographyStyle,
3359 align: OH_Drawing_TextVerticalAlignment,
3360 );
3361}
3362extern "C" {
3363 #[doc = " @brief Obtains the locale of a text style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TextStyle} object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @return Pointer to the locale in the format of language-country. For example, zh-CN indicates Chinese (China), and\n en-US indicates English (United States). For details, see BCP 47.\n @since 12\n @version 1.0"]
3364 pub fn OH_Drawing_TextStyleGetLocale(
3365 style: *mut OH_Drawing_TextStyle,
3366 ) -> *const ::std::os::raw::c_char;
3367}
3368extern "C" {
3369 #[doc = " @brief Sets whether to enable superscript or subscript for text typography. If this API is not called, superscript\n and subscript are disabled by default.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TextStyle} object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @param textBadgeType Whether to enable superscript or subscript in text typography. TEXT_SUPERSCRIPT enables\n superscript, TEXT_SUBSCRIPT enables subscript, and the default value TEXT_BADGE_NONE disables both.\n @since 20"]
3370 #[cfg(feature = "api-20")]
3371 pub fn OH_Drawing_SetTextStyleBadgeType(
3372 style: *mut OH_Drawing_TextStyle,
3373 textBadgeType: OH_Drawing_TextBadgeType,
3374 );
3375}
3376extern "C" {
3377 #[doc = " @brief Sets the font style, including the font weight, width, and slant, for a text style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param drawingTextStyle Pointer to the {@link OH_Drawing_TextStyle} object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @param fontStyle Font style, including the font weight, width, and slant.\n @since 12\n @version 1.0"]
3378 pub fn OH_Drawing_SetTextStyleFontStyleStruct(
3379 drawingTextStyle: *mut OH_Drawing_TextStyle,
3380 fontStyle: OH_Drawing_FontStyleStruct,
3381 );
3382}
3383extern "C" {
3384 #[doc = " @brief Obtains the font style, including the font weight, width, and slant, of a text style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param drawingTextStyle Pointer to the {@link OH_Drawing_TextStyle} object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @return Returns the obtained font style object.\n @since 12\n @version 1.0"]
3385 pub fn OH_Drawing_TextStyleGetFontStyleStruct(
3386 drawingTextStyle: *mut OH_Drawing_TextStyle,
3387 ) -> OH_Drawing_FontStyleStruct;
3388}
3389extern "C" {
3390 #[doc = " @brief Sets the font style, including the font weight, width, and slant, for the default text style of a typography\n style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param drawingStyle Pointer to the {@link OH_Drawing_TypographyStyle} object, which is obtained from\n {@link OH_Drawing_CreateTypographyStyle}.\n @param fontStyle Font style, including the font weight, width, and slant.\n @since 12\n @version 1.0"]
3391 pub fn OH_Drawing_SetTypographyStyleFontStyleStruct(
3392 drawingStyle: *mut OH_Drawing_TypographyStyle,
3393 fontStyle: OH_Drawing_FontStyleStruct,
3394 );
3395}
3396extern "C" {
3397 #[doc = " @brief Obtains the font style, including the font weight, width, and slant, of the default text style of a\n typography style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param drawingStyle Pointer to the typography style object {@link OH_Drawing_TypographyStyle}, obtained by\n {@link OH_Drawing_CreateTypographyStyle}.\n @return Font style, including the font weight, width, and slant.\n @since 12\n @version 1.0"]
3398 pub fn OH_Drawing_TypographyStyleGetFontStyleStruct(
3399 drawingStyle: *mut OH_Drawing_TypographyStyle,
3400 ) -> OH_Drawing_FontStyleStruct;
3401}
3402extern "C" {
3403 #[doc = " @brief Checks whether two text styles are equal. The word width property is not involved in the comparison.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the first text style.\n @param comparedStyle Pointer to the first text style.\n @return Whether two text style objects are equal. **true** if the source rectangle is equal to the destination\n rectangle; **false** otherwise.\n @since 12\n @version 1.0"]
3404 pub fn OH_Drawing_TextStyleIsEqual(
3405 style: *const OH_Drawing_TextStyle,
3406 comparedStyle: *const OH_Drawing_TextStyle,
3407 ) -> bool;
3408}
3409extern "C" {
3410 #[doc = " @brief Checks whether the font style properties of two text styles are equal.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the first text style.\n @param comparedStyle Pointer to the first text style.\n @return true if the font style attributes of the two text style objects are equal; false otherwise.\n @since 12\n @version 1.0"]
3411 pub fn OH_Drawing_TextStyleIsEqualByFont(
3412 style: *const OH_Drawing_TextStyle,
3413 comparedStyle: *const OH_Drawing_TextStyle,
3414 ) -> bool;
3415}
3416extern "C" {
3417 #[doc = " @brief Checks whether two text styles have the same font style type.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the first text style.\n @param comparedStyle Pointer to the first text style.\n @param textStyleType Text style types as in {@link OH_Drawing_TextStyleType}.\n @return Whether two text styles have the same font style type. **true** means yes; **false** otherwise.\n @since 12\n @version 1.0"]
3418 pub fn OH_Drawing_TextStyleIsAttributeMatched(
3419 style: *const OH_Drawing_TextStyle,
3420 comparedStyle: *const OH_Drawing_TextStyle,
3421 textStyleType: OH_Drawing_TextStyleType,
3422 ) -> bool;
3423}
3424extern "C" {
3425 #[doc = " @brief Adds a placeholder.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TextStyle} object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @since 12\n @version 1.0"]
3426 pub fn OH_Drawing_TextStyleSetPlaceholder(style: *mut OH_Drawing_TextStyle);
3427}
3428extern "C" {
3429 #[doc = " @brief Checks whether a placeholder is set for a text style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TextStyle} object, which is obtained from\n {@link OH_Drawing_CreateTextStyle}.\n @return Checks whether a placeholder is set for a text style. **true** means yes; **false** otherwise.\n @since 12\n @version 1.0"]
3430 pub fn OH_Drawing_TextStyleIsPlaceholder(style: *mut OH_Drawing_TextStyle) -> bool;
3431}
3432extern "C" {
3433 #[doc = " @brief Obtains the text alignment mode.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TypographyStyle} object, which is obtained from\n {@link OH_Drawing_CreateTypographyStyle}.\n @return Text alignment modes as in {@link OH_Drawing_TextAlign}.\n @since 12\n @version 1.0"]
3434 pub fn OH_Drawing_TypographyStyleGetEffectiveAlignment(
3435 style: *mut OH_Drawing_TypographyStyle,
3436 ) -> OH_Drawing_TextAlign;
3437}
3438extern "C" {
3439 #[doc = " @brief Checks whether font hinting is enabled for a typography style. Font hinting is used to improve the\n readability and appearance of small-sized text when rendering it.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the typography style object {@link OH_Drawing_TypographyStyle}, obtained by\n {@link OH_Drawing_CreateTypographyStyle}.\n @return Whether to enable font hinting for a typography style. **true**: enabled; **false**: disabled.\n @since 12\n @version 1.0"]
3440 pub fn OH_Drawing_TypographyStyleIsHintEnabled(style: *mut OH_Drawing_TypographyStyle) -> bool;
3441}
3442extern "C" {
3443 #[doc = " @brief Obtains the system font configuration.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param errorCode Error code. For details, see {@link OH_Drawing_FontConfigInfoErrorCode}.\n @return Pointer to the system font configuration. When it is no longer required, call\n {@link OH_Drawing_DestroySystemFontConfigInfo} to release the pointer to the object.\n @since 12\n @version 1.0"]
3444 pub fn OH_Drawing_GetSystemFontConfigInfo(
3445 errorCode: *mut OH_Drawing_FontConfigInfoErrorCode,
3446 ) -> *mut OH_Drawing_FontConfigInfo;
3447}
3448extern "C" {
3449 #[doc = " @brief Reclaims the memory occupied by the system font configuration.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param drawFontCfgInfo Pointer to the {@link OH_Drawing_FontConfigInfo} object, which is obtained from\n {@link OH_Drawing_GetSystemFontConfigInfo}.\n @since 12\n @version 1.0"]
3450 pub fn OH_Drawing_DestroySystemFontConfigInfo(drawFontCfgInfo: *mut OH_Drawing_FontConfigInfo);
3451}
3452extern "C" {
3453 #[doc = " @brief Sets the strut style for a typography style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the typography style object {@link OH_Drawing_TypographyStyle}, obtained by\n {@link OH_Drawing_CreateTypographyStyle}.\n @param strutstyle Pointer to the {@link OH_Drawing_StrutStyle} object, which is obtained from\n {@link OH_Drawing_TypographyStyleGetStrutStyle}.\n @since 12\n @version 1.0"]
3454 pub fn OH_Drawing_SetTypographyStyleTextStrutStyle(
3455 style: *mut OH_Drawing_TypographyStyle,
3456 strutstyle: *mut OH_Drawing_StrutStyle,
3457 );
3458}
3459extern "C" {
3460 #[doc = " @brief Reclaims the memory occupied by a strut style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param strutstyle Pointer to the {@link OH_Drawing_StrutStyle} object, which is obtained from\n {@link OH_Drawing_TypographyStyleGetStrutStyle}.\n @since 12\n @version 1.0"]
3461 pub fn OH_Drawing_TypographyStyleDestroyStrutStyle(strutstyle: *mut OH_Drawing_StrutStyle);
3462}
3463extern "C" {
3464 #[doc = " @brief Obtains the strut style of a typography style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the typography style object {@link OH_Drawing_TypographyStyle}, obtained by\n {@link OH_Drawing_CreateTypographyStyle}.\n @return Pointer to the {@link OH_Drawing_StrutStyle} object.\n @since 12\n @version 1.0"]
3465 pub fn OH_Drawing_TypographyStyleGetStrutStyle(
3466 style: *mut OH_Drawing_TypographyStyle,
3467 ) -> *mut OH_Drawing_StrutStyle;
3468}
3469extern "C" {
3470 #[doc = " @brief Checks whether two strut styles are equal.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param from Pointer to the first strut style.\n @param to Pointer to the second strut style.\n @since 12\n @version 1.0"]
3471 pub fn OH_Drawing_TypographyStyleStrutStyleEquals(
3472 from: *mut OH_Drawing_StrutStyle,
3473 to: *mut OH_Drawing_StrutStyle,
3474 ) -> bool;
3475}
3476extern "C" {
3477 #[doc = " @brief Sets whether to enable font hinting for a typography style. Font hinting is used to improve the readability\n and appearance of small-sized text when rendering it.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the typography style object {@link OH_Drawing_TypographyStyle}, obtained by\n {@link OH_Drawing_CreateTypographyStyle}.\n @param hintsEnabled Whether to enable font hinting. **true**: enabled; **false**: disabled.\n @since 12\n @version 1.0"]
3478 pub fn OH_Drawing_TypographyStyleSetHintsEnabled(
3479 style: *mut OH_Drawing_TypographyStyle,
3480 hintsEnabled: bool,
3481 );
3482}
3483extern "C" {
3484 #[doc = " @brief Obtains all font metrics from a given line in a typography object. This function must be called after\n {@link OH_Drawing_TypographyLayout} is called. Otherwise, a null pointer is returned. Release this pointer by\n calling {@link OH_Drawing_TypographyDestroyLineFontMetrics} when this object is no longer needed.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param typography Pointer to the {@link OH_Drawing_Typography} object, which is obtained from\n {@link OH_Drawing_CreateTypography}.\n @param lineNumber Line number, which is an integer. The minimum value is 1, and the maximum value depends on the\n number of lines parsed by the font engine after text input. If a value greater than the maximum number is passed\n in, an error value is returned and an error message is printed.\n @param fontMetricsSize Pointer to the size of the struct.\n @return Returns all the font metrics.\n @since 12\n @version 1.0"]
3485 pub fn OH_Drawing_TypographyGetLineFontMetrics(
3486 typography: *mut OH_Drawing_Typography,
3487 lineNumber: usize,
3488 fontMetricsSize: *mut usize,
3489 ) -> *mut OH_Drawing_Font_Metrics;
3490}
3491extern "C" {
3492 #[doc = " @brief Reclaims the memory occupied by the struct array that holds all the font metrics of a given line.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param lineFontMetric Pointer to the first address of the struct array.\n @since 12\n @version 1.0"]
3493 pub fn OH_Drawing_TypographyDestroyLineFontMetrics(
3494 lineFontMetric: *mut OH_Drawing_Font_Metrics,
3495 );
3496}
3497extern "C" {
3498 #[doc = " @brief Marks a typography object as dirty data. This function is used to initialize the typography state.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param typography Pointer to the {@link OH_Drawing_Typography} object, which is obtained from\n {@link OH_Drawing_CreateTypography}.\n @since 12\n @version 1.0"]
3499 pub fn OH_Drawing_TypographyMarkDirty(typography: *mut OH_Drawing_Typography);
3500}
3501extern "C" {
3502 #[doc = " @brief Obtains the number of unresolved glyphs in a typography object. This function can be called only after\n {@link OH_Drawing_TypographyLayout} is called and applied.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param typography Pointer to the {@link OH_Drawing_Typography} object, which is obtained from\n {@link OH_Drawing_CreateTypography}.\n @return Number of unresolved glyphs.\n @since 12\n @version 1.0"]
3503 pub fn OH_Drawing_TypographyGetUnresolvedGlyphsCount(
3504 typography: *mut OH_Drawing_Typography,
3505 ) -> i32;
3506}
3507extern "C" {
3508 #[doc = " @brief Updates the font size in a typography object.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param typography Pointer to the {@link OH_Drawing_Typography} object, which is obtained from\n {@link OH_Drawing_CreateTypography}.\n @param from Reserved field, which is not used.\n @param to Reserved field, which is not used.\n @param fontSize Updated font size. The value must be greater than 0, in px.\n @since 12\n @version 1.0"]
3509 pub fn OH_Drawing_TypographyUpdateFontSize(
3510 typography: *mut OH_Drawing_Typography,
3511 from: usize,
3512 to: usize,
3513 fontSize: f32,
3514 );
3515}
3516extern "C" {
3517 #[doc = " @brief Updates the font color in a typography object. This API call also updates the decoration color if it hasn't\n been set yet. The updated font color takes effect after you call {@link OH_Drawing_TypographyPaint} to draw the text.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param typography Pointer to the {@link OH_Drawing_Typography} object, which is obtained from\n {@link OH_Drawing_CreateTypography}.\n @param color New font color.\n @since 20\n @version 1.0"]
3518 #[cfg(feature = "api-20")]
3519 pub fn OH_Drawing_TypographyUpdateFontColor(typography: *mut OH_Drawing_Typography, color: u32);
3520}
3521extern "C" {
3522 #[doc = " @brief Updates the decoration type of a typography object. The updated decoration type takes effect after you call\n {@link OH_Drawing_TypographyPaint} to draw the text.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param typography Pointer to the {@link OH_Drawing_Typography} object, which is obtained from\n {@link OH_Drawing_CreateTypography}.\n @param decoration Updated decoration type. For details, see {@link OH_Drawing_TextDecoration}. You can set multiple\n text decoration types at a time via bitwise OR operations. If a decoration type that is not in the\n {@link OH_Drawing_TextDecoration} enumeration is set, the original decoration is retained.\n @since 20\n @version 1.0"]
3523 #[cfg(feature = "api-20")]
3524 pub fn OH_Drawing_TypographyUpdateDecoration(
3525 typography: *mut OH_Drawing_Typography,
3526 decoration: OH_Drawing_TextDecoration,
3527 );
3528}
3529extern "C" {
3530 #[doc = " @brief Updates the decoration thickness scale of a typography object. The updated decoration thickness scale takes\n effect after you call {@link OH_Drawing_TypographyPaint} to draw the text.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param typography Pointer to the {@link OH_Drawing_Typography} object, which is obtained from\n {@link OH_Drawing_CreateTypography}.\n @param decorationThicknessScale Thickness scaling ratio of the updated text decoration line. The thickness of the\n decoration line increases as the ratio increases. If the value is less than or equal to 0, the decoration line\n will not be drawn.\n @since 20\n @version 1.0"]
3531 #[cfg(feature = "api-20")]
3532 pub fn OH_Drawing_TypographyUpdateDecorationThicknessScale(
3533 typography: *mut OH_Drawing_Typography,
3534 decorationThicknessScale: f64,
3535 );
3536}
3537extern "C" {
3538 #[doc = " @brief Updates the decoration style of a typography object. The updated decoration style takes effect after you call\n {@link OH_Drawing_TypographyPaint} to draw the text.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param typography Pointer to the {@link OH_Drawing_Typography} object, which is obtained from\n {@link OH_Drawing_CreateTypography}.\n @param decorationStyle Updated text decoration style. For details about the available options, see\n {@link OH_Drawing_TextDecorationStyle}.\n @since 20\n @version 1.0"]
3539 #[cfg(feature = "api-20")]
3540 pub fn OH_Drawing_TypographyUpdateDecorationStyle(
3541 typography: *mut OH_Drawing_Typography,
3542 decorationStyle: OH_Drawing_TextDecorationStyle,
3543 );
3544}
3545extern "C" {
3546 #[doc = " @brief Updates the decoration color of a typography object.\n <br> The updated decoration color takes effect after you call {@link OH_Drawing_TypographyPaint} to draw the text.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param typography Pointer to the {@link OH_Drawing_Typography} object, which is obtained from\n {@link OH_Drawing_CreateTypography}.\n @param color Updated text decoration color.\n @since 20\n @version 1.0"]
3547 #[cfg(feature = "api-20")]
3548 pub fn OH_Drawing_TypographyUpdateDecorationColor(
3549 typography: *mut OH_Drawing_Typography,
3550 color: u32,
3551 );
3552}
3553extern "C" {
3554 #[doc = " @brief Checks whether the text line style is enabled for a typography style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TypographyStyle} object, which is obtained from\n {@link OH_Drawing_CreateTypographyStyle}.\n @return Whether the line style is enabled. **true**: enabled; **false**: disabled.\n @since 12\n @version 1.0"]
3555 pub fn OH_Drawing_TypographyTextGetLineStyle(style: *mut OH_Drawing_TypographyStyle) -> bool;
3556}
3557extern "C" {
3558 #[doc = " @brief Obtains the font weight of a text line style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TypographyStyle} object, which is obtained from\n {@link OH_Drawing_CreateTypographyStyle}.\n @return Font weight.\n <br> For details about the available options, see {@link OH_Drawing_FontWeight}.\n @since 12\n @version 1.0"]
3559 pub fn OH_Drawing_TypographyTextlineStyleGetFontWeight(
3560 style: *mut OH_Drawing_TypographyStyle,
3561 ) -> OH_Drawing_FontWeight;
3562}
3563extern "C" {
3564 #[doc = " @brief Obtains the font style of the strut style in a typography style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TypographyStyle} object, which is obtained from\n {@link OH_Drawing_CreateTypographyStyle}.\n @return Font style of the strut style in a typography style. **1** indicates italic, and **0** or others indicate\n non-italic. For details, see the {@link OH_Drawing_FontStyle} enumeration.\n @since 12\n @version 1.0"]
3565 pub fn OH_Drawing_TypographyTextlineStyleGetFontStyle(
3566 style: *mut OH_Drawing_TypographyStyle,
3567 ) -> OH_Drawing_FontStyle;
3568}
3569extern "C" {
3570 #[doc = " @brief Obtains the font families of a text line style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TypographyStyle} object, which is obtained from\n {@link OH_Drawing_CreateTypographyStyle}.\n @param num Pointer to the number of font families.\n @return Font families.\n @since 12\n @version 1.0"]
3571 pub fn OH_Drawing_TypographyTextlineStyleGetFontFamilies(
3572 style: *mut OH_Drawing_TypographyStyle,
3573 num: *mut usize,
3574 ) -> *mut *mut ::std::os::raw::c_char;
3575}
3576extern "C" {
3577 #[doc = " @brief Releases the memory occupied by the font family name list.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param fontFamilies Pointer to the font families.\n @param fontFamiliesNum Number of font families.\n @since 12\n @version 1.0"]
3578 pub fn OH_Drawing_TypographyTextlineStyleDestroyFontFamilies(
3579 fontFamilies: *mut *mut ::std::os::raw::c_char,
3580 fontFamiliesNum: usize,
3581 );
3582}
3583extern "C" {
3584 #[doc = " @brief Obtains the font size of a text line style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TypographyStyle} object, which is obtained from\n {@link OH_Drawing_CreateTypographyStyle}.\n @return Font size.\n @since 12\n @version 1.0"]
3585 pub fn OH_Drawing_TypographyTextlineStyleGetFontSize(
3586 style: *mut OH_Drawing_TypographyStyle,
3587 ) -> f64;
3588}
3589extern "C" {
3590 #[doc = " @brief Obtains the height scale factor of a text line style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TypographyStyle} object, which is obtained from\n {@link OH_Drawing_CreateTypographyStyle}.\n @return Height scale factor.\n @since 12\n @version 1.0"]
3591 pub fn OH_Drawing_TypographyTextlineStyleGetHeightScale(
3592 style: *mut OH_Drawing_TypographyStyle,
3593 ) -> f64;
3594}
3595extern "C" {
3596 #[doc = " @brief Checks whether only the font height is used for a text line style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TypographyStyle} object, which is obtained from\n {@link OH_Drawing_CreateTypographyStyle}.\n @return Method for calculating the height of a font block. **true** means that the height is calculated based on the\n font size; **false** means that the height is calculated based on the line spacing.\n @since 12\n @version 1.0"]
3597 pub fn OH_Drawing_TypographyTextlineStyleGetHeightOnly(
3598 style: *mut OH_Drawing_TypographyStyle,
3599 ) -> bool;
3600}
3601extern "C" {
3602 #[doc = " @brief Checks whether half leading is enabled for a text line style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TypographyStyle} object, which is obtained from\n {@link OH_Drawing_CreateTypographyStyle}.\n @return **true** if half leading is enabled; returns **false** otherwise.\n @since 12\n @version 1.0"]
3603 pub fn OH_Drawing_TypographyTextlineStyleGetHalfLeading(
3604 style: *mut OH_Drawing_TypographyStyle,
3605 ) -> bool;
3606}
3607extern "C" {
3608 #[doc = " @brief Obtains the spacing scale factor of a text line style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TypographyStyle} object, which is obtained from\n {@link OH_Drawing_CreateTypographyStyle}.\n @return Spacing scale factor.\n @since 12\n @version 1.0"]
3609 pub fn OH_Drawing_TypographyTextlineStyleGetSpacingScale(
3610 style: *mut OH_Drawing_TypographyStyle,
3611 ) -> f64;
3612}
3613extern "C" {
3614 #[doc = " @brief Checks whether only the text line style is enabled for a typography style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TypographyStyle} object, which is obtained from\n {@link OH_Drawing_CreateTypographyStyle}.\n @return Whether only the text line style is enabled for a typography style. **true**: enabled; **false**: disabled.\n @since 12\n @version 1.0"]
3615 pub fn OH_Drawing_TypographyTextlineGetStyleOnly(
3616 style: *mut OH_Drawing_TypographyStyle,
3617 ) -> bool;
3618}
3619extern "C" {
3620 #[doc = " @brief Obtains the text alignment mode.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TypographyStyle} object, which is obtained from\n {@link OH_Drawing_CreateTypographyStyle}.\n @return Alignment mode. For details about the available options, see {@link OH_Drawing_TextAlign}.\n @since 12\n @version 1.0"]
3621 pub fn OH_Drawing_TypographyGetTextAlign(
3622 style: *mut OH_Drawing_TypographyStyle,
3623 ) -> OH_Drawing_TextAlign;
3624}
3625extern "C" {
3626 #[doc = " @brief Obtains the text direction of a typography style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TypographyStyle} object, which is obtained from\n {@link OH_Drawing_CreateTypographyStyle}.\n @return Text direction. **0** means right-to-left; **1** means left-to-right. For details, see\n {@link OH_Drawing_TextDirection}.\n @since 12\n @version 1.0"]
3627 pub fn OH_Drawing_TypographyGetTextDirection(
3628 style: *mut OH_Drawing_TypographyStyle,
3629 ) -> OH_Drawing_TextDirection;
3630}
3631extern "C" {
3632 #[doc = " @brief Obtains the maximum number of lines.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TypographyStyle} object, which is obtained from\n {@link OH_Drawing_CreateTypographyStyle}.\n @return Maximum number of lines.\n @since 12\n @version 1.0"]
3633 pub fn OH_Drawing_TypographyGetTextMaxLines(style: *mut OH_Drawing_TypographyStyle) -> usize;
3634}
3635extern "C" {
3636 #[doc = " @brief Obtains the text ellipsis content of a typography style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TypographyStyle} object, which is obtained from\n {@link OH_Drawing_CreateTypographyStyle}.\n @return Ellipsis text.\n @since 12\n @version 1.0"]
3637 pub fn OH_Drawing_TypographyGetTextEllipsis(
3638 style: *mut OH_Drawing_TypographyStyle,
3639 ) -> *mut ::std::os::raw::c_char;
3640}
3641extern "C" {
3642 #[doc = " @brief Releases the memory occupied by the ellipsis text.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param ellipsis Pointer to the ellipsis text.\n @since 12\n @version 1.0"]
3643 pub fn OH_Drawing_TypographyDestroyEllipsis(ellipsis: *mut ::std::os::raw::c_char);
3644}
3645extern "C" {
3646 #[doc = " @brief Checks whether two typography styles are the same. The text height modifier mode\n {@link OH_Drawing_TextHeightBehavior} is not involved in the comparison.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param from Pointer to the first typography style.\n @param to Pointer to the second typography style.\n @return Returns **true** if the two are the same; returns **false** otherwise.\n @since 12\n @version 1.0"]
3647 pub fn OH_Drawing_TypographyStyleEquals(
3648 from: *mut OH_Drawing_TypographyStyle,
3649 to: *mut OH_Drawing_TypographyStyle,
3650 ) -> bool;
3651}
3652extern "C" {
3653 #[doc = " @brief Releases the memory occupied by a text box.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param textBox Pointer to the {@link OH_Drawing_TextBox} object.\n @since 12\n @version 1.0"]
3654 pub fn OH_Drawing_TypographyDestroyTextBox(textBox: *mut OH_Drawing_TextBox);
3655}
3656extern "C" {
3657 #[doc = " @brief Sets the parameters of the text shadow object.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param shadow Pointer to the text shadow object {@link OH_Drawing_TextShadow}, obtained by\n {@link OH_Drawing_CreateTextShadow}.\n @param color Color of the text shadow. For example, if the input parameter is 0xAABBCCDD, AA represents the alpha\n value, BB represents the red component, CC represents the green component, and DD represents the blue component.\n @param offset Pointer to the coordinate point object {@link OH_Drawing_Point}, which indicates the offset of the\n text shadow relative to the current text.\n @param blurRadius Blur radius. The value is a floating point number and has no unit. The value **0.0** means that\n there is no blur effect.\n @since 12\n @version 1.0"]
3658 pub fn OH_Drawing_SetTextShadow(
3659 shadow: *mut OH_Drawing_TextShadow,
3660 color: u32,
3661 offset: *mut OH_Drawing_Point,
3662 blurRadius: f64,
3663 );
3664}
3665extern "C" {
3666 #[doc = " @brief Creates a text tab object.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param alignment Alignment mode of the text following the tab character. The value **1** means right alignment, **2**\n means center alignment, and **0** or other values mean left alignment.\n @param location Alignment position of the text following the tab character. The unit is px. The minimum value is **1.\n 0**.\n @return Pointer to the **OH_Drawing_TextTab** object created. If a null pointer is returned, the creation fails. A\n possible cause is that no memory is available.\n @since 18\n @version 1.0"]
3667 #[cfg(feature = "api-18")]
3668 pub fn OH_Drawing_CreateTextTab(
3669 alignment: OH_Drawing_TextAlign,
3670 location: f32,
3671 ) -> *mut OH_Drawing_TextTab;
3672}
3673extern "C" {
3674 #[doc = " @brief Releases the memory occupied by a text tab object.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param tab Pointer to an **OH_Drawing_TextTab** object.\n @since 18\n @version 1.0"]
3675 #[cfg(feature = "api-18")]
3676 pub fn OH_Drawing_DestroyTextTab(tab: *mut OH_Drawing_TextTab);
3677}
3678extern "C" {
3679 #[doc = " @brief Obtains the alignment mode of a text tab.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param tab Pointer to an **OH_Drawing_TextTab** object.\n @return Alignment mode. The value **1** means right alignment, **2** means center alignment, and **0** or other\n values mean left alignment.\n @since 18\n @version 1.0"]
3680 #[cfg(feature = "api-18")]
3681 pub fn OH_Drawing_GetTextTabAlignment(tab: *mut OH_Drawing_TextTab) -> OH_Drawing_TextAlign;
3682}
3683extern "C" {
3684 #[doc = " @brief Obtains the location of a text tab.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param tab Pointer to an **OH_Drawing_TextTab** object.\n @return Position of the text tab.\n @since 18\n @version 1.0"]
3685 #[cfg(feature = "api-18")]
3686 pub fn OH_Drawing_GetTextTabLocation(tab: *mut OH_Drawing_TextTab) -> f32;
3687}
3688extern "C" {
3689 #[doc = " @brief Sets the alignment mode and location of a text tab. When the text alignment mode or ellipsis style is set,\n the tab does not take effect. When the tab location is less than 1.0, the tab is replaced with a space.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the typography style object {@link OH_Drawing_TypographyStyle}.\n @param tab Pointer to an **OH_Drawing_TextTab** object.\n @since 18\n @version 1.0"]
3690 #[cfg(feature = "api-18")]
3691 pub fn OH_Drawing_SetTypographyTextTab(
3692 style: *mut OH_Drawing_TypographyStyle,
3693 tab: *mut OH_Drawing_TextTab,
3694 );
3695}
3696extern "C" {
3697 #[doc = " @brief Obtains the number of objects in the input object array {@link OH_Drawing_Array}.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param drawingArray Pointer to the {@link OH_Drawing_Array} object array.\n @return Number of objects in the array.\n @since 14\n @version 1.0"]
3698 #[cfg(feature = "api-14")]
3699 pub fn OH_Drawing_GetDrawingArraySize(drawingArray: *mut OH_Drawing_Array) -> usize;
3700}
3701extern "C" {
3702 #[doc = " @brief Sets whether to include the trailing spaces in alignment calculations during text typography.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the typography style object {@link OH_Drawing_TypographyStyle}.\n @param trailingSpaceOptimized Whether trailing spaces participate in alignment calculation during text typography.\n The value true means trailing spaces do not participate in calculation, and false means they do. The default\n value is false. It is recommended to set this parameter to true for center-aligned text.\n @since 20\n @version 1.0"]
3703 #[cfg(feature = "api-20")]
3704 pub fn OH_Drawing_SetTypographyTextTrailingSpaceOptimized(
3705 style: *mut OH_Drawing_TypographyStyle,
3706 trailingSpaceOptimized: bool,
3707 );
3708}
3709extern "C" {
3710 #[doc = " @brief Adds text encoded in a specified format.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param handler Pointer to the {@link OH_Drawing_TypographyCreate} object, which is obtained from\n {@link OH_Drawing_CreateTypographyHandler}.\n @param text Pointer to the text content.\n @param byteLength Length of the text, in bytes.\n @param textEncodingType Text encoding type, which is an enumerated value of {@link OH_Drawing_TextEncoding}. Only **\n TEXT_ENCODING_UTF8**, **TEXT_ENCODING_UTF16**, and **TEXT_ENCODING_UTF32** are supported.\n @since 20\n @version 1.0"]
3711 #[cfg(feature = "api-20")]
3712 pub fn OH_Drawing_TypographyHandlerAddEncodedText(
3713 handler: *mut OH_Drawing_TypographyCreate,
3714 text: *const ::std::os::raw::c_void,
3715 byteLength: usize,
3716 textEncodingType: OH_Drawing_TextEncoding,
3717 );
3718}
3719extern "C" {
3720 #[doc = " @brief Sets whether to enable auto spacing for text typography.\n <br>Auto spacing is disabled by default. Once enabled, the spacing between CJK (Chinese, Japanese, and Korean\n characters) and Western characters (Latin, Cyrillic, and Greek letters), CJK and digits, CJK and copyright symbols,\n copyright symbols and digits, and copyright symbols and Western characters is automatically adjusted.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to an {@link OH_Drawing_TypographyStyle} object, obtained by\n {@link OH_Drawing_CreateTypographyStyle}.\n @param enableAutoSpace Whether to enable automatic spacing in text typography. The value `true` means to enable\n automatic spacing, and `false` means the opposite. The default value is `false`.\n @since 20"]
3721 #[cfg(feature = "api-20")]
3722 pub fn OH_Drawing_SetTypographyTextAutoSpace(
3723 style: *mut OH_Drawing_TypographyStyle,
3724 enableAutoSpace: bool,
3725 );
3726}
3727extern "C" {
3728 #[doc = " @brief Creates a copy of an existing paragraph style object.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TypographyStyle} object to be copied.\n @return Pointer to the copied {@link OH_Drawing_TypographyStyle} object. If a null pointer is returned, the creation\n fails. The possible cause is that no memory is available or **style** is a null pointer. Release this pointer by\n calling {@link OH_Drawing_DestroyTypographyStyle} when this object is no longer needed.\n @since 20\n @version 1.0"]
3729 #[cfg(feature = "api-20")]
3730 pub fn OH_Drawing_CopyTypographyStyle(
3731 style: *mut OH_Drawing_TypographyStyle,
3732 ) -> *mut OH_Drawing_TypographyStyle;
3733}
3734extern "C" {
3735 #[doc = " @brief Creates a copy of an existing text style object.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param style Pointer to the {@link OH_Drawing_TextStyle} object to be copied.\n @return Pointer to the copied {@link OH_Drawing_TextStyle} object. If a null pointer is returned, the creation fails.\n The possible cause is that no memory is available or **style** is a null pointer. Release this pointer by\n calling {@link OH_Drawing_DestroyTextStyle} when this object is no longer needed.\n @since 20\n @version 1.0"]
3736 #[cfg(feature = "api-20")]
3737 pub fn OH_Drawing_CopyTextStyle(style: *mut OH_Drawing_TextStyle) -> *mut OH_Drawing_TextStyle;
3738}
3739extern "C" {
3740 #[doc = " @brief Creates a copy of an existing text shadow object.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param shadow Pointer to the {@link OH_Drawing_TextShadow} object to be copied.\n @return Pointer to the copied {@link OH_Drawing_TextShadow} object. If a null pointer is returned, the creation\n fails. The possible cause is that no memory is available or **shadow** is a null pointer. Release this pointer\n by calling {@link OH_Drawing_DestroyTextShadow} when this object is no longer needed.\n @since 20\n @version 1.0"]
3741 #[cfg(feature = "api-20")]
3742 pub fn OH_Drawing_CopyTextShadow(
3743 shadow: *mut OH_Drawing_TextShadow,
3744 ) -> *mut OH_Drawing_TextShadow;
3745}
3746extern "C" {
3747 #[doc = " @brief Destroys an {@link OH_Drawing_PositionAndAffinity} object and reclaims the memory occupied by the object.\n\n @param positionAndAffinity Pointer to the {@link OH_Drawing_PositionAndAffinity} object.\n @since 23"]
3748 #[cfg(feature = "api-23")]
3749 pub fn OH_Drawing_DestroyPositionAndAffinity(
3750 positionAndAffinity: *mut OH_Drawing_PositionAndAffinity,
3751 );
3752}
3753extern "C" {
3754 #[doc = " @brief Obtains the character range corresponding to the specified glyph range.\n\n @param typography Pointer to the **OH_Drawing_Typography** object, which is obtained from\n {@link OH_Drawing_CreateTypography}.\n @param glyphRangeStart Start position of the glyph range.\n @param glyphRangeEnd End position of the glyph range.\n @param actualGlyphRange Returns the actual font range, indicating the level-2 pointer to {@link OH_Drawing_Range}.\n It is used as an output parameter.\n <br>When the requested glyph range contains only a part of a complex glyph sequence, this parameter returns the\n corresponding complete glyph range.\n <br>For example, ligatures and combined emojis may consist of multiple atomic glyphs and must be processed as a\n whole.\n <br>If this parameter is NULL, the actual glyph range is not returned, indicating that the caller does not care\n about the actual glyph range information.\n <br>After use, release the object through the {@link OH_Drawing_ReleaseRangeBuffer} API.\n @param textEncodingType Text encoding type {@link OH_Drawing_TextEncoding}.\n <br>Currently, only UTF-8 and UTF-16 encoding types are supported.\n <br>For UTF-8 encoding, the returned character range indicates the byte range.\n <br>For UTF-16 encoding, the returned character range indicates the UTF-16 code unit range.\n @return Returns the {@link OH_Drawing_Range} object pointer that indicates the character range. When the object is\n no longer needed, use the {@link OH_Drawing_ReleaseRangeBuffer} API to release it.\n @since 24"]
3755 #[cfg(feature = "api-24")]
3756 pub fn OH_Drawing_TypographyGetCharacterRangeForGlyphRangeWithBuffer(
3757 typography: *mut OH_Drawing_Typography,
3758 glyphRangeStart: usize,
3759 glyphRangeEnd: usize,
3760 actualGlyphRange: *mut *mut OH_Drawing_Range,
3761 textEncodingType: OH_Drawing_TextEncoding,
3762 ) -> *mut OH_Drawing_Range;
3763}
3764extern "C" {
3765 #[doc = " @brief Obtains the character position information closest to the specified coordinates.\n\n @param typography Pointer to the **OH_Drawing_Typography** object, which is obtained from\n {@link OH_Drawing_CreateTypography}.\n @param dx Horizontal coordinate in the text layout area, in physical pixels (px).\n <br>X offset relative to the top-left corner of the text layout area, with the right direction as positive.\n <br>Supports floating-point values and accepts negative values, which indicate positions to the left of the text\n layout area.\n <br>If the coordinates are beyond the text layout area, the nearest character position is returned. It can be\n obtained through a touch event or click event.\n @param dy Vertical coordinate in the text layout area, in physical pixels (px).\n <br>Y offset relative to the top-left corner of the text layout area, with the downward direction as positive.\n <br>Supports floating-point values and accepts negative values, which indicate positions above the text layout\n area.\n <br>If the coordinates are beyond the text layout area, the nearest character position is returned. It can be\n obtained through a touch event or click event.\n @param textEncodingType Text encoding type {@link OH_Drawing_TextEncoding}.\n <br>Currently, only UTF-8 and UTF-16 encoding types are supported.\n <br>For UTF-8 encoding, the returned position indicates the byte offset. For UTF-16 encoding, the returned\n position indicates the UTF-16 code unit offset.\n @return Returns the character index position and affinity at the coordinate. The return type is the\n {@link OH_Drawing_PositionAndAffinity} structure.\n <br>When the object is no longer needed, call {@link OH_Drawing_DestroyPositionAndAffinity} to release it.\n @since 24"]
3766 #[cfg(feature = "api-24")]
3767 pub fn OH_Drawing_TypographyGetCharacterPositionAtCoordinateWithBuffer(
3768 typography: *mut OH_Drawing_Typography,
3769 dx: f64,
3770 dy: f64,
3771 textEncodingType: OH_Drawing_TextEncoding,
3772 ) -> *mut OH_Drawing_PositionAndAffinity;
3773}
3774extern "C" {
3775 #[doc = " @brief Obtains the glyph range corresponding to the specified character range.\n\n @param typography Pointer to the **OH_Drawing_Typography** object, which is obtained from\n {@link OH_Drawing_CreateTypography}.\n @param characterRangeStart Start position of the character range.\n @param characterRangeEnd End position of the character range.\n @param actualCharacterRange Returns the actual character range, indicating the level-2 pointer to\n {@link OH_Drawing_Range}. It is used as an output parameter.\n <br>When the requested character range contains only a part of the combined character sequence, this parameter\n returns the corresponding complete character range.\n <br>For example, a combined character consisting of a base character and a diacritical mark must be processed as\n a whole.\n <br>If this parameter is NULL, the actual character range is not returned, indicating that the caller does not\n care about the actual character range information.\n <br>After use, release the object through the {@link OH_Drawing_ReleaseRangeBuffer} API.\n @param textEncodingType Text encoding type {@link OH_Drawing_TextEncoding}.\n <br>Currently, only UTF-8 and UTF-16 encoding types are supported.\n <br>For UTF-8 encoding, the input character range should be interpreted as a byte range. For UTF-16 encoding,\n the input character range should be interpreted as a UTF-16 code unit range.\n @return Returns the {@link OH_Drawing_Range} object pointer that indicates the font range. If the object is no\n longer needed, use the {@link OH_Drawing_ReleaseRangeBuffer} API to release it.\n @since 24"]
3776 #[cfg(feature = "api-24")]
3777 pub fn OH_Drawing_TypographyGetGlyphRangeForCharacterRangeWithBuffer(
3778 typography: *mut OH_Drawing_Typography,
3779 characterRangeStart: usize,
3780 characterRangeEnd: usize,
3781 actualCharacterRange: *mut *mut OH_Drawing_Range,
3782 textEncodingType: OH_Drawing_TextEncoding,
3783 ) -> *mut OH_Drawing_Range;
3784}
3785extern "C" {
3786 #[doc = " @brief Releases the memory occupied by the {@link OH_Drawing_Range} object.\n\n @param range Pointer to the {@link OH_Drawing_Range} object.\n @since 24"]
3787 #[cfg(feature = "api-24")]
3788 pub fn OH_Drawing_ReleaseRangeBuffer(range: *mut OH_Drawing_Range);
3789}
3790extern "C" {
3791 #[doc = " @brief Creates an **OH_Drawing_FontMgr** object, which can be used only to manage system fonts.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @return Pointer to the {@link OH_Drawing_FontMgr} object created.\n @since 12\n @version 1.0"]
3792 pub fn OH_Drawing_FontMgrCreate() -> *mut OH_Drawing_FontMgr;
3793}
3794extern "C" {
3795 #[doc = " @brief Destroys an **OH_Drawing_FontMgr** object and reclaims the memory occupied by the object.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param drawingFontMgr Pointer to an {@link OH_Drawing_FontMgr} object, which is obtained from\n {@link OH_Drawing_FontMgrCreate}.\n @since 12\n @version 1.0"]
3796 pub fn OH_Drawing_FontMgrDestroy(drawingFontMgr: *mut OH_Drawing_FontMgr);
3797}
3798extern "C" {
3799 #[doc = " @brief Obtains the number of font families.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param drawingFontMgr Pointer to an {@link OH_Drawing_FontMgr} object, which is obtained from\n {@link OH_Drawing_FontMgrCreate}.\n @return Returns the number of font families.\n @since 12\n @version 1.0"]
3800 pub fn OH_Drawing_FontMgrGetFamilyCount(
3801 drawingFontMgr: *mut OH_Drawing_FontMgr,
3802 ) -> ::std::os::raw::c_int;
3803}
3804extern "C" {
3805 #[doc = " @brief Obtains the font family name based on an index. When the returned name is no longer needed, use\n {@link OH_Drawing_FontMgrDestroyFamilyName} to release the memory occupied by the name.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param drawingFontMgr Pointer to an {@link OH_Drawing_FontMgr} object, which is obtained from\n {@link OH_Drawing_FontMgrCreate}.\n @param index Index used to obtain the corresponding font family name. The value range is [0,\n OH_Drawing_FontMgrGetFamilyCount() - 1].\n @return Font family name corresponding to the index. When no longer needed, use\n {@link OH_Drawing_FontMgrDestroyFamilyName} to release the memory occupied by the name.\n @since 12\n @version 1.0"]
3806 pub fn OH_Drawing_FontMgrGetFamilyName(
3807 drawingFontMgr: *mut OH_Drawing_FontMgr,
3808 index: ::std::os::raw::c_int,
3809 ) -> *mut ::std::os::raw::c_char;
3810}
3811extern "C" {
3812 #[doc = " @brief Reclaims the memory occupied by a font family name.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param familyName Pointer to a font family name.\n @since 12\n @version 1.0"]
3813 pub fn OH_Drawing_FontMgrDestroyFamilyName(familyName: *mut ::std::os::raw::c_char);
3814}
3815extern "C" {
3816 #[doc = " @brief Creates a font style set object from a font manager object.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param drawingFontMgr Pointer to an {@link OH_Drawing_FontMgr} object, which is obtained from\n {@link OH_Drawing_FontMgrCreate}.\n @param index Index value used to obtain the font style set object from the font manager object. Value range: [0,\n OH_Drawing_FontMgrGetFamilyCount() - 1].\n @return Returns a pointer to the {@link OH_Drawing_FontStyleSet} object created.\n @since 12\n @version 1.0"]
3817 pub fn OH_Drawing_FontMgrCreateFontStyleSet(
3818 drawingFontMgr: *mut OH_Drawing_FontMgr,
3819 index: ::std::os::raw::c_int,
3820 ) -> *mut OH_Drawing_FontStyleSet;
3821}
3822extern "C" {
3823 #[doc = " @brief Reclaims the memory occupied by a font style set.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param drawingFontStyleSet Pointer to an {@link OH_Drawing_FontStyleSet} object.\n @since 12\n @version 1.0"]
3824 pub fn OH_Drawing_FontMgrDestroyFontStyleSet(drawingFontStyleSet: *mut OH_Drawing_FontStyleSet);
3825}
3826extern "C" {
3827 #[doc = " @brief Obtains a font style set object based on a specified font family name. When the object is no longer needed,\n use {@link OH_Drawing_FontMgrDestroyFontStyleSet} to release it.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param drawingFontMgr Pointer to an {@link OH_Drawing_FontMgr} object, which is obtained from\n {@link OH_Drawing_FontMgrCreate}.\n @param familyName Pointer to a font family name.\n @return Pointer to the corresponding font style set object {@link OH_Drawing_FontStyleSet}. When no longer needed,\n use {@link OH_Drawing_FontMgrDestroyFontStyleSet} to release the object pointer. <br>NULL is returned if\n matching fails.\n @since 12\n @version 1.0"]
3828 pub fn OH_Drawing_FontMgrMatchFamily(
3829 drawingFontMgr: *mut OH_Drawing_FontMgr,
3830 familyName: *const ::std::os::raw::c_char,
3831 ) -> *mut OH_Drawing_FontStyleSet;
3832}
3833extern "C" {
3834 #[doc = " @brief Obtains a typeface object based on the specified font style information and font family name. When the object\n is no longer needed, use {@link OH_Drawing_TypefaceDestroy} to release it.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param drawingFontMgr Pointer to an {@link OH_Drawing_FontMgr} object, which is obtained from\n {@link OH_Drawing_FontMgrCreate}.\n @param familyName Pointer to a font family name.\n @param fontStyle Font style, including the font weight, width, and slant.\n @return Pointer to the {@link OH_Drawing_Typeface} object corresponding to the font style. Use\n {@link OH_Drawing_TypefaceDestroy} to release the pointer when it is no longer needed. <br>NULL is returned if\n the match fails.\n @since 12\n @version 1.0"]
3835 pub fn OH_Drawing_FontMgrMatchFamilyStyle(
3836 drawingFontMgr: *mut OH_Drawing_FontMgr,
3837 familyName: *const ::std::os::raw::c_char,
3838 fontStyle: OH_Drawing_FontStyleStruct,
3839 ) -> *mut OH_Drawing_Typeface;
3840}
3841extern "C" {
3842 #[doc = " @brief Obtains a typeface for the specified character. A null pointer is returned only when no typeface\n corresponding to the input UTF-8 character is found in the font management object. When the object is no longer\n needed, use {@link OH_Drawing_TypefaceDestroy} to release it.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param drawingFontMgr Pointer to an {@link OH_Drawing_FontMgr} object, which is obtained from\n {@link OH_Drawing_FontMgrCreate}.\n @param familyName Pointer to a font family name.\n @param fontStyle Font style, including the font weight, width, and slant.\n @param bcp47 Array of BCP47 language codes, which is a combination of ISO 639, 15924, and 3166-1 language codes.\n @param bcp47Count Size of the bcp47 array, which must match the actual number of elements in the bcp47 array.\n @param character UTF-8 character used for matching.\n @return Pointer to the corresponding {@link OH_Drawing_Typeface} typeface object, or NULL if no typeface is matched.\n @since 12\n @version 1.0"]
3843 pub fn OH_Drawing_FontMgrMatchFamilyStyleCharacter(
3844 drawingFontMgr: *mut OH_Drawing_FontMgr,
3845 familyName: *const ::std::os::raw::c_char,
3846 fontStyle: OH_Drawing_FontStyleStruct,
3847 bcp47: *mut *const ::std::os::raw::c_char,
3848 bcp47Count: ::std::os::raw::c_int,
3849 character: i32,
3850 ) -> *mut OH_Drawing_Typeface;
3851}
3852extern "C" {
3853 #[doc = " @brief Gets a typeface for the specified index. When the object is no longer needed, use\n {@link OH_Drawing_TypefaceDestroy} to release it.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param fontStyleSet Pointer to an {@link OH_Drawing_FontStyleSet} object.\n @param index Index of the specified typeface object. The value range is [0, OH_Drawing_FontStyleSetCount() - 1].\n @return Typeface object if successful; NULL otherwise.\n @since 12\n @version 1.0"]
3854 pub fn OH_Drawing_FontStyleSetCreateTypeface(
3855 fontStyleSet: *mut OH_Drawing_FontStyleSet,
3856 index: ::std::os::raw::c_int,
3857 ) -> *mut OH_Drawing_Typeface;
3858}
3859extern "C" {
3860 #[doc = " @brief Obtains the font style. Call {@link OH_Drawing_FontStyleSetFreeStyleName} to release **styleName** when it is\n no longer needed, freeing up the allocated memory.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param fontStyleSet Pointer to an {@link OH_Drawing_FontStyleSet} object.\n @param index Index of the specified font style. The value range is [0, OH_Drawing_FontStyleSetCount() - 1].\n @param styleName String specifying the font style name. Call {@link OH_Drawing_FontStyleSetFreeStyleName} to release\n it when it is no longer needed, freeing up the allocated memory.\n @return Returns the font style.\n @since 12\n @version 1.0"]
3861 pub fn OH_Drawing_FontStyleSetGetStyle(
3862 fontStyleSet: *mut OH_Drawing_FontStyleSet,
3863 index: i32,
3864 styleName: *mut *mut ::std::os::raw::c_char,
3865 ) -> OH_Drawing_FontStyleStruct;
3866}
3867extern "C" {
3868 #[doc = " @brief Frees the memory occupied by a font style.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param styleName Double pointer to the string that specifies the font style name.\n @since 12\n @version 1.0"]
3869 pub fn OH_Drawing_FontStyleSetFreeStyleName(styleName: *mut *mut ::std::os::raw::c_char);
3870}
3871extern "C" {
3872 #[doc = " @brief Obtains the typeface closest to the font style (font weight, font width, and slant). When the object is no\n longer needed, use {@link OH_Drawing_TypefaceDestroy} to release it.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param fontStyleSet Pointer to an {@link OH_Drawing_FontStyleSet} object.\n @param fontStyleStruct Font style, including the font weight, width, and slant.\n @return Pointer to the corresponding typeface object {@link OH_Drawing_Typeface}, or NULL if matching fails.\n @since 12\n @version 1.0"]
3873 pub fn OH_Drawing_FontStyleSetMatchStyle(
3874 fontStyleSet: *mut OH_Drawing_FontStyleSet,
3875 fontStyleStruct: OH_Drawing_FontStyleStruct,
3876 ) -> *mut OH_Drawing_Typeface;
3877}
3878extern "C" {
3879 #[doc = " @brief Obtains the number of fonts in the font style set.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param fontStyleSet Pointer to an {@link OH_Drawing_FontStyleSet} object.\n @return Returns the number of fonts.\n @since 12\n @version 1.0"]
3880 pub fn OH_Drawing_FontStyleSetCount(
3881 fontStyleSet: *mut OH_Drawing_FontStyleSet,
3882 ) -> ::std::os::raw::c_int;
3883}
3884#[doc = " @brief This struct describes the options about the GPU context.\n\n @since 12\n @version 1.0\n @deprecated since 18"]
3885#[repr(C)]
3886#[derive(Debug, Copy, Clone)]
3887pub struct OH_Drawing_GpuContextOptions {
3888 #[doc = " Whether to allow path mask textures to be cached. The value **true** means to allow the path mask textures to be\n cached, and **false** means the opposite."]
3889 pub allowPathMaskCaching: bool,
3890}
3891extern "C" {
3892 #[doc = " @brief Creates an **OH_Drawing_GpuContext** object that uses OpenGL as the backend interface.\n\n @param gpuContextOptions GPU context options, which is {@link OH_Drawing_GpuContextOptions}.\n @return Returns the pointer to the {@link OH_Drawing_GpuContext} object created.\n @since 12\n @version 1.0\n @deprecated since 18\n @useinstead OH_Drawing_GpuContextCreate"]
3893 pub fn OH_Drawing_GpuContextCreateFromGL(
3894 gpuContextOptions: OH_Drawing_GpuContextOptions,
3895 ) -> *mut OH_Drawing_GpuContext;
3896}
3897extern "C" {
3898 #[doc = " @brief Creates an **OH_Drawing_GpuContext** object, for which the backend type depends on the device.\n\n @return Returns the pointer to the {@link OH_Drawing_GpuContext} object created.\n @since 16\n @version 1.0"]
3899 #[cfg(feature = "api-16")]
3900 pub fn OH_Drawing_GpuContextCreate() -> *mut OH_Drawing_GpuContext;
3901}
3902extern "C" {
3903 #[doc = " @brief Destroys an **OH_Drawing_GpuContext** object and reclaims the memory occupied by the object.\n\n @param gpuContext Pointer to an {@link OH_Drawing_GpuContext} object.\n @since 12\n @version 1.0"]
3904 pub fn OH_Drawing_GpuContextDestroy(gpuContext: *mut OH_Drawing_GpuContext);
3905}
3906extern "C" {
3907 #[doc = " @brief Creates an **OH_Drawing_Image** object that describes an array of two-dimensional pixels to draw.\n\n @return Returns a pointer to the {@link OH_Drawing_Image} object created.\n @since 12\n @version 1.0"]
3908 pub fn OH_Drawing_ImageCreate() -> *mut OH_Drawing_Image;
3909}
3910extern "C" {
3911 #[doc = " @brief Destroys an **OH_Drawing_Image** object and reclaims the memory occupied by the object.\n\n @param image Pointer to the {@link OH_Drawing_Image} object.\n @since 12\n @version 1.0"]
3912 pub fn OH_Drawing_ImageDestroy(image: *mut OH_Drawing_Image);
3913}
3914extern "C" {
3915 #[doc = " @brief Builds an image from a bitmap by sharing or copying bitmap pixels. If the bitmap is marked as immutable, the\n pixel memory is shared, not copied.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **image** or **bitmap** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param image Pointer to the {@link OH_Drawing_Image} object.\n @param bitmap Pointer to the {@link OH_Drawing_Bitmap} object.\n @return Returns **true** if the image is built; returns **false** otherwise.\n @since 12\n @version 1.0"]
3916 pub fn OH_Drawing_ImageBuildFromBitmap(
3917 image: *mut OH_Drawing_Image,
3918 bitmap: *mut OH_Drawing_Bitmap,
3919 ) -> bool;
3920}
3921extern "C" {
3922 #[doc = " @brief Obtains the image width, that is, the number of pixels in each line.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **image** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param image Pointer to the {@link OH_Drawing_Image} object.\n @return Returns the width.\n @since 12\n @version 1.0"]
3923 pub fn OH_Drawing_ImageGetWidth(image: *mut OH_Drawing_Image) -> i32;
3924}
3925extern "C" {
3926 #[doc = " @brief Obtains the image height, that is, the number of pixel lines.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **image** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param image Pointer to the {@link OH_Drawing_Image} object.\n @return Returns the height.\n @since 12\n @version 1.0"]
3927 pub fn OH_Drawing_ImageGetHeight(image: *mut OH_Drawing_Image) -> i32;
3928}
3929extern "C" {
3930 #[doc = " @brief Obtains the image information. After this function is called, the passed-in image information object is\n filled.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **image** or **imageInfo** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param image Pointer to the {@link OH_Drawing_Image} object.\n @param imageInfo Pointer to an {@link OH_Drawing_Image_Info} object, which can be created by calling\n {@link OH_Drawing_Image_Info}\n .\n @since 12\n @version 1.0"]
3931 pub fn OH_Drawing_ImageGetImageInfo(
3932 image: *mut OH_Drawing_Image,
3933 imageInfo: *mut OH_Drawing_Image_Info,
3934 );
3935}
3936#[doc = " Replicates the edge color if the shader effect draws outside of its original boundary."]
3937pub const OH_Drawing_TileMode_CLAMP: OH_Drawing_TileMode = 0;
3938#[doc = " Repeats the shader effect's image in both horizontal and vertical directions."]
3939pub const OH_Drawing_TileMode_REPEAT: OH_Drawing_TileMode = 1;
3940#[doc = " Repeats the shader effect's image in both horizontal and vertical directions, alternating mirror images."]
3941pub const OH_Drawing_TileMode_MIRROR: OH_Drawing_TileMode = 2;
3942#[doc = " Renders the shader effect's image only within the original boundary, and returns transparent black elsewhere."]
3943pub const OH_Drawing_TileMode_DECAL: OH_Drawing_TileMode = 3;
3944#[doc = " @brief Defines an enum for the tile modes of the shader effect.\n\n @since 11\n @version 1.0"]
3945pub type OH_Drawing_TileMode = u32;
3946extern "C" {
3947 #[doc = " @brief Creates an **OH_Drawing_ShaderEffect** object with a single color.\n\n @param color Color in the ARGB format. The value is a 32-bit unsigned integer.\n @return Returns the pointer to the {@link OH_Drawing_ShaderEffect} object created. If NULL is returned, the creation\n fails. The possible failure cause is that no memory is available.\n @since 12\n @version 1.0"]
3948 pub fn OH_Drawing_ShaderEffectCreateColorShader(color: u32) -> *mut OH_Drawing_ShaderEffect;
3949}
3950extern "C" {
3951 #[doc = " @brief Creates a **ShaderEffect** object that generates a linear gradient between two points.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If any of **startPt**, **endPt**, and **colors** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n If **tileMode** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.\n\n @param startPt Start point.\n @param endPt End point.\n @param colors Colors to distribute between the two points.\n @param pos Relative position of each color in the color array. The array length must be the same as that of **colors*\n *. If **pos** is NULL, colors are evenly distributed between the start point and end point.\n @param size Number of colors and positions (if **pos** is not NULL).\n @param tileMode Tile mode of the shader effect. For details about the available options, see\n {@link OH_Drawing_TileMode}\n .\n @return Returns the pointer to the **OH_Drawing_ShaderEffect** object created.\n @since 11\n @version 1.0"]
3952 pub fn OH_Drawing_ShaderEffectCreateLinearGradient(
3953 startPt: *const OH_Drawing_Point,
3954 endPt: *const OH_Drawing_Point,
3955 colors: *const u32,
3956 pos: *const f32,
3957 size: u32,
3958 tileMode: OH_Drawing_TileMode,
3959 ) -> *mut OH_Drawing_ShaderEffect;
3960}
3961extern "C" {
3962 #[doc = " @brief Creates a **ShaderEffect** object that generates a linear gradient between two points.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If any of **startPt**, **endPt**, and **colors** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n If **tileMode** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.\n\n @param startPt Start point.\n @param endPt End point.\n @param colors Colors to distribute between the two points.\n @param pos Relative position of each color in the color array. The array length must be the same as that of **colors*\n *. If **pos** is NULL, colors are evenly distributed between the start point and end point.\n @param size Number of colors and positions (if **pos** is not NULL).\n @param tileMode Tile mode of the shader effect. For details about the available options, see\n {@link OH_Drawing_TileMode}\n .\n @param matrix Matrix applied on the shader effect. If **matrix** is NULL, an identity matrix is applied by default.\n @return Returns the pointer to the {@link OH_Drawing_ShaderEffect} object created. If NULL is returned, the creation\n fails. The possible failure cause is that no memory is available or at least one of the parameters **startPt**, **\n endPt**, and **colors** is NULL.\n @since 12\n @version 1.0"]
3963 pub fn OH_Drawing_ShaderEffectCreateLinearGradientWithLocalMatrix(
3964 startPt: *const OH_Drawing_Point2D,
3965 endPt: *const OH_Drawing_Point2D,
3966 colors: *const u32,
3967 pos: *const f32,
3968 size: u32,
3969 tileMode: OH_Drawing_TileMode,
3970 matrix: *const OH_Drawing_Matrix,
3971 ) -> *mut OH_Drawing_ShaderEffect;
3972}
3973extern "C" {
3974 #[doc = " @brief Creates an **OH_Drawing_ShaderEffect** object that generates a radial gradient based on the center and radius\n of a circle.\n The radial gradient transitions colors from the center to the ending shape in a radial manner.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **centerPt** or **colors** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n If **tileMode** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.\n\n @param centerPt Center of the circle.\n @param radius Radius of the gradient. The value should be a non-negative number.\n @param colors Colors to distribute in the radial direction.\n @param pos Relative position of each color in the color array. The array length must be the same as that of **colors*\n *. If **pos** is NULL, colors are evenly distributed in the radial direction.\n @param size Number of colors and positions (if **pos** is not NULL).\n @param tileMode Tile mode of the shader effect. For details about the available options, see\n {@link OH_Drawing_TileMode}\n .\n @return Returns the pointer to the **OH_Drawing_ShaderEffect** object created.\n @since 11\n @version 1.0"]
3975 pub fn OH_Drawing_ShaderEffectCreateRadialGradient(
3976 centerPt: *const OH_Drawing_Point,
3977 radius: f32,
3978 colors: *const u32,
3979 pos: *const f32,
3980 size: u32,
3981 tileMode: OH_Drawing_TileMode,
3982 ) -> *mut OH_Drawing_ShaderEffect;
3983}
3984extern "C" {
3985 #[doc = " @brief Creates an **OH_Drawing_ShaderEffect** object that generates a radial gradient based on the center and radius\n of a circle.\n The radial gradient transitions colors from the center to the ending shape in a radial manner.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **centerPt** or **colors** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n If **tileMode** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.\n\n @param centerPt Center of the circle.\n @param radius Radius of the gradient.\n @param colors Colors to distribute in the radial direction.\n @param pos Relative position of each color in the color array. The array length must be the same as that of **colors*\n *. If **pos** is NULL, colors are evenly distributed in the radial direction.\n @param size Number of colors and positions (if **pos** is not NULL).\n @param tileMode Tile mode of the shader effect. For details about the available options, see\n {@link OH_Drawing_TileMode}\n .\n @param matrix Matrix applied on the shader effect. If **matrix** is NULL, an identity matrix is applied by default.\n @return Returns the pointer to the {@link OH_Drawing_ShaderEffect} object created. If NULL is returned, the creation\n fails. The possible failure cause is that no memory is available or at least one of the parameters **centerPt** and *\n *colors** is NULL.\n @since 12\n @version 1.0"]
3986 pub fn OH_Drawing_ShaderEffectCreateRadialGradientWithLocalMatrix(
3987 centerPt: *const OH_Drawing_Point2D,
3988 radius: f32,
3989 colors: *const u32,
3990 pos: *const f32,
3991 size: u32,
3992 tileMode: OH_Drawing_TileMode,
3993 matrix: *const OH_Drawing_Matrix,
3994 ) -> *mut OH_Drawing_ShaderEffect;
3995}
3996extern "C" {
3997 #[doc = " @brief Creates an **OH_Drawing_ShaderEffect** object that generates a sweep gradient based on the matrix\n transformation at the given center.\n A sweep gradient paints a gradient in a sweeping arc ranging from 0° to 360°.\n\n @param centerPt Center of the circle.\n @param colors Colors to distribute between the two points.\n @param pos Relative position of each color in the color array. The array length must be the same as that of **colors*\n *. If **pos** is NULL, colors are evenly distributed between the start angle (0°) and end angle (360°).\n @param size Number of colors and positions (if **pos** is not NULL).\n @param tileMode Tile mode of the shader effect. For details about the available options, see\n {@link OH_Drawing_TileMode}\n .\n @param matrix Matrix applied on the shader effect. If **matrix** is NULL, an identity matrix is applied by default.\n @return Returns the pointer to the {@link OH_Drawing_ShaderEffect} object created.\n A null pointer is returned if any of the following conditions is met:\n - The available memory is empty.\n - **centerPt** or **colors** is NULL.\n - The value of **tileMode** is out of the enumerated value range.\n @since 20\n @version 1.0"]
3998 #[cfg(feature = "api-20")]
3999 pub fn OH_Drawing_ShaderEffectCreateSweepGradientWithLocalMatrix(
4000 centerPt: *const OH_Drawing_Point,
4001 colors: *const u32,
4002 pos: *const f32,
4003 size: u32,
4004 tileMode: OH_Drawing_TileMode,
4005 matrix: *const OH_Drawing_Matrix,
4006 ) -> *mut OH_Drawing_ShaderEffect;
4007}
4008extern "C" {
4009 #[doc = " @brief Creates an **OH_Drawing_ShaderEffect** object that generates a sweep gradient based on the center.\n A sweep gradient paints a gradient in a sweeping arc ranging from 0° to 360°.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **centerPt** or **colors** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n If **tileMode** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.\n\n @param centerPt Center of the circle.\n @param colors Colors to distribute between the two points.\n @param pos Relative position of each color in the color array. The array length must be the same as that of **colors*\n *. If **pos** is NULL, colors are evenly distributed between the start angle (0°) and end angle (360°).\n @param size Number of colors and positions (if **pos** is not NULL).\n @param tileMode Tile mode of the shader effect. For details about the available options, see\n {@link OH_Drawing_TileMode}\n .\n @return Returns the pointer to the {@link OH_Drawing_ShaderEffect} object created.\n A null pointer is returned if any of the following conditions is met:\n - The available memory is empty.\n - **centerPt** or **colors** is NULL.\n - The value of **tileMode** is out of the enumerated value range.\n @since 11\n @version 1.0"]
4010 pub fn OH_Drawing_ShaderEffectCreateSweepGradient(
4011 centerPt: *const OH_Drawing_Point,
4012 colors: *const u32,
4013 pos: *const f32,
4014 size: u32,
4015 tileMode: OH_Drawing_TileMode,
4016 ) -> *mut OH_Drawing_ShaderEffect;
4017}
4018extern "C" {
4019 #[doc = " @brief Creates an **OH_Drawing_ShaderEffect** object for an image shader. You are advised not to use the function\n for the canvas of the capture type because it affects the performance.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **image** or **samplingOptions** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n If either **tileX** or **tileY** is not set to one of the enumerated values, **\n OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.\n\n @param image Pointer to the {@link OH_Drawing_Image} object.\n @param tileX Tile mode of the shader effect in the horizontal direction. For details about the available options,\n see {@link OH_Drawing_TileMode}.\n @param tileY Tile mode of the shader effect in the vertical direction. For details about the available options, see\n {@link OH_Drawing_TileMode}\n .\n @param samplingOptions Pointer to the {@link OH_Drawing_SamplingOptions} object.\n @param matrix Pointer to the {@link OH_Drawing_Matrix} object. If the pointer array is empty, the identity matrix is\n passed in.\n @return Returns the pointer to the {@link OH_Drawing_ShaderEffect} object created.\n A null pointer is returned if any of the following conditions is met:\n - The available memory is empty.\n - **image** or **samplingOptions** is NULL.\n - The value of **tileX** or **tileY** is out of the enumerated value range.\n @since 12\n @version 1.0"]
4020 pub fn OH_Drawing_ShaderEffectCreateImageShader(
4021 image: *mut OH_Drawing_Image,
4022 tileX: OH_Drawing_TileMode,
4023 tileY: OH_Drawing_TileMode,
4024 samplingOptions: *const OH_Drawing_SamplingOptions,
4025 matrix: *const OH_Drawing_Matrix,
4026 ) -> *mut OH_Drawing_ShaderEffect;
4027}
4028extern "C" {
4029 #[doc = " @brief Creates a PixelMap shader object.\n\n @param pixelMap Pointer to the {@link OH_Drawing_PixelMap} object.\n @param tileX Tile mode of the shader effect in the horizontal direction. For details about the available options,\n see {@link OH_Drawing_TileMode}.\n @param tileY Tile mode of the shader effect in the vertical direction. For details about the available options, see\n {@link OH_Drawing_TileMode}\n .\n @param samplingOptions Pointer to the {@link OH_Drawing_SamplingOptions} object.\n @param matrix Pointer to the {@link OH_Drawing_Matrix} object. If the pointer array is empty, the identity matrix is\n passed in.\n @return Returns the pointer to the **OH_Drawing_ShaderEffect** object created.\n @since 20\n @version 1.0"]
4030 #[cfg(feature = "api-20")]
4031 pub fn OH_Drawing_ShaderEffectCreatePixelMapShader(
4032 pixelMap: *mut OH_Drawing_PixelMap,
4033 tileX: OH_Drawing_TileMode,
4034 tileY: OH_Drawing_TileMode,
4035 samplingOptions: *const OH_Drawing_SamplingOptions,
4036 matrix: *const OH_Drawing_Matrix,
4037 ) -> *mut OH_Drawing_ShaderEffect;
4038}
4039extern "C" {
4040 #[doc = " @brief Creates an **OH_Drawing_ShaderEffect** object that generates a gradient between two given circles.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If any of **startPt**, **endPt**, and **colors** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n If **tileMode** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.\n\n @param startPt Pointer to the center of the start circle.\n @param startRadius Start radius of the gradient. The value should be a non-negative number.\n @param endPt Pointer to the center of the end circle.\n @param endRadius End radius of the gradient. The value should be a non-negative number.\n @param colors Colors to distribute between the two circles.\n @param pos Relative position of each color in the color array. The array length must be the same as that of **colors*\n *. If **pos** is NULL, colors are evenly distributed between the two circles.\n @param size Number of colors and positions (if **pos** is not NULL).\n @param tileMode Tile mode of the shader effect. For details about the available options, see\n {@link OH_Drawing_TileMode}\n .\n @param matrix Matrix applied on the shader effect. If **matrix** is NULL, an identity matrix is applied by default.\n @return Returns the pointer to the {@link OH_Drawing_ShaderEffect} object created. If the returned pointer is NULL,\n the creation fails. The possible causes are as follows:\n - The available memory is empty.\n - **startPt**, **endPt**, or **colors** is NULL.\n - The value of **tileMode** is out of the enumerated value range.\n @since 12\n @version 1.0"]
4041 pub fn OH_Drawing_ShaderEffectCreateTwoPointConicalGradient(
4042 startPt: *const OH_Drawing_Point2D,
4043 startRadius: f32,
4044 endPt: *const OH_Drawing_Point2D,
4045 endRadius: f32,
4046 colors: *const u32,
4047 pos: *const f32,
4048 size: u32,
4049 tileMode: OH_Drawing_TileMode,
4050 matrix: *const OH_Drawing_Matrix,
4051 ) -> *mut OH_Drawing_ShaderEffect;
4052}
4053extern "C" {
4054 #[doc = " @brief Creates a shader by blending two existing shaders in a certain way.\n\n @param dst Shader that serves as the destination color in blend mode.\n @param src Shader that serves as the source color in blend mode.\n @param mode Blend mode.\n @return Returns the pointer to the {@link OH_Drawing_ShaderEffect} object created.\n If the returned pointer is NULL, the creation fails. The possible causes are as follows:\n - The available memory is empty.\n - **dst** or **src** is NULL.\n - The value of **mode** is out of the enumerated value range.\n @since 20\n @version 1.0"]
4055 #[cfg(feature = "api-20")]
4056 pub fn OH_Drawing_ShaderEffectCreateCompose(
4057 dst: *mut OH_Drawing_ShaderEffect,
4058 src: *mut OH_Drawing_ShaderEffect,
4059 mode: OH_Drawing_BlendMode,
4060 ) -> *mut OH_Drawing_ShaderEffect;
4061}
4062extern "C" {
4063 #[doc = " @brief Destroys an **OH_Drawing_ShaderEffect** object and reclaims the memory occupied by the object.\n\n @param shaderEffect Pointer to an **OH_Drawing_ShaderEffect** object.\n @since 11\n @version 1.0"]
4064 pub fn OH_Drawing_ShaderEffectDestroy(shaderEffect: *mut OH_Drawing_ShaderEffect);
4065}
4066extern "C" {
4067 #[doc = " @brief Creates an image filter with a given blur effect.\n\n @param sigmaX Standard deviation of the Gaussian blur to apply along the X axis. The value must be greater than 0.\n @param sigmaY Standard deviation of the Gaussian blur to apply along the Y axis. The value must be greater than 0.\n @param tileMode Tile mode of the shader effect. For details about the available options, see\n {@link OH_Drawing_TileMode}\n .\n @param imageFilter Pointer to the filter to which the image filter will be applied. If NULL is passed in, the image\n filter is directly applied to the original image.\n @return Returns the pointer to the <b>OH_Drawing_ImageFilter</b> object created.\n If nullptr is returned, the creation fails.\n The possible cause of the failure is that the available memory is empty.\n @since 12\n @version 1.0"]
4068 pub fn OH_Drawing_ImageFilterCreateBlur(
4069 sigmaX: f32,
4070 sigmaY: f32,
4071 tileMode: OH_Drawing_TileMode,
4072 imageFilter: *mut OH_Drawing_ImageFilter,
4073 ) -> *mut OH_Drawing_ImageFilter;
4074}
4075extern "C" {
4076 #[doc = " @brief Creates an image filter with a given blur effect.\n\n @param sigmaX Standard deviation of the Gaussian blur to apply along the X axis. The value must be greater than 0.0.\n @param sigmaY Standard deviation of the Gaussian blur to apply along the Y axis. The value must be greater than 0.0.\n @param tileMode Tile mode of the shader effect. For details about the available options, see\n {@link OH_Drawing_TileMode}\n .\n @param input Pointer to the filter to which the image filter will be applied. If NULL is passed in, the image filter\n is directly applied to the original image.\n @param rect Pointer to the rectangular region to be cropped. If NULL is passed in, the blur effect is directly\n applied to the entire image.\n @return Returns the pointer to the <b>OH_Drawing_ImageFilter</b> object created.\n @since 20\n @version 1.0"]
4077 #[cfg(feature = "api-20")]
4078 pub fn OH_Drawing_ImageFilterCreateBlurWithCrop(
4079 sigmaX: f32,
4080 sigmaY: f32,
4081 tileMode: OH_Drawing_TileMode,
4082 input: *mut OH_Drawing_ImageFilter,
4083 rect: *const OH_Drawing_Rect,
4084 ) -> *mut OH_Drawing_ImageFilter;
4085}
4086extern "C" {
4087 #[doc = " @brief Creates an **OH_Drawing_ImageFilter** object with a color filter effect. This API may return an error code.\n For details, call {@link OH_Drawing_ErrorCodeGet}. If **colorFilter** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER**\n is returned.\n\n @param colorFilter Pointer to an {@link OH_Drawing_ColorFilter} object.\n @param imageFilter Pointer to the filter to which the image filter will be applied. If NULL is passed in, the image\n filter is directly applied to the original image.\n @return Returns the pointer to the <b>OH_Drawing_ImageFilter</b> object created.\n If nullptr is returned, the creation fails.\n The possible cause of the failure is that the available memory is empty or\n a nullptr <b>OH_Drawing_ColorFilter</b> is passed.\n @since 12\n @version 1.0"]
4088 pub fn OH_Drawing_ImageFilterCreateFromColorFilter(
4089 colorFilter: *mut OH_Drawing_ColorFilter,
4090 imageFilter: *mut OH_Drawing_ImageFilter,
4091 ) -> *mut OH_Drawing_ImageFilter;
4092}
4093extern "C" {
4094 #[doc = " @brief Creates an offset filter to translate the input filter based on the specified vector.\n\n @param x Distance to translate on the X axis.\n @param y Distance to translate on the Y axis.\n @param imageFilter Filter to be translated. If NULL is passed in, the drawing result without the filtering effect is\n translated.\n @return Returns the pointer to the <b>OH_Drawing_ImageFilter</b> object created.\n If nullptr is returned, the creation fails.\n The possible cause of the failure is that the available memory is empty.\n @since 20\n @version 1.0"]
4095 #[cfg(feature = "api-20")]
4096 pub fn OH_Drawing_ImageFilterCreateOffset(
4097 x: f32,
4098 y: f32,
4099 imageFilter: *mut OH_Drawing_ImageFilter,
4100 ) -> *mut OH_Drawing_ImageFilter;
4101}
4102extern "C" {
4103 #[doc = " @brief Creates an **ImageFilter** object based on a shader.\n\n @param shaderEffect Shader effect to be applied to the image.\n @return Returns the pointer to the <b>OH_Drawing_ImageFilter</b> object created.\n If nullptr is returned, the creation fails.\n The possible cause of the failure is that the available memory is empty or\n a nullptr <b>OH_Drawing_ShaderEffect</b> is passed.\n @since 20\n @version 1.0"]
4104 #[cfg(feature = "api-20")]
4105 pub fn OH_Drawing_ImageFilterCreateFromShaderEffect(
4106 shaderEffect: *mut OH_Drawing_ShaderEffect,
4107 ) -> *mut OH_Drawing_ImageFilter;
4108}
4109extern "C" {
4110 #[doc = " @brief Destroys an **OH_Drawing_ImageFilter** object and reclaims the memory occupied by the object.\n\n @param imageFilter Pointer to an {@link OH_Drawing_ImageFilter} object.\n @since 12\n @version 1.0"]
4111 pub fn OH_Drawing_ImageFilterDestroy(imageFilter: *mut OH_Drawing_ImageFilter);
4112}
4113#[doc = " Blurs both inside and outside the original border."]
4114pub const OH_Drawing_BlurType_NORMAL: OH_Drawing_BlurType = 0;
4115#[doc = " Draws solid inside the border, and blurs outside."]
4116pub const OH_Drawing_BlurType_SOLID: OH_Drawing_BlurType = 1;
4117#[doc = " Draws nothing inside the border, and blurs outside."]
4118pub const OH_Drawing_BlurType_OUTER: OH_Drawing_BlurType = 2;
4119#[doc = " Blurs inside the border, and draws nothing outside."]
4120pub const OH_Drawing_BlurType_INNER: OH_Drawing_BlurType = 3;
4121#[doc = " @brief Defines an enum for the blur types.\n\n @since 11\n @version 1.0"]
4122pub type OH_Drawing_BlurType = u32;
4123extern "C" {
4124 #[doc = " @brief Creates an **OH_Drawing_MaskFilter** object with a blur type.\n\n @param blurType Blur type.\n @param sigma Standard deviation of the Gaussian blur to apply. The value must be greater than 0.\n @param respectCTM Whether the blur standard deviation is modified by the current transformation matrix (CTM). The\n default value is **true**. **true**: The blur standard deviation is affected by the CTM. **false**: The blur\n standard deviation is fixed and not affected by the CTM.\n @return Returns the pointer to the **OH_Drawing_MaskFilter** object created.\n @since 11\n @version 1.0"]
4125 pub fn OH_Drawing_MaskFilterCreateBlur(
4126 blurType: OH_Drawing_BlurType,
4127 sigma: f32,
4128 respectCTM: bool,
4129 ) -> *mut OH_Drawing_MaskFilter;
4130}
4131extern "C" {
4132 #[doc = " @brief Destroys an **OH_Drawing_MaskFilter** object and reclaims the memory occupied by the object.\n\n @param maskFilter Pointer to an **OH_Drawing_MaskFilter** object.\n @since 11\n @version 1.0"]
4133 pub fn OH_Drawing_MaskFilterDestroy(maskFilter: *mut OH_Drawing_MaskFilter);
4134}
4135extern "C" {
4136 #[doc = " @brief Creates an **OH_Drawing_Matrix** object.\n\n @return Returns the pointer to the <b>OH_Drawing_Matrix</b> object created.\n @since 11\n @version 1.0"]
4137 pub fn OH_Drawing_MatrixCreate() -> *mut OH_Drawing_Matrix;
4138}
4139extern "C" {
4140 #[doc = " @brief Creates a copy of a matrix object.\n\n @param matrix Pointer to the {@link OH_Drawing_Matrix} object to be copied.\n @return Returns the pointer to the <b>OH_Drawing_Matrix</b> object created.\n @since 20\n @version 1.0"]
4141 #[cfg(feature = "api-20")]
4142 pub fn OH_Drawing_MatrixCopy(matrix: *const OH_Drawing_Matrix) -> *mut OH_Drawing_Matrix;
4143}
4144extern "C" {
4145 #[doc = " @brief Creates an **OH_Drawing_Matrix** with the rotation attribute.\n The matrix is obtained by rotating an identity matrix by a given degree around the rotation point (x, y).\n\n @param deg Angle to rotate, in degrees. A positive value indicates a clockwise rotation, and a negative value\n indicates a counterclockwise rotation.\n @param x Coordinate point on the X axis.\n @param y Coordinate point on the Y axis.\n @return Returns the pointer to the <b>OH_Drawing_Matrix</b> object created.\n @since 12\n @version 1.0"]
4146 pub fn OH_Drawing_MatrixCreateRotation(deg: f32, x: f32, y: f32) -> *mut OH_Drawing_Matrix;
4147}
4148extern "C" {
4149 #[doc = " @brief Creates an **OH_Drawing_Matrix** with the scale attribute.\n The matrix is obtained by scaling an identity matrix with the factor (sx, sy) at the rotation point (px, py).\n\n @param sx Scale factor on the X axis. If a negative number is passed in, the matrix is mirrored around y = px before\n being scaled. The value is a floating point number.\n @param sy Scale factor on the Y axis. If a negative number is passed in, the matrix is mirrored around x = py before\n being scaled. The value is a floating point number.\n @param px Coordinate point on the X axis.\n @param py Coordinate point on the Y axis.\n @return Returns the pointer to the <b>OH_Drawing_Matrix</b> object created.\n @since 12\n @version 1.0"]
4150 pub fn OH_Drawing_MatrixCreateScale(
4151 sx: f32,
4152 sy: f32,
4153 px: f32,
4154 py: f32,
4155 ) -> *mut OH_Drawing_Matrix;
4156}
4157extern "C" {
4158 #[doc = " @brief Creates an **OH_Drawing_Matrix** with the translation attribute.\n The matrix is obtained by translating the identity matrix by the distance (dx, dy).\n\n @param dx Distance to translate on the X axis. A positive number indicates a translation towards the positive\n direction of the X axis, and a negative number indicates a translation towards the negative direction of the X axis.\n The value is a floating point number.\n @param dy Distance to translate on the Y axis. A positive number indicates a translation towards the positive\n direction of the Y axis, and a negative number indicates a translation towards the negative direction of the Y axis.\n The value is a floating point number.\n @return Returns the pointer to the <b>OH_Drawing_Matrix</b> object created.\n @since 12\n @version 1.0"]
4159 pub fn OH_Drawing_MatrixCreateTranslation(dx: f32, dy: f32) -> *mut OH_Drawing_Matrix;
4160}
4161extern "C" {
4162 #[doc = " @brief Sets matrix parameters for an **OH_Drawing_Matrix** object.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **OH_Drawing_Matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param matrix Pointer to an **OH_Drawing_Matrix** object.\n @param scaleX Scale factor on the X axis.\n @param skewX Skew factor on the X axis.\n @param transX Translation coefficient on the X axis.\n @param skewY Skew factor on the Y axis.\n @param scaleY Scale factor on the Y axis.\n @param transY Translation coefficient on the Y axis.\n @param persp0 Perspective coefficient of the X axis.\n @param persp1 Perspective coefficient of the Y axis.\n @param persp2 Perspective scale coefficient.\n @since 11\n @version 1.0"]
4163 pub fn OH_Drawing_MatrixSetMatrix(
4164 matrix: *mut OH_Drawing_Matrix,
4165 scaleX: f32,
4166 skewX: f32,
4167 transX: f32,
4168 skewY: f32,
4169 scaleY: f32,
4170 transY: f32,
4171 persp0: f32,
4172 persp1: f32,
4173 persp2: f32,
4174 );
4175}
4176#[doc = " Scales the source rectangle both horizontally and vertically to exactly match the destination rectangle."]
4177pub const OH_Drawing_ScaleToFit_SCALE_TO_FIT_FILL: OH_Drawing_ScaleToFit = 0;
4178#[doc = " Scales the source rectangle and aligns it to the left and top edges of the destination rectangle."]
4179pub const OH_Drawing_ScaleToFit_SCALE_TO_FIT_START: OH_Drawing_ScaleToFit = 1;
4180#[doc = " Scales the source rectangle and aligns it to the center of the destination rectangle."]
4181pub const OH_Drawing_ScaleToFit_SCALE_TO_FIT_CENTER: OH_Drawing_ScaleToFit = 2;
4182#[doc = " Scales the source rectangle and aligns it to the right and bottom edges of the destination rectangle."]
4183pub const OH_Drawing_ScaleToFit_SCALE_TO_FIT_END: OH_Drawing_ScaleToFit = 3;
4184#[doc = " @brief Defines an enum for the matrix scaling modes.\n\n @since 12\n @version 1.0"]
4185pub type OH_Drawing_ScaleToFit = u32;
4186extern "C" {
4187 #[doc = " @brief Scales a matrix to map a source rectangle to a destination rectangle.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If any of **matrix**, **src**, and **dst** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param matrix Pointer to the {@link OH_Drawing_Matrix} object.\n @param src Pointer to the {@link OH_Drawing_Rect} object of the mapping source.\n @param dst Pointer to the {@link OH_Drawing_Rect} object of the mapping destination.\n @param stf Scaling mode. For details about the available options, see {@link OH_Drawing_ScaleToFit}.\n @return Returns true if dst is empty, and sets matrix to:\n | 0 0 0 |\n | 0 0 0 |\n | 0 0 1 |\n\n @since 12\n @version 1.0"]
4188 pub fn OH_Drawing_MatrixSetRectToRect(
4189 matrix: *mut OH_Drawing_Matrix,
4190 src: *const OH_Drawing_Rect,
4191 dst: *const OH_Drawing_Rect,
4192 stf: OH_Drawing_ScaleToFit,
4193 ) -> bool;
4194}
4195extern "C" {
4196 #[doc = " @brief Premultiplies this matrix by a matrix that is derived from an identity matrix after it has been rotated by a\n given degree around the rotation point (px, py).\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param matrix Pointer to the {@link OH_Drawing_Matrix} object.\n @param degree Angle to rotate, in degrees. A positive value indicates a clockwise rotation, and a negative value\n indicates a counterclockwise rotation.\n @param px X coordinate of the rotation point.\n @param py Y coordinate of the rotation point.\n @since 12\n @version 1.0"]
4197 pub fn OH_Drawing_MatrixPreRotate(
4198 matrix: *mut OH_Drawing_Matrix,
4199 degree: f32,
4200 px: f32,
4201 py: f32,
4202 );
4203}
4204extern "C" {
4205 #[doc = " @brief Premultiplies a matrix by an identity matrix that scales with the factor (sx, sy) at the scale point (px, py).\n\n @param matrix Pointer to the {@link OH_Drawing_Matrix} object.\n @param sx Scale factor on the X axis. If a negative number is passed in, the matrix is mirrored around y = px before\n being scaled. The value is a floating point number.\n @param sy Scale factor on the Y axis. If a negative number is passed in, the matrix is mirrored around x = py before\n being scaled. The value is a floating point number.\n @param px X coordinate of the scale point.\n @param py Y coordinate of the scale point.\n @since 12\n @version 1.0"]
4206 pub fn OH_Drawing_MatrixPreScale(
4207 matrix: *mut OH_Drawing_Matrix,
4208 sx: f32,
4209 sy: f32,
4210 px: f32,
4211 py: f32,
4212 );
4213}
4214extern "C" {
4215 #[doc = " @brief Premultiplies this matrix by a matrix that is derived from an identity matrix after it has been translated by\n a given distance (dx, dy).\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param matrix Pointer to the {@link OH_Drawing_Matrix} object.\n @param dx Horizontal distance to translate. A positive number indicates a translation towards the positive direction\n of the X axis, and a negative number indicates a translation towards the negative direction of the X axis. The value\n is a floating point number.\n @param dy Vertical distance to translate. A positive number indicates a translation towards the positive direction\n of the Y axis, and a negative number indicates a translation towards the negative direction of the Y axis. The value\n is a floating point number.\n @since 12\n @version 1.0"]
4216 pub fn OH_Drawing_MatrixPreTranslate(matrix: *mut OH_Drawing_Matrix, dx: f32, dy: f32);
4217}
4218extern "C" {
4219 #[doc = " @brief Post multiplies this matrix by a matrix that is derived from an identity matrix after it has been rotated by\n a given degree around the rotation point (px, py).\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param matrix Pointer to the {@link OH_Drawing_Matrix} object.\n @param degree Angle to rotate, in degrees. A positive value indicates a clockwise rotation, and a negative value\n indicates a counterclockwise rotation.\n @param px X coordinate of the rotation point.\n @param py Y coordinate of the rotation point.\n @since 12\n @version 1.0"]
4220 pub fn OH_Drawing_MatrixPostRotate(
4221 matrix: *mut OH_Drawing_Matrix,
4222 degree: f32,
4223 px: f32,
4224 py: f32,
4225 );
4226}
4227extern "C" {
4228 #[doc = " @brief Post multiplies a matrix by an identity matrix that scales with the factor (sx, sy) at the scale point (px,\n py).\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param matrix Pointer to the {@link OH_Drawing_Matrix} object.\n @param sx Scale factor on the X axis. If a negative number is passed in, the matrix is mirrored around y = px before\n being scaled. The value is a floating point number.\n @param sy Scale factor on the Y axis. If a negative number is passed in, the matrix is mirrored around x = py before\n being scaled. The value is a floating point number.\n @param px X coordinate of the scale point.\n @param py Y coordinate of the scale point.\n @since 12\n @version 1.0"]
4229 pub fn OH_Drawing_MatrixPostScale(
4230 matrix: *mut OH_Drawing_Matrix,
4231 sx: f32,
4232 sy: f32,
4233 px: f32,
4234 py: f32,
4235 );
4236}
4237extern "C" {
4238 #[doc = " @brief Post multiplies this matrix by a matrix that is derived from an identity matrix after it has been translated\n by a given distance (dx, dy).\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param matrix Pointer to the {@link OH_Drawing_Matrix} object.\n @param dx Horizontal distance to translate. A positive number indicates a translation towards the positive direction\n of the X axis, and a negative number indicates a translation towards the negative direction of the X axis. The value\n is a floating point number.\n @param dy Vertical distance to translate. A positive number indicates a translation towards the positive direction\n of the Y axis, and a negative number indicates a translation towards the negative direction of the Y axis. The value\n is a floating point number.\n @since 12\n @version 1.0"]
4239 pub fn OH_Drawing_MatrixPostTranslate(matrix: *mut OH_Drawing_Matrix, dx: f32, dy: f32);
4240}
4241extern "C" {
4242 #[doc = " @brief Resets a matrix to an identity matrix.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param matrix Pointer to the {@link OH_Drawing_Matrix} object.\n @since 12\n @version 1.0"]
4243 pub fn OH_Drawing_MatrixReset(matrix: *mut OH_Drawing_Matrix);
4244}
4245extern "C" {
4246 #[doc = " @brief Multiplies two matrices to produce a new matrix.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If any of **total**, **a**, and **b** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param total Pointer to the {@link OH_Drawing_Matrix} object.\n @param a Pointer to {@link OH_Drawing_Matrix} object a.\n @param b Pointer to {@link OH_Drawing_Matrix} object b.\n @since 12\n @version 1.0"]
4247 pub fn OH_Drawing_MatrixConcat(
4248 total: *mut OH_Drawing_Matrix,
4249 a: *const OH_Drawing_Matrix,
4250 b: *const OH_Drawing_Matrix,
4251 );
4252}
4253extern "C" {
4254 #[doc = " @brief Obtains all element values of a matrix.\n\n @param matrix Pointer to the {@link OH_Drawing_Matrix} object.\n @param value Array used to store the obtained element values.\n @return Returns the error code.\n Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.\n Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if matrix or value is nullptr.\n @since 12\n @version 1.0"]
4255 pub fn OH_Drawing_MatrixGetAll(
4256 matrix: *mut OH_Drawing_Matrix,
4257 value: *mut f32,
4258 ) -> OH_Drawing_ErrorCode;
4259}
4260extern "C" {
4261 #[doc = " @brief Left-multiplies matrix a by matrix b.\n\n @param a Pointer to the {@link OH_Drawing_Matrix} object.\n @param b Pointer to the {@link OH_Drawing_Matrix} object.\n @return Returns the error code.\n Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.\n Returns {@link OH_DRAWING_ERROR_INCORRECT_PARAMETER} if a or b is nullptr.\n @since 22\n @version 1.0"]
4262 #[cfg(feature = "api-22")]
4263 pub fn OH_Drawing_MatrixPreConcat(
4264 a: *mut OH_Drawing_Matrix,
4265 b: *mut OH_Drawing_Matrix,
4266 ) -> OH_Drawing_ErrorCode;
4267}
4268extern "C" {
4269 #[doc = " @brief Obtains a matrix value of a given index, which ranges from 0 to 8.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n If **index** is less than 0 or greater than 8, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.\n\n @param matrix Pointer to the {@link OH_Drawing_Matrix} object.\n @param index Index, which ranges from 0 to 8.\n @return Returns value corresponding to index.Returns 0 if out of range.\n @since 12\n @version 1.0"]
4270 pub fn OH_Drawing_MatrixGetValue(
4271 matrix: *mut OH_Drawing_Matrix,
4272 index: ::std::os::raw::c_int,
4273 ) -> f32;
4274}
4275extern "C" {
4276 #[doc = " @brief Sets this matrix as an identity matrix and rotates it by a given degree around the rotation point (px, py).\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param matrix Pointer to the {@link OH_Drawing_Matrix} object.\n @param degree Angle to rotate, in degrees. A positive value indicates a clockwise rotation, and a negative value\n indicates a counterclockwise rotation.\n @param px Coordinate point on the X axis.\n @param py Coordinate point on the Y axis.\n @since 12\n @version 1.0"]
4277 pub fn OH_Drawing_MatrixRotate(matrix: *mut OH_Drawing_Matrix, degree: f32, px: f32, py: f32);
4278}
4279extern "C" {
4280 #[doc = " @brief Sets a matrix as an identity matrix and translates it by a given distance (dx, dy).\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param matrix Pointer to the {@link OH_Drawing_Matrix} object.\n @param dx Distance to translate on the X axis. A positive number indicates a translation towards the positive\n direction of the X axis, and a negative number indicates a translation towards the negative direction of the X axis.\n The value is a floating point number.\n @param dy Distance to translate on the Y axis. A positive number indicates a translation towards the positive\n direction of the Y axis, and a negative number indicates a translation towards the negative direction of the Y axis.\n The value is a floating point number.\n @since 12\n @version 1.0"]
4281 pub fn OH_Drawing_MatrixTranslate(matrix: *mut OH_Drawing_Matrix, dx: f32, dy: f32);
4282}
4283extern "C" {
4284 #[doc = " @brief Sets a matrix as an identity matrix and scales it with the factor (sx, sy) at the rotation point (px, py).\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param matrix Pointer to the {@link OH_Drawing_Matrix} object.\n @param sx Scale factor on the X axis. If a negative number is passed in, the matrix is mirrored around y = px before\n being scaled. The value is a floating point number.\n @param sy Scale factor on the Y axis. If a negative number is passed in, the matrix is mirrored around x = py before\n being scaled. The value is a floating point number.\n @param px Coordinate point on the X axis.\n @param py Coordinate point on the Y axis.\n @since 12\n @version 1.0"]
4285 pub fn OH_Drawing_MatrixScale(
4286 matrix: *mut OH_Drawing_Matrix,
4287 sx: f32,
4288 sy: f32,
4289 px: f32,
4290 py: f32,
4291 );
4292}
4293extern "C" {
4294 #[doc = " @brief Inverts a matrix and returns the result.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **matrix** or **inverse** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param matrix Pointer to the {@link OH_Drawing_Matrix} object.\n @param inverse Pointer to the inverse {@link OH_Drawing_Matrix} object. You can call {@link OH_Drawing_MatrixCreate}\n to create an inverse matrix object.\n @return Returns true if the matrix is not nullptr and can be inverted;\n returns false if the matrix is nullptr or cannot be inverted.\n @since 12\n @version 1.0"]
4295 pub fn OH_Drawing_MatrixInvert(
4296 matrix: *mut OH_Drawing_Matrix,
4297 inverse: *mut OH_Drawing_Matrix,
4298 ) -> bool;
4299}
4300extern "C" {
4301 #[doc = " @brief Generates a transformation matrix by setting source points and destination points.\n Both the number of source points and that of destination points must be in the range [0, 4]. This API may return an\n error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n If **count** is less than 0 or greater than 4, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.\n\n @param matrix Pointer to the {@link OH_Drawing_Matrix} object.\n @param src Array of source points. If NULL is passed in, **count** must be 0.\n @param dst Array of destination points. The number of destination points must be the same as that of source points.\n If NULL is passed in, **count** must be 0.\n @param count Number of source points or destination points. If 0 is passed in, the matrix is set to an identity\n matrix.\n @return Returns true if matrix is constructed successfully.\n @since 12\n @version 1.0"]
4302 pub fn OH_Drawing_MatrixSetPolyToPoly(
4303 matrix: *mut OH_Drawing_Matrix,
4304 src: *const OH_Drawing_Point2D,
4305 dst: *const OH_Drawing_Point2D,
4306 count: u32,
4307 ) -> bool;
4308}
4309extern "C" {
4310 #[doc = " @brief Maps a source point array to a destination point array by means of matrix transformation.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If any of **matrix**, **src**, and **dst** is NULL or **count** is less than or equal to 0, **\n OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param matrix Pointer to the {@link OH_Drawing_Matrix} object.\n @param src Array of source points.\n @param dst Array of destination points. The number of destination points must be the same as that of source points.\n @param count Number of source points or destination points.\n @since 12\n @version 1.0"]
4311 pub fn OH_Drawing_MatrixMapPoints(
4312 matrix: *const OH_Drawing_Matrix,
4313 src: *const OH_Drawing_Point2D,
4314 dst: *mut OH_Drawing_Point2D,
4315 count: ::std::os::raw::c_int,
4316 );
4317}
4318extern "C" {
4319 #[doc = " @brief Maps a rectangle to the smallest rectangle that can enclose the vertices to which the four source vertices\n are mapped by means of matrix transformation.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If any of **matrix**, **src**, and **dst** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param matrix Pointer to the {@link OH_Drawing_Matrix} object.\n @param src Source rectangle.\n @param dst Destination rectangle.\n @return Returns true if the mapped src is equal to the dst; returns false is not equal.\n @since 12\n @version 1.0"]
4320 pub fn OH_Drawing_MatrixMapRect(
4321 matrix: *const OH_Drawing_Matrix,
4322 src: *const OH_Drawing_Rect,
4323 dst: *mut OH_Drawing_Rect,
4324 ) -> bool;
4325}
4326extern "C" {
4327 #[doc = " @brief Checks whether two **OH_Drawing_Matrix** objects are equal.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **matrix** or **other** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param matrix Pointer to one {@link OH_Drawing_Matrix} object.\n @param other Pointer to the other {@link OH_Drawing_Matrix} object.\n @return Returns true if the two matrices are equal; returns false if not equal.\n @since 12\n @version 1.0"]
4328 pub fn OH_Drawing_MatrixIsEqual(
4329 matrix: *mut OH_Drawing_Matrix,
4330 other: *mut OH_Drawing_Matrix,
4331 ) -> bool;
4332}
4333extern "C" {
4334 #[doc = " @brief Checks whether an **OH_Drawing_Matrix** object is an identity matrix.\n An identity matrix is as follows: | 1 0 0 || 0 1 0 || 0 0 1 |. This API may return an error code. For details, see\n {@link OH_Drawing_ErrorCodeGet}\n .\n If **matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param matrix Pointer to the {@link OH_Drawing_Matrix} object.\n @return Returns true if matrix is identity; returns false if not identity.\n @since 12\n @version 1.0"]
4335 pub fn OH_Drawing_MatrixIsIdentity(matrix: *mut OH_Drawing_Matrix) -> bool;
4336}
4337extern "C" {
4338 #[doc = " @brief Checks whether the existing matrix is an affine matrix, which includes transformations such as translation,\n rotation, and scaling.\n\n @param matrix Pointer to the {@link OH_Drawing_Matrix} object.\n @param isAffine Whether the existing matrix is an affine matrix. It is used as an output parameter. **true** means\n yes; **false** otherwise.\n @return Returns the error code.\n Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.\n Returns {@link OH_DRAWING_ERROR_INCORRECT_PARAMETER} if matrix or isAffine is nullptr.\n @since 23"]
4339 #[cfg(feature = "api-23")]
4340 pub fn OH_Drawing_MatrixIsAffine(
4341 matrix: *const OH_Drawing_Matrix,
4342 isAffine: *mut bool,
4343 ) -> OH_Drawing_ErrorCode;
4344}
4345extern "C" {
4346 #[doc = " @brief Left multiplies the current matrix by a matrix constructed based on (px, py) and (kx, ky).\n\n @param matrix Pointer to the {@link OH_Drawing_Matrix} object.\n @param kx Tilt on the X axis.\n @param ky Tilt on the Y axis.\n @param px X-coordinate of the tilt center.\n @param py Y-coordinate of the tilt center.\n @return Returns the error code.\n Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.\n Returns {@link OH_DRAWING_ERROR_INCORRECT_PARAMETER} if matrix is nullptr.\n @since 23"]
4347 #[cfg(feature = "api-23")]
4348 pub fn OH_Drawing_MatrixPreSkew(
4349 matrix: *mut OH_Drawing_Matrix,
4350 kx: f32,
4351 ky: f32,
4352 px: f32,
4353 py: f32,
4354 ) -> OH_Drawing_ErrorCode;
4355}
4356extern "C" {
4357 #[doc = " @brief Checks whether the rectangle remains rectangular after being mapped by the current matrix. This condition is\n met when the matrix is an identity matrix or contains only affine transformations such as translation, scaling, and\n rotation by 90 degrees.\n\n @param matrix Pointer to the {@link OH_Drawing_Matrix} object.\n @param isRectStaysRect Whether a rectangle stays a rectangle after being mapped by a matrix. It is used as an output\n parameter.\n **true** means yes; **false** otherwise.\n @return Returns the error code.\n Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.\n Returns {@link OH_DRAWING_ERROR_INCORRECT_PARAMETER} if matrix or isRectStaysRect is nullptr.\n @since 23"]
4358 #[cfg(feature = "api-23")]
4359 pub fn OH_Drawing_MatrixRectStaysRect(
4360 matrix: *const OH_Drawing_Matrix,
4361 isRectStaysRect: *mut bool,
4362 ) -> OH_Drawing_ErrorCode;
4363}
4364extern "C" {
4365 #[doc = " @brief Sets the matrix to rotate around the rotation center (px, py) with the specified sine and cosine values.\n\n @param matrix Pointer to the {@link OH_Drawing_Matrix} object.\n @param sinValue Sine value of the rotation angle.\n @param cosValue Cosine value of the rotation angle.\n @param px X-axis coordinate of the rotation center.\n @param py Y-axis coordinate of the rotation center.\n @return Returns the error code.\n Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.\n Returns {@link OH_DRAWING_ERROR_INCORRECT_PARAMETER} if matrix is nullptr.\n @since 23"]
4366 #[cfg(feature = "api-23")]
4367 pub fn OH_Drawing_MatrixSetSinCos(
4368 matrix: *mut OH_Drawing_Matrix,
4369 sinValue: f32,
4370 cosValue: f32,
4371 px: f32,
4372 py: f32,
4373 ) -> OH_Drawing_ErrorCode;
4374}
4375extern "C" {
4376 #[doc = " @brief Destroys an **OH_Drawing_Matrix** object and reclaims the memory occupied by the object.\n\n @param matrix Pointer to an **OH_Drawing_Matrix** object.\n @since 11\n @version 1.0"]
4377 pub fn OH_Drawing_MatrixDestroy(matrix: *mut OH_Drawing_Matrix);
4378}
4379extern "C" {
4380 #[doc = " @brief Creates an **OH_Drawing_MemoryStream** object.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **data** is NULL or **length** is **0**, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @return Returns the pointer to the {@link OH_Drawing_MemoryStream} object created.\n @param data Pointer to the data.\n @param length Length of the data.\n @param copyData Whether to copy data. The value **true** means that the **OH_Drawing_MemoryStream** object copies\n the data, and **false** means that the **OH_Drawing_MemoryStream** object directly uses the data without copying.\n @since 12\n @version 1.0"]
4381 pub fn OH_Drawing_MemoryStreamCreate(
4382 data: *const ::std::os::raw::c_void,
4383 length: usize,
4384 copyData: bool,
4385 ) -> *mut OH_Drawing_MemoryStream;
4386}
4387extern "C" {
4388 #[doc = " @brief Destroys an **OH_Drawing_MemoryStream** object and reclaims the memory occupied by the object.\n\n @param memoryStream Pointer to an {@link OH_Drawing_MemoryStream} object.\n @since 12\n @version 1.0"]
4389 pub fn OH_Drawing_MemoryStreamDestroy(memoryStream: *mut OH_Drawing_MemoryStream);
4390}
4391#[doc = " Sets the start point of the path."]
4392#[cfg(feature = "api-23")]
4393pub const OH_Drawing_PathIteratorVerb_MOVE: OH_Drawing_PathIteratorVerb = 0;
4394#[doc = " Adds a line segment."]
4395#[cfg(feature = "api-23")]
4396pub const OH_Drawing_PathIteratorVerb_LINE: OH_Drawing_PathIteratorVerb = 1;
4397#[doc = " Adds a quadratic Bezier curve for smooth transitions."]
4398#[cfg(feature = "api-23")]
4399pub const OH_Drawing_PathIteratorVerb_QUAD: OH_Drawing_PathIteratorVerb = 2;
4400#[doc = " Adds a conic curve."]
4401#[cfg(feature = "api-23")]
4402pub const OH_Drawing_PathIteratorVerb_CONIC: OH_Drawing_PathIteratorVerb = 3;
4403#[doc = " Adds a cubic Bezier curve for smooth transitions."]
4404#[cfg(feature = "api-23")]
4405pub const OH_Drawing_PathIteratorVerb_CUBIC: OH_Drawing_PathIteratorVerb = 4;
4406#[doc = " Closes the path."]
4407#[cfg(feature = "api-23")]
4408pub const OH_Drawing_PathIteratorVerb_CLOSE: OH_Drawing_PathIteratorVerb = 5;
4409#[doc = " Completes the path configuration."]
4410#[cfg(feature = "api-23")]
4411pub const OH_Drawing_PathIteratorVerb_DONE: OH_Drawing_PathIteratorVerb = 6;
4412#[doc = " @brief Enumerates the path operation types contained in an iterator. It is used to read path operation instructions.\n\n @since 23"]
4413#[cfg(feature = "api-23")]
4414pub type OH_Drawing_PathIteratorVerb = u32;
4415extern "C" {
4416 #[doc = " @brief Creates an **OH_Drawing_PathIterator** object.\n\n @param path Pointer to an {@link OH_Drawing_Path} object.\n @param pathIterator Double pointer to an {@link OH_Drawing_PathIterator} object, which serves as an output parameter.\n @return Execution result.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INCORRECT_PARAMETER** if **path** or **pathIterator** is a null pointer.\n @since 23"]
4417 #[cfg(feature = "api-23")]
4418 pub fn OH_Drawing_PathIteratorCreate(
4419 path: *const OH_Drawing_Path,
4420 pathIterator: *mut *mut OH_Drawing_PathIterator,
4421 ) -> OH_Drawing_ErrorCode;
4422}
4423extern "C" {
4424 #[doc = " @brief Destroys an **OH_Drawing_PathIterator** object and reclaims the memory occupied by the object.\n\n @param pathIterator Pointer to an {@link OH_Drawing_PathIterator} object.\n @return Execution result.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INCORRECT_PARAMETER** if **pathIterator** is a null pointer.\n @since 23"]
4425 #[cfg(feature = "api-23")]
4426 pub fn OH_Drawing_PathIteratorDestroy(
4427 pathIterator: *mut OH_Drawing_PathIterator,
4428 ) -> OH_Drawing_ErrorCode;
4429}
4430extern "C" {
4431 #[doc = " @brief Checks whether there is any next operation in the path operation iterator.\n\n @param pathIterator Pointer to an {@link OH_Drawing_PathIterator} object.\n @param hasNext Whether there is a next operation in the path operation iterator, which serves as an output parameter.\n A value of **true** means there is a next operation; **false** means the opposite.\n @return Execution result.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INCORRECT_PARAMETER** if **pathIterator** or **hasNext** is a null pointer.\n @since 23"]
4432 #[cfg(feature = "api-23")]
4433 pub fn OH_Drawing_PathIteratorHasNext(
4434 pathIterator: *const OH_Drawing_PathIterator,
4435 hasNext: *mut bool,
4436 ) -> OH_Drawing_ErrorCode;
4437}
4438extern "C" {
4439 #[doc = " @brief Retrieves the next operation in this path and moves the iterator to that operation.\n\n @param pathIterator Pointer to an {@link OH_Drawing_PathIterator} object.\n @param points Array of coordinate points.\n @param count Size of the coordinate point array.\n @param offset Offset of the write position relative to the start point in the array. The value range is [0, count –\n 4].\n @param verb Next operation of the current path, which serves as an output parameter.\n @return Execution result.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INCORRECT_PARAMETER** if **pathIterator**, **points**, or **verb** is a null pointer.\n **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** if **count** is less than offset + 4.\n @since 23"]
4440 #[cfg(feature = "api-23")]
4441 pub fn OH_Drawing_PathIteratorNext(
4442 pathIterator: *mut OH_Drawing_PathIterator,
4443 points: *mut OH_Drawing_Point2D,
4444 count: u32,
4445 offset: u32,
4446 verb: *mut OH_Drawing_PathIteratorVerb,
4447 ) -> OH_Drawing_ErrorCode;
4448}
4449extern "C" {
4450 #[doc = " @brief Retrieves the next operation in this path, without moving the iterator.\n\n @param pathIterator Pointer to an {@link OH_Drawing_PathIterator} object.\n @param verb Next operation of the current path, which serves as an output parameter.\n @return Execution result.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INCORRECT_PARAMETER** if **pathIterator** or **verb** is a null pointer.\n @since 23"]
4451 #[cfg(feature = "api-23")]
4452 pub fn OH_Drawing_PathIteratorPeek(
4453 pathIterator: *const OH_Drawing_PathIterator,
4454 verb: *mut OH_Drawing_PathIteratorVerb,
4455 ) -> OH_Drawing_ErrorCode;
4456}
4457#[doc = " Adds a closed contour clockwise."]
4458pub const OH_Drawing_PathDirection_PATH_DIRECTION_CW: OH_Drawing_PathDirection = 0;
4459#[doc = " Adds a closed contour counterclockwise."]
4460pub const OH_Drawing_PathDirection_PATH_DIRECTION_CCW: OH_Drawing_PathDirection = 1;
4461#[doc = " @brief Enumerates the directions of a closed contour.\n\n @since 12\n @version 1.0"]
4462pub type OH_Drawing_PathDirection = u32;
4463#[doc = " For any point within the drawing area, a ray is cast in an arbitrary direction. The count starts at 0 for all\n intersections between this ray and the path.<br>Each clockwise intersection—where the path crosses the ray from\n left to right—results in the count being incremented by 1, while each counterclockwise intersection—where the\n path crosses the ray from right to left—causes the count to be decremented by 1. A point is deemed inside the\n path and needs to be colored if the final count is non-zero; if the count is 0, the point remains uncolored."]
4464pub const OH_Drawing_PathFillType_PATH_FILL_TYPE_WINDING: OH_Drawing_PathFillType = 0;
4465#[doc = " For any point in the drawing area, a ray is cast in an arbitrary direction. If the number of intersections\n between this ray and the path is odd, the point is deemed inside the path and needs to be colored; if the number\n is even, it remains uncolored."]
4466pub const OH_Drawing_PathFillType_PATH_FILL_TYPE_EVEN_ODD: OH_Drawing_PathFillType = 1;
4467#[doc = " Same as **PATH_FILL_TYPE_WINDING**, but draws outside of the path, rather than inside."]
4468pub const OH_Drawing_PathFillType_PATH_FILL_TYPE_INVERSE_WINDING: OH_Drawing_PathFillType = 2;
4469#[doc = " Same as **PATH_FILL_TYPE_EVEN_ODD**, but draws outside of the path, rather than inside."]
4470pub const OH_Drawing_PathFillType_PATH_FILL_TYPE_INVERSE_EVEN_ODD: OH_Drawing_PathFillType = 3;
4471#[doc = " @brief Enumerates the fill types of a path.\n\n @since 12\n @version 1.0"]
4472pub type OH_Drawing_PathFillType = u32;
4473#[doc = " Adds a path in append mode."]
4474pub const OH_Drawing_PathAddMode_PATH_ADD_MODE_APPEND: OH_Drawing_PathAddMode = 0;
4475#[doc = " Adds a line segment to close the path if the previous path is not closed."]
4476pub const OH_Drawing_PathAddMode_PATH_ADD_MODE_EXTEND: OH_Drawing_PathAddMode = 1;
4477#[doc = " @brief Enumerates the path adding modes.\n\n @since 12\n @version 1.0"]
4478pub type OH_Drawing_PathAddMode = u32;
4479#[doc = " Difference operation."]
4480pub const OH_Drawing_PathOpMode_PATH_OP_MODE_DIFFERENCE: OH_Drawing_PathOpMode = 0;
4481#[doc = " Intersection operation."]
4482pub const OH_Drawing_PathOpMode_PATH_OP_MODE_INTERSECT: OH_Drawing_PathOpMode = 1;
4483#[doc = " Union operation."]
4484pub const OH_Drawing_PathOpMode_PATH_OP_MODE_UNION: OH_Drawing_PathOpMode = 2;
4485#[doc = " XOR operation."]
4486pub const OH_Drawing_PathOpMode_PATH_OP_MODE_XOR: OH_Drawing_PathOpMode = 3;
4487#[doc = " Reverse difference operation."]
4488pub const OH_Drawing_PathOpMode_PATH_OP_MODE_REVERSE_DIFFERENCE: OH_Drawing_PathOpMode = 4;
4489#[doc = " @brief Enumerates the operation modes available for a path.\n\n @since 12\n @version 1.0"]
4490pub type OH_Drawing_PathOpMode = u32;
4491#[doc = " Matrix corresponding to the position information."]
4492pub const OH_Drawing_PathMeasureMatrixFlags_GET_POSITION_MATRIX: OH_Drawing_PathMeasureMatrixFlags =
4493 0;
4494#[doc = " Matrix corresponding to the tangent information."]
4495pub const OH_Drawing_PathMeasureMatrixFlags_GET_TANGENT_MATRIX: OH_Drawing_PathMeasureMatrixFlags =
4496 1;
4497#[doc = " Matrix corresponding to the position and tangent information."]
4498pub const OH_Drawing_PathMeasureMatrixFlags_GET_POSITION_AND_TANGENT_MATRIX:
4499 OH_Drawing_PathMeasureMatrixFlags = 2;
4500#[doc = " @brief Enumerates the types of matrix information obtained during path measurement.\n\n @since 12\n @version 1.0"]
4501pub type OH_Drawing_PathMeasureMatrixFlags = u32;
4502extern "C" {
4503 #[doc = " @brief Creates an **OH_Drawing_Path** object.\n\n @return Returns the pointer to the **OH_Drawing_Path** object created.\n @since 8\n @version 1.0"]
4504 pub fn OH_Drawing_PathCreate() -> *mut OH_Drawing_Path;
4505}
4506extern "C" {
4507 #[doc = " @brief Creates a copy of the {@link OH_Drawing_Path} object.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param path Pointer to the {@link OH_Drawing_Path} object.\n @return Pointer to the copy of the {@link OH_Drawing_Path} object.\n @since 12\n @version 1.0"]
4508 pub fn OH_Drawing_PathCopy(path: *mut OH_Drawing_Path) -> *mut OH_Drawing_Path;
4509}
4510extern "C" {
4511 #[doc = " @brief Destroys an **OH_Drawing_Path** object and reclaims the memory occupied by the object.\n\n @param path Pointer to an **OH_Drawing_Path** object.\n @since 8\n @version 1.0"]
4512 pub fn OH_Drawing_PathDestroy(path: *mut OH_Drawing_Path);
4513}
4514extern "C" {
4515 #[doc = " @brief Sets a path object as the current path object.\n\n @param path Pointer to the {@link OH_Drawing_Path} object.\n @param other Pointer to the {@link OH_Drawing_Path} object to be set.\n @return Execution result.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if **path** or **other** is NULL.\n @since 20\n @version 1.0"]
4516 #[cfg(feature = "api-20")]
4517 pub fn OH_Drawing_PathSetPath(
4518 path: *mut OH_Drawing_Path,
4519 other: *mut OH_Drawing_Path,
4520 ) -> OH_Drawing_ErrorCode;
4521}
4522extern "C" {
4523 #[doc = " @brief Checks whether a path object is empty.\n\n @param path Pointer to the {@link OH_Drawing_Path} object.\n @param isEmpty Whether the path object is empty. **true** means empty; **false** otherwise. It as an output\n parameter.\n @return Execution result.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if **path** or **isEmpty** is NULL.\n @since 20\n @version 1.0"]
4524 #[cfg(feature = "api-20")]
4525 pub fn OH_Drawing_PathIsEmpty(
4526 path: *mut OH_Drawing_Path,
4527 isEmpty: *mut bool,
4528 ) -> OH_Drawing_ErrorCode;
4529}
4530extern "C" {
4531 #[doc = " @brief Checks whether a path object forms a rectangle.\n\n @param path Pointer to the {@link OH_Drawing_Path} object.\n @param rect Pointer to the {@link OH_Drawing_Rect} object, which is used as an output parameter and can be null.\n @param isRect Whether a path forms a rectangle. **true** means yes; **false** otherwise. It as an output parameter.\n @return Execution result.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if **path** or **isRect** is NULL.\n @since 20\n @version 1.0"]
4532 #[cfg(feature = "api-20")]
4533 pub fn OH_Drawing_PathIsRect(
4534 path: *mut OH_Drawing_Path,
4535 rect: *mut OH_Drawing_Rect,
4536 isRect: *mut bool,
4537 ) -> OH_Drawing_ErrorCode;
4538}
4539extern "C" {
4540 #[doc = " @brief Sets the start point of this path.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param path Pointer to an **OH_Drawing_Path** object.\n @param x X coordinate of the start point.\n @param y Y coordinate of the start point.\n @since 8\n @version 1.0"]
4541 pub fn OH_Drawing_PathMoveTo(path: *mut OH_Drawing_Path, x: f32, y: f32);
4542}
4543extern "C" {
4544 #[doc = " @brief Draws a line segment from the last point of this path to the target point. If the path is empty, the start\n point (0, 0) is used.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param path Pointer to an **OH_Drawing_Path** object.\n @param x X coordinate of the target point.\n @param y Y coordinate of the target point.\n @since 8\n @version 1.0"]
4545 pub fn OH_Drawing_PathLineTo(path: *mut OH_Drawing_Path, x: f32, y: f32);
4546}
4547extern "C" {
4548 #[doc = " @brief Draws an arc to a path. This is done by using angle arc mode. In this mode, a rectangle is specified first,\n and then a start angle and scanning degree are specified. The inscribed ellipse of the rectangle will be used to\n intercept the arc.\n The arc is a portion of the ellipse defined by the start angle and the sweep angle. If the path is empty, a line\n segment from the last point of the path to the start point of the arc is also added.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param path Pointer to an **OH_Drawing_Path** object.\n @param x1 X coordinate of the upper left corner of the rectangle.\n @param y1 Y coordinate of the upper left corner of the rectangle.\n @param x2 X coordinate of the lower right corner of the rectangle.\n @param y2 Y coordinate of the lower right corner of the rectangle.\n @param startDeg Start angle. The start direction (0°) of the angle is the positive direction of the X axis.\n @param sweepDeg Angle to sweep, in degrees. A positive number indicates a clockwise sweep, and a negative value\n indicates a counterclockwise swipe. The actual swipe degree is the modulo operation result of the input parameter by\n 360.\n @since 8\n @version 1.0"]
4549 pub fn OH_Drawing_PathArcTo(
4550 path: *mut OH_Drawing_Path,
4551 x1: f32,
4552 y1: f32,
4553 x2: f32,
4554 y2: f32,
4555 startDeg: f32,
4556 sweepDeg: f32,
4557 );
4558}
4559extern "C" {
4560 #[doc = " @brief Draws a quadratic Bezier curve from the last point of a path to the target point. If the path is empty, the\n start point (0, 0) is used.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param path Pointer to an **OH_Drawing_Path** object.\n @param ctrlX X coordinate of the control point.\n @param ctrlY Y coordinate of the control point.\n @param endX X coordinate of the target point.\n @param endY Y coordinate of the target point.\n @since 8\n @version 1.0"]
4561 pub fn OH_Drawing_PathQuadTo(
4562 path: *mut OH_Drawing_Path,
4563 ctrlX: f32,
4564 ctrlY: f32,
4565 endX: f32,
4566 endY: f32,
4567 );
4568}
4569extern "C" {
4570 #[doc = " @brief Draws a conic curve from the last point of a path to the target point. If the path is empty, the start point (\n 0, 0) is used.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param path Pointer to the {@link OH_Drawing_Path} object.\n @param ctrlX X coordinate of the control point.\n @param ctrlY Y coordinate of the control point.\n @param endX X coordinate of the target point.\n @param endY Y coordinate of the target point.\n @param weight Weight of the curve, which determines its shape. The larger the value, the closer of the curve to the\n control point.\n If the value is less than or equal to **0**, the result is equivalent to a line segment from the start point to the\n end point, which is added by calling {@link OH_Drawing_PathLineTo}.\n If the value is **1**, the result is equivalent to {@link OH_Drawing_PathQuadTo}.\n @since 12\n @version 1.0"]
4571 pub fn OH_Drawing_PathConicTo(
4572 path: *mut OH_Drawing_Path,
4573 ctrlX: f32,
4574 ctrlY: f32,
4575 endX: f32,
4576 endY: f32,
4577 weight: f32,
4578 );
4579}
4580extern "C" {
4581 #[doc = " @brief Draws a cubic Bezier curve from the last point of this path to the target point. If the path is empty, the\n start point (0, 0) is used.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param path Pointer to an **OH_Drawing_Path** object.\n @param ctrlX1 X coordinate of the first control point.\n @param ctrlY1 Y coordinate of the first control point.\n @param ctrlX2 X coordinate of the second control point.\n @param ctrlY2 Y coordinate of the second control point.\n @param endX X coordinate of the target point.\n @param endY Y coordinate of the target point.\n @since 8\n @version 1.0"]
4582 pub fn OH_Drawing_PathCubicTo(
4583 path: *mut OH_Drawing_Path,
4584 ctrlX1: f32,
4585 ctrlY1: f32,
4586 ctrlX2: f32,
4587 ctrlY2: f32,
4588 endX: f32,
4589 endY: f32,
4590 );
4591}
4592extern "C" {
4593 #[doc = " @brief Sets the start position relative to the last point of a path. If the path is empty, the start point (0, 0) is\n used.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param path Pointer to the {@link OH_Drawing_Path} object.\n @param x X-axis offset relative to the end point of a path. A positive number indicates an offset in the positive\n direction of the X axis, and a negative number indicates an offset in the negative direction of the X axis.\n @param y Y-axis offset relative to the end point of a path. A positive number indicates an offset in the positive\n direction of the Y axis, and a negative number indicates an offset in the negative direction of the Y axis.\n @since 12\n @version 1.0"]
4594 pub fn OH_Drawing_PathRMoveTo(path: *mut OH_Drawing_Path, x: f32, y: f32);
4595}
4596extern "C" {
4597 #[doc = " @brief Draws a line segment from the last point of this path to a point relative to the last point. If the path is\n empty, the start point (0, 0) is used.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param path Pointer to the {@link OH_Drawing_Path} object.\n @param x X offset relative to the last point, which is used to specify the X coordinate of the target point.\n @param y Y offset relative to the last point, which is used to specify the X coordinate of the target point.\n @since 12\n @version 1.0"]
4598 pub fn OH_Drawing_PathRLineTo(path: *mut OH_Drawing_Path, x: f32, y: f32);
4599}
4600extern "C" {
4601 #[doc = " @brief Draws a quadratic Bezier curve from the last point of this path to a point relative to the last point. If the\n path is empty, the start point (0, 0) is used.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param path Pointer to the {@link OH_Drawing_Path} object.\n @param ctrlX X offset relative to the last point, which is used to specify the X coordinate of the control point.\n @param ctrlY Y offset relative to the last point, which is used to specify the Y coordinate of the control point.\n @param endX X offset relative to the last point, which is used to specify the X coordinate of the target point.\n @param endY Y offset relative to the last point, which is used to specify the Y coordinate of the target point.\n @since 12\n @version 1.0"]
4602 pub fn OH_Drawing_PathRQuadTo(
4603 path: *mut OH_Drawing_Path,
4604 ctrlX: f32,
4605 ctrlY: f32,
4606 endX: f32,
4607 endY: f32,
4608 );
4609}
4610extern "C" {
4611 #[doc = " @brief Draws a conic curve from the last point of a path to a point relative to the last point. If the path is empty,\n the start point (0, 0) is used.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param path Pointer to the {@link OH_Drawing_Path} object.\n @param ctrlX X offset relative to the last point, which is used to specify the X coordinate of the control point.\n @param ctrlY Y offset relative to the last point, which is used to specify the Y coordinate of the control point.\n @param endX X offset relative to the last point, which is used to specify the X coordinate of the target point.\n @param endY Y offset relative to the last point, which is used to specify the Y coordinate of the target point.\n @param weight Weight of the curve, which determines its shape. The larger the value, the closer of the curve to the\n control point.\n If the value is less than or equal to **0**, the result is equivalent to a line segment from the start point to the\n end point, which is added by calling {@link OH_Drawing_PathRLineTo}.\n If the value is **1**, the result is equivalent to {@link OH_Drawing_PathRQuadTo}.\n @since 12\n @version 1.0"]
4612 pub fn OH_Drawing_PathRConicTo(
4613 path: *mut OH_Drawing_Path,
4614 ctrlX: f32,
4615 ctrlY: f32,
4616 endX: f32,
4617 endY: f32,
4618 weight: f32,
4619 );
4620}
4621extern "C" {
4622 #[doc = " @brief Draws a cubic Bezier curve from the last point of a path to a point relative to the last point. If the path\n is empty, the start point (0, 0) is used.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param path Pointer to the {@link OH_Drawing_Path} object.\n @param ctrlX1 X offset relative to the last point, which is used to specify the X coordinate of the first control\n point.\n @param ctrlY1 Y offset relative to the last point, which is used to specify the Y coordinate of the first control\n point.\n @param ctrlX2 X offset relative to the last point, which is used to specify the X coordinate of the second control\n point.\n @param ctrlY2 Y offset relative to the last point, which is used to specify the Y coordinate of the second control\n point.\n @param endX X offset relative to the last point, which is used to specify the X coordinate of the target point.\n @param endY Y offset relative to the last point, which is used to specify the Y coordinate of the target point.\n @since 12\n @version 1.0"]
4623 pub fn OH_Drawing_PathRCubicTo(
4624 path: *mut OH_Drawing_Path,
4625 ctrlX1: f32,
4626 ctrlY1: f32,
4627 ctrlX2: f32,
4628 ctrlY2: f32,
4629 endX: f32,
4630 endY: f32,
4631 );
4632}
4633extern "C" {
4634 #[doc = " @brief Adds a rectangle to a path in the specified direction. The start point is the upper left corner of the\n rectangle.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n If **pathDirection** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is\n returned.\n\n @param path Pointer to the {@link OH_Drawing_Path} object.\n @param left X coordinate of the upper left corner of the rectangle.\n @param top Y coordinate of the upper left corner of the rectangle.\n @param right X coordinate of the lower right corner of the rectangle.\n @param bottom Y coordinate of the lower right corner of the rectangle.\n @param pathDirection {@link OH_Drawing_PathDirection} object.\n @since 12\n @version 1.0"]
4635 pub fn OH_Drawing_PathAddRect(
4636 path: *mut OH_Drawing_Path,
4637 left: f32,
4638 top: f32,
4639 right: f32,
4640 bottom: f32,
4641 pathDirection: OH_Drawing_PathDirection,
4642 );
4643}
4644extern "C" {
4645 #[doc = " @brief Adds a rectangle contour to a path in the specified direction.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **path** or **rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n If **pathDirection** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is\n returned.\n\n @param path Pointer to the {@link OH_Drawing_Path} object.\n @param rect Pointer to the {@link OH_Drawing_Rect} object.\n @param pathDirection Indicates the path direction.\n @param start Start point, indicating the corner of the rectangle from which the path is drawn. The value **0** means\n the upper left corner, **1** means the upper right corner, **2** means the lower right corner, and **3** means the\n lower left corner.\n @since 12\n @version 1.0"]
4646 pub fn OH_Drawing_PathAddRectWithInitialCorner(
4647 path: *mut OH_Drawing_Path,
4648 rect: *const OH_Drawing_Rect,
4649 pathDirection: OH_Drawing_PathDirection,
4650 start: u32,
4651 );
4652}
4653extern "C" {
4654 #[doc = " @brief Adds a rounded rectangle to a path in the specified direction. When the path direction is clockwise, the\n start point is at the intersection of the rounded rectangle's left boundary and its lower left corner. When the path\n direction is counterclockwise, the start point is at the intersection point between the left boundary and the upper\n left corner.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **path** or **roundRect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n If **pathDirection** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is\n returned.\n\n @param path Pointer to the {@link OH_Drawing_Path} object.\n @param roundRect Pointer to the {@link OH_Drawing_RoundRect} object.\n @param pathDirection {@link OH_Drawing_PathDirection} object.\n @since 12\n @version 1.0"]
4655 pub fn OH_Drawing_PathAddRoundRect(
4656 path: *mut OH_Drawing_Path,
4657 roundRect: *const OH_Drawing_RoundRect,
4658 pathDirection: OH_Drawing_PathDirection,
4659 );
4660}
4661extern "C" {
4662 #[doc = " @brief Adds an oval to a path. **OH_Drawing_Rect** specifies the outer tangent rectangle of the oval, and **\n OH_Drawing_PathDirection** specifies whether the drawing is clockwise or counterclockwise.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **path** or **rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n If **pathDirection** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is\n returned.\n\n @param path Pointer to the {@link OH_Drawing_Path} object.\n @param rect Pointer to the {@link OH_Drawing_Rect} object.\n @param start Start point of the oval.\n @param pathDirection {@link OH_Drawing_PathDirection} object.\n @since 12\n @version 1.0"]
4663 pub fn OH_Drawing_PathAddOvalWithInitialPoint(
4664 path: *mut OH_Drawing_Path,
4665 rect: *const OH_Drawing_Rect,
4666 start: u32,
4667 pathDirection: OH_Drawing_PathDirection,
4668 );
4669}
4670extern "C" {
4671 #[doc = " @brief Adds an oval to a path in the specified direction.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **path** or **rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n If **pathDirection** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is\n returned.\n\n @param path Pointer to the {@link OH_Drawing_Path} object.\n @param rect Pointer to the {@link OH_Drawing_Rect} object.\n @param pathDirection {@link OH_Drawing_PathDirection} object.\n @since 12\n @version 1.0"]
4672 pub fn OH_Drawing_PathAddOval(
4673 path: *mut OH_Drawing_Path,
4674 rect: *const OH_Drawing_Rect,
4675 pathDirection: OH_Drawing_PathDirection,
4676 );
4677}
4678extern "C" {
4679 #[doc = " @brief Adds an arc to a path as the start of a new contour. The arc added is part of the inscribed ellipse of the\n rectangle, from the start angle through the sweep angle. If the sweep angle is less than or equal to -360°, or if\n the sweep angle is greater than or equal to 360°, and start angle modulo 90 is nearly zero, an oval instead of an\n ellipse is added.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **path** or **rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param path Pointer to the {@link OH_Drawing_Path} object.\n @param rect Pointer to the {@link OH_Drawing_Rect} object.\n @param startAngle Start angle of the arc, in degrees.\n @param sweepAngle Angle to sweep, in degrees. A positive number indicates a clockwise sweep, and a negative value\n indicates a counterclockwise swipe. The actual swipe degree is the modulo operation result of the input parameter by\n 360.\n @since 12\n @version 1.0"]
4680 pub fn OH_Drawing_PathAddArc(
4681 path: *mut OH_Drawing_Path,
4682 rect: *const OH_Drawing_Rect,
4683 startAngle: f32,
4684 sweepAngle: f32,
4685 );
4686}
4687extern "C" {
4688 #[doc = " @brief Transforms the points in a **src** path by a matrix and adds the new one to the current path.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **path** or **src** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param path Pointer to the existing {@link OH_Drawing_Path} object.\n @param src Pointer to the source {@link OH_Drawing_Path} object.\n @param matrix Pointer to the {@link OH_Drawing_Matrix} object. A null pointer means an identity matrix.\n @since 12\n @version 1.0"]
4689 pub fn OH_Drawing_PathAddPath(
4690 path: *mut OH_Drawing_Path,
4691 src: *const OH_Drawing_Path,
4692 matrix: *const OH_Drawing_Matrix,
4693 );
4694}
4695extern "C" {
4696 #[doc = " @brief Transforms the points in a **src** path by a matrix and adds the new one to the current path with the\n specified adding mode.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **path** or **src** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n If **pathAddMode** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is\n returned.\n\n @param path Pointer to the existing {@link OH_Drawing_Path} object.\n @param src Pointer to the source {@link OH_Drawing_Path} object.\n @param matrix Pointer to the {@link OH_Drawing_Matrix} object. A null pointer means an identity matrix.\n @param pathAddMode {@link OH_Drawing_PathAddMode} object.\n @since 12\n @version 1.0"]
4697 pub fn OH_Drawing_PathAddPathWithMatrixAndMode(
4698 path: *mut OH_Drawing_Path,
4699 src: *const OH_Drawing_Path,
4700 matrix: *const OH_Drawing_Matrix,
4701 pathAddMode: OH_Drawing_PathAddMode,
4702 );
4703}
4704extern "C" {
4705 #[doc = " @brief Adds a **src** path to the current path with the specified adding mode.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **path** or **src** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n If **pathAddMode** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is\n returned.\n\n @param path Pointer to the existing {@link OH_Drawing_Path} object.\n @param src Pointer to the source {@link OH_Drawing_Path} object.\n @param pathAddMode {@link OH_Drawing_PathAddMode} object.\n @since 12\n @version 1.0"]
4706 pub fn OH_Drawing_PathAddPathWithMode(
4707 path: *mut OH_Drawing_Path,
4708 src: *const OH_Drawing_Path,
4709 pathAddMode: OH_Drawing_PathAddMode,
4710 );
4711}
4712extern "C" {
4713 #[doc = " @brief Translates a **src** path by an offset and adds the new one to the current path with the specified adding\n mode.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **path** or **src** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n If **pathAddMode** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is\n returned.\n\n @param path Pointer to the existing {@link OH_Drawing_Path} object.\n @param src Pointer to the source {@link OH_Drawing_Path} object.\n @param dx X offset.\n @param dy Y offset.\n @param pathAddMode {@link OH_Drawing_PathAddMode} object.\n @since 12\n @version 1.0"]
4714 pub fn OH_Drawing_PathAddPathWithOffsetAndMode(
4715 path: *mut OH_Drawing_Path,
4716 src: *const OH_Drawing_Path,
4717 dx: f32,
4718 dy: f32,
4719 pathAddMode: OH_Drawing_PathAddMode,
4720 );
4721}
4722extern "C" {
4723 #[doc = " @brief Adds a polygon to a path.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **path** or **points** is NULL or **count** is **0**, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param path Pointer to the existing {@link OH_Drawing_Path} object.\n @param points Pointer to an array that holds the vertex coordinates of the polygon.\n @param count Size of the array.\n @param isClosed Whether the path is closed. The value **true** means that the path is closed, and **false** means\n the opposite.\n @since 12\n @version 1.0"]
4724 pub fn OH_Drawing_PathAddPolygon(
4725 path: *mut OH_Drawing_Path,
4726 points: *const OH_Drawing_Point2D,
4727 count: u32,
4728 isClosed: bool,
4729 );
4730}
4731extern "C" {
4732 #[doc = " @brief Adds a circle to a path in the specified direction.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n If **radius** is less than or equal to 0, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.\n If **pathDirection** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is\n returned.\n\n @param path Pointer to the {@link OH_Drawing_Path} object.\n @param x X coordinate of the circle center.\n @param y Y coordinate of the circle center.\n @param radius Radius of the circle.\n @param pathDirection {@link OH_Drawing_PathDirection} object.\n @since 12\n @version 1.0"]
4733 pub fn OH_Drawing_PathAddCircle(
4734 path: *mut OH_Drawing_Path,
4735 x: f32,
4736 y: f32,
4737 radius: f32,
4738 pathDirection: OH_Drawing_PathDirection,
4739 );
4740}
4741extern "C" {
4742 #[doc = " @brief Parses the path represented by an SVG string.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **path** or **str** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param path Pointer to the {@link OH_Drawing_Path} object.\n @param str Pointer to the SVG string.\n @return Returns whether the SVG string is successfully parsed. **true** means successful; **false** otherwise.\n @since 12\n @version 1.0"]
4743 pub fn OH_Drawing_PathBuildFromSvgString(
4744 path: *mut OH_Drawing_Path,
4745 str_: *const ::std::os::raw::c_char,
4746 ) -> bool;
4747}
4748extern "C" {
4749 #[doc = " @brief Convert path to an SVG string.\n\n @param path Indicates the pointer to an <b>OH_Drawing_Path</b> object.\n @param str Indicates the SVG string. API users are responsible for allocating and freeing memory.\n @param strSize Indicates the SVG string memory size in bytes.\n @return Returns the error code.\n Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.\n Returns {@link OH_DRAWING_ERROR_INCORRECT_PARAMETER} if path or strSize is nullptr.\n @since 26.0.0"]
4750 #[cfg(feature = "api-26")]
4751 pub fn OH_Drawing_PathConvertToSvgString(
4752 path: *const OH_Drawing_Path,
4753 str_: *mut ::std::os::raw::c_char,
4754 strSize: *mut usize,
4755 ) -> OH_Drawing_ErrorCode;
4756}
4757extern "C" {
4758 #[doc = " @brief Get path point data.\n\n @param path Indicates the pointer to an <b>OH_Drawing_Path</b> object.\n @param points Indicates the path point array.\n @param count Indicates the size of point array.\n @return Returns the error code.\n Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.\n Returns {@link OH_DRAWING_ERROR_INCORRECT_PARAMETER} if path or count is nullptr.\n @since 26.0.0"]
4759 #[cfg(feature = "api-26")]
4760 pub fn OH_Drawing_PathGetPointData(
4761 path: *const OH_Drawing_Path,
4762 points: *mut OH_Drawing_Point2D,
4763 count: *mut u32,
4764 ) -> OH_Drawing_ErrorCode;
4765}
4766extern "C" {
4767 #[doc = " @brief Get path verb data.\n\n @param path Indicates the pointer to an <b>OH_Drawing_Path</b> object.\n @param verbs Indicates the path verb array.\n @param count Indicates the size of verb array.\n @return Returns the error code.\n Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.\n Returns {@link OH_DRAWING_ERROR_INCORRECT_PARAMETER} if path or count is nullptr.\n @since 26.0.0"]
4768 #[cfg(feature = "api-26")]
4769 pub fn OH_Drawing_PathGetVerbData(
4770 path: *const OH_Drawing_Path,
4771 verbs: *mut OH_Drawing_PathIteratorVerb,
4772 count: *mut u32,
4773 ) -> OH_Drawing_ErrorCode;
4774}
4775extern "C" {
4776 #[doc = " @brief Get path conic weight data.\n\n @param path Indicates the pointer to an <b>OH_Drawing_Path</b> object.\n @param conicWeights Indicates the path conic weight array.\n @param count Indicates the size of conic weight array.\n @return Returns the error code.\n Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.\n Returns {@link OH_DRAWING_ERROR_INCORRECT_PARAMETER} if path or count is nullptr.\n @since 26.0.0"]
4777 #[cfg(feature = "api-26")]
4778 pub fn OH_Drawing_PathGetConicWeightData(
4779 path: *const OH_Drawing_Path,
4780 conicWeights: *mut f32,
4781 count: *mut u32,
4782 ) -> OH_Drawing_ErrorCode;
4783}
4784extern "C" {
4785 #[doc = " @brief Checks whether a coordinate point is included in this path. For details, see {@link OH_Drawing_PathFillType}.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param path Pointer to the {@link OH_Drawing_Path} object.\n @param x Coordinate point on the X axis.\n @param y Coordinate point on the Y axis.\n @return Returns **true** if the coordinate point is included in the path; returns **false** otherwise.\n @since 12\n @version 1.0"]
4786 pub fn OH_Drawing_PathContains(path: *mut OH_Drawing_Path, x: f32, y: f32) -> bool;
4787}
4788extern "C" {
4789 #[doc = " @brief Transforms the points in a path by matrix.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **path** or **matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param path Pointer to the {@link OH_Drawing_Path} object.\n @param matrix Pointer to the {@link OH_Drawing_Matrix} object.\n @since 12\n @version 1.0"]
4790 pub fn OH_Drawing_PathTransform(path: *mut OH_Drawing_Path, matrix: *const OH_Drawing_Matrix);
4791}
4792extern "C" {
4793 #[doc = " @brief Transforms the points in a path by matrix, and uses the new one to replace the **dst** path. If **dst** is\n NULL, the **src** path is replaced.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **src** or **matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param src Pointer to the {@link OH_Drawing_Path} object.\n @param matrix Pointer to the {@link OH_Drawing_Matrix} object.\n @param dst Pointer to the target {@link OH_Drawing_Path} object.\n @param applyPerspectiveClip Whether to apply perspective cropping to the new path. The value **true** means to apply\n perspective cropping, and **false** means the opposite.\n @since 12\n @version 1.0"]
4794 pub fn OH_Drawing_PathTransformWithPerspectiveClip(
4795 src: *mut OH_Drawing_Path,
4796 matrix: *const OH_Drawing_Matrix,
4797 dst: *mut OH_Drawing_Path,
4798 applyPerspectiveClip: bool,
4799 );
4800}
4801extern "C" {
4802 #[doc = " @brief Sets the fill type of a path. The fill type determines how \"inside\" of the path is drawn.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n If **pathFillType** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is\n returned.\n\n @param path Pointer to the {@link OH_Drawing_Path} object.\n @param pathFillType {@link OH_Drawing_PathFillType} object.\n @since 12\n @version 1.0"]
4803 pub fn OH_Drawing_PathSetFillType(
4804 path: *mut OH_Drawing_Path,
4805 pathFillType: OH_Drawing_PathFillType,
4806 );
4807}
4808extern "C" {
4809 #[doc = " @brief Obtains the fill type of a path.\n\n @param path Pointer to the {@link OH_Drawing_Path} object.\n @param pathFillType Pointer to the {@link OH_Drawing_PathFillType} object.\n @return Execution result.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if **path** or **pathFillType** is NULL.\n @since 20\n @version 1.0"]
4810 #[cfg(feature = "api-20")]
4811 pub fn OH_Drawing_PathGetFillType(
4812 path: *mut OH_Drawing_Path,
4813 pathFillType: *mut OH_Drawing_PathFillType,
4814 ) -> OH_Drawing_ErrorCode;
4815}
4816extern "C" {
4817 #[doc = " @brief Obtains the length of a path.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param path Pointer to the {@link OH_Drawing_Path} object.\n @param forceClosed Whether the path is measured as a closed path. **true** means that the path is forcibly\n considered as a closed path; **false** means that the path is measured depending on whether it is a closed path.\n @return Returns the length of the path.\n @since 12\n @version 1.0"]
4818 pub fn OH_Drawing_PathGetLength(path: *mut OH_Drawing_Path, forceClosed: bool) -> f32;
4819}
4820extern "C" {
4821 #[doc = " @brief Obtains the minimum bounds that enclose a path.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **path** or **rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param path Pointer to the {@link OH_Drawing_Path} object.\n @param rect Pointer to the {@link OH_Drawing_Rect} object.\n @since 12\n @version 1.0"]
4822 pub fn OH_Drawing_PathGetBounds(path: *mut OH_Drawing_Path, rect: *mut OH_Drawing_Rect);
4823}
4824extern "C" {
4825 #[doc = " @brief Draws a line segment from the current point to the start point of this path.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param path Pointer to the {@link OH_Drawing_Path} object.\n @since 8\n @version 1.0"]
4826 pub fn OH_Drawing_PathClose(path: *mut OH_Drawing_Path);
4827}
4828extern "C" {
4829 #[doc = " @brief Translates a path by an offset along the X axis and Y axis and adds the new one to the **dst** path.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param path Pointer to the existing {@link OH_Drawing_Path} object.\n @param dst Pointer to a destination path, which is an {@link OH_Drawing_Path} object. If NULL is passed in, the\n result is stored in the current path.\n @param dx X offset.\n @param dy Y offset.\n @since 12\n @version 1.0"]
4830 pub fn OH_Drawing_PathOffset(
4831 path: *mut OH_Drawing_Path,
4832 dst: *mut OH_Drawing_Path,
4833 dx: f32,
4834 dy: f32,
4835 );
4836}
4837extern "C" {
4838 #[doc = " @brief Resets the path data.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param path Pointer to an **OH_Drawing_Path** object.\n @since 8\n @version 1.0"]
4839 pub fn OH_Drawing_PathReset(path: *mut OH_Drawing_Path);
4840}
4841extern "C" {
4842 #[doc = " @brief Checks whether a path is closed.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param path Pointer to the {@link OH_Drawing_Path} object.\n @param forceClosed Whether the path is measured as a closed path. The value **true** means that the path is\n considered closed during measurement, and **false** means that the path is measured based on the actual closed\n status.\n @return Returns **true** if the path is closed; returns **false** otherwise.\n @since 12\n @version 1.0"]
4843 pub fn OH_Drawing_PathIsClosed(path: *mut OH_Drawing_Path, forceClosed: bool) -> bool;
4844}
4845extern "C" {
4846 #[doc = " @brief Obtains the coordinates and tangent at a distance from the start point of this path.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If any of **path**, **position**, or **tangent** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param path Pointer to the {@link OH_Drawing_Path} object.\n @param forceClosed Whether the path is measured as a closed path. The value **true** means that the path is\n considered closed during measurement, and **false** means that the path is measured based on the actual closed\n status.\n @param distance Distance from the start point. If the distance is less than 0, it is considered as 0. If the\n distance is greater than the path length, it is considered as the path length.\n @param position Pointer to the coordinates.\n @param tangent Pointer to the tangent, where **tangent.x** and **tangent.y** represent the cosine and sine of the\n tangent of the point, respectively.\n @return Returns whether the measurement is successful. **true** means successful; **false** otherwise.\n @since 12\n @version 1.0"]
4847 pub fn OH_Drawing_PathGetPositionTangent(
4848 path: *mut OH_Drawing_Path,
4849 forceClosed: bool,
4850 distance: f32,
4851 position: *mut OH_Drawing_Point2D,
4852 tangent: *mut OH_Drawing_Point2D,
4853 ) -> bool;
4854}
4855extern "C" {
4856 #[doc = " @brief Extracts a segment of a path and appends it to a destination path.\n\n @param path Pointer to the {@link OH_Drawing_Path} object.\n @param forceClosed Whether the path is measured as a closed path. The value **true** means that the path is\n considered closed during measurement, and **false** means that the path is measured based on the actual closed\n status.\n @param start Distance from the start point of the path to the start point of the segment. If it is less than 0, it\n defaults to 0. If it is greater than or equal to **stop**, the extraction fails.\n @param stop Distance from the start point of the path to the end point of the segment. If it is less than or equal\n to **start**, the extraction fails. If it is greater than the path length, it defaults to the path length.\n @param startWithMoveTo Whether to execute {@link OH_Drawing_PathMoveTo} in the destination path to move to its start\n point. The value **true** means to move to the start point, and **false** means the opposite.\n @param dst Pointer to a destination path, which is an {@link OH_Drawing_Path} object. If the extraction succeeds,\n the segment is appended to the path. If the extraction fails, nothing changes.\n @param result Pointer to the extraction result. The value **true** means that the extraction is successful, and **\n false** means the opposite. It as an output parameter.\n @return Returns one of the following result codes:\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if at least one of the **path**, **dst**, and **result** parameters is a null\n pointer.\n @since 18\n @version 1.0"]
4857 #[cfg(feature = "api-18")]
4858 pub fn OH_Drawing_PathGetSegment(
4859 path: *mut OH_Drawing_Path,
4860 forceClosed: bool,
4861 start: f32,
4862 stop: f32,
4863 startWithMoveTo: bool,
4864 dst: *mut OH_Drawing_Path,
4865 result: *mut bool,
4866 ) -> OH_Drawing_ErrorCode;
4867}
4868extern "C" {
4869 #[doc = " @brief Combines two paths based on the specified operation mode.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **path** or **srcPath** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n If **op** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.\n\n @param path Pointer to an {@link OH_Drawing_Path} object, in which the resulting path is saved.\n @param other Pointer to the {@link OH_Drawing_Path} object.\n @param op Operation mode of the path. For details about the available options, see {@link OH_Drawing_PathOpMode}.\n @return Returns **true** if the resulting path is not empty; returns **false** otherwise.\n @since 12\n @version 1.0"]
4870 pub fn OH_Drawing_PathOp(
4871 path: *mut OH_Drawing_Path,
4872 other: *const OH_Drawing_Path,
4873 op: OH_Drawing_PathOpMode,
4874 ) -> bool;
4875}
4876extern "C" {
4877 #[doc = " @brief Obtains a transformation matrix at a distance from the start point of this path.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **path** or **matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n If **flag** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.\n\n @param path Pointer to the {@link OH_Drawing_Path} object.\n @param forceClosed Whether the path is measured as a closed path. The value **true** means that the path is\n considered closed during measurement, and **false** means that the path is measured based on the actual closed\n status.\n @param distance Distance from the start point. If the distance is less than 0, it is considered as 0. If the\n distance is greater than the path length, it is considered as the path length.\n @param matrix Pointer to the transformation matrix.\n @param flag Type of the matrix information. For details about the available options, see\n {@link OH_Drawing_PathMeasureMatrixFlags}\n .\n @return Returns **true** if the transformation matrix is obtained successfully; returns **false** otherwise. The\n possible failure cause is that **path** is NULL or the path length is 0.\n @since 12\n @version 1.0"]
4878 pub fn OH_Drawing_PathGetMatrix(
4879 path: *mut OH_Drawing_Path,
4880 forceClosed: bool,
4881 distance: f32,
4882 matrix: *mut OH_Drawing_Matrix,
4883 flag: OH_Drawing_PathMeasureMatrixFlags,
4884 ) -> bool;
4885}
4886extern "C" {
4887 #[doc = " @brief Converts the existing path into an approximate path consisting of consecutive line segments.\n\n @param path Pointer to the {@link OH_Drawing_Path} object.\n @param acceptableError Acceptable error of each line segment on the path. The value cannot be less than 0.\n 1. Avoid setting **acceptableError** to **0** as it heavily divides the curve path, significantly impacting\n performance and memory usage.\n 2. Setting a high **acceptableError** simplifies the path greatly by keeping only essential points, potentially\n distorting the original shape.\n 3. When you set a high **acceptableError** for curves such as ellipses, the fitting process often simplifies them to\n polygons by keeping just the start and end points of their Bezier curve segments.\n @param vals An array of approximate points of the path.\n Each point consists of three values, indicating:\n 1. Length ratio of the point to the start point of the path.\n 2. X coordinate of the point.\n 3. Y coordinate of the point.\n @param count Size of the returned array, which is at least 6. The size of the point array after fitting is returned\n if **vals** is a null pointer.\n @return Execution result.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if **path** or **count** is a null pointer.\n **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** if **acceptableError** is less than 0.\n @since 20\n @version 1.0"]
4888 #[cfg(feature = "api-20")]
4889 pub fn OH_Drawing_PathApproximate(
4890 path: *mut OH_Drawing_Path,
4891 acceptableError: f32,
4892 vals: *mut f32,
4893 count: *mut u32,
4894 ) -> OH_Drawing_ErrorCode;
4895}
4896extern "C" {
4897 #[doc = " @brief Interpolates between the existing path and another path based on the given weight and stores the result in\n the target path object.\n Interpolation is achievable if the two paths have the same number of points. The target path is created based on the\n structure of the existing path.\n\n @param path Pointer to the {@link OH_Drawing_Path} object.\n @param other Pointer to the {@link OH_Drawing_Path} object of the other path used for interpolation.\n @param weight Interpolation weight. The value range is [0, 1].\n @param success Whether the interpolation is successful. **true** means yes; **false** otherwise. It as an output\n parameter.\n @param interpolatedPath Pointer to the {@link OH_Drawing_Path} object used to store the interpolation result.\n @return Execution result.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if **path**, **other**, **success**, or **interpolatedPath** is a null\n pointer.\n **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** if **weight** is not in the range of [0, 1].\n @since 20\n @version 1.0"]
4898 #[cfg(feature = "api-20")]
4899 pub fn OH_Drawing_PathInterpolate(
4900 path: *mut OH_Drawing_Path,
4901 other: *mut OH_Drawing_Path,
4902 weight: f32,
4903 success: *mut bool,
4904 interpolatedPath: *mut OH_Drawing_Path,
4905 ) -> OH_Drawing_ErrorCode;
4906}
4907extern "C" {
4908 #[doc = " @brief Checks whether the existing path and another path (**other**) are compatible for interpolation in terms of\n structure and operation sequence.\n If the paths contain conic operations, the weight values of the operations must be the same.\n\n @param path Pointer to the {@link OH_Drawing_Path} object.\n @param other Pointer to the {@link OH_Drawing_Path} object.\n @param result Checks whether a path is compatible with another path. It is used as an output parameter.\n **true** if the paths are compatible, **false** otherwise.\n @return Execution result.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if **path**, **other**, or **result** is a null pointer.\n @since 20\n @version 1.0"]
4909 #[cfg(feature = "api-20")]
4910 pub fn OH_Drawing_PathIsInterpolate(
4911 path: *mut OH_Drawing_Path,
4912 other: *mut OH_Drawing_Path,
4913 result: *mut bool,
4914 ) -> OH_Drawing_ErrorCode;
4915}
4916extern "C" {
4917 #[doc = " @brief Gets the last point of the path.\n\n @param path Indicates the pointer to an <b>OH_Drawing_Path</b> object.\n @param point Indicates the pointer to an <b>OH_Drawing_Point2D</b> object to store the last point.\n @return Returns the error code.\n Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.\n Returns {@link OH_DRAWING_ERROR_INCORRECT_PARAMETER} if path or point is nullptr, or the path is empty.\n @since 26.0.0"]
4918 #[cfg(feature = "api-26")]
4919 pub fn OH_Drawing_PathGetLastPoint(
4920 path: *mut OH_Drawing_Path,
4921 point: *mut OH_Drawing_Point2D,
4922 ) -> OH_Drawing_ErrorCode;
4923}
4924extern "C" {
4925 #[doc = " @brief Checks whether the fill type of the path is the inverse type.\n\n @param path Pointer to the {@link OH_Drawing_Path} object.\n @param isInverse Whether the fill type is the inverse type. It is used as an output parameter. **true** if the fill\n type is the inverse type; **false** otherwise.\n @return Execution result.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INCORRECT_PARAMETER** if **path** or **isInverse** is a null pointer.\n @since 23\n @version 1.0"]
4926 #[cfg(feature = "api-23")]
4927 pub fn OH_Drawing_PathIsInverseFillType(
4928 path: *const OH_Drawing_Path,
4929 isInverse: *mut bool,
4930 ) -> OH_Drawing_ErrorCode;
4931}
4932extern "C" {
4933 #[doc = " @brief Toggles the fill type of the path to the inverse type.\n\n @param path Pointer to the {@link OH_Drawing_Path} object.\n @return Execution result.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INCORRECT_PARAMETER** if **path** is a null pointer.\n @since 23\n @version 1.0"]
4934 #[cfg(feature = "api-23")]
4935 pub fn OH_Drawing_PathToggleInverseFillType(path: *mut OH_Drawing_Path)
4936 -> OH_Drawing_ErrorCode;
4937}
4938extern "C" {
4939 #[doc = " @brief Checks if two paths are equal.\n\n @param path Indicates the pointer to an <b>OH_Drawing_Path</b> object.\n @param other Indicates the pointer to another <b>OH_Drawing_Path</b> object to compare.\n @param equal Indicates whether the two paths are equal.\n @return Returns the error code.\n Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.\n Returns {@link OH_DRAWING_ERROR_INCORRECT_PARAMETER} if path or other is nullptr, or equal is nullptr.\n @since 26.0.0"]
4940 #[cfg(feature = "api-26")]
4941 pub fn OH_Drawing_PathIsEqual(
4942 path: *mut OH_Drawing_Path,
4943 other: *mut OH_Drawing_Path,
4944 equal: *mut bool,
4945 ) -> OH_Drawing_ErrorCode;
4946}
4947#[doc = " Translation effect."]
4948#[cfg(feature = "api-18")]
4949pub const OH_Drawing_PathDashStyle_DRAWING_PATH_DASH_STYLE_TRANSLATE: OH_Drawing_PathDashStyle = 0;
4950#[doc = " Rotation effect."]
4951#[cfg(feature = "api-18")]
4952pub const OH_Drawing_PathDashStyle_DRAWING_PATH_DASH_STYLE_ROTATE: OH_Drawing_PathDashStyle = 1;
4953#[doc = " Morphing effect."]
4954#[cfg(feature = "api-18")]
4955pub const OH_Drawing_PathDashStyle_DRAWING_PATH_DASH_STYLE_MORPH: OH_Drawing_PathDashStyle = 2;
4956#[doc = " @brief Enumerates the drawing styles for path effects.\n\n @since 18\n @version 1.0"]
4957#[cfg(feature = "api-18")]
4958pub type OH_Drawing_PathDashStyle = u32;
4959extern "C" {
4960 #[doc = " @brief Creates a path effect by sequentially applying the inner effect and then the outer effect.\n\n @param outer Pointer to an outer effect, which is an {@link OH_Drawing_PathEffect} object.\n @param inner Pointer to an inner effect, which is an {@link OH_Drawing_PathEffect} object.\n @return Returns a pointer to the created {@link OH_Drawing_PathEffect} object.\n If a null pointer is returned, the creation fails. The possible failure cause is that **inner** or **inner** is a\n null pointer.\n @since 18\n @version 1.0"]
4961 #[cfg(feature = "api-18")]
4962 pub fn OH_Drawing_CreateComposePathEffect(
4963 outer: *mut OH_Drawing_PathEffect,
4964 inner: *mut OH_Drawing_PathEffect,
4965 ) -> *mut OH_Drawing_PathEffect;
4966}
4967extern "C" {
4968 #[doc = " @brief Creates a path effect that transforms the sharp angle between line segments into a rounded corner with the\n specified radius.\n\n @param radius Radius of the rounded corner. The value is valid only when it is greater than 0.\n @return Returns a pointer to the created {@link OH_Drawing_PathEffect} object.\n If a null pointer is returned, the creation fails. The possible failure cause is that **radius** is less than or\n equal to **0**.\n @since 18\n @version 1.0"]
4969 #[cfg(feature = "api-18")]
4970 pub fn OH_Drawing_CreateCornerPathEffect(radius: f32) -> *mut OH_Drawing_PathEffect;
4971}
4972extern "C" {
4973 #[doc = " @brief Creates a dashed path effect. The dashed line effect is determined by a group of \"on\" and \"off\" intervals.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **intervals** is NULL or **count** is less than or equal to 0, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param intervals Pointer to the start address of the dashed line interval array. In the array, an even entry\n indicates an \"on\" interval and an odd entry indicates an \"off\" interval. The unit is px.\n @param count Number of entries in the dashed line interval array. The value must be an even number greater than 0.\n @param phase Offset in the dashed line interval array.\n @return Returns a pointer to the created {@link OH_Drawing_PathEffect} object.\n @since 12\n @version 1.0"]
4974 pub fn OH_Drawing_CreateDashPathEffect(
4975 intervals: *mut f32,
4976 count: ::std::os::raw::c_int,
4977 phase: f32,
4978 ) -> *mut OH_Drawing_PathEffect;
4979}
4980extern "C" {
4981 #[doc = " @brief Creates a path effect that segments the path and scatters the segments in an irregular pattern along the path.\n\n @param segLength Distance along the path at which each segment is fragmented. An effect is created when it is\n greater than 0.\n @param deviation Maximum amount by which the end points of the segments can be randomly displaced during rendering.\n @return Returns a pointer to the created {@link OH_Drawing_PathEffect} object.\n @since 18\n @version 1.0"]
4982 #[cfg(feature = "api-18")]
4983 pub fn OH_Drawing_CreateDiscretePathEffect(
4984 segLength: f32,
4985 deviation: f32,
4986 ) -> *mut OH_Drawing_PathEffect;
4987}
4988extern "C" {
4989 #[doc = " @brief Creates a dashed path effect.\n\n @param path Pointer to an {@link OH_Drawing_Path} object.\n @param advance Length of each dashed line segment.\n @param phase Offset of the pattern within the dash segment length.\n @param type Style of the dashed path effect.\n @return Returns a pointer to the created {@link OH_Drawing_PathEffect} object.\n If a null pointer is returned, the creation fails. The possible failure cause is that **path** is a null pointer or *\n *advance** is less than or equal to **0**.\n @since 18\n @version 1.0"]
4990 #[cfg(feature = "api-18")]
4991 pub fn OH_Drawing_CreatePathDashEffect(
4992 path: *const OH_Drawing_Path,
4993 advance: f32,
4994 phase: f32,
4995 type_: OH_Drawing_PathDashStyle,
4996 ) -> *mut OH_Drawing_PathEffect;
4997}
4998extern "C" {
4999 #[doc = " @brief Creates an overlay path effect based on two distinct path effects that take effect separately.\n\n @param firstPathEffect Pointer to an {@link OH_Drawing_PathEffect} object.\n @param secondPathEffect Pointer to an {@link OH_Drawing_PathEffect} object.\n @return Returns a pointer to the created {@link OH_Drawing_PathEffect} object.\n If a null pointer is returned, the creation fails. The possible failure cause is that **firstPathEffect** or **\n secondPathEffect** is a null pointer.\n @since 18\n @version 1.0"]
5000 #[cfg(feature = "api-18")]
5001 pub fn OH_Drawing_CreateSumPathEffect(
5002 firstPathEffect: *mut OH_Drawing_PathEffect,
5003 secondPathEffect: *mut OH_Drawing_PathEffect,
5004 ) -> *mut OH_Drawing_PathEffect;
5005}
5006extern "C" {
5007 #[doc = " @brief Destroys an **OH_Drawing_PathEffect** object and reclaims the memory occupied by the object.\n\n @param pathEffect Pointer to an {@link OH_Drawing_PathEffect} object.\n @since 12\n @version 1.0"]
5008 pub fn OH_Drawing_PathEffectDestroy(pathEffect: *mut OH_Drawing_PathEffect);
5009}
5010extern "C" {
5011 #[doc = " @brief Creates an **OH_Drawing_Pen** object.\n\n @return Returns the pointer to the **OH_Drawing_Pen** object created.\n @since 8\n @version 1.0"]
5012 pub fn OH_Drawing_PenCreate() -> *mut OH_Drawing_Pen;
5013}
5014extern "C" {
5015 #[doc = " @brief Creates a copy of the {@link OH_Drawing_Pen} object.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param pen Pointer to an **OH_Drawing_Pen** object.\n @return Returns the pointer to the {@link OH_Drawing_Pen} object created. If NULL is returned, the creation fails.\n The possible failure cause is that no memory is available or **pen** is NULL.\n @since 12\n @version 1.0"]
5016 pub fn OH_Drawing_PenCopy(pen: *mut OH_Drawing_Pen) -> *mut OH_Drawing_Pen;
5017}
5018extern "C" {
5019 #[doc = " @brief Destroys an **OH_Drawing_Pen** object and reclaims the memory occupied by the object.\n\n @param pen Pointer to an **OH_Drawing_Pen** object.\n @since 8\n @version 1.0"]
5020 pub fn OH_Drawing_PenDestroy(pen: *mut OH_Drawing_Pen);
5021}
5022extern "C" {
5023 #[doc = " @brief Checks whether anti-aliasing is enabled for a pen. Anti-aliasing makes the pixels around the shape edges semi-\n transparent.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param pen Pointer to an **OH_Drawing_Pen** object.\n @return Returns **true** if anti-aliasing is enabled; returns **false** otherwise.\n @since 8\n @version 1.0"]
5024 pub fn OH_Drawing_PenIsAntiAlias(pen: *const OH_Drawing_Pen) -> bool;
5025}
5026extern "C" {
5027 #[doc = " @brief Enables or disables anti-aliasing for a pen. Anti-aliasing makes the pixels around the shape edges semi-\n transparent.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param pen Pointer to an **OH_Drawing_Pen** object.\n @param antiAlias Whether to enable anti-aliasing. The value **true** means to enable anti-aliasing, and **false**\n means the opposite.\n @since 8\n @version 1.0"]
5028 pub fn OH_Drawing_PenSetAntiAlias(pen: *mut OH_Drawing_Pen, antiAlias: bool);
5029}
5030extern "C" {
5031 #[doc = " @brief Obtains the color of a pen. The color is used by the pen to outline a shape.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param pen Pointer to an **OH_Drawing_Pen** object.\n @return Returns a 32-bit (ARGB) variable that describes the color.\n @since 8\n @version 1.0"]
5032 pub fn OH_Drawing_PenGetColor(pen: *const OH_Drawing_Pen) -> u32;
5033}
5034extern "C" {
5035 #[doc = " @brief Sets the color for a pen. The color is used by the pen to outline a shape.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param pen Pointer to an **OH_Drawing_Pen** object.\n @param color Color, which is a 32-bit (ARGB) variable.\n @since 8\n @version 1.0"]
5036 pub fn OH_Drawing_PenSetColor(pen: *mut OH_Drawing_Pen, color: u32);
5037}
5038extern "C" {
5039 #[doc = " @brief Obtains the alpha value of a pen. This value is used by the alpha channel when the pen outlines a shape.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param pen Pointer to an **OH_Drawing_Pen** object.\n @return Returns an 8-bit variable that describes the alpha value.\n @since 11\n @version 1.0"]
5040 pub fn OH_Drawing_PenGetAlpha(pen: *const OH_Drawing_Pen) -> u8;
5041}
5042extern "C" {
5043 #[doc = " @brief Sets the alpha value for a pen. This value is used by the alpha channel when the pen outlines a shape.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param pen Pointer to an **OH_Drawing_Pen** object.\n @param alpha Alpha value, which is an 8-bit variable.\n @since 11\n @version 1.0"]
5044 pub fn OH_Drawing_PenSetAlpha(pen: *mut OH_Drawing_Pen, alpha: u8);
5045}
5046extern "C" {
5047 #[doc = " @brief Sets the color for a pen, which is used to outline a shape.\n The color is in ARGB format represented by floating-point numbers. The color space is specified by\n {@link OH_NativeColorSpaceManager}\n .\n If **colorSpaceManager** is a null pointer, the SRGB (standard red, green, and blue color space based on IEC 61966-2.\n 1:1999) color space is used as the default value.\n\n @param pen Pointer to an {@link OH_Drawing_Pen} object.\n @param a Alpha value of the color, which is a floating-point number ranging from 0.0 to 1.0. Values above 1.0\n default to 1.0, while values below 0.0 default to 0.0.\n @param r Red component of the color, which is a floating-point number ranging from 0.0 to 1.0. Values above 1.0\n default to 1.0, while values below 0.0 default to 0.0.\n @param g Green component of the color, which is a floating-point number ranging from 0.0 to 1.0. Values above 1.0\n default to 1.0, while values below 0.0 default to 0.0.\n @param b Blue component of the color, which is a floating-point number ranging from 0.0 to 1.0. Values above 1.0\n default to 1.0, while values below 0.0 default to 0.0.\n @param colorSpaceManager Pointer to an {@link OH_NativeColorSpaceManager} object.\n @return Execution result.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if **pen** is NULL.\n @since 20\n @version 1.0"]
5048 #[cfg(feature = "api-20")]
5049 pub fn OH_Drawing_PenSetColor4f(
5050 pen: *mut OH_Drawing_Pen,
5051 a: f32,
5052 r: f32,
5053 g: f32,
5054 b: f32,
5055 colorSpaceManager: *mut OH_NativeColorSpaceManager,
5056 ) -> OH_Drawing_ErrorCode;
5057}
5058extern "C" {
5059 #[doc = " @brief Obtains the alpha value of the pen color.\n\n @param pen Pointer to an {@link OH_Drawing_Pen} object.\n @param a Alpha value of the pen color. The value is a floating-point number ranging from 0.0 to 1.0.\n @return Execution result.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if **pen** or **a** is NULL.\n @since 20\n @version 1.0"]
5060 #[cfg(feature = "api-20")]
5061 pub fn OH_Drawing_PenGetAlphaFloat(
5062 pen: *mut OH_Drawing_Pen,
5063 a: *mut f32,
5064 ) -> OH_Drawing_ErrorCode;
5065}
5066extern "C" {
5067 #[doc = " @brief Obtains the red component of the pen color.\n\n @param pen Pointer to an {@link OH_Drawing_Pen} object.\n @param r Red component of the pen color. The value is a floating-point number ranging from 0.0 to 1.0.\n @return Execution result.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if **pen** or **r** is NULL.\n @since 20\n @version 1.0"]
5068 #[cfg(feature = "api-20")]
5069 pub fn OH_Drawing_PenGetRedFloat(pen: *mut OH_Drawing_Pen, r: *mut f32)
5070 -> OH_Drawing_ErrorCode;
5071}
5072extern "C" {
5073 #[doc = " @brief Obtains the green component of the pen color.\n\n @param pen Pointer to an {@link OH_Drawing_Pen} object.\n @param g Green component of the pen color. The value is a floating-point number ranging from 0.0 to 1.0.\n @return Execution result.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if **pen** or **g** is NULL.\n @since 20\n @version 1.0"]
5074 #[cfg(feature = "api-20")]
5075 pub fn OH_Drawing_PenGetGreenFloat(
5076 pen: *mut OH_Drawing_Pen,
5077 g: *mut f32,
5078 ) -> OH_Drawing_ErrorCode;
5079}
5080extern "C" {
5081 #[doc = " @brief Obtains the blue component of the pen color.\n\n @param pen Pointer to an {@link OH_Drawing_Pen} object.\n @param b Blue component of the pen color. The value is a floating-point number ranging from 0.0 to 1.0.\n @return Execution result.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if **pen** or **b** is NULL.\n @since 20\n @version 1.0"]
5082 #[cfg(feature = "api-20")]
5083 pub fn OH_Drawing_PenGetBlueFloat(
5084 pen: *mut OH_Drawing_Pen,
5085 b: *mut f32,
5086 ) -> OH_Drawing_ErrorCode;
5087}
5088extern "C" {
5089 #[doc = " @brief Obtains the thickness of a pen. This thickness determines the width of the outline of a shape.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param pen Pointer to an **OH_Drawing_Pen** object.\n @return Returns the thickness.\n @since 8\n @version 1.0"]
5090 pub fn OH_Drawing_PenGetWidth(pen: *const OH_Drawing_Pen) -> f32;
5091}
5092extern "C" {
5093 #[doc = " @brief Sets the thickness for a pen. This thickness determines the width of the outline of a shape.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param pen Pointer to an **OH_Drawing_Pen** object.\n @param width Thickness, which is a variable.\n @since 8\n @version 1.0"]
5094 pub fn OH_Drawing_PenSetWidth(pen: *mut OH_Drawing_Pen, width: f32);
5095}
5096extern "C" {
5097 #[doc = " @brief Obtains the stroke miter limit of a polyline drawn by a pen. When the corner type is bevel, a beveled corner\n is displayed if the miter limit is exceeded, and a mitered corner is displayed if the miter limit is not exceeded.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param pen Pointer to an **OH_Drawing_Pen** object.\n @return Returns the miter limit.\n @since 8\n @version 1.0"]
5098 pub fn OH_Drawing_PenGetMiterLimit(pen: *const OH_Drawing_Pen) -> f32;
5099}
5100extern "C" {
5101 #[doc = " @brief Sets the stroke miter limit for a polyline drawn by a pen. When the corner type is bevel, a beveled corner is\n displayed if the miter limit is exceeded, and a mitered corner is displayed if the miter limit is not exceeded.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param pen Pointer to an **OH_Drawing_Pen** object.\n @param miter Stroke miter limit, which is a variable.\n @since 8\n @version 1.0"]
5102 pub fn OH_Drawing_PenSetMiterLimit(pen: *mut OH_Drawing_Pen, miter: f32);
5103}
5104#[doc = " There is no cap style. Both ends of the line segment are cut off square."]
5105pub const OH_Drawing_PenLineCapStyle_LINE_FLAT_CAP: OH_Drawing_PenLineCapStyle = 0;
5106#[doc = " Square cap style. Both ends have a square, the height of which is half of the width of the line segment, with\n the same width."]
5107pub const OH_Drawing_PenLineCapStyle_LINE_SQUARE_CAP: OH_Drawing_PenLineCapStyle = 1;
5108#[doc = " Round cap style. Both ends have a semicircle centered, the diameter of which is the same as the width of the\n line segment."]
5109pub const OH_Drawing_PenLineCapStyle_LINE_ROUND_CAP: OH_Drawing_PenLineCapStyle = 2;
5110#[doc = " @brief Enumerates the line cap styles of a pen. The line cap style defines the style of both ends of a line segment\n drawn by the pen.\n\n @since 8\n @version 1.0"]
5111pub type OH_Drawing_PenLineCapStyle = u32;
5112extern "C" {
5113 #[doc = " @brief Obtains the line cap style of a pen.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param pen Pointer to an **OH_Drawing_Pen** object.\n @return Returns the line cap style.\n @since 8\n @version 1.0"]
5114 pub fn OH_Drawing_PenGetCap(pen: *const OH_Drawing_Pen) -> OH_Drawing_PenLineCapStyle;
5115}
5116extern "C" {
5117 #[doc = " @brief Sets the line cap style for a pen.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n If **capStyle** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.\n\n @param pen Pointer to an **OH_Drawing_Pen** object.\n @param capStyle Line cap style, which is a variable.\n @since 8\n @version 1.0"]
5118 pub fn OH_Drawing_PenSetCap(pen: *mut OH_Drawing_Pen, capStyle: OH_Drawing_PenLineCapStyle);
5119}
5120#[doc = " Mitered corner. If the angle of a polyline is small, its miter length may be inappropriate. In this case, you\n need to use the miter limit to limit the miter length."]
5121pub const OH_Drawing_PenLineJoinStyle_LINE_MITER_JOIN: OH_Drawing_PenLineJoinStyle = 0;
5122#[doc = " Round corner."]
5123pub const OH_Drawing_PenLineJoinStyle_LINE_ROUND_JOIN: OH_Drawing_PenLineJoinStyle = 1;
5124#[doc = " Beveled corner."]
5125pub const OH_Drawing_PenLineJoinStyle_LINE_BEVEL_JOIN: OH_Drawing_PenLineJoinStyle = 2;
5126#[doc = " @brief Enumerates the line join styles of a pen. The line join style defines the shape of the joints of a polyline\n segment drawn by the pen.\n\n @since 8\n @version 1.0"]
5127pub type OH_Drawing_PenLineJoinStyle = u32;
5128extern "C" {
5129 #[doc = " @brief Obtains the line join style of a pen.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param pen Pointer to an **OH_Drawing_Pen** object.\n @return Returns the line join style.\n @since 8\n @version 1.0"]
5130 pub fn OH_Drawing_PenGetJoin(pen: *const OH_Drawing_Pen) -> OH_Drawing_PenLineJoinStyle;
5131}
5132extern "C" {
5133 #[doc = " @brief Sets the join style for this pen.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n If **joinStyle** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.\n\n @param pen Pointer to an **OH_Drawing_Pen** object.\n @param joinStyle Join style.\n @since 8\n @version 1.0"]
5134 pub fn OH_Drawing_PenSetJoin(pen: *mut OH_Drawing_Pen, joinStyle: OH_Drawing_PenLineJoinStyle);
5135}
5136extern "C" {
5137 #[doc = " @brief Sets the shader effect for this pen.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param pen Pointer to the {@link OH_Drawing_Pen} object.\n @param shaderEffect Pointer to an {@link OH_Drawing_ShaderEffect} object. If NULL is passed in, the shader effect\n will be cleared.\n @since 11\n @version 1.0"]
5138 pub fn OH_Drawing_PenSetShaderEffect(
5139 pen: *mut OH_Drawing_Pen,
5140 shaderEffect: *mut OH_Drawing_ShaderEffect,
5141 );
5142}
5143extern "C" {
5144 #[doc = " @brief Sets the shadow layer for a pen. The shadow layer effect takes effect only when text is drawn.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param pen Pointer to the {@link OH_Drawing_Pen} object.\n @param shadowLayer Pointer to an {@link OH_Drawing_ShadowLayer} object. If NULL is passed in, the shadow layer\n effect will be cleared.\n @since 12\n @version 1.0"]
5145 pub fn OH_Drawing_PenSetShadowLayer(
5146 pen: *mut OH_Drawing_Pen,
5147 shadowLayer: *mut OH_Drawing_ShadowLayer,
5148 );
5149}
5150extern "C" {
5151 #[doc = " @brief Sets the path effect for this pen.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param pen Pointer to the {@link OH_Drawing_Pen} object.\n @param pathEffect Pointer to an {@link OH_Drawing_PathEffect} object. If NULL is passed in, the path effect will be\n cleared.\n @since 12\n @version 1.0"]
5152 pub fn OH_Drawing_PenSetPathEffect(
5153 pen: *mut OH_Drawing_Pen,
5154 pathEffect: *mut OH_Drawing_PathEffect,
5155 );
5156}
5157extern "C" {
5158 #[doc = " @brief Sets a filter for a pen.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param pen Pointer to the {@link OH_Drawing_Pen} object.\n @param filter Pointer to an {@link OH_Drawing_Filter} object. If NULL is passed in, the filter will be cleared.\n @since 11\n @version 1.0"]
5159 pub fn OH_Drawing_PenSetFilter(pen: *mut OH_Drawing_Pen, filter: *mut OH_Drawing_Filter);
5160}
5161extern "C" {
5162 #[doc = " @brief Obtains the {@link OH_Drawing_Filter} object from the pen. The filter is a container that holds a mask filter\n and color filter.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **pen** or **filter** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param pen Pointer to the {@link OH_Drawing_Pen} object.\n @param filter Pointer to an {@link OH_Drawing_Filter} object.\n @since 12\n @version 1.0"]
5163 pub fn OH_Drawing_PenGetFilter(pen: *mut OH_Drawing_Pen, filter: *mut OH_Drawing_Filter);
5164}
5165extern "C" {
5166 #[doc = " @brief Sets a blender for a pen. The blender implements the specified blend mode.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n If **blendMode** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.\n\n @param pen Pointer to the {@link OH_Drawing_Pen} object.\n @param blendMode Enumeration of blend modes.\n @since 12\n @version 1.0"]
5167 pub fn OH_Drawing_PenSetBlendMode(pen: *mut OH_Drawing_Pen, blendMode: OH_Drawing_BlendMode);
5168}
5169extern "C" {
5170 #[doc = " @brief Obtains the source path outline drawn using this pen and represents it using a destination path.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If any of **pen**, **src**, and **dst** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param pen Pointer to the {@link OH_Drawing_Pen} object.\n @param src Pointer to the source {@link OH_Drawing_Path} object.\n @param dst Pointer to the target {@link OH_Drawing_Path} object.\n @param rect Pointer to an {@link OH_Drawing_Rect} object. NULL is recommended.\n @param matrix Pointer to an {@link OH_Drawing_Matrix} object. NULL is recommended. The default value is an identity\n matrix.\n @return Returns **true** if the destination path is obtained; returns **false** otherwise.\n @since 12\n @version 1.0"]
5171 pub fn OH_Drawing_PenGetFillPath(
5172 pen: *mut OH_Drawing_Pen,
5173 src: *const OH_Drawing_Path,
5174 dst: *mut OH_Drawing_Path,
5175 rect: *const OH_Drawing_Rect,
5176 matrix: *const OH_Drawing_Matrix,
5177 ) -> bool;
5178}
5179extern "C" {
5180 #[doc = " @brief Resets a pen to the initial state.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param pen Pointer to the {@link OH_Drawing_Pen} object.\n @since 12\n @version 1.0"]
5181 pub fn OH_Drawing_PenReset(pen: *mut OH_Drawing_Pen);
5182}
5183extern "C" {
5184 #[doc = " @brief Obtains the pixel map defined by this module from a pixel map defined by the image framework.\n\n @param nativePixelMap Pointer to a {@link NativePixelMap_} object, which is the pixel map defined by the image\n framework.\n @return Returns the pointer to an {@link OH_Drawing_PixelMap} object, which is the pixel map defined by this module.\n If NULL is returned, the creation fails. The possible failure cause is that **NativePixelMap_** is NULL.\n @since 12\n @version 1.0"]
5185 pub fn OH_Drawing_PixelMapGetFromNativePixelMap(
5186 nativePixelMap: *mut NativePixelMap_,
5187 ) -> *mut OH_Drawing_PixelMap;
5188}
5189extern "C" {
5190 #[doc = " @brief Obtains the pixel map defined by this module from a pixel map defined by the image framework.\n\n @param pixelmapNative Pointer to a {@link OH_PixelmapNative} object, which is the pixel map defined by the image\n framework.\n @return Returns the pointer to an {@link OH_Drawing_PixelMap} object, which is the pixel map defined by this module.\n If NULL is returned, the creation fails. The possible failure cause is that **OH_PixelmapNative** is NULL.\n @since 12\n @version 1.0"]
5191 pub fn OH_Drawing_PixelMapGetFromOhPixelMapNative(
5192 pixelmapNative: *mut OH_PixelmapNative,
5193 ) -> *mut OH_Drawing_PixelMap;
5194}
5195extern "C" {
5196 #[doc = " @brief Removes the relationship between a pixel map defined by this module and a pixel map defined by the image\n framework. The relationship is established by calling {@link OH_Drawing_PixelMapGetFromNativePixelMap} or\n {@link OH_Drawing_PixelMapGetFromOhPixelMapNative}\n .\n\n @param pixelMap Pointer to an {@link OH_Drawing_PixelMap} object.\n @since 12\n @version 1.0"]
5197 pub fn OH_Drawing_PixelMapDissolve(pixelMap: *mut OH_Drawing_PixelMap);
5198}
5199extern "C" {
5200 #[doc = " @brief Creates an **OH_Drawing_Point** object.\n\n @param x X coordinate of the point.\n @param y Y coordinate of the point.\n @return Returns the pointer to the **OH_Drawing_Point** object created.\n @since 11\n @version 1.0"]
5201 pub fn OH_Drawing_PointCreate(x: f32, y: f32) -> *mut OH_Drawing_Point;
5202}
5203extern "C" {
5204 #[doc = " @brief Obtains the X coordinate of a point.\n\n @param point Pointer to an {@link OH_Drawing_Point} object.\n @param x Pointer to the X coordinate.\n @return Returns one of the following result codes:\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **point** or **x** is NULL.\n @since 12\n @version 1.0"]
5205 pub fn OH_Drawing_PointGetX(
5206 point: *const OH_Drawing_Point,
5207 x: *mut f32,
5208 ) -> OH_Drawing_ErrorCode;
5209}
5210extern "C" {
5211 #[doc = " @brief Obtains the Y coordinate of a point.\n\n @param point Pointer to an {@link OH_Drawing_Point} object.\n @param y Pointer to the Y coordinate.\n @return Returns one of the following result codes:\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **point** or **y** is NULL.\n @since 12\n @version 1.0"]
5212 pub fn OH_Drawing_PointGetY(
5213 point: *const OH_Drawing_Point,
5214 y: *mut f32,
5215 ) -> OH_Drawing_ErrorCode;
5216}
5217extern "C" {
5218 #[doc = " @brief Sets the X and Y coordinates of a point.\n\n @param point Pointer to an {@link OH_Drawing_Point} object.\n @param x Pointer to the X coordinate.\n @param y Pointer to the Y coordinate.\n @return Returns one of the following result codes:\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if **point** is NULL.\n @since 12\n @version 1.0"]
5219 pub fn OH_Drawing_PointSet(
5220 point: *mut OH_Drawing_Point,
5221 x: f32,
5222 y: f32,
5223 ) -> OH_Drawing_ErrorCode;
5224}
5225extern "C" {
5226 #[doc = " @brief Negates the point's coordinates.\n\n @param point Indicates the pointer to an <b>OH_Drawing_Point</b> object.\n @return Returns the error code.\n Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.\n Returns {@link OH_DRAWING_ERROR_INCORRECT_PARAMETER} if point is nullptr.\n @since 26.0.0"]
5227 #[cfg(feature = "api-26")]
5228 pub fn OH_Drawing_PointNegate(point: *mut OH_Drawing_Point) -> OH_Drawing_ErrorCode;
5229}
5230extern "C" {
5231 #[doc = " @brief Offsets the point's coordinates by dx, dy.\n\n @param point Indicates the pointer to an <b>OH_Drawing_Point</b> object.\n @param dx Indicates the distance to offset on the x-axis in pixels.\n @param dy Indicates the distance to offset on the y-axis in pixels.\n @return Returns the error code.\n Returns {@link OH_DRAWING_SUCCESS} if the operation is successful.\n Returns {@link OH_DRAWING_ERROR_INCORRECT_PARAMETER} if point is nullptr.\n @since 26.0.0"]
5232 #[cfg(feature = "api-26")]
5233 pub fn OH_Drawing_PointOffset(
5234 point: *mut OH_Drawing_Point,
5235 dx: f32,
5236 dy: f32,
5237 ) -> OH_Drawing_ErrorCode;
5238}
5239extern "C" {
5240 #[doc = " @brief Destroys an **OH_Drawing_Point** object and reclaims the memory occupied by the object.\n\n @param point Pointer to an **OH_Drawing_Point** object.\n @since 11\n @version 1.0"]
5241 pub fn OH_Drawing_PointDestroy(point: *mut OH_Drawing_Point);
5242}
5243extern "C" {
5244 #[doc = " @brief Creates an **OH_Drawing_RecordCmdUtils** object.\n\n @return Returns the pointer to the **OH_Drawing_RecordCmdUtils** object created.\n @since 13\n @version 1.0"]
5245 #[cfg(feature = "api-13")]
5246 pub fn OH_Drawing_RecordCmdUtilsCreate() -> *mut OH_Drawing_RecordCmdUtils;
5247}
5248extern "C" {
5249 #[doc = " @brief Destroys an **OH_Drawing_RecordCmdUtils** object and reclaims the memory occupied by the object.\n\n @param recordCmdUtils Pointer to an {@link OH_Drawing_RecordCmdUtils} object.\n @return Returns one of the following result codes:\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if **recordCmdUtils** is NULL.\n @since 13\n @version 1.0"]
5250 #[cfg(feature = "api-13")]
5251 pub fn OH_Drawing_RecordCmdUtilsDestroy(
5252 recordCmdUtils: *mut OH_Drawing_RecordCmdUtils,
5253 ) -> OH_Drawing_ErrorCode;
5254}
5255extern "C" {
5256 #[doc = " @brief Starts recording. This API must be used together with {@link OH_Drawing_RecordCmdUtilsFinishRecording}.\n The **OH_Drawing_RecordCmdUtils** object generates a canvas object of the recording type and calls the interface of\n the drawing object to record all drawing commands.\n\n @param recordCmdUtils Pointer to an {@link OH_Drawing_RecordCmdUtils} object.\n @param width Width of the canvas.\n @param height Height of the canvas.\n @param canvas Double pointer to the {@link OH_Drawing_Canvas} object. You do not need to release this pointer.\n This object does not support nested calling of {@link OH_Drawing_CanvasDrawRecordCmd}.\n @return Returns one of the following result codes:\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **recordCmdUtils** or **canvas** is NULL.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **width** or **height** is less than 0.\n **OH_DRAWING_ERROR_ALLOCATION_FAILED** if the system memory is insufficient.\n @since 13\n @version 1.0"]
5257 #[cfg(feature = "api-13")]
5258 pub fn OH_Drawing_RecordCmdUtilsBeginRecording(
5259 recordCmdUtils: *mut OH_Drawing_RecordCmdUtils,
5260 width: i32,
5261 height: i32,
5262 canvas: *mut *mut OH_Drawing_Canvas,
5263 ) -> OH_Drawing_ErrorCode;
5264}
5265extern "C" {
5266 #[doc = " @brief Stops video recording. This function must be called after {@link OH_Drawing_RecordCmdUtilsBeginRecording}.\n The **OH_Drawing_RecordCmdUtils** object ends recording and stores the drawing commands recorded by the canvas\n object of the recording type into the generated {@link OH_Drawing_RecordCmdUtilsBeginRecording} object.\n\n @param recordCmdUtils Pointer to an {@link OH_Drawing_RecordCmdUtils} object.\n @param recordCmd Double pointer to the {@link OH_Drawing_RecordCmd} object. You need to call\n {@link OH_Drawing_CanvasDrawRecordCmd}\n to draw the object, and call {@link OH_Drawing_RecordCmdDestroy} to release it.\n @return Returns one of the following result codes:\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **recordCmdUtils** or **recordCmd** is NULL.\n **OH_DRAWING_ERROR_ALLOCATION_FAILED** if the system memory is insufficient.\n @since 13\n @version 1.0"]
5267 #[cfg(feature = "api-13")]
5268 pub fn OH_Drawing_RecordCmdUtilsFinishRecording(
5269 recordCmdUtils: *mut OH_Drawing_RecordCmdUtils,
5270 recordCmd: *mut *mut OH_Drawing_RecordCmd,
5271 ) -> OH_Drawing_ErrorCode;
5272}
5273extern "C" {
5274 #[doc = " @brief Destroys an **OH_Drawing_RecordCmd** object and reclaims the memory occupied by the object.\n\n @param recordCmd Pointer to an {@link OH_Drawing_RecordCmd} object.\n @return Returns one of the following result codes:\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if **recordCmd** is NULL.\n @since 13\n @version 1.0"]
5275 #[cfg(feature = "api-13")]
5276 pub fn OH_Drawing_RecordCmdDestroy(
5277 recordCmd: *mut OH_Drawing_RecordCmd,
5278 ) -> OH_Drawing_ErrorCode;
5279}
5280extern "C" {
5281 #[doc = " @brief Creates an **OH_Drawing_Rect** object, without sorting the coordinates passed in. This means that the\n coordinates of the upper left corner of the rectangle can be greater than those of the lower right corner.\n\n @param left X coordinate of the upper left corner of the rectangle.\n @param top Y coordinate of the upper left corner of the rectangle.\n @param right X coordinate of the lower right corner of the rectangle.\n @param bottom Y coordinate of the lower right corner of the rectangle.\n @return Returns the pointer to the **OH_Drawing_Rect** object created.\n @since 11\n @version 1.0"]
5282 pub fn OH_Drawing_RectCreate(
5283 left: f32,
5284 top: f32,
5285 right: f32,
5286 bottom: f32,
5287 ) -> *mut OH_Drawing_Rect;
5288}
5289extern "C" {
5290 #[doc = " @brief Checks whether two rectangles intersect and if yes, sets **rect** to the area of intersection.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **rect** or **other** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param rect Pointer to an **OH_Drawing_Rect** object.\n @param other Pointer to an **OH_Drawing_Rect** object.\n @return Returns **true** if they intersect (**rect** is set to the intersection area); returns **false** otherwise (*\n *rect** remains unchanged).\n @since 12\n @version 1.0"]
5291 pub fn OH_Drawing_RectIntersect(
5292 rect: *mut OH_Drawing_Rect,
5293 other: *const OH_Drawing_Rect,
5294 ) -> bool;
5295}
5296extern "C" {
5297 #[doc = " @brief Obtains the union of two rectangles.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **rect** or **other** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param rect Pointer to an **OH_Drawing_Rect** object.\n @param other Pointer to an **OH_Drawing_Rect** object.\n @return Returns **true** if the union is obtained; returns **false** otherwise. The possible failure cause is that\n at least one of the parameters **rect** and **other** is NULL or the size of the rectangle specified by **other** is\n empty.\n @since 12\n @version 1.0"]
5298 pub fn OH_Drawing_RectJoin(rect: *mut OH_Drawing_Rect, other: *const OH_Drawing_Rect) -> bool;
5299}
5300extern "C" {
5301 #[doc = " @brief Sets the horizontal coordinate of the upper left corner of a rectangle.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param rect Pointer to an **OH_Drawing_Rect** object.\n @param left X coordinate of the upper left corner of the rectangle.\n @since 12\n @version 1.0"]
5302 pub fn OH_Drawing_RectSetLeft(rect: *mut OH_Drawing_Rect, left: f32);
5303}
5304extern "C" {
5305 #[doc = " @brief Sets the vertical coordinate of the upper left corner of a rectangle.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param rect Pointer to an **OH_Drawing_Rect** object.\n @param top Y coordinate of the upper left corner of the rectangle.\n @since 12\n @version 1.0"]
5306 pub fn OH_Drawing_RectSetTop(rect: *mut OH_Drawing_Rect, top: f32);
5307}
5308extern "C" {
5309 #[doc = " @brief Sets the horizontal coordinate of the lower right corner of a rectangle.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param rect Pointer to an **OH_Drawing_Rect** object.\n @param right X coordinate of the lower right corner of the rectangle.\n @since 12\n @version 1.0"]
5310 pub fn OH_Drawing_RectSetRight(rect: *mut OH_Drawing_Rect, right: f32);
5311}
5312extern "C" {
5313 #[doc = " @brief Sets the vertical coordinate of the lower right corner of a rectangle.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param rect Pointer to an **OH_Drawing_Rect** object.\n @param bottom Y coordinate of the lower right corner of the rectangle.\n @since 12\n @version 1.0"]
5314 pub fn OH_Drawing_RectSetBottom(rect: *mut OH_Drawing_Rect, bottom: f32);
5315}
5316extern "C" {
5317 #[doc = " @brief Obtains the X coordinate of the upper left corner of a rectangle.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param rect Pointer to an **OH_Drawing_Rect** object.\n @return X coordinate of the upper left corner of the rectangle.\n @since 12\n @version 1.0"]
5318 pub fn OH_Drawing_RectGetLeft(rect: *mut OH_Drawing_Rect) -> f32;
5319}
5320extern "C" {
5321 #[doc = " @brief Obtains the Y coordinate of the upper left corner of a rectangle.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param rect Pointer to an **OH_Drawing_Rect** object.\n @return Y coordinate of the upper left corner of the rectangle.\n @since 12\n @version 1.0"]
5322 pub fn OH_Drawing_RectGetTop(rect: *mut OH_Drawing_Rect) -> f32;
5323}
5324extern "C" {
5325 #[doc = " @brief Obtains the X coordinate of the lower right corner of a rectangle.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param rect Pointer to an **OH_Drawing_Rect** object.\n @return X coordinate of the lower right corner of the rectangle.\n @since 12\n @version 1.0"]
5326 pub fn OH_Drawing_RectGetRight(rect: *mut OH_Drawing_Rect) -> f32;
5327}
5328extern "C" {
5329 #[doc = " @brief Obtains the Y coordinate of the lower right corner of a rectangle.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param rect Pointer to an **OH_Drawing_Rect** object.\n @return Y coordinate of the lower right corner of the rectangle.\n @since 12\n @version 1.0"]
5330 pub fn OH_Drawing_RectGetBottom(rect: *mut OH_Drawing_Rect) -> f32;
5331}
5332extern "C" {
5333 #[doc = " @brief Obtains the height of a rectangle. The height is calculated by using the Y coordinate of the lower right\n corner of the rectangle minus the Y coordinate of the upper left corner.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n @return Returns the height of the rectangle, in pixels.\n @param rect Pointer to an **OH_Drawing_Rect** object.\n @since 12\n @version 1.0"]
5334 pub fn OH_Drawing_RectGetHeight(rect: *mut OH_Drawing_Rect) -> f32;
5335}
5336extern "C" {
5337 #[doc = " @brief Obtains the width of a rectangle. The width is calculated by using the X coordinate of the lower right corner\n of the rectangle minus the X coordinate of the upper left corner.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param rect Pointer to an **OH_Drawing_Rect** object.\n @return Returns the weight of the rectangle, in pixels.\n @since 12\n @version 1.0"]
5338 pub fn OH_Drawing_RectGetWidth(rect: *mut OH_Drawing_Rect) -> f32;
5339}
5340extern "C" {
5341 #[doc = " @brief Copies a source rectangle to create a new one.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **src** or **dst** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param src Pointer to a source rectangle, which is an **OH_Drawing_Rect** object.\n @param dst Pointer to a destination rectangle, which is an **OH_Drawing_Rect** object.\n @since 12\n @version 1.0"]
5342 pub fn OH_Drawing_RectCopy(src: *mut OH_Drawing_Rect, dst: *mut OH_Drawing_Rect);
5343}
5344extern "C" {
5345 #[doc = " @brief Destroys an **OH_Drawing_Rect** object and reclaims the memory occupied by the object.\n\n @param rect Pointer to an **OH_Drawing_Rect** object.\n @since 11\n @version 1.0"]
5346 pub fn OH_Drawing_RectDestroy(rect: *mut OH_Drawing_Rect);
5347}
5348extern "C" {
5349 #[doc = " @brief Creates a rectangle array object to store multiple rectangle objects. Release this pointer by calling\n {@link OH_Drawing_RectDestroyArray}\n when this object is no longer needed.\n\n @param size Size of the rectangle array. The value cannot exceed 65536, which is the maximum number of glyph indices.\n @return Returns the pointer to the {@link OH_Drawing_Array} object created. If the returned object pointer is null,\n the creation fails.\n Possible causes are that no memory is available or an input parameter is incorrect.\n @since 18\n @version 1.0"]
5350 #[cfg(feature = "api-18")]
5351 pub fn OH_Drawing_RectCreateArray(size: usize) -> *mut OH_Drawing_Array;
5352}
5353extern "C" {
5354 #[doc = " @brief Obtains the size of an {@link OH_Drawing_Array} object.\n\n @param rectArray Pointer to an {@link OH_Drawing_Array} object.\n @param pSize Pointer to the size_t type, which is used as an output parameter to store the size of the rectangle\n array.\n @return Returns one of the following result codes:\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **rectArray** or **pSize** is NULL.\n @since 18\n @version 1.0"]
5355 #[cfg(feature = "api-18")]
5356 pub fn OH_Drawing_RectGetArraySize(
5357 rectArray: *mut OH_Drawing_Array,
5358 pSize: *mut usize,
5359 ) -> OH_Drawing_ErrorCode;
5360}
5361extern "C" {
5362 #[doc = " @brief Obtains the rectangle with the specified index in a rectangle array.\n\n @param rectArray Pointer to an {@link OH_Drawing_Array} object.\n @param index Index of the rectangle array.\n @param rect Double pointer to {@link OH_Drawing_Rect}, which is returned to the caller as an output parameter.\n @return Returns one of the following result codes:\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if **rectArray** or **rect** is null or **index** is out of range.\n @since 18\n @version 1.0"]
5363 #[cfg(feature = "api-18")]
5364 pub fn OH_Drawing_RectGetArrayElement(
5365 rectArray: *mut OH_Drawing_Array,
5366 index: usize,
5367 rect: *mut *mut OH_Drawing_Rect,
5368 ) -> OH_Drawing_ErrorCode;
5369}
5370extern "C" {
5371 #[doc = " @brief Destroys an **OH_Drawing_Array** object and reclaims the memory occupied by the object.\n\n @param rectArray Pointer to an {@link OH_Drawing_Array} object.\n @return Returns one of the following result codes:\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if **rectArray** is NULL.\n @since 18\n @version 1.0"]
5372 #[cfg(feature = "api-18")]
5373 pub fn OH_Drawing_RectDestroyArray(rectArray: *mut OH_Drawing_Array) -> OH_Drawing_ErrorCode;
5374}
5375extern "C" {
5376 #[doc = " @brief Checks whether a rectangle completely contains another rectangle.\n\n @param rect Pointer to the {@link OH_Drawing_Rect} object. This rectangle is used to check whether another rectangle\n (**other**) is contained.\n @param other Pointer to the {@link OH_Drawing_Rect} object. This rectangle is used to check whether it is contained\n by another rectangle (**rect**).\n @param isContains Result of whether a rectangle completely contains another rectangle. It is used as an output\n parameter. **true** indicates that **rect** completely contains **other**. **false** indicates that **rect** does\n not completely contain **other**.\n @return Returns one of the following result codes:\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INCORRECT_PARAMETER** if the **rect**, **other**, or **isContains** parameter is empty.\n @since 22\n @version 1.0"]
5377 #[cfg(feature = "api-22")]
5378 pub fn OH_Drawing_RectContains(
5379 rect: *mut OH_Drawing_Rect,
5380 other: *const OH_Drawing_Rect,
5381 isContains: *mut bool,
5382 ) -> OH_Drawing_ErrorCode;
5383}
5384extern "C" {
5385 #[doc = " @brief Adds a specified value to the bounds of a rectangle.\n\n @param rect Pointer to the {@link OH_Drawing_Rect} object.\n @param left Value to be added to the left bound of the rectangle (X coordinate of the upper left corner of the\n rectangle).\n @param top Value to be added to the top bound of the rectangle (Y coordinate of the upper left corner of the\n rectangle).\n @param right Value to be added to the right bound of the rectangle (X coordinate of the lower right corner of the\n rectangle).\n @param bottom Value to be added to the bottom bound of the rectangle (Y coordinate of the lower right corner of the\n rectangle).\n @return Returns one of the following result codes:\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INCORRECT_PARAMETER** if the **rect** parameter is empty.\n @since 22\n @version 1.0"]
5386 #[cfg(feature = "api-22")]
5387 pub fn OH_Drawing_RectInset(
5388 rect: *mut OH_Drawing_Rect,
5389 left: f32,
5390 top: f32,
5391 right: f32,
5392 bottom: f32,
5393 ) -> OH_Drawing_ErrorCode;
5394}
5395extern "C" {
5396 #[doc = " @brief Checks whether a rectangle is empty.\n\n @param rect Pointer to the {@link OH_Drawing_Rect} object.\n @param isEmpty Whether a rectangle is empty. It is used as an output parameter. **true** means yes; **false**\n otherwise.\n @return Execution result.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INCORRECT_PARAMETER** if **rect** or **isEmpty** is a null pointer.\n @since 23"]
5397 #[cfg(feature = "api-23")]
5398 pub fn OH_Drawing_RectIsEmpty(
5399 rect: *const OH_Drawing_Rect,
5400 isEmpty: *mut bool,
5401 ) -> OH_Drawing_ErrorCode;
5402}
5403extern "C" {
5404 #[doc = " @brief Offsets a rectangle along the X axis and Y axis.\n\n @param rect Pointer to the {@link OH_Drawing_Rect} object.\n @param dx Offset on the X axis. A positive number indicates an offset towards the positive direction of the X axis,\n and a negative number indicates an offset towards the negative direction of the X axis.\n @param dy Offset on the Y axis. A positive number indicates an offset towards the positive direction of the Y axis,\n and a negative number indicates an offset towards the negative direction of the Y axis.\n @return Execution result.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INCORRECT_PARAMETER** if **rect** is a null pointer.\n @since 23"]
5405 #[cfg(feature = "api-23")]
5406 pub fn OH_Drawing_RectOffset(
5407 rect: *mut OH_Drawing_Rect,
5408 dx: f32,
5409 dy: f32,
5410 ) -> OH_Drawing_ErrorCode;
5411}
5412extern "C" {
5413 #[doc = " @brief Offsets a rectangle to a specific position while keeping the width and height unchanged.\n\n @param rect Pointer to the {@link OH_Drawing_Rect} object.\n @param newLeft X coordinate of the upper left corner of the rectangle after the offset.\n @param newTop Y coordinate of the upper left corner of the rectangle after the offset.\n @return Execution result.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INCORRECT_PARAMETER** if **rect** is a null pointer.\n @since 23"]
5414 #[cfg(feature = "api-23")]
5415 pub fn OH_Drawing_RectOffsetTo(
5416 rect: *mut OH_Drawing_Rect,
5417 newLeft: f32,
5418 newTop: f32,
5419 ) -> OH_Drawing_ErrorCode;
5420}
5421extern "C" {
5422 #[doc = " @brief Clears a rectangle (by setting the X and Y coordinates of the upper left corner and lower right corner to **0*\n *).\n\n @param rect Pointer to the {@link OH_Drawing_Rect} object.\n @return Execution result.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INCORRECT_PARAMETER** if **rect** is a null pointer.\n @since 23"]
5423 #[cfg(feature = "api-23")]
5424 pub fn OH_Drawing_RectSetEmpty(rect: *mut OH_Drawing_Rect) -> OH_Drawing_ErrorCode;
5425}
5426extern "C" {
5427 #[doc = " @brief Sorts the coordinates of a rectangle based on the actual position.\n\n @param rect Pointer to the {@link OH_Drawing_Rect} object.\n @return Execution result.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INCORRECT_PARAMETER** if **rect** is a null pointer.\n @since 23"]
5428 #[cfg(feature = "api-23")]
5429 pub fn OH_Drawing_RectSort(rect: *mut OH_Drawing_Rect) -> OH_Drawing_ErrorCode;
5430}
5431extern "C" {
5432 #[doc = " @brief Sets the current rectangle to the union of this rectangle and another rectangle.\n\n @param rect Pointer to this {@link OH_Drawing_Rect} object.\n @param other Pointer to another {@link OH_Drawing_Rect} object.\n @return Execution result.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INCORRECT_PARAMETER** if **rect** or **other** is a null pointer.\n @since 23"]
5433 #[cfg(feature = "api-23")]
5434 pub fn OH_Drawing_RectUnion(
5435 rect: *mut OH_Drawing_Rect,
5436 other: *const OH_Drawing_Rect,
5437 ) -> OH_Drawing_ErrorCode;
5438}
5439#[doc = " Difference operation."]
5440pub const OH_Drawing_RegionOpMode_REGION_OP_MODE_DIFFERENCE: OH_Drawing_RegionOpMode = 0;
5441#[doc = " Intersection operation."]
5442pub const OH_Drawing_RegionOpMode_REGION_OP_MODE_INTERSECT: OH_Drawing_RegionOpMode = 1;
5443#[doc = " Union operation."]
5444pub const OH_Drawing_RegionOpMode_REGION_OP_MODE_UNION: OH_Drawing_RegionOpMode = 2;
5445#[doc = " XOR operation."]
5446pub const OH_Drawing_RegionOpMode_REGION_OP_MODE_XOR: OH_Drawing_RegionOpMode = 3;
5447#[doc = " Reverse difference operation."]
5448pub const OH_Drawing_RegionOpMode_REGION_OP_MODE_REVERSE_DIFFERENCE: OH_Drawing_RegionOpMode = 4;
5449#[doc = " Replacement operation."]
5450pub const OH_Drawing_RegionOpMode_REGION_OP_MODE_REPLACE: OH_Drawing_RegionOpMode = 5;
5451#[doc = " @brief Enumerates the operation modes available for a region.\n\n @since 12\n @version 1.0"]
5452pub type OH_Drawing_RegionOpMode = u32;
5453extern "C" {
5454 #[doc = " @brief Creates an **OH_Drawing_Region** object for more accurate graphical control.\n\n @return Returns the pointer to the {@link OH_Drawing_Region} object created.\n @since 12\n @version 1.0"]
5455 pub fn OH_Drawing_RegionCreate() -> *mut OH_Drawing_Region;
5456}
5457extern "C" {
5458 #[doc = " @brief Creates a copy of a region object.\n\n @param region Pointer to the {@link OH_Drawing_Region} object to be copied.\n @return Returns the pointer to the **OH_Drawing_Region** object created.\n @since 20\n @version 1.0"]
5459 #[cfg(feature = "api-20")]
5460 pub fn OH_Drawing_RegionCopy(region: *const OH_Drawing_Region) -> *mut OH_Drawing_Region;
5461}
5462extern "C" {
5463 #[doc = " @brief Checks whether a region contains the specified point.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **region** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param region Pointer to the {@link OH_Drawing_Region} object.\n @param x X coordinate of the point.\n @param y Y coordinate of the point.\n @return Returns **true** if the region contains the specified point; returns **false** otherwise.\n @since 12\n @version 1.0"]
5464 pub fn OH_Drawing_RegionContains(region: *mut OH_Drawing_Region, x: i32, y: i32) -> bool;
5465}
5466extern "C" {
5467 #[doc = " @brief Combines two regions based on the specified operation mode.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **region** or **dst** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n If **op** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.\n\n @param region Pointer to an {@link OH_Drawing_Region} object, in which the resulting region is saved.\n @param other Pointer to the {@link OH_Drawing_Region} object.\n @param op Operation mode of the region. For details about the available options, see {@link OH_Drawing_RegionOpMode}.\n @return Returns **true** if the resulting region is not empty; returns false otherwise.\n @since 12\n @version 1.0"]
5468 pub fn OH_Drawing_RegionOp(
5469 region: *mut OH_Drawing_Region,
5470 other: *const OH_Drawing_Region,
5471 op: OH_Drawing_RegionOpMode,
5472 ) -> bool;
5473}
5474extern "C" {
5475 #[doc = " @brief Sets the boundary for an **OH_Drawing_Region** object.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **region** or **rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param region Pointer to the {@link OH_Drawing_Region} object.\n @param rect Pointer to an **OH_Drawing_Rect** object.\n @return Returns **true** if the setting is successful; returns **false** otherwise.\n @since 12\n @version 1.0"]
5476 pub fn OH_Drawing_RegionSetRect(
5477 region: *mut OH_Drawing_Region,
5478 rect: *const OH_Drawing_Rect,
5479 ) -> bool;
5480}
5481extern "C" {
5482 #[doc = " @brief Sets a region to the area described by the path.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **region**, **path**, or **clip** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param region Pointer to the {@link OH_Drawing_Region} object.\n @param path Pointer to the {@link OH_Drawing_Path} object.\n @param clip Pointer to the {@link OH_Drawing_Region} object.\n @return Returns **true** if the resulting region is not empty; returns false otherwise.\n @since 12\n @version 1.0"]
5483 pub fn OH_Drawing_RegionSetPath(
5484 region: *mut OH_Drawing_Region,
5485 path: *const OH_Drawing_Path,
5486 clip: *const OH_Drawing_Region,
5487 ) -> bool;
5488}
5489extern "C" {
5490 #[doc = " @brief Destroys an **OH_Drawing_Region** object and reclaims the memory occupied by the object.\n\n @param region Pointer to the {@link OH_Drawing_Region} object.\n @since 12\n @version 1.0"]
5491 pub fn OH_Drawing_RegionDestroy(region: *mut OH_Drawing_Region);
5492}
5493extern "C" {
5494 #[doc = " @brief Sets the existing region to empty.\n\n @param region Pointer to the {@link OH_Drawing_Region} object.\n @return Returns one of the following result codes:\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INCORRECT_PARAMETER** if the **region** parameter is empty.\n @since 22\n @version 1.0"]
5495 #[cfg(feature = "api-22")]
5496 pub fn OH_Drawing_RegionEmpty(region: *mut OH_Drawing_Region) -> OH_Drawing_ErrorCode;
5497}
5498extern "C" {
5499 #[doc = " @brief Sets the path as the boundary of the region. If the region is empty, the path is also empty.\n\n @param region Pointer to the {@link OH_Drawing_Region} object.\n @param path Pointer to the {@link OH_Drawing_Path} object. It is used as an output parameter.\n @return Execution result.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INCORRECT_PARAMETER** if **region** or **path** is a null pointer.\n @since 23"]
5500 #[cfg(feature = "api-23")]
5501 pub fn OH_Drawing_RegionGetBoundaryPath(
5502 region: *const OH_Drawing_Region,
5503 path: *mut OH_Drawing_Path,
5504 ) -> OH_Drawing_ErrorCode;
5505}
5506extern "C" {
5507 #[doc = " @brief Obtains the smallest bounding rectangle that contains the region.\n\n @param region Pointer to the {@link OH_Drawing_Region} object.\n @param rect Pointer to the {@link OH_Drawing_Rect} object. It is used as an output parameter.\n @return Execution result.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INCORRECT_PARAMETER** if **region** or **rect** is a null pointer.\n @since 23"]
5508 #[cfg(feature = "api-23")]
5509 pub fn OH_Drawing_RegionGetBounds(
5510 region: *const OH_Drawing_Region,
5511 rect: *mut OH_Drawing_Rect,
5512 ) -> OH_Drawing_ErrorCode;
5513}
5514extern "C" {
5515 #[doc = " @brief Checks whether the region contains two or more rectangles.\n\n @param region Pointer to the {@link OH_Drawing_Region} object.\n @param isComplex Whether this region contains multiple rectangles. It is used as an output parameter. **true** means\n yes; **false** otherwise.\n @return Execution result.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INCORRECT_PARAMETER** if **region** or **isComplex** is a null pointer.\n @since 23"]
5516 #[cfg(feature = "api-23")]
5517 pub fn OH_Drawing_RegionIsComplex(
5518 region: *const OH_Drawing_Region,
5519 isComplex: *mut bool,
5520 ) -> OH_Drawing_ErrorCode;
5521}
5522extern "C" {
5523 #[doc = " @brief Checks whether the region is empty.\n\n @param region Pointer to the {@link OH_Drawing_Region} object.\n @param isEmpty Whether the region is empty. It is used as an output parameter. **true** means yes; **false**\n otherwise.\n @return Execution result.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INCORRECT_PARAMETER** if **region** or **isEmpty** is a null pointer.\n @since 23"]
5524 #[cfg(feature = "api-23")]
5525 pub fn OH_Drawing_RegionIsEmpty(
5526 region: *const OH_Drawing_Region,
5527 isEmpty: *mut bool,
5528 ) -> OH_Drawing_ErrorCode;
5529}
5530extern "C" {
5531 #[doc = " @brief Checks whether the region the same as a rectangle.\n\n @param region Pointer to the {@link OH_Drawing_Region} object.\n @param isRect Whether the region the same as a rectangle. It is used as an output parameter. **true** means yes; **\n false** otherwise.\n @return Execution result.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INCORRECT_PARAMETER** if **region** or **isRect** is a null pointer.\n @since 23"]
5532 #[cfg(feature = "api-23")]
5533 pub fn OH_Drawing_RegionIsRect(
5534 region: *const OH_Drawing_Region,
5535 isRect: *mut bool,
5536 ) -> OH_Drawing_ErrorCode;
5537}
5538extern "C" {
5539 #[doc = " @brief Checks whether the region is the same as a single rectangle and contains the specified rectangle.\n\n @param region Pointer to the {@link OH_Drawing_Region} object.\n @param left X coordinate of the upper left corner of the specified rectangle.\n @param top Y coordinate of the upper left corner of the specified rectangle.\n @param right X coordinate of the lower right corner of the specified rectangle.\n @param bottom Y coordinate of the lower right corner of the specified rectangle.\n @param isContained Whether the region is the same as a single rectangle and contains the specified rectangle. It is\n used as an output parameter.\n **true** if the current region is the same as a single rectangle and contains the specified rectangle; **false**\n otherwise.\n @return Execution result.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INCORRECT_PARAMETER** if **region** or **isContained** is a null pointer.\n @since 23"]
5540 #[cfg(feature = "api-23")]
5541 pub fn OH_Drawing_RegionQuickContains(
5542 region: *const OH_Drawing_Region,
5543 left: i32,
5544 top: i32,
5545 right: i32,
5546 bottom: i32,
5547 isContained: *mut bool,
5548 ) -> OH_Drawing_ErrorCode;
5549}
5550extern "C" {
5551 #[doc = " @brief Checks whether the region is empty or does not intersect the specified rectangle.\n\n @param region Pointer to the {@link OH_Drawing_Region} object.\n @param left X coordinate of the upper left corner of the specified rectangle.\n @param top Y coordinate of the upper left corner of the specified rectangle.\n @param right X coordinate of the lower right corner of the specified rectangle.\n @param bottom Y coordinate of the lower right corner of the specified rectangle.\n @param isReject Whether the region is empty or whether the specified rectangle does not intersect with the region.\n It is used as an output parameter.\n **true** means yes; **false** otherwise.\n @return Execution result.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INCORRECT_PARAMETER** if **region** or **isReject** is a null pointer.\n @since 23"]
5552 #[cfg(feature = "api-23")]
5553 pub fn OH_Drawing_RegionQuickReject(
5554 region: *const OH_Drawing_Region,
5555 left: i32,
5556 top: i32,
5557 right: i32,
5558 bottom: i32,
5559 isReject: *mut bool,
5560 ) -> OH_Drawing_ErrorCode;
5561}
5562extern "C" {
5563 #[doc = " @brief Translates the region by a specified distance on the X and Y axes. If the region is empty, no operation is\n performed.\n\n @param region Pointer to the {@link OH_Drawing_Region} object.\n @param dx Distance to be translated on the X axis, in pixels.\n @param dy Distance to be translated on the Y axis, in pixels.\n @return Execution result.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INCORRECT_PARAMETER** if **region** is a null pointer.\n @since 23"]
5564 #[cfg(feature = "api-23")]
5565 pub fn OH_Drawing_RegionTranslate(
5566 region: *mut OH_Drawing_Region,
5567 dx: i32,
5568 dy: i32,
5569 ) -> OH_Drawing_ErrorCode;
5570}
5571extern "C" {
5572 #[doc = " @brief Registers a custom font with the font manager. The supported font file formats are .ttf and .otf.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param fontCollection Indicates the pointer to an <b>OH_Drawing_FontCollection</b> object.\n @param fontFamily Name of the font to register.\n @param familySrc Path to the font file to register.\n @return Result code.\n <br>Returns 0 if the operation is successful.\n <br>Returns 1 if the file does not exist.\n <br>Returns 2 if opening the file fails.\n <br>Returns 3 if reading the file fails.\n <br>Returns 4 if seeking the file fails.\n <br>Returns 5 if obtaining the file size fails.\n <br>Returns 8 if fontCollection is NULL.\n <br>Returns 9 if the file is corrupted.\n @since 11\n @version 1.0"]
5573 pub fn OH_Drawing_RegisterFont(
5574 fontCollection: *mut OH_Drawing_FontCollection,
5575 fontFamily: *const ::std::os::raw::c_char,
5576 familySrc: *const ::std::os::raw::c_char,
5577 ) -> u32;
5578}
5579extern "C" {
5580 #[doc = " @brief Registers a font buffer in the font manager, supporting data read from ttf and otf files.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param fontCollection Indicates the pointer to an <b>OH_Drawing_FontCollection</b> object.\n @param fontFamily Font name of the font to register.\n @param fontBuffer Buffer of the font file to register.\n @param length Length of the font file to register. Must match the actual length of fontBuffer.\n @return Result code.\n <br>Returns 0 if the operation is successful.\n <br>Returns 6 if fontBuffer is NULL.\n <br>Returns 7 if the buffer size is zero.\n <br>Returns 8 if fontCollection is NULL.\n @since 11\n @version 1.0"]
5581 pub fn OH_Drawing_RegisterFontBuffer(
5582 fontCollection: *mut OH_Drawing_FontCollection,
5583 fontFamily: *const ::std::os::raw::c_char,
5584 fontBuffer: *mut u8,
5585 length: usize,
5586 ) -> u32;
5587}
5588extern "C" {
5589 #[doc = " @brief Registers a custom font using a ttc/otc file, with the index parameter specifying the font index to register.\n\n @param fontCollection Pointer to an {@link OH_Drawing_FontCollection} object.\n @param fontFamily Family name of the font to register.\n @param familySrc Path of the font file to register.\n @param index Index of the font in the ttc/otc file. The value ranges from 0 to the total number of fonts minus 1.\n For non-ttc/otc files, set this parameter to 0.\n @return Result code. 0 indicates function execution is successful, 1 indicates file does not exist, 2 indicates file\n opening failure, 3 indicates file reading failure, 4 indicates file seeking failure, 5 indicates size obtaining\n failure, 8 indicates fontCollection is NULL, and 9 indicates file corruption.\n @since 23"]
5590 #[cfg(feature = "api-23")]
5591 pub fn OH_Drawing_RegisterFontByIndex(
5592 fontCollection: *mut OH_Drawing_FontCollection,
5593 fontFamily: *const ::std::os::raw::c_char,
5594 familySrc: *const ::std::os::raw::c_char,
5595 index: u32,
5596 ) -> u32;
5597}
5598extern "C" {
5599 #[doc = " @brief Registers a font using the font buffer of a TTC/OTC file.\n\n @param fontCollection Pointer to an {@link OH_Drawing_FontCollection} object.\n @param fontFamily Family name of the font to register.\n @param fontBuffer Font buffer of the font file to register.\n @param length Length of the byte stream data, which must match the actual length of fontBuffer.\n @param index Index of the font in the ttc/otc file. The value ranges from 0 to the number of fonts minus 1. For\n files in non-ttc/otc formats, set this parameter to 0.\n @return Result code.\n <br>Returns 0 the function is executed successfully.\n <br>Returns 6 if fontBuffer is NULL.\n <br>Returns 7 if the buffer size is zero.\n <br>Returns 8 if fontCollection is NULL.\n <br>Returns 9 if the file is corrupted.\n @since 23"]
5600 #[cfg(feature = "api-23")]
5601 pub fn OH_Drawing_RegisterFontBufferByIndex(
5602 fontCollection: *mut OH_Drawing_FontCollection,
5603 fontFamily: *const ::std::os::raw::c_char,
5604 fontBuffer: *mut u8,
5605 length: usize,
5606 index: u32,
5607 ) -> u32;
5608}
5609extern "C" {
5610 #[doc = " @brief Unregisters a custom font by font name.\n <br>Unregistering a font that is currently in use may lead to text rendering exceptions (such as garbled characters\n or missing glyphs).\n <br>All typesetting objects that use the unregistered font name should be destroyed and recreated.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param fontCollection Pointer to an {@link OH_Drawing_FontCollection} object.\n @param fontFamily Font name to unregister.\n @return Result code. Returns 0 if the function is executed successfully, 8 if the input parameter is invalid, and 1\n if the unregistration fails.\n @since 20"]
5611 #[cfg(feature = "api-20")]
5612 pub fn OH_Drawing_UnregisterFont(
5613 fontCollection: *mut OH_Drawing_FontCollection,
5614 fontFamily: *const ::std::os::raw::c_char,
5615 ) -> u32;
5616}
5617extern "C" {
5618 #[doc = " @brief Checks whether the system supports the font format of the specified path.\n\n @param path Absolute path of the font file.\n @return Returns **true** if the font is supported; returns **false** otherwise.\n @since 23"]
5619 #[cfg(feature = "api-23")]
5620 pub fn OH_Drawing_IsFontSupportedFromPath(path: *const ::std::os::raw::c_char) -> bool;
5621}
5622extern "C" {
5623 #[doc = " @brief Checks whether the system supports the font format specified in the buffer.\n\n @param data Pointer to the buffer that contains the font data.\n @param dataLength Size of the font data, in bytes. Must match the actual length of data.\n @return Returns **true** if the font is supported; returns **false** otherwise.\n @since 23"]
5624 #[cfg(feature = "api-23")]
5625 pub fn OH_Drawing_IsFontSupportedFromBuffer(data: *mut u8, dataLength: usize) -> bool;
5626}
5627#[doc = " Top left corner of the rounded rectangle."]
5628pub const OH_Drawing_CornerPos_CORNER_POS_TOP_LEFT: OH_Drawing_CornerPos = 0;
5629#[doc = " Top right corner of the rounded rectangle."]
5630pub const OH_Drawing_CornerPos_CORNER_POS_TOP_RIGHT: OH_Drawing_CornerPos = 1;
5631#[doc = " Bottom right corner of the rounded rectangle."]
5632pub const OH_Drawing_CornerPos_CORNER_POS_BOTTOM_RIGHT: OH_Drawing_CornerPos = 2;
5633#[doc = " Bottom left corner of the rounded rectangle."]
5634pub const OH_Drawing_CornerPos_CORNER_POS_BOTTOM_LEFT: OH_Drawing_CornerPos = 3;
5635#[doc = " @brief Defines an enum for the corner positions of a rounded rectangle.\n\n @since 12\n @version 1.0"]
5636pub type OH_Drawing_CornerPos = u32;
5637extern "C" {
5638 #[doc = " @brief Creates an **OH_Drawing_RoundRect** object. This API may return an error code. For details, call\n {@link OH_Drawing_ErrorCodeGet}\n .\n If **rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param rect Pointer to an **OH_Drawing_Rect** object.\n @param xRad Radius of the rounded corner on the X axis. A negative number is invalid.\n @param yRad Radius of the rounded corner on the Y axis. A negative number is invalid.\n @return Returns the pointer to the **OH_Drawing_RoundRect** object created.\n @since 11\n @version 1.0"]
5639 pub fn OH_Drawing_RoundRectCreate(
5640 rect: *const OH_Drawing_Rect,
5641 xRad: f32,
5642 yRad: f32,
5643 ) -> *mut OH_Drawing_RoundRect;
5644}
5645extern "C" {
5646 #[doc = " @brief Creates a copy of a rounded rectangle.\n\n @param roundRect Pointer to an {@link OH_Drawing_RoundRect} object.\n @return Returns the pointer to the new **OH_Drawing_RoundRect** object created.\n @since 20\n @version 1.0"]
5647 #[cfg(feature = "api-20")]
5648 pub fn OH_Drawing_RoundRectCopy(
5649 roundRect: *const OH_Drawing_RoundRect,
5650 ) -> *mut OH_Drawing_RoundRect;
5651}
5652extern "C" {
5653 #[doc = " @brief Sets the radii of the specified rounded corner in this rounded rectangle.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **roundRect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param roundRect Pointer to an **OH_Drawing_RoundRect** object.\n @param pos Position of the rounded corner. For details about the available options, see {@link OH_Drawing_CornerPos}.\n @param radii OH_Drawing_Corner_Radii struct, including the radii on the X axis and Y axis. A radius less than or\n equal to 0 is invalid.\n @since 12\n @version 1.0"]
5654 pub fn OH_Drawing_RoundRectSetCorner(
5655 roundRect: *mut OH_Drawing_RoundRect,
5656 pos: OH_Drawing_CornerPos,
5657 radii: OH_Drawing_Corner_Radii,
5658 );
5659}
5660extern "C" {
5661 #[doc = " @brief Obtains the radii of the specified rounded corner in a rounded rectangle.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **roundRect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param roundRect Pointer to an **OH_Drawing_RoundRect** object.\n @param pos Position of the rounded corner. For details about the available options, see {@link OH_Drawing_CornerPos}.\n @return Returns an OH_Drawing_Corner_Radii struct, including the radii on the X axis and Y axis.\n @since 12\n @version 1.0"]
5662 pub fn OH_Drawing_RoundRectGetCorner(
5663 roundRect: *mut OH_Drawing_RoundRect,
5664 pos: OH_Drawing_CornerPos,
5665 ) -> OH_Drawing_Corner_Radii;
5666}
5667extern "C" {
5668 #[doc = " @brief Destroys an **OH_Drawing_RoundRect** object and reclaims the memory occupied by the object.\n\n @param roundRect Pointer to an **OH_Drawing_RoundRect** object.\n @since 11\n @version 1.0"]
5669 pub fn OH_Drawing_RoundRectDestroy(roundRect: *mut OH_Drawing_RoundRect);
5670}
5671extern "C" {
5672 #[doc = " @brief Translates a rounded rectangle by an offset along the X axis and Y axis.\n\n @param roundRect Pointer to an {@link OH_Drawing_Point2D} object.\n @param dx X offset.\n @param dy Y offset.\n @return Returns one of the following result codes:\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if **roundRect** is NULL.\n @since 12\n @version 1.0"]
5673 pub fn OH_Drawing_RoundRectOffset(
5674 roundRect: *mut OH_Drawing_RoundRect,
5675 dx: f32,
5676 dy: f32,
5677 ) -> OH_Drawing_ErrorCode;
5678}
5679extern "C" {
5680 #[doc = " @brief Creates an **OH_Drawing_ShadowLayer** object.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **blurRadius** is less than or equal to 0, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned.\n\n @param blurRadius Radius of the shadow layer. The value must be greater than 0.\n @param x Offset on the X axis.\n @param y Offset on the Y axis.\n @param color Color of the shadow.\n @return Returns the pointer to the **OH_Drawing_ShadowLayer** object created.\n @since 12\n @version 1.0"]
5681 pub fn OH_Drawing_ShadowLayerCreate(
5682 blurRadius: f32,
5683 x: f32,
5684 y: f32,
5685 color: u32,
5686 ) -> *mut OH_Drawing_ShadowLayer;
5687}
5688extern "C" {
5689 #[doc = " @brief Destroys an **OH_Drawing_ShadowLayer** object and reclaims the memory occupied by the object.\n\n @param shadowLayer Pointer to the shadow layer.\n @since 12\n @version 1.0"]
5690 pub fn OH_Drawing_ShadowLayerDestroy(shadowLayer: *mut OH_Drawing_ShadowLayer);
5691}
5692extern "C" {
5693 #[doc = " @brief Creates an **OH_Drawing_Surface** object using the GPU context to manage the content drawn on the canvas.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **gpuContext** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param gpuContext Pointer to an {@link OH_Drawing_GpuContext} object.\n @param flag Whether the memory allocation is counted in the cache budget. **true** means yes; **false** otherwise.\n @param imageInfo Image information struct.\n @return Returns a pointer to the created {@link OH_Drawing_Surface} object.\n @since 12\n @version 1.0"]
5694 pub fn OH_Drawing_SurfaceCreateFromGpuContext(
5695 gpuContext: *mut OH_Drawing_GpuContext,
5696 flag: bool,
5697 imageInfo: OH_Drawing_Image_Info,
5698 ) -> *mut OH_Drawing_Surface;
5699}
5700extern "C" {
5701 #[doc = " @brief Creates an **OH_Drawing_Surface** object bound to the window using the GPU context to manage the content\n drawn on the canvas.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if **gpuContext** or **window** is NULL.\n\n @param gpuContext Pointer to an {@link OH_Drawing_GpuContext} object.\n This object must be created by {@link OH_Drawing_GpuContextCreate}. Otherwise, the **OH_Drawing_Surface** object\n fails to be created.\n @param imageInfo Image information struct.\n @param window Pointer to the window object.\n @return Returns a pointer to the created {@link OH_Drawing_Surface} object.\n @since 16\n @version 1.0"]
5702 #[cfg(feature = "api-16")]
5703 pub fn OH_Drawing_SurfaceCreateOnScreen(
5704 gpuContext: *mut OH_Drawing_GpuContext,
5705 imageInfo: OH_Drawing_Image_Info,
5706 window: *mut ::std::os::raw::c_void,
5707 ) -> *mut OH_Drawing_Surface;
5708}
5709extern "C" {
5710 #[doc = " @brief Obtains a canvas from an **OH_Drawing_Surface** object.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **surface** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param surface Pointer to an **OH_Drawing_Surface** object.\n @return Returns a pointer to the created {@link OH_Drawing_Canvas} object. The pointer returned does not need to be\n managed by the caller.\n @since 12\n @version 1.0"]
5711 pub fn OH_Drawing_SurfaceGetCanvas(surface: *mut OH_Drawing_Surface) -> *mut OH_Drawing_Canvas;
5712}
5713extern "C" {
5714 #[doc = " @brief Pushes the drawing content from an **OH_Drawing_Surface** object to the GPU for rendering.\n\n @param surface Pointer to the created {@link OH_Drawing_Surface} object. This object must be created by calling\n {@link OH_Drawing_SurfaceCreateOnScreen}\n . Otherwise, calling the current API has no effect.\n @return Returns one of the following result codes:\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if **surface** is NULL.\n @since 16\n @version 1.0"]
5715 #[cfg(feature = "api-16")]
5716 pub fn OH_Drawing_SurfaceFlush(surface: *mut OH_Drawing_Surface) -> OH_Drawing_ErrorCode;
5717}
5718extern "C" {
5719 #[doc = " @brief Destroys an **OH_Drawing_Surface** object and reclaims the memory occupied.\n\n @param surface Pointer to an **OH_Drawing_Surface** object.\n @since 12\n @version 1.0"]
5720 pub fn OH_Drawing_SurfaceDestroy(surface: *mut OH_Drawing_Surface);
5721}
5722extern "C" {
5723 #[doc = " @brief Creates an **OH_Drawing_TextBlobBuilder** object.\n\n @return Returns the pointer to the **OH_Drawing_TextBlobBuilder** object created.\n @since 11\n @version 1.0"]
5724 pub fn OH_Drawing_TextBlobBuilderCreate() -> *mut OH_Drawing_TextBlobBuilder;
5725}
5726extern "C" {
5727 #[doc = " @brief Creates an **OH_Drawing_TextBlob** object from the text.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **text** or **font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n If **textEncoding** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is\n returned.\n\n @param text Pointer to the text.\n @param byteLength Length of the text, in bytes.\n @param font Pointer to the {@link OH_Drawing_Font} object.\n @param textEncoding Text encoding type {@link OH_Drawing_TextEncoding}.\n @return Returns a pointer to the created {@link OH_Drawing_TextBlob} object.\n @since 12\n @version 1.0"]
5728 pub fn OH_Drawing_TextBlobCreateFromText(
5729 text: *const ::std::os::raw::c_void,
5730 byteLength: usize,
5731 font: *const OH_Drawing_Font,
5732 textEncoding: OH_Drawing_TextEncoding,
5733 ) -> *mut OH_Drawing_TextBlob;
5734}
5735extern "C" {
5736 #[doc = " @brief Creates an **OH_Drawing_TextBlob** object from the text. The coordinates of each character in the **\n OH_Drawing_TextBlob** object are determined by the coordinate information in the **OH_Drawing_Point2D** array.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If any of **text**, **point2D**, and **font** is NULL or **byteLength** is **0**, **\n OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n If **textEncoding** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is\n returned.\n\n @param text Pointer to the text.\n @param byteLength Length of the text, in bytes.\n @param point2D Pointer to the start address of the {@link OH_Drawing_Point2D}\n array. The number of entries in the array is determined by {@link OH_Drawing_FontCountText}\n .\n @param font Pointer to the {@link OH_Drawing_Font} object.\n @param textEncoding Text encoding type {@link OH_Drawing_TextEncoding}.\n @return Returns a pointer to the created {@link OH_Drawing_TextBlob} object.\n @since 12\n @version 1.0"]
5737 pub fn OH_Drawing_TextBlobCreateFromPosText(
5738 text: *const ::std::os::raw::c_void,
5739 byteLength: usize,
5740 point2D: *mut OH_Drawing_Point2D,
5741 font: *const OH_Drawing_Font,
5742 textEncoding: OH_Drawing_TextEncoding,
5743 ) -> *mut OH_Drawing_TextBlob;
5744}
5745extern "C" {
5746 #[doc = " @brief Creates an **OH_Drawing_TextBlob** object from a string.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **str** or **font** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n If **textEncoding** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is\n returned.\n\n @param str Pointer to a string.\n @param font Pointer to the {@link OH_Drawing_Font} object.\n @param textEncoding Text encoding type {@link OH_Drawing_TextEncoding}.\n @return Returns a pointer to the created {@link OH_Drawing_TextBlob} object.\n @since 12\n @version 1.0"]
5747 pub fn OH_Drawing_TextBlobCreateFromString(
5748 str_: *const ::std::os::raw::c_char,
5749 font: *const OH_Drawing_Font,
5750 textEncoding: OH_Drawing_TextEncoding,
5751 ) -> *mut OH_Drawing_TextBlob;
5752}
5753extern "C" {
5754 #[doc = " @brief Obtains the bounds of an **OH_Drawing_TextBlob** object.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **textBlob** or **rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param textBlob Pointer to the {@link OH_Drawing_TextBlob} object.\n @param rect Pointer to the {@link OH_Drawing_Rect} object. You can call {@link OH_Drawing_Rect} to create a\n rectangle object.\n @since 12\n @version 1.0"]
5755 pub fn OH_Drawing_TextBlobGetBounds(
5756 textBlob: *mut OH_Drawing_TextBlob,
5757 rect: *mut OH_Drawing_Rect,
5758 );
5759}
5760extern "C" {
5761 #[doc = " @brief Obtains the unique identifier of a text blob. The identifier is a non-zero value.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **textBlob** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param textBlob Pointer to the {@link OH_Drawing_TextBlob} object.\n @return Returns the unique identifier of the text blob.\n @since 12\n @version 1.0"]
5762 pub fn OH_Drawing_TextBlobUniqueID(textBlob: *const OH_Drawing_TextBlob) -> u32;
5763}
5764#[doc = " @brief This struct describes a run, which provides storage for glyphs and positions.\n\n @since 11\n @version 1.0"]
5765#[repr(C)]
5766#[derive(Debug, Copy, Clone)]
5767pub struct OH_Drawing_RunBuffer {
5768 #[doc = " Storage for glyph indexes in the run."]
5769 pub glyphs: *mut u16,
5770 #[doc = " Storage for glyph positions in the run."]
5771 pub pos: *mut f32,
5772 #[doc = " Storage for UTF-8 encoded text units in the run."]
5773 pub utf8text: *mut ::std::os::raw::c_char,
5774 #[doc = " Storage for glyph clusters (index of the UTF-8 encoded text unit) in the run."]
5775 pub clusters: *mut u32,
5776}
5777extern "C" {
5778 #[doc = " @brief Allocates a run to store glyphs and positions. The pointer returned does not need to be managed by the caller.\n It can no longer be used after {@link OH_Drawing_TextBlobBuilderMake} is called.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If either **textBlobBuilder** or **font** is NULL or **count** is less than or equal to 0, **\n OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param textBlobBuilder Pointer to an **OH_Drawing_TextBlobBuilder** object.\n @param font Pointer to an **OH_Drawing_Font** object.\n @param count Number of text blobs.\n @param rect Rectangle of the text blob. The value NULL means that no rectangle is set.\n @return Returns the pointer to the **OH_Drawing_RunBuffer** object created.\n @since 11\n @version 1.0"]
5779 pub fn OH_Drawing_TextBlobBuilderAllocRunPos(
5780 textBlobBuilder: *mut OH_Drawing_TextBlobBuilder,
5781 font: *const OH_Drawing_Font,
5782 count: i32,
5783 rect: *const OH_Drawing_Rect,
5784 ) -> *const OH_Drawing_RunBuffer;
5785}
5786extern "C" {
5787 #[doc = " @brief Makes an **OH_Drawing_TextBlob** object from an **OH_Drawing_TextBlobBuilder**.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **textBlobBuilder** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param textBlobBuilder Pointer to an **OH_Drawing_TextBlobBuilder** object.\n @return Returns the pointer to the **OH_Drawing_TextBlob** object created.\n @since 11\n @version 1.0"]
5788 pub fn OH_Drawing_TextBlobBuilderMake(
5789 textBlobBuilder: *mut OH_Drawing_TextBlobBuilder,
5790 ) -> *mut OH_Drawing_TextBlob;
5791}
5792extern "C" {
5793 #[doc = " @brief Destroys an **OH_Drawing_TextBlob** object and reclaims the memory occupied by the object.\n\n @param textBlob Pointer to an **OH_Drawing_TextBlob** object.\n @since 11\n @version 1.0"]
5794 pub fn OH_Drawing_TextBlobDestroy(textBlob: *mut OH_Drawing_TextBlob);
5795}
5796extern "C" {
5797 #[doc = " @brief Destroys an **OH_Drawing_TextBlobBuilder** object and reclaims the memory occupied by the object.\n\n @param textBlobBuilder Pointer to an **OH_Drawing_TextBlobBuilder** object.\n @since 11\n @version 1.0"]
5798 pub fn OH_Drawing_TextBlobBuilderDestroy(textBlobBuilder: *mut OH_Drawing_TextBlobBuilder);
5799}
5800#[doc = " All font types."]
5801#[cfg(feature = "api-14")]
5802pub const OH_Drawing_SystemFontType_ALL: OH_Drawing_SystemFontType = 1;
5803#[doc = " System font type."]
5804#[cfg(feature = "api-14")]
5805pub const OH_Drawing_SystemFontType_GENERIC: OH_Drawing_SystemFontType = 2;
5806#[doc = " Style font type."]
5807#[cfg(feature = "api-14")]
5808pub const OH_Drawing_SystemFontType_STYLISH: OH_Drawing_SystemFontType = 4;
5809#[doc = " User-installed font type."]
5810#[cfg(feature = "api-14")]
5811pub const OH_Drawing_SystemFontType_INSTALLED: OH_Drawing_SystemFontType = 8;
5812#[doc = " Custom font type.\n @since 18"]
5813#[cfg(feature = "api-18")]
5814pub const OH_Drawing_SystemFontType_CUSTOMIZED: OH_Drawing_SystemFontType = 16;
5815#[doc = " @brief Defines an enum for the system font types.\n\n @since 14"]
5816#[cfg(feature = "api-14")]
5817pub type OH_Drawing_SystemFontType = u32;
5818#[doc = " Font file path, of the {@link OH_Drawing_String} type."]
5819#[cfg(feature = "api-22")]
5820pub const OH_Drawing_FontFullDescriptorAttributeId_FULL_DESCRIPTOR_ATTR_S_PATH:
5821 OH_Drawing_FontFullDescriptorAttributeId = 0;
5822#[doc = " Postscript font name, of the {@link OH_Drawing_String} type."]
5823#[cfg(feature = "api-22")]
5824pub const OH_Drawing_FontFullDescriptorAttributeId_FULL_DESCRIPTOR_ATTR_S_POSTSCRIPT_NAME:
5825 OH_Drawing_FontFullDescriptorAttributeId = 1;
5826#[doc = " Font name, of the {@link OH_Drawing_String} type."]
5827#[cfg(feature = "api-22")]
5828pub const OH_Drawing_FontFullDescriptorAttributeId_FULL_DESCRIPTOR_ATTR_S_FULL_NAME:
5829 OH_Drawing_FontFullDescriptorAttributeId = 2;
5830#[doc = " Font family name, of the {@link OH_Drawing_String} type."]
5831#[cfg(feature = "api-22")]
5832pub const OH_Drawing_FontFullDescriptorAttributeId_FULL_DESCRIPTOR_ATTR_S_FAMILY_NAME:
5833 OH_Drawing_FontFullDescriptorAttributeId = 3;
5834#[doc = " Font subfamily name, of the {@link OH_Drawing_String} type."]
5835#[cfg(feature = "api-22")]
5836pub const OH_Drawing_FontFullDescriptorAttributeId_FULL_DESCRIPTOR_ATTR_S_SUB_FAMILY_NAME:
5837 OH_Drawing_FontFullDescriptorAttributeId = 4;
5838#[doc = " Font weight, of the int type."]
5839#[cfg(feature = "api-22")]
5840pub const OH_Drawing_FontFullDescriptorAttributeId_FULL_DESCRIPTOR_ATTR_I_WEIGHT:
5841 OH_Drawing_FontFullDescriptorAttributeId = 5;
5842#[doc = " Font width style, of the int type."]
5843#[cfg(feature = "api-22")]
5844pub const OH_Drawing_FontFullDescriptorAttributeId_FULL_DESCRIPTOR_ATTR_I_WIDTH:
5845 OH_Drawing_FontFullDescriptorAttributeId = 6;
5846#[doc = " Whether the font is italic, of the int type. **1** means that the font is italic; **0** otherwise."]
5847#[cfg(feature = "api-22")]
5848pub const OH_Drawing_FontFullDescriptorAttributeId_FULL_DESCRIPTOR_ATTR_I_ITALIC:
5849 OH_Drawing_FontFullDescriptorAttributeId = 7;
5850#[doc = " Whether the font is monospaced. The value is of the bool type. The value true means the font is monospaced, and\n false means the opposite."]
5851#[cfg(feature = "api-22")]
5852pub const OH_Drawing_FontFullDescriptorAttributeId_FULL_DESCRIPTOR_ATTR_B_MONO:
5853 OH_Drawing_FontFullDescriptorAttributeId = 8;
5854#[doc = " Whether the font supports the symbol font, of the bool type. **true** means yes; **false** otherwise."]
5855#[cfg(feature = "api-22")]
5856pub const OH_Drawing_FontFullDescriptorAttributeId_FULL_DESCRIPTOR_ATTR_B_SYMBOLIC:
5857 OH_Drawing_FontFullDescriptorAttributeId = 9;
5858#[doc = " Extracts the postscript name of the font based on the system language configuration.\n @since 23"]
5859#[cfg(feature = "api-23")]
5860pub const OH_Drawing_FontFullDescriptorAttributeId_FULL_DESCRIPTOR_ATTR_S_LOCAL_POSTSCRIPT_NAME:
5861 OH_Drawing_FontFullDescriptorAttributeId = 10;
5862#[doc = " Extracts the full name of the font based on the system language configuration.\n @since 23"]
5863#[cfg(feature = "api-23")]
5864pub const OH_Drawing_FontFullDescriptorAttributeId_FULL_DESCRIPTOR_ATTR_S_LOCAL_FULL_NAME:
5865 OH_Drawing_FontFullDescriptorAttributeId = 11;
5866#[doc = " Extracts the font family name based on the system language configuration.\n @since 23"]
5867#[cfg(feature = "api-23")]
5868pub const OH_Drawing_FontFullDescriptorAttributeId_FULL_DESCRIPTOR_ATTR_S_LOCAL_FAMILY_NAME:
5869 OH_Drawing_FontFullDescriptorAttributeId = 12;
5870#[doc = " Extracts the font subfamily name based on the system language configuration.\n @since 23"]
5871#[cfg(feature = "api-23")]
5872pub const OH_Drawing_FontFullDescriptorAttributeId_FULL_DESCRIPTOR_ATTR_S_LOCAL_SUB_FAMILY_NAME:
5873 OH_Drawing_FontFullDescriptorAttributeId = 13;
5874#[doc = " Font version.\n @since 23"]
5875#[cfg(feature = "api-23")]
5876pub const OH_Drawing_FontFullDescriptorAttributeId_FULL_DESCRIPTOR_ATTR_S_VERSION:
5877 OH_Drawing_FontFullDescriptorAttributeId = 14;
5878#[doc = " Font manufacturer information.\n @since 23"]
5879#[cfg(feature = "api-23")]
5880pub const OH_Drawing_FontFullDescriptorAttributeId_FULL_DESCRIPTOR_ATTR_S_MANUFACTURE:
5881 OH_Drawing_FontFullDescriptorAttributeId = 15;
5882#[doc = " The copyright of the font\n @since 23"]
5883#[cfg(feature = "api-23")]
5884pub const OH_Drawing_FontFullDescriptorAttributeId_FULL_DESCRIPTOR_ATTR_S_COPYRIGHT:
5885 OH_Drawing_FontFullDescriptorAttributeId = 16;
5886#[doc = " Font trademark information.\n @since 23"]
5887#[cfg(feature = "api-23")]
5888pub const OH_Drawing_FontFullDescriptorAttributeId_FULL_DESCRIPTOR_ATTR_S_TRADEMARK:
5889 OH_Drawing_FontFullDescriptorAttributeId = 17;
5890#[doc = " Font license information.\n @since 23"]
5891#[cfg(feature = "api-23")]
5892pub const OH_Drawing_FontFullDescriptorAttributeId_FULL_DESCRIPTOR_ATTR_S_LICENSE:
5893 OH_Drawing_FontFullDescriptorAttributeId = 18;
5894#[doc = " Font variable axis array.\n @since 24"]
5895#[cfg(feature = "api-24")]
5896pub const OH_Drawing_FontFullDescriptorAttributeId_FULL_DESCRIPTOR_ATTR_O_VARIATION_AXIS:
5897 OH_Drawing_FontFullDescriptorAttributeId = 19;
5898#[doc = " Font variable instance array.\n @since 24"]
5899#[cfg(feature = "api-24")]
5900pub const OH_Drawing_FontFullDescriptorAttributeId_FULL_DESCRIPTOR_ATTR_O_VARIATION_INSTANCE:
5901 OH_Drawing_FontFullDescriptorAttributeId = 20;
5902#[doc = " Font index.\n @since 23"]
5903#[cfg(feature = "api-23")]
5904pub const OH_Drawing_FontFullDescriptorAttributeId_FULL_DESCRIPTOR_ATTR_I_INDEX:
5905 OH_Drawing_FontFullDescriptorAttributeId = 21;
5906#[doc = " @brief Enumerates font descriptor attributes. You can use the corresponding APIs to obtain the attributes of\n different font descriptor types. For example, if **FULL_DESCRIPTOR_ATTR_I_WEIGHT** is of the int type, use the\n {@link OH_Drawing_GetFontFullDescriptorAttributeInt} API to obtain its attribute value.\n\n @since 22"]
5907#[cfg(feature = "api-22")]
5908pub type OH_Drawing_FontFullDescriptorAttributeId = u32;
5909#[doc = " Keyword identifier of the font variable axis."]
5910#[cfg(feature = "api-24")]
5911pub const OH_Drawing_FontVariationAxisAttributeId_FONT_VARIATION_AXIS_ATTR_S_KEY:
5912 OH_Drawing_FontVariationAxisAttributeId = 0;
5913#[doc = " Minimum value of the font variable axis."]
5914#[cfg(feature = "api-24")]
5915pub const OH_Drawing_FontVariationAxisAttributeId_FONT_VARIATION_AXIS_ATTR_D_MIN_VALUE:
5916 OH_Drawing_FontVariationAxisAttributeId = 1;
5917#[doc = " Maximum value of the font variable axis."]
5918#[cfg(feature = "api-24")]
5919pub const OH_Drawing_FontVariationAxisAttributeId_FONT_VARIATION_AXIS_ATTR_D_MAX_VALUE:
5920 OH_Drawing_FontVariationAxisAttributeId = 2;
5921#[doc = " Default value of the font variable axis."]
5922#[cfg(feature = "api-24")]
5923pub const OH_Drawing_FontVariationAxisAttributeId_FONT_VARIATION_AXIS_ATTR_D_DEFAULT_VALUE:
5924 OH_Drawing_FontVariationAxisAttributeId = 3;
5925#[doc = " Flag of the font variable axis. The value **0** indicates that the axis is visible to users, and the value **1**\n indicates that the axis should be hidden."]
5926#[cfg(feature = "api-24")]
5927pub const OH_Drawing_FontVariationAxisAttributeId_FONT_VARIATION_AXIS_ATTR_I_FLAGS:
5928 OH_Drawing_FontVariationAxisAttributeId = 4;
5929#[doc = " English name of the font variable axis."]
5930#[cfg(feature = "api-24")]
5931pub const OH_Drawing_FontVariationAxisAttributeId_FONT_VARIATION_AXIS_ATTR_S_NAME:
5932 OH_Drawing_FontVariationAxisAttributeId = 5;
5933#[doc = " Localized name of the font variable axis."]
5934#[cfg(feature = "api-24")]
5935pub const OH_Drawing_FontVariationAxisAttributeId_FONT_VARIATION_AXIS_ATTR_S_LOCAL_NAME:
5936 OH_Drawing_FontVariationAxisAttributeId = 6;
5937#[doc = " @brief Enumerates font variable axis attributes.\n\n @since 24"]
5938#[cfg(feature = "api-24")]
5939pub type OH_Drawing_FontVariationAxisAttributeId = u32;
5940#[doc = " English name of the font variable instance."]
5941#[cfg(feature = "api-24")]
5942pub const OH_Drawing_FontVariationInstanceAttributeId_FONT_VARIATION_INSTANCE_ATTR_S_NAME:
5943 OH_Drawing_FontVariationInstanceAttributeId = 0;
5944#[doc = " Localized name of the font variable instance."]
5945#[cfg(feature = "api-24")]
5946pub const OH_Drawing_FontVariationInstanceAttributeId_FONT_VARIATION_INSTANCE_ATTR_S_LOCAL_NAME:
5947 OH_Drawing_FontVariationInstanceAttributeId = 1;
5948#[doc = " @brief Enumerates font variable instance attributes.\n\n @since 24"]
5949#[cfg(feature = "api-24")]
5950pub type OH_Drawing_FontVariationInstanceAttributeId = u32;
5951#[doc = " @brief Variable font attribute key-value pair.\n\n @since 24"]
5952#[cfg(feature = "api-24")]
5953#[repr(C)]
5954#[derive(Debug, Copy, Clone)]
5955pub struct OH_Drawing_FontVariationInstanceCoordinate {
5956 #[doc = " String identified by the keyword in the variable font attribute key-value pair."]
5957 pub axisKey: *mut ::std::os::raw::c_char,
5958 #[doc = " Value of the variable font attribute key-value pair."]
5959 pub value: f64,
5960}
5961extern "C" {
5962 #[doc = " @brief Obtains all system font descriptors that match a font descriptor. In the {@link OH_Drawing_FontDescriptor}\n struct, the **path** field is not used for matching, and other fields are valid only when they are not set to their\n default values.\n <br>If all fields in **desc** are set to their default values, all system font descriptors are returned.\n <br>If no matching is found, NULL is returned. Call {@link OH_Drawing_DestroyFontDescriptors} to release this\n pointer when the object is no longer needed.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param desc Pointer to the {@link OH_Drawing_FontDescriptor} object.\n <br>It is recommended to use {@link OH_Drawing_CreateFontDescriptor} to obtain a valid\n {@link OH_Drawing_FontDescriptor} instance.\n <br>If you create a {@link OH_Drawing_FontDescriptor} instance yourself, ensure that the fields not used for\n matching are set to default values.\n @param num Output parameter. Used to receive the number of members in the returned array.\n @return An array of {@link OH_Drawing_FontDescriptor} objects. Use {@link OH_Drawing_DestroyFontDescriptors} to\n release the array.\n @since 18"]
5963 #[cfg(feature = "api-18")]
5964 pub fn OH_Drawing_MatchFontDescriptors(
5965 desc: *mut OH_Drawing_FontDescriptor,
5966 num: *mut usize,
5967 ) -> *mut OH_Drawing_FontDescriptor;
5968}
5969extern "C" {
5970 #[doc = " @brief Releases an array of {@link OH_Drawing_FontDescriptor} objects.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param descriptors Pointer to the array of {@link OH_Drawing_FontDescriptor} objects to be released.\n @param num Number of members in an array of {@link OH_Drawing_FontDescriptor} objects.\n @since 18"]
5971 #[cfg(feature = "api-18")]
5972 pub fn OH_Drawing_DestroyFontDescriptors(
5973 descriptors: *mut OH_Drawing_FontDescriptor,
5974 num: usize,
5975 );
5976}
5977extern "C" {
5978 #[doc = " @brief Obtains the specified font descriptor based on the font name and font type. This API supports system fonts,\n style fonts, and user-installed fonts. If the acquisition fails, NULL is returned.\n <br>A font descriptor is a data structure that describes font characteristics. It contains detailed information that\n defines the appearance and properties of a font.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param fullName Pointer to the font name, which is {@link OH_Drawing_String}.\n @param fontType Enum for the system font types, which is {@link OH_Drawing_SystemFontType}.\n @return Pointer to an {@link OH_Drawing_FontDescriptor} object. Call {@link OH_Drawing_DestroyFontDescriptor} to\n release this pointer when the object is no longer needed.\n @since 14"]
5979 #[cfg(feature = "api-14")]
5980 pub fn OH_Drawing_GetFontDescriptorByFullName(
5981 fullName: *const OH_Drawing_String,
5982 fontType: OH_Drawing_SystemFontType,
5983 ) -> *mut OH_Drawing_FontDescriptor;
5984}
5985extern "C" {
5986 #[doc = " @brief Obtains an array of font names by font type.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param fontType Enum for the system font types, which is {@link OH_Drawing_SystemFontType}.\n @return Returns the pointer to the {@link OH_Drawing_Array} object of the corresponding font type. Call\n {@link OH_Drawing_DestroySystemFontFullNames} to release this pointer when the object is no longer needed.\n @since 14"]
5987 #[cfg(feature = "api-14")]
5988 pub fn OH_Drawing_GetSystemFontFullNamesByType(
5989 fontType: OH_Drawing_SystemFontType,
5990 ) -> *mut OH_Drawing_Array;
5991}
5992extern "C" {
5993 #[doc = " @brief Obtains the font name at the corresponding position in the font name array by index. If the index is out of\n range or the array is invalid, NULL is returned.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param fullNameArray Pointer to an {@link OH_Drawing_Array} object.\n @param index Index of the font in the array.\n @return Returns the pointer to the font name, which is an {@link OH_Drawing_String} object.\n @since 14"]
5994 #[cfg(feature = "api-14")]
5995 pub fn OH_Drawing_GetSystemFontFullNameByIndex(
5996 fullNameArray: *mut OH_Drawing_Array,
5997 index: usize,
5998 ) -> *const OH_Drawing_String;
5999}
6000extern "C" {
6001 #[doc = " @brief Releases the memory occupied by the font name array obtained by font type.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param fullNameArray Pointer to an {@link OH_Drawing_Array} object.\n @since 14"]
6002 #[cfg(feature = "api-14")]
6003 pub fn OH_Drawing_DestroySystemFontFullNames(fullNameArray: *mut OH_Drawing_Array);
6004}
6005extern "C" {
6006 #[doc = " @brief Obtains the font descriptor array based on the original binary data.\n\n @param data Pointer to the raw binary font data buffer.\n @param size Size of the font data buffer, in bytes.\n @return Returns the pointer to the {@link OH_Drawing_Array} array of the font descriptor corresponding to the font\n file. Call {@link OH_Drawing_DestroyFontFullDescriptors} to release the pointer when the **OH_Drawing_Array**\n object is no longer needed.\n <br>Returns NULL if the operation fails due to an invalid data format or parsing error.\n @since 22"]
6007 #[cfg(feature = "api-22")]
6008 pub fn OH_Drawing_GetFontFullDescriptorsFromStream(
6009 data: *const ::std::os::raw::c_void,
6010 size: usize,
6011 ) -> *mut OH_Drawing_Array;
6012}
6013extern "C" {
6014 #[doc = " @brief Obtains an array of font descriptors based on the font file path.\n\n @param path Path of the font file to be queried.\n @return Returns the pointer to the {@link OH_Drawing_Array} array of the font descriptor corresponding to the font\n file. Call {@link OH_Drawing_DestroyFontFullDescriptors} to release the pointer when the **OH_Drawing_Array**\n object is no longer needed.\n <br>Returns NULL if the font file is not found, the font file path is invalid, the font file does not have the\n required permission, or the file is not in the font format.\n @since 22"]
6015 #[cfg(feature = "api-22")]
6016 pub fn OH_Drawing_GetFontFullDescriptorsFromPath(
6017 path: *const ::std::os::raw::c_char,
6018 ) -> *mut OH_Drawing_Array;
6019}
6020extern "C" {
6021 #[doc = " @brief Obtains the font descriptor from the font descriptor array based on the index.\n\n @param descriptorArray Pointer to the font descriptor array {@link OH_Drawing_Array}.\n @param index Index of the array, starting from 0.\n @return Returns the pointer to the font descriptor object {@link OH_Drawing_FontFullDescriptor} at the specified\n index.\n <br>Returns NULL if the index is out of range or the array is invalid.\n @since 22"]
6022 #[cfg(feature = "api-22")]
6023 pub fn OH_Drawing_GetFontFullDescriptorByIndex(
6024 descriptorArray: *mut OH_Drawing_Array,
6025 index: usize,
6026 ) -> *const OH_Drawing_FontFullDescriptor;
6027}
6028extern "C" {
6029 #[doc = " @brief Releases the memory occupied by the font descriptor array.\n\n @param descriptorArray Pointer to the font descriptor array {@link OH_Drawing_Array}.\n @since 22"]
6030 #[cfg(feature = "api-22")]
6031 pub fn OH_Drawing_DestroyFontFullDescriptors(descriptorArray: *mut OH_Drawing_Array);
6032}
6033extern "C" {
6034 #[doc = " @brief Releases the memory occupied by the font descriptor pointer. This function can be used to release the font\n descriptor pointer obtained by the {@link OH_Drawing_GetFontFullDescriptorByFullName} API.\n\n @param descriptor Pointer to the font descriptor object {@link OH_Drawing_FontFullDescriptor}.\n @since 24"]
6035 #[cfg(feature = "api-24")]
6036 pub fn OH_Drawing_DestroyFontFullDescriptor(descriptor: *const OH_Drawing_FontFullDescriptor);
6037}
6038extern "C" {
6039 #[doc = " @brief Obtains the Unicode code array from a font file.\n\n @param fontSrc Font file path.\n @param index Index of the font in the ttc/otc file. The value ranges from 0 to Font Count minus 1. Set this\n parameter to 0 for non-ttc/otc files.\n @param unicodeArray Output parameter, which is used to receive the Unicode array. Use **free()** to release the\n Unicode array when the array is no longer needed.\n @param arrayLength Output parameter, which is used to receive the length of the Unicode array.\n @return Result code.\n <br>Returns OH_DRAWING_SUCCESS if the operation is successful.\n <br>Returns OH_DRAWING_ERROR_INCORRECT_PARAMETER if the font path is invalid, a non-font file is passed in, or\n the unicodeArray or arrayLength parameter is NULL.\n @since 23"]
6040 #[cfg(feature = "api-23")]
6041 pub fn OH_Drawing_GetFontUnicodeArrayFromFile(
6042 fontSrc: *const ::std::os::raw::c_char,
6043 index: u32,
6044 unicodeArray: *mut *mut i32,
6045 arrayLength: *mut i32,
6046 ) -> OH_Drawing_ErrorCode;
6047}
6048extern "C" {
6049 #[doc = " @brief Obtains the Unicode code array from a font byte stream buffer.\n\n @param fontBuffer Font file data.\n @param length Length of the font file data.\n @param index Index of the font in the ttc/otc file. The value ranges from 0 to Font Count - 1. For non-ttc/otc files,\n set this parameter to 0.\n @param unicodeArray Output parameter, which is used to receive the Unicode array. Use **free()** to release the\n Unicode array when the array is no longer needed.\n @param arrayLength Output parameter, which is used to receive the length of the Unicode array.\n @return Result code.\n <br>Returns OH_DRAWING_SUCCESS if the operation is successful.\n <br>Returns OH_DRAWING_ERROR_INCORRECT_PARAMETER if the cached data is invalid, the cached data is not font file\n data, or the parameters unicodeArray and arrayLength are NULL.\n @since 23"]
6050 #[cfg(feature = "api-23")]
6051 pub fn OH_Drawing_GetFontUnicodeArrayFromBuffer(
6052 fontBuffer: *mut u8,
6053 length: usize,
6054 index: u32,
6055 unicodeArray: *mut *mut i32,
6056 arrayLength: *mut i32,
6057 ) -> OH_Drawing_ErrorCode;
6058}
6059extern "C" {
6060 #[doc = " @brief Obtains the attributes of a font descriptor of the int type.\n\n @param descriptor Pointer to the font descriptor object {@link OH_Drawing_FontFullDescriptor}.\n @param id Font descriptor attribute ID. You can obtain the font descriptor attribute from\n {@link OH_Drawing_FontFullDescriptorAttributeId}.\n @param value Pointer to the attribute of the **int** type. It is used as an output parameter.\n @return Returns the execution result.\n <br>**OH_DRAWING_SUCCESS** if the operation is successful.\n <br>**OH_DRAWING_ERROR_INCORRECT_PARAMETER** if the descriptor or value parameter is null.\n <br>**OH_DRAWING_ERROR_ATTRIBUTE_ID_MISMATCH** if the input attribute ID does not match the called function.\n @since 22"]
6061 #[cfg(feature = "api-22")]
6062 pub fn OH_Drawing_GetFontFullDescriptorAttributeInt(
6063 descriptor: *const OH_Drawing_FontFullDescriptor,
6064 id: OH_Drawing_FontFullDescriptorAttributeId,
6065 value: *mut ::std::os::raw::c_int,
6066 ) -> OH_Drawing_ErrorCode;
6067}
6068extern "C" {
6069 #[doc = " @brief Obtains the font descriptor attribute of the bool type.\n\n @param descriptor Pointer to the font descriptor object {@link OH_Drawing_FontFullDescriptor}.\n @param id Font descriptor attribute ID. You can obtain the font descriptor attribute from\n {@link OH_Drawing_FontFullDescriptorAttributeId}.\n @param value Pointer to the bool attribute It is used as an output parameter.\n @return Returns the execution result.\n <br>**OH_DRAWING_SUCCESS** if the operation is successful.\n <br>**OH_DRAWING_ERROR_INCORRECT_PARAMETER** if the descriptor or value parameter is null.\n <br>**OH_DRAWING_ERROR_ATTRIBUTE_ID_MISMATCH** if the input attribute ID does not match the called function.\n @since 22"]
6070 #[cfg(feature = "api-22")]
6071 pub fn OH_Drawing_GetFontFullDescriptorAttributeBool(
6072 descriptor: *const OH_Drawing_FontFullDescriptor,
6073 id: OH_Drawing_FontFullDescriptorAttributeId,
6074 value: *mut bool,
6075 ) -> OH_Drawing_ErrorCode;
6076}
6077extern "C" {
6078 #[doc = " @brief Obtains the attributes of the {@link OH_Drawing_String} font descriptor.\n\n @note The caller is responsible for manually releasing the internal <b>strData</b> member of the\n <b>OH_Drawing_String</b> structure when it is no longer needed.\n\n @param descriptor Pointer to the font descriptor object {@link OH_Drawing_FontFullDescriptor}.\n @param id Font descriptor attribute ID. You can obtain the font descriptor attribute from\n {@link OH_Drawing_FontFullDescriptorAttributeId}.\n @param str Pointer to the **OH_Drawing_String** attribute. It is used as an output parameter.\n @return Returns the execution result.\n <br>**OH_DRAWING_SUCCESS** if the operation is successful.\n <br>**OH_DRAWING_ERROR_INCORRECT_PARAMETER** if **descriptor** or **str** is a null pointer.\n <br>**OH_DRAWING_ERROR_ATTRIBUTE_ID_MISMATCH** if the input attribute ID does not match the called function.\n @since 22"]
6079 #[cfg(feature = "api-22")]
6080 pub fn OH_Drawing_GetFontFullDescriptorAttributeString(
6081 descriptor: *const OH_Drawing_FontFullDescriptor,
6082 id: OH_Drawing_FontFullDescriptorAttributeId,
6083 str_: *mut OH_Drawing_String,
6084 ) -> OH_Drawing_ErrorCode;
6085}
6086extern "C" {
6087 #[doc = " @brief Obtains the object array attributes of the font descriptor.\n\n @param descriptor Pointer to the font descriptor object {@link OH_Drawing_FontFullDescriptor}.\n @param id Font descriptor attribute ID. You can obtain the font descriptor attribute from\n {@link OH_Drawing_FontFullDescriptorAttributeId}.\n @return Array of objects returned, or NULL if the retrieval fails. When id is FULL_DESCRIPTOR_ATTR_O_VARIATION_AXIS,\n use the {@link OH_Drawing_DestroyFontVariationAxis} API to release it when it is no longer needed. When id is\n FULL_DESCRIPTOR_ATTR_O_VARIATION_INSTANCE, use the {@link OH_Drawing_DestroyFontVariationInstance} API to\n release it when it is no longer needed.\n @since 24"]
6088 #[cfg(feature = "api-24")]
6089 pub fn OH_Drawing_GetFontFullDescriptorAttributeArray(
6090 descriptor: *const OH_Drawing_FontFullDescriptor,
6091 id: OH_Drawing_FontFullDescriptorAttributeId,
6092 ) -> *mut OH_Drawing_Array;
6093}
6094extern "C" {
6095 #[doc = " @brief Obtains the corresponding font variable axis from the font variable axis array by index.\n\n @param array Pointer to the font variation axis array {@link OH_Drawing_Array}, obtained through\n {@link OH_Drawing_GetFontFullDescriptorAttributeArray}.\n @param index Index of the array, starting from 0.\n @return Returns the pointer to the font variable axis object {@link OH_Drawing_FontVariationAxis} at the specified\n index.\n <br>Returns NULL if the index is out of range or the array is invalid.\n @since 24"]
6096 #[cfg(feature = "api-24")]
6097 pub fn OH_Drawing_GetFontVariationAxisByIndex(
6098 array: *mut OH_Drawing_Array,
6099 index: usize,
6100 ) -> *mut OH_Drawing_FontVariationAxis;
6101}
6102extern "C" {
6103 #[doc = " @brief Releases the memory occupied by the font variable axis array.\n\n @param fontVariaAxisArray Pointer to the font variable axis array object {@link OH_Drawing_Array}.\n @since 24"]
6104 #[cfg(feature = "api-24")]
6105 pub fn OH_Drawing_DestroyFontVariationAxis(fontVariaAxisArray: *mut OH_Drawing_Array);
6106}
6107extern "C" {
6108 #[doc = " @brief Obtains the font variable axis attributes of the double type.\n\n @param variationAxis Pointer to the font variable axis object {@link OH_Drawing_FontVariationAxis}.\n @param id Font variable axis attribute ID. You can obtain the font variable axis attribute from\n {@link OH_Drawing_FontVariationAxisAttributeId}.\n @param value Pointer to the attributes of the double type. It is used as an output parameter.\n @return Returns the execution result.\n <br>**OH_DRAWING_SUCCESS** if the operation is successful.\n <br>**OH_DRAWING_ERROR_INCORRECT_PARAMETER** if the parameter **variationAxis** or **value** is a null pointer.\n <br>**OH_DRAWING_ERROR_ATTRIBUTE_ID_MISMATCH** if the input attribute ID does not match the called function.\n @since 24"]
6109 #[cfg(feature = "api-24")]
6110 pub fn OH_Drawing_GetFontVariationAxisAttributeDouble(
6111 variationAxis: *mut OH_Drawing_FontVariationAxis,
6112 id: OH_Drawing_FontVariationAxisAttributeId,
6113 value: *mut f64,
6114 ) -> OH_Drawing_ErrorCode;
6115}
6116extern "C" {
6117 #[doc = " @brief Obtains the font variable axis attributes of the int type.\n\n @param variationAxis Pointer to the font variable axis object {@link OH_Drawing_FontVariationAxis}.\n @param id Font variable axis attribute ID. You can obtain the font variable axis attribute from\n {@link OH_Drawing_FontVariationAxisAttributeId}.\n @param value Pointer to the attribute of the **int** type. It is used as an output parameter.\n @return Returns the execution result.\n <br>**OH_DRAWING_SUCCESS** if the operation is successful.\n <br>**OH_DRAWING_ERROR_INCORRECT_PARAMETER** if the parameter **variationAxis** or **value** is a null pointer.\n <br>**OH_DRAWING_ERROR_ATTRIBUTE_ID_MISMATCH** if the input attribute ID does not match the called function.\n @since 24"]
6118 #[cfg(feature = "api-24")]
6119 pub fn OH_Drawing_GetFontVariationAxisAttributeInt(
6120 variationAxis: *mut OH_Drawing_FontVariationAxis,
6121 id: OH_Drawing_FontVariationAxisAttributeId,
6122 value: *mut ::std::os::raw::c_int,
6123 ) -> OH_Drawing_ErrorCode;
6124}
6125extern "C" {
6126 #[doc = " @brief Obtains the font variable axis attributes of the {@link OH_Drawing_String} type.\n\n @note The caller is responsible for manually releasing the internal <b>strData</b> member of the\n <b>OH_Drawing_String</b> structure when it is no longer needed.\n\n @param variationAxis Pointer to the font variable axis object {@link OH_Drawing_FontVariationAxis}.\n @param id Font variable axis attribute ID. You can obtain the font variable axis attribute from\n {@link OH_Drawing_FontVariationAxisAttributeId}.\n @param str Pointer to the **OH_Drawing_String** attribute. It is used as an output parameter.\n @return Returns the execution result.\n <br>**OH_DRAWING_SUCCESS** if the operation is successful.\n <br>**OH_DRAWING_ERROR_INCORRECT_PARAMETER** if the parameter **variationAxis** or **str** is a null pointer.\n <br>**OH_DRAWING_ERROR_ATTRIBUTE_ID_MISMATCH** if the input attribute ID does not match the called function.\n @since 24"]
6127 #[cfg(feature = "api-24")]
6128 pub fn OH_Drawing_GetFontVariationAxisAttributeStr(
6129 variationAxis: *mut OH_Drawing_FontVariationAxis,
6130 id: OH_Drawing_FontVariationAxisAttributeId,
6131 str_: *mut OH_Drawing_String,
6132 ) -> OH_Drawing_ErrorCode;
6133}
6134extern "C" {
6135 #[doc = " @brief Obtains the corresponding font variable instance from the font variable instance array by index.\n\n @param array Pointer to the font variation instance array {@link OH_Drawing_Array}. Obtained through\n {@link OH_Drawing_GetFontFullDescriptorAttributeArray}.\n @param index Index of the array, starting from 0.\n @return Returns the pointer to the font variable instance object {@link OH_Drawing_FontVariationInstance} at the\n specified index.\n <br>Returns NULL if the index is out of range or the array is invalid.\n @since 24"]
6136 #[cfg(feature = "api-24")]
6137 pub fn OH_Drawing_GetFontVariationInstanceByIndex(
6138 array: *mut OH_Drawing_Array,
6139 index: usize,
6140 ) -> *mut OH_Drawing_FontVariationInstance;
6141}
6142extern "C" {
6143 #[doc = " @brief Releases the memory occupied by the font variable instance array.\n\n @param fontVariaAxisInstance Pointer to the font variable instance array object {@link OH_Drawing_Array}.\n @since 24"]
6144 #[cfg(feature = "api-24")]
6145 pub fn OH_Drawing_DestroyFontVariationInstance(fontVariaAxisInstance: *mut OH_Drawing_Array);
6146}
6147extern "C" {
6148 #[doc = " @brief Obtains the font variable instance attributes of the {@link OH_Drawing_String} type.\n\n @note The caller is responsible for manually releasing the internal <b>strData</b> member of the\n <b>OH_Drawing_String</b> structure when it is no longer needed.\n\n @param variationInstance Pointer to the font variable instance object {@link OH_Drawing_FontVariationInstance}.\n @param id Font variable instance attribute ID. You can obtain the font variable instance attribute from\n {@link OH_Drawing_FontVariationInstanceAttributeId}.\n @param str Pointer to the **OH_Drawing_String** attribute. It is used as an output parameter.\n @return Returns the execution result.\n <br>**OH_DRAWING_SUCCESS** if the operation is successful.\n <br>**OH_DRAWING_ERROR_INCORRECT_PARAMETER** if the parameter **variationInstance** or **str** is a null pointer.\n <br>**OH_DRAWING_ERROR_ATTRIBUTE_ID_MISMATCH** if the input attribute ID does not match the called function.\n @since 24"]
6149 #[cfg(feature = "api-24")]
6150 pub fn OH_Drawing_GetFontVariationInstanceAttributeStr(
6151 variationInstance: *mut OH_Drawing_FontVariationInstance,
6152 id: OH_Drawing_FontVariationInstanceAttributeId,
6153 str_: *mut OH_Drawing_String,
6154 ) -> OH_Drawing_ErrorCode;
6155}
6156extern "C" {
6157 #[doc = " @brief Obtains the variable font attribute object of the font variable instance.\n\n @param variationInstance Pointer to the font variable instance.\n @param arrayLength Pointer to the list length of OH_Drawing_FontVariationInstanceCoordinate.\n @return Pointer to the font variation instance coordinate list. NULL if variationInstance is invalid.\n @since 24"]
6158 #[cfg(feature = "api-24")]
6159 pub fn OH_Drawing_GetFontVariationInstanceCoordinate(
6160 variationInstance: *mut OH_Drawing_FontVariationInstance,
6161 arrayLength: *mut usize,
6162 ) -> *mut OH_Drawing_FontVariationInstanceCoordinate;
6163}
6164extern "C" {
6165 #[doc = " @brief Obtains the complete font descriptor object based on the font name and type.\n\n @param fullName Pointer to the font name object {@link OH_Drawing_String}.\n @param fontType Enum for the system font type object, which is {@link OH_Drawing_SystemFontType}.\n @return Returns the pointer to the complete font descriptor object {@link OH_Drawing_FontFullDescriptor}. If\n OH_Drawing_FontFullDescriptor is not required, use the {@link OH_Drawing_DestroyFontFullDescriptor} API to\n release the pointer of the object.\n @since 24"]
6166 #[cfg(feature = "api-24")]
6167 pub fn OH_Drawing_GetFontFullDescriptorByFullName(
6168 fullName: *const OH_Drawing_String,
6169 fontType: OH_Drawing_SystemFontType,
6170 ) -> *const OH_Drawing_FontFullDescriptor;
6171}
6172extern "C" {
6173 #[doc = " @brief Obtains the number of fonts contained in a font file.\n\n @param fontSrc Font file path.\n @return Number of fonts.\n @since 23"]
6174 #[cfg(feature = "api-23")]
6175 pub fn OH_Drawing_GetFontCountFromFile(fontSrc: *const ::std::os::raw::c_char) -> u32;
6176}
6177extern "C" {
6178 #[doc = " @brief Obtains the number of fonts contained in a font buffer.\n\n @param fontBuffer Font buffer data.\n @param length Length of the font data.\n @return Number of fonts.\n @since 23"]
6179 #[cfg(feature = "api-23")]
6180 pub fn OH_Drawing_GetFontCountFromBuffer(fontBuffer: *mut u8, length: usize) -> u32;
6181}
6182extern "C" {
6183 #[doc = " @brief Obtains all font file paths of the specified font type.\n\n @param fontType Enum for the system font types, which is {@link OH_Drawing_SystemFontType}.\n @param pathCount Output parameter, used to receive the number of font paths returned.\n @return List of font paths returned. When no longer needed, use free to release the pointer to this object and the\n pointer held internally by each OH_Drawing_String object.\n @since 23"]
6184 #[cfg(feature = "api-23")]
6185 pub fn OH_Drawing_GetFontPathsByType(
6186 fontType: OH_Drawing_SystemFontType,
6187 pathCount: *mut usize,
6188 ) -> *mut OH_Drawing_String;
6189}
6190#[doc = " Follows the high contrast mode for text rendering in the system settings."]
6191#[cfg(feature = "api-20")]
6192pub const OH_Drawing_TextHighContrast_TEXT_FOLLOW_SYSTEM_HIGH_CONTRAST:
6193 OH_Drawing_TextHighContrast = 0;
6194#[doc = " Disables the app's text rendering high contrast configuration. The priority of this mode is higher than the high\n contrast text configuration in system settings."]
6195#[cfg(feature = "api-20")]
6196pub const OH_Drawing_TextHighContrast_TEXT_APP_DISABLE_HIGH_CONTRAST: OH_Drawing_TextHighContrast =
6197 1;
6198#[doc = " Enables the app's text rendering high contrast configuration. The priority of this mode is higher than the high\n contrast text configuration in system settings."]
6199#[cfg(feature = "api-20")]
6200pub const OH_Drawing_TextHighContrast_TEXT_APP_ENABLE_HIGH_CONTRAST: OH_Drawing_TextHighContrast =
6201 2;
6202#[doc = " @brief Defines an enum of the high contrast modes for text rendering.\n\n @since 20\n @version 1.0"]
6203#[cfg(feature = "api-20")]
6204pub type OH_Drawing_TextHighContrast = u32;
6205#[doc = " Uses the default glyph (which may be a blank box, space, or custom symbol) defined in the font file."]
6206#[cfg(feature = "api-20")]
6207pub const OH_Drawing_TextUndefinedGlyphDisplay_TEXT_NO_GLYPH_USE_DEFAULT:
6208 OH_Drawing_TextUndefinedGlyphDisplay = 0;
6209#[doc = " Always uses tofu blocks to represent absent glyphs."]
6210#[cfg(feature = "api-20")]
6211pub const OH_Drawing_TextUndefinedGlyphDisplay_TEXT_NO_GLYPH_USE_TOFU:
6212 OH_Drawing_TextUndefinedGlyphDisplay = 1;
6213#[doc = " @brief Defines an enum of the modes for displaying undefined glyphs.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @since 20"]
6214#[cfg(feature = "api-20")]
6215pub type OH_Drawing_TextUndefinedGlyphDisplay = u32;
6216extern "C" {
6217 #[doc = " @brief Sets the high contrast mode for text rendering.\n <br>The setting of this API takes effect for the entire process, and all pages in the process share the same mode.\n <br>The text rendering high contrast mode can be set by calling this API, or enabled/disabled through the high\n contrast text configuration switch in the system settings screen. The text rendering high contrast mode set by this\n API takes precedence over the system settings.\n <br>This API does not take effect for the text drawing scenario.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param action High contrast mode for text rendering. The value is an enumerated value of the\n {@link OH_Drawing_TextHighContrast} type.\n @since 20"]
6218 #[cfg(feature = "api-20")]
6219 pub fn OH_Drawing_SetTextHighContrast(action: OH_Drawing_TextHighContrast);
6220}
6221extern "C" {
6222 #[doc = " @brief Sets the presentation mode of undefined glyphs. After this API is called, it affects all subsequently\n rendered text in the current process.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param undefinedGlyphDisplay Mode of displaying undefined glyphs. The value is an enumerated value of the\n {@link OH_Drawing_TextUndefinedGlyphDisplay} type.\n @since 20"]
6223 #[cfg(feature = "api-20")]
6224 pub fn OH_Drawing_SetTextUndefinedGlyphDisplay(
6225 undefinedGlyphDisplay: OH_Drawing_TextUndefinedGlyphDisplay,
6226 );
6227}
6228extern "C" {
6229 #[doc = " @brief Obtains the array of text lines in a typography object. This array contains one or more text line objects.\n Release this pointer by calling {@link OH_Drawing_DestroyTextLines} when this object is no longer needed.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param typography Pointer to the {@link OH_Drawing_Typography} object.\n @return Pointer to the text line array {@link OH_Drawing_Array}. <br>Returns NULL when typography is NULL.\n @since 18"]
6230 #[cfg(feature = "api-18")]
6231 pub fn OH_Drawing_TypographyGetTextLines(
6232 typography: *mut OH_Drawing_Typography,
6233 ) -> *mut OH_Drawing_Array;
6234}
6235extern "C" {
6236 #[doc = " @brief Releases the memory occupied by a text line array.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param lines Pointer to the {@link OH_Drawing_Array} object.\n @since 18\n @version 1.0"]
6237 #[cfg(feature = "api-18")]
6238 pub fn OH_Drawing_DestroyTextLines(lines: *mut OH_Drawing_Array);
6239}
6240extern "C" {
6241 #[doc = " @brief Releases the memory of a single text line object. Only the memory of a text line object that is independently\n allocated can be released. The memory of a text line object obtained from a line array through\n {@link OH_Drawing_GetTextLineByIndex} cannot be released.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param line Pointer to the {@link OH_Drawing_TextLine} object.\n @since 18\n @version 1.0"]
6242 #[cfg(feature = "api-18")]
6243 pub fn OH_Drawing_DestroyTextLine(line: *mut OH_Drawing_TextLine);
6244}
6245extern "C" {
6246 #[doc = " @brief Obtains the text line object with the specified index in a text line array.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param lines Pointer to the {@link OH_Drawing_Array} object.\n @param index Index of the text line array.\n @return Pointer to the {@link OH_Drawing_TextLine} text line object at the specified index. <br>Returns NULL if\n lines is NULL or the index is out of bounds.\n @since 18"]
6247 #[cfg(feature = "api-18")]
6248 pub fn OH_Drawing_GetTextLineByIndex(
6249 lines: *mut OH_Drawing_Array,
6250 index: usize,
6251 ) -> *mut OH_Drawing_TextLine;
6252}
6253extern "C" {
6254 #[doc = " @brief Obtains the number of glyphs in a text line object.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param line Pointer to the {@link OH_Drawing_TextLine} object.\n @return Returns the number of glyphs in the text line object.\n @since 18\n @version 1.0"]
6255 #[cfg(feature = "api-18")]
6256 pub fn OH_Drawing_TextLineGetGlyphCount(line: *mut OH_Drawing_TextLine) -> f64;
6257}
6258extern "C" {
6259 #[doc = " @brief Obtains the range of the text in a text line object in the entire paragraph.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param line Pointer to the {@link OH_Drawing_TextLine} object.\n @param start Pointer to the start of the range.\n @param end Pointer to the end of the range.\n @since 18\n @version 1.0"]
6260 #[cfg(feature = "api-18")]
6261 pub fn OH_Drawing_TextLineGetTextRange(
6262 line: *mut OH_Drawing_TextLine,
6263 start: *mut usize,
6264 end: *mut usize,
6265 );
6266}
6267extern "C" {
6268 #[doc = " @brief Obtains the array of text rendering units {@link OH_Drawing_Run} in the text line object.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param line Pointer to the {@link OH_Drawing_TextLine} object.\n @return Pointer to the {@link OH_Drawing_Array} array of text rendering units {@link OH_Drawing_Run}. When the\n {@link OH_Drawing_Array} is no longer needed, please use the {@link OH_Drawing_DestroyRuns} API to release the\n pointer of the object.\n @since 18\n @version 1.0"]
6269 #[cfg(feature = "api-18")]
6270 pub fn OH_Drawing_TextLineGetGlyphRuns(line: *mut OH_Drawing_TextLine)
6271 -> *mut OH_Drawing_Array;
6272}
6273extern "C" {
6274 #[doc = " @brief Releases the memory occupied by a glyph run array.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param runs Pointer to the {@link OH_Drawing_Array} array, which holds multiple {@link OH_Drawing_Run} objects.\n @since 18\n @version 1.0"]
6275 #[cfg(feature = "api-18")]
6276 pub fn OH_Drawing_DestroyRuns(runs: *mut OH_Drawing_Array);
6277}
6278extern "C" {
6279 #[doc = " @brief Obtains the glyph run object with the specified index in a glyph run array.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param runs Pointer to the {@link OH_Drawing_Array} array, which holds multiple {@link OH_Drawing_Run} objects.\n @param index Index of the glyph run array.\n @return Pointer to the text rendering unit object {@link OH_Drawing_Run} at the specified index. <br>NULL is\n returned if runs is NULL or the index is out of bounds.\n @since 18"]
6280 #[cfg(feature = "api-18")]
6281 pub fn OH_Drawing_GetRunByIndex(
6282 runs: *mut OH_Drawing_Array,
6283 index: usize,
6284 ) -> *mut OH_Drawing_Run;
6285}
6286extern "C" {
6287 #[doc = " @brief Paints a text line on the canvas with the coordinate point (x, y) as the upper left corner.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param line Pointer to the {@link OH_Drawing_TextLine} object.\n @param canvas Pointer to the target canvas for drawing, which is an {@link OH_Drawing_Canvas}.\n @param x Horizontal coordinate of the upper left corner, in px.\n @param y Vertical coordinate of the upper left corner, in px.\n @since 18\n @version 1.0"]
6288 #[cfg(feature = "api-18")]
6289 pub fn OH_Drawing_TextLinePaint(
6290 line: *mut OH_Drawing_TextLine,
6291 canvas: *mut OH_Drawing_Canvas,
6292 x: f64,
6293 y: f64,
6294 );
6295}
6296extern "C" {
6297 #[doc = " @brief Creates a truncated text line object. Truncates the original text line based on the specified width,\n truncation type, and truncation mark string, inserts the specified mark string at the truncation position, and\n generates and returns a new independent text line object. The original text is not affected.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param line Pointer to the {@link OH_Drawing_TextLine} object.\n @param width Width of the truncated line, in physical pixels (px).\n @param mode Truncation type. The value is an enumerated value of {@link OH_Drawing_EllipsisModal}. Currently, only **\n ELLIPSIS_MODAL_HEAD** and **ELLIPSIS_MODAL_TAIL** are supported.\n @param ellipsis Pointer to the string used to mark a truncation.\n @return Pointer to the truncated text line object {@link OH_Drawing_TextLine}. <br>NULL is returned when line or\n ellipsis is NULL. <br>Please use {@link OH_Drawing_DestroyTextLine} to release the object's memory when it is no\n longer needed.\n @since 18\n @version 1.0"]
6298 #[cfg(feature = "api-18")]
6299 pub fn OH_Drawing_TextLineCreateTruncatedLine(
6300 line: *mut OH_Drawing_TextLine,
6301 width: f64,
6302 mode: ::std::os::raw::c_int,
6303 ellipsis: *const ::std::os::raw::c_char,
6304 ) -> *mut OH_Drawing_TextLine;
6305}
6306extern "C" {
6307 #[doc = " @brief Obtains the typographic bounds of the text line object. The typographic bounds of a text line are related to\n the typographic font and typographic font size, and are independent of the characters themselves.\n <br>For example, for the string \" a b \", where there is one space before the 'a' character and one space after the '\n b' character, the typographic bounds include the bounds of the leading and trailing spaces. For example, for the\n string \"j\" or \"E\", the typographic bounds are the same, i.e., independent of the characters themselves.\n <br>The text height can be calculated using height = ascent + descent + leading.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param line Pointer to the text line object {@link OH_Drawing_TextLine}.\n @param ascent Pointer to the ascent height of the text line object. The unit is physical pixel.\n @param descent Pointer to the descent height of the text line object. The unit is physical pixel.\n @param leading Pointer to the leading of the text line object. The unit is physical pixel.\n @return Total width of the typographic bounds, in physical pixels.\n @since 18\n @version 1.0"]
6308 #[cfg(feature = "api-18")]
6309 pub fn OH_Drawing_TextLineGetTypographicBounds(
6310 line: *mut OH_Drawing_TextLine,
6311 ascent: *mut f64,
6312 descent: *mut f64,
6313 leading: *mut f64,
6314 ) -> f64;
6315}
6316extern "C" {
6317 #[doc = " @brief Obtains the image bounds of the text line object. The image bounds of a text line are related to the\n typographic font, typographic font size, and the characters themselves, and are equivalent to the visual bounds.\n <br>For example, for the string \" a b \", where there is one space before the 'a' character and one space after the '\n b' character, the user can only see \"a b\" on the UI, and the image bounds are the bounds excluding the leading and\n trailing spaces.\n <br>For example, for the string \"j\" or \"E\", the visual bounds are different, i.e., related to the characters\n themselves. The visual bounds width of the string \"j\" is smaller than that of the string \"E\", and the visual bounds\n height of the string \"j\" is greater than that of the string \"E\".\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param line Pointer to the {@link OH_Drawing_TextLine} object.\n @return Pointer to the image bounds {@link OH_Drawing_Rect} of the text line object. <br>Returns NULL when the\n passed-in line is NULL. <br>When the {@link OH_Drawing_Rect} is no longer needed, please use the\n {@link OH_Drawing_RectDestroy} API to release the pointer of the object.\n @since 18\n @version 1.0"]
6318 #[cfg(feature = "api-18")]
6319 pub fn OH_Drawing_TextLineGetImageBounds(
6320 line: *mut OH_Drawing_TextLine,
6321 ) -> *mut OH_Drawing_Rect;
6322}
6323extern "C" {
6324 #[doc = " @brief Obtains the width of the spaces at the end of a text line object.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param line Pointer to the {@link OH_Drawing_TextLine} object.\n @return Width of the trailing whitespace characters of the text line object, in physical pixels (px).\n @since 18\n @version 1.0"]
6325 #[cfg(feature = "api-18")]
6326 pub fn OH_Drawing_TextLineGetTrailingSpaceWidth(line: *mut OH_Drawing_TextLine) -> f64;
6327}
6328extern "C" {
6329 #[doc = " @brief Obtains the string index at the specified position in the text line object.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param line Pointer to the {@link OH_Drawing_TextLine} object.\n @param point Pointer to the position {@link OH_Drawing_Point} where the index is to be found.\n @return Returns the index of the character. For example, for the string \"abc\", the index of \"a\" is 0, the index of \"\n b\" is 1, and the index of \"c\" is 2. If the specified position is at \"a\", then **0** is returned.\n @since 18"]
6330 #[cfg(feature = "api-18")]
6331 pub fn OH_Drawing_TextLineGetStringIndexForPosition(
6332 line: *mut OH_Drawing_TextLine,
6333 point: *mut OH_Drawing_Point,
6334 ) -> i32;
6335}
6336extern "C" {
6337 #[doc = " @brief Obtains the offset of a character with the specified index in a text line object.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param line Pointer to the {@link OH_Drawing_TextLine} object.\n @param index Index of the character.\n @return Offset at the specified string index, in physical pixels (px).\n @since 18"]
6338 #[cfg(feature = "api-18")]
6339 pub fn OH_Drawing_TextLineGetOffsetForStringIndex(
6340 line: *mut OH_Drawing_TextLine,
6341 index: i32,
6342 ) -> f64;
6343}
6344#[doc = " @brief Defines a custom callback used to receive the offset and index of each character in a text line object\n as its parameters.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param offset Offset of each character in the text line object.\n @param index Index of each character in the text line object.\n @param leadingEdge Whether the cursor is located at the leading edge of a character. **true** means that the\n cursor is located at the front of the character, that is, the offset does not contain the character width.\n **false** means that the cursor is located at the rear of the character, that is, the offset contains the\n character width.\n @return Whether to stop calling the callback. **true** means to stop; **false** otherwise.\n @since 18\n @version 1.0"]
6345#[cfg(feature = "api-18")]
6346pub type Drawing_CaretOffsetsCallback =
6347 ::std::option::Option<unsafe extern "C" fn(offset: f64, index: i32, leadingEdge: bool) -> bool>;
6348extern "C" {
6349 #[doc = " @brief Enumerates the offset and index of each character in a text line object and passes them to a custom callback\n function. You can use the offset and index array for other operations.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param line Pointer to the {@link OH_Drawing_TextLine} object.\n @param callback User-defined function {@link Drawing_CaretOffsetsCallback}.\n @since 18"]
6350 #[cfg(feature = "api-18")]
6351 pub fn OH_Drawing_TextLineEnumerateCaretOffsets(
6352 line: *mut OH_Drawing_TextLine,
6353 callback: Drawing_CaretOffsetsCallback,
6354 );
6355}
6356extern "C" {
6357 #[doc = " @brief Obtains the offset of a text line object after alignment based on the alignment factor and alignment width.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param line Pointer to the {@link OH_Drawing_TextLine} object.\n @param alignmentFactor Alignment factor. A value less than or equal to 0.0 indicates left alignment, greater than 0.\n 0 and less than 0.5 indicates left-biased alignment, 0.5 indicates center alignment, greater than 0.5 and less\n than 1.0 indicates right-biased alignment, and greater than or equal to 1.0 indicates right alignment.\n @param alignmentWidth Alignment width, i.e., the offset of the bottom-right corner of the text line object relative\n to the starting position after final offset, in physical pixels (px). If the specified alignment width is less\n than the actual width of the text line object, 0 is returned.\n @return Calculated offset required for alignment. The unit is physical pixel (px).\n @since 18\n @version 1.0"]
6358 #[cfg(feature = "api-18")]
6359 pub fn OH_Drawing_TextLineGetAlignmentOffset(
6360 line: *mut OH_Drawing_TextLine,
6361 alignmentFactor: f64,
6362 alignmentWidth: f64,
6363 ) -> f64;
6364}
6365extern "C" {
6366 #[doc = " @brief Creates a pointer to a typography line object {@link OH_Drawing_LineTypography}. The typography line object\n serves as a container for storing text content and styles, and can be used to calculate single-line typography\n information.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param handler Pointer to the {@link OH_Drawing_TypographyCreate} object, which is obtained from\n {@link OH_Drawing_CreateTypographyHandler}.\n @return Returns the pointer to the {@link OH_Drawing_LineTypography} object created.\n @since 18"]
6367 #[cfg(feature = "api-18")]
6368 pub fn OH_Drawing_CreateLineTypography(
6369 handler: *mut OH_Drawing_TypographyCreate,
6370 ) -> *mut OH_Drawing_LineTypography;
6371}
6372extern "C" {
6373 #[doc = " @brief Releases the memory occupied by an {@link OH_Drawing_LineTypography} object.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param lineTypography Pointer to the {@link OH_Drawing_LineTypography} object, which is obtained from\n {@link OH_Drawing_CreateLineTypography}.\n @since 18"]
6374 #[cfg(feature = "api-18")]
6375 pub fn OH_Drawing_DestroyLineTypography(lineTypography: *mut OH_Drawing_LineTypography);
6376}
6377extern "C" {
6378 #[doc = " @brief Obtains the number of characters that can fit in the layout from the specified position within a limited\n layout width.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param lineTypography Pointer to the {@link OH_Drawing_LineTypography} object, which is obtained from\n {@link OH_Drawing_CreateLineTypography}.\n @param startIndex Start position (inclusive) for calculating the typography. The value is an integer in the range [0,\n total count of text characters).\n @param width Layout width. The value is a floating point number greater than 0, in px.\n @return Returns the number of characters.\n @since 18"]
6379 #[cfg(feature = "api-18")]
6380 pub fn OH_Drawing_LineTypographyGetLineBreak(
6381 lineTypography: *mut OH_Drawing_LineTypography,
6382 startIndex: usize,
6383 width: f64,
6384 ) -> usize;
6385}
6386extern "C" {
6387 #[doc = " @brief Creates a pointer to an {@link OH_Drawing_TextLine} object based on the text content in a specified range.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param lineTypography Pointer to the {@link OH_Drawing_LineTypography} object, which is obtained from\n {@link OH_Drawing_CreateLineTypography}.\n @param startIndex Start position for layout calculation. The value is an integer in the range [0, total number of\n text characters).\n @param count Number of characters to be typeset from the specified typography start position. The value is an\n integer in the range [0, total count of text characters), and the sum of startIndex and count cannot exceed the\n total count of text characters.\n <br>You can first use {@link OH_Drawing_LineTypographyGetLineBreak} to obtain a reasonable total count of\n characters that can be typeset. If this value is set to 0, the content from startIndex to the end of the text is\n returned.\n @return Pointer to the {@link OH_Drawing_TextLine} object.\n @since 18"]
6388 #[cfg(feature = "api-18")]
6389 pub fn OH_Drawing_LineTypographyCreateLine(
6390 lineTypography: *mut OH_Drawing_LineTypography,
6391 startIndex: usize,
6392 count: usize,
6393 ) -> *mut OH_Drawing_TextLine;
6394}
6395extern "C" {
6396 #[doc = " @brief Obtains an array of character indices of glyphs within a specified range of a run, where the indices are\n offsets relative to the entire paragraph.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param run Pointer to an {@link OH_Drawing_Run} object.\n @param start Start position specified within the rendering unit. The value range is [0, glyphCount-1], where\n glyphCount is the glyph count of the rendering unit. The method returns a null pointer when passing a negative\n number or a value that exceeds the glyph count of the rendering unit.\n @param length Length specified within the rendering unit. When length is 0, the method obtains the character index\n array of all characters in the rendering unit. When length is less than 0, the method returns a null pointer.\n When start+length exceeds the actual range of the rendering unit, the method obtains valid data up to the end of\n the rendering unit.\n @return Returns the character index array of the glyph. Call {@link OH_Drawing_DestroyRunStringIndices} to release\n this pointer when the object is no longer needed.\n @since 18"]
6397 #[cfg(feature = "api-18")]
6398 pub fn OH_Drawing_GetRunStringIndices(
6399 run: *mut OH_Drawing_Run,
6400 start: i64,
6401 length: i64,
6402 ) -> *mut OH_Drawing_Array;
6403}
6404extern "C" {
6405 #[doc = " @brief Obtains character indices of glyphs in a run by index.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param stringIndices Pointer to a character index array.\n @param index Subscript of the character index array for the rendering unit glyphs. The value range is [0,\n arrayLength-1], where arrayLength is the number of elements in the stringIndices array. 0 is returned when the\n value exceeds this range.\n @return Returns the character indices.\n @since 18"]
6406 #[cfg(feature = "api-18")]
6407 pub fn OH_Drawing_GetRunStringIndicesByIndex(
6408 stringIndices: *mut OH_Drawing_Array,
6409 index: usize,
6410 ) -> u64;
6411}
6412extern "C" {
6413 #[doc = " @brief Releases the pointer to a character index array object.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param stringIndices Pointer to a character index array.\n @since 18"]
6414 #[cfg(feature = "api-18")]
6415 pub fn OH_Drawing_DestroyRunStringIndices(stringIndices: *mut OH_Drawing_Array);
6416}
6417extern "C" {
6418 #[doc = " @brief Obtains the range of glyphs generated by a run.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param run Pointer to an {@link OH_Drawing_Run} object.\n @param location Start position of the character range of the rendering unit glyph, which is an offset relative to\n the whole paragraph. This is an output parameter. The caller must provide a valid pointer to receive the return\n value.\n @param length Length of the character range of the rendering unit. This is an output parameter. The caller must\n provide a valid pointer to receive the return value.\n @since 18"]
6419 #[cfg(feature = "api-18")]
6420 pub fn OH_Drawing_GetRunStringRange(
6421 run: *mut OH_Drawing_Run,
6422 location: *mut u64,
6423 length: *mut u64,
6424 );
6425}
6426extern "C" {
6427 #[doc = " @brief Obtains the typographic boundary of a run. The typographic boundary is related to the font and font size used\n for typography, but not the characters within the text.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param run Pointer to an {@link OH_Drawing_Run} object.\n @param ascent Pointer to the distance from the highest character in the rendering unit to the baseline, in px.\n @param descent Pointer to the distance from the lowest character in the rendering unit to the baseline, in px.\n @param leading Pointer to the line spacing of the rendering unit, in px.\n @return Typographic width of the rendering unit, in px.\n @since 18"]
6428 #[cfg(feature = "api-18")]
6429 pub fn OH_Drawing_GetRunTypographicBounds(
6430 run: *mut OH_Drawing_Run,
6431 ascent: *mut f32,
6432 descent: *mut f32,
6433 leading: *mut f32,
6434 ) -> f32;
6435}
6436extern "C" {
6437 #[doc = " @brief Paints the text contained in a run on the canvas.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param canvas Pointer to an {@link OH_Drawing_Canvas} object.\n @param run Pointer to an {@link OH_Drawing_Run} object.\n @param x X coordinate of the rendering unit, in px.\n @param y Y coordinate of the rendering unit, in px.\n @since 18"]
6438 #[cfg(feature = "api-18")]
6439 pub fn OH_Drawing_RunPaint(
6440 canvas: *mut OH_Drawing_Canvas,
6441 run: *mut OH_Drawing_Run,
6442 x: f64,
6443 y: f64,
6444 );
6445}
6446extern "C" {
6447 #[doc = " @brief Obtains the image boundary of a run. The image boundary is related to characters and is equivalent to the\n visual boundary.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param run Pointer to an {@link OH_Drawing_Run} object.\n @return Returns the pointer to an {@link OH_Drawing_Rect} object. Call {@link OH_Drawing_DestroyRunImageBounds} to\n release this pointer when the object is no longer needed.\n @since 18"]
6448 #[cfg(feature = "api-18")]
6449 pub fn OH_Drawing_GetRunImageBounds(run: *mut OH_Drawing_Run) -> *mut OH_Drawing_Rect;
6450}
6451extern "C" {
6452 #[doc = " @brief Releases the pointer to an image boundary object of a run.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param rect Pointer to the image boundary, which is an {@link OH_Drawing_Rect} object.\n @since 18"]
6453 #[cfg(feature = "api-18")]
6454 pub fn OH_Drawing_DestroyRunImageBounds(rect: *mut OH_Drawing_Rect);
6455}
6456extern "C" {
6457 #[doc = " @brief Obtains an array of glyphs within the specified range of a run.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param run Pointer to an {@link OH_Drawing_Run} object.\n @param start Start position specified within the rendering unit. The value range is [0, glyphCount-1], where\n glyphCount is the number of glyphs in the rendering unit. When a negative number is passed or the value exceeds\n the number of glyphs in the rendering unit, the method returns a null pointer.\n @param length Length specified within the rendering unit. When length is 0, all glyphs of the rendering unit are\n obtained. When length is less than 0, the method returns a null pointer. When start+length exceeds the actual\n range of the rendering unit, valid data up to the end of the rendering unit is obtained.\n @return Returns the pointer to an {@link OH_Drawing_Array} object of a glyph array in a run. Call\n {@link OH_Drawing_DestroyRunGlyphs} to release this pointer when the object is no longer needed.\n @since 18"]
6458 #[cfg(feature = "api-18")]
6459 pub fn OH_Drawing_GetRunGlyphs(
6460 run: *mut OH_Drawing_Run,
6461 start: i64,
6462 length: i64,
6463 ) -> *mut OH_Drawing_Array;
6464}
6465extern "C" {
6466 #[doc = " @brief Obtains individual glyphs in a run by index.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param glyphs Pointer to the glyph array, which is an {@link OH_Drawing_Array} object.\n @param index Subscript of the rendering unit glyph array. The value range is [0, arrayLength-1], where arrayLength\n is the number of elements in the glyphs array. 0 is returned when the value exceeds this range.\n @return Glyph ID of a single glyph in the rendering unit.\n @since 18\n @version 1.0"]
6467 #[cfg(feature = "api-18")]
6468 pub fn OH_Drawing_GetRunGlyphsByIndex(glyphs: *mut OH_Drawing_Array, index: usize) -> u16;
6469}
6470extern "C" {
6471 #[doc = " @brief Releases the pointer to a glyph array in a run.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param glyphs Pointer to the glyph array, which is an {@link OH_Drawing_Array} object.\n @since 18"]
6472 #[cfg(feature = "api-18")]
6473 pub fn OH_Drawing_DestroyRunGlyphs(glyphs: *mut OH_Drawing_Array);
6474}
6475extern "C" {
6476 #[doc = " @brief Obtains the positions of glyphs within the specified range of a run.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param run Pointer to an {@link OH_Drawing_Run} object.\n @param start Start position specified within the rendering unit. The value range is [0, glyphCount-1], where\n glyphCount is the glyph count of the rendering unit. The method returns a null pointer when a negative number is\n passed or when the value exceeds the glyph count of the rendering unit.\n @param length Length specified within the rendering unit. When length is 0, all glyph positions of the rendering\n unit are obtained. The method returns a null pointer when length is less than 0. When start+length exceeds the\n actual range of the rendering unit, valid data up to the end of the rendering unit is obtained.\n @return Returns the pointer to an {@link OH_Drawing_Array} object of a glyph position array in a run. Call\n {@link OH_Drawing_DestroyRunPositions} to release this pointer when the object is no longer needed.\n @since 18"]
6477 #[cfg(feature = "api-18")]
6478 pub fn OH_Drawing_GetRunPositions(
6479 run: *mut OH_Drawing_Run,
6480 start: i64,
6481 length: i64,
6482 ) -> *mut OH_Drawing_Array;
6483}
6484extern "C" {
6485 #[doc = " @brief Obtains the positions of individual glyphs in a run by index.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param positions Pointer to the glyph position array, which is an {@link OH_Drawing_Array} object.\n @param index Subscript of the rendering unit glyph position array. The value range is [0, arrayLength-1], where\n arrayLength is the number of elements in the positions array. The method returns null pointer when the value\n exceeds the range.\n @return Returns the pointer to an {@link OH_Drawing_Point} object, which holds the positions of individual glyphs in\n the run.\n @since 18\n @version 1.0"]
6486 #[cfg(feature = "api-18")]
6487 pub fn OH_Drawing_GetRunPositionsByIndex(
6488 positions: *mut OH_Drawing_Array,
6489 index: usize,
6490 ) -> *mut OH_Drawing_Point;
6491}
6492extern "C" {
6493 #[doc = " @brief Releases the pointer to a glyph position array in a run.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param positions Pointer to the glyph position array, which is an {@link OH_Drawing_Array} object.\n @since 18"]
6494 #[cfg(feature = "api-18")]
6495 pub fn OH_Drawing_DestroyRunPositions(positions: *mut OH_Drawing_Array);
6496}
6497extern "C" {
6498 #[doc = " @brief Obtains the number of glyphs in a run.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param run Pointer to an {@link OH_Drawing_Run} object.\n @return Returns the number of glyphs.\n @since 18"]
6499 #[cfg(feature = "api-18")]
6500 pub fn OH_Drawing_GetRunGlyphCount(run: *mut OH_Drawing_Run) -> u32;
6501}
6502extern "C" {
6503 #[doc = " @brief Obtains the font object of a run.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param run Pointer to an {@link OH_Drawing_Run} object.\n @return Returns the pointer to an {@link OH_Drawing_Font} object in a run. Call {@link OH_Drawing_FontDestroy} to\n release this pointer when the object is no longer needed.\n @since 20\n @version 1.0"]
6504 #[cfg(feature = "api-20")]
6505 pub fn OH_Drawing_GetRunFont(run: *mut OH_Drawing_Run) -> *mut OH_Drawing_Font;
6506}
6507extern "C" {
6508 #[doc = " @brief Obtains the text direction of a run.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param run Pointer to an {@link OH_Drawing_Run} object.\n @return Returns the text direction of a run. **0**: **TEXT_DIRECTION_RTL**, which means right-to-left; **1**: **\n TEXT_DIRECTION_LTR**, which means left-to-right. For details, see {@link OH_Drawing_TextDirection}.\n @since 20"]
6509 #[cfg(feature = "api-20")]
6510 pub fn OH_Drawing_GetRunTextDirection(run: *mut OH_Drawing_Run) -> OH_Drawing_TextDirection;
6511}
6512extern "C" {
6513 #[doc = " @brief Obtains the glyph advance array of a run.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param run Pointer to an {@link OH_Drawing_Run} object.\n @param start Start position specified within the rendering unit. The value range is [0, glyphCount-1], where\n glyphCount is the glyph count of the rendering unit. If the passed value exceeds the glyph count of the\n rendering unit, the method returns null pointer.\n @param length Length specified within the rendering unit. When length is 0, obtains the widths of all glyphs from\n start to the end of the rendering unit.\n @return Returns the pointer to an {@link OH_Drawing_Array} object of a glyph advance array in a run. Call\n {@link OH_Drawing_DestroyRunGlyphAdvances} to release this pointer when the object is no longer needed.\n @since 20"]
6514 #[cfg(feature = "api-20")]
6515 pub fn OH_Drawing_GetRunGlyphAdvances(
6516 run: *mut OH_Drawing_Run,
6517 start: u32,
6518 length: u32,
6519 ) -> *mut OH_Drawing_Array;
6520}
6521extern "C" {
6522 #[doc = " @brief Obtains the advances of individual glyphs in a run by index.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param advances Pointer to the glyph advance array, which is an {@link OH_Drawing_Array} object.\n @param index Subscript of the rendering unit glyph width array. The value range is [0, arrayLength-1], where\n arrayLength is the number of elements in the advances array. A null pointer is returned when the value exceeds\n the range.\n @return Returns the pointer to an {@link OH_Drawing_Point} object, which holds the advance of individual glyphs in\n the run. **x** indicates the advance, and **y** is a reserved field and defaults to **0**.\n @since 20"]
6523 #[cfg(feature = "api-20")]
6524 pub fn OH_Drawing_GetRunGlyphAdvanceByIndex(
6525 advances: *mut OH_Drawing_Array,
6526 index: usize,
6527 ) -> *mut OH_Drawing_Point;
6528}
6529extern "C" {
6530 #[doc = " @brief Releases the pointer to a glyph advance array in a run.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @param advances Pointer to the glyph advance array, which is an {@link OH_Drawing_Array} object.\n @since 20"]
6531 #[cfg(feature = "api-20")]
6532 pub fn OH_Drawing_DestroyRunGlyphAdvances(advances: *mut OH_Drawing_Array);
6533}
6534extern "C" {
6535 #[doc = " @brief Creates a default **OH_Drawing_Typeface** object.\n\n @return Returns the pointer to the **OH_Drawing_Typeface** object created.\n @since 11\n @version 1.0"]
6536 pub fn OH_Drawing_TypefaceCreateDefault() -> *mut OH_Drawing_Typeface;
6537}
6538extern "C" {
6539 #[doc = " @brief Creates an **OH_Drawing_Typeface** object through a file.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param path Pointer to the file path.\n @param index File index.\n @return Returns a pointer to the created {@link OH_Drawing_Typeface} object.\n @since 12\n @version 1.0"]
6540 pub fn OH_Drawing_TypefaceCreateFromFile(
6541 path: *const ::std::os::raw::c_char,
6542 index: ::std::os::raw::c_int,
6543 ) -> *mut OH_Drawing_Typeface;
6544}
6545extern "C" {
6546 #[doc = " @brief Creates an **OH_Drawing_Typeface** object with font arguments through a file.\n If the **OH_Drawing_Typeface** object does not support the variation described in the font arguments, this function\n creates an **OH_Drawing_Typeface** object with the default font arguments.\n In this case, this function provides the same capability as {@link OH_Drawing_TypefaceCreateFromFile}.\n\n @param path Pointer to the file path.\n @param fontArguments Pointer to an {@link OH_Drawing_FontArguments} object.\n @return Returns a pointer to the created {@link OH_Drawing_Typeface} object.\n If a null pointer is returned, the creation fails. Possible causes are that no memory is available, the passed-in **\n path** or **fontArguments** is NULL, or the path is invalid.\n @since 13\n @version 1.0"]
6547 #[cfg(feature = "api-13")]
6548 pub fn OH_Drawing_TypefaceCreateFromFileWithArguments(
6549 path: *const ::std::os::raw::c_char,
6550 fontArguments: *const OH_Drawing_FontArguments,
6551 ) -> *mut OH_Drawing_Typeface;
6552}
6553extern "C" {
6554 #[doc = " @brief Creates an **OH_Drawing_Typeface** object with font arguments based on an existing **OH_Drawing_Typeface**\n object.\n\n @param current Pointer to the {@link OH_Drawing_Typeface} object.\n @param fontArguments Pointer to an {@link OH_Drawing_FontArguments} object.\n @return Returns a pointer to the created {@link OH_Drawing_Typeface} object.\n If a null pointer is returned, the creation fails. Possible causes are that no memory is available, the passed-in **\n path** or **fontArguments** is NULL, or the existing **OH_Drawing_FontArguments** object does not support the\n variation described in the font arguments.\n @since 13\n @version 1.0"]
6555 #[cfg(feature = "api-13")]
6556 pub fn OH_Drawing_TypefaceCreateFromCurrent(
6557 current: *const OH_Drawing_Typeface,
6558 fontArguments: *const OH_Drawing_FontArguments,
6559 ) -> *mut OH_Drawing_Typeface;
6560}
6561extern "C" {
6562 #[doc = " @brief Creates an **OH_Drawing_Typeface** object through a memory stream. If the memory stream is an invalid font\n file, a null pointer is returned. After the memory stream is passed in, the ownership is transferred and you cannot\n release it.\n This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}.\n If **memoryStream** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned.\n\n @param memoryStream Pointer to an {@link OH_Drawing_MemoryStream} object.\n @param index Index of the memory stream.\n @return Returns a pointer to the created {@link OH_Drawing_Typeface} object.\n @since 12\n @version 1.0"]
6563 pub fn OH_Drawing_TypefaceCreateFromStream(
6564 memoryStream: *mut OH_Drawing_MemoryStream,
6565 index: i32,
6566 ) -> *mut OH_Drawing_Typeface;
6567}
6568extern "C" {
6569 #[doc = " @brief Destroys an **OH_Drawing_Typeface** object and reclaims the memory occupied by the object.\n\n @param typeface Pointer to an **OH_Drawing_Typeface** object.\n @since 11\n @version 1.0"]
6570 pub fn OH_Drawing_TypefaceDestroy(typeface: *mut OH_Drawing_Typeface);
6571}
6572extern "C" {
6573 #[doc = " @brief Creates an **OH_Drawing_FontArguments** object. The font arguments are used to create an **\n OH_Drawing_Typeface** object with custom attributes.\n\n @return Returns the pointer to the **OH_Drawing_FontArguments** object created.\n @since 13\n @version 1.0"]
6574 #[cfg(feature = "api-13")]
6575 pub fn OH_Drawing_FontArgumentsCreate() -> *mut OH_Drawing_FontArguments;
6576}
6577extern "C" {
6578 #[doc = " @brief Adds a variation to an **OH_Drawing_FontArguments** object.\n\n @param fontArguments Pointer to an {@link OH_Drawing_FontArguments} object.\n @param axis Pointer to the label of the variation. The value must contain four ASCII characters. The supported\n labels depend on the loaded font file. For example, **'wght'** is the font weight label.\n @param value Value of the variation label.\n @return Returns one of the following result codes:\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **fontArguments** or **axis** is NULL or the length of **axis** is\n not 4.\n @since 13\n @version 1.0"]
6579 #[cfg(feature = "api-13")]
6580 pub fn OH_Drawing_FontArgumentsAddVariation(
6581 fontArguments: *mut OH_Drawing_FontArguments,
6582 axis: *const ::std::os::raw::c_char,
6583 value: f32,
6584 ) -> OH_Drawing_ErrorCode;
6585}
6586extern "C" {
6587 #[doc = " @brief Destroys an **OH_Drawing_FontArguments** object.\n\n @param fontArguments Pointer to an {@link OH_Drawing_FontArguments} object.\n @return Returns one of the following result codes:\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INVALID_PARAMETER** if **fontArguments** is NULL.\n @since 13\n @version 1.0"]
6588 #[cfg(feature = "api-13")]
6589 pub fn OH_Drawing_FontArgumentsDestroy(
6590 fontArguments: *mut OH_Drawing_FontArguments,
6591 ) -> OH_Drawing_ErrorCode;
6592}
6593extern "C" {
6594 #[doc = " @brief Checks whether the typeface is bold.\n\n @param typeface Pointer to the {@link OH_Drawing_Typeface} object.\n @param isBold Whether the typeface is bold. It is used as an output parameter. **true** if the typeface is bold; **\n false** otherwise.\n @return Execution result.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INCORRECT_PARAMETER** if **typeface** or **isBold** is a null pointer.\n @since 23\n @version 1.0"]
6595 #[cfg(feature = "api-23")]
6596 pub fn OH_Drawing_TypefaceIsBold(
6597 typeface: *const OH_Drawing_Typeface,
6598 isBold: *mut bool,
6599 ) -> OH_Drawing_ErrorCode;
6600}
6601extern "C" {
6602 #[doc = " @brief Checks whether the typeface is italic.\n\n @param typeface Pointer to the {@link OH_Drawing_Typeface} object.\n @param isItalic Whether the typeface is italic. It is used as an output parameter. **true** if the typeface is\n italic; **false** otherwise.\n @return Execution result.\n **OH_DRAWING_SUCCESS** if the operation is successful.\n **OH_DRAWING_ERROR_INCORRECT_PARAMETER** if **typeface** or **isItalic** is a null pointer.\n @since 23\n @version 1.0"]
6603 #[cfg(feature = "api-23")]
6604 pub fn OH_Drawing_TypefaceIsItalic(
6605 typeface: *const OH_Drawing_Typeface,
6606 isItalic: *mut bool,
6607 ) -> OH_Drawing_ErrorCode;
6608}