/* automatically generated by rust-bindgen 0.65.1 */
#![allow(non_snake_case)]
#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(clippy::missing_safety_doc)]
// bindgen's bitfield accessors transmute/cast between identical types.
#![allow(clippy::useless_transmute)]
#![allow(clippy::unnecessary_cast)]
#[allow(unused_imports)]
use ohos_image_native_sys::*;
use ohos_image_sys::*;
#[link(name = "native_drawing")]
unsafe extern "C" {}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_Canvas {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_Pen {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_Region {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_Brush {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_Path {
_unused: [u8; 0],
}
#[cfg(feature = "api-23")]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_PathIterator {
_unused: [u8; 0],
}
#[cfg(feature = "api-23")]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_Lattice {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_Bitmap {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_Point {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_PixelMap {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_ColorSpace {
_unused: [u8; 0],
}
#[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"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_Point2D {
pub x: f32,
pub y: f32,
}
#[doc = " @brief Defines corner radii, which is on x-axis and y-axis.\n\n @since 12\n @version 1.0"]
pub type OH_Drawing_Corner_Radii = OH_Drawing_Point2D;
#[doc = " @brief This struct describes a three-dimensional coordinate point.\n\n @since 12\n @version 1.0"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_Point3D {
pub x: f32,
pub y: f32,
pub z: f32,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_PathEffect {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_Rect {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_RoundRect {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_Matrix {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_ShaderEffect {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_ShadowLayer {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_Filter {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_MaskFilter {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_ColorFilter {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_Font {
_unused: [u8; 0],
}
#[cfg(feature = "api-20")]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_FontFeatures {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_MemoryStream {
_unused: [u8; 0],
}
#[cfg(feature = "api-13")]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_FontArguments {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_Typeface {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_TextBlob {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_Image {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_ImageFilter {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_SamplingOptions {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_TextBlobBuilder {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_GpuContext {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_Surface {
_unused: [u8; 0],
}
#[doc = " Unknown format.\n\n @since 8"]
pub const OH_Drawing_ColorFormat_COLOR_FORMAT_UNKNOWN: OH_Drawing_ColorFormat = 0;
#[doc = " Each pixel is represented by 8 bits, which together indicate alpha.\n\n @since 8"]
pub const OH_Drawing_ColorFormat_COLOR_FORMAT_ALPHA_8: OH_Drawing_ColorFormat = 1;
#[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"]
pub const OH_Drawing_ColorFormat_COLOR_FORMAT_RGB_565: OH_Drawing_ColorFormat = 2;
#[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"]
pub const OH_Drawing_ColorFormat_COLOR_FORMAT_ARGB_4444: OH_Drawing_ColorFormat = 3;
#[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"]
pub const OH_Drawing_ColorFormat_COLOR_FORMAT_RGBA_8888: OH_Drawing_ColorFormat = 4;
#[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"]
pub const OH_Drawing_ColorFormat_COLOR_FORMAT_BGRA_8888: OH_Drawing_ColorFormat = 5;
#[doc = " @brief Defines an enum for the storage formats of bitmap pixels.\n\n @since 8\n @version 1.0"]
pub type OH_Drawing_ColorFormat = u32;
#[doc = " Unknown format.\n\n @since 8"]
pub const OH_Drawing_AlphaFormat_ALPHA_FORMAT_UNKNOWN: OH_Drawing_AlphaFormat = 0;
#[doc = " The bitmap does not have the alpha component.\n\n @since 8"]
pub const OH_Drawing_AlphaFormat_ALPHA_FORMAT_OPAQUE: OH_Drawing_AlphaFormat = 1;
#[doc = " The color component of each pixel is premultiplied by the alpha component.\n\n @since 8"]
pub const OH_Drawing_AlphaFormat_ALPHA_FORMAT_PREMUL: OH_Drawing_AlphaFormat = 2;
#[doc = " The color component of each pixel is not premultiplied by the alpha component.\n\n @since 8"]
pub const OH_Drawing_AlphaFormat_ALPHA_FORMAT_UNPREMUL: OH_Drawing_AlphaFormat = 3;
#[doc = " @brief Defines an enum for the alpha formats of bitmap pixels.\n\n @since 8\n @version 1.0"]
pub type OH_Drawing_AlphaFormat = u32;
#[doc = " Clear mode. r = 0.\n\n @since 11"]
pub const OH_Drawing_BlendMode_BLEND_MODE_CLEAR: OH_Drawing_BlendMode = 0;
#[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"]
pub const OH_Drawing_BlendMode_BLEND_MODE_SRC: OH_Drawing_BlendMode = 1;
#[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"]
pub const OH_Drawing_BlendMode_BLEND_MODE_DST: OH_Drawing_BlendMode = 2;
#[doc = " r = s + (1 - sa) * d.\n\n @since 11"]
pub const OH_Drawing_BlendMode_BLEND_MODE_SRC_OVER: OH_Drawing_BlendMode = 3;
#[doc = " r = d + (1 - da) * s.\n\n @since 11"]
pub const OH_Drawing_BlendMode_BLEND_MODE_DST_OVER: OH_Drawing_BlendMode = 4;
#[doc = " r = s * da.\n\n @since 11"]
pub const OH_Drawing_BlendMode_BLEND_MODE_SRC_IN: OH_Drawing_BlendMode = 5;
#[doc = " r = d * sa.\n\n @since 11"]
pub const OH_Drawing_BlendMode_BLEND_MODE_DST_IN: OH_Drawing_BlendMode = 6;
#[doc = " r = s * (1 - da).\n\n @since 11"]
pub const OH_Drawing_BlendMode_BLEND_MODE_SRC_OUT: OH_Drawing_BlendMode = 7;
#[doc = " r = d * (1 - sa).\n\n @since 11"]
pub const OH_Drawing_BlendMode_BLEND_MODE_DST_OUT: OH_Drawing_BlendMode = 8;
#[doc = " r = s * da + d * (1 - sa).\n\n @since 11"]
pub const OH_Drawing_BlendMode_BLEND_MODE_SRC_ATOP: OH_Drawing_BlendMode = 9;
#[doc = " r = d * sa + s * (1 - da).\n\n @since 11"]
pub const OH_Drawing_BlendMode_BLEND_MODE_DST_ATOP: OH_Drawing_BlendMode = 10;
#[doc = " r = s * (1 - da) + d * (1 - sa).\n\n @since 11"]
pub const OH_Drawing_BlendMode_BLEND_MODE_XOR: OH_Drawing_BlendMode = 11;
#[doc = " r = min(s + d, 1).\n\n @since 11"]
pub const OH_Drawing_BlendMode_BLEND_MODE_PLUS: OH_Drawing_BlendMode = 12;
#[doc = " r = s * d.\n\n @since 11"]
pub const OH_Drawing_BlendMode_BLEND_MODE_MODULATE: OH_Drawing_BlendMode = 13;
#[doc = " Screen mode. r = s + d - s * d.\n\n @since 11"]
pub const OH_Drawing_BlendMode_BLEND_MODE_SCREEN: OH_Drawing_BlendMode = 14;
#[doc = " Overlay mode.\n\n @since 11"]
pub const OH_Drawing_BlendMode_BLEND_MODE_OVERLAY: OH_Drawing_BlendMode = 15;
#[doc = " Darken mode. rc = s + d - max(s * da, d * sa), ra = s + (1 - sa) * d.\n\n @since 11"]
pub const OH_Drawing_BlendMode_BLEND_MODE_DARKEN: OH_Drawing_BlendMode = 16;
#[doc = " Lighten mode. rc = rc = s + d - min(s * da, d * sa), ra = s + (1 - sa) * d.\n\n @since 11"]
pub const OH_Drawing_BlendMode_BLEND_MODE_LIGHTEN: OH_Drawing_BlendMode = 17;
#[doc = " Color dodge mode.\n\n @since 11"]
pub const OH_Drawing_BlendMode_BLEND_MODE_COLOR_DODGE: OH_Drawing_BlendMode = 18;
#[doc = " Color burn mode.\n\n @since 11"]
pub const OH_Drawing_BlendMode_BLEND_MODE_COLOR_BURN: OH_Drawing_BlendMode = 19;
#[doc = " Hard light mode.\n\n @since 11"]
pub const OH_Drawing_BlendMode_BLEND_MODE_HARD_LIGHT: OH_Drawing_BlendMode = 20;
#[doc = " Soft light mode.\n\n @since 11"]
pub const OH_Drawing_BlendMode_BLEND_MODE_SOFT_LIGHT: OH_Drawing_BlendMode = 21;
#[doc = " Difference mode. rc = s + d - 2 * (min(s * da, d * sa)), ra = s + (1 - sa) * d.\n\n @since 11"]
pub const OH_Drawing_BlendMode_BLEND_MODE_DIFFERENCE: OH_Drawing_BlendMode = 22;
#[doc = " Exclusion mode. rc = s + d - two(s * d), ra = s + (1 - sa) * d.\n\n @since 11"]
pub const OH_Drawing_BlendMode_BLEND_MODE_EXCLUSION: OH_Drawing_BlendMode = 23;
#[doc = " Multiply mode. r = s * (1 - da) + d * (1 - sa) + s * d.\n\n @since 11"]
pub const OH_Drawing_BlendMode_BLEND_MODE_MULTIPLY: OH_Drawing_BlendMode = 24;
#[doc = " Hue mode.\n\n @since 11"]
pub const OH_Drawing_BlendMode_BLEND_MODE_HUE: OH_Drawing_BlendMode = 25;
#[doc = " Saturation mode.\n\n @since 11"]
pub const OH_Drawing_BlendMode_BLEND_MODE_SATURATION: OH_Drawing_BlendMode = 26;
#[doc = " Color mode.\n\n @since 11"]
pub const OH_Drawing_BlendMode_BLEND_MODE_COLOR: OH_Drawing_BlendMode = 27;
#[doc = " Luminosity mode.\n\n @since 11"]
pub const OH_Drawing_BlendMode_BLEND_MODE_LUMINOSITY: OH_Drawing_BlendMode = 28;
#[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"]
pub type OH_Drawing_BlendMode = u32;
#[doc = " One byte used to indicate UTF-8 or ASCII characters.\n\n @since 12"]
pub const OH_Drawing_TextEncoding_TEXT_ENCODING_UTF8: OH_Drawing_TextEncoding = 0;
#[doc = " Two bytes used to indicate most Unicode characters.\n\n @since 12"]
pub const OH_Drawing_TextEncoding_TEXT_ENCODING_UTF16: OH_Drawing_TextEncoding = 1;
#[doc = " Four bytes used to indicate all Unicode characters.\n\n @since 12"]
pub const OH_Drawing_TextEncoding_TEXT_ENCODING_UTF32: OH_Drawing_TextEncoding = 2;
#[doc = " Two bytes used to indicate the glyph index.\n\n @since 12"]
pub const OH_Drawing_TextEncoding_TEXT_ENCODING_GLYPH_ID: OH_Drawing_TextEncoding = 3;
#[doc = " @brief Defines an enum for the text encoding types.\n\n @since 12\n @version 1.0"]
pub type OH_Drawing_TextEncoding = u32;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_FontMgr {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_FontStyleSet {
_unused: [u8; 0],
}
#[cfg(feature = "api-13")]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_RecordCmdUtils {
_unused: [u8; 0],
}
#[cfg(feature = "api-13")]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_RecordCmd {
_unused: [u8; 0],
}
#[cfg(feature = "api-14")]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_Array {
_unused: [u8; 0],
}
#[doc = " @brief This struct describes the style of a rectangle.\n\n @since 12\n @version 1.0"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_RectStyle_Info {
#[doc = " Color of the rectangle.\n\n @since 12"]
pub color: u32,
#[doc = " Left top radius of the rectangle.\n\n @since 12"]
pub leftTopRadius: f64,
#[doc = " Right top radius of the rectangle.\n\n @since 12"]
pub rightTopRadius: f64,
#[doc = " Right bottom radius of the rectangle.\n\n @since 12"]
pub rightBottomRadius: f64,
#[doc = " Left bottom radius of the rectangle.\n\n @since 12"]
pub leftBottomRadius: f64,
}
#[doc = " @brief This struct describes the image information.\n\n @since 12\n @version 1.0"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_Image_Info {
#[doc = " Width, in pixels.\n\n @since 12"]
pub width: i32,
#[doc = " Height, in pixels.\n\n @since 12"]
pub height: i32,
#[doc = " Color type.\n\n @since 12"]
pub colorType: OH_Drawing_ColorFormat,
#[doc = " Alpha type.\n\n @since 12"]
pub alphaType: OH_Drawing_AlphaFormat,
}
#[doc = " @brief This struct describes a string of characters encoded in UTF-16.\n\n @since 14\n @version 1.0"]
#[cfg(feature = "api-14")]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_String {
#[doc = " Pointer to a byte array that stores characters in the UTF-16 encoding format.\n\n @since 14"]
pub strData: *mut u8,
#[doc = " Actual length of the string that **strData** points to, in bytes.\n\n @since 14"]
pub strLen: u32,
}
#[doc = " Operation successful.\n\n @since 12"]
pub const OH_Drawing_ErrorCode_OH_DRAWING_SUCCESS: OH_Drawing_ErrorCode = 0;
#[doc = " Permission denied.\n\n @since 12"]
pub const OH_Drawing_ErrorCode_OH_DRAWING_ERROR_NO_PERMISSION: OH_Drawing_ErrorCode = 201;
#[doc = " Invalid input parameter. For example, NULL is passed in.\n\n @since 12"]
pub const OH_Drawing_ErrorCode_OH_DRAWING_ERROR_INVALID_PARAMETER: OH_Drawing_ErrorCode = 401;
#[doc = " The input parameter is not in the valid range.\n\n @since 12"]
pub const OH_Drawing_ErrorCode_OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE: OH_Drawing_ErrorCode =
26200001;
#[doc = " Failed to allocate memory.\n\n @since 13"]
#[cfg(feature = "api-13")]
pub const OH_Drawing_ErrorCode_OH_DRAWING_ERROR_ALLOCATION_FAILED: OH_Drawing_ErrorCode = 26200002;
#[doc = " No function matches the input attribute ID.\n\n @since 21"]
#[cfg(feature = "api-21")]
pub const OH_Drawing_ErrorCode_OH_DRAWING_ERROR_ATTRIBUTE_ID_MISMATCH: OH_Drawing_ErrorCode =
26200003;
#[doc = " The input parameter is incorrect. For example, the pointer of the input parameter is null.\n\n @since 22"]
#[cfg(feature = "api-22")]
pub const OH_Drawing_ErrorCode_OH_DRAWING_ERROR_INCORRECT_PARAMETER: OH_Drawing_ErrorCode =
26200004;
#[doc = " File not found. The specified file does not exist or the path is incorrect.\n\n @since 23"]
#[cfg(feature = "api-23")]
pub const OH_Drawing_ErrorCode_OH_DRAWING_ERROR_FILE_NOT_FOUND: OH_Drawing_ErrorCode = 26200005;
#[doc = " Failed to open the file, which is caused by insufficient permissions or I/O issues.\n\n @since 23"]
#[cfg(feature = "api-23")]
pub const OH_Drawing_ErrorCode_OH_DRAWING_ERROR_OPEN_FILE_FAILED: OH_Drawing_ErrorCode = 26200006;
#[doc = " Fails to seek the file. The system cannot reposition the file read pointer.\n\n @since 23"]
#[cfg(feature = "api-23")]
pub const OH_Drawing_ErrorCode_OH_DRAWING_ERROR_FILE_SEEK_FAILED: OH_Drawing_ErrorCode = 26200007;
#[doc = " Failed to obtain the file size. The system cannot obtain the file size information.\n\n @since 23"]
#[cfg(feature = "api-23")]
pub const OH_Drawing_ErrorCode_OH_DRAWING_ERROR_GET_FILE_SIZE_FAILED: OH_Drawing_ErrorCode =
26200008;
#[doc = " Failed to read the file. The file cannot be read completely or contains unreadable data.\n\n @since 23"]
#[cfg(feature = "api-23")]
pub const OH_Drawing_ErrorCode_OH_DRAWING_ERROR_READ_FILE_FAILED: OH_Drawing_ErrorCode = 26200009;
#[doc = " Empty file. The specified font file is empty and does not contain valid data.\n\n @since 23"]
#[cfg(feature = "api-23")]
pub const OH_Drawing_ErrorCode_OH_DRAWING_ERROR_EMPTY_FILE: OH_Drawing_ErrorCode = 26200010;
#[doc = " Corrupted file. The file content is invalid or corrupted, and cannot be parsed.\n\n @since 23"]
#[cfg(feature = "api-23")]
pub const OH_Drawing_ErrorCode_OH_DRAWING_ERROR_FILE_CORRUPTED: OH_Drawing_ErrorCode = 26200011;
#[doc = " @brief Defines an enum for the error codes that may be generated by the module.\n\n @since 12"]
pub type OH_Drawing_ErrorCode = u32;
extern "C" {
#[doc = " @brief Obtains the error code of the module.\n\n @return Returns the error code.\n @since 12\n @version 1.0"]
pub fn OH_Drawing_ErrorCodeGet() -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_ErrorCodeReset();
}
#[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"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_BitmapFormat {
#[doc = " Storage format of bitmap pixels."]
pub colorFormat: OH_Drawing_ColorFormat,
#[doc = " Alpha format of bitmap pixels."]
pub alphaFormat: OH_Drawing_AlphaFormat,
}
extern "C" {
#[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"]
pub fn OH_Drawing_BitmapCreate() -> *mut OH_Drawing_Bitmap;
}
extern "C" {
#[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"]
pub fn OH_Drawing_BitmapDestroy(bitmap: *mut OH_Drawing_Bitmap);
}
extern "C" {
#[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"]
pub fn OH_Drawing_BitmapCreateFromPixels(
imageInfo: *mut OH_Drawing_Image_Info,
pixels: *mut ::std::os::raw::c_void,
rowBytes: u32,
) -> *mut OH_Drawing_Bitmap;
}
extern "C" {
#[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"]
pub fn OH_Drawing_BitmapBuild(
bitmap: *mut OH_Drawing_Bitmap,
width: u32,
height: u32,
bitmapFormat: *const OH_Drawing_BitmapFormat,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_BitmapGetWidth(bitmap: *mut OH_Drawing_Bitmap) -> u32;
}
extern "C" {
#[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"]
pub fn OH_Drawing_BitmapGetHeight(bitmap: *mut OH_Drawing_Bitmap) -> u32;
}
extern "C" {
#[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"]
pub fn OH_Drawing_BitmapGetColorFormat(
bitmap: *mut OH_Drawing_Bitmap,
) -> OH_Drawing_ColorFormat;
}
extern "C" {
#[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"]
pub fn OH_Drawing_BitmapGetAlphaFormat(
bitmap: *mut OH_Drawing_Bitmap,
) -> OH_Drawing_AlphaFormat;
}
extern "C" {
#[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"]
pub fn OH_Drawing_BitmapGetPixels(
bitmap: *mut OH_Drawing_Bitmap,
) -> *mut ::std::os::raw::c_void;
}
extern "C" {
#[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"]
pub fn OH_Drawing_BitmapGetImageInfo(
bitmap: *mut OH_Drawing_Bitmap,
imageInfo: *mut OH_Drawing_Image_Info,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_BitmapReadPixels(
bitmap: *mut OH_Drawing_Bitmap,
dstInfo: *const OH_Drawing_Image_Info,
dstPixels: *mut ::std::os::raw::c_void,
dstRowBytes: usize,
srcX: i32,
srcY: i32,
) -> bool;
}
extern "C" {
#[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"]
#[cfg(feature = "api-26")]
pub fn OH_Drawing_BitmapGetRowBytes(
bitmap: *mut OH_Drawing_Bitmap,
bytes: *mut u32,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
pub fn OH_Drawing_BrushCreate() -> *mut OH_Drawing_Brush;
}
extern "C" {
#[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"]
pub fn OH_Drawing_BrushCopy(brush: *mut OH_Drawing_Brush) -> *mut OH_Drawing_Brush;
}
extern "C" {
#[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"]
pub fn OH_Drawing_BrushDestroy(brush: *mut OH_Drawing_Brush);
}
extern "C" {
#[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"]
pub fn OH_Drawing_BrushIsAntiAlias(brush: *const OH_Drawing_Brush) -> bool;
}
extern "C" {
#[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"]
pub fn OH_Drawing_BrushSetAntiAlias(brush: *mut OH_Drawing_Brush, antiAlias: bool);
}
extern "C" {
#[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"]
pub fn OH_Drawing_BrushGetColor(brush: *const OH_Drawing_Brush) -> u32;
}
extern "C" {
#[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"]
pub fn OH_Drawing_BrushSetColor(brush: *mut OH_Drawing_Brush, color: u32);
}
extern "C" {
#[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"]
pub fn OH_Drawing_BrushGetAlpha(brush: *const OH_Drawing_Brush) -> u8;
}
extern "C" {
#[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"]
pub fn OH_Drawing_BrushSetAlpha(brush: *mut OH_Drawing_Brush, alpha: u8);
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_BrushSetColor4f(
brush: *mut OH_Drawing_Brush,
a: f32,
r: f32,
g: f32,
b: f32,
colorSpaceManager: *mut OH_NativeColorSpaceManager,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_BrushGetAlphaFloat(
brush: *const OH_Drawing_Brush,
a: *mut f32,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_BrushGetRedFloat(
brush: *const OH_Drawing_Brush,
r: *mut f32,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_BrushGetGreenFloat(
brush: *const OH_Drawing_Brush,
g: *mut f32,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_BrushGetBlueFloat(
brush: *const OH_Drawing_Brush,
b: *mut f32,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
pub fn OH_Drawing_BrushSetShaderEffect(
brush: *mut OH_Drawing_Brush,
shaderEffect: *mut OH_Drawing_ShaderEffect,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_BrushSetShadowLayer(
brush: *mut OH_Drawing_Brush,
shadowLayer: *mut OH_Drawing_ShadowLayer,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_BrushSetFilter(brush: *mut OH_Drawing_Brush, filter: *mut OH_Drawing_Filter);
}
extern "C" {
#[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"]
pub fn OH_Drawing_BrushGetFilter(brush: *mut OH_Drawing_Brush, filter: *mut OH_Drawing_Filter);
}
extern "C" {
#[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"]
pub fn OH_Drawing_BrushSetBlendMode(
brush: *mut OH_Drawing_Brush,
blendMode: OH_Drawing_BlendMode,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_BrushReset(brush: *mut OH_Drawing_Brush);
}
#[doc = " Nearest filter mode."]
pub const OH_Drawing_FilterMode_FILTER_MODE_NEAREST: OH_Drawing_FilterMode = 0;
#[doc = " Linear filter mode."]
pub const OH_Drawing_FilterMode_FILTER_MODE_LINEAR: OH_Drawing_FilterMode = 1;
#[doc = " @brief Defines an enum for the filter modes.\n\n @since 12\n @version 1.0"]
pub type OH_Drawing_FilterMode = u32;
#[doc = " Mipmap level ignored."]
pub const OH_Drawing_MipmapMode_MIPMAP_MODE_NONE: OH_Drawing_MipmapMode = 0;
#[doc = " Nearest sampling from two adjacent mipmap levels."]
pub const OH_Drawing_MipmapMode_MIPMAP_MODE_NEAREST: OH_Drawing_MipmapMode = 1;
#[doc = " Linear interpolation sampling between two adjacent mipmap levels."]
pub const OH_Drawing_MipmapMode_MIPMAP_MODE_LINEAR: OH_Drawing_MipmapMode = 2;
#[doc = " @brief Defines an enum for the mipmap modes.\n\n @since 12\n @version 1.0"]
pub type OH_Drawing_MipmapMode = u32;
extern "C" {
#[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"]
pub fn OH_Drawing_SamplingOptionsCreate(
filterMode: OH_Drawing_FilterMode,
mipmapMode: OH_Drawing_MipmapMode,
) -> *mut OH_Drawing_SamplingOptions;
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_SamplingOptionsCopy(
samplingOptions: *mut OH_Drawing_SamplingOptions,
) -> *mut OH_Drawing_SamplingOptions;
}
extern "C" {
#[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"]
pub fn OH_Drawing_SamplingOptionsDestroy(samplingOptions: *mut OH_Drawing_SamplingOptions);
}
#[doc = " The source rectangle must be completely contained in the image."]
pub const OH_Drawing_SrcRectConstraint_STRICT_SRC_RECT_CONSTRAINT: OH_Drawing_SrcRectConstraint = 0;
#[doc = " The source rectangle can be partly outside the image."]
pub const OH_Drawing_SrcRectConstraint_FAST_SRC_RECT_CONSTRAINT: OH_Drawing_SrcRectConstraint = 1;
#[doc = " @brief Enumerates the constraint types of the source rectangle.\n\n @since 12\n @version 1.0"]
pub type OH_Drawing_SrcRectConstraint = u32;
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasCreate() -> *mut OH_Drawing_Canvas;
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_CanvasCreateWithPixelMap(
pixelMap: *mut OH_Drawing_PixelMap,
) -> *mut OH_Drawing_Canvas;
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasDestroy(canvas: *mut OH_Drawing_Canvas);
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasBind(canvas: *mut OH_Drawing_Canvas, bitmap: *mut OH_Drawing_Bitmap);
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasAttachPen(canvas: *mut OH_Drawing_Canvas, pen: *const OH_Drawing_Pen);
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasDetachPen(canvas: *mut OH_Drawing_Canvas);
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasAttachBrush(
canvas: *mut OH_Drawing_Canvas,
brush: *const OH_Drawing_Brush,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasDetachBrush(canvas: *mut OH_Drawing_Canvas);
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasSave(canvas: *mut OH_Drawing_Canvas);
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasSaveLayer(
canvas: *mut OH_Drawing_Canvas,
rect: *const OH_Drawing_Rect,
brush: *const OH_Drawing_Brush,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasRestore(canvas: *mut OH_Drawing_Canvas);
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasGetSaveCount(canvas: *mut OH_Drawing_Canvas) -> u32;
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasRestoreToCount(canvas: *mut OH_Drawing_Canvas, saveCount: u32);
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasDrawLine(
canvas: *mut OH_Drawing_Canvas,
x1: f32,
y1: f32,
x2: f32,
y2: f32,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasDrawPath(canvas: *mut OH_Drawing_Canvas, path: *const OH_Drawing_Path);
}
extern "C" {
#[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"]
#[cfg(feature = "api-23")]
pub fn OH_Drawing_CanvasDrawPixelMapMesh(
cCanvas: *mut OH_Drawing_Canvas,
pixelMap: *mut OH_Drawing_PixelMap,
meshWidth: u32,
meshHeight: u32,
vertices: *const f32,
verticesSize: u32,
vertOffset: u32,
colors: *const u32,
colorsSize: u32,
colorOffset: u32,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_CanvasDrawPixelMapNine(
canvas: *mut OH_Drawing_Canvas,
pixelMap: *mut OH_Drawing_PixelMap,
center: *const OH_Drawing_Rect,
dst: *const OH_Drawing_Rect,
mode: OH_Drawing_FilterMode,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasDrawPixelMapRect(
canvas: *mut OH_Drawing_Canvas,
pixelMap: *mut OH_Drawing_PixelMap,
src: *const OH_Drawing_Rect,
dst: *const OH_Drawing_Rect,
samplingOptions: *const OH_Drawing_SamplingOptions,
);
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_CanvasDrawPixelMapRectConstraint(
canvas: *mut OH_Drawing_Canvas,
pixelMap: *mut OH_Drawing_PixelMap,
src: *const OH_Drawing_Rect,
dst: *const OH_Drawing_Rect,
samplingOptions: *const OH_Drawing_SamplingOptions,
constraint: OH_Drawing_SrcRectConstraint,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasDrawBackground(
canvas: *mut OH_Drawing_Canvas,
brush: *const OH_Drawing_Brush,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasDrawRegion(
canvas: *mut OH_Drawing_Canvas,
region: *const OH_Drawing_Region,
);
}
#[doc = " Draws each point separately."]
pub const OH_Drawing_PointMode_POINT_MODE_POINTS: OH_Drawing_PointMode = 0;
#[doc = " Draws every two points as a line segment."]
pub const OH_Drawing_PointMode_POINT_MODE_LINES: OH_Drawing_PointMode = 1;
#[doc = " Draws an array of points as an open polygon."]
pub const OH_Drawing_PointMode_POINT_MODE_POLYGON: OH_Drawing_PointMode = 2;
#[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"]
pub type OH_Drawing_PointMode = u32;
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasDrawPoint(
canvas: *mut OH_Drawing_Canvas,
point: *const OH_Drawing_Point2D,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasDrawPoints(
canvas: *mut OH_Drawing_Canvas,
mode: OH_Drawing_PointMode,
count: u32,
point2D: *const OH_Drawing_Point2D,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasDrawBitmap(
canvas: *mut OH_Drawing_Canvas,
bitmap: *const OH_Drawing_Bitmap,
left: f32,
top: f32,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasDrawBitmapRect(
canvas: *mut OH_Drawing_Canvas,
bitmap: *const OH_Drawing_Bitmap,
src: *const OH_Drawing_Rect,
dst: *const OH_Drawing_Rect,
samplingOptions: *const OH_Drawing_SamplingOptions,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasDrawRect(canvas: *mut OH_Drawing_Canvas, rect: *const OH_Drawing_Rect);
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasDrawCircle(
canvas: *mut OH_Drawing_Canvas,
point: *const OH_Drawing_Point,
radius: f32,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasDrawColor(
canvas: *mut OH_Drawing_Canvas,
color: u32,
blendMode: OH_Drawing_BlendMode,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasDrawOval(canvas: *mut OH_Drawing_Canvas, rect: *const OH_Drawing_Rect);
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasDrawArc(
canvas: *mut OH_Drawing_Canvas,
rect: *const OH_Drawing_Rect,
startAngle: f32,
sweepAngle: f32,
);
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_CanvasDrawArcWithCenter(
canvas: *mut OH_Drawing_Canvas,
rect: *const OH_Drawing_Rect,
startAngle: f32,
sweepAngle: f32,
useCenter: bool,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasDrawRoundRect(
canvas: *mut OH_Drawing_Canvas,
roundRect: *const OH_Drawing_RoundRect,
);
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_CanvasDrawNestedRoundRect(
canvas: *mut OH_Drawing_Canvas,
outer: *const OH_Drawing_RoundRect,
inner: *const OH_Drawing_RoundRect,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasDrawSingleCharacter(
canvas: *mut OH_Drawing_Canvas,
str_: *const ::std::os::raw::c_char,
font: *const OH_Drawing_Font,
x: f32,
y: f32,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_CanvasDrawSingleCharacterWithFeatures(
canvas: *mut OH_Drawing_Canvas,
str_: *const ::std::os::raw::c_char,
font: *const OH_Drawing_Font,
x: f32,
y: f32,
fontFeatures: *mut OH_Drawing_FontFeatures,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasDrawTextBlob(
canvas: *mut OH_Drawing_Canvas,
textBlob: *const OH_Drawing_TextBlob,
x: f32,
y: f32,
);
}
extern "C" {
#[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"]
#[cfg(feature = "api-26")]
pub fn OH_Drawing_CanvasDrawGlyphs(
canvas: *const OH_Drawing_Canvas,
glyphIds: *const ::std::os::raw::c_int,
glyphIdCount: ::std::os::raw::c_int,
glyphIdOffset: ::std::os::raw::c_int,
positions: *const OH_Drawing_Point2D,
positionCount: ::std::os::raw::c_int,
positionOffset: ::std::os::raw::c_int,
glyphCount: ::std::os::raw::c_int,
font: *const OH_Drawing_Font,
) -> OH_Drawing_ErrorCode;
}
#[doc = " Clips a specified area. That is, the difference set is obtained."]
pub const OH_Drawing_CanvasClipOp_DIFFERENCE: OH_Drawing_CanvasClipOp = 0;
#[doc = " Retains a specified area. That is, the intersection is obtained."]
pub const OH_Drawing_CanvasClipOp_INTERSECT: OH_Drawing_CanvasClipOp = 1;
#[doc = " @brief Enumerates the canvas clipping modes.\n\n @since 11\n @version 1.0"]
pub type OH_Drawing_CanvasClipOp = u32;
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasClipRect(
canvas: *mut OH_Drawing_Canvas,
rect: *const OH_Drawing_Rect,
clipOp: OH_Drawing_CanvasClipOp,
doAntiAlias: bool,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasClipRoundRect(
canvas: *mut OH_Drawing_Canvas,
roundRect: *const OH_Drawing_RoundRect,
clipOp: OH_Drawing_CanvasClipOp,
doAntiAlias: bool,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasClipPath(
canvas: *mut OH_Drawing_Canvas,
path: *const OH_Drawing_Path,
clipOp: OH_Drawing_CanvasClipOp,
doAntiAlias: bool,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasClipRegion(
canvas: *mut OH_Drawing_Canvas,
region: *const OH_Drawing_Region,
clipOp: OH_Drawing_CanvasClipOp,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasRotate(canvas: *mut OH_Drawing_Canvas, degrees: f32, px: f32, py: f32);
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasTranslate(canvas: *mut OH_Drawing_Canvas, dx: f32, dy: f32);
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasScale(canvas: *mut OH_Drawing_Canvas, sx: f32, sy: f32);
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasSkew(canvas: *mut OH_Drawing_Canvas, sx: f32, sy: f32);
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasGetWidth(canvas: *mut OH_Drawing_Canvas) -> i32;
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasGetHeight(canvas: *mut OH_Drawing_Canvas) -> i32;
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasGetLocalClipBounds(
canvas: *mut OH_Drawing_Canvas,
rect: *mut OH_Drawing_Rect,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasGetTotalMatrix(
canvas: *mut OH_Drawing_Canvas,
matrix: *mut OH_Drawing_Matrix,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasConcatMatrix(
canvas: *mut OH_Drawing_Canvas,
matrix: *mut OH_Drawing_Matrix,
);
}
#[doc = " There is no shadow flag."]
pub const OH_Drawing_CanvasShadowFlags_SHADOW_FLAGS_NONE: OH_Drawing_CanvasShadowFlags = 0;
#[doc = " The occluding object is transparent."]
pub const OH_Drawing_CanvasShadowFlags_SHADOW_FLAGS_TRANSPARENT_OCCLUDER:
OH_Drawing_CanvasShadowFlags = 1;
#[doc = " No analysis on the shadows is required."]
pub const OH_Drawing_CanvasShadowFlags_SHADOW_FLAGS_GEOMETRIC_ONLY: OH_Drawing_CanvasShadowFlags =
2;
#[doc = " All the preceding shadow flags are used."]
pub const OH_Drawing_CanvasShadowFlags_SHADOW_FLAGS_ALL: OH_Drawing_CanvasShadowFlags = 3;
#[doc = " @brief Enumerates the shadow flags.\n\n @since 12\n @version 1.0"]
pub type OH_Drawing_CanvasShadowFlags = u32;
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasDrawShadow(
canvas: *mut OH_Drawing_Canvas,
path: *mut OH_Drawing_Path,
planeParams: OH_Drawing_Point3D,
devLightPos: OH_Drawing_Point3D,
lightRadius: f32,
ambientColor: u32,
spotColor: u32,
flag: OH_Drawing_CanvasShadowFlags,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasClear(canvas: *mut OH_Drawing_Canvas, color: u32);
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasSetMatrix(
canvas: *mut OH_Drawing_Canvas,
matrix: *mut OH_Drawing_Matrix,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasResetMatrix(canvas: *mut OH_Drawing_Canvas);
}
extern "C" {
#[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"]
#[cfg(feature = "api-26")]
pub fn OH_Drawing_CanvasResetClip(canvas: *mut OH_Drawing_Canvas) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasDrawImageRectWithSrc(
canvas: *mut OH_Drawing_Canvas,
image: *const OH_Drawing_Image,
src: *const OH_Drawing_Rect,
dst: *const OH_Drawing_Rect,
samplingOptions: *const OH_Drawing_SamplingOptions,
srcRectConstraint: OH_Drawing_SrcRectConstraint,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasDrawImageRect(
canvas: *mut OH_Drawing_Canvas,
image: *mut OH_Drawing_Image,
rect: *mut OH_Drawing_Rect,
samplingOptions: *mut OH_Drawing_SamplingOptions,
);
}
#[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."]
pub const OH_Drawing_VertexMode_VERTEX_MODE_TRIANGLES: OH_Drawing_VertexMode = 0;
#[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."]
pub const OH_Drawing_VertexMode_VERTEX_MODE_TRIANGLES_STRIP: OH_Drawing_VertexMode = 1;
#[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)."]
pub const OH_Drawing_VertexMode_VERTEX_MODE_TRIANGLE_FAN: OH_Drawing_VertexMode = 2;
#[doc = " @brief Enumerates the modes of interpreting the geometry of a given vertex.\n\n @since 12\n @version 1.0"]
pub type OH_Drawing_VertexMode = u32;
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasDrawVertices(
canvas: *mut OH_Drawing_Canvas,
vertexMmode: OH_Drawing_VertexMode,
vertexCount: i32,
positions: *const OH_Drawing_Point2D,
texs: *const OH_Drawing_Point2D,
colors: *const u32,
indexCount: i32,
indices: *const u16,
mode: OH_Drawing_BlendMode,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasReadPixels(
canvas: *mut OH_Drawing_Canvas,
imageInfo: *mut OH_Drawing_Image_Info,
dstPixels: *mut ::std::os::raw::c_void,
dstRowBytes: u32,
srcX: i32,
srcY: i32,
) -> bool;
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasReadPixelsToBitmap(
canvas: *mut OH_Drawing_Canvas,
bitmap: *mut OH_Drawing_Bitmap,
srcX: i32,
srcY: i32,
) -> bool;
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasIsClipEmpty(
canvas: *mut OH_Drawing_Canvas,
isClipEmpty: *mut bool,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
pub fn OH_Drawing_CanvasGetImageInfo(
canvas: *mut OH_Drawing_Canvas,
imageInfo: *mut OH_Drawing_Image_Info,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-13")]
pub fn OH_Drawing_CanvasDrawRecordCmd(
canvas: *mut OH_Drawing_Canvas,
recordCmd: *mut OH_Drawing_RecordCmd,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-19")]
pub fn OH_Drawing_CanvasDrawRecordCmdNesting(
canvas: *mut OH_Drawing_Canvas,
recordCmd: *mut OH_Drawing_RecordCmd,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_CanvasQuickRejectPath(
canvas: *mut OH_Drawing_Canvas,
path: *const OH_Drawing_Path,
quickReject: *mut bool,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_CanvasQuickRejectRect(
canvas: *mut OH_Drawing_Canvas,
rect: *const OH_Drawing_Rect,
quickReject: *mut bool,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-26")]
pub fn OH_Drawing_CanvasIsOpaque(
canvas: *const OH_Drawing_Canvas,
isOpaque: *mut bool,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
pub fn OH_Drawing_ColorSetArgb(alpha: u32, red: u32, green: u32, blue: u32) -> u32;
}
extern "C" {
#[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"]
pub fn OH_Drawing_ColorFilterCreateBlendMode(
color: u32,
blendMode: OH_Drawing_BlendMode,
) -> *mut OH_Drawing_ColorFilter;
}
extern "C" {
#[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"]
pub fn OH_Drawing_ColorFilterCreateCompose(
outerColorFilter: *mut OH_Drawing_ColorFilter,
innerColorFilter: *mut OH_Drawing_ColorFilter,
) -> *mut OH_Drawing_ColorFilter;
}
extern "C" {
#[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"]
pub fn OH_Drawing_ColorFilterCreateMatrix(matrix: *const f32) -> *mut OH_Drawing_ColorFilter;
}
extern "C" {
#[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"]
pub fn OH_Drawing_ColorFilterCreateLinearToSrgbGamma() -> *mut OH_Drawing_ColorFilter;
}
extern "C" {
#[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"]
pub fn OH_Drawing_ColorFilterCreateSrgbGammaToLinear() -> *mut OH_Drawing_ColorFilter;
}
extern "C" {
#[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"]
pub fn OH_Drawing_ColorFilterCreateLuma() -> *mut OH_Drawing_ColorFilter;
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_ColorFilterCreateLighting(
mulColor: u32,
addColor: u32,
) -> *mut OH_Drawing_ColorFilter;
}
extern "C" {
#[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"]
pub fn OH_Drawing_ColorFilterDestroy(colorFilter: *mut OH_Drawing_ColorFilter);
}
extern "C" {
#[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"]
pub fn OH_Drawing_ColorSpaceCreateSrgb() -> *mut OH_Drawing_ColorSpace;
}
extern "C" {
#[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"]
pub fn OH_Drawing_ColorSpaceCreateSrgbLinear() -> *mut OH_Drawing_ColorSpace;
}
extern "C" {
#[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"]
pub fn OH_Drawing_ColorSpaceDestroy(colorSpace: *mut OH_Drawing_ColorSpace);
}
extern "C" {
#[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"]
pub fn OH_Drawing_FilterCreate() -> *mut OH_Drawing_Filter;
}
extern "C" {
#[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"]
pub fn OH_Drawing_FilterSetImageFilter(
filter: *mut OH_Drawing_Filter,
imageFilter: *mut OH_Drawing_ImageFilter,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_FilterSetMaskFilter(
filter: *mut OH_Drawing_Filter,
maskFilter: *mut OH_Drawing_MaskFilter,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_FilterSetColorFilter(
filter: *mut OH_Drawing_Filter,
colorFilter: *mut OH_Drawing_ColorFilter,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_FilterGetColorFilter(
filter: *mut OH_Drawing_Filter,
colorFilter: *mut OH_Drawing_ColorFilter,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_FilterDestroy(filter: *mut OH_Drawing_Filter);
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontCreate() -> *mut OH_Drawing_Font;
}
#[doc = " No font hinting is used.\n\n @since 12"]
pub const OH_Drawing_FontHinting_FONT_HINTING_NONE: OH_Drawing_FontHinting = 0;
#[doc = " Slight font hinting is used to improve contrast.\n\n @since 12"]
pub const OH_Drawing_FontHinting_FONT_HINTING_SLIGHT: OH_Drawing_FontHinting = 1;
#[doc = " Normal font hinting is used to improve contrast.\n\n @since 12"]
pub const OH_Drawing_FontHinting_FONT_HINTING_NORMAL: OH_Drawing_FontHinting = 2;
#[doc = " Full font hinting is used to improve contrast.\n\n @since 12"]
pub const OH_Drawing_FontHinting_FONT_HINTING_FULL: OH_Drawing_FontHinting = 3;
#[doc = " @brief Defines an enum for the font hinting types.\n\n @since 12\n @version 1.0"]
pub type OH_Drawing_FontHinting = u32;
#[doc = " No anti-aliasing processing is used.\n\n @since 12"]
pub const OH_Drawing_FontEdging_FONT_EDGING_ALIAS: OH_Drawing_FontEdging = 0;
#[doc = " Uses anti-aliasing to smooth the jagged edges.\n\n @since 12"]
pub const OH_Drawing_FontEdging_FONT_EDGING_ANTI_ALIAS: OH_Drawing_FontEdging = 1;
#[doc = " Uses sub-pixel anti-aliasing to provide a smoother effect for jagged edges.\n\n @since 12"]
pub const OH_Drawing_FontEdging_FONT_EDGING_SUBPIXEL_ANTI_ALIAS: OH_Drawing_FontEdging = 2;
#[doc = " @brief Enumerates the font edging types.\n\n @since 12\n @version 1.0"]
pub type OH_Drawing_FontEdging = u32;
extern "C" {
#[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"]
pub fn OH_Drawing_FontSetBaselineSnap(font: *mut OH_Drawing_Font, baselineSnap: bool);
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontIsBaselineSnap(font: *const OH_Drawing_Font) -> bool;
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontSetSubpixel(font: *mut OH_Drawing_Font, isSubpixel: bool);
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontIsSubpixel(font: *const OH_Drawing_Font) -> bool;
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontSetForceAutoHinting(font: *mut OH_Drawing_Font, isForceAutoHinting: bool);
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontIsForceAutoHinting(font: *const OH_Drawing_Font) -> bool;
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontSetTypeface(
font: *mut OH_Drawing_Font,
typeface: *mut OH_Drawing_Typeface,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontGetTypeface(font: *mut OH_Drawing_Font) -> *mut OH_Drawing_Typeface;
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontSetTextSize(font: *mut OH_Drawing_Font, textSize: f32);
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontGetTextSize(font: *const OH_Drawing_Font) -> f32;
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontCountText(
font: *mut OH_Drawing_Font,
text: *const ::std::os::raw::c_void,
byteLength: usize,
encoding: OH_Drawing_TextEncoding,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontTextToGlyphs(
font: *const OH_Drawing_Font,
text: *const ::std::os::raw::c_void,
byteLength: u32,
encoding: OH_Drawing_TextEncoding,
glyphs: *mut u16,
maxGlyphCount: ::std::os::raw::c_int,
) -> u32;
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontGetWidths(
font: *const OH_Drawing_Font,
glyphs: *const u16,
count: ::std::os::raw::c_int,
widths: *mut f32,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontMeasureSingleCharacter(
font: *const OH_Drawing_Font,
str_: *const ::std::os::raw::c_char,
textWidth: *mut f32,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_FontMeasureSingleCharacterWithFeatures(
font: *const OH_Drawing_Font,
str_: *const ::std::os::raw::c_char,
fontFeatures: *const OH_Drawing_FontFeatures,
textWidth: *mut f32,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontMeasureText(
font: *const OH_Drawing_Font,
text: *const ::std::os::raw::c_void,
byteLength: usize,
encoding: OH_Drawing_TextEncoding,
bounds: *mut OH_Drawing_Rect,
textWidth: *mut f32,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-19")]
pub fn OH_Drawing_FontMeasureTextWithBrushOrPen(
font: *const OH_Drawing_Font,
text: *const ::std::os::raw::c_void,
byteLength: usize,
encoding: OH_Drawing_TextEncoding,
brush: *const OH_Drawing_Brush,
pen: *const OH_Drawing_Pen,
bounds: *mut OH_Drawing_Rect,
textWidth: *mut f32,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-19")]
pub fn OH_Drawing_FontGetWidthsBounds(
font: *const OH_Drawing_Font,
glyphs: *const u16,
count: ::std::os::raw::c_int,
brush: *const OH_Drawing_Brush,
pen: *const OH_Drawing_Pen,
widths: *mut f32,
bounds: *mut OH_Drawing_Array,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-19")]
pub fn OH_Drawing_FontGetPos(
font: *const OH_Drawing_Font,
glyphs: *const u16,
count: ::std::os::raw::c_int,
origin: *const OH_Drawing_Point,
points: *mut OH_Drawing_Point2D,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-19")]
pub fn OH_Drawing_FontGetSpacing(
font: *const OH_Drawing_Font,
spacing: *mut f32,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontSetLinearText(font: *mut OH_Drawing_Font, isLinearText: bool);
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontIsLinearText(font: *const OH_Drawing_Font) -> bool;
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontSetTextSkewX(font: *mut OH_Drawing_Font, skewX: f32);
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontGetTextSkewX(font: *const OH_Drawing_Font) -> f32;
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontSetFakeBoldText(font: *mut OH_Drawing_Font, isFakeBoldText: bool);
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontIsFakeBoldText(font: *const OH_Drawing_Font) -> bool;
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontSetScaleX(font: *mut OH_Drawing_Font, scaleX: f32);
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontGetScaleX(font: *const OH_Drawing_Font) -> f32;
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontSetHinting(
font: *mut OH_Drawing_Font,
fontHinting: OH_Drawing_FontHinting,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontGetHinting(font: *const OH_Drawing_Font) -> OH_Drawing_FontHinting;
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontSetEmbeddedBitmaps(font: *mut OH_Drawing_Font, isEmbeddedBitmaps: bool);
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontIsEmbeddedBitmaps(font: *const OH_Drawing_Font) -> bool;
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontSetEdging(font: *mut OH_Drawing_Font, fontEdging: OH_Drawing_FontEdging);
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontGetEdging(font: *const OH_Drawing_Font) -> OH_Drawing_FontEdging;
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontDestroy(font: *mut OH_Drawing_Font);
}
#[doc = " @brief This struct describes the measurement information about a font.\n\n @since 12\n @version 1.0"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_Font_Metrics {
#[doc = " Measurement information that is valid.\n\n @since 12"]
pub flags: u32,
#[doc = " Maximum distance from the baseline to the highest coordinate of a character.\n\n @since 12"]
pub top: f32,
#[doc = " Recommended distance from the baseline to the highest coordinate of a character.\n\n @since 12"]
pub ascent: f32,
#[doc = " Recommended distance from the baseline to the lowest coordinate of a character.\n\n @since 12"]
pub descent: f32,
#[doc = " Maximum distance from the baseline to the lowest coordinate of a character.\n\n @since 12"]
pub bottom: f32,
#[doc = " Gap between rows.\n\n @since 12"]
pub leading: f32,
#[doc = " Average character width, or zero if unknown.\n\n @since 12"]
pub avgCharWidth: f32,
#[doc = " Maximum character width, or zero if unknown.\n\n @since 12"]
pub maxCharWidth: f32,
#[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"]
pub xMin: f32,
#[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"]
pub xMax: f32,
#[doc = " Height of a lowercase letter, or zero if unknown. Generally, the value is a negative value.\n\n @since 12"]
pub xHeight: f32,
#[doc = " Height of an uppercase letter, or zero if unknown. Generally, the value is a negative value.\n\n @since 12"]
pub capHeight: f32,
#[doc = " @brief Thickness of the underline.\n\n @since 12"]
pub underlineThickness: f32,
#[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"]
pub underlinePosition: f32,
#[doc = " Thickness of the strikethrough.\n\n @since 12"]
pub strikeoutThickness: f32,
#[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"]
pub strikeoutPosition: f32,
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontGetMetrics(
font: *mut OH_Drawing_Font,
fontMetrics: *mut OH_Drawing_Font_Metrics,
) -> f32;
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_FontGetBounds(
font: *const OH_Drawing_Font,
glyphs: *const u16,
count: u32,
bounds: *mut OH_Drawing_Array,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_FontGetPathForGlyph(
font: *const OH_Drawing_Font,
glyph: u16,
path: *mut OH_Drawing_Path,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_FontGetTextPath(
font: *const OH_Drawing_Font,
text: *const ::std::os::raw::c_void,
byteLength: usize,
encoding: OH_Drawing_TextEncoding,
x: f32,
y: f32,
path: *mut OH_Drawing_Path,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-26")]
pub fn OH_Drawing_FontGetTextPathWithFallback(
font: *const OH_Drawing_Font,
text: *const ::std::os::raw::c_void,
byteLength: usize,
encoding: OH_Drawing_TextEncoding,
x: f32,
y: f32,
path: *mut OH_Drawing_Path,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_FontFeaturesCreate() -> *mut OH_Drawing_FontFeatures;
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_FontFeaturesAddFeature(
fontFeatures: *mut OH_Drawing_FontFeatures,
name: *const ::std::os::raw::c_char,
value: f32,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_FontFeaturesDestroy(
fontFeatures: *mut OH_Drawing_FontFeatures,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-15")]
pub fn OH_Drawing_FontSetThemeFontFollowed(
font: *mut OH_Drawing_Font,
followed: bool,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-15")]
pub fn OH_Drawing_FontIsThemeFontFollowed(
font: *const OH_Drawing_Font,
followed: *mut bool,
) -> OH_Drawing_ErrorCode;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_FontCollection {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_Typography {
_unused: [u8; 0],
}
#[cfg(feature = "api-18")]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_LineTypography {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_TextStyle {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_TypographyStyle {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_TypographyCreate {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_TextBox {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_PositionAndAffinity {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_Range {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_FontParser {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_TextShadow {
_unused: [u8; 0],
}
#[cfg(feature = "api-18")]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_TextTab {
_unused: [u8; 0],
}
#[cfg(feature = "api-18")]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_TextLine {
_unused: [u8; 0],
}
#[cfg(feature = "api-18")]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_Run {
_unused: [u8; 0],
}
#[cfg(feature = "api-22")]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_FontFullDescriptor {
_unused: [u8; 0],
}
#[cfg(feature = "api-24")]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_FontVariationAxis {
_unused: [u8; 0],
}
#[cfg(feature = "api-24")]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_FontVariationInstance {
_unused: [u8; 0],
}
extern "C" {
#[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"]
pub fn OH_Drawing_CreateFontCollection() -> *mut OH_Drawing_FontCollection;
}
extern "C" {
#[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"]
pub fn OH_Drawing_DestroyFontCollection(fontCollection: *mut OH_Drawing_FontCollection);
}
extern "C" {
#[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"]
pub fn OH_Drawing_DisableFontCollectionFallback(fontCollection: *mut OH_Drawing_FontCollection);
}
extern "C" {
#[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"]
pub fn OH_Drawing_DisableFontCollectionSystemFont(
fontCollection: *mut OH_Drawing_FontCollection,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_CreateSharedFontCollection() -> *mut OH_Drawing_FontCollection;
}
extern "C" {
#[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"]
pub fn OH_Drawing_ClearFontCaches(fontCollection: *mut OH_Drawing_FontCollection);
}
extern "C" {
#[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"]
#[cfg(feature = "api-14")]
pub fn OH_Drawing_GetFontCollectionGlobalInstance() -> *mut OH_Drawing_FontCollection;
}
#[doc = " Right to left (RTL)."]
pub const OH_Drawing_TextDirection_TEXT_DIRECTION_RTL: OH_Drawing_TextDirection = 0;
#[doc = " Left to right (LTR)."]
pub const OH_Drawing_TextDirection_TEXT_DIRECTION_LTR: OH_Drawing_TextDirection = 1;
#[doc = " @brief Enumerates the text directions.\n\n @since 8\n @version 1.0"]
pub type OH_Drawing_TextDirection = u32;
#[doc = " Left-aligned."]
pub const OH_Drawing_TextAlign_TEXT_ALIGN_LEFT: OH_Drawing_TextAlign = 0;
#[doc = " Right-aligned."]
pub const OH_Drawing_TextAlign_TEXT_ALIGN_RIGHT: OH_Drawing_TextAlign = 1;
#[doc = " Center-aligned."]
pub const OH_Drawing_TextAlign_TEXT_ALIGN_CENTER: OH_Drawing_TextAlign = 2;
#[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."]
pub const OH_Drawing_TextAlign_TEXT_ALIGN_JUSTIFY: OH_Drawing_TextAlign = 3;
#[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."]
pub const OH_Drawing_TextAlign_TEXT_ALIGN_START: OH_Drawing_TextAlign = 4;
#[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."]
pub const OH_Drawing_TextAlign_TEXT_ALIGN_END: OH_Drawing_TextAlign = 5;
#[doc = " @brief Enumerates the text alignment modes.\n\n @since 8\n @version 1.0"]
pub type OH_Drawing_TextAlign = u32;
#[doc = " Thin."]
pub const OH_Drawing_FontWeight_FONT_WEIGHT_100: OH_Drawing_FontWeight = 0;
#[doc = " Extra-light."]
pub const OH_Drawing_FontWeight_FONT_WEIGHT_200: OH_Drawing_FontWeight = 1;
#[doc = " Light."]
pub const OH_Drawing_FontWeight_FONT_WEIGHT_300: OH_Drawing_FontWeight = 2;
#[doc = " Normal/Regular."]
pub const OH_Drawing_FontWeight_FONT_WEIGHT_400: OH_Drawing_FontWeight = 3;
#[doc = " Medium."]
pub const OH_Drawing_FontWeight_FONT_WEIGHT_500: OH_Drawing_FontWeight = 4;
#[doc = " Semi-bold."]
pub const OH_Drawing_FontWeight_FONT_WEIGHT_600: OH_Drawing_FontWeight = 5;
#[doc = " Bold."]
pub const OH_Drawing_FontWeight_FONT_WEIGHT_700: OH_Drawing_FontWeight = 6;
#[doc = " Extra-bold."]
pub const OH_Drawing_FontWeight_FONT_WEIGHT_800: OH_Drawing_FontWeight = 7;
#[doc = " Black."]
pub const OH_Drawing_FontWeight_FONT_WEIGHT_900: OH_Drawing_FontWeight = 8;
#[doc = " @brief Enumerates the font weights.\n\n @since 8\n @version 1.0"]
pub type OH_Drawing_FontWeight = u32;
#[doc = " Alphabetic, where the letters in alphabets like English sit on."]
pub const OH_Drawing_TextBaseline_TEXT_BASELINE_ALPHABETIC: OH_Drawing_TextBaseline = 0;
#[doc = " Ideographic, where the baseline is at the bottom of the text area."]
pub const OH_Drawing_TextBaseline_TEXT_BASELINE_IDEOGRAPHIC: OH_Drawing_TextBaseline = 1;
#[doc = " @brief Enumerates the text baselines.\n\n @since 8\n @version 1.0"]
pub type OH_Drawing_TextBaseline = u32;
#[doc = " No decoration."]
pub const OH_Drawing_TextDecoration_TEXT_DECORATION_NONE: OH_Drawing_TextDecoration = 0;
#[doc = " An underline is used for decoration."]
pub const OH_Drawing_TextDecoration_TEXT_DECORATION_UNDERLINE: OH_Drawing_TextDecoration = 1;
#[doc = " An overline is used for decoration."]
pub const OH_Drawing_TextDecoration_TEXT_DECORATION_OVERLINE: OH_Drawing_TextDecoration = 2;
#[doc = " A strikethrough is used for decoration."]
pub const OH_Drawing_TextDecoration_TEXT_DECORATION_LINE_THROUGH: OH_Drawing_TextDecoration = 4;
#[doc = " @brief Enumerates the text decorations.\n\n @since 8\n @version 1.0"]
pub type OH_Drawing_TextDecoration = u32;
#[doc = " Normal style."]
pub const OH_Drawing_FontStyle_FONT_STYLE_NORMAL: OH_Drawing_FontStyle = 0;
#[doc = " Italic."]
pub const OH_Drawing_FontStyle_FONT_STYLE_ITALIC: OH_Drawing_FontStyle = 1;
#[doc = " Oblique."]
pub const OH_Drawing_FontStyle_FONT_STYLE_OBLIQUE: OH_Drawing_FontStyle = 2;
#[doc = " @brief Font styles, including non-italic, italic, and oblique.\n\n @since 8\n @version 1.0"]
pub type OH_Drawing_FontStyle = u32;
#[doc = " Aligned to the baseline."]
pub const OH_Drawing_PlaceholderVerticalAlignment_ALIGNMENT_OFFSET_AT_BASELINE:
OH_Drawing_PlaceholderVerticalAlignment = 0;
#[doc = " Aligned above the baseline."]
pub const OH_Drawing_PlaceholderVerticalAlignment_ALIGNMENT_ABOVE_BASELINE:
OH_Drawing_PlaceholderVerticalAlignment = 1;
#[doc = " Aligned below the baseline."]
pub const OH_Drawing_PlaceholderVerticalAlignment_ALIGNMENT_BELOW_BASELINE:
OH_Drawing_PlaceholderVerticalAlignment = 2;
#[doc = " Aligned to the top of the row box."]
pub const OH_Drawing_PlaceholderVerticalAlignment_ALIGNMENT_TOP_OF_ROW_BOX:
OH_Drawing_PlaceholderVerticalAlignment = 3;
#[doc = " Aligned to the bottom of the row box."]
pub const OH_Drawing_PlaceholderVerticalAlignment_ALIGNMENT_BOTTOM_OF_ROW_BOX:
OH_Drawing_PlaceholderVerticalAlignment = 4;
#[doc = " Aligned to the center of the row box."]
pub const OH_Drawing_PlaceholderVerticalAlignment_ALIGNMENT_CENTER_OF_ROW_BOX:
OH_Drawing_PlaceholderVerticalAlignment = 5;
#[doc = " Follows the text vertical alignment.\n @since 20"]
#[cfg(feature = "api-20")]
pub const OH_Drawing_PlaceholderVerticalAlignment_ALIGNMENT_FOLLOW_PARAGRAPH:
OH_Drawing_PlaceholderVerticalAlignment = 6;
#[doc = " @brief Enumerates the vertical alignment modes of placeholders.\n\n @since 11\n @version 1.0"]
pub type OH_Drawing_PlaceholderVerticalAlignment = u32;
#[doc = " @brief This struct describes the placeholder that acts as a span.\n\n @since 11\n @version 1.0"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_PlaceholderSpan {
#[doc = " Width of a placeholder."]
pub width: f64,
#[doc = " Height of a placeholder."]
pub height: f64,
#[doc = " Alignment mode of a placeholder."]
pub alignment: OH_Drawing_PlaceholderVerticalAlignment,
#[doc = " Baseline of a placeholder."]
pub baseline: OH_Drawing_TextBaseline,
#[doc = " Baseline offset of a placeholder."]
pub baselineOffset: f64,
}
#[doc = " Solid style."]
pub const OH_Drawing_TextDecorationStyle_TEXT_DECORATION_STYLE_SOLID:
OH_Drawing_TextDecorationStyle = 0;
#[doc = " Double style."]
pub const OH_Drawing_TextDecorationStyle_TEXT_DECORATION_STYLE_DOUBLE:
OH_Drawing_TextDecorationStyle = 1;
#[doc = " Dotted style."]
pub const OH_Drawing_TextDecorationStyle_TEXT_DECORATION_STYLE_DOTTED:
OH_Drawing_TextDecorationStyle = 2;
#[doc = " Dashed style."]
pub const OH_Drawing_TextDecorationStyle_TEXT_DECORATION_STYLE_DASHED:
OH_Drawing_TextDecorationStyle = 3;
#[doc = " Wavy style."]
pub const OH_Drawing_TextDecorationStyle_TEXT_DECORATION_STYLE_WAVY:
OH_Drawing_TextDecorationStyle = 4;
#[doc = " @brief Enumerates the text decoration styles.\n\n @since 11\n @version 1.0"]
pub type OH_Drawing_TextDecorationStyle = u32;
#[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}."]
pub const OH_Drawing_EllipsisModal_ELLIPSIS_MODAL_HEAD: OH_Drawing_EllipsisModal = 0;
#[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}."]
pub const OH_Drawing_EllipsisModal_ELLIPSIS_MODAL_MIDDLE: OH_Drawing_EllipsisModal = 1;
#[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}."]
pub const OH_Drawing_EllipsisModal_ELLIPSIS_MODAL_TAIL: OH_Drawing_EllipsisModal = 2;
#[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"]
#[cfg(feature = "api-24")]
pub const OH_Drawing_EllipsisModal_ELLIPSIS_MODAL_MULTILINE_HEAD: OH_Drawing_EllipsisModal = 3;
#[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"]
#[cfg(feature = "api-24")]
pub const OH_Drawing_EllipsisModal_ELLIPSIS_MODAL_MULTILINE_MIDDLE: OH_Drawing_EllipsisModal = 4;
#[doc = " @brief Enumerates the ellipsis styles.\n\n @since 11\n @version 1.0"]
pub type OH_Drawing_EllipsisModal = u32;
#[doc = " Each line is filled as much as possible during line break."]
pub const OH_Drawing_BreakStrategy_BREAK_STRATEGY_GREEDY: OH_Drawing_BreakStrategy = 0;
#[doc = " Text continuity is preferentially considered during line break."]
pub const OH_Drawing_BreakStrategy_BREAK_STRATEGY_HIGH_QUALITY: OH_Drawing_BreakStrategy = 1;
#[doc = " Line breaks are performed at the word boundary."]
pub const OH_Drawing_BreakStrategy_BREAK_STRATEGY_BALANCED: OH_Drawing_BreakStrategy = 2;
#[doc = " @brief Enumerates the text break strategies.\n\n @since 11\n @version 1.0"]
pub type OH_Drawing_BreakStrategy = u32;
#[doc = " Normal mode."]
pub const OH_Drawing_WordBreakType_WORD_BREAK_TYPE_NORMAL: OH_Drawing_WordBreakType = 0;
#[doc = " Breaks the words at any character to prevent overflow."]
pub const OH_Drawing_WordBreakType_WORD_BREAK_TYPE_BREAK_ALL: OH_Drawing_WordBreakType = 1;
#[doc = " Breaks the words at arbitrary points to prevent overflow."]
pub const OH_Drawing_WordBreakType_WORD_BREAK_TYPE_BREAK_WORD: OH_Drawing_WordBreakType = 2;
#[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"]
#[cfg(feature = "api-18")]
pub const OH_Drawing_WordBreakType_WORD_BREAK_TYPE_BREAK_HYPHEN: OH_Drawing_WordBreakType = 3;
#[doc = " @brief Enumerates the word break types.\n\n @since 11\n @version 1.0"]
pub type OH_Drawing_WordBreakType = u32;
#[doc = " Tight style. The text box height closely fits the text content boundary."]
pub const OH_Drawing_RectHeightStyle_RECT_HEIGHT_STYLE_TIGHT: OH_Drawing_RectHeightStyle = 0;
#[doc = " Max style. The text box height takes the maximum height among all lines."]
pub const OH_Drawing_RectHeightStyle_RECT_HEIGHT_STYLE_MAX: OH_Drawing_RectHeightStyle = 1;
#[doc = " Include line spacing middle style. The text box height includes the middle portion of the line spacing."]
pub const OH_Drawing_RectHeightStyle_RECT_HEIGHT_STYLE_INCLUDELINESPACEMIDDLE:
OH_Drawing_RectHeightStyle = 2;
#[doc = " Include line spacing top style. The text box height includes the top portion of the line spacing."]
pub const OH_Drawing_RectHeightStyle_RECT_HEIGHT_STYLE_INCLUDELINESPACETOP:
OH_Drawing_RectHeightStyle = 3;
#[doc = " Include line spacing bottom style. The text box height includes the bottom portion of the line spacing."]
pub const OH_Drawing_RectHeightStyle_RECT_HEIGHT_STYLE_INCLUDELINESPACEBOTTOM:
OH_Drawing_RectHeightStyle = 4;
#[doc = " Struct style. The Strut Style determines the text box height."]
pub const OH_Drawing_RectHeightStyle_RECT_HEIGHT_STYLE_STRUCT: OH_Drawing_RectHeightStyle = 5;
#[doc = " @brief Enumerates the rectangle height styles.\n\n @since 11\n @version 1.0"]
pub type OH_Drawing_RectHeightStyle = u32;
#[doc = " Tight style. The text box height closely fits the text content boundary."]
pub const OH_Drawing_RectWidthStyle_RECT_WIDTH_STYLE_TIGHT: OH_Drawing_RectWidthStyle = 0;
#[doc = " Max style. The text box height takes the maximum height among all lines."]
pub const OH_Drawing_RectWidthStyle_RECT_WIDTH_STYLE_MAX: OH_Drawing_RectWidthStyle = 1;
#[doc = " @brief Enumerates the rectangle width styles.\n\n @since 11\n @version 1.0"]
pub type OH_Drawing_RectWidthStyle = u32;
#[doc = " Operation successful."]
pub const OH_Drawing_FontConfigInfoErrorCode_SUCCESS_FONT_CONFIG_INFO:
OH_Drawing_FontConfigInfoErrorCode = 0;
#[doc = " Unknown error."]
pub const OH_Drawing_FontConfigInfoErrorCode_ERROR_FONT_CONFIG_INFO_UNKNOWN:
OH_Drawing_FontConfigInfoErrorCode = 1;
#[doc = " Failed to parse the system configuration file."]
pub const OH_Drawing_FontConfigInfoErrorCode_ERROR_FONT_CONFIG_INFO_PARSE_FILE:
OH_Drawing_FontConfigInfoErrorCode = 2;
#[doc = " Memory allocation fails."]
pub const OH_Drawing_FontConfigInfoErrorCode_ERROR_FONT_CONFIG_INFO_ALLOC_MEMORY:
OH_Drawing_FontConfigInfoErrorCode = 3;
#[doc = " Failed to copy the string data."]
pub const OH_Drawing_FontConfigInfoErrorCode_ERROR_FONT_CONFIG_INFO_COPY_STRING_DATA:
OH_Drawing_FontConfigInfoErrorCode = 4;
#[doc = " @brief Enumerates the error codes for the system font configuration information list.\n\n @since 12\n @version 1.0"]
pub type OH_Drawing_FontConfigInfoErrorCode = u32;
#[doc = " @brief This struct describes the information about a font fallback.\n\n @since 12\n @version 1.0"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_FontFallbackInfo {
#[doc = " Pointer to the language supported by the font fallback. The language format is bcp47."]
pub language: *mut ::std::os::raw::c_char,
#[doc = " Pointer to the name of a font family."]
pub familyName: *mut ::std::os::raw::c_char,
}
#[doc = " @brief This struct describes the information about a font fallback group.\n\n @since 12\n @version 1.0"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_FontFallbackGroup {
#[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."]
pub groupName: *mut ::std::os::raw::c_char,
#[doc = " Number of font fallbacks."]
pub fallbackInfoSize: usize,
#[doc = " List of fallback font sets."]
pub fallbackInfoSet: *mut OH_Drawing_FontFallbackInfo,
}
#[doc = " @brief This struct describes the information about a font weight mapping.\n\n @since 12\n @version 1.0"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_FontAdjustInfo {
#[doc = " Original font weight."]
pub weight: ::std::os::raw::c_int,
#[doc = " Font weight displayed in the application."]
pub to: ::std::os::raw::c_int,
}
#[doc = " @brief This struct describes the information about a font alias.\n\n @since 12\n @version 1.0"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_FontAliasInfo {
#[doc = " Pointer to the name of a font family."]
pub familyName: *mut ::std::os::raw::c_char,
#[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."]
pub weight: ::std::os::raw::c_int,
}
#[doc = " @brief This struct describes the information about generic fonts supported by the system.\n\n @since 12\n @version 1.0"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_FontGenericInfo {
#[doc = " Pointer to the name of a font family."]
pub familyName: *mut ::std::os::raw::c_char,
#[doc = " Number of font aliases."]
pub aliasInfoSize: usize,
#[doc = " Number of font weight mappings."]
pub adjustInfoSize: usize,
#[doc = " Pointer to a set of font aliases."]
pub aliasInfoSet: *mut OH_Drawing_FontAliasInfo,
#[doc = " Pointer to a set of font weight mappings."]
pub adjustInfoSet: *mut OH_Drawing_FontAdjustInfo,
}
#[doc = " @brief This struct describes the information about a system font configuration.\n\n @since 12\n @version 1.0"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_FontConfigInfo {
#[doc = " Number of system font file paths."]
pub fontDirSize: usize,
#[doc = " Number of generic fonts."]
pub fontGenericInfoSize: usize,
#[doc = " Number of font fallbacks."]
pub fallbackGroupSize: usize,
#[doc = " Double pointer to the system font file paths."]
pub fontDirSet: *mut *mut ::std::os::raw::c_char,
#[doc = " Pointer to a set of generic fonts."]
pub fontGenericInfoSet: *mut OH_Drawing_FontGenericInfo,
#[doc = " Pointer to a set of font fallbacks."]
pub fallbackGroupSet: *mut OH_Drawing_FontFallbackGroup,
}
#[doc = " @brief This struct describes the detailed information about a system font.\n\n @since 12\n @version 1.0"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_FontDescriptor {
#[doc = " File path of the system font."]
pub path: *mut ::std::os::raw::c_char,
#[doc = " PostScript name that uniquely identifies the system font."]
pub postScriptName: *mut ::std::os::raw::c_char,
#[doc = " Full name of the system font."]
pub fullName: *mut ::std::os::raw::c_char,
#[doc = " Family of the system font."]
pub fontFamily: *mut ::std::os::raw::c_char,
#[doc = " Subfamily of the system font."]
pub fontSubfamily: *mut ::std::os::raw::c_char,
#[doc = " Weight of the system font."]
pub weight: ::std::os::raw::c_int,
#[doc = " Width of the system font."]
pub width: ::std::os::raw::c_int,
#[doc = " Slope of the system font."]
pub italic: ::std::os::raw::c_int,
#[doc = " Whether the system font is monospace. The value true means the font is monospace, and false means the opposite."]
pub monoSpace: bool,
#[doc = " Whether the system font supports symbols. **true** means yes; **false** otherwise."]
pub symbolic: bool,
}
#[doc = " @brief This struct describes the measurement information about a line of text.\n\n @since 12\n @version 1.0"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_LineMetrics {
#[doc = " Height of a character above the baseline, after taking the absolute value."]
pub ascender: f64,
#[doc = " Height of a character below the baseline, after taking the absolute value."]
pub descender: f64,
#[doc = " Height of an uppercase letter above the baseline."]
pub capHeight: f64,
#[doc = " Height of a lowercase letter, specifically the lowercase x, not including ascenders and descenders."]
pub xHeight: f64,
#[doc = " Horizontal space taken up by a character."]
pub width: f64,
#[doc = " Line height."]
pub height: f64,
#[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."]
pub x: f64,
#[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."]
pub y: f64,
#[doc = " Index of the first character in the line."]
pub startIndex: usize,
#[doc = " Index of the last character in the line."]
pub endIndex: usize,
#[doc = " Measurement information of the first character."]
pub firstCharMetrics: OH_Drawing_Font_Metrics,
}
#[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."]
pub const OH_Drawing_TextHeightBehavior_TEXT_HEIGHT_ALL: OH_Drawing_TextHeightBehavior = 0;
#[doc = " Disables the height set by calling {@link OH_Drawing_SetTextStyleFontHeight} for the top of the first line in a\n paragraph."]
pub const OH_Drawing_TextHeightBehavior_TEXT_HEIGHT_DISABLE_FIRST_ASCENT:
OH_Drawing_TextHeightBehavior = 1;
#[doc = " Disables the height set by calling {@link OH_Drawing_SetTextStyleFontHeight} for the bottom of the last line in\n a paragraph."]
pub const OH_Drawing_TextHeightBehavior_TEXT_HEIGHT_DISABLE_LAST_ASCENT:
OH_Drawing_TextHeightBehavior = 2;
#[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."]
pub const OH_Drawing_TextHeightBehavior_TEXT_HEIGHT_DISABLE_ALL: OH_Drawing_TextHeightBehavior = 3;
#[doc = " @brief Enumerates the text height modifier patterns.\n\n @since 12\n @version 1.0"]
pub type OH_Drawing_TextHeightBehavior = u32;
#[doc = " No text style."]
pub const OH_Drawing_TextStyleType_TEXT_STYLE_NONE: OH_Drawing_TextStyleType = 0;
#[doc = " All text styles."]
pub const OH_Drawing_TextStyleType_TEXT_STYLE_ALL_ATTRIBUTES: OH_Drawing_TextStyleType = 1;
#[doc = " Font style."]
pub const OH_Drawing_TextStyleType_TEXT_STYLE_FONT: OH_Drawing_TextStyleType = 2;
#[doc = " Text foreground style."]
pub const OH_Drawing_TextStyleType_TEXT_STYLE_FOREGROUND: OH_Drawing_TextStyleType = 3;
#[doc = " Text background style."]
pub const OH_Drawing_TextStyleType_TEXT_STYLE_BACKGROUND: OH_Drawing_TextStyleType = 4;
#[doc = " Text shadow style."]
pub const OH_Drawing_TextStyleType_TEXT_STYLE_SHADOW: OH_Drawing_TextStyleType = 5;
#[doc = " Text decoration style."]
pub const OH_Drawing_TextStyleType_TEXT_STYLE_DECORATIONS: OH_Drawing_TextStyleType = 6;
#[doc = " Text letter spacing style."]
pub const OH_Drawing_TextStyleType_TEXT_STYLE_LETTER_SPACING: OH_Drawing_TextStyleType = 7;
#[doc = " Text word spacing style."]
pub const OH_Drawing_TextStyleType_TEXT_STYLE_WORD_SPACING: OH_Drawing_TextStyleType = 8;
#[doc = " @brief Enumerates the text style types.\n\n @since 12\n @version 1.0"]
pub type OH_Drawing_TextStyleType = u32;
#[doc = " Ultra condensed font."]
pub const OH_Drawing_FontWidth_FONT_WIDTH_ULTRA_CONDENSED: OH_Drawing_FontWidth = 1;
#[doc = " Extra condensed font."]
pub const OH_Drawing_FontWidth_FONT_WIDTH_EXTRA_CONDENSED: OH_Drawing_FontWidth = 2;
#[doc = " Condensed font."]
pub const OH_Drawing_FontWidth_FONT_WIDTH_CONDENSED: OH_Drawing_FontWidth = 3;
#[doc = " Semi-condensed font."]
pub const OH_Drawing_FontWidth_FONT_WIDTH_SEMI_CONDENSED: OH_Drawing_FontWidth = 4;
#[doc = " Normal font."]
pub const OH_Drawing_FontWidth_FONT_WIDTH_NORMAL: OH_Drawing_FontWidth = 5;
#[doc = " Semi-expanded font."]
pub const OH_Drawing_FontWidth_FONT_WIDTH_SEMI_EXPANDED: OH_Drawing_FontWidth = 6;
#[doc = " Expanded font."]
pub const OH_Drawing_FontWidth_FONT_WIDTH_EXPANDED: OH_Drawing_FontWidth = 7;
#[doc = " Extra expanded font."]
pub const OH_Drawing_FontWidth_FONT_WIDTH_EXTRA_EXPANDED: OH_Drawing_FontWidth = 8;
#[doc = " Ultra expanded font."]
pub const OH_Drawing_FontWidth_FONT_WIDTH_ULTRA_EXPANDED: OH_Drawing_FontWidth = 9;
#[doc = " @brief Enumerates the font widths.\n\n @since 12\n @version 1.0"]
pub type OH_Drawing_FontWidth = u32;
#[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."]
#[cfg(feature = "api-21")]
pub const OH_Drawing_TextStyleAttributeId_TEXT_STYLE_ATTR_D_LINE_HEIGHT_MAXIMUM:
OH_Drawing_TextStyleAttributeId = 0;
#[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**."]
#[cfg(feature = "api-21")]
pub const OH_Drawing_TextStyleAttributeId_TEXT_STYLE_ATTR_D_LINE_HEIGHT_MINIMUM:
OH_Drawing_TextStyleAttributeId = 1;
#[doc = " Scaling base style of the line height. For details, see {@link OH_Drawing_LineHeightStyle}."]
#[cfg(feature = "api-21")]
pub const OH_Drawing_TextStyleAttributeId_TEXT_STYLE_ATTR_I_LINE_HEIGHT_STYLE:
OH_Drawing_TextStyleAttributeId = 2;
#[doc = " Font width."]
#[cfg(feature = "api-21")]
pub const OH_Drawing_TextStyleAttributeId_TEXT_STYLE_ATTR_I_FONT_WIDTH:
OH_Drawing_TextStyleAttributeId = 3;
#[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"]
#[cfg(feature = "api-24")]
pub const OH_Drawing_TextStyleAttributeId_TEXT_STYLE_ATTR_I_FONT_EDGING:
OH_Drawing_TextStyleAttributeId = 4;
#[doc = " @brief Enumerates the text style attributes.\n\n @since 21"]
#[cfg(feature = "api-21")]
pub type OH_Drawing_TextStyleAttributeId = u32;
#[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."]
#[cfg(feature = "api-21")]
pub const OH_Drawing_LineHeightStyle_TEXT_LINE_HEIGHT_BY_FONT_SIZE: OH_Drawing_LineHeightStyle = 0;
#[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."]
#[cfg(feature = "api-21")]
pub const OH_Drawing_LineHeightStyle_TEXT_LINE_HEIGHT_BY_FONT_HEIGHT: OH_Drawing_LineHeightStyle =
1;
#[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"]
#[cfg(feature = "api-21")]
pub type OH_Drawing_LineHeightStyle = u32;
#[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."]
#[cfg(feature = "api-21")]
pub const OH_Drawing_TypographyStyleAttributeId_TYPOGRAPHY_STYLE_ATTR_D_LINE_HEIGHT_MAXIMUM:
OH_Drawing_TypographyStyleAttributeId = 0;
#[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**."]
#[cfg(feature = "api-21")]
pub const OH_Drawing_TypographyStyleAttributeId_TYPOGRAPHY_STYLE_ATTR_D_LINE_HEIGHT_MINIMUM:
OH_Drawing_TypographyStyleAttributeId = 1;
#[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**."]
#[cfg(feature = "api-21")]
pub const OH_Drawing_TypographyStyleAttributeId_TYPOGRAPHY_STYLE_ATTR_D_LINE_SPACING:
OH_Drawing_TypographyStyleAttributeId = 2;
#[doc = " Scaling base style of the line height. For details, see {@link OH_Drawing_LineHeightStyle}."]
#[cfg(feature = "api-21")]
pub const OH_Drawing_TypographyStyleAttributeId_TYPOGRAPHY_STYLE_ATTR_I_LINE_HEIGHT_STYLE:
OH_Drawing_TypographyStyleAttributeId = 3;
#[doc = " Font width."]
#[cfg(feature = "api-21")]
pub const OH_Drawing_TypographyStyleAttributeId_TYPOGRAPHY_STYLE_ATTR_I_FONT_WIDTH:
OH_Drawing_TypographyStyleAttributeId = 4;
#[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"]
#[cfg(feature = "api-23")]
pub const OH_Drawing_TypographyStyleAttributeId_TYPOGRAPHY_STYLE_ATTR_B_COMPRESS_HEAD_PUNCTUATION : OH_Drawing_TypographyStyleAttributeId = 5 ;
#[doc = " Whether to enable the internal padding of the font during text typography.\n @since 23"]
#[cfg(feature = "api-23")]
pub const OH_Drawing_TypographyStyleAttributeId_TYPOGRAPHY_STYLE_ATTR_B_INCLUDE_FONT_PADDING:
OH_Drawing_TypographyStyleAttributeId = 6;
#[doc = " Whether to enable the line spacing fallback mechanism during text typography.\n @since 23"]
#[cfg(feature = "api-23")]
pub const OH_Drawing_TypographyStyleAttributeId_TYPOGRAPHY_STYLE_ATTR_B_FALLBACK_LINE_SPACING:
OH_Drawing_TypographyStyleAttributeId = 7;
#[doc = " Ellipsis style. For details about the ellipsis style, see {@link OH_Drawing_EllipsisModal}.\n @since 24"]
#[cfg(feature = "api-24")]
pub const OH_Drawing_TypographyStyleAttributeId_TYPOGRAPHY_STYLE_ATTR_I_ELLIPSIS_MODAL:
OH_Drawing_TypographyStyleAttributeId = 8;
#[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"]
#[cfg(feature = "api-26")]
pub const OH_Drawing_TypographyStyleAttributeId_TYPOGRAPHY_STYLE_ATTR_DA_LINE_HEAD_INDENT:
OH_Drawing_TypographyStyleAttributeId = 9;
#[doc = " First-line indent of a paragraph. The indent value must be greater than or equal to 0.\n @since 26.0.0"]
#[cfg(feature = "api-26")]
pub const OH_Drawing_TypographyStyleAttributeId_TYPOGRAPHY_STYLE_ATTR_D_FIRST_LINE_HEAD_INDENT:
OH_Drawing_TypographyStyleAttributeId = 10;
#[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"]
#[cfg(feature = "api-26")]
pub const OH_Drawing_TypographyStyleAttributeId_TYPOGRAPHY_STYLE_ATTR_DA_LINE_TAIL_INDENT:
OH_Drawing_TypographyStyleAttributeId = 11;
#[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"]
#[cfg(feature = "api-21")]
pub type OH_Drawing_TypographyStyleAttributeId = u32;
#[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"]
#[cfg(feature = "api-26")]
pub const OH_Drawing_TypographyAttributeId_TYPOGRAPHY_ATTR_B_FORCE_REUSE_RASTER_RESULT:
OH_Drawing_TypographyAttributeId = 0;
#[doc = " @brief Enumerates the typography attributes.\n\n @since 26.0.0"]
#[cfg(feature = "api-26")]
pub type OH_Drawing_TypographyAttributeId = u32;
extern "C" {
#[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"]
#[cfg(feature = "api-26")]
pub fn OH_Drawing_GetTypographyAttributeBool(
typography: *const OH_Drawing_Typography,
id: OH_Drawing_TypographyAttributeId,
value: *mut bool,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-26")]
pub fn OH_Drawing_SetTypographyAttributeBool(
typography: *mut OH_Drawing_Typography,
id: OH_Drawing_TypographyAttributeId,
value: bool,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-21")]
pub fn OH_Drawing_SetTextStyleAttributeDouble(
style: *mut OH_Drawing_TextStyle,
id: OH_Drawing_TextStyleAttributeId,
value: f64,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-21")]
pub fn OH_Drawing_GetTextStyleAttributeDouble(
style: *mut OH_Drawing_TextStyle,
id: OH_Drawing_TextStyleAttributeId,
value: *mut f64,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-21")]
pub fn OH_Drawing_SetTextStyleAttributeInt(
style: *mut OH_Drawing_TextStyle,
id: OH_Drawing_TextStyleAttributeId,
value: ::std::os::raw::c_int,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-21")]
pub fn OH_Drawing_GetTextStyleAttributeInt(
style: *mut OH_Drawing_TextStyle,
id: OH_Drawing_TextStyleAttributeId,
value: *mut ::std::os::raw::c_int,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-21")]
pub fn OH_Drawing_SetTypographyStyleAttributeDouble(
style: *mut OH_Drawing_TypographyStyle,
id: OH_Drawing_TypographyStyleAttributeId,
value: f64,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-21")]
pub fn OH_Drawing_GetTypographyStyleAttributeDouble(
style: *mut OH_Drawing_TypographyStyle,
id: OH_Drawing_TypographyStyleAttributeId,
value: *mut f64,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-21")]
pub fn OH_Drawing_SetTypographyStyleAttributeInt(
style: *mut OH_Drawing_TypographyStyle,
id: OH_Drawing_TypographyStyleAttributeId,
value: ::std::os::raw::c_int,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-21")]
pub fn OH_Drawing_GetTypographyStyleAttributeInt(
style: *mut OH_Drawing_TypographyStyle,
id: OH_Drawing_TypographyStyleAttributeId,
value: *mut ::std::os::raw::c_int,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-23")]
pub fn OH_Drawing_SetTypographyStyleAttributeBool(
style: *mut OH_Drawing_TypographyStyle,
id: OH_Drawing_TypographyStyleAttributeId,
value: bool,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-23")]
pub fn OH_Drawing_GetTypographyStyleAttributeBool(
style: *mut OH_Drawing_TypographyStyle,
id: OH_Drawing_TypographyStyleAttributeId,
value: *mut bool,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-26")]
pub fn OH_Drawing_SetTypographyStyleAttributeDoubleArray(
style: *mut OH_Drawing_TypographyStyle,
id: OH_Drawing_TypographyStyleAttributeId,
arrayValue: *mut f64,
arrayLength: usize,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-26")]
pub fn OH_Drawing_GetTypographyStyleAttributeDoubleArray(
style: *const OH_Drawing_TypographyStyle,
id: OH_Drawing_TypographyStyleAttributeId,
arrayValue: *mut *mut f64,
arrayLength: *mut usize,
) -> OH_Drawing_ErrorCode;
}
#[doc = " Disable superscript or subscript."]
#[cfg(feature = "api-20")]
pub const OH_Drawing_TextBadgeType_TEXT_BADGE_NONE: OH_Drawing_TextBadgeType = 0;
#[doc = " Enable superscript."]
#[cfg(feature = "api-20")]
pub const OH_Drawing_TextBadgeType_TEXT_SUPERSCRIPT: OH_Drawing_TextBadgeType = 1;
#[doc = " Enable subscript."]
#[cfg(feature = "api-20")]
pub const OH_Drawing_TextBadgeType_TEXT_SUBSCRIPT: OH_Drawing_TextBadgeType = 2;
#[doc = " @brief Enumerates the text badge styles.\n\n @since 20\n @version 1.0"]
#[cfg(feature = "api-20")]
pub type OH_Drawing_TextBadgeType = u32;
#[doc = " Aligned to the baseline."]
#[cfg(feature = "api-20")]
pub const OH_Drawing_TextVerticalAlignment_TEXT_VERTICAL_ALIGNMENT_BASELINE:
OH_Drawing_TextVerticalAlignment = 0;
#[doc = " Bottom aligned."]
#[cfg(feature = "api-20")]
pub const OH_Drawing_TextVerticalAlignment_TEXT_VERTICAL_ALIGNMENT_BOTTOM:
OH_Drawing_TextVerticalAlignment = 1;
#[doc = " Center-aligned."]
#[cfg(feature = "api-20")]
pub const OH_Drawing_TextVerticalAlignment_TEXT_VERTICAL_ALIGNMENT_CENTER:
OH_Drawing_TextVerticalAlignment = 2;
#[doc = " Top aligned."]
#[cfg(feature = "api-20")]
pub const OH_Drawing_TextVerticalAlignment_TEXT_VERTICAL_ALIGNMENT_TOP:
OH_Drawing_TextVerticalAlignment = 3;
#[doc = " @brief Enumerates the vertical alignment modes.\n\n @since 20\n @version 1.0"]
#[cfg(feature = "api-20")]
pub type OH_Drawing_TextVerticalAlignment = u32;
#[doc = " @brief This struct describes a font style.\n\n @since 12\n @version 1.0"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_FontStyleStruct {
#[doc = " Font weight."]
pub weight: OH_Drawing_FontWeight,
#[doc = " Font width."]
pub width: OH_Drawing_FontWidth,
#[doc = " Font slant."]
pub slant: OH_Drawing_FontStyle,
}
#[doc = " @brief This struct describes a font feature.\n\n @since 12\n @version 1.0"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_FontFeature {
#[doc = " Tag of the font feature."]
pub tag: *mut ::std::os::raw::c_char,
#[doc = " Value of the font feature."]
pub value: ::std::os::raw::c_int,
}
#[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"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_StrutStyle {
#[doc = " Font weight used for calculating the strut."]
pub weight: OH_Drawing_FontWeight,
#[doc = " Font style used when calculating the strut."]
pub style: OH_Drawing_FontStyle,
#[doc = " Size of the ascent plus descent in the logical pixels."]
pub size: f64,
#[doc = " Scale factor of the line height."]
pub heightScale: f64,
#[doc = " Whether to enable height override. **true**: enabled; **false**: disabled."]
pub heightOverride: bool,
#[doc = " Whether to enable half leading. **true**: enabled; **false**: disabled."]
pub halfLeading: bool,
#[doc = " Custom leading to be applied to the strut."]
pub leading: f64,
#[doc = " Whether to forcibly use the strut height for all rows. **true** means yes; **false** otherwise."]
pub forceStrutHeight: bool,
#[doc = " Number of font families."]
pub familiesSize: usize,
#[doc = " Double pointer to the font families used for calculating the strut."]
pub families: *mut *mut ::std::os::raw::c_char,
}
#[doc = " @brief Defines a text rectangle structure.\n\n @since 24"]
#[cfg(feature = "api-24")]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_RectSize {
#[doc = " Rectangle width."]
pub width: f64,
#[doc = " Rectangle height."]
pub height: f64,
}
extern "C" {
#[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"]
pub fn OH_Drawing_CreateTypographyStyle() -> *mut OH_Drawing_TypographyStyle;
}
extern "C" {
#[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"]
pub fn OH_Drawing_DestroyTypographyStyle(style: *mut OH_Drawing_TypographyStyle);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTypographyTextDirection(
style: *mut OH_Drawing_TypographyStyle,
direction: ::std::os::raw::c_int,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTypographyTextAlign(
style: *mut OH_Drawing_TypographyStyle,
align: ::std::os::raw::c_int,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTypographyTextMaxLines(
style: *mut OH_Drawing_TypographyStyle,
lineNumber: ::std::os::raw::c_int,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_CreateTextStyle() -> *mut OH_Drawing_TextStyle;
}
extern "C" {
#[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"]
pub fn OH_Drawing_DestroyTextStyle(style: *mut OH_Drawing_TextStyle);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTextStyleColor(style: *mut OH_Drawing_TextStyle, color: u32);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTextStyleFontSize(style: *mut OH_Drawing_TextStyle, fontSize: f64);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTextStyleFontWeight(
style: *mut OH_Drawing_TextStyle,
fontWeight: ::std::os::raw::c_int,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTextStyleBaseLine(
style: *mut OH_Drawing_TextStyle,
baseline: ::std::os::raw::c_int,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTextStyleDecoration(
style: *mut OH_Drawing_TextStyle,
decoration: ::std::os::raw::c_int,
);
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_AddTextStyleDecoration(
style: *mut OH_Drawing_TextStyle,
decoration: ::std::os::raw::c_int,
);
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_RemoveTextStyleDecoration(
style: *mut OH_Drawing_TextStyle,
decoration: ::std::os::raw::c_int,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTextStyleDecorationColor(style: *mut OH_Drawing_TextStyle, color: u32);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTextStyleFontHeight(style: *mut OH_Drawing_TextStyle, fontHeight: f64);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTextStyleFontFamilies(
style: *mut OH_Drawing_TextStyle,
fontFamiliesNumber: ::std::os::raw::c_int,
fontFamilies: *mut *const ::std::os::raw::c_char,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTextStyleFontStyle(
style: *mut OH_Drawing_TextStyle,
fontStyle: ::std::os::raw::c_int,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTextStyleLocale(
style: *mut OH_Drawing_TextStyle,
locale: *const ::std::os::raw::c_char,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTextStyleForegroundBrush(
style: *mut OH_Drawing_TextStyle,
foregroundBrush: *mut OH_Drawing_Brush,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextStyleGetForegroundBrush(
style: *mut OH_Drawing_TextStyle,
foregroundBrush: *mut OH_Drawing_Brush,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTextStyleForegroundPen(
style: *mut OH_Drawing_TextStyle,
foregroundPen: *mut OH_Drawing_Pen,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextStyleGetForegroundPen(
style: *mut OH_Drawing_TextStyle,
foregroundPen: *mut OH_Drawing_Pen,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTextStyleBackgroundBrush(
style: *mut OH_Drawing_TextStyle,
backgroundBrush: *mut OH_Drawing_Brush,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextStyleGetBackgroundBrush(
style: *mut OH_Drawing_TextStyle,
backgroundBrush: *mut OH_Drawing_Brush,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTextStyleBackgroundPen(
style: *mut OH_Drawing_TextStyle,
backgroundPen: *mut OH_Drawing_Pen,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextStyleGetBackgroundPen(
style: *mut OH_Drawing_TextStyle,
backgroundPen: *mut OH_Drawing_Pen,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_CreateTypographyHandler(
style: *mut OH_Drawing_TypographyStyle,
fontCollection: *mut OH_Drawing_FontCollection,
) -> *mut OH_Drawing_TypographyCreate;
}
extern "C" {
#[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"]
pub fn OH_Drawing_DestroyTypographyHandler(handler: *mut OH_Drawing_TypographyCreate);
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyHandlerPushTextStyle(
handler: *mut OH_Drawing_TypographyCreate,
style: *mut OH_Drawing_TextStyle,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyHandlerAddText(
handler: *mut OH_Drawing_TypographyCreate,
text: *const ::std::os::raw::c_char,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyHandlerPopTextStyle(handler: *mut OH_Drawing_TypographyCreate);
}
extern "C" {
#[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"]
pub fn OH_Drawing_CreateTypography(
handler: *mut OH_Drawing_TypographyCreate,
) -> *mut OH_Drawing_Typography;
}
extern "C" {
#[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"]
pub fn OH_Drawing_DestroyTypography(typography: *mut OH_Drawing_Typography);
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyLayout(typography: *mut OH_Drawing_Typography, maxWidth: f64);
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyPaint(
typography: *mut OH_Drawing_Typography,
canvas: *mut OH_Drawing_Canvas,
positionX: f64,
positionY: f64,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyPaintOnPath(
typography: *mut OH_Drawing_Typography,
canvas: *mut OH_Drawing_Canvas,
path: *mut OH_Drawing_Path,
hOffset: f64,
vOffset: f64,
);
}
extern "C" {
#[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"]
#[cfg(feature = "api-24")]
pub fn OH_Drawing_TypographyLayoutWithConstraintsWithBuffer(
typography: *mut OH_Drawing_Typography,
constraintsRect: OH_Drawing_RectSize,
fitStrRangeArr: *mut *mut OH_Drawing_Array,
fitStrRangeArrayLen: *mut usize,
) -> OH_Drawing_RectSize;
}
extern "C" {
#[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"]
#[cfg(feature = "api-24")]
pub fn OH_Drawing_GetRangeByArrayIndex(
array: *mut OH_Drawing_Array,
index: usize,
) -> *mut OH_Drawing_Range;
}
extern "C" {
#[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"]
#[cfg(feature = "api-24")]
pub fn OH_Drawing_ReleaseArrayBuffer(array: *mut OH_Drawing_Array) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyGetMaxWidth(typography: *mut OH_Drawing_Typography) -> f64;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyGetHeight(typography: *mut OH_Drawing_Typography) -> f64;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyGetLongestLine(typography: *mut OH_Drawing_Typography) -> f64;
}
extern "C" {
#[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"]
#[cfg(feature = "api-13")]
pub fn OH_Drawing_TypographyGetLongestLineWithIndent(
typography: *mut OH_Drawing_Typography,
) -> f64;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyGetMinIntrinsicWidth(typography: *mut OH_Drawing_Typography)
-> f64;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyGetMaxIntrinsicWidth(typography: *mut OH_Drawing_Typography)
-> f64;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyGetAlphabeticBaseline(
typography: *mut OH_Drawing_Typography,
) -> f64;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyGetIdeographicBaseline(
typography: *mut OH_Drawing_Typography,
) -> f64;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyHandlerAddPlaceholder(
handler: *mut OH_Drawing_TypographyCreate,
span: *mut OH_Drawing_PlaceholderSpan,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyDidExceedMaxLines(typography: *mut OH_Drawing_Typography) -> bool;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyGetRectsForRange(
typography: *mut OH_Drawing_Typography,
start: usize,
end: usize,
heightStyle: OH_Drawing_RectHeightStyle,
widthStyle: OH_Drawing_RectWidthStyle,
) -> *mut OH_Drawing_TextBox;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyGetRectsForPlaceholders(
typography: *mut OH_Drawing_Typography,
) -> *mut OH_Drawing_TextBox;
}
extern "C" {
#[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"]
pub fn OH_Drawing_GetLeftFromTextBox(
textbox: *mut OH_Drawing_TextBox,
index: ::std::os::raw::c_int,
) -> f32;
}
extern "C" {
#[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"]
pub fn OH_Drawing_GetRightFromTextBox(
textbox: *mut OH_Drawing_TextBox,
index: ::std::os::raw::c_int,
) -> f32;
}
extern "C" {
#[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"]
pub fn OH_Drawing_GetTopFromTextBox(
textbox: *mut OH_Drawing_TextBox,
index: ::std::os::raw::c_int,
) -> f32;
}
extern "C" {
#[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"]
pub fn OH_Drawing_GetBottomFromTextBox(
textbox: *mut OH_Drawing_TextBox,
index: ::std::os::raw::c_int,
) -> f32;
}
extern "C" {
#[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"]
pub fn OH_Drawing_GetTextDirectionFromTextBox(
textbox: *mut OH_Drawing_TextBox,
index: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[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"]
pub fn OH_Drawing_GetSizeOfTextBox(textBox: *mut OH_Drawing_TextBox) -> usize;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyGetGlyphPositionAtCoordinate(
typography: *mut OH_Drawing_Typography,
dx: f64,
dy: f64,
) -> *mut OH_Drawing_PositionAndAffinity;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyGetGlyphPositionAtCoordinateWithCluster(
typography: *mut OH_Drawing_Typography,
dx: f64,
dy: f64,
) -> *mut OH_Drawing_PositionAndAffinity;
}
extern "C" {
#[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"]
pub fn OH_Drawing_GetPositionFromPositionAndAffinity(
positionAndAffinity: *mut OH_Drawing_PositionAndAffinity,
) -> usize;
}
extern "C" {
#[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"]
pub fn OH_Drawing_GetAffinityFromPositionAndAffinity(
positionAndAffinity: *mut OH_Drawing_PositionAndAffinity,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyGetWordBoundary(
typography: *mut OH_Drawing_Typography,
offset: usize,
) -> *mut OH_Drawing_Range;
}
extern "C" {
#[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"]
pub fn OH_Drawing_GetStartFromRange(range: *mut OH_Drawing_Range) -> usize;
}
extern "C" {
#[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"]
pub fn OH_Drawing_GetEndFromRange(range: *mut OH_Drawing_Range) -> usize;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyGetLineCount(typography: *mut OH_Drawing_Typography) -> usize;
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTextStyleDecorationStyle(
style: *mut OH_Drawing_TextStyle,
decorationStyle: ::std::os::raw::c_int,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTextStyleDecorationThicknessScale(
style: *mut OH_Drawing_TextStyle,
decorationThicknessScale: f64,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTextStyleLetterSpacing(
style: *mut OH_Drawing_TextStyle,
letterSpacing: f64,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTextStyleWordSpacing(style: *mut OH_Drawing_TextStyle, wordSpacing: f64);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTextStyleHalfLeading(style: *mut OH_Drawing_TextStyle, halfLeading: bool);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTextStyleEllipsis(
style: *mut OH_Drawing_TextStyle,
ellipsis: *const ::std::os::raw::c_char,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTextStyleEllipsisModal(
style: *mut OH_Drawing_TextStyle,
ellipsisModal: ::std::os::raw::c_int,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTypographyTextBreakStrategy(
style: *mut OH_Drawing_TypographyStyle,
breakStrategy: ::std::os::raw::c_int,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTypographyTextWordBreakType(
style: *mut OH_Drawing_TypographyStyle,
wordBreakType: ::std::os::raw::c_int,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTypographyTextEllipsisModal(
style: *mut OH_Drawing_TypographyStyle,
ellipsisModal: ::std::os::raw::c_int,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyGetLineHeight(
typography: *mut OH_Drawing_Typography,
lineNumber: ::std::os::raw::c_int,
) -> f64;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyGetLineWidth(
typography: *mut OH_Drawing_Typography,
lineNumber: ::std::os::raw::c_int,
) -> f64;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyGetLineTextRange(
typography: *mut OH_Drawing_Typography,
lineNumber: ::std::os::raw::c_int,
includeSpaces: bool,
) -> *mut OH_Drawing_Range;
}
extern "C" {
#[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"]
pub fn OH_Drawing_CreateFontDescriptor() -> *mut OH_Drawing_FontDescriptor;
}
extern "C" {
#[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"]
pub fn OH_Drawing_DestroyFontDescriptor(descriptor: *mut OH_Drawing_FontDescriptor);
}
extern "C" {
#[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"]
pub fn OH_Drawing_CreateFontParser() -> *mut OH_Drawing_FontParser;
}
extern "C" {
#[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"]
pub fn OH_Drawing_DestroyFontParser(parser: *mut OH_Drawing_FontParser);
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontParserGetSystemFontList(
fontParser: *mut OH_Drawing_FontParser,
num: *mut usize,
) -> *mut *mut ::std::os::raw::c_char;
}
extern "C" {
#[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"]
pub fn OH_Drawing_DestroySystemFontList(fontList: *mut *mut ::std::os::raw::c_char, num: usize);
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontParserGetFontByName(
fontParser: *mut OH_Drawing_FontParser,
name: *const ::std::os::raw::c_char,
) -> *mut OH_Drawing_FontDescriptor;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyGetLineMetrics(
typography: *mut OH_Drawing_Typography,
) -> *mut OH_Drawing_LineMetrics;
}
extern "C" {
#[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"]
pub fn OH_Drawing_LineMetricsGetSize(lineMetrics: *mut OH_Drawing_LineMetrics) -> usize;
}
extern "C" {
#[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"]
pub fn OH_Drawing_DestroyLineMetrics(lineMetrics: *mut OH_Drawing_LineMetrics);
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyGetLineMetricsAt(
typography: *mut OH_Drawing_Typography,
lineNumber: ::std::os::raw::c_int,
lineMetric: *mut OH_Drawing_LineMetrics,
) -> bool;
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTypographyTextEllipsis(
style: *mut OH_Drawing_TypographyStyle,
ellipsis: *const ::std::os::raw::c_char,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTypographyTextLocale(
style: *mut OH_Drawing_TypographyStyle,
locale: *const ::std::os::raw::c_char,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTypographyTextSplitRatio(
style: *mut OH_Drawing_TypographyStyle,
textSplitRatio: f32,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyGetTextStyle(
style: *mut OH_Drawing_TypographyStyle,
) -> *mut OH_Drawing_TextStyle;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyGetEffectiveAlignment(
style: *mut OH_Drawing_TypographyStyle,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyIsLineUnlimited(style: *mut OH_Drawing_TypographyStyle) -> bool;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyIsEllipsized(style: *mut OH_Drawing_TypographyStyle) -> bool;
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTypographyTextStyle(
handler: *mut OH_Drawing_TypographyStyle,
style: *mut OH_Drawing_TextStyle,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextStyleGetFontMetrics(
typography: *mut OH_Drawing_Typography,
style: *mut OH_Drawing_TextStyle,
fontmetrics: *mut OH_Drawing_Font_Metrics,
) -> bool;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyGetLineInfo(
typography: *mut OH_Drawing_Typography,
lineNumber: ::std::os::raw::c_int,
oneLine: bool,
includeWhitespace: bool,
drawingLineMetrics: *mut OH_Drawing_LineMetrics,
) -> bool;
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTypographyTextFontWeight(
style: *mut OH_Drawing_TypographyStyle,
weight: ::std::os::raw::c_int,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTypographyTextFontStyle(
style: *mut OH_Drawing_TypographyStyle,
fontStyle: ::std::os::raw::c_int,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTypographyTextFontFamily(
style: *mut OH_Drawing_TypographyStyle,
fontFamily: *const ::std::os::raw::c_char,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTypographyTextFontSize(
style: *mut OH_Drawing_TypographyStyle,
fontSize: f64,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTypographyTextFontHeight(
style: *mut OH_Drawing_TypographyStyle,
fontHeight: f64,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTypographyTextHalfLeading(
style: *mut OH_Drawing_TypographyStyle,
halfLeading: bool,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTypographyTextUseLineStyle(
style: *mut OH_Drawing_TypographyStyle,
useLineStyle: bool,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTypographyTextLineStyleFontWeight(
style: *mut OH_Drawing_TypographyStyle,
weight: ::std::os::raw::c_int,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTypographyTextLineStyleFontStyle(
style: *mut OH_Drawing_TypographyStyle,
fontStyle: ::std::os::raw::c_int,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTypographyTextLineStyleFontFamilies(
style: *mut OH_Drawing_TypographyStyle,
fontFamiliesNumber: ::std::os::raw::c_int,
fontFamilies: *mut *const ::std::os::raw::c_char,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTypographyTextLineStyleFontSize(
style: *mut OH_Drawing_TypographyStyle,
lineStyleFontSize: f64,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTypographyTextLineStyleFontHeight(
style: *mut OH_Drawing_TypographyStyle,
lineStyleFontHeight: f64,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTypographyTextLineStyleHalfLeading(
style: *mut OH_Drawing_TypographyStyle,
lineStyleHalfLeading: bool,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTypographyTextLineStyleSpacingScale(
style: *mut OH_Drawing_TypographyStyle,
spacingScale: f64,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTypographyTextLineStyleOnly(
style: *mut OH_Drawing_TypographyStyle,
lineStyleOnly: bool,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_CreateTextShadow() -> *mut OH_Drawing_TextShadow;
}
extern "C" {
#[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"]
pub fn OH_Drawing_DestroyTextShadow(shadow: *mut OH_Drawing_TextShadow);
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextStyleGetShadows(
style: *mut OH_Drawing_TextStyle,
) -> *mut OH_Drawing_TextShadow;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextStyleGetShadowCount(
style: *mut OH_Drawing_TextStyle,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextStyleAddShadow(
style: *mut OH_Drawing_TextStyle,
shadow: *const OH_Drawing_TextShadow,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextStyleClearShadows(style: *mut OH_Drawing_TextStyle);
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextStyleGetShadowWithIndex(
style: *mut OH_Drawing_TextStyle,
index: ::std::os::raw::c_int,
) -> *mut OH_Drawing_TextShadow;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographySetIndents(
typography: *mut OH_Drawing_Typography,
indentsNumber: ::std::os::raw::c_int,
indents: *const f32,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyGetIndentsWithIndex(
typography: *mut OH_Drawing_Typography,
index: ::std::os::raw::c_int,
) -> f32;
}
extern "C" {
#[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"]
pub fn OH_Drawing_DestroyTextShadows(shadow: *mut OH_Drawing_TextShadow);
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyTextSetHeightBehavior(
style: *mut OH_Drawing_TypographyStyle,
heightMode: OH_Drawing_TextHeightBehavior,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyTextGetHeightBehavior(
style: *mut OH_Drawing_TypographyStyle,
) -> OH_Drawing_TextHeightBehavior;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextStyleSetBackgroundRect(
style: *mut OH_Drawing_TextStyle,
rectStyleInfo: *const OH_Drawing_RectStyle_Info,
styleId: ::std::os::raw::c_int,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyHandlerAddSymbol(
handler: *mut OH_Drawing_TypographyCreate,
symbol: u32,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextStyleAddFontFeature(
style: *mut OH_Drawing_TextStyle,
tag: *const ::std::os::raw::c_char,
value: ::std::os::raw::c_int,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextStyleAddFontVariation(
style: *mut OH_Drawing_TextStyle,
axis: *const ::std::os::raw::c_char,
value: f32,
);
}
extern "C" {
#[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"]
#[cfg(feature = "api-24")]
pub fn OH_Drawing_TextStyleAddFontVariationWithNormalization(
style: *mut OH_Drawing_TextStyle,
axis: *const ::std::os::raw::c_char,
normalizedValue: f32,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextStyleGetFontFeatures(
style: *mut OH_Drawing_TextStyle,
) -> *mut OH_Drawing_FontFeature;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextStyleDestroyFontFeatures(
fontFeature: *mut OH_Drawing_FontFeature,
fontFeatureSize: usize,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextStyleGetFontFeatureSize(style: *mut OH_Drawing_TextStyle) -> usize;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextStyleClearFontFeature(style: *mut OH_Drawing_TextStyle);
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextStyleSetBaselineShift(style: *mut OH_Drawing_TextStyle, lineShift: f64);
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextStyleGetBaselineShift(style: *mut OH_Drawing_TextStyle) -> f64;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextStyleGetColor(style: *mut OH_Drawing_TextStyle) -> u32;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextStyleGetDecorationStyle(
style: *mut OH_Drawing_TextStyle,
) -> OH_Drawing_TextDecorationStyle;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextStyleGetFontWeight(
style: *mut OH_Drawing_TextStyle,
) -> OH_Drawing_FontWeight;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextStyleGetFontStyle(
style: *mut OH_Drawing_TextStyle,
) -> OH_Drawing_FontStyle;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextStyleGetBaseline(
style: *mut OH_Drawing_TextStyle,
) -> OH_Drawing_TextBaseline;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextStyleGetFontFamilies(
style: *mut OH_Drawing_TextStyle,
num: *mut usize,
) -> *mut *mut ::std::os::raw::c_char;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextStyleDestroyFontFamilies(
fontFamilies: *mut *mut ::std::os::raw::c_char,
num: usize,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextStyleGetFontSize(style: *mut OH_Drawing_TextStyle) -> f64;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextStyleGetLetterSpacing(style: *mut OH_Drawing_TextStyle) -> f64;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextStyleGetWordSpacing(style: *mut OH_Drawing_TextStyle) -> f64;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextStyleGetFontHeight(style: *mut OH_Drawing_TextStyle) -> f64;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextStyleGetHalfLeading(style: *mut OH_Drawing_TextStyle) -> bool;
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_SetTypographyVerticalAlignment(
style: *mut OH_Drawing_TypographyStyle,
align: OH_Drawing_TextVerticalAlignment,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextStyleGetLocale(
style: *mut OH_Drawing_TextStyle,
) -> *const ::std::os::raw::c_char;
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_SetTextStyleBadgeType(
style: *mut OH_Drawing_TextStyle,
textBadgeType: OH_Drawing_TextBadgeType,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTextStyleFontStyleStruct(
drawingTextStyle: *mut OH_Drawing_TextStyle,
fontStyle: OH_Drawing_FontStyleStruct,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextStyleGetFontStyleStruct(
drawingTextStyle: *mut OH_Drawing_TextStyle,
) -> OH_Drawing_FontStyleStruct;
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTypographyStyleFontStyleStruct(
drawingStyle: *mut OH_Drawing_TypographyStyle,
fontStyle: OH_Drawing_FontStyleStruct,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyStyleGetFontStyleStruct(
drawingStyle: *mut OH_Drawing_TypographyStyle,
) -> OH_Drawing_FontStyleStruct;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextStyleIsEqual(
style: *const OH_Drawing_TextStyle,
comparedStyle: *const OH_Drawing_TextStyle,
) -> bool;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextStyleIsEqualByFont(
style: *const OH_Drawing_TextStyle,
comparedStyle: *const OH_Drawing_TextStyle,
) -> bool;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextStyleIsAttributeMatched(
style: *const OH_Drawing_TextStyle,
comparedStyle: *const OH_Drawing_TextStyle,
textStyleType: OH_Drawing_TextStyleType,
) -> bool;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextStyleSetPlaceholder(style: *mut OH_Drawing_TextStyle);
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextStyleIsPlaceholder(style: *mut OH_Drawing_TextStyle) -> bool;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyStyleGetEffectiveAlignment(
style: *mut OH_Drawing_TypographyStyle,
) -> OH_Drawing_TextAlign;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyStyleIsHintEnabled(style: *mut OH_Drawing_TypographyStyle) -> bool;
}
extern "C" {
#[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"]
pub fn OH_Drawing_GetSystemFontConfigInfo(
errorCode: *mut OH_Drawing_FontConfigInfoErrorCode,
) -> *mut OH_Drawing_FontConfigInfo;
}
extern "C" {
#[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"]
pub fn OH_Drawing_DestroySystemFontConfigInfo(drawFontCfgInfo: *mut OH_Drawing_FontConfigInfo);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTypographyStyleTextStrutStyle(
style: *mut OH_Drawing_TypographyStyle,
strutstyle: *mut OH_Drawing_StrutStyle,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyStyleDestroyStrutStyle(strutstyle: *mut OH_Drawing_StrutStyle);
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyStyleGetStrutStyle(
style: *mut OH_Drawing_TypographyStyle,
) -> *mut OH_Drawing_StrutStyle;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyStyleStrutStyleEquals(
from: *mut OH_Drawing_StrutStyle,
to: *mut OH_Drawing_StrutStyle,
) -> bool;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyStyleSetHintsEnabled(
style: *mut OH_Drawing_TypographyStyle,
hintsEnabled: bool,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyGetLineFontMetrics(
typography: *mut OH_Drawing_Typography,
lineNumber: usize,
fontMetricsSize: *mut usize,
) -> *mut OH_Drawing_Font_Metrics;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyDestroyLineFontMetrics(
lineFontMetric: *mut OH_Drawing_Font_Metrics,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyMarkDirty(typography: *mut OH_Drawing_Typography);
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyGetUnresolvedGlyphsCount(
typography: *mut OH_Drawing_Typography,
) -> i32;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyUpdateFontSize(
typography: *mut OH_Drawing_Typography,
from: usize,
to: usize,
fontSize: f32,
);
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_TypographyUpdateFontColor(typography: *mut OH_Drawing_Typography, color: u32);
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_TypographyUpdateDecoration(
typography: *mut OH_Drawing_Typography,
decoration: OH_Drawing_TextDecoration,
);
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_TypographyUpdateDecorationThicknessScale(
typography: *mut OH_Drawing_Typography,
decorationThicknessScale: f64,
);
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_TypographyUpdateDecorationStyle(
typography: *mut OH_Drawing_Typography,
decorationStyle: OH_Drawing_TextDecorationStyle,
);
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_TypographyUpdateDecorationColor(
typography: *mut OH_Drawing_Typography,
color: u32,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyTextGetLineStyle(style: *mut OH_Drawing_TypographyStyle) -> bool;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyTextlineStyleGetFontWeight(
style: *mut OH_Drawing_TypographyStyle,
) -> OH_Drawing_FontWeight;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyTextlineStyleGetFontStyle(
style: *mut OH_Drawing_TypographyStyle,
) -> OH_Drawing_FontStyle;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyTextlineStyleGetFontFamilies(
style: *mut OH_Drawing_TypographyStyle,
num: *mut usize,
) -> *mut *mut ::std::os::raw::c_char;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyTextlineStyleDestroyFontFamilies(
fontFamilies: *mut *mut ::std::os::raw::c_char,
fontFamiliesNum: usize,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyTextlineStyleGetFontSize(
style: *mut OH_Drawing_TypographyStyle,
) -> f64;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyTextlineStyleGetHeightScale(
style: *mut OH_Drawing_TypographyStyle,
) -> f64;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyTextlineStyleGetHeightOnly(
style: *mut OH_Drawing_TypographyStyle,
) -> bool;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyTextlineStyleGetHalfLeading(
style: *mut OH_Drawing_TypographyStyle,
) -> bool;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyTextlineStyleGetSpacingScale(
style: *mut OH_Drawing_TypographyStyle,
) -> f64;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyTextlineGetStyleOnly(
style: *mut OH_Drawing_TypographyStyle,
) -> bool;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyGetTextAlign(
style: *mut OH_Drawing_TypographyStyle,
) -> OH_Drawing_TextAlign;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyGetTextDirection(
style: *mut OH_Drawing_TypographyStyle,
) -> OH_Drawing_TextDirection;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyGetTextMaxLines(style: *mut OH_Drawing_TypographyStyle) -> usize;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyGetTextEllipsis(
style: *mut OH_Drawing_TypographyStyle,
) -> *mut ::std::os::raw::c_char;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyDestroyEllipsis(ellipsis: *mut ::std::os::raw::c_char);
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyStyleEquals(
from: *mut OH_Drawing_TypographyStyle,
to: *mut OH_Drawing_TypographyStyle,
) -> bool;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypographyDestroyTextBox(textBox: *mut OH_Drawing_TextBox);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SetTextShadow(
shadow: *mut OH_Drawing_TextShadow,
color: u32,
offset: *mut OH_Drawing_Point,
blurRadius: f64,
);
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_CreateTextTab(
alignment: OH_Drawing_TextAlign,
location: f32,
) -> *mut OH_Drawing_TextTab;
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_DestroyTextTab(tab: *mut OH_Drawing_TextTab);
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_GetTextTabAlignment(tab: *mut OH_Drawing_TextTab) -> OH_Drawing_TextAlign;
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_GetTextTabLocation(tab: *mut OH_Drawing_TextTab) -> f32;
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_SetTypographyTextTab(
style: *mut OH_Drawing_TypographyStyle,
tab: *mut OH_Drawing_TextTab,
);
}
extern "C" {
#[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"]
#[cfg(feature = "api-14")]
pub fn OH_Drawing_GetDrawingArraySize(drawingArray: *mut OH_Drawing_Array) -> usize;
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_SetTypographyTextTrailingSpaceOptimized(
style: *mut OH_Drawing_TypographyStyle,
trailingSpaceOptimized: bool,
);
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_TypographyHandlerAddEncodedText(
handler: *mut OH_Drawing_TypographyCreate,
text: *const ::std::os::raw::c_void,
byteLength: usize,
textEncodingType: OH_Drawing_TextEncoding,
);
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_SetTypographyTextAutoSpace(
style: *mut OH_Drawing_TypographyStyle,
enableAutoSpace: bool,
);
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_CopyTypographyStyle(
style: *mut OH_Drawing_TypographyStyle,
) -> *mut OH_Drawing_TypographyStyle;
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_CopyTextStyle(style: *mut OH_Drawing_TextStyle) -> *mut OH_Drawing_TextStyle;
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_CopyTextShadow(
shadow: *mut OH_Drawing_TextShadow,
) -> *mut OH_Drawing_TextShadow;
}
extern "C" {
#[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"]
#[cfg(feature = "api-23")]
pub fn OH_Drawing_DestroyPositionAndAffinity(
positionAndAffinity: *mut OH_Drawing_PositionAndAffinity,
);
}
extern "C" {
#[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"]
#[cfg(feature = "api-24")]
pub fn OH_Drawing_TypographyGetCharacterRangeForGlyphRangeWithBuffer(
typography: *mut OH_Drawing_Typography,
glyphRangeStart: usize,
glyphRangeEnd: usize,
actualGlyphRange: *mut *mut OH_Drawing_Range,
textEncodingType: OH_Drawing_TextEncoding,
) -> *mut OH_Drawing_Range;
}
extern "C" {
#[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"]
#[cfg(feature = "api-24")]
pub fn OH_Drawing_TypographyGetCharacterPositionAtCoordinateWithBuffer(
typography: *mut OH_Drawing_Typography,
dx: f64,
dy: f64,
textEncodingType: OH_Drawing_TextEncoding,
) -> *mut OH_Drawing_PositionAndAffinity;
}
extern "C" {
#[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"]
#[cfg(feature = "api-24")]
pub fn OH_Drawing_TypographyGetGlyphRangeForCharacterRangeWithBuffer(
typography: *mut OH_Drawing_Typography,
characterRangeStart: usize,
characterRangeEnd: usize,
actualCharacterRange: *mut *mut OH_Drawing_Range,
textEncodingType: OH_Drawing_TextEncoding,
) -> *mut OH_Drawing_Range;
}
extern "C" {
#[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"]
#[cfg(feature = "api-24")]
pub fn OH_Drawing_ReleaseRangeBuffer(range: *mut OH_Drawing_Range);
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontMgrCreate() -> *mut OH_Drawing_FontMgr;
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontMgrDestroy(drawingFontMgr: *mut OH_Drawing_FontMgr);
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontMgrGetFamilyCount(
drawingFontMgr: *mut OH_Drawing_FontMgr,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontMgrGetFamilyName(
drawingFontMgr: *mut OH_Drawing_FontMgr,
index: ::std::os::raw::c_int,
) -> *mut ::std::os::raw::c_char;
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontMgrDestroyFamilyName(familyName: *mut ::std::os::raw::c_char);
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontMgrCreateFontStyleSet(
drawingFontMgr: *mut OH_Drawing_FontMgr,
index: ::std::os::raw::c_int,
) -> *mut OH_Drawing_FontStyleSet;
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontMgrDestroyFontStyleSet(drawingFontStyleSet: *mut OH_Drawing_FontStyleSet);
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontMgrMatchFamily(
drawingFontMgr: *mut OH_Drawing_FontMgr,
familyName: *const ::std::os::raw::c_char,
) -> *mut OH_Drawing_FontStyleSet;
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontMgrMatchFamilyStyle(
drawingFontMgr: *mut OH_Drawing_FontMgr,
familyName: *const ::std::os::raw::c_char,
fontStyle: OH_Drawing_FontStyleStruct,
) -> *mut OH_Drawing_Typeface;
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontMgrMatchFamilyStyleCharacter(
drawingFontMgr: *mut OH_Drawing_FontMgr,
familyName: *const ::std::os::raw::c_char,
fontStyle: OH_Drawing_FontStyleStruct,
bcp47: *mut *const ::std::os::raw::c_char,
bcp47Count: ::std::os::raw::c_int,
character: i32,
) -> *mut OH_Drawing_Typeface;
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontStyleSetCreateTypeface(
fontStyleSet: *mut OH_Drawing_FontStyleSet,
index: ::std::os::raw::c_int,
) -> *mut OH_Drawing_Typeface;
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontStyleSetGetStyle(
fontStyleSet: *mut OH_Drawing_FontStyleSet,
index: i32,
styleName: *mut *mut ::std::os::raw::c_char,
) -> OH_Drawing_FontStyleStruct;
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontStyleSetFreeStyleName(styleName: *mut *mut ::std::os::raw::c_char);
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontStyleSetMatchStyle(
fontStyleSet: *mut OH_Drawing_FontStyleSet,
fontStyleStruct: OH_Drawing_FontStyleStruct,
) -> *mut OH_Drawing_Typeface;
}
extern "C" {
#[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"]
pub fn OH_Drawing_FontStyleSetCount(
fontStyleSet: *mut OH_Drawing_FontStyleSet,
) -> ::std::os::raw::c_int;
}
#[doc = " @brief This struct describes the options about the GPU context.\n\n @since 12\n @version 1.0\n @deprecated since 18"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_GpuContextOptions {
#[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."]
pub allowPathMaskCaching: bool,
}
extern "C" {
#[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"]
pub fn OH_Drawing_GpuContextCreateFromGL(
gpuContextOptions: OH_Drawing_GpuContextOptions,
) -> *mut OH_Drawing_GpuContext;
}
extern "C" {
#[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"]
#[cfg(feature = "api-16")]
pub fn OH_Drawing_GpuContextCreate() -> *mut OH_Drawing_GpuContext;
}
extern "C" {
#[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"]
pub fn OH_Drawing_GpuContextDestroy(gpuContext: *mut OH_Drawing_GpuContext);
}
extern "C" {
#[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"]
pub fn OH_Drawing_ImageCreate() -> *mut OH_Drawing_Image;
}
extern "C" {
#[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"]
pub fn OH_Drawing_ImageDestroy(image: *mut OH_Drawing_Image);
}
extern "C" {
#[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"]
pub fn OH_Drawing_ImageBuildFromBitmap(
image: *mut OH_Drawing_Image,
bitmap: *mut OH_Drawing_Bitmap,
) -> bool;
}
extern "C" {
#[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"]
pub fn OH_Drawing_ImageGetWidth(image: *mut OH_Drawing_Image) -> i32;
}
extern "C" {
#[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"]
pub fn OH_Drawing_ImageGetHeight(image: *mut OH_Drawing_Image) -> i32;
}
extern "C" {
#[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"]
pub fn OH_Drawing_ImageGetImageInfo(
image: *mut OH_Drawing_Image,
imageInfo: *mut OH_Drawing_Image_Info,
);
}
#[doc = " Replicates the edge color if the shader effect draws outside of its original boundary."]
pub const OH_Drawing_TileMode_CLAMP: OH_Drawing_TileMode = 0;
#[doc = " Repeats the shader effect's image in both horizontal and vertical directions."]
pub const OH_Drawing_TileMode_REPEAT: OH_Drawing_TileMode = 1;
#[doc = " Repeats the shader effect's image in both horizontal and vertical directions, alternating mirror images."]
pub const OH_Drawing_TileMode_MIRROR: OH_Drawing_TileMode = 2;
#[doc = " Renders the shader effect's image only within the original boundary, and returns transparent black elsewhere."]
pub const OH_Drawing_TileMode_DECAL: OH_Drawing_TileMode = 3;
#[doc = " @brief Defines an enum for the tile modes of the shader effect.\n\n @since 11\n @version 1.0"]
pub type OH_Drawing_TileMode = u32;
extern "C" {
#[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"]
pub fn OH_Drawing_ShaderEffectCreateColorShader(color: u32) -> *mut OH_Drawing_ShaderEffect;
}
extern "C" {
#[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"]
pub fn OH_Drawing_ShaderEffectCreateLinearGradient(
startPt: *const OH_Drawing_Point,
endPt: *const OH_Drawing_Point,
colors: *const u32,
pos: *const f32,
size: u32,
tileMode: OH_Drawing_TileMode,
) -> *mut OH_Drawing_ShaderEffect;
}
extern "C" {
#[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"]
pub fn OH_Drawing_ShaderEffectCreateLinearGradientWithLocalMatrix(
startPt: *const OH_Drawing_Point2D,
endPt: *const OH_Drawing_Point2D,
colors: *const u32,
pos: *const f32,
size: u32,
tileMode: OH_Drawing_TileMode,
matrix: *const OH_Drawing_Matrix,
) -> *mut OH_Drawing_ShaderEffect;
}
extern "C" {
#[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"]
pub fn OH_Drawing_ShaderEffectCreateRadialGradient(
centerPt: *const OH_Drawing_Point,
radius: f32,
colors: *const u32,
pos: *const f32,
size: u32,
tileMode: OH_Drawing_TileMode,
) -> *mut OH_Drawing_ShaderEffect;
}
extern "C" {
#[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"]
pub fn OH_Drawing_ShaderEffectCreateRadialGradientWithLocalMatrix(
centerPt: *const OH_Drawing_Point2D,
radius: f32,
colors: *const u32,
pos: *const f32,
size: u32,
tileMode: OH_Drawing_TileMode,
matrix: *const OH_Drawing_Matrix,
) -> *mut OH_Drawing_ShaderEffect;
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_ShaderEffectCreateSweepGradientWithLocalMatrix(
centerPt: *const OH_Drawing_Point,
colors: *const u32,
pos: *const f32,
size: u32,
tileMode: OH_Drawing_TileMode,
matrix: *const OH_Drawing_Matrix,
) -> *mut OH_Drawing_ShaderEffect;
}
extern "C" {
#[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"]
pub fn OH_Drawing_ShaderEffectCreateSweepGradient(
centerPt: *const OH_Drawing_Point,
colors: *const u32,
pos: *const f32,
size: u32,
tileMode: OH_Drawing_TileMode,
) -> *mut OH_Drawing_ShaderEffect;
}
extern "C" {
#[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"]
pub fn OH_Drawing_ShaderEffectCreateImageShader(
image: *mut OH_Drawing_Image,
tileX: OH_Drawing_TileMode,
tileY: OH_Drawing_TileMode,
samplingOptions: *const OH_Drawing_SamplingOptions,
matrix: *const OH_Drawing_Matrix,
) -> *mut OH_Drawing_ShaderEffect;
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_ShaderEffectCreatePixelMapShader(
pixelMap: *mut OH_Drawing_PixelMap,
tileX: OH_Drawing_TileMode,
tileY: OH_Drawing_TileMode,
samplingOptions: *const OH_Drawing_SamplingOptions,
matrix: *const OH_Drawing_Matrix,
) -> *mut OH_Drawing_ShaderEffect;
}
extern "C" {
#[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"]
pub fn OH_Drawing_ShaderEffectCreateTwoPointConicalGradient(
startPt: *const OH_Drawing_Point2D,
startRadius: f32,
endPt: *const OH_Drawing_Point2D,
endRadius: f32,
colors: *const u32,
pos: *const f32,
size: u32,
tileMode: OH_Drawing_TileMode,
matrix: *const OH_Drawing_Matrix,
) -> *mut OH_Drawing_ShaderEffect;
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_ShaderEffectCreateCompose(
dst: *mut OH_Drawing_ShaderEffect,
src: *mut OH_Drawing_ShaderEffect,
mode: OH_Drawing_BlendMode,
) -> *mut OH_Drawing_ShaderEffect;
}
extern "C" {
#[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"]
pub fn OH_Drawing_ShaderEffectDestroy(shaderEffect: *mut OH_Drawing_ShaderEffect);
}
extern "C" {
#[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"]
pub fn OH_Drawing_ImageFilterCreateBlur(
sigmaX: f32,
sigmaY: f32,
tileMode: OH_Drawing_TileMode,
imageFilter: *mut OH_Drawing_ImageFilter,
) -> *mut OH_Drawing_ImageFilter;
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_ImageFilterCreateBlurWithCrop(
sigmaX: f32,
sigmaY: f32,
tileMode: OH_Drawing_TileMode,
input: *mut OH_Drawing_ImageFilter,
rect: *const OH_Drawing_Rect,
) -> *mut OH_Drawing_ImageFilter;
}
extern "C" {
#[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"]
pub fn OH_Drawing_ImageFilterCreateFromColorFilter(
colorFilter: *mut OH_Drawing_ColorFilter,
imageFilter: *mut OH_Drawing_ImageFilter,
) -> *mut OH_Drawing_ImageFilter;
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_ImageFilterCreateOffset(
x: f32,
y: f32,
imageFilter: *mut OH_Drawing_ImageFilter,
) -> *mut OH_Drawing_ImageFilter;
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_ImageFilterCreateFromShaderEffect(
shaderEffect: *mut OH_Drawing_ShaderEffect,
) -> *mut OH_Drawing_ImageFilter;
}
extern "C" {
#[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"]
pub fn OH_Drawing_ImageFilterDestroy(imageFilter: *mut OH_Drawing_ImageFilter);
}
#[doc = " Blurs both inside and outside the original border."]
pub const OH_Drawing_BlurType_NORMAL: OH_Drawing_BlurType = 0;
#[doc = " Draws solid inside the border, and blurs outside."]
pub const OH_Drawing_BlurType_SOLID: OH_Drawing_BlurType = 1;
#[doc = " Draws nothing inside the border, and blurs outside."]
pub const OH_Drawing_BlurType_OUTER: OH_Drawing_BlurType = 2;
#[doc = " Blurs inside the border, and draws nothing outside."]
pub const OH_Drawing_BlurType_INNER: OH_Drawing_BlurType = 3;
#[doc = " @brief Defines an enum for the blur types.\n\n @since 11\n @version 1.0"]
pub type OH_Drawing_BlurType = u32;
extern "C" {
#[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"]
pub fn OH_Drawing_MaskFilterCreateBlur(
blurType: OH_Drawing_BlurType,
sigma: f32,
respectCTM: bool,
) -> *mut OH_Drawing_MaskFilter;
}
extern "C" {
#[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"]
pub fn OH_Drawing_MaskFilterDestroy(maskFilter: *mut OH_Drawing_MaskFilter);
}
extern "C" {
#[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"]
pub fn OH_Drawing_MatrixCreate() -> *mut OH_Drawing_Matrix;
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_MatrixCopy(matrix: *const OH_Drawing_Matrix) -> *mut OH_Drawing_Matrix;
}
extern "C" {
#[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"]
pub fn OH_Drawing_MatrixCreateRotation(deg: f32, x: f32, y: f32) -> *mut OH_Drawing_Matrix;
}
extern "C" {
#[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"]
pub fn OH_Drawing_MatrixCreateScale(
sx: f32,
sy: f32,
px: f32,
py: f32,
) -> *mut OH_Drawing_Matrix;
}
extern "C" {
#[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"]
pub fn OH_Drawing_MatrixCreateTranslation(dx: f32, dy: f32) -> *mut OH_Drawing_Matrix;
}
extern "C" {
#[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"]
pub fn OH_Drawing_MatrixSetMatrix(
matrix: *mut OH_Drawing_Matrix,
scaleX: f32,
skewX: f32,
transX: f32,
skewY: f32,
scaleY: f32,
transY: f32,
persp0: f32,
persp1: f32,
persp2: f32,
);
}
#[doc = " Scales the source rectangle both horizontally and vertically to exactly match the destination rectangle."]
pub const OH_Drawing_ScaleToFit_SCALE_TO_FIT_FILL: OH_Drawing_ScaleToFit = 0;
#[doc = " Scales the source rectangle and aligns it to the left and top edges of the destination rectangle."]
pub const OH_Drawing_ScaleToFit_SCALE_TO_FIT_START: OH_Drawing_ScaleToFit = 1;
#[doc = " Scales the source rectangle and aligns it to the center of the destination rectangle."]
pub const OH_Drawing_ScaleToFit_SCALE_TO_FIT_CENTER: OH_Drawing_ScaleToFit = 2;
#[doc = " Scales the source rectangle and aligns it to the right and bottom edges of the destination rectangle."]
pub const OH_Drawing_ScaleToFit_SCALE_TO_FIT_END: OH_Drawing_ScaleToFit = 3;
#[doc = " @brief Defines an enum for the matrix scaling modes.\n\n @since 12\n @version 1.0"]
pub type OH_Drawing_ScaleToFit = u32;
extern "C" {
#[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"]
pub fn OH_Drawing_MatrixSetRectToRect(
matrix: *mut OH_Drawing_Matrix,
src: *const OH_Drawing_Rect,
dst: *const OH_Drawing_Rect,
stf: OH_Drawing_ScaleToFit,
) -> bool;
}
extern "C" {
#[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"]
pub fn OH_Drawing_MatrixPreRotate(
matrix: *mut OH_Drawing_Matrix,
degree: f32,
px: f32,
py: f32,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_MatrixPreScale(
matrix: *mut OH_Drawing_Matrix,
sx: f32,
sy: f32,
px: f32,
py: f32,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_MatrixPreTranslate(matrix: *mut OH_Drawing_Matrix, dx: f32, dy: f32);
}
extern "C" {
#[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"]
pub fn OH_Drawing_MatrixPostRotate(
matrix: *mut OH_Drawing_Matrix,
degree: f32,
px: f32,
py: f32,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_MatrixPostScale(
matrix: *mut OH_Drawing_Matrix,
sx: f32,
sy: f32,
px: f32,
py: f32,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_MatrixPostTranslate(matrix: *mut OH_Drawing_Matrix, dx: f32, dy: f32);
}
extern "C" {
#[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"]
pub fn OH_Drawing_MatrixReset(matrix: *mut OH_Drawing_Matrix);
}
extern "C" {
#[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"]
pub fn OH_Drawing_MatrixConcat(
total: *mut OH_Drawing_Matrix,
a: *const OH_Drawing_Matrix,
b: *const OH_Drawing_Matrix,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_MatrixGetAll(
matrix: *mut OH_Drawing_Matrix,
value: *mut f32,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-22")]
pub fn OH_Drawing_MatrixPreConcat(
a: *mut OH_Drawing_Matrix,
b: *mut OH_Drawing_Matrix,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
pub fn OH_Drawing_MatrixGetValue(
matrix: *mut OH_Drawing_Matrix,
index: ::std::os::raw::c_int,
) -> f32;
}
extern "C" {
#[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"]
pub fn OH_Drawing_MatrixRotate(matrix: *mut OH_Drawing_Matrix, degree: f32, px: f32, py: f32);
}
extern "C" {
#[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"]
pub fn OH_Drawing_MatrixTranslate(matrix: *mut OH_Drawing_Matrix, dx: f32, dy: f32);
}
extern "C" {
#[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"]
pub fn OH_Drawing_MatrixScale(
matrix: *mut OH_Drawing_Matrix,
sx: f32,
sy: f32,
px: f32,
py: f32,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_MatrixInvert(
matrix: *mut OH_Drawing_Matrix,
inverse: *mut OH_Drawing_Matrix,
) -> bool;
}
extern "C" {
#[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"]
pub fn OH_Drawing_MatrixSetPolyToPoly(
matrix: *mut OH_Drawing_Matrix,
src: *const OH_Drawing_Point2D,
dst: *const OH_Drawing_Point2D,
count: u32,
) -> bool;
}
extern "C" {
#[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"]
pub fn OH_Drawing_MatrixMapPoints(
matrix: *const OH_Drawing_Matrix,
src: *const OH_Drawing_Point2D,
dst: *mut OH_Drawing_Point2D,
count: ::std::os::raw::c_int,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_MatrixMapRect(
matrix: *const OH_Drawing_Matrix,
src: *const OH_Drawing_Rect,
dst: *mut OH_Drawing_Rect,
) -> bool;
}
extern "C" {
#[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"]
pub fn OH_Drawing_MatrixIsEqual(
matrix: *mut OH_Drawing_Matrix,
other: *mut OH_Drawing_Matrix,
) -> bool;
}
extern "C" {
#[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"]
pub fn OH_Drawing_MatrixIsIdentity(matrix: *mut OH_Drawing_Matrix) -> bool;
}
extern "C" {
#[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"]
#[cfg(feature = "api-23")]
pub fn OH_Drawing_MatrixIsAffine(
matrix: *const OH_Drawing_Matrix,
isAffine: *mut bool,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-23")]
pub fn OH_Drawing_MatrixPreSkew(
matrix: *mut OH_Drawing_Matrix,
kx: f32,
ky: f32,
px: f32,
py: f32,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-23")]
pub fn OH_Drawing_MatrixRectStaysRect(
matrix: *const OH_Drawing_Matrix,
isRectStaysRect: *mut bool,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-23")]
pub fn OH_Drawing_MatrixSetSinCos(
matrix: *mut OH_Drawing_Matrix,
sinValue: f32,
cosValue: f32,
px: f32,
py: f32,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
pub fn OH_Drawing_MatrixDestroy(matrix: *mut OH_Drawing_Matrix);
}
extern "C" {
#[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"]
pub fn OH_Drawing_MemoryStreamCreate(
data: *const ::std::os::raw::c_void,
length: usize,
copyData: bool,
) -> *mut OH_Drawing_MemoryStream;
}
extern "C" {
#[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"]
pub fn OH_Drawing_MemoryStreamDestroy(memoryStream: *mut OH_Drawing_MemoryStream);
}
#[doc = " Sets the start point of the path."]
#[cfg(feature = "api-23")]
pub const OH_Drawing_PathIteratorVerb_MOVE: OH_Drawing_PathIteratorVerb = 0;
#[doc = " Adds a line segment."]
#[cfg(feature = "api-23")]
pub const OH_Drawing_PathIteratorVerb_LINE: OH_Drawing_PathIteratorVerb = 1;
#[doc = " Adds a quadratic Bezier curve for smooth transitions."]
#[cfg(feature = "api-23")]
pub const OH_Drawing_PathIteratorVerb_QUAD: OH_Drawing_PathIteratorVerb = 2;
#[doc = " Adds a conic curve."]
#[cfg(feature = "api-23")]
pub const OH_Drawing_PathIteratorVerb_CONIC: OH_Drawing_PathIteratorVerb = 3;
#[doc = " Adds a cubic Bezier curve for smooth transitions."]
#[cfg(feature = "api-23")]
pub const OH_Drawing_PathIteratorVerb_CUBIC: OH_Drawing_PathIteratorVerb = 4;
#[doc = " Closes the path."]
#[cfg(feature = "api-23")]
pub const OH_Drawing_PathIteratorVerb_CLOSE: OH_Drawing_PathIteratorVerb = 5;
#[doc = " Completes the path configuration."]
#[cfg(feature = "api-23")]
pub const OH_Drawing_PathIteratorVerb_DONE: OH_Drawing_PathIteratorVerb = 6;
#[doc = " @brief Enumerates the path operation types contained in an iterator. It is used to read path operation instructions.\n\n @since 23"]
#[cfg(feature = "api-23")]
pub type OH_Drawing_PathIteratorVerb = u32;
extern "C" {
#[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"]
#[cfg(feature = "api-23")]
pub fn OH_Drawing_PathIteratorCreate(
path: *const OH_Drawing_Path,
pathIterator: *mut *mut OH_Drawing_PathIterator,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-23")]
pub fn OH_Drawing_PathIteratorDestroy(
pathIterator: *mut OH_Drawing_PathIterator,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-23")]
pub fn OH_Drawing_PathIteratorHasNext(
pathIterator: *const OH_Drawing_PathIterator,
hasNext: *mut bool,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-23")]
pub fn OH_Drawing_PathIteratorNext(
pathIterator: *mut OH_Drawing_PathIterator,
points: *mut OH_Drawing_Point2D,
count: u32,
offset: u32,
verb: *mut OH_Drawing_PathIteratorVerb,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-23")]
pub fn OH_Drawing_PathIteratorPeek(
pathIterator: *const OH_Drawing_PathIterator,
verb: *mut OH_Drawing_PathIteratorVerb,
) -> OH_Drawing_ErrorCode;
}
#[doc = " Adds a closed contour clockwise."]
pub const OH_Drawing_PathDirection_PATH_DIRECTION_CW: OH_Drawing_PathDirection = 0;
#[doc = " Adds a closed contour counterclockwise."]
pub const OH_Drawing_PathDirection_PATH_DIRECTION_CCW: OH_Drawing_PathDirection = 1;
#[doc = " @brief Enumerates the directions of a closed contour.\n\n @since 12\n @version 1.0"]
pub type OH_Drawing_PathDirection = u32;
#[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."]
pub const OH_Drawing_PathFillType_PATH_FILL_TYPE_WINDING: OH_Drawing_PathFillType = 0;
#[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."]
pub const OH_Drawing_PathFillType_PATH_FILL_TYPE_EVEN_ODD: OH_Drawing_PathFillType = 1;
#[doc = " Same as **PATH_FILL_TYPE_WINDING**, but draws outside of the path, rather than inside."]
pub const OH_Drawing_PathFillType_PATH_FILL_TYPE_INVERSE_WINDING: OH_Drawing_PathFillType = 2;
#[doc = " Same as **PATH_FILL_TYPE_EVEN_ODD**, but draws outside of the path, rather than inside."]
pub const OH_Drawing_PathFillType_PATH_FILL_TYPE_INVERSE_EVEN_ODD: OH_Drawing_PathFillType = 3;
#[doc = " @brief Enumerates the fill types of a path.\n\n @since 12\n @version 1.0"]
pub type OH_Drawing_PathFillType = u32;
#[doc = " Adds a path in append mode."]
pub const OH_Drawing_PathAddMode_PATH_ADD_MODE_APPEND: OH_Drawing_PathAddMode = 0;
#[doc = " Adds a line segment to close the path if the previous path is not closed."]
pub const OH_Drawing_PathAddMode_PATH_ADD_MODE_EXTEND: OH_Drawing_PathAddMode = 1;
#[doc = " @brief Enumerates the path adding modes.\n\n @since 12\n @version 1.0"]
pub type OH_Drawing_PathAddMode = u32;
#[doc = " Difference operation."]
pub const OH_Drawing_PathOpMode_PATH_OP_MODE_DIFFERENCE: OH_Drawing_PathOpMode = 0;
#[doc = " Intersection operation."]
pub const OH_Drawing_PathOpMode_PATH_OP_MODE_INTERSECT: OH_Drawing_PathOpMode = 1;
#[doc = " Union operation."]
pub const OH_Drawing_PathOpMode_PATH_OP_MODE_UNION: OH_Drawing_PathOpMode = 2;
#[doc = " XOR operation."]
pub const OH_Drawing_PathOpMode_PATH_OP_MODE_XOR: OH_Drawing_PathOpMode = 3;
#[doc = " Reverse difference operation."]
pub const OH_Drawing_PathOpMode_PATH_OP_MODE_REVERSE_DIFFERENCE: OH_Drawing_PathOpMode = 4;
#[doc = " @brief Enumerates the operation modes available for a path.\n\n @since 12\n @version 1.0"]
pub type OH_Drawing_PathOpMode = u32;
#[doc = " Matrix corresponding to the position information."]
pub const OH_Drawing_PathMeasureMatrixFlags_GET_POSITION_MATRIX: OH_Drawing_PathMeasureMatrixFlags =
0;
#[doc = " Matrix corresponding to the tangent information."]
pub const OH_Drawing_PathMeasureMatrixFlags_GET_TANGENT_MATRIX: OH_Drawing_PathMeasureMatrixFlags =
1;
#[doc = " Matrix corresponding to the position and tangent information."]
pub const OH_Drawing_PathMeasureMatrixFlags_GET_POSITION_AND_TANGENT_MATRIX:
OH_Drawing_PathMeasureMatrixFlags = 2;
#[doc = " @brief Enumerates the types of matrix information obtained during path measurement.\n\n @since 12\n @version 1.0"]
pub type OH_Drawing_PathMeasureMatrixFlags = u32;
extern "C" {
#[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"]
pub fn OH_Drawing_PathCreate() -> *mut OH_Drawing_Path;
}
extern "C" {
#[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"]
pub fn OH_Drawing_PathCopy(path: *mut OH_Drawing_Path) -> *mut OH_Drawing_Path;
}
extern "C" {
#[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"]
pub fn OH_Drawing_PathDestroy(path: *mut OH_Drawing_Path);
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_PathSetPath(
path: *mut OH_Drawing_Path,
other: *mut OH_Drawing_Path,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_PathIsEmpty(
path: *mut OH_Drawing_Path,
isEmpty: *mut bool,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_PathIsRect(
path: *mut OH_Drawing_Path,
rect: *mut OH_Drawing_Rect,
isRect: *mut bool,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
pub fn OH_Drawing_PathMoveTo(path: *mut OH_Drawing_Path, x: f32, y: f32);
}
extern "C" {
#[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"]
pub fn OH_Drawing_PathLineTo(path: *mut OH_Drawing_Path, x: f32, y: f32);
}
extern "C" {
#[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"]
pub fn OH_Drawing_PathArcTo(
path: *mut OH_Drawing_Path,
x1: f32,
y1: f32,
x2: f32,
y2: f32,
startDeg: f32,
sweepDeg: f32,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_PathQuadTo(
path: *mut OH_Drawing_Path,
ctrlX: f32,
ctrlY: f32,
endX: f32,
endY: f32,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_PathConicTo(
path: *mut OH_Drawing_Path,
ctrlX: f32,
ctrlY: f32,
endX: f32,
endY: f32,
weight: f32,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_PathCubicTo(
path: *mut OH_Drawing_Path,
ctrlX1: f32,
ctrlY1: f32,
ctrlX2: f32,
ctrlY2: f32,
endX: f32,
endY: f32,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_PathRMoveTo(path: *mut OH_Drawing_Path, x: f32, y: f32);
}
extern "C" {
#[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"]
pub fn OH_Drawing_PathRLineTo(path: *mut OH_Drawing_Path, x: f32, y: f32);
}
extern "C" {
#[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"]
pub fn OH_Drawing_PathRQuadTo(
path: *mut OH_Drawing_Path,
ctrlX: f32,
ctrlY: f32,
endX: f32,
endY: f32,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_PathRConicTo(
path: *mut OH_Drawing_Path,
ctrlX: f32,
ctrlY: f32,
endX: f32,
endY: f32,
weight: f32,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_PathRCubicTo(
path: *mut OH_Drawing_Path,
ctrlX1: f32,
ctrlY1: f32,
ctrlX2: f32,
ctrlY2: f32,
endX: f32,
endY: f32,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_PathAddRect(
path: *mut OH_Drawing_Path,
left: f32,
top: f32,
right: f32,
bottom: f32,
pathDirection: OH_Drawing_PathDirection,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_PathAddRectWithInitialCorner(
path: *mut OH_Drawing_Path,
rect: *const OH_Drawing_Rect,
pathDirection: OH_Drawing_PathDirection,
start: u32,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_PathAddRoundRect(
path: *mut OH_Drawing_Path,
roundRect: *const OH_Drawing_RoundRect,
pathDirection: OH_Drawing_PathDirection,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_PathAddOvalWithInitialPoint(
path: *mut OH_Drawing_Path,
rect: *const OH_Drawing_Rect,
start: u32,
pathDirection: OH_Drawing_PathDirection,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_PathAddOval(
path: *mut OH_Drawing_Path,
rect: *const OH_Drawing_Rect,
pathDirection: OH_Drawing_PathDirection,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_PathAddArc(
path: *mut OH_Drawing_Path,
rect: *const OH_Drawing_Rect,
startAngle: f32,
sweepAngle: f32,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_PathAddPath(
path: *mut OH_Drawing_Path,
src: *const OH_Drawing_Path,
matrix: *const OH_Drawing_Matrix,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_PathAddPathWithMatrixAndMode(
path: *mut OH_Drawing_Path,
src: *const OH_Drawing_Path,
matrix: *const OH_Drawing_Matrix,
pathAddMode: OH_Drawing_PathAddMode,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_PathAddPathWithMode(
path: *mut OH_Drawing_Path,
src: *const OH_Drawing_Path,
pathAddMode: OH_Drawing_PathAddMode,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_PathAddPathWithOffsetAndMode(
path: *mut OH_Drawing_Path,
src: *const OH_Drawing_Path,
dx: f32,
dy: f32,
pathAddMode: OH_Drawing_PathAddMode,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_PathAddPolygon(
path: *mut OH_Drawing_Path,
points: *const OH_Drawing_Point2D,
count: u32,
isClosed: bool,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_PathAddCircle(
path: *mut OH_Drawing_Path,
x: f32,
y: f32,
radius: f32,
pathDirection: OH_Drawing_PathDirection,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_PathBuildFromSvgString(
path: *mut OH_Drawing_Path,
str_: *const ::std::os::raw::c_char,
) -> bool;
}
extern "C" {
#[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"]
#[cfg(feature = "api-26")]
pub fn OH_Drawing_PathConvertToSvgString(
path: *const OH_Drawing_Path,
str_: *mut ::std::os::raw::c_char,
strSize: *mut usize,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-26")]
pub fn OH_Drawing_PathGetPointData(
path: *const OH_Drawing_Path,
points: *mut OH_Drawing_Point2D,
count: *mut u32,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-26")]
pub fn OH_Drawing_PathGetVerbData(
path: *const OH_Drawing_Path,
verbs: *mut OH_Drawing_PathIteratorVerb,
count: *mut u32,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-26")]
pub fn OH_Drawing_PathGetConicWeightData(
path: *const OH_Drawing_Path,
conicWeights: *mut f32,
count: *mut u32,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
pub fn OH_Drawing_PathContains(path: *mut OH_Drawing_Path, x: f32, y: f32) -> bool;
}
extern "C" {
#[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"]
pub fn OH_Drawing_PathTransform(path: *mut OH_Drawing_Path, matrix: *const OH_Drawing_Matrix);
}
extern "C" {
#[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"]
pub fn OH_Drawing_PathTransformWithPerspectiveClip(
src: *mut OH_Drawing_Path,
matrix: *const OH_Drawing_Matrix,
dst: *mut OH_Drawing_Path,
applyPerspectiveClip: bool,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_PathSetFillType(
path: *mut OH_Drawing_Path,
pathFillType: OH_Drawing_PathFillType,
);
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_PathGetFillType(
path: *mut OH_Drawing_Path,
pathFillType: *mut OH_Drawing_PathFillType,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
pub fn OH_Drawing_PathGetLength(path: *mut OH_Drawing_Path, forceClosed: bool) -> f32;
}
extern "C" {
#[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"]
pub fn OH_Drawing_PathGetBounds(path: *mut OH_Drawing_Path, rect: *mut OH_Drawing_Rect);
}
extern "C" {
#[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"]
pub fn OH_Drawing_PathClose(path: *mut OH_Drawing_Path);
}
extern "C" {
#[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"]
pub fn OH_Drawing_PathOffset(
path: *mut OH_Drawing_Path,
dst: *mut OH_Drawing_Path,
dx: f32,
dy: f32,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_PathReset(path: *mut OH_Drawing_Path);
}
extern "C" {
#[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"]
pub fn OH_Drawing_PathIsClosed(path: *mut OH_Drawing_Path, forceClosed: bool) -> bool;
}
extern "C" {
#[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"]
pub fn OH_Drawing_PathGetPositionTangent(
path: *mut OH_Drawing_Path,
forceClosed: bool,
distance: f32,
position: *mut OH_Drawing_Point2D,
tangent: *mut OH_Drawing_Point2D,
) -> bool;
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_PathGetSegment(
path: *mut OH_Drawing_Path,
forceClosed: bool,
start: f32,
stop: f32,
startWithMoveTo: bool,
dst: *mut OH_Drawing_Path,
result: *mut bool,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
pub fn OH_Drawing_PathOp(
path: *mut OH_Drawing_Path,
other: *const OH_Drawing_Path,
op: OH_Drawing_PathOpMode,
) -> bool;
}
extern "C" {
#[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"]
pub fn OH_Drawing_PathGetMatrix(
path: *mut OH_Drawing_Path,
forceClosed: bool,
distance: f32,
matrix: *mut OH_Drawing_Matrix,
flag: OH_Drawing_PathMeasureMatrixFlags,
) -> bool;
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_PathApproximate(
path: *mut OH_Drawing_Path,
acceptableError: f32,
vals: *mut f32,
count: *mut u32,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_PathInterpolate(
path: *mut OH_Drawing_Path,
other: *mut OH_Drawing_Path,
weight: f32,
success: *mut bool,
interpolatedPath: *mut OH_Drawing_Path,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_PathIsInterpolate(
path: *mut OH_Drawing_Path,
other: *mut OH_Drawing_Path,
result: *mut bool,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-26")]
pub fn OH_Drawing_PathGetLastPoint(
path: *mut OH_Drawing_Path,
point: *mut OH_Drawing_Point2D,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-23")]
pub fn OH_Drawing_PathIsInverseFillType(
path: *const OH_Drawing_Path,
isInverse: *mut bool,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-23")]
pub fn OH_Drawing_PathToggleInverseFillType(path: *mut OH_Drawing_Path)
-> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-26")]
pub fn OH_Drawing_PathIsEqual(
path: *mut OH_Drawing_Path,
other: *mut OH_Drawing_Path,
equal: *mut bool,
) -> OH_Drawing_ErrorCode;
}
#[doc = " Translation effect."]
#[cfg(feature = "api-18")]
pub const OH_Drawing_PathDashStyle_DRAWING_PATH_DASH_STYLE_TRANSLATE: OH_Drawing_PathDashStyle = 0;
#[doc = " Rotation effect."]
#[cfg(feature = "api-18")]
pub const OH_Drawing_PathDashStyle_DRAWING_PATH_DASH_STYLE_ROTATE: OH_Drawing_PathDashStyle = 1;
#[doc = " Morphing effect."]
#[cfg(feature = "api-18")]
pub const OH_Drawing_PathDashStyle_DRAWING_PATH_DASH_STYLE_MORPH: OH_Drawing_PathDashStyle = 2;
#[doc = " @brief Enumerates the drawing styles for path effects.\n\n @since 18\n @version 1.0"]
#[cfg(feature = "api-18")]
pub type OH_Drawing_PathDashStyle = u32;
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_CreateComposePathEffect(
outer: *mut OH_Drawing_PathEffect,
inner: *mut OH_Drawing_PathEffect,
) -> *mut OH_Drawing_PathEffect;
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_CreateCornerPathEffect(radius: f32) -> *mut OH_Drawing_PathEffect;
}
extern "C" {
#[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"]
pub fn OH_Drawing_CreateDashPathEffect(
intervals: *mut f32,
count: ::std::os::raw::c_int,
phase: f32,
) -> *mut OH_Drawing_PathEffect;
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_CreateDiscretePathEffect(
segLength: f32,
deviation: f32,
) -> *mut OH_Drawing_PathEffect;
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_CreatePathDashEffect(
path: *const OH_Drawing_Path,
advance: f32,
phase: f32,
type_: OH_Drawing_PathDashStyle,
) -> *mut OH_Drawing_PathEffect;
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_CreateSumPathEffect(
firstPathEffect: *mut OH_Drawing_PathEffect,
secondPathEffect: *mut OH_Drawing_PathEffect,
) -> *mut OH_Drawing_PathEffect;
}
extern "C" {
#[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"]
pub fn OH_Drawing_PathEffectDestroy(pathEffect: *mut OH_Drawing_PathEffect);
}
extern "C" {
#[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"]
pub fn OH_Drawing_PenCreate() -> *mut OH_Drawing_Pen;
}
extern "C" {
#[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"]
pub fn OH_Drawing_PenCopy(pen: *mut OH_Drawing_Pen) -> *mut OH_Drawing_Pen;
}
extern "C" {
#[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"]
pub fn OH_Drawing_PenDestroy(pen: *mut OH_Drawing_Pen);
}
extern "C" {
#[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"]
pub fn OH_Drawing_PenIsAntiAlias(pen: *const OH_Drawing_Pen) -> bool;
}
extern "C" {
#[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"]
pub fn OH_Drawing_PenSetAntiAlias(pen: *mut OH_Drawing_Pen, antiAlias: bool);
}
extern "C" {
#[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"]
pub fn OH_Drawing_PenGetColor(pen: *const OH_Drawing_Pen) -> u32;
}
extern "C" {
#[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"]
pub fn OH_Drawing_PenSetColor(pen: *mut OH_Drawing_Pen, color: u32);
}
extern "C" {
#[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"]
pub fn OH_Drawing_PenGetAlpha(pen: *const OH_Drawing_Pen) -> u8;
}
extern "C" {
#[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"]
pub fn OH_Drawing_PenSetAlpha(pen: *mut OH_Drawing_Pen, alpha: u8);
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_PenSetColor4f(
pen: *mut OH_Drawing_Pen,
a: f32,
r: f32,
g: f32,
b: f32,
colorSpaceManager: *mut OH_NativeColorSpaceManager,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_PenGetAlphaFloat(
pen: *mut OH_Drawing_Pen,
a: *mut f32,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_PenGetRedFloat(pen: *mut OH_Drawing_Pen, r: *mut f32)
-> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_PenGetGreenFloat(
pen: *mut OH_Drawing_Pen,
g: *mut f32,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_PenGetBlueFloat(
pen: *mut OH_Drawing_Pen,
b: *mut f32,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
pub fn OH_Drawing_PenGetWidth(pen: *const OH_Drawing_Pen) -> f32;
}
extern "C" {
#[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"]
pub fn OH_Drawing_PenSetWidth(pen: *mut OH_Drawing_Pen, width: f32);
}
extern "C" {
#[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"]
pub fn OH_Drawing_PenGetMiterLimit(pen: *const OH_Drawing_Pen) -> f32;
}
extern "C" {
#[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"]
pub fn OH_Drawing_PenSetMiterLimit(pen: *mut OH_Drawing_Pen, miter: f32);
}
#[doc = " There is no cap style. Both ends of the line segment are cut off square."]
pub const OH_Drawing_PenLineCapStyle_LINE_FLAT_CAP: OH_Drawing_PenLineCapStyle = 0;
#[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."]
pub const OH_Drawing_PenLineCapStyle_LINE_SQUARE_CAP: OH_Drawing_PenLineCapStyle = 1;
#[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."]
pub const OH_Drawing_PenLineCapStyle_LINE_ROUND_CAP: OH_Drawing_PenLineCapStyle = 2;
#[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"]
pub type OH_Drawing_PenLineCapStyle = u32;
extern "C" {
#[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"]
pub fn OH_Drawing_PenGetCap(pen: *const OH_Drawing_Pen) -> OH_Drawing_PenLineCapStyle;
}
extern "C" {
#[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"]
pub fn OH_Drawing_PenSetCap(pen: *mut OH_Drawing_Pen, capStyle: OH_Drawing_PenLineCapStyle);
}
#[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."]
pub const OH_Drawing_PenLineJoinStyle_LINE_MITER_JOIN: OH_Drawing_PenLineJoinStyle = 0;
#[doc = " Round corner."]
pub const OH_Drawing_PenLineJoinStyle_LINE_ROUND_JOIN: OH_Drawing_PenLineJoinStyle = 1;
#[doc = " Beveled corner."]
pub const OH_Drawing_PenLineJoinStyle_LINE_BEVEL_JOIN: OH_Drawing_PenLineJoinStyle = 2;
#[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"]
pub type OH_Drawing_PenLineJoinStyle = u32;
extern "C" {
#[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"]
pub fn OH_Drawing_PenGetJoin(pen: *const OH_Drawing_Pen) -> OH_Drawing_PenLineJoinStyle;
}
extern "C" {
#[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"]
pub fn OH_Drawing_PenSetJoin(pen: *mut OH_Drawing_Pen, joinStyle: OH_Drawing_PenLineJoinStyle);
}
extern "C" {
#[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"]
pub fn OH_Drawing_PenSetShaderEffect(
pen: *mut OH_Drawing_Pen,
shaderEffect: *mut OH_Drawing_ShaderEffect,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_PenSetShadowLayer(
pen: *mut OH_Drawing_Pen,
shadowLayer: *mut OH_Drawing_ShadowLayer,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_PenSetPathEffect(
pen: *mut OH_Drawing_Pen,
pathEffect: *mut OH_Drawing_PathEffect,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_PenSetFilter(pen: *mut OH_Drawing_Pen, filter: *mut OH_Drawing_Filter);
}
extern "C" {
#[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"]
pub fn OH_Drawing_PenGetFilter(pen: *mut OH_Drawing_Pen, filter: *mut OH_Drawing_Filter);
}
extern "C" {
#[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"]
pub fn OH_Drawing_PenSetBlendMode(pen: *mut OH_Drawing_Pen, blendMode: OH_Drawing_BlendMode);
}
extern "C" {
#[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"]
pub fn OH_Drawing_PenGetFillPath(
pen: *mut OH_Drawing_Pen,
src: *const OH_Drawing_Path,
dst: *mut OH_Drawing_Path,
rect: *const OH_Drawing_Rect,
matrix: *const OH_Drawing_Matrix,
) -> bool;
}
extern "C" {
#[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"]
pub fn OH_Drawing_PenReset(pen: *mut OH_Drawing_Pen);
}
extern "C" {
#[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"]
pub fn OH_Drawing_PixelMapGetFromNativePixelMap(
nativePixelMap: *mut NativePixelMap_,
) -> *mut OH_Drawing_PixelMap;
}
extern "C" {
#[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"]
pub fn OH_Drawing_PixelMapGetFromOhPixelMapNative(
pixelmapNative: *mut OH_PixelmapNative,
) -> *mut OH_Drawing_PixelMap;
}
extern "C" {
#[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"]
pub fn OH_Drawing_PixelMapDissolve(pixelMap: *mut OH_Drawing_PixelMap);
}
extern "C" {
#[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"]
pub fn OH_Drawing_PointCreate(x: f32, y: f32) -> *mut OH_Drawing_Point;
}
extern "C" {
#[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"]
pub fn OH_Drawing_PointGetX(
point: *const OH_Drawing_Point,
x: *mut f32,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
pub fn OH_Drawing_PointGetY(
point: *const OH_Drawing_Point,
y: *mut f32,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
pub fn OH_Drawing_PointSet(
point: *mut OH_Drawing_Point,
x: f32,
y: f32,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-26")]
pub fn OH_Drawing_PointNegate(point: *mut OH_Drawing_Point) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-26")]
pub fn OH_Drawing_PointOffset(
point: *mut OH_Drawing_Point,
dx: f32,
dy: f32,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
pub fn OH_Drawing_PointDestroy(point: *mut OH_Drawing_Point);
}
extern "C" {
#[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"]
#[cfg(feature = "api-13")]
pub fn OH_Drawing_RecordCmdUtilsCreate() -> *mut OH_Drawing_RecordCmdUtils;
}
extern "C" {
#[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"]
#[cfg(feature = "api-13")]
pub fn OH_Drawing_RecordCmdUtilsDestroy(
recordCmdUtils: *mut OH_Drawing_RecordCmdUtils,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-13")]
pub fn OH_Drawing_RecordCmdUtilsBeginRecording(
recordCmdUtils: *mut OH_Drawing_RecordCmdUtils,
width: i32,
height: i32,
canvas: *mut *mut OH_Drawing_Canvas,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-13")]
pub fn OH_Drawing_RecordCmdUtilsFinishRecording(
recordCmdUtils: *mut OH_Drawing_RecordCmdUtils,
recordCmd: *mut *mut OH_Drawing_RecordCmd,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-13")]
pub fn OH_Drawing_RecordCmdDestroy(
recordCmd: *mut OH_Drawing_RecordCmd,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
pub fn OH_Drawing_RectCreate(
left: f32,
top: f32,
right: f32,
bottom: f32,
) -> *mut OH_Drawing_Rect;
}
extern "C" {
#[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"]
pub fn OH_Drawing_RectIntersect(
rect: *mut OH_Drawing_Rect,
other: *const OH_Drawing_Rect,
) -> bool;
}
extern "C" {
#[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"]
pub fn OH_Drawing_RectJoin(rect: *mut OH_Drawing_Rect, other: *const OH_Drawing_Rect) -> bool;
}
extern "C" {
#[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"]
pub fn OH_Drawing_RectSetLeft(rect: *mut OH_Drawing_Rect, left: f32);
}
extern "C" {
#[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"]
pub fn OH_Drawing_RectSetTop(rect: *mut OH_Drawing_Rect, top: f32);
}
extern "C" {
#[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"]
pub fn OH_Drawing_RectSetRight(rect: *mut OH_Drawing_Rect, right: f32);
}
extern "C" {
#[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"]
pub fn OH_Drawing_RectSetBottom(rect: *mut OH_Drawing_Rect, bottom: f32);
}
extern "C" {
#[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"]
pub fn OH_Drawing_RectGetLeft(rect: *mut OH_Drawing_Rect) -> f32;
}
extern "C" {
#[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"]
pub fn OH_Drawing_RectGetTop(rect: *mut OH_Drawing_Rect) -> f32;
}
extern "C" {
#[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"]
pub fn OH_Drawing_RectGetRight(rect: *mut OH_Drawing_Rect) -> f32;
}
extern "C" {
#[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"]
pub fn OH_Drawing_RectGetBottom(rect: *mut OH_Drawing_Rect) -> f32;
}
extern "C" {
#[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"]
pub fn OH_Drawing_RectGetHeight(rect: *mut OH_Drawing_Rect) -> f32;
}
extern "C" {
#[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"]
pub fn OH_Drawing_RectGetWidth(rect: *mut OH_Drawing_Rect) -> f32;
}
extern "C" {
#[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"]
pub fn OH_Drawing_RectCopy(src: *mut OH_Drawing_Rect, dst: *mut OH_Drawing_Rect);
}
extern "C" {
#[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"]
pub fn OH_Drawing_RectDestroy(rect: *mut OH_Drawing_Rect);
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_RectCreateArray(size: usize) -> *mut OH_Drawing_Array;
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_RectGetArraySize(
rectArray: *mut OH_Drawing_Array,
pSize: *mut usize,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_RectGetArrayElement(
rectArray: *mut OH_Drawing_Array,
index: usize,
rect: *mut *mut OH_Drawing_Rect,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_RectDestroyArray(rectArray: *mut OH_Drawing_Array) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-22")]
pub fn OH_Drawing_RectContains(
rect: *mut OH_Drawing_Rect,
other: *const OH_Drawing_Rect,
isContains: *mut bool,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-22")]
pub fn OH_Drawing_RectInset(
rect: *mut OH_Drawing_Rect,
left: f32,
top: f32,
right: f32,
bottom: f32,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-23")]
pub fn OH_Drawing_RectIsEmpty(
rect: *const OH_Drawing_Rect,
isEmpty: *mut bool,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-23")]
pub fn OH_Drawing_RectOffset(
rect: *mut OH_Drawing_Rect,
dx: f32,
dy: f32,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-23")]
pub fn OH_Drawing_RectOffsetTo(
rect: *mut OH_Drawing_Rect,
newLeft: f32,
newTop: f32,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-23")]
pub fn OH_Drawing_RectSetEmpty(rect: *mut OH_Drawing_Rect) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-23")]
pub fn OH_Drawing_RectSort(rect: *mut OH_Drawing_Rect) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-23")]
pub fn OH_Drawing_RectUnion(
rect: *mut OH_Drawing_Rect,
other: *const OH_Drawing_Rect,
) -> OH_Drawing_ErrorCode;
}
#[doc = " Difference operation."]
pub const OH_Drawing_RegionOpMode_REGION_OP_MODE_DIFFERENCE: OH_Drawing_RegionOpMode = 0;
#[doc = " Intersection operation."]
pub const OH_Drawing_RegionOpMode_REGION_OP_MODE_INTERSECT: OH_Drawing_RegionOpMode = 1;
#[doc = " Union operation."]
pub const OH_Drawing_RegionOpMode_REGION_OP_MODE_UNION: OH_Drawing_RegionOpMode = 2;
#[doc = " XOR operation."]
pub const OH_Drawing_RegionOpMode_REGION_OP_MODE_XOR: OH_Drawing_RegionOpMode = 3;
#[doc = " Reverse difference operation."]
pub const OH_Drawing_RegionOpMode_REGION_OP_MODE_REVERSE_DIFFERENCE: OH_Drawing_RegionOpMode = 4;
#[doc = " Replacement operation."]
pub const OH_Drawing_RegionOpMode_REGION_OP_MODE_REPLACE: OH_Drawing_RegionOpMode = 5;
#[doc = " @brief Enumerates the operation modes available for a region.\n\n @since 12\n @version 1.0"]
pub type OH_Drawing_RegionOpMode = u32;
extern "C" {
#[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"]
pub fn OH_Drawing_RegionCreate() -> *mut OH_Drawing_Region;
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_RegionCopy(region: *const OH_Drawing_Region) -> *mut OH_Drawing_Region;
}
extern "C" {
#[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"]
pub fn OH_Drawing_RegionContains(region: *mut OH_Drawing_Region, x: i32, y: i32) -> bool;
}
extern "C" {
#[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"]
pub fn OH_Drawing_RegionOp(
region: *mut OH_Drawing_Region,
other: *const OH_Drawing_Region,
op: OH_Drawing_RegionOpMode,
) -> bool;
}
extern "C" {
#[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"]
pub fn OH_Drawing_RegionSetRect(
region: *mut OH_Drawing_Region,
rect: *const OH_Drawing_Rect,
) -> bool;
}
extern "C" {
#[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"]
pub fn OH_Drawing_RegionSetPath(
region: *mut OH_Drawing_Region,
path: *const OH_Drawing_Path,
clip: *const OH_Drawing_Region,
) -> bool;
}
extern "C" {
#[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"]
pub fn OH_Drawing_RegionDestroy(region: *mut OH_Drawing_Region);
}
extern "C" {
#[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"]
#[cfg(feature = "api-22")]
pub fn OH_Drawing_RegionEmpty(region: *mut OH_Drawing_Region) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-23")]
pub fn OH_Drawing_RegionGetBoundaryPath(
region: *const OH_Drawing_Region,
path: *mut OH_Drawing_Path,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-23")]
pub fn OH_Drawing_RegionGetBounds(
region: *const OH_Drawing_Region,
rect: *mut OH_Drawing_Rect,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-23")]
pub fn OH_Drawing_RegionIsComplex(
region: *const OH_Drawing_Region,
isComplex: *mut bool,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-23")]
pub fn OH_Drawing_RegionIsEmpty(
region: *const OH_Drawing_Region,
isEmpty: *mut bool,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-23")]
pub fn OH_Drawing_RegionIsRect(
region: *const OH_Drawing_Region,
isRect: *mut bool,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-23")]
pub fn OH_Drawing_RegionQuickContains(
region: *const OH_Drawing_Region,
left: i32,
top: i32,
right: i32,
bottom: i32,
isContained: *mut bool,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-23")]
pub fn OH_Drawing_RegionQuickReject(
region: *const OH_Drawing_Region,
left: i32,
top: i32,
right: i32,
bottom: i32,
isReject: *mut bool,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-23")]
pub fn OH_Drawing_RegionTranslate(
region: *mut OH_Drawing_Region,
dx: i32,
dy: i32,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
pub fn OH_Drawing_RegisterFont(
fontCollection: *mut OH_Drawing_FontCollection,
fontFamily: *const ::std::os::raw::c_char,
familySrc: *const ::std::os::raw::c_char,
) -> u32;
}
extern "C" {
#[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"]
pub fn OH_Drawing_RegisterFontBuffer(
fontCollection: *mut OH_Drawing_FontCollection,
fontFamily: *const ::std::os::raw::c_char,
fontBuffer: *mut u8,
length: usize,
) -> u32;
}
extern "C" {
#[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"]
#[cfg(feature = "api-23")]
pub fn OH_Drawing_RegisterFontByIndex(
fontCollection: *mut OH_Drawing_FontCollection,
fontFamily: *const ::std::os::raw::c_char,
familySrc: *const ::std::os::raw::c_char,
index: u32,
) -> u32;
}
extern "C" {
#[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"]
#[cfg(feature = "api-23")]
pub fn OH_Drawing_RegisterFontBufferByIndex(
fontCollection: *mut OH_Drawing_FontCollection,
fontFamily: *const ::std::os::raw::c_char,
fontBuffer: *mut u8,
length: usize,
index: u32,
) -> u32;
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_UnregisterFont(
fontCollection: *mut OH_Drawing_FontCollection,
fontFamily: *const ::std::os::raw::c_char,
) -> u32;
}
extern "C" {
#[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"]
#[cfg(feature = "api-23")]
pub fn OH_Drawing_IsFontSupportedFromPath(path: *const ::std::os::raw::c_char) -> bool;
}
extern "C" {
#[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"]
#[cfg(feature = "api-23")]
pub fn OH_Drawing_IsFontSupportedFromBuffer(data: *mut u8, dataLength: usize) -> bool;
}
#[doc = " Top left corner of the rounded rectangle."]
pub const OH_Drawing_CornerPos_CORNER_POS_TOP_LEFT: OH_Drawing_CornerPos = 0;
#[doc = " Top right corner of the rounded rectangle."]
pub const OH_Drawing_CornerPos_CORNER_POS_TOP_RIGHT: OH_Drawing_CornerPos = 1;
#[doc = " Bottom right corner of the rounded rectangle."]
pub const OH_Drawing_CornerPos_CORNER_POS_BOTTOM_RIGHT: OH_Drawing_CornerPos = 2;
#[doc = " Bottom left corner of the rounded rectangle."]
pub const OH_Drawing_CornerPos_CORNER_POS_BOTTOM_LEFT: OH_Drawing_CornerPos = 3;
#[doc = " @brief Defines an enum for the corner positions of a rounded rectangle.\n\n @since 12\n @version 1.0"]
pub type OH_Drawing_CornerPos = u32;
extern "C" {
#[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"]
pub fn OH_Drawing_RoundRectCreate(
rect: *const OH_Drawing_Rect,
xRad: f32,
yRad: f32,
) -> *mut OH_Drawing_RoundRect;
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_RoundRectCopy(
roundRect: *const OH_Drawing_RoundRect,
) -> *mut OH_Drawing_RoundRect;
}
extern "C" {
#[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"]
pub fn OH_Drawing_RoundRectSetCorner(
roundRect: *mut OH_Drawing_RoundRect,
pos: OH_Drawing_CornerPos,
radii: OH_Drawing_Corner_Radii,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_RoundRectGetCorner(
roundRect: *mut OH_Drawing_RoundRect,
pos: OH_Drawing_CornerPos,
) -> OH_Drawing_Corner_Radii;
}
extern "C" {
#[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"]
pub fn OH_Drawing_RoundRectDestroy(roundRect: *mut OH_Drawing_RoundRect);
}
extern "C" {
#[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"]
pub fn OH_Drawing_RoundRectOffset(
roundRect: *mut OH_Drawing_RoundRect,
dx: f32,
dy: f32,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
pub fn OH_Drawing_ShadowLayerCreate(
blurRadius: f32,
x: f32,
y: f32,
color: u32,
) -> *mut OH_Drawing_ShadowLayer;
}
extern "C" {
#[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"]
pub fn OH_Drawing_ShadowLayerDestroy(shadowLayer: *mut OH_Drawing_ShadowLayer);
}
extern "C" {
#[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"]
pub fn OH_Drawing_SurfaceCreateFromGpuContext(
gpuContext: *mut OH_Drawing_GpuContext,
flag: bool,
imageInfo: OH_Drawing_Image_Info,
) -> *mut OH_Drawing_Surface;
}
extern "C" {
#[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"]
#[cfg(feature = "api-16")]
pub fn OH_Drawing_SurfaceCreateOnScreen(
gpuContext: *mut OH_Drawing_GpuContext,
imageInfo: OH_Drawing_Image_Info,
window: *mut ::std::os::raw::c_void,
) -> *mut OH_Drawing_Surface;
}
extern "C" {
#[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"]
pub fn OH_Drawing_SurfaceGetCanvas(surface: *mut OH_Drawing_Surface) -> *mut OH_Drawing_Canvas;
}
extern "C" {
#[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"]
#[cfg(feature = "api-16")]
pub fn OH_Drawing_SurfaceFlush(surface: *mut OH_Drawing_Surface) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
pub fn OH_Drawing_SurfaceDestroy(surface: *mut OH_Drawing_Surface);
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextBlobBuilderCreate() -> *mut OH_Drawing_TextBlobBuilder;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextBlobCreateFromText(
text: *const ::std::os::raw::c_void,
byteLength: usize,
font: *const OH_Drawing_Font,
textEncoding: OH_Drawing_TextEncoding,
) -> *mut OH_Drawing_TextBlob;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextBlobCreateFromPosText(
text: *const ::std::os::raw::c_void,
byteLength: usize,
point2D: *mut OH_Drawing_Point2D,
font: *const OH_Drawing_Font,
textEncoding: OH_Drawing_TextEncoding,
) -> *mut OH_Drawing_TextBlob;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextBlobCreateFromString(
str_: *const ::std::os::raw::c_char,
font: *const OH_Drawing_Font,
textEncoding: OH_Drawing_TextEncoding,
) -> *mut OH_Drawing_TextBlob;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextBlobGetBounds(
textBlob: *mut OH_Drawing_TextBlob,
rect: *mut OH_Drawing_Rect,
);
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextBlobUniqueID(textBlob: *const OH_Drawing_TextBlob) -> u32;
}
#[doc = " @brief This struct describes a run, which provides storage for glyphs and positions.\n\n @since 11\n @version 1.0"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_RunBuffer {
#[doc = " Storage for glyph indexes in the run."]
pub glyphs: *mut u16,
#[doc = " Storage for glyph positions in the run."]
pub pos: *mut f32,
#[doc = " Storage for UTF-8 encoded text units in the run."]
pub utf8text: *mut ::std::os::raw::c_char,
#[doc = " Storage for glyph clusters (index of the UTF-8 encoded text unit) in the run."]
pub clusters: *mut u32,
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextBlobBuilderAllocRunPos(
textBlobBuilder: *mut OH_Drawing_TextBlobBuilder,
font: *const OH_Drawing_Font,
count: i32,
rect: *const OH_Drawing_Rect,
) -> *const OH_Drawing_RunBuffer;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextBlobBuilderMake(
textBlobBuilder: *mut OH_Drawing_TextBlobBuilder,
) -> *mut OH_Drawing_TextBlob;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextBlobDestroy(textBlob: *mut OH_Drawing_TextBlob);
}
extern "C" {
#[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"]
pub fn OH_Drawing_TextBlobBuilderDestroy(textBlobBuilder: *mut OH_Drawing_TextBlobBuilder);
}
#[doc = " All font types."]
#[cfg(feature = "api-14")]
pub const OH_Drawing_SystemFontType_ALL: OH_Drawing_SystemFontType = 1;
#[doc = " System font type."]
#[cfg(feature = "api-14")]
pub const OH_Drawing_SystemFontType_GENERIC: OH_Drawing_SystemFontType = 2;
#[doc = " Style font type."]
#[cfg(feature = "api-14")]
pub const OH_Drawing_SystemFontType_STYLISH: OH_Drawing_SystemFontType = 4;
#[doc = " User-installed font type."]
#[cfg(feature = "api-14")]
pub const OH_Drawing_SystemFontType_INSTALLED: OH_Drawing_SystemFontType = 8;
#[doc = " Custom font type.\n @since 18"]
#[cfg(feature = "api-18")]
pub const OH_Drawing_SystemFontType_CUSTOMIZED: OH_Drawing_SystemFontType = 16;
#[doc = " @brief Defines an enum for the system font types.\n\n @since 14"]
#[cfg(feature = "api-14")]
pub type OH_Drawing_SystemFontType = u32;
#[doc = " Font file path, of the {@link OH_Drawing_String} type."]
#[cfg(feature = "api-22")]
pub const OH_Drawing_FontFullDescriptorAttributeId_FULL_DESCRIPTOR_ATTR_S_PATH:
OH_Drawing_FontFullDescriptorAttributeId = 0;
#[doc = " Postscript font name, of the {@link OH_Drawing_String} type."]
#[cfg(feature = "api-22")]
pub const OH_Drawing_FontFullDescriptorAttributeId_FULL_DESCRIPTOR_ATTR_S_POSTSCRIPT_NAME:
OH_Drawing_FontFullDescriptorAttributeId = 1;
#[doc = " Font name, of the {@link OH_Drawing_String} type."]
#[cfg(feature = "api-22")]
pub const OH_Drawing_FontFullDescriptorAttributeId_FULL_DESCRIPTOR_ATTR_S_FULL_NAME:
OH_Drawing_FontFullDescriptorAttributeId = 2;
#[doc = " Font family name, of the {@link OH_Drawing_String} type."]
#[cfg(feature = "api-22")]
pub const OH_Drawing_FontFullDescriptorAttributeId_FULL_DESCRIPTOR_ATTR_S_FAMILY_NAME:
OH_Drawing_FontFullDescriptorAttributeId = 3;
#[doc = " Font subfamily name, of the {@link OH_Drawing_String} type."]
#[cfg(feature = "api-22")]
pub const OH_Drawing_FontFullDescriptorAttributeId_FULL_DESCRIPTOR_ATTR_S_SUB_FAMILY_NAME:
OH_Drawing_FontFullDescriptorAttributeId = 4;
#[doc = " Font weight, of the int type."]
#[cfg(feature = "api-22")]
pub const OH_Drawing_FontFullDescriptorAttributeId_FULL_DESCRIPTOR_ATTR_I_WEIGHT:
OH_Drawing_FontFullDescriptorAttributeId = 5;
#[doc = " Font width style, of the int type."]
#[cfg(feature = "api-22")]
pub const OH_Drawing_FontFullDescriptorAttributeId_FULL_DESCRIPTOR_ATTR_I_WIDTH:
OH_Drawing_FontFullDescriptorAttributeId = 6;
#[doc = " Whether the font is italic, of the int type. **1** means that the font is italic; **0** otherwise."]
#[cfg(feature = "api-22")]
pub const OH_Drawing_FontFullDescriptorAttributeId_FULL_DESCRIPTOR_ATTR_I_ITALIC:
OH_Drawing_FontFullDescriptorAttributeId = 7;
#[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."]
#[cfg(feature = "api-22")]
pub const OH_Drawing_FontFullDescriptorAttributeId_FULL_DESCRIPTOR_ATTR_B_MONO:
OH_Drawing_FontFullDescriptorAttributeId = 8;
#[doc = " Whether the font supports the symbol font, of the bool type. **true** means yes; **false** otherwise."]
#[cfg(feature = "api-22")]
pub const OH_Drawing_FontFullDescriptorAttributeId_FULL_DESCRIPTOR_ATTR_B_SYMBOLIC:
OH_Drawing_FontFullDescriptorAttributeId = 9;
#[doc = " Extracts the postscript name of the font based on the system language configuration.\n @since 23"]
#[cfg(feature = "api-23")]
pub const OH_Drawing_FontFullDescriptorAttributeId_FULL_DESCRIPTOR_ATTR_S_LOCAL_POSTSCRIPT_NAME:
OH_Drawing_FontFullDescriptorAttributeId = 10;
#[doc = " Extracts the full name of the font based on the system language configuration.\n @since 23"]
#[cfg(feature = "api-23")]
pub const OH_Drawing_FontFullDescriptorAttributeId_FULL_DESCRIPTOR_ATTR_S_LOCAL_FULL_NAME:
OH_Drawing_FontFullDescriptorAttributeId = 11;
#[doc = " Extracts the font family name based on the system language configuration.\n @since 23"]
#[cfg(feature = "api-23")]
pub const OH_Drawing_FontFullDescriptorAttributeId_FULL_DESCRIPTOR_ATTR_S_LOCAL_FAMILY_NAME:
OH_Drawing_FontFullDescriptorAttributeId = 12;
#[doc = " Extracts the font subfamily name based on the system language configuration.\n @since 23"]
#[cfg(feature = "api-23")]
pub const OH_Drawing_FontFullDescriptorAttributeId_FULL_DESCRIPTOR_ATTR_S_LOCAL_SUB_FAMILY_NAME:
OH_Drawing_FontFullDescriptorAttributeId = 13;
#[doc = " Font version.\n @since 23"]
#[cfg(feature = "api-23")]
pub const OH_Drawing_FontFullDescriptorAttributeId_FULL_DESCRIPTOR_ATTR_S_VERSION:
OH_Drawing_FontFullDescriptorAttributeId = 14;
#[doc = " Font manufacturer information.\n @since 23"]
#[cfg(feature = "api-23")]
pub const OH_Drawing_FontFullDescriptorAttributeId_FULL_DESCRIPTOR_ATTR_S_MANUFACTURE:
OH_Drawing_FontFullDescriptorAttributeId = 15;
#[doc = " The copyright of the font\n @since 23"]
#[cfg(feature = "api-23")]
pub const OH_Drawing_FontFullDescriptorAttributeId_FULL_DESCRIPTOR_ATTR_S_COPYRIGHT:
OH_Drawing_FontFullDescriptorAttributeId = 16;
#[doc = " Font trademark information.\n @since 23"]
#[cfg(feature = "api-23")]
pub const OH_Drawing_FontFullDescriptorAttributeId_FULL_DESCRIPTOR_ATTR_S_TRADEMARK:
OH_Drawing_FontFullDescriptorAttributeId = 17;
#[doc = " Font license information.\n @since 23"]
#[cfg(feature = "api-23")]
pub const OH_Drawing_FontFullDescriptorAttributeId_FULL_DESCRIPTOR_ATTR_S_LICENSE:
OH_Drawing_FontFullDescriptorAttributeId = 18;
#[doc = " Font variable axis array.\n @since 24"]
#[cfg(feature = "api-24")]
pub const OH_Drawing_FontFullDescriptorAttributeId_FULL_DESCRIPTOR_ATTR_O_VARIATION_AXIS:
OH_Drawing_FontFullDescriptorAttributeId = 19;
#[doc = " Font variable instance array.\n @since 24"]
#[cfg(feature = "api-24")]
pub const OH_Drawing_FontFullDescriptorAttributeId_FULL_DESCRIPTOR_ATTR_O_VARIATION_INSTANCE:
OH_Drawing_FontFullDescriptorAttributeId = 20;
#[doc = " Font index.\n @since 23"]
#[cfg(feature = "api-23")]
pub const OH_Drawing_FontFullDescriptorAttributeId_FULL_DESCRIPTOR_ATTR_I_INDEX:
OH_Drawing_FontFullDescriptorAttributeId = 21;
#[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"]
#[cfg(feature = "api-22")]
pub type OH_Drawing_FontFullDescriptorAttributeId = u32;
#[doc = " Keyword identifier of the font variable axis."]
#[cfg(feature = "api-24")]
pub const OH_Drawing_FontVariationAxisAttributeId_FONT_VARIATION_AXIS_ATTR_S_KEY:
OH_Drawing_FontVariationAxisAttributeId = 0;
#[doc = " Minimum value of the font variable axis."]
#[cfg(feature = "api-24")]
pub const OH_Drawing_FontVariationAxisAttributeId_FONT_VARIATION_AXIS_ATTR_D_MIN_VALUE:
OH_Drawing_FontVariationAxisAttributeId = 1;
#[doc = " Maximum value of the font variable axis."]
#[cfg(feature = "api-24")]
pub const OH_Drawing_FontVariationAxisAttributeId_FONT_VARIATION_AXIS_ATTR_D_MAX_VALUE:
OH_Drawing_FontVariationAxisAttributeId = 2;
#[doc = " Default value of the font variable axis."]
#[cfg(feature = "api-24")]
pub const OH_Drawing_FontVariationAxisAttributeId_FONT_VARIATION_AXIS_ATTR_D_DEFAULT_VALUE:
OH_Drawing_FontVariationAxisAttributeId = 3;
#[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."]
#[cfg(feature = "api-24")]
pub const OH_Drawing_FontVariationAxisAttributeId_FONT_VARIATION_AXIS_ATTR_I_FLAGS:
OH_Drawing_FontVariationAxisAttributeId = 4;
#[doc = " English name of the font variable axis."]
#[cfg(feature = "api-24")]
pub const OH_Drawing_FontVariationAxisAttributeId_FONT_VARIATION_AXIS_ATTR_S_NAME:
OH_Drawing_FontVariationAxisAttributeId = 5;
#[doc = " Localized name of the font variable axis."]
#[cfg(feature = "api-24")]
pub const OH_Drawing_FontVariationAxisAttributeId_FONT_VARIATION_AXIS_ATTR_S_LOCAL_NAME:
OH_Drawing_FontVariationAxisAttributeId = 6;
#[doc = " @brief Enumerates font variable axis attributes.\n\n @since 24"]
#[cfg(feature = "api-24")]
pub type OH_Drawing_FontVariationAxisAttributeId = u32;
#[doc = " English name of the font variable instance."]
#[cfg(feature = "api-24")]
pub const OH_Drawing_FontVariationInstanceAttributeId_FONT_VARIATION_INSTANCE_ATTR_S_NAME:
OH_Drawing_FontVariationInstanceAttributeId = 0;
#[doc = " Localized name of the font variable instance."]
#[cfg(feature = "api-24")]
pub const OH_Drawing_FontVariationInstanceAttributeId_FONT_VARIATION_INSTANCE_ATTR_S_LOCAL_NAME:
OH_Drawing_FontVariationInstanceAttributeId = 1;
#[doc = " @brief Enumerates font variable instance attributes.\n\n @since 24"]
#[cfg(feature = "api-24")]
pub type OH_Drawing_FontVariationInstanceAttributeId = u32;
#[doc = " @brief Variable font attribute key-value pair.\n\n @since 24"]
#[cfg(feature = "api-24")]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_Drawing_FontVariationInstanceCoordinate {
#[doc = " String identified by the keyword in the variable font attribute key-value pair."]
pub axisKey: *mut ::std::os::raw::c_char,
#[doc = " Value of the variable font attribute key-value pair."]
pub value: f64,
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_MatchFontDescriptors(
desc: *mut OH_Drawing_FontDescriptor,
num: *mut usize,
) -> *mut OH_Drawing_FontDescriptor;
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_DestroyFontDescriptors(
descriptors: *mut OH_Drawing_FontDescriptor,
num: usize,
);
}
extern "C" {
#[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"]
#[cfg(feature = "api-14")]
pub fn OH_Drawing_GetFontDescriptorByFullName(
fullName: *const OH_Drawing_String,
fontType: OH_Drawing_SystemFontType,
) -> *mut OH_Drawing_FontDescriptor;
}
extern "C" {
#[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"]
#[cfg(feature = "api-14")]
pub fn OH_Drawing_GetSystemFontFullNamesByType(
fontType: OH_Drawing_SystemFontType,
) -> *mut OH_Drawing_Array;
}
extern "C" {
#[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"]
#[cfg(feature = "api-14")]
pub fn OH_Drawing_GetSystemFontFullNameByIndex(
fullNameArray: *mut OH_Drawing_Array,
index: usize,
) -> *const OH_Drawing_String;
}
extern "C" {
#[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"]
#[cfg(feature = "api-14")]
pub fn OH_Drawing_DestroySystemFontFullNames(fullNameArray: *mut OH_Drawing_Array);
}
extern "C" {
#[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"]
#[cfg(feature = "api-22")]
pub fn OH_Drawing_GetFontFullDescriptorsFromStream(
data: *const ::std::os::raw::c_void,
size: usize,
) -> *mut OH_Drawing_Array;
}
extern "C" {
#[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"]
#[cfg(feature = "api-22")]
pub fn OH_Drawing_GetFontFullDescriptorsFromPath(
path: *const ::std::os::raw::c_char,
) -> *mut OH_Drawing_Array;
}
extern "C" {
#[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"]
#[cfg(feature = "api-22")]
pub fn OH_Drawing_GetFontFullDescriptorByIndex(
descriptorArray: *mut OH_Drawing_Array,
index: usize,
) -> *const OH_Drawing_FontFullDescriptor;
}
extern "C" {
#[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"]
#[cfg(feature = "api-22")]
pub fn OH_Drawing_DestroyFontFullDescriptors(descriptorArray: *mut OH_Drawing_Array);
}
extern "C" {
#[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"]
#[cfg(feature = "api-24")]
pub fn OH_Drawing_DestroyFontFullDescriptor(descriptor: *const OH_Drawing_FontFullDescriptor);
}
extern "C" {
#[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"]
#[cfg(feature = "api-23")]
pub fn OH_Drawing_GetFontUnicodeArrayFromFile(
fontSrc: *const ::std::os::raw::c_char,
index: u32,
unicodeArray: *mut *mut i32,
arrayLength: *mut i32,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-23")]
pub fn OH_Drawing_GetFontUnicodeArrayFromBuffer(
fontBuffer: *mut u8,
length: usize,
index: u32,
unicodeArray: *mut *mut i32,
arrayLength: *mut i32,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-22")]
pub fn OH_Drawing_GetFontFullDescriptorAttributeInt(
descriptor: *const OH_Drawing_FontFullDescriptor,
id: OH_Drawing_FontFullDescriptorAttributeId,
value: *mut ::std::os::raw::c_int,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-22")]
pub fn OH_Drawing_GetFontFullDescriptorAttributeBool(
descriptor: *const OH_Drawing_FontFullDescriptor,
id: OH_Drawing_FontFullDescriptorAttributeId,
value: *mut bool,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-22")]
pub fn OH_Drawing_GetFontFullDescriptorAttributeString(
descriptor: *const OH_Drawing_FontFullDescriptor,
id: OH_Drawing_FontFullDescriptorAttributeId,
str_: *mut OH_Drawing_String,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-24")]
pub fn OH_Drawing_GetFontFullDescriptorAttributeArray(
descriptor: *const OH_Drawing_FontFullDescriptor,
id: OH_Drawing_FontFullDescriptorAttributeId,
) -> *mut OH_Drawing_Array;
}
extern "C" {
#[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"]
#[cfg(feature = "api-24")]
pub fn OH_Drawing_GetFontVariationAxisByIndex(
array: *mut OH_Drawing_Array,
index: usize,
) -> *mut OH_Drawing_FontVariationAxis;
}
extern "C" {
#[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"]
#[cfg(feature = "api-24")]
pub fn OH_Drawing_DestroyFontVariationAxis(fontVariaAxisArray: *mut OH_Drawing_Array);
}
extern "C" {
#[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"]
#[cfg(feature = "api-24")]
pub fn OH_Drawing_GetFontVariationAxisAttributeDouble(
variationAxis: *mut OH_Drawing_FontVariationAxis,
id: OH_Drawing_FontVariationAxisAttributeId,
value: *mut f64,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-24")]
pub fn OH_Drawing_GetFontVariationAxisAttributeInt(
variationAxis: *mut OH_Drawing_FontVariationAxis,
id: OH_Drawing_FontVariationAxisAttributeId,
value: *mut ::std::os::raw::c_int,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-24")]
pub fn OH_Drawing_GetFontVariationAxisAttributeStr(
variationAxis: *mut OH_Drawing_FontVariationAxis,
id: OH_Drawing_FontVariationAxisAttributeId,
str_: *mut OH_Drawing_String,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-24")]
pub fn OH_Drawing_GetFontVariationInstanceByIndex(
array: *mut OH_Drawing_Array,
index: usize,
) -> *mut OH_Drawing_FontVariationInstance;
}
extern "C" {
#[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"]
#[cfg(feature = "api-24")]
pub fn OH_Drawing_DestroyFontVariationInstance(fontVariaAxisInstance: *mut OH_Drawing_Array);
}
extern "C" {
#[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"]
#[cfg(feature = "api-24")]
pub fn OH_Drawing_GetFontVariationInstanceAttributeStr(
variationInstance: *mut OH_Drawing_FontVariationInstance,
id: OH_Drawing_FontVariationInstanceAttributeId,
str_: *mut OH_Drawing_String,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-24")]
pub fn OH_Drawing_GetFontVariationInstanceCoordinate(
variationInstance: *mut OH_Drawing_FontVariationInstance,
arrayLength: *mut usize,
) -> *mut OH_Drawing_FontVariationInstanceCoordinate;
}
extern "C" {
#[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"]
#[cfg(feature = "api-24")]
pub fn OH_Drawing_GetFontFullDescriptorByFullName(
fullName: *const OH_Drawing_String,
fontType: OH_Drawing_SystemFontType,
) -> *const OH_Drawing_FontFullDescriptor;
}
extern "C" {
#[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"]
#[cfg(feature = "api-23")]
pub fn OH_Drawing_GetFontCountFromFile(fontSrc: *const ::std::os::raw::c_char) -> u32;
}
extern "C" {
#[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"]
#[cfg(feature = "api-23")]
pub fn OH_Drawing_GetFontCountFromBuffer(fontBuffer: *mut u8, length: usize) -> u32;
}
extern "C" {
#[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"]
#[cfg(feature = "api-23")]
pub fn OH_Drawing_GetFontPathsByType(
fontType: OH_Drawing_SystemFontType,
pathCount: *mut usize,
) -> *mut OH_Drawing_String;
}
#[doc = " Follows the high contrast mode for text rendering in the system settings."]
#[cfg(feature = "api-20")]
pub const OH_Drawing_TextHighContrast_TEXT_FOLLOW_SYSTEM_HIGH_CONTRAST:
OH_Drawing_TextHighContrast = 0;
#[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."]
#[cfg(feature = "api-20")]
pub const OH_Drawing_TextHighContrast_TEXT_APP_DISABLE_HIGH_CONTRAST: OH_Drawing_TextHighContrast =
1;
#[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."]
#[cfg(feature = "api-20")]
pub const OH_Drawing_TextHighContrast_TEXT_APP_ENABLE_HIGH_CONTRAST: OH_Drawing_TextHighContrast =
2;
#[doc = " @brief Defines an enum of the high contrast modes for text rendering.\n\n @since 20\n @version 1.0"]
#[cfg(feature = "api-20")]
pub type OH_Drawing_TextHighContrast = u32;
#[doc = " Uses the default glyph (which may be a blank box, space, or custom symbol) defined in the font file."]
#[cfg(feature = "api-20")]
pub const OH_Drawing_TextUndefinedGlyphDisplay_TEXT_NO_GLYPH_USE_DEFAULT:
OH_Drawing_TextUndefinedGlyphDisplay = 0;
#[doc = " Always uses tofu blocks to represent absent glyphs."]
#[cfg(feature = "api-20")]
pub const OH_Drawing_TextUndefinedGlyphDisplay_TEXT_NO_GLYPH_USE_TOFU:
OH_Drawing_TextUndefinedGlyphDisplay = 1;
#[doc = " @brief Defines an enum of the modes for displaying undefined glyphs.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing\n @since 20"]
#[cfg(feature = "api-20")]
pub type OH_Drawing_TextUndefinedGlyphDisplay = u32;
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_SetTextHighContrast(action: OH_Drawing_TextHighContrast);
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_SetTextUndefinedGlyphDisplay(
undefinedGlyphDisplay: OH_Drawing_TextUndefinedGlyphDisplay,
);
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_TypographyGetTextLines(
typography: *mut OH_Drawing_Typography,
) -> *mut OH_Drawing_Array;
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_DestroyTextLines(lines: *mut OH_Drawing_Array);
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_DestroyTextLine(line: *mut OH_Drawing_TextLine);
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_GetTextLineByIndex(
lines: *mut OH_Drawing_Array,
index: usize,
) -> *mut OH_Drawing_TextLine;
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_TextLineGetGlyphCount(line: *mut OH_Drawing_TextLine) -> f64;
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_TextLineGetTextRange(
line: *mut OH_Drawing_TextLine,
start: *mut usize,
end: *mut usize,
);
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_TextLineGetGlyphRuns(line: *mut OH_Drawing_TextLine)
-> *mut OH_Drawing_Array;
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_DestroyRuns(runs: *mut OH_Drawing_Array);
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_GetRunByIndex(
runs: *mut OH_Drawing_Array,
index: usize,
) -> *mut OH_Drawing_Run;
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_TextLinePaint(
line: *mut OH_Drawing_TextLine,
canvas: *mut OH_Drawing_Canvas,
x: f64,
y: f64,
);
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_TextLineCreateTruncatedLine(
line: *mut OH_Drawing_TextLine,
width: f64,
mode: ::std::os::raw::c_int,
ellipsis: *const ::std::os::raw::c_char,
) -> *mut OH_Drawing_TextLine;
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_TextLineGetTypographicBounds(
line: *mut OH_Drawing_TextLine,
ascent: *mut f64,
descent: *mut f64,
leading: *mut f64,
) -> f64;
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_TextLineGetImageBounds(
line: *mut OH_Drawing_TextLine,
) -> *mut OH_Drawing_Rect;
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_TextLineGetTrailingSpaceWidth(line: *mut OH_Drawing_TextLine) -> f64;
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_TextLineGetStringIndexForPosition(
line: *mut OH_Drawing_TextLine,
point: *mut OH_Drawing_Point,
) -> i32;
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_TextLineGetOffsetForStringIndex(
line: *mut OH_Drawing_TextLine,
index: i32,
) -> f64;
}
#[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"]
#[cfg(feature = "api-18")]
pub type Drawing_CaretOffsetsCallback =
::std::option::Option<unsafe extern "C" fn(offset: f64, index: i32, leadingEdge: bool) -> bool>;
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_TextLineEnumerateCaretOffsets(
line: *mut OH_Drawing_TextLine,
callback: Drawing_CaretOffsetsCallback,
);
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_TextLineGetAlignmentOffset(
line: *mut OH_Drawing_TextLine,
alignmentFactor: f64,
alignmentWidth: f64,
) -> f64;
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_CreateLineTypography(
handler: *mut OH_Drawing_TypographyCreate,
) -> *mut OH_Drawing_LineTypography;
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_DestroyLineTypography(lineTypography: *mut OH_Drawing_LineTypography);
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_LineTypographyGetLineBreak(
lineTypography: *mut OH_Drawing_LineTypography,
startIndex: usize,
width: f64,
) -> usize;
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_LineTypographyCreateLine(
lineTypography: *mut OH_Drawing_LineTypography,
startIndex: usize,
count: usize,
) -> *mut OH_Drawing_TextLine;
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_GetRunStringIndices(
run: *mut OH_Drawing_Run,
start: i64,
length: i64,
) -> *mut OH_Drawing_Array;
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_GetRunStringIndicesByIndex(
stringIndices: *mut OH_Drawing_Array,
index: usize,
) -> u64;
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_DestroyRunStringIndices(stringIndices: *mut OH_Drawing_Array);
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_GetRunStringRange(
run: *mut OH_Drawing_Run,
location: *mut u64,
length: *mut u64,
);
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_GetRunTypographicBounds(
run: *mut OH_Drawing_Run,
ascent: *mut f32,
descent: *mut f32,
leading: *mut f32,
) -> f32;
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_RunPaint(
canvas: *mut OH_Drawing_Canvas,
run: *mut OH_Drawing_Run,
x: f64,
y: f64,
);
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_GetRunImageBounds(run: *mut OH_Drawing_Run) -> *mut OH_Drawing_Rect;
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_DestroyRunImageBounds(rect: *mut OH_Drawing_Rect);
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_GetRunGlyphs(
run: *mut OH_Drawing_Run,
start: i64,
length: i64,
) -> *mut OH_Drawing_Array;
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_GetRunGlyphsByIndex(glyphs: *mut OH_Drawing_Array, index: usize) -> u16;
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_DestroyRunGlyphs(glyphs: *mut OH_Drawing_Array);
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_GetRunPositions(
run: *mut OH_Drawing_Run,
start: i64,
length: i64,
) -> *mut OH_Drawing_Array;
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_GetRunPositionsByIndex(
positions: *mut OH_Drawing_Array,
index: usize,
) -> *mut OH_Drawing_Point;
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_DestroyRunPositions(positions: *mut OH_Drawing_Array);
}
extern "C" {
#[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"]
#[cfg(feature = "api-18")]
pub fn OH_Drawing_GetRunGlyphCount(run: *mut OH_Drawing_Run) -> u32;
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_GetRunFont(run: *mut OH_Drawing_Run) -> *mut OH_Drawing_Font;
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_GetRunTextDirection(run: *mut OH_Drawing_Run) -> OH_Drawing_TextDirection;
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_GetRunGlyphAdvances(
run: *mut OH_Drawing_Run,
start: u32,
length: u32,
) -> *mut OH_Drawing_Array;
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_GetRunGlyphAdvanceByIndex(
advances: *mut OH_Drawing_Array,
index: usize,
) -> *mut OH_Drawing_Point;
}
extern "C" {
#[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"]
#[cfg(feature = "api-20")]
pub fn OH_Drawing_DestroyRunGlyphAdvances(advances: *mut OH_Drawing_Array);
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypefaceCreateDefault() -> *mut OH_Drawing_Typeface;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypefaceCreateFromFile(
path: *const ::std::os::raw::c_char,
index: ::std::os::raw::c_int,
) -> *mut OH_Drawing_Typeface;
}
extern "C" {
#[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"]
#[cfg(feature = "api-13")]
pub fn OH_Drawing_TypefaceCreateFromFileWithArguments(
path: *const ::std::os::raw::c_char,
fontArguments: *const OH_Drawing_FontArguments,
) -> *mut OH_Drawing_Typeface;
}
extern "C" {
#[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"]
#[cfg(feature = "api-13")]
pub fn OH_Drawing_TypefaceCreateFromCurrent(
current: *const OH_Drawing_Typeface,
fontArguments: *const OH_Drawing_FontArguments,
) -> *mut OH_Drawing_Typeface;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypefaceCreateFromStream(
memoryStream: *mut OH_Drawing_MemoryStream,
index: i32,
) -> *mut OH_Drawing_Typeface;
}
extern "C" {
#[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"]
pub fn OH_Drawing_TypefaceDestroy(typeface: *mut OH_Drawing_Typeface);
}
extern "C" {
#[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"]
#[cfg(feature = "api-13")]
pub fn OH_Drawing_FontArgumentsCreate() -> *mut OH_Drawing_FontArguments;
}
extern "C" {
#[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"]
#[cfg(feature = "api-13")]
pub fn OH_Drawing_FontArgumentsAddVariation(
fontArguments: *mut OH_Drawing_FontArguments,
axis: *const ::std::os::raw::c_char,
value: f32,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-13")]
pub fn OH_Drawing_FontArgumentsDestroy(
fontArguments: *mut OH_Drawing_FontArguments,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-23")]
pub fn OH_Drawing_TypefaceIsBold(
typeface: *const OH_Drawing_Typeface,
isBold: *mut bool,
) -> OH_Drawing_ErrorCode;
}
extern "C" {
#[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"]
#[cfg(feature = "api-23")]
pub fn OH_Drawing_TypefaceIsItalic(
typeface: *const OH_Drawing_Typeface,
isItalic: *mut bool,
) -> OH_Drawing_ErrorCode;
}