diff --git a/.rustfmt.toml b/.rustfmt.toml new file mode 100644 index 0000000..9cc7fa4 --- /dev/null +++ b/.rustfmt.toml @@ -0,0 +1,3 @@ +# unstable_features = true +# normalize_comments = true +# normalize_doc_attributes = true diff --git a/CHANGELOG.md b/CHANGELOG.md index 48df8df..36abcb5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# v0.5.0 + +## Breaking + +- Remove `Debug` from opaque structs + # v0.4.0 (2024-10-29) ## Change diff --git a/Cargo.toml b/Cargo.toml index 80fb1ea..890c0df 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,6 @@ description = "Bindings to the native API of OpenHarmony OS" license = "Apache-2.0" repository = "https://github.com/openharmony-rs/ohos-sys" keywords = ["OpenHarmony", "HarmonyOS", "ffi"] -exclude = ["src/**/*_api11.rs", "src/**/*_api12.rs"] readme = "Readme.md" resolver = "2" rust-version = "1.78.0" diff --git a/components/arkui/CHANGELOG.md b/components/arkui/CHANGELOG.md new file mode 100644 index 0000000..cc94bfd --- /dev/null +++ b/components/arkui/CHANGELOG.md @@ -0,0 +1,6 @@ +## 0.2.0 + +### Breaking + +- `ArkUI_NumberValue` is now a native Rust union instead of a bindgen union type. + diff --git a/components/arkui/Cargo.toml b/components/arkui/Cargo.toml index 7f4e528..09c7bdd 100644 --- a/components/arkui/Cargo.toml +++ b/components/arkui/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "arkui-sys" -version = "0.1.0" +version = "0.2.0" edition = "2021" description = "Bindings to the native ArkUI API of OpenHarmony" license = "Apache-2.0" diff --git a/components/arkui/src/native_gesture.rs b/components/arkui/src/native_gesture.rs index 80f0c5f..8e77e26 100644 --- a/components/arkui/src/native_gesture.rs +++ b/components/arkui/src/native_gesture.rs @@ -1,2 +1,2 @@ -mod native_gesture_api12; -pub use native_gesture_api12::*; +mod native_gesture_ffi; +pub use native_gesture_ffi::*; diff --git a/components/arkui/src/native_gesture/native_gesture_api12.rs b/components/arkui/src/native_gesture/native_gesture_ffi.rs similarity index 86% rename from components/arkui/src/native_gesture/native_gesture_api12.rs rename to components/arkui/src/native_gesture/native_gesture_ffi.rs index 908ec5d..a9997d0 100644 --- a/components/arkui/src/native_gesture/native_gesture_api12.rs +++ b/components/arkui/src/native_gesture/native_gesture_ffi.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.70.1 */ +/* automatically generated by rust-bindgen 0.71.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] @@ -18,21 +18,29 @@ pub struct ArkUI_GestureInterruptInfo { pub struct ArkUI_GestureEvent { _unused: [u8; 0], } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_GestureEventActionType { /// Triggered. pub const GESTURE_EVENT_ACTION_ACCEPT: ArkUI_GestureEventActionType = ArkUI_GestureEventActionType(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_GestureEventActionType { /// Updated. pub const GESTURE_EVENT_ACTION_UPDATE: ArkUI_GestureEventActionType = ArkUI_GestureEventActionType(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_GestureEventActionType { /// Ended. pub const GESTURE_EVENT_ACTION_END: ArkUI_GestureEventActionType = ArkUI_GestureEventActionType(4); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_GestureEventActionType { /// Canceled. pub const GESTURE_EVENT_ACTION_CANCEL: ArkUI_GestureEventActionType = @@ -42,6 +50,8 @@ impl ArkUI_GestureEventActionType { /** @brief Enumerates gesture event types. @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] #[derive(Clone, Hash, PartialEq, Eq)] pub struct ArkUI_GestureEventActionType(pub ::core::ffi::c_uint); /** @brief Defines a set of gesture event types. @@ -49,15 +59,23 @@ pub struct ArkUI_GestureEventActionType(pub ::core::ffi::c_uint); Example: ArkUI_GestureEventActionTypeMask actions = GESTURE_EVENT_ACTION_ACCEPT | GESTURE_EVENT_ACTION_UPDATE;\n @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub type ArkUI_GestureEventActionTypeMask = u32; +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_GesturePriority { /// Normal. pub const NORMAL: ArkUI_GesturePriority = ArkUI_GesturePriority(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_GesturePriority { /// High-priority. pub const PRIORITY: ArkUI_GesturePriority = ArkUI_GesturePriority(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_GesturePriority { /// Parallel. pub const PARALLEL: ArkUI_GesturePriority = ArkUI_GesturePriority(2); @@ -66,16 +84,24 @@ impl ArkUI_GesturePriority { /** @brief Enumerates gesture event modes. @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] #[derive(Clone, Hash, PartialEq, Eq)] pub struct ArkUI_GesturePriority(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_GroupGestureMode { pub const SEQUENTIAL_GROUP: ArkUI_GroupGestureMode = ArkUI_GroupGestureMode(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_GroupGestureMode { /** Parallel recognition. Registered gestures are recognized concurrently until all gestures are recognized. The recognition result of each gesture does not affect each other.*/ pub const PARALLEL_GROUP: ArkUI_GroupGestureMode = ArkUI_GroupGestureMode(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_GroupGestureMode { /** Exclusive recognition. Registered gestures are identified concurrently. If one gesture is successfully recognized, gesture recognition ends.*/ @@ -85,36 +111,54 @@ impl ArkUI_GroupGestureMode { /** @brief Enumerates gesture group modes. @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] #[derive(Clone, Hash, PartialEq, Eq)] pub struct ArkUI_GroupGestureMode(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_GestureDirection { /// All directions. pub const GESTURE_DIRECTION_ALL: ArkUI_GestureDirection = ArkUI_GestureDirection(15); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_GestureDirection { /// Horizontal direction. pub const GESTURE_DIRECTION_HORIZONTAL: ArkUI_GestureDirection = ArkUI_GestureDirection(3); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_GestureDirection { /// Vertical direction. pub const GESTURE_DIRECTION_VERTICAL: ArkUI_GestureDirection = ArkUI_GestureDirection(12); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_GestureDirection { /// Leftward. pub const GESTURE_DIRECTION_LEFT: ArkUI_GestureDirection = ArkUI_GestureDirection(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_GestureDirection { /// Rightward. pub const GESTURE_DIRECTION_RIGHT: ArkUI_GestureDirection = ArkUI_GestureDirection(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_GestureDirection { /// Upward. pub const GESTURE_DIRECTION_UP: ArkUI_GestureDirection = ArkUI_GestureDirection(4); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_GestureDirection { /// Downward. pub const GESTURE_DIRECTION_DOWN: ArkUI_GestureDirection = ArkUI_GestureDirection(8); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_GestureDirection { /// None. pub const GESTURE_DIRECTION_NONE: ArkUI_GestureDirection = ArkUI_GestureDirection(0); @@ -123,6 +167,8 @@ impl ArkUI_GestureDirection { /** @brief Enumerates gesture directions. @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] #[derive(Clone, Hash, PartialEq, Eq)] pub struct ArkUI_GestureDirection(pub ::core::ffi::c_uint); /** @brief Defines a set of gesture directions. @@ -131,11 +177,17 @@ Example: ArkUI_GestureDirectionMask directions = GESTURE_DIRECTION_LEFT | GESTUR This example indicates that the leftward and rightward directions are supported. \n @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub type ArkUI_GestureDirectionMask = u32; +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_GestureMask { /// The gestures of child components are enabled and recognized based on the default gesture recognition sequence. pub const NORMAL_GESTURE_MASK: ArkUI_GestureMask = ArkUI_GestureMask(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_GestureMask { /// The gestures of child components are disabled, including the built-in gestures. pub const IGNORE_INTERNAL_GESTURE_MASK: ArkUI_GestureMask = ArkUI_GestureMask(1); @@ -144,32 +196,48 @@ impl ArkUI_GestureMask { /** @brief Enumerates gesture masking modes. @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] #[derive(Clone, Hash, PartialEq, Eq)] pub struct ArkUI_GestureMask(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_GestureRecognizerType { /// Tap. pub const TAP_GESTURE: ArkUI_GestureRecognizerType = ArkUI_GestureRecognizerType(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_GestureRecognizerType { /// Long press. pub const LONG_PRESS_GESTURE: ArkUI_GestureRecognizerType = ArkUI_GestureRecognizerType(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_GestureRecognizerType { /// Pan. pub const PAN_GESTURE: ArkUI_GestureRecognizerType = ArkUI_GestureRecognizerType(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_GestureRecognizerType { /// Pinch. pub const PINCH_GESTURE: ArkUI_GestureRecognizerType = ArkUI_GestureRecognizerType(3); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_GestureRecognizerType { /// Rotate. pub const ROTATION_GESTURE: ArkUI_GestureRecognizerType = ArkUI_GestureRecognizerType(4); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_GestureRecognizerType { /// Swipe. pub const SWIPE_GESTURE: ArkUI_GestureRecognizerType = ArkUI_GestureRecognizerType(5); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_GestureRecognizerType { /// A group of gestures. pub const GROUP_GESTURE: ArkUI_GestureRecognizerType = ArkUI_GestureRecognizerType(6); @@ -178,13 +246,19 @@ impl ArkUI_GestureRecognizerType { /** @brief Enumerates gesture types. @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] #[derive(Clone, Hash, PartialEq, Eq)] pub struct ArkUI_GestureRecognizerType(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_GestureInterruptResult { /// The gesture recognition process continues. pub const GESTURE_INTERRUPT_RESULT_CONTINUE: ArkUI_GestureInterruptResult = ArkUI_GestureInterruptResult(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_GestureInterruptResult { /// The gesture recognition process is paused. pub const GESTURE_INTERRUPT_RESULT_REJECT: ArkUI_GestureInterruptResult = @@ -194,33 +268,47 @@ impl ArkUI_GestureInterruptResult { /** @brief Enumerates gesture interruption results. @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] #[derive(Clone, Hash, PartialEq, Eq)] pub struct ArkUI_GestureInterruptResult(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_GestureRecognizerState { /// Ready. pub const ARKUI_GESTURE_RECOGNIZER_STATE_READY: ArkUI_GestureRecognizerState = ArkUI_GestureRecognizerState(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_GestureRecognizerState { /// Detecting. pub const ARKUI_GESTURE_RECOGNIZER_STATE_DETECTING: ArkUI_GestureRecognizerState = ArkUI_GestureRecognizerState(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_GestureRecognizerState { /// Pending. pub const ARKUI_GESTURE_RECOGNIZER_STATE_PENDING: ArkUI_GestureRecognizerState = ArkUI_GestureRecognizerState(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_GestureRecognizerState { /// Blocked. pub const ARKUI_GESTURE_RECOGNIZER_STATE_BLOCKED: ArkUI_GestureRecognizerState = ArkUI_GestureRecognizerState(3); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_GestureRecognizerState { /// Successful. pub const ARKUI_GESTURE_RECOGNIZER_STATE_SUCCESSFUL: ArkUI_GestureRecognizerState = ArkUI_GestureRecognizerState(4); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_GestureRecognizerState { /// Failed. pub const ARKUI_GESTURE_RECOGNIZER_STATE_FAILED: ArkUI_GestureRecognizerState = @@ -230,15 +318,21 @@ impl ArkUI_GestureRecognizerState { /** @brief Enumerates the gesture recognizer states. @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] #[derive(Clone, Hash, PartialEq, Eq)] pub struct ArkUI_GestureRecognizerState(pub ::core::ffi::c_uint); /** @brief Defines the gesture recognizer handle. @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub type ArkUI_GestureRecognizerHandle = *mut ArkUI_GestureRecognizer; /** @brief Defines the gesture recognizer handle array. @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub type ArkUI_GestureRecognizerHandleArray = *mut ArkUI_GestureRecognizerHandle; #[repr(C)] pub struct ArkUI_GestureEventTargetInfo { @@ -250,6 +344,8 @@ pub struct ArkUI_ParallelInnerGestureEvent { } /** @brief Defines a callback function for notifying gesture recognizer destruction. @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub type ArkUI_GestureRecognizerDisposeNotifyCallback = ::core::option::Option< unsafe extern "C" fn( recognizer: *mut ArkUI_GestureRecognizer, @@ -259,6 +355,8 @@ pub type ArkUI_GestureRecognizerDisposeNotifyCallback = ::core::option::Option< /** @brief Defines the gesture APIs. @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] #[repr(C)] pub struct ArkUI_NativeGestureAPI_1 { /// The struct version is 1. @@ -550,6 +648,8 @@ extern "C" { @return Returns true if the gesture is a built-in gesture; returns false otherwise. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_GestureInterruptInfo_GetSystemFlag( event: *const ArkUI_GestureInterruptInfo, ) -> bool; @@ -558,6 +658,8 @@ extern "C" { @param event Indicates the pointer to the gesture interruption information. @return Returns the pointer to interrupted gesture recognizer. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_GestureInterruptInfo_GetRecognizer( event: *const ArkUI_GestureInterruptInfo, ) -> *mut ArkUI_GestureRecognizer; @@ -566,6 +668,8 @@ extern "C" { @param event Indicates the pointer to the gesture interruption information. @return Returns the pointer to the interrupted gesture event. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_GestureInterruptInfo_GetGestureEvent( event: *const ArkUI_GestureInterruptInfo, ) -> *mut ArkUI_GestureEvent; @@ -575,6 +679,8 @@ extern "C" { @return Returns the type of the system gesture to trigger. If the gesture to trigger is not a system gesture, -1 is returned. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_GestureInterruptInfo_GetSystemRecognizerType( event: *const ArkUI_GestureInterruptInfo, ) -> i32; @@ -583,6 +689,8 @@ extern "C" { @param event Indicates the pointer to the gesture event. @return Returns the gesture event type. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_GestureEvent_GetActionType( event: *const ArkUI_GestureEvent, ) -> ArkUI_GestureEventActionType; @@ -591,6 +699,8 @@ extern "C" { @param event Indicates the pointer to the gesture event. @return Returns the pointer to the input event of the gesture event. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_GestureEvent_GetRawInputEvent( event: *const ArkUI_GestureEvent, ) -> *const ArkUI_UIInputEvent; @@ -599,6 +709,8 @@ extern "C" { @param event Indicates the pointer to the gesture event. @return Returns the number of times that the long press gesture is triggered periodically. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_LongPress_GetRepeatCount(event: *const ArkUI_GestureEvent) -> i32; /** @brief Obtains the velocity of a pan gesture along the main axis. @@ -606,30 +718,40 @@ extern "C" { @return Returns the velocity of the pan gesture along the main axis, in px/s. The value is the square root of the sum of the squares of the velocity on the x-axis and y-axis. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_PanGesture_GetVelocity(event: *const ArkUI_GestureEvent) -> f32; /** @brief Obtains the velocity of a pan gesture along the x-axis. @param event Indicates the pointer to the gesture event. @return Returns the velocity of the pan gesture along the x-axis, in px/s. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_PanGesture_GetVelocityX(event: *const ArkUI_GestureEvent) -> f32; /** @brief Obtains the velocity of a pan gesture along the y-axis. @param event Indicates the pointer to the gesture event. @return Returns the velocity of the pan gesture along the y-axis, in px/s. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_PanGesture_GetVelocityY(event: *const ArkUI_GestureEvent) -> f32; /** @brief Obtains the relative offset of a pan gesture along the x-axis. @param event Indicates the pointer to the gesture event. @return Returns the relative offset of the gesture along the x-axis, in px. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_PanGesture_GetOffsetX(event: *const ArkUI_GestureEvent) -> f32; /** @brief Obtains the relative offset of a pan gesture along the y-axis. @param event Indicates the pointer to the gesture event. @return Returns the relative offset of the gesture along the y-axis, in px. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_PanGesture_GetOffsetY(event: *const ArkUI_GestureEvent) -> f32; /** @brief Obtains the angle information of the swipe gesture. @@ -644,24 +766,32 @@ extern "C" { @param event Indicates the pointer to the gesture event. @return Returns the angle of the swipe gesture, which is the result obtained based on the aforementioned formula. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_SwipeGesture_GetAngle(event: *const ArkUI_GestureEvent) -> f32; /** @brief Obtains the average velocity of all fingers used in the swipe gesture. @param event Indicates the pointer to the gesture event. @return Returns the average velocity of all fingers used in the swipe gesture, in px/s. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_SwipeGesture_GetVelocity(event: *const ArkUI_GestureEvent) -> f32; /** @brief Obtains the angle information of a rotation gesture. @param event Indicates the pointer to the gesture event. @return Returns the rotation angle. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_RotationGesture_GetAngle(event: *const ArkUI_GestureEvent) -> f32; /** @brief Obtains the scale ratio of a pinch gesture. @param event Indicates the pointer to the gesture event. @return Returns the scale ratio. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_PinchGesture_GetScale(event: *const ArkUI_GestureEvent) -> f32; /** @brief Obtains the X coordinate of the center of the pinch gesture, in vp, relative to the upper left corner of the current component. @@ -670,6 +800,8 @@ extern "C" { @return Returns the X coordinate of the center of the pinch gesture, in vp, relative to the upper left corner of the current component. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_PinchGesture_GetCenterX(event: *const ArkUI_GestureEvent) -> f32; /** @brief Obtains the Y coordinate of the center of the pinch gesture, in vp, relative to the upper left corner of the current component. @@ -678,6 +810,8 @@ extern "C" { @return Returns the Y coordinate of the center of the pinch gesture, in vp, relative to the upper left corner of the current component. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_PinchGesture_GetCenterY(event: *const ArkUI_GestureEvent) -> f32; /** @brief Obtains information about a gesture response chain. @@ -687,6 +821,8 @@ extern "C" { @return Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if success. Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_GetResponseRecognizersFromInterruptInfo( event: *const ArkUI_GestureInterruptInfo, responseChain: *mut ArkUI_GestureRecognizerHandleArray, @@ -699,6 +835,8 @@ extern "C" { @return Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if success. Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_SetGestureRecognizerEnabled( recognizer: *mut ArkUI_GestureRecognizer, enabled: bool, @@ -709,6 +847,8 @@ extern "C" { @return Returns true if the gesture recognizer is enabled. Returns false if the gesture recognizer is disabled. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_GetGestureRecognizerEnabled(recognizer: *mut ArkUI_GestureRecognizer) -> bool; /** @brief Obtains the state of a gesture recognizer. @@ -717,6 +857,8 @@ extern "C" { @return Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if success. Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_GetGestureRecognizerState( recognizer: *mut ArkUI_GestureRecognizer, state: *mut ArkUI_GestureRecognizerState, @@ -728,6 +870,8 @@ extern "C" { @return Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if success. Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_GetGestureEventTargetInfo( recognizer: *mut ArkUI_GestureRecognizer, info: *mut *mut ArkUI_GestureEventTargetInfo, @@ -740,6 +884,8 @@ extern "C" { Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. Returns {@link ARKUI_ERROR_CODE_NON_SCROLLABLE_CONTAINER} if the component is not a scroll container. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_GestureEventTargetInfo_IsScrollBegin( info: *mut ArkUI_GestureEventTargetInfo, ret: *mut bool, @@ -752,6 +898,8 @@ extern "C" { Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. Returns {@link ARKUI_ERROR_CODE_NON_SCROLLABLE_CONTAINER} if the component is not a scroll container. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_GestureEventTargetInfo_IsScrollEnd( info: *mut ArkUI_GestureEventTargetInfo, ret: *mut bool, @@ -763,6 +911,8 @@ extern "C" { @return Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if success. Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_GetPanGestureDirectionMask( recognizer: *mut ArkUI_GestureRecognizer, directionMask: *mut ArkUI_GestureDirectionMask, @@ -772,6 +922,8 @@ extern "C" { @param recognizer Indicates the pointer to a gesture recognizer. @return Returns true if the gesture is a built-in gesture; returns false otherwise. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_IsBuiltInGesture(recognizer: *mut ArkUI_GestureRecognizer) -> bool; /** @brief Obtains the tag of a gesture recognizer. @@ -783,6 +935,8 @@ extern "C" { Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. Returns {@link ARKUI_ERROR_CODE_BUFFER_SIZE_NOT_ENOUGH} if the buffer is not large enough. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_GetGestureTag( recognizer: *mut ArkUI_GestureRecognizer, buffer: *mut ::core::ffi::c_char, @@ -799,6 +953,8 @@ extern "C" { Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. Returns {@link ARKUI_ERROR_CODE_BUFFER_SIZE_NOT_ENOUGH} if the buffer is not large enough. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_GetGestureBindNodeId( recognizer: *mut ArkUI_GestureRecognizer, nodeId: *mut ::core::ffi::c_char, @@ -811,12 +967,16 @@ extern "C" { @return Returns true if the gesture recognizer is valid. Returns false if the gesture recognizer is invalid. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_IsGestureRecognizerValid(recognizer: *mut ArkUI_GestureRecognizer) -> bool; /** @brief Obtains custom data in the parallel internal gesture event. @param event Indicates the pointer to a parallel internal gesture event. @return Returns the pointer to custom data. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_ParallelInnerGestureEvent_GetUserData( event: *mut ArkUI_ParallelInnerGestureEvent, ) -> *mut ::core::ffi::c_void; @@ -825,6 +985,8 @@ extern "C" { @param event Indicates the pointer to a parallel internal gesture event. @return Returns the pointer to the current gesture recognizer. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_ParallelInnerGestureEvent_GetCurrentRecognizer( event: *mut ArkUI_ParallelInnerGestureEvent, ) -> *mut ArkUI_GestureRecognizer; @@ -836,6 +998,8 @@ extern "C" { @return Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if success. Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_ParallelInnerGestureEvent_GetConflictRecognizers( event: *mut ArkUI_ParallelInnerGestureEvent, array: *mut ArkUI_GestureRecognizerHandleArray, diff --git a/components/arkui/src/native_type.rs b/components/arkui/src/native_type.rs index 5406df4..e33a0b3 100644 --- a/components/arkui/src/native_type.rs +++ b/components/arkui/src/native_type.rs @@ -1,2 +1,2 @@ -mod native_type_api12; -pub use native_type_api12::*; +mod native_type_ffi; +pub use native_type_ffi::*; diff --git a/components/arkui/src/native_type/native_type_api12.rs b/components/arkui/src/native_type/native_type_ffi.rs similarity index 73% rename from components/arkui/src/native_type/native_type_api12.rs rename to components/arkui/src/native_type/native_type_ffi.rs index ccef7d4..6a3b472 100644 --- a/components/arkui/src/native_type/native_type_api12.rs +++ b/components/arkui/src/native_type/native_type_ffi.rs @@ -1,55 +1,14 @@ -/* automatically generated by rust-bindgen 0.70.1 */ +/* automatically generated by rust-bindgen 0.71.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -#[repr(C)] -pub struct __BindgenUnionField(::core::marker::PhantomData); -impl __BindgenUnionField { - #[inline] - pub const fn new() -> Self { - __BindgenUnionField(::core::marker::PhantomData) - } - #[inline] - pub unsafe fn as_ref(&self) -> &T { - ::core::mem::transmute(self) - } - #[inline] - pub unsafe fn as_mut(&mut self) -> &mut T { - ::core::mem::transmute(self) - } -} -impl ::core::default::Default for __BindgenUnionField { - #[inline] - fn default() -> Self { - Self::new() - } -} -impl ::core::clone::Clone for __BindgenUnionField { - #[inline] - fn clone(&self) -> Self { - *self - } -} -impl ::core::marker::Copy for __BindgenUnionField {} -impl ::core::fmt::Debug for __BindgenUnionField { - fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - fmt.write_str("__BindgenUnionField") - } -} -impl ::core::hash::Hash for __BindgenUnionField { - fn hash(&self, _state: &mut H) {} -} -impl ::core::cmp::PartialEq for __BindgenUnionField { - fn eq(&self, _other: &__BindgenUnionField) -> bool { - true - } -} -impl ::core::cmp::Eq for __BindgenUnionField {} /** @brief Defines the ArkUI native component object. @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] #[repr(C)] pub struct ArkUI_Node { _unused: [u8; 0], @@ -61,10 +20,14 @@ pub struct ArkUI_NodeContent { /** @brief Defines the pointer type of the ArkUI node content @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub type ArkUI_NodeContentHandle = *mut ArkUI_NodeContent; /** @brief Defines the custom dialog box controller of ArkUI on the native side. @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] #[repr(C)] pub struct ArkUI_NativeDialog { _unused: [u8; 0], @@ -80,10 +43,14 @@ pub struct ArkUI_DrawContext { /** @brief Defines the pointer to the ArkUI native component object. @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub type ArkUI_NodeHandle = *mut ArkUI_Node; /** @brief Defines the pointer to the custom dialog box controller of ArkUI on the native side. @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub type ArkUI_NativeDialogHandle = *mut ArkUI_NativeDialog; #[repr(C)] pub struct ArkUI_WaterFlowSectionOption { @@ -100,6 +67,8 @@ pub struct ArkUI_ListItemSwipeActionOption { /** @brief Defines the ArkUI native context object. @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] #[repr(C)] pub struct ArkUI_Context { _unused: [u8; 0], @@ -107,6 +76,8 @@ pub struct ArkUI_Context { /** @brief Defines the pointer to the context instance object pointer definition of ArkUI on the native side. @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub type ArkUI_ContextHandle = *mut ArkUI_Context; #[repr(C)] pub struct ArkUI_SwiperIndicator { @@ -143,6 +114,8 @@ pub struct ArkUI_AccessibilityValue { /** @brief Defines the event callback type. @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] #[repr(C)] pub struct ArkUI_ContextCallback { /// Custom type. @@ -153,48 +126,68 @@ pub struct ArkUI_ContextCallback { /** @brief Provides the number types of ArkUI in the native code. @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] #[repr(C)] -pub struct ArkUI_NumberValue { +#[derive(Copy, Clone)] +pub union ArkUI_NumberValue { /// Floating-point type. - pub f32_: __BindgenUnionField, + pub f32_: f32, /// Signed integer. - pub i32_: __BindgenUnionField, + pub i32_: i32, /// Unsigned integer. - pub u32_: __BindgenUnionField, - pub bindgen_union_field: u32, + pub u32_: u32, } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_Alignment { /// Top start. pub const ARKUI_ALIGNMENT_TOP_START: ArkUI_Alignment = ArkUI_Alignment(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_Alignment { /// Top center. pub const ARKUI_ALIGNMENT_TOP: ArkUI_Alignment = ArkUI_Alignment(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_Alignment { /// Top end. pub const ARKUI_ALIGNMENT_TOP_END: ArkUI_Alignment = ArkUI_Alignment(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_Alignment { /// Vertically centered start. pub const ARKUI_ALIGNMENT_START: ArkUI_Alignment = ArkUI_Alignment(3); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_Alignment { /// Horizontally and vertically centered. pub const ARKUI_ALIGNMENT_CENTER: ArkUI_Alignment = ArkUI_Alignment(4); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_Alignment { /// Vertically centered end. pub const ARKUI_ALIGNMENT_END: ArkUI_Alignment = ArkUI_Alignment(5); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_Alignment { /// Bottom start. pub const ARKUI_ALIGNMENT_BOTTOM_START: ArkUI_Alignment = ArkUI_Alignment(6); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_Alignment { /// Horizontally centered on the bottom. pub const ARKUI_ALIGNMENT_BOTTOM: ArkUI_Alignment = ArkUI_Alignment(7); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_Alignment { /// Bottom end. pub const ARKUI_ALIGNMENT_BOTTOM_END: ArkUI_Alignment = ArkUI_Alignment(8); @@ -203,20 +196,30 @@ impl ArkUI_Alignment { /** @brief Enumerates the alignment modes. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_Alignment(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ImageRepeat { /// The image is not repeatedly drawn. pub const ARKUI_IMAGE_REPEAT_NONE: ArkUI_ImageRepeat = ArkUI_ImageRepeat(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ImageRepeat { /// The image is repeatedly drawn only along the x-axis. pub const ARKUI_IMAGE_REPEAT_X: ArkUI_ImageRepeat = ArkUI_ImageRepeat(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ImageRepeat { /// The image is repeatedly drawn only along the y-axis. pub const ARKUI_IMAGE_REPEAT_Y: ArkUI_ImageRepeat = ArkUI_ImageRepeat(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ImageRepeat { /// The image is repeatedly drawn along both axes. pub const ARKUI_IMAGE_REPEAT_XY: ArkUI_ImageRepeat = ArkUI_ImageRepeat(3); @@ -225,12 +228,18 @@ impl ArkUI_ImageRepeat { /** @brief Enumerates the image repeat patterns. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_ImageRepeat(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_FontStyle { /// Standard font style. pub const ARKUI_FONT_STYLE_NORMAL: ArkUI_FontStyle = ArkUI_FontStyle(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_FontStyle { /// Italic font style. pub const ARKUI_FONT_STYLE_ITALIC: ArkUI_FontStyle = ArkUI_FontStyle(1); @@ -239,64 +248,96 @@ impl ArkUI_FontStyle { /** @brief Enumerates the font styles. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_FontStyle(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_FontWeight { /// 100 pub const ARKUI_FONT_WEIGHT_W100: ArkUI_FontWeight = ArkUI_FontWeight(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_FontWeight { /// 200 pub const ARKUI_FONT_WEIGHT_W200: ArkUI_FontWeight = ArkUI_FontWeight(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_FontWeight { /// 300 pub const ARKUI_FONT_WEIGHT_W300: ArkUI_FontWeight = ArkUI_FontWeight(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_FontWeight { /// 400 pub const ARKUI_FONT_WEIGHT_W400: ArkUI_FontWeight = ArkUI_FontWeight(3); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_FontWeight { /// 500 pub const ARKUI_FONT_WEIGHT_W500: ArkUI_FontWeight = ArkUI_FontWeight(4); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_FontWeight { /// 600 pub const ARKUI_FONT_WEIGHT_W600: ArkUI_FontWeight = ArkUI_FontWeight(5); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_FontWeight { /// 700 pub const ARKUI_FONT_WEIGHT_W700: ArkUI_FontWeight = ArkUI_FontWeight(6); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_FontWeight { /// 800 pub const ARKUI_FONT_WEIGHT_W800: ArkUI_FontWeight = ArkUI_FontWeight(7); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_FontWeight { /// 900 pub const ARKUI_FONT_WEIGHT_W900: ArkUI_FontWeight = ArkUI_FontWeight(8); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_FontWeight { /// The font weight is bold. pub const ARKUI_FONT_WEIGHT_BOLD: ArkUI_FontWeight = ArkUI_FontWeight(9); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_FontWeight { /// The font weight is normal. pub const ARKUI_FONT_WEIGHT_NORMAL: ArkUI_FontWeight = ArkUI_FontWeight(10); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_FontWeight { /// The font weight is bolder. pub const ARKUI_FONT_WEIGHT_BOLDER: ArkUI_FontWeight = ArkUI_FontWeight(11); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_FontWeight { /// The font weight is lighter. pub const ARKUI_FONT_WEIGHT_LIGHTER: ArkUI_FontWeight = ArkUI_FontWeight(12); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_FontWeight { /// The font weight is medium. pub const ARKUI_FONT_WEIGHT_MEDIUM: ArkUI_FontWeight = ArkUI_FontWeight(13); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_FontWeight { /// The font weight is normal. pub const ARKUI_FONT_WEIGHT_REGULAR: ArkUI_FontWeight = ArkUI_FontWeight(14); @@ -305,20 +346,30 @@ impl ArkUI_FontWeight { /** @brief Enumerates the font weights. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_FontWeight(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextAlignment { /// Aligned with the start. pub const ARKUI_TEXT_ALIGNMENT_START: ArkUI_TextAlignment = ArkUI_TextAlignment(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextAlignment { /// Horizontally centered. pub const ARKUI_TEXT_ALIGNMENT_CENTER: ArkUI_TextAlignment = ArkUI_TextAlignment(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextAlignment { /// Aligned with the end. pub const ARKUI_TEXT_ALIGNMENT_END: ArkUI_TextAlignment = ArkUI_TextAlignment(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextAlignment { /// Aligned with both margins. pub const ARKUI_TEXT_ALIGNMENT_JUSTIFY: ArkUI_TextAlignment = ArkUI_TextAlignment(3); @@ -327,32 +378,48 @@ impl ArkUI_TextAlignment { /** @brief Enumerates the text alignment mode. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_TextAlignment(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_EnterKeyType { /// The Enter key is labeled "Go." pub const ARKUI_ENTER_KEY_TYPE_GO: ArkUI_EnterKeyType = ArkUI_EnterKeyType(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_EnterKeyType { /// The Enter key is labeled "Search." pub const ARKUI_ENTER_KEY_TYPE_SEARCH: ArkUI_EnterKeyType = ArkUI_EnterKeyType(3); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_EnterKeyType { /// The Enter key is labeled "Send." pub const ARKUI_ENTER_KEY_TYPE_SEND: ArkUI_EnterKeyType = ArkUI_EnterKeyType(4); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_EnterKeyType { /// The Enter key is labeled "Next." pub const ARKUI_ENTER_KEY_TYPE_NEXT: ArkUI_EnterKeyType = ArkUI_EnterKeyType(5); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_EnterKeyType { /// The Enter key is labeled "Done." pub const ARKUI_ENTER_KEY_TYPE_DONE: ArkUI_EnterKeyType = ArkUI_EnterKeyType(6); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_EnterKeyType { /// The Enter key is labeled "Previous." pub const ARKUI_ENTER_KEY_TYPE_PREVIOUS: ArkUI_EnterKeyType = ArkUI_EnterKeyType(7); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_EnterKeyType { /// The Enter key is labeled "New Line." pub const ARKUI_ENTER_KEY_TYPE_NEW_LINE: ArkUI_EnterKeyType = ArkUI_EnterKeyType(8); @@ -361,45 +428,67 @@ impl ArkUI_EnterKeyType { /** @brief Enumerates the types of the Enter key for a single-line text box. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_EnterKeyType(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextInputType { /// Normal input mode. pub const ARKUI_TEXTINPUT_TYPE_NORMAL: ArkUI_TextInputType = ArkUI_TextInputType(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextInputType { /// Number input mode. pub const ARKUI_TEXTINPUT_TYPE_NUMBER: ArkUI_TextInputType = ArkUI_TextInputType(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextInputType { /// Phone number input mode. pub const ARKUI_TEXTINPUT_TYPE_PHONE_NUMBER: ArkUI_TextInputType = ArkUI_TextInputType(3); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextInputType { /// Email address input mode. pub const ARKUI_TEXTINPUT_TYPE_EMAIL: ArkUI_TextInputType = ArkUI_TextInputType(5); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextInputType { /// Password input mode. pub const ARKUI_TEXTINPUT_TYPE_PASSWORD: ArkUI_TextInputType = ArkUI_TextInputType(7); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextInputType { /// Numeric password input mode. pub const ARKUI_TEXTINPUT_TYPE_NUMBER_PASSWORD: ArkUI_TextInputType = ArkUI_TextInputType(8); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextInputType { /// Lock screen password input mode. pub const ARKUI_TEXTINPUT_TYPE_SCREEN_LOCK_PASSWORD: ArkUI_TextInputType = ArkUI_TextInputType(9); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextInputType { /// Username input mode. pub const ARKUI_TEXTINPUT_TYPE_USER_NAME: ArkUI_TextInputType = ArkUI_TextInputType(10); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextInputType { /// New password input mode. pub const ARKUI_TEXTINPUT_TYPE_NEW_PASSWORD: ArkUI_TextInputType = ArkUI_TextInputType(11); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextInputType { /// Number input mode with a decimal point. pub const ARKUI_TEXTINPUT_TYPE_NUMBER_DECIMAL: ArkUI_TextInputType = ArkUI_TextInputType(12); @@ -408,20 +497,30 @@ impl ArkUI_TextInputType { /** @brief Enumerates the text input types. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_TextInputType(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextAreaType { /// Normal input mode. pub const ARKUI_TEXTAREA_TYPE_NORMAL: ArkUI_TextAreaType = ArkUI_TextAreaType(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextAreaType { /// Number input mode. pub const ARKUI_TEXTAREA_TYPE_NUMBER: ArkUI_TextAreaType = ArkUI_TextAreaType(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextAreaType { /// Phone number input mode. pub const ARKUI_TEXTAREA_TYPE_PHONE_NUMBER: ArkUI_TextAreaType = ArkUI_TextAreaType(3); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextAreaType { /// Email address input mode. pub const ARKUI_TEXTAREA_TYPE_EMAIL: ArkUI_TextAreaType = ArkUI_TextAreaType(5); @@ -430,18 +529,26 @@ impl ArkUI_TextAreaType { /** @brief Enumerates the text box types. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_TextAreaType(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_CancelButtonStyle { /// The Cancel button is always displayed. pub const ARKUI_CANCELBUTTON_STYLE_CONSTANT: ArkUI_CancelButtonStyle = ArkUI_CancelButtonStyle(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_CancelButtonStyle { /// The Cancel button is always hidden. pub const ARKUI_CANCELBUTTON_STYLE_INVISIBLE: ArkUI_CancelButtonStyle = ArkUI_CancelButtonStyle(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_CancelButtonStyle { /// The Cancel button is displayed when there is text input. pub const ARKUI_CANCELBUTTON_STYLE_INPUT: ArkUI_CancelButtonStyle = ArkUI_CancelButtonStyle(2); @@ -450,12 +557,18 @@ impl ArkUI_CancelButtonStyle { /** @brief Enumerates the styles of the Cancel button. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_CancelButtonStyle(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_XComponentType { /// The custom content of EGL/OpenGL ES and media data is displayed individually on the screen. pub const ARKUI_XCOMPONENT_TYPE_SURFACE: ArkUI_XComponentType = ArkUI_XComponentType(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_XComponentType { /** The custom content of EGL/OpenGL ES and media data is grouped and displayed together with content of the component.*/ @@ -465,24 +578,36 @@ impl ArkUI_XComponentType { /** @brief Enumerates the types of the component. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_XComponentType(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ProgressType { /// Linear style. pub const ARKUI_PROGRESS_TYPE_LINEAR: ArkUI_ProgressType = ArkUI_ProgressType(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ProgressType { /// Indeterminate ring style. pub const ARKUI_PROGRESS_TYPE_RING: ArkUI_ProgressType = ArkUI_ProgressType(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ProgressType { /// Eclipse style. pub const ARKUI_PROGRESS_TYPE_ECLIPSE: ArkUI_ProgressType = ArkUI_ProgressType(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ProgressType { /// Determinate ring style. pub const ARKUI_PROGRESS_TYPE_SCALE_RING: ArkUI_ProgressType = ArkUI_ProgressType(3); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ProgressType { /// Capsule style. pub const ARKUI_PROGRESS_TYPE_CAPSULE: ArkUI_ProgressType = ArkUI_ProgressType(4); @@ -491,23 +616,33 @@ impl ArkUI_ProgressType { /** @brief Enumerates the styles of the progress indicator. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_ProgressType(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextDecorationType { /// No text decoration. pub const ARKUI_TEXT_DECORATION_TYPE_NONE: ArkUI_TextDecorationType = ArkUI_TextDecorationType(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextDecorationType { /// Line under the text. pub const ARKUI_TEXT_DECORATION_TYPE_UNDERLINE: ArkUI_TextDecorationType = ArkUI_TextDecorationType(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextDecorationType { /// Line over the text. pub const ARKUI_TEXT_DECORATION_TYPE_OVERLINE: ArkUI_TextDecorationType = ArkUI_TextDecorationType(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextDecorationType { /// Line through the text. pub const ARKUI_TEXT_DECORATION_TYPE_LINE_THROUGH: ArkUI_TextDecorationType = @@ -517,28 +652,40 @@ impl ArkUI_TextDecorationType { /** @brief Enumerates the text decoration types. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_TextDecorationType(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextDecorationStyle { /// Single solid line. pub const ARKUI_TEXT_DECORATION_STYLE_SOLID: ArkUI_TextDecorationStyle = ArkUI_TextDecorationStyle(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextDecorationStyle { /// Double solid line. pub const ARKUI_TEXT_DECORATION_STYLE_DOUBLE: ArkUI_TextDecorationStyle = ArkUI_TextDecorationStyle(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextDecorationStyle { /// Dotted line. pub const ARKUI_TEXT_DECORATION_STYLE_DOTTED: ArkUI_TextDecorationStyle = ArkUI_TextDecorationStyle(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextDecorationStyle { /// Dashed line. pub const ARKUI_TEXT_DECORATION_STYLE_DASHED: ArkUI_TextDecorationStyle = ArkUI_TextDecorationStyle(3); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextDecorationStyle { /// Wavy line. pub const ARKUI_TEXT_DECORATION_STYLE_WAVY: ArkUI_TextDecorationStyle = @@ -548,16 +695,24 @@ impl ArkUI_TextDecorationStyle { /** @brief Enumerates the text decoration styles. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_TextDecorationStyle(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextCase { /// The original case of the text is retained. pub const ARKUI_TEXT_CASE_NORMAL: ArkUI_TextCase = ArkUI_TextCase(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextCase { /// All letters in the text are in lowercase. pub const ARKUI_TEXT_CASE_LOWER: ArkUI_TextCase = ArkUI_TextCase(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextCase { /// All letters in the text are in uppercase. pub const ARKUI_TEXT_CASE_UPPER: ArkUI_TextCase = ArkUI_TextCase(2); @@ -566,20 +721,30 @@ impl ArkUI_TextCase { /** @brief Enumerates the text cases. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_TextCase(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_CopyOptions { /// Copy is not allowed. pub const ARKUI_COPY_OPTIONS_NONE: ArkUI_CopyOptions = ArkUI_CopyOptions(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_CopyOptions { /// Intra-application copy is allowed. pub const ARKUI_COPY_OPTIONS_IN_APP: ArkUI_CopyOptions = ArkUI_CopyOptions(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_CopyOptions { /// Intra-device copy is allowed. pub const ARKUI_COPY_OPTIONS_LOCAL_DEVICE: ArkUI_CopyOptions = ArkUI_CopyOptions(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_CopyOptions { /// Cross-device copy is allowed. pub const ARKUI_COPY_OPTIONS_CROSS_DEVICE: ArkUI_CopyOptions = ArkUI_CopyOptions(3); @@ -588,12 +753,18 @@ impl ArkUI_CopyOptions { /** @brief Enumerates the text copy and paste modes. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_CopyOptions(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ShadowType { /// Color. pub const ARKUI_SHADOW_TYPE_COLOR: ArkUI_ShadowType = ArkUI_ShadowType(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ShadowType { /// Blur. pub const ARKUI_SHADOW_TYPE_BLUR: ArkUI_ShadowType = ArkUI_ShadowType(1); @@ -602,23 +773,33 @@ impl ArkUI_ShadowType { /** @brief Enumerates the shadow types. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_ShadowType(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextPickerRangeType { /// Single-column text picker. pub const ARKUI_TEXTPICKER_RANGETYPE_SINGLE: ArkUI_TextPickerRangeType = ArkUI_TextPickerRangeType(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextPickerRangeType { /// Multi-column text picker. pub const ARKUI_TEXTPICKER_RANGETYPE_MULTI: ArkUI_TextPickerRangeType = ArkUI_TextPickerRangeType(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextPickerRangeType { /// Single-column text picker with image resources. pub const ARKUI_TEXTPICKER_RANGETYPE_RANGE_CONTENT: ArkUI_TextPickerRangeType = ArkUI_TextPickerRangeType(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextPickerRangeType { /// Interconnected multi-column text picker. pub const ARKUI_TEXTPICKER_RANGETYPE_CASCADE_RANGE_CONTENT: ArkUI_TextPickerRangeType = @@ -628,11 +809,15 @@ impl ArkUI_TextPickerRangeType { /** @brief Enumerates the types of the text picker. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_TextPickerRangeType(pub ::core::ffi::c_uint); /** @brief Defines the input structure of the single-column text picker with image resources. @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] #[repr(C)] pub struct ARKUI_TextPickerRangeContent { /// Image resource. @@ -643,6 +828,8 @@ pub struct ARKUI_TextPickerRangeContent { /** @brief Defines the input structure of the interconnected multi-column text picker. @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] #[repr(C)] pub struct ARKUI_TextPickerCascadeRangeContent { /// Text information. @@ -652,15 +839,21 @@ pub struct ARKUI_TextPickerCascadeRangeContent { /// Size of the interconnected data array. pub size: i32, } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_EdgeEffect { /** Spring effect. When at one of the edges, the component can move beyond the bounds based on the initial speed or through touches, and produces a bounce effect when the user releases their finger.*/ pub const ARKUI_EDGE_EFFECT_SPRING: ArkUI_EdgeEffect = ArkUI_EdgeEffect(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_EdgeEffect { /// Fade effect. When at one of the edges, the component produces a fade effect. pub const ARKUI_EDGE_EFFECT_FADE: ArkUI_EdgeEffect = ArkUI_EdgeEffect(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_EdgeEffect { /// No effect after the scrollbar is moved to the edge. pub const ARKUI_EDGE_EFFECT_NONE: ArkUI_EdgeEffect = ArkUI_EdgeEffect(2); @@ -670,16 +863,24 @@ impl ArkUI_EdgeEffect { reached. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_EdgeEffect(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ScrollDirection { /// Only vertical scrolling is supported. pub const ARKUI_SCROLL_DIRECTION_VERTICAL: ArkUI_ScrollDirection = ArkUI_ScrollDirection(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ScrollDirection { /// Only horizontal scrolling is supported. pub const ARKUI_SCROLL_DIRECTION_HORIZONTAL: ArkUI_ScrollDirection = ArkUI_ScrollDirection(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ScrollDirection { /// Scrolling is not allowed. pub const ARKUI_SCROLL_DIRECTION_NONE: ArkUI_ScrollDirection = ArkUI_ScrollDirection(3); @@ -688,20 +889,30 @@ impl ArkUI_ScrollDirection { /** @brief Enumerates the scroll directions for the component. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_ScrollDirection(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ScrollSnapAlign { /// No alignment. This is the default value. pub const ARKUI_SCROLL_SNAP_ALIGN_NONE: ArkUI_ScrollSnapAlign = ArkUI_ScrollSnapAlign(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ScrollSnapAlign { /// The first item in the view is aligned at the start of the list. pub const ARKUI_SCROLL_SNAP_ALIGN_START: ArkUI_ScrollSnapAlign = ArkUI_ScrollSnapAlign(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ScrollSnapAlign { /// The middle items in the view are aligned in the center of the list. pub const ARKUI_SCROLL_SNAP_ALIGN_CENTER: ArkUI_ScrollSnapAlign = ArkUI_ScrollSnapAlign(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ScrollSnapAlign { /// The last item in the view is aligned at the end of the list. pub const ARKUI_SCROLL_SNAP_ALIGN_END: ArkUI_ScrollSnapAlign = ArkUI_ScrollSnapAlign(3); @@ -710,18 +921,26 @@ impl ArkUI_ScrollSnapAlign { /** @brief Enumerates the alignment modes of list items when scrolling ends. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_ScrollSnapAlign(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ScrollBarDisplayMode { /// Hide. pub const ARKUI_SCROLL_BAR_DISPLAY_MODE_OFF: ArkUI_ScrollBarDisplayMode = ArkUI_ScrollBarDisplayMode(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ScrollBarDisplayMode { /// Display on demand (displays when the screen is touched and disappears after 2s). pub const ARKUI_SCROLL_BAR_DISPLAY_MODE_AUTO: ArkUI_ScrollBarDisplayMode = ArkUI_ScrollBarDisplayMode(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ScrollBarDisplayMode { /// Always display. pub const ARKUI_SCROLL_BAR_DISPLAY_MODE_ON: ArkUI_ScrollBarDisplayMode = @@ -731,12 +950,18 @@ impl ArkUI_ScrollBarDisplayMode { /** @brief Enumerates the scrollbar display modes. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_ScrollBarDisplayMode(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_Axis { /// Only vertical scrolling is supported. pub const ARKUI_AXIS_VERTICAL: ArkUI_Axis = ArkUI_Axis(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_Axis { /// Only horizontal scrolling is supported. pub const ARKUI_AXIS_HORIZONTAL: ArkUI_Axis = ArkUI_Axis(1); @@ -745,20 +970,30 @@ impl ArkUI_Axis { /** @brief Enumerates the scroll directions for the component. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_Axis(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_StickyStyle { /// In the list item group, the header is not pinned to the top, and the footer is not pinned to the bottom. pub const ARKUI_STICKY_STYLE_NONE: ArkUI_StickyStyle = ArkUI_StickyStyle(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_StickyStyle { /// In the list item group, the header is pinned to the top, and the footer is not pinned to the bottom. pub const ARKUI_STICKY_STYLE_HEADER: ArkUI_StickyStyle = ArkUI_StickyStyle(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_StickyStyle { /// In the list item group, the footer is pinned to the bottom, and the header is not pinned to the top. pub const ARKUI_STICKY_STYLE_FOOTER: ArkUI_StickyStyle = ArkUI_StickyStyle(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_StickyStyle { /// In the list item group, the footer is pinned to the bottom, and the header is pinned to the top. pub const ARKUI_STICKY_STYLE_BOTH: ArkUI_StickyStyle = ArkUI_StickyStyle(3); @@ -767,16 +1002,24 @@ impl ArkUI_StickyStyle { /** @brief Enumerates the modes for pinning the header to the top or the footer to the bottom. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_StickyStyle(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BorderStyle { /// Solid border. pub const ARKUI_BORDER_STYLE_SOLID: ArkUI_BorderStyle = ArkUI_BorderStyle(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BorderStyle { /// Dashed border. pub const ARKUI_BORDER_STYLE_DASHED: ArkUI_BorderStyle = ArkUI_BorderStyle(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BorderStyle { /// Dotted border. pub const ARKUI_BORDER_STYLE_DOTTED: ArkUI_BorderStyle = ArkUI_BorderStyle(2); @@ -785,23 +1028,33 @@ impl ArkUI_BorderStyle { /** @brief Enumerates the border styles. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_BorderStyle(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_HitTestMode { /** Both the node and its child node respond to the hit test of a touch event, but its sibling node is blocked from the hit test.*/ pub const ARKUI_HIT_TEST_MODE_DEFAULT: ArkUI_HitTestMode = ArkUI_HitTestMode(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_HitTestMode { /** The node responds to the hit test of a touch event, but its child node and sibling node are blocked from the hit test.*/ pub const ARKUI_HIT_TEST_MODE_BLOCK: ArkUI_HitTestMode = ArkUI_HitTestMode(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_HitTestMode { /** Both the node and its child node respond to the hit test of a touch event, and its sibling node is also considered during the hit test.*/ pub const ARKUI_HIT_TEST_MODE_TRANSPARENT: ArkUI_HitTestMode = ArkUI_HitTestMode(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_HitTestMode { /// The node does not respond to the hit test of a touch event. pub const ARKUI_HIT_TEST_MODE_NONE: ArkUI_HitTestMode = ArkUI_HitTestMode(3); @@ -810,28 +1063,42 @@ impl ArkUI_HitTestMode { /** @brief Enumerates the hit test modes. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_HitTestMode(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ShadowStyle { /// Mini shadow. pub const ARKUI_SHADOW_STYLE_OUTER_DEFAULT_XS: ArkUI_ShadowStyle = ArkUI_ShadowStyle(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ShadowStyle { /// Little shadow. pub const ARKUI_SHADOW_STYLE_OUTER_DEFAULT_SM: ArkUI_ShadowStyle = ArkUI_ShadowStyle(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ShadowStyle { /// Medium shadow. pub const ARKUI_SHADOW_STYLE_OUTER_DEFAULT_MD: ArkUI_ShadowStyle = ArkUI_ShadowStyle(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ShadowStyle { /// Large shadow. pub const ARKUI_SHADOW_STYLE_OUTER_DEFAULT_LG: ArkUI_ShadowStyle = ArkUI_ShadowStyle(3); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ShadowStyle { /// Floating small shadow. pub const ARKUI_SHADOW_STYLE_OUTER_FLOATING_SM: ArkUI_ShadowStyle = ArkUI_ShadowStyle(4); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ShadowStyle { /// Floating medium shadow. pub const ARKUI_SHADOW_STYLE_OUTER_FLOATING_MD: ArkUI_ShadowStyle = ArkUI_ShadowStyle(5); @@ -840,56 +1107,84 @@ impl ArkUI_ShadowStyle { /** @brief Enumerates the shadow styles. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_ShadowStyle(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_AnimationCurve { /// The animation speed keeps unchanged. pub const ARKUI_CURVE_LINEAR: ArkUI_AnimationCurve = ArkUI_AnimationCurve(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_AnimationCurve { /// The animation starts slowly, accelerates, and then slows down towards the end. pub const ARKUI_CURVE_EASE: ArkUI_AnimationCurve = ArkUI_AnimationCurve(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_AnimationCurve { /// The animation starts at a low speed and then picks up speed until the end. pub const ARKUI_CURVE_EASE_IN: ArkUI_AnimationCurve = ArkUI_AnimationCurve(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_AnimationCurve { /// The animation ends at a low speed. pub const ARKUI_CURVE_EASE_OUT: ArkUI_AnimationCurve = ArkUI_AnimationCurve(3); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_AnimationCurve { /// The animation starts and ends at a low speed. pub const ARKUI_CURVE_EASE_IN_OUT: ArkUI_AnimationCurve = ArkUI_AnimationCurve(4); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_AnimationCurve { /// The animation uses the standard curve pub const ARKUI_CURVE_FAST_OUT_SLOW_IN: ArkUI_AnimationCurve = ArkUI_AnimationCurve(5); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_AnimationCurve { /// The animation uses the deceleration curve. pub const ARKUI_CURVE_LINEAR_OUT_SLOW_IN: ArkUI_AnimationCurve = ArkUI_AnimationCurve(6); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_AnimationCurve { /// The animation uses the acceleration curve. pub const ARKUI_CURVE_FAST_OUT_LINEAR_IN: ArkUI_AnimationCurve = ArkUI_AnimationCurve(7); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_AnimationCurve { /// The animation uses the extreme deceleration curve. pub const ARKUI_CURVE_EXTREME_DECELERATION: ArkUI_AnimationCurve = ArkUI_AnimationCurve(8); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_AnimationCurve { /// The animation uses the sharp curve. pub const ARKUI_CURVE_SHARP: ArkUI_AnimationCurve = ArkUI_AnimationCurve(9); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_AnimationCurve { /// The animation uses the rhythm curve. pub const ARKUI_CURVE_RHYTHM: ArkUI_AnimationCurve = ArkUI_AnimationCurve(10); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_AnimationCurve { /// The animation uses the smooth curve. pub const ARKUI_CURVE_SMOOTH: ArkUI_AnimationCurve = ArkUI_AnimationCurve(11); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_AnimationCurve { /// The animation uses the friction curve pub const ARKUI_CURVE_FRICTION: ArkUI_AnimationCurve = ArkUI_AnimationCurve(12); @@ -898,16 +1193,24 @@ impl ArkUI_AnimationCurve { /** @brief Enumerates the animation curves. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_AnimationCurve(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_SwiperArrow { /// The arrow is not displayed for the navigation point indicator. pub const ARKUI_SWIPER_ARROW_HIDE: ArkUI_SwiperArrow = ArkUI_SwiperArrow(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_SwiperArrow { /// The arrow is displayed for the navigation point indicator. pub const ARKUI_SWIPER_ARROW_SHOW: ArkUI_SwiperArrow = ArkUI_SwiperArrow(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_SwiperArrow { /// The arrow is displayed only when the mouse pointer hovers over the navigation point indicator. pub const ARKUI_SWIPER_ARROW_SHOW_ON_HOVER: ArkUI_SwiperArrow = ArkUI_SwiperArrow(2); @@ -916,13 +1219,19 @@ impl ArkUI_SwiperArrow { /** @brief Enumerates arrow styles of the navigation point indicator. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_SwiperArrow(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_SwiperNestedScrollMode { /// Swiper only scrolls on its own and is not linked to its parent component. pub const ARKUI_SWIPER_NESTED_SRCOLL_SELF_ONLY: ArkUI_SwiperNestedScrollMode = ArkUI_SwiperNestedScrollMode(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_SwiperNestedScrollMode { /** The Swiper itself scrolls first, and the parent component scrolls after it reaches the edge. After the parent component scrolls to the edge, if the parent component has an edge effect, the parent component triggers the edge @@ -934,22 +1243,32 @@ impl ArkUI_SwiperNestedScrollMode { /** @brief Nested scrolling mode for Swiper components and parent components. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_SwiperNestedScrollMode(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_AccessibilityMode { /// Whether the component can be identified by the accessibility service is dependent on the component. pub const ARKUI_ACCESSIBILITY_MODE_AUTO: ArkUI_AccessibilityMode = ArkUI_AccessibilityMode(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_AccessibilityMode { /// The component can be identified by the accessibility service. pub const ARKUI_ACCESSIBILITY_MODE_ENABLED: ArkUI_AccessibilityMode = ArkUI_AccessibilityMode(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_AccessibilityMode { /// The component cannot be identified by the accessibility service. pub const ARKUI_ACCESSIBILITY_MODE_DISABLED: ArkUI_AccessibilityMode = ArkUI_AccessibilityMode(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_AccessibilityMode { /// The component and all its child components cannot be identified by the accessibility service. pub const ARKUI_ACCESSIBILITY_MODE_DISABLED_FOR_DESCENDANTS: ArkUI_AccessibilityMode = @@ -959,21 +1278,31 @@ impl ArkUI_AccessibilityMode { /** @brief Enumerates the accessibility modes. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_AccessibilityMode(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextCopyOptions { /// Copy is not allowed. pub const ARKUI_TEXT_COPY_OPTIONS_NONE: ArkUI_TextCopyOptions = ArkUI_TextCopyOptions(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextCopyOptions { /// Intra-application copy is allowed. pub const ARKUI_TEXT_COPY_OPTIONS_IN_APP: ArkUI_TextCopyOptions = ArkUI_TextCopyOptions(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextCopyOptions { /// Intra-device copy is allowed. pub const ARKUI_TEXT_COPY_OPTIONS_LOCAL_DEVICE: ArkUI_TextCopyOptions = ArkUI_TextCopyOptions(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextCopyOptions { /// Cross-device copy is allowed. pub const ARKUI_TEXT_COPY_OPTIONS_CROSS_DEVICE: ArkUI_TextCopyOptions = @@ -983,18 +1312,26 @@ impl ArkUI_TextCopyOptions { /** @brief Defines whether copy and paste is allowed for text content. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_TextCopyOptions(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextHeightAdaptivePolicy { /// Prioritize the maxLines settings. pub const ARKUI_TEXT_HEIGHT_ADAPTIVE_POLICY_MAX_LINES_FIRST: ArkUI_TextHeightAdaptivePolicy = ArkUI_TextHeightAdaptivePolicy(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextHeightAdaptivePolicy { /// Prioritize the minFontSize settings. pub const ARKUI_TEXT_HEIGHT_ADAPTIVE_POLICY_MIN_FONT_SIZE_FIRST: ArkUI_TextHeightAdaptivePolicy = ArkUI_TextHeightAdaptivePolicy(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextHeightAdaptivePolicy { /// Prioritize the layout constraint settings in terms of height. pub const ARKUI_TEXT_HEIGHT_ADAPTIVE_POLICY_LAYOUT_CONSTRAINT_FIRST: @@ -1004,19 +1341,27 @@ impl ArkUI_TextHeightAdaptivePolicy { /** @brief Defines how the adaptive height is determined for the text. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_TextHeightAdaptivePolicy(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ScrollNestedMode { /** The scrolling is contained within the component, and no scroll chaining occurs, that is, the parent component does not scroll when the component scrolling reaches the boundary.*/ pub const ARKUI_SCROLL_NESTED_MODE_SELF_ONLY: ArkUI_ScrollNestedMode = ArkUI_ScrollNestedMode(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ScrollNestedMode { #[doc = " The component scrolls first, and when it hits the boundary, the parent component scrolls.\n/** When the parent component hits the boundary, its edge effect is displayed. If no edge\n effect is specified for the parent component, the edge effect of the child component is displayed instead."] pub const ARKUI_SCROLL_NESTED_MODE_SELF_FIRST: ArkUI_ScrollNestedMode = ArkUI_ScrollNestedMode(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ScrollNestedMode { /** The parent component scrolls first, and when it hits the boundary, the component scrolls. When the component hits the boundary, its edge effect is displayed. If no edge effect is specified for the @@ -1024,6 +1369,8 @@ impl ArkUI_ScrollNestedMode { pub const ARKUI_SCROLL_NESTED_MODE_PARENT_FIRST: ArkUI_ScrollNestedMode = ArkUI_ScrollNestedMode(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ScrollNestedMode { /** The component and its parent component scroll at the same time. When both the component and its parent component hit the boundary, the edge effect of the component is displayed. If no edge effect is specified for the @@ -1034,20 +1381,30 @@ impl ArkUI_ScrollNestedMode { /** @brief Defines nested scrolling options. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_ScrollNestedMode(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ScrollEdge { /// Top edge in the vertical direction. pub const ARKUI_SCROLL_EDGE_TOP: ArkUI_ScrollEdge = ArkUI_ScrollEdge(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ScrollEdge { /// Bottom edge in the vertical direction. pub const ARKUI_SCROLL_EDGE_BOTTOM: ArkUI_ScrollEdge = ArkUI_ScrollEdge(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ScrollEdge { /// Start position in the horizontal direction. pub const ARKUI_SCROLL_EDGE_START: ArkUI_ScrollEdge = ArkUI_ScrollEdge(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ScrollEdge { /// End position in the horizontal direction. pub const ARKUI_SCROLL_EDGE_END: ArkUI_ScrollEdge = ArkUI_ScrollEdge(3); @@ -1056,20 +1413,30 @@ impl ArkUI_ScrollEdge { /** @brief Defines the edge to which the component scrolls. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_ScrollEdge(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ScrollAlignment { /// Align the head. Align the head of the specified item with the head of the container. pub const ARKUI_SCROLL_ALIGNMENT_START: ArkUI_ScrollAlignment = ArkUI_ScrollAlignment(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ScrollAlignment { /// Center alignment. Align the axis direction of the specified item to the center of the container. pub const ARKUI_SCROLL_ALIGNMENT_CENTER: ArkUI_ScrollAlignment = ArkUI_ScrollAlignment(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ScrollAlignment { /// Tail alignment. Align the tail of the specified item with the tail of the container. pub const ARKUI_SCROLL_ALIGNMENT_END: ArkUI_ScrollAlignment = ArkUI_ScrollAlignment(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ScrollAlignment { /** Automatic alignment. If the specified item is completely in the display area, no adjustments will be made. Otherwise, according to the principle of the shortest sliding distance, align the head or tail of the specified @@ -1080,17 +1447,25 @@ impl ArkUI_ScrollAlignment { /** @brief Alignment when scrolling to specific items. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_ScrollAlignment(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ScrollState { /** Idle state. Trigger when using the method provided by the controller to control scrolling, and trigger when dragging the scroll bar to scroll.*/ pub const ARKUI_SCROLL_STATE_IDLE: ArkUI_ScrollState = ArkUI_ScrollState(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ScrollState { /// Scroll state. Triggered when dragging the container with fingers to scroll. pub const ARKUI_SCROLL_STATE_SCROLL: ArkUI_ScrollState = ArkUI_ScrollState(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ScrollState { /** Inertial rolling state. Triggered when inertia rolling and bouncing back to the edge are performed after releasing the hand quickly.*/ @@ -1100,16 +1475,24 @@ impl ArkUI_ScrollState { /** @brief Define the current scrolling state. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_ScrollState(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_SliderBlockStyle { /// Round slider. pub const ARKUI_SLIDER_BLOCK_STYLE_DEFAULT: ArkUI_SliderBlockStyle = ArkUI_SliderBlockStyle(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_SliderBlockStyle { /// Slider with an image background. pub const ARKUI_SLIDER_BLOCK_STYLE_IMAGE: ArkUI_SliderBlockStyle = ArkUI_SliderBlockStyle(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_SliderBlockStyle { /// Slider in a custom shape. pub const ARKUI_SLIDER_BLOCK_STYLE_SHAPE: ArkUI_SliderBlockStyle = ArkUI_SliderBlockStyle(2); @@ -1118,12 +1501,18 @@ impl ArkUI_SliderBlockStyle { /** @brief Enumerates the types of the slider in the block direction. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_SliderBlockStyle(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_SliderDirection { /// Vertical direction. pub const ARKUI_SLIDER_DIRECTION_VERTICAL: ArkUI_SliderDirection = ArkUI_SliderDirection(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_SliderDirection { /// Horizontal direction. pub const ARKUI_SLIDER_DIRECTION_HORIZONTAL: ArkUI_SliderDirection = ArkUI_SliderDirection(1); @@ -1132,16 +1521,24 @@ impl ArkUI_SliderDirection { /** @brief Enumerates the scroll directions of the slider. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_SliderDirection(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_SliderStyle { /// The slider is on the slider track. pub const ARKUI_SLIDER_STYLE_OUT_SET: ArkUI_SliderStyle = ArkUI_SliderStyle(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_SliderStyle { /// The slider is in the slider track. pub const ARKUI_SLIDER_STYLE_IN_SET: ArkUI_SliderStyle = ArkUI_SliderStyle(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_SliderStyle { /// No slider. pub const ARKUI_SLIDER_STYLE_NONE: ArkUI_SliderStyle = ArkUI_SliderStyle(2); @@ -1150,12 +1547,18 @@ impl ArkUI_SliderStyle { /** @brief Enumerates the slider styles. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_SliderStyle(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_CheckboxShape { /// Circle. pub const ArkUI_CHECKBOX_SHAPE_CIRCLE: ArkUI_CheckboxShape = ArkUI_CheckboxShape(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_CheckboxShape { /// Rounded square. pub const ArkUI_CHECKBOX_SHAPE_ROUNDED_SQUARE: ArkUI_CheckboxShape = ArkUI_CheckboxShape(1); @@ -1164,24 +1567,34 @@ impl ArkUI_CheckboxShape { /** @brief Enumerates the shapes of the check box @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_CheckboxShape(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_AnimationPlayMode { /// The animation is played forwards. pub const ARKUI_ANIMATION_PLAY_MODE_NORMAL: ArkUI_AnimationPlayMode = ArkUI_AnimationPlayMode(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_AnimationPlayMode { /// The animation is played reversely. pub const ARKUI_ANIMATION_PLAY_MODE_REVERSE: ArkUI_AnimationPlayMode = ArkUI_AnimationPlayMode(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_AnimationPlayMode { /** The animation is played normally for an odd number of times (1, 3, 5...) and reversely for an even number of times (2, 4, 6...).*/ pub const ARKUI_ANIMATION_PLAY_MODE_ALTERNATE: ArkUI_AnimationPlayMode = ArkUI_AnimationPlayMode(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_AnimationPlayMode { /** The animation is played reversely for an odd number of times (1, 3, 5...) and normally for an even number of times (2, 4, 6...).*/ @@ -1192,17 +1605,25 @@ impl ArkUI_AnimationPlayMode { /** @brief Enumerates the animation playback modes. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_AnimationPlayMode(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ImageSize { /// The original image aspect ratio is retained. pub const ARKUI_IMAGE_SIZE_AUTO: ArkUI_ImageSize = ArkUI_ImageSize(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ImageSize { /** Default value. The image is scaled with its aspect ratio retained for both sides to be greater than or equal to the display boundaries.*/ pub const ARKUI_IMAGE_SIZE_COVER: ArkUI_ImageSize = ArkUI_ImageSize(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ImageSize { /** The image is scaled with its aspect ratio retained for the content to be completely displayed within the display boundaries.*/ @@ -1212,12 +1633,18 @@ impl ArkUI_ImageSize { /** @brief Defines the image size. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_ImageSize(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_AdaptiveColor { /// Adaptive color mode is not used. pub const ARKUI_ADAPTIVE_COLOR_DEFAULT: ArkUI_AdaptiveColor = ArkUI_AdaptiveColor(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_AdaptiveColor { /// Adaptive color mode is used. pub const ARKUI_ADAPTIVE_COLOR_AVERAGE: ArkUI_AdaptiveColor = ArkUI_AdaptiveColor(1); @@ -1226,16 +1653,24 @@ impl ArkUI_AdaptiveColor { /** @brief Enumerates the adaptive color modes. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_AdaptiveColor(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ColorMode { /// Following the system color mode. pub const ARKUI_COLOR_MODE_SYSTEM: ArkUI_ColorMode = ArkUI_ColorMode(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ColorMode { /// Light color mode. pub const ARKUI_COLOR_MODE_LIGHT: ArkUI_ColorMode = ArkUI_ColorMode(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ColorMode { /// Dark color mode. pub const ARKUI_COLOR_MODE_DARK: ArkUI_ColorMode = ArkUI_ColorMode(2); @@ -1244,12 +1679,18 @@ impl ArkUI_ColorMode { /** @brief Enumerates the color modes. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_ColorMode(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_SystemColorMode { /// Light color mode. pub const ARKUI_SYSTEM_COLOR_MODE_LIGHT: ArkUI_SystemColorMode = ArkUI_SystemColorMode(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_SystemColorMode { /// Dark color mode. pub const ARKUI_SYSTEM_COLOR_MODE_DARK: ArkUI_SystemColorMode = ArkUI_SystemColorMode(1); @@ -1258,56 +1699,84 @@ impl ArkUI_SystemColorMode { /** @brief Enumerates the system color modes. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_SystemColorMode(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BlurStyle { /// Thin material. pub const ARKUI_BLUR_STYLE_THIN: ArkUI_BlurStyle = ArkUI_BlurStyle(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BlurStyle { /// Regular material. pub const ARKUI_BLUR_STYLE_REGULAR: ArkUI_BlurStyle = ArkUI_BlurStyle(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BlurStyle { /// Thick material. pub const ARKUI_BLUR_STYLE_THICK: ArkUI_BlurStyle = ArkUI_BlurStyle(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BlurStyle { /// Material that creates the minimum depth of field effect. pub const ARKUI_BLUR_STYLE_BACKGROUND_THIN: ArkUI_BlurStyle = ArkUI_BlurStyle(3); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BlurStyle { /// Material that creates a medium shallow depth of field effect. pub const ARKUI_BLUR_STYLE_BACKGROUND_REGULAR: ArkUI_BlurStyle = ArkUI_BlurStyle(4); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BlurStyle { /// Material that creates a high shallow depth of field effect. pub const ARKUI_BLUR_STYLE_BACKGROUND_THICK: ArkUI_BlurStyle = ArkUI_BlurStyle(5); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BlurStyle { /// Material that creates the maximum depth of field effect. pub const ARKUI_BLUR_STYLE_BACKGROUND_ULTRA_THICK: ArkUI_BlurStyle = ArkUI_BlurStyle(6); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BlurStyle { /// No blur. pub const ARKUI_BLUR_STYLE_NONE: ArkUI_BlurStyle = ArkUI_BlurStyle(7); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BlurStyle { /// Component ultra-thin material. pub const ARKUI_BLUR_STYLE_COMPONENT_ULTRA_THIN: ArkUI_BlurStyle = ArkUI_BlurStyle(8); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BlurStyle { /// Component thin material. pub const ARKUI_BLUR_STYLE_COMPONENT_THIN: ArkUI_BlurStyle = ArkUI_BlurStyle(9); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BlurStyle { /// Component regular material. pub const ARKUI_BLUR_STYLE_COMPONENT_REGULAR: ArkUI_BlurStyle = ArkUI_BlurStyle(10); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BlurStyle { /// Component thick material. pub const ARKUI_BLUR_STYLE_COMPONENT_THICK: ArkUI_BlurStyle = ArkUI_BlurStyle(11); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BlurStyle { /// Component ultra-thick material. pub const ARKUI_BLUR_STYLE_COMPONENT_ULTRA_THICK: ArkUI_BlurStyle = ArkUI_BlurStyle(12); @@ -1316,16 +1785,24 @@ impl ArkUI_BlurStyle { /** @brief Enumerates the blur styles. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_BlurStyle(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_VerticalAlignment { /// Top aligned. pub const ARKUI_VERTICAL_ALIGNMENT_TOP: ArkUI_VerticalAlignment = ArkUI_VerticalAlignment(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_VerticalAlignment { /// Center aligned. This is the default alignment mode. pub const ARKUI_VERTICAL_ALIGNMENT_CENTER: ArkUI_VerticalAlignment = ArkUI_VerticalAlignment(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_VerticalAlignment { /// Bottom aligned. pub const ARKUI_VERTICAL_ALIGNMENT_BOTTOM: ArkUI_VerticalAlignment = ArkUI_VerticalAlignment(2); @@ -1334,18 +1811,26 @@ impl ArkUI_VerticalAlignment { /** @brief Enumerates the vertical alignment modes. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_VerticalAlignment(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_HorizontalAlignment { /// Aligned with the start edge in the same direction as the language in use. pub const ARKUI_HORIZONTAL_ALIGNMENT_START: ArkUI_HorizontalAlignment = ArkUI_HorizontalAlignment(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_HorizontalAlignment { /// Center aligned. This is the default alignment mode. pub const ARKUI_HORIZONTAL_ALIGNMENT_CENTER: ArkUI_HorizontalAlignment = ArkUI_HorizontalAlignment(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_HorizontalAlignment { /// Aligned with the end edge in the same direction as the language in use. pub const ARKUI_HORIZONTAL_ALIGNMENT_END: ArkUI_HorizontalAlignment = @@ -1355,20 +1840,30 @@ impl ArkUI_HorizontalAlignment { /** @brief Enumerates the alignment mode in the horizontal direction. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_HorizontalAlignment(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextOverflow { /// Extra-long text is not clipped. pub const ARKUI_TEXT_OVERFLOW_NONE: ArkUI_TextOverflow = ArkUI_TextOverflow(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextOverflow { /// Extra-long text is clipped. pub const ARKUI_TEXT_OVERFLOW_CLIP: ArkUI_TextOverflow = ArkUI_TextOverflow(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextOverflow { /// An ellipsis (...) is used to represent text overflow. pub const ARKUI_TEXT_OVERFLOW_ELLIPSIS: ArkUI_TextOverflow = ArkUI_TextOverflow(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextOverflow { /// Text continuously scrolls when text overflow occurs. pub const ARKUI_TEXT_OVERFLOW_MARQUEE: ArkUI_TextOverflow = ArkUI_TextOverflow(3); @@ -1377,23 +1872,33 @@ impl ArkUI_TextOverflow { /** @brief Enumerates the display modes when the text is too long. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_TextOverflow(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ImageSpanAlignment { /// The image is bottom aligned with the text baseline. pub const ARKUI_IMAGE_SPAN_ALIGNMENT_BASELINE: ArkUI_ImageSpanAlignment = ArkUI_ImageSpanAlignment(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ImageSpanAlignment { /// The image is bottom aligned with the text. pub const ARKUI_IMAGE_SPAN_ALIGNMENT_BOTTOM: ArkUI_ImageSpanAlignment = ArkUI_ImageSpanAlignment(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ImageSpanAlignment { /// The image is centered aligned with the text. pub const ARKUI_IMAGE_SPAN_ALIGNMENT_CENTER: ArkUI_ImageSpanAlignment = ArkUI_ImageSpanAlignment(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ImageSpanAlignment { /// The image is top aligned with the text. pub const ARKUI_IMAGE_SPAN_ALIGNMENT_TOP: ArkUI_ImageSpanAlignment = @@ -1403,67 +1908,99 @@ impl ArkUI_ImageSpanAlignment { /** @brief Enumerates the alignment mode of the image with the text. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_ImageSpanAlignment(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ObjectFit { /** The image is scaled with its aspect ratio retained for the content to be completely displayed within the display boundaries.*/ pub const ARKUI_OBJECT_FIT_CONTAIN: ArkUI_ObjectFit = ArkUI_ObjectFit(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ObjectFit { /** The image is scaled with its aspect ratio retained for both sides to be greater than or equal to the display boundaries.*/ pub const ARKUI_OBJECT_FIT_COVER: ArkUI_ObjectFit = ArkUI_ObjectFit(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ObjectFit { /// The image is scaled automatically to fit the display area. pub const ARKUI_OBJECT_FIT_AUTO: ArkUI_ObjectFit = ArkUI_ObjectFit(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ObjectFit { /// The image is scaled to fill the display area, and its aspect ratio is not retained. pub const ARKUI_OBJECT_FIT_FILL: ArkUI_ObjectFit = ArkUI_ObjectFit(3); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ObjectFit { /** The image content is displayed with its aspect ratio retained. The size is smaller than or equal to the original size.*/ pub const ARKUI_OBJECT_FIT_SCALE_DOWN: ArkUI_ObjectFit = ArkUI_ObjectFit(4); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ObjectFit { /// The original size is retained. pub const ARKUI_OBJECT_FIT_NONE: ArkUI_ObjectFit = ArkUI_ObjectFit(5); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ObjectFit { /// Not resized, the image is aligned with the start edge of the top of the container. pub const ARKUI_OBJECT_FIT_NONE_AND_ALIGN_TOP_START: ArkUI_ObjectFit = ArkUI_ObjectFit(6); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ObjectFit { /// Not resized, the image is horizontally centered at the top of the container. pub const ARKUI_OBJECT_FIT_NONE_AND_ALIGN_TOP: ArkUI_ObjectFit = ArkUI_ObjectFit(7); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ObjectFit { /// Not resized, the image is aligned with the end edge at the top of the container. pub const ARKUI_OBJECT_FIT_NONE_AND_ALIGN_TOP_END: ArkUI_ObjectFit = ArkUI_ObjectFit(8); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ObjectFit { /// Not resized, the image is vertically centered on the start edge of the container. pub const ARKUI_OBJECT_FIT_NONE_AND_ALIGN_START: ArkUI_ObjectFit = ArkUI_ObjectFit(9); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ObjectFit { /// Not resized, the image is horizontally and vertically centered in the container. pub const ARKUI_OBJECT_FIT_NONE_AND_ALIGN_CENTER: ArkUI_ObjectFit = ArkUI_ObjectFit(10); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ObjectFit { /// Not resized, the image is vertically centered on the end edge of the container. pub const ARKUI_OBJECT_FIT_NONE_AND_ALIGN_END: ArkUI_ObjectFit = ArkUI_ObjectFit(11); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ObjectFit { /// Not resized, the image is aligned with the start edge at the bottom of the container. pub const ARKUI_OBJECT_FIT_NONE_AND_ALIGN_BOTTOM_START: ArkUI_ObjectFit = ArkUI_ObjectFit(12); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ObjectFit { /// Not resized, the image is horizontally centered at the bottom of the container. pub const ARKUI_OBJECT_FIT_NONE_AND_ALIGN_BOTTOM: ArkUI_ObjectFit = ArkUI_ObjectFit(13); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ObjectFit { /// Not resized, the image is aligned with the end edge at the bottom of the container. pub const ARKUI_OBJECT_FIT_NONE_AND_ALIGN_BOTTOM_END: ArkUI_ObjectFit = ArkUI_ObjectFit(14); @@ -1472,22 +2009,32 @@ impl ArkUI_ObjectFit { /** @brief Defines how the image is resized to fit its container. ImageSpanAlignment @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_ObjectFit(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ImageInterpolation { /// No image interpolation. pub const ARKUI_IMAGE_INTERPOLATION_NONE: ArkUI_ImageInterpolation = ArkUI_ImageInterpolation(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ImageInterpolation { /// Low quality interpolation. pub const ARKUI_IMAGE_INTERPOLATION_LOW: ArkUI_ImageInterpolation = ArkUI_ImageInterpolation(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ImageInterpolation { /// Medium quality interpolation. pub const ARKUI_IMAGE_INTERPOLATION_MEDIUM: ArkUI_ImageInterpolation = ArkUI_ImageInterpolation(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ImageInterpolation { /// High quality interpolation. This mode produces scaled images of the highest possible quality. pub const ARKUI_IMAGE_INTERPOLATION_HIGH: ArkUI_ImageInterpolation = @@ -1497,135 +2044,197 @@ impl ArkUI_ImageInterpolation { /** @brief Enumerates the image interpolation effect. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_ImageInterpolation(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BlendMode { /// The top image is superimposed on the bottom image without any blending. pub const ARKUI_BLEND_MODE_NONE: ArkUI_BlendMode = ArkUI_BlendMode(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BlendMode { /// The target pixels covered by the source pixels are erased by being turned to completely transparent. pub const ARKUI_BLEND_MODE_CLEAR: ArkUI_BlendMode = ArkUI_BlendMode(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BlendMode { /// r = s: Only the source pixels are displayed. pub const ARKUI_BLEND_MODE_SRC: ArkUI_BlendMode = ArkUI_BlendMode(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BlendMode { /// r = d: Only the target pixels are displayed. pub const ARKUI_BLEND_MODE_DST: ArkUI_BlendMode = ArkUI_BlendMode(3); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BlendMode { /// r = s + (1 - sa) * d: The source pixels are blended based on opacity and cover the target pixels. pub const ARKUI_BLEND_MODE_SRC_OVER: ArkUI_BlendMode = ArkUI_BlendMode(4); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BlendMode { /// r = d + (1 - da) * s: The target pixels are blended based on opacity and cover on the source pixels. pub const ARKUI_BLEND_MODE_DST_OVER: ArkUI_BlendMode = ArkUI_BlendMode(5); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BlendMode { /// r = s * da: Only the part of the source pixels that overlap with the target pixels is displayed. pub const ARKUI_BLEND_MODE_SRC_IN: ArkUI_BlendMode = ArkUI_BlendMode(6); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BlendMode { /// r = d * sa: Only the part of the target pixels that overlap with the source pixels is displayed. pub const ARKUI_BLEND_MODE_DST_IN: ArkUI_BlendMode = ArkUI_BlendMode(7); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BlendMode { /// r = s * (1 - da): Only the part of the source pixels that do not overlap with the target pixels is displayed. pub const ARKUI_BLEND_MODE_SRC_OUT: ArkUI_BlendMode = ArkUI_BlendMode(8); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BlendMode { /// r = d * (1 - sa): Only the part of the target pixels that do not overlap with the source pixels is displayed. pub const ARKUI_BLEND_MODE_DST_OUT: ArkUI_BlendMode = ArkUI_BlendMode(9); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BlendMode { /** r = s * da + d * (1 - sa): The part of the source pixels that overlap with the target pixels is displayed and the part of the target pixels that do not overlap with the source pixels are displayed.*/ pub const ARKUI_BLEND_MODE_SRC_ATOP: ArkUI_BlendMode = ArkUI_BlendMode(10); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BlendMode { /** r = d * sa + s * (1 - da): The part of the target pixels that overlap with the source pixels and the part of the source pixels that do not overlap with the target pixels are displayed.*/ pub const ARKUI_BLEND_MODE_DST_ATOP: ArkUI_BlendMode = ArkUI_BlendMode(11); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BlendMode { /** r = s * (1 - da) + d * (1 - sa): Only the non-overlapping part between the source pixels and the target pixels is displayed.*/ pub const ARKUI_BLEND_MODE_XOR: ArkUI_BlendMode = ArkUI_BlendMode(12); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BlendMode { /// r = min(s + d, 1): New pixels resulting from adding the source pixels to the target pixels are displayed. pub const ARKUI_BLEND_MODE_PLUS: ArkUI_BlendMode = ArkUI_BlendMode(13); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BlendMode { /// r = s * d: New pixels resulting from multiplying the source pixels with the target pixels are displayed. pub const ARKUI_BLEND_MODE_MODULATE: ArkUI_BlendMode = ArkUI_BlendMode(14); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BlendMode { /** r = s + d - s * d: Pixels are blended by adding the source pixels to the target pixels and subtracting the product of their multiplication.*/ pub const ARKUI_BLEND_MODE_SCREEN: ArkUI_BlendMode = ArkUI_BlendMode(15); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BlendMode { /// The MULTIPLY or SCREEN mode is used based on the target pixels. pub const ARKUI_BLEND_MODE_OVERLAY: ArkUI_BlendMode = ArkUI_BlendMode(16); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BlendMode { /// rc = s + d - max(s * da, d * sa), ra = kSrcOver: When two colors overlap, whichever is darker is used. pub const ARKUI_BLEND_MODE_DARKEN: ArkUI_BlendMode = ArkUI_BlendMode(17); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BlendMode { /** rc = s + d - min(s * da, d * sa), ra = kSrcOver: The final pixels are composed of the lightest values of pixels.*/ pub const ARKUI_BLEND_MODE_LIGHTEN: ArkUI_BlendMode = ArkUI_BlendMode(18); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BlendMode { /// The colors of the target pixels are lightened to reflect the source pixels. pub const ARKUI_BLEND_MODE_COLOR_DODGE: ArkUI_BlendMode = ArkUI_BlendMode(19); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BlendMode { /// The colors of the target pixels are darkened to reflect the source pixels. pub const ARKUI_BLEND_MODE_COLOR_BURN: ArkUI_BlendMode = ArkUI_BlendMode(20); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BlendMode { /// The MULTIPLY or SCREEN mode is used, depending on the source pixels. pub const ARKUI_BLEND_MODE_HARD_LIGHT: ArkUI_BlendMode = ArkUI_BlendMode(21); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BlendMode { /// The LIGHTEN or DARKEN mode is used, depending on the source pixels. pub const ARKUI_BLEND_MODE_SOFT_LIGHT: ArkUI_BlendMode = ArkUI_BlendMode(22); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BlendMode { /** rc = s + d - 2 * (min(s * da, d * sa)), ra = kSrcOver: The final pixel is the result of subtracting the darker of the two pixels (source and target) from the lighter one.*/ pub const ARKUI_BLEND_MODE_DIFFERENCE: ArkUI_BlendMode = ArkUI_BlendMode(23); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BlendMode { /// rc = s + d - two(s * d), ra = kSrcOver: The final pixel is similar to DIFFERENCE, but with less contrast. pub const ARKUI_BLEND_MODE_EXCLUSION: ArkUI_BlendMode = ArkUI_BlendMode(24); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BlendMode { /** r = s * (1 - da) + d * (1 - sa) + s * d: The final pixel is the result of multiplying the source pixel by the target pixel.*/ pub const ARKUI_BLEND_MODE_MULTIPLY: ArkUI_BlendMode = ArkUI_BlendMode(25); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BlendMode { /** The resultant image is created with the luminance and saturation of the source image and the hue of the target image.*/ pub const ARKUI_BLEND_MODE_HUE: ArkUI_BlendMode = ArkUI_BlendMode(26); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BlendMode { /** The resultant image is created with the luminance and hue of the target image and the saturation of the source image.*/ pub const ARKUI_BLEND_MODE_SATURATION: ArkUI_BlendMode = ArkUI_BlendMode(27); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BlendMode { /** The resultant image is created with the saturation and hue of the source image and the luminance of the target image.*/ pub const ARKUI_BLEND_MODE_COLOR: ArkUI_BlendMode = ArkUI_BlendMode(28); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BlendMode { /** The resultant image is created with the saturation and hue of the target image and the luminance of the source image.*/ @@ -1635,16 +2244,24 @@ impl ArkUI_BlendMode { /** @brief Enumerates the blend modes. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_BlendMode(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_Direction { /// Components are arranged from left to right. pub const ARKUI_DIRECTION_LTR: ArkUI_Direction = ArkUI_Direction(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_Direction { /// Components are arranged from right to left. pub const ARKUI_DIRECTION_RTL: ArkUI_Direction = ArkUI_Direction(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_Direction { /// The default layout direction is used. pub const ARKUI_DIRECTION_AUTO: ArkUI_Direction = ArkUI_Direction(3); @@ -1653,28 +2270,42 @@ impl ArkUI_Direction { /** @brief Enumerates the modes in which components are laid out along the main axis of the container. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_Direction(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ItemAlignment { /// The default configuration in the container is used. pub const ARKUI_ITEM_ALIGNMENT_AUTO: ArkUI_ItemAlignment = ArkUI_ItemAlignment(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ItemAlignment { /// The items in the container are aligned with the cross-start edge. pub const ARKUI_ITEM_ALIGNMENT_START: ArkUI_ItemAlignment = ArkUI_ItemAlignment(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ItemAlignment { /// The items in the container are centered along the cross axis. pub const ARKUI_ITEM_ALIGNMENT_CENTER: ArkUI_ItemAlignment = ArkUI_ItemAlignment(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ItemAlignment { /// The items in the container are aligned with the cross-end edge. pub const ARKUI_ITEM_ALIGNMENT_END: ArkUI_ItemAlignment = ArkUI_ItemAlignment(3); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ItemAlignment { /// The items in the container are stretched and padded along the cross axis. pub const ARKUI_ITEM_ALIGNMENT_STRETCH: ArkUI_ItemAlignment = ArkUI_ItemAlignment(4); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ItemAlignment { /** The items in the container are aligned in such a manner that their text baselines are aligned along the cross axis.*/ @@ -1684,16 +2315,24 @@ impl ArkUI_ItemAlignment { /** @brief Enumerates the modes in which components are laid out along the cross axis of the container. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_ItemAlignment(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ColorStrategy { /// The foreground colors are the inverse of the component background colors. pub const ARKUI_COLOR_STRATEGY_INVERT: ArkUI_ColorStrategy = ArkUI_ColorStrategy(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ColorStrategy { /// The shadow colors of the component are the average color obtained from the component background shadow area. pub const ARKUI_COLOR_STRATEGY_AVERAGE: ArkUI_ColorStrategy = ArkUI_ColorStrategy(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ColorStrategy { /// The shadow colors of the component are the primary color obtained from the component background shadow area. pub const ARKUI_COLOR_STRATEGY_PRIMARY: ArkUI_ColorStrategy = ArkUI_ColorStrategy(2); @@ -1702,32 +2341,46 @@ impl ArkUI_ColorStrategy { /** @brief Enumerates the foreground colors. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_ColorStrategy(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_FlexAlignment { /// The child components are aligned with the start edge of the main axis. pub const ARKUI_FLEX_ALIGNMENT_START: ArkUI_FlexAlignment = ArkUI_FlexAlignment(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_FlexAlignment { /// The child components are aligned in the center of the main axis. pub const ARKUI_FLEX_ALIGNMENT_CENTER: ArkUI_FlexAlignment = ArkUI_FlexAlignment(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_FlexAlignment { /// The child components are aligned with the end edge of the main axis. pub const ARKUI_FLEX_ALIGNMENT_END: ArkUI_FlexAlignment = ArkUI_FlexAlignment(3); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_FlexAlignment { /** The child components are evenly distributed along the main axis. The space between any two adjacent components is the same. The first component is aligned with the main-start, and the last component is aligned with the main-end.*/ pub const ARKUI_FLEX_ALIGNMENT_SPACE_BETWEEN: ArkUI_FlexAlignment = ArkUI_FlexAlignment(6); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_FlexAlignment { /** The child components are evenly distributed along the main axis. The space between any two adjacent components is the same. The space between the first component and main-start, and that between the last component and cross-main are both half the size of the space between two adjacent components.*/ pub const ARKUI_FLEX_ALIGNMENT_SPACE_AROUND: ArkUI_FlexAlignment = ArkUI_FlexAlignment(7); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_FlexAlignment { /** The child components are evenly distributed along the main axis. The space between the first component and main-start, the space between the last component and main-end, and the space between any two adjacent @@ -1738,20 +2391,30 @@ impl ArkUI_FlexAlignment { /** @brief Enumerates the vertical alignment modes. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_FlexAlignment(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_FlexDirection { /// The child components are arranged in the same direction as the main axis runs along the rows. pub const ARKUI_FLEX_DIRECTION_ROW: ArkUI_FlexDirection = ArkUI_FlexDirection(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_FlexDirection { /// The child components are arranged in the same direction as the main axis runs down the columns. pub const ARKUI_FLEX_DIRECTION_COLUMN: ArkUI_FlexDirection = ArkUI_FlexDirection(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_FlexDirection { /// The child components are arranged opposite to the ROW direction. pub const ARKUI_FLEX_DIRECTION_ROW_REVERSE: ArkUI_FlexDirection = ArkUI_FlexDirection(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_FlexDirection { /// The child components are arranged opposite to the COLUMN direction. pub const ARKUI_FLEX_DIRECTION_COLUMN_REVERSE: ArkUI_FlexDirection = ArkUI_FlexDirection(3); @@ -1760,16 +2423,24 @@ impl ArkUI_FlexDirection { /** @brief Enumerates the directions of the main axis in the flex container. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_FlexDirection(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_FlexWrap { /// The child components in the flex container are arranged in a single line, and they cannot overflow. pub const ARKUI_FLEX_WRAP_NO_WRAP: ArkUI_FlexWrap = ArkUI_FlexWrap(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_FlexWrap { /// The child components in the flex container are arranged in multiple lines, and they may overflow. pub const ARKUI_FLEX_WRAP_WRAP: ArkUI_FlexWrap = ArkUI_FlexWrap(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_FlexWrap { /// The child components in the flex container are reversely arranged in multiple lines, and they may overflow. pub const ARKUI_FLEX_WRAP_WRAP_REVERSE: ArkUI_FlexWrap = ArkUI_FlexWrap(2); @@ -1778,16 +2449,24 @@ impl ArkUI_FlexWrap { /** @brief Defines whether the flex container has a single line or multiple lines. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_FlexWrap(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_Visibility { /// The component is visible. pub const ARKUI_VISIBILITY_VISIBLE: ArkUI_Visibility = ArkUI_Visibility(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_Visibility { /// The component is hidden, and a placeholder is used for it in the layout. pub const ARKUI_VISIBILITY_HIDDEN: ArkUI_Visibility = ArkUI_Visibility(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_Visibility { /// The component is hidden. It is not involved in the layout, and no placeholder is used for it. pub const ARKUI_VISIBILITY_NONE: ArkUI_Visibility = ArkUI_Visibility(2); @@ -1796,16 +2475,24 @@ impl ArkUI_Visibility { /** @brief Enumerates the visibility values. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_Visibility(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_CalendarAlignment { /// Left aligned. pub const ARKUI_CALENDAR_ALIGNMENT_START: ArkUI_CalendarAlignment = ArkUI_CalendarAlignment(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_CalendarAlignment { /// Center aligned. pub const ARKUI_CALENDAR_ALIGNMENT_CENTER: ArkUI_CalendarAlignment = ArkUI_CalendarAlignment(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_CalendarAlignment { /// Right aligned. pub const ARKUI_CALENDAR_ALIGNMENT_END: ArkUI_CalendarAlignment = ArkUI_CalendarAlignment(2); @@ -1814,24 +2501,36 @@ impl ArkUI_CalendarAlignment { /** @brief Enumerates the alignment modes between the calendar picker and the entry component. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_CalendarAlignment(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_MaskType { /// Rectangle. pub const ARKUI_MASK_TYPE_RECTANGLE: ArkUI_MaskType = ArkUI_MaskType(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_MaskType { /// Circle. pub const ARKUI_MASK_TYPE_CIRCLE: ArkUI_MaskType = ArkUI_MaskType(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_MaskType { /// Ellipse. pub const ARKUI_MASK_TYPE_ELLIPSE: ArkUI_MaskType = ArkUI_MaskType(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_MaskType { /// Path. pub const ARKUI_MASK_TYPE_PATH: ArkUI_MaskType = ArkUI_MaskType(3); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_MaskType { /// Progress indicator. pub const ARKUI_MASK_TYPE_PROGRESS: ArkUI_MaskType = ArkUI_MaskType(4); @@ -1840,20 +2539,30 @@ impl ArkUI_MaskType { /** @brief Enumerates the mask types. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_MaskType(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ClipType { /// Rectangle. pub const ARKUI_CLIP_TYPE_RECTANGLE: ArkUI_ClipType = ArkUI_ClipType(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ClipType { /// Circle. pub const ARKUI_CLIP_TYPE_CIRCLE: ArkUI_ClipType = ArkUI_ClipType(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ClipType { /// Ellipse. pub const ARKUI_CLIP_TYPE_ELLIPSE: ArkUI_ClipType = ArkUI_ClipType(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ClipType { /// Path. pub const ARKUI_CLIP_TYPE_PATH: ArkUI_ClipType = ArkUI_ClipType(3); @@ -1862,11 +2571,15 @@ impl ArkUI_ClipType { /** @brief Enumerates the clipping region types. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_ClipType(pub ::core::ffi::c_uint); /** @brief Defines the gradient color stop structure. @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] #[repr(C)] pub struct ArkUI_ColorStop { /// Color array. @@ -1876,18 +2589,26 @@ pub struct ArkUI_ColorStop { /// Length array. pub size: ::core::ffi::c_int, } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ShapeType { /// Rectangle. pub const ARKUI_SHAPE_TYPE_RECTANGLE: ArkUI_ShapeType = ArkUI_ShapeType(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ShapeType { /// Circle. pub const ARKUI_SHAPE_TYPE_CIRCLE: ArkUI_ShapeType = ArkUI_ShapeType(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ShapeType { /// Ellipse. pub const ARKUI_SHAPE_TYPE_ELLIPSE: ArkUI_ShapeType = ArkUI_ShapeType(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ShapeType { /// Path. pub const ARKUI_SHAPE_TYPE_PATH: ArkUI_ShapeType = ArkUI_ShapeType(3); @@ -1896,53 +2617,75 @@ impl ArkUI_ShapeType { /** @brief Enumerates the custom shapes. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_ShapeType(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_LinearGradientDirection { /// From right to left. pub const ARKUI_LINEAR_GRADIENT_DIRECTION_LEFT: ArkUI_LinearGradientDirection = ArkUI_LinearGradientDirection(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_LinearGradientDirection { /// From bottom to top. pub const ARKUI_LINEAR_GRADIENT_DIRECTION_TOP: ArkUI_LinearGradientDirection = ArkUI_LinearGradientDirection(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_LinearGradientDirection { /// From left to right. pub const ARKUI_LINEAR_GRADIENT_DIRECTION_RIGHT: ArkUI_LinearGradientDirection = ArkUI_LinearGradientDirection(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_LinearGradientDirection { /// From top to bottom. pub const ARKUI_LINEAR_GRADIENT_DIRECTION_BOTTOM: ArkUI_LinearGradientDirection = ArkUI_LinearGradientDirection(3); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_LinearGradientDirection { /// From lower right to upper left. pub const ARKUI_LINEAR_GRADIENT_DIRECTION_LEFT_TOP: ArkUI_LinearGradientDirection = ArkUI_LinearGradientDirection(4); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_LinearGradientDirection { /// From upper right to lower left. pub const ARKUI_LINEAR_GRADIENT_DIRECTION_LEFT_BOTTOM: ArkUI_LinearGradientDirection = ArkUI_LinearGradientDirection(5); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_LinearGradientDirection { /// From lower left to upper right. pub const ARKUI_LINEAR_GRADIENT_DIRECTION_RIGHT_TOP: ArkUI_LinearGradientDirection = ArkUI_LinearGradientDirection(6); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_LinearGradientDirection { /// From upper left to lower right. pub const ARKUI_LINEAR_GRADIENT_DIRECTION_RIGHT_BOTTOM: ArkUI_LinearGradientDirection = ArkUI_LinearGradientDirection(7); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_LinearGradientDirection { /// No gradient. pub const ARKUI_LINEAR_GRADIENT_DIRECTION_NONE: ArkUI_LinearGradientDirection = ArkUI_LinearGradientDirection(8); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_LinearGradientDirection { /// Custom direction. pub const ARKUI_LINEAR_GRADIENT_DIRECTION_CUSTOM: ArkUI_LinearGradientDirection = @@ -1952,18 +2695,26 @@ impl ArkUI_LinearGradientDirection { /** @brief Enumerates the gradient directions. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_LinearGradientDirection(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_WordBreak { /** Word breaks can occur between any two characters for Chinese, Japanese, and Korean (CJK) text, but can occur only at a space character for non-CJK text (such as English).*/ pub const ARKUI_WORD_BREAK_NORMAL: ArkUI_WordBreak = ArkUI_WordBreak(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_WordBreak { /** Word breaks can occur between any two characters for non-CJK text. CJK text behavior is the same as for NORMAL.*/ pub const ARKUI_WORD_BREAK_BREAK_ALL: ArkUI_WordBreak = ArkUI_WordBreak(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_WordBreak { /** This option has the same effect as BREAK_ALL for non-CJK text, except that if it preferentially wraps lines at appropriate characters (for example, spaces) whenever possible. @@ -1974,16 +2725,24 @@ impl ArkUI_WordBreak { /** @brief Enumerates the word break rules. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_WordBreak(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_EllipsisMode { /// An ellipsis is used at the start of the line of text. pub const ARKUI_ELLIPSIS_MODE_START: ArkUI_EllipsisMode = ArkUI_EllipsisMode(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_EllipsisMode { /// An ellipsis is used at the center of the line of text. pub const ARKUI_ELLIPSIS_MODE_CENTER: ArkUI_EllipsisMode = ArkUI_EllipsisMode(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_EllipsisMode { /// An ellipsis is used at the end of the line of text. pub const ARKUI_ELLIPSIS_MODE_END: ArkUI_EllipsisMode = ArkUI_EllipsisMode(2); @@ -1992,12 +2751,18 @@ impl ArkUI_EllipsisMode { /** @brief Enumerates the ellipsis positions. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_EllipsisMode(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ImageRenderMode { /// Render image pixels as they are in the original source image. pub const ARKUI_IMAGE_RENDER_MODE_ORIGINAL: ArkUI_ImageRenderMode = ArkUI_ImageRenderMode(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ImageRenderMode { /// Render image pixels to create a monochrome template image. pub const ARKUI_IMAGE_RENDER_MODE_TEMPLATE: ArkUI_ImageRenderMode = ArkUI_ImageRenderMode(1); @@ -2006,20 +2771,30 @@ impl ArkUI_ImageRenderMode { /** @brief Enumerates the image rendering modes. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_ImageRenderMode(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TransitionEdge { /// Top edge of the window. pub const ARKUI_TRANSITION_EDGE_TOP: ArkUI_TransitionEdge = ArkUI_TransitionEdge(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TransitionEdge { /// Bottom edge of the window. pub const ARKUI_TRANSITION_EDGE_BOTTOM: ArkUI_TransitionEdge = ArkUI_TransitionEdge(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TransitionEdge { /// Left edge of the window. pub const ARKUI_TRANSITION_EDGE_START: ArkUI_TransitionEdge = ArkUI_TransitionEdge(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TransitionEdge { /// Right edge of the window. pub const ARKUI_TRANSITION_EDGE_END: ArkUI_TransitionEdge = ArkUI_TransitionEdge(3); @@ -2028,12 +2803,18 @@ impl ArkUI_TransitionEdge { /** @brief Enumerates the slide-in and slide-out positions of the component from the screen edge during transition. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_TransitionEdge(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BlendApplyType { /// The content of the view is blended in sequence on the target image. pub const BLEND_APPLY_TYPE_FAST: ArkUI_BlendApplyType = ArkUI_BlendApplyType(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BlendApplyType { #[doc = " The content of the component and its child components are drawn on the offscreen canvas, and then blended with\n/* the existing content on the canvas."] pub const BLEND_APPLY_TYPE_OFFSCREEN: ArkUI_BlendApplyType = ArkUI_BlendApplyType(1); @@ -2042,12 +2823,17 @@ impl ArkUI_BlendApplyType { /** @brief Defines how the specified blend mode is applied. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_BlendApplyType(pub ::core::ffi::c_uint); /** @brief Defines a mask area. @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] #[repr(C)] +#[derive(Copy, Clone)] pub struct ArkUI_Rect { /// X coordinate of the mask area. pub x: f32, @@ -2061,7 +2847,10 @@ pub struct ArkUI_Rect { /** @brief Describes the width and height of a component. @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] #[repr(C)] +#[derive(Copy, Clone)] pub struct ArkUI_IntSize { /// Width, in px. pub width: i32, @@ -2071,17 +2860,24 @@ pub struct ArkUI_IntSize { /** @brief Describes the position of a component. @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] #[repr(C)] +#[derive(Copy, Clone)] pub struct ArkUI_IntOffset { /// Horizontal coordinate, in px. pub x: i32, /// Vertical coordinate, in px. pub y: i32, } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_FinishCallbackType { /// The callback is invoked when the entire animation is removed once it has finished. pub const ARKUI_FINISH_CALLBACK_REMOVED: ArkUI_FinishCallbackType = ArkUI_FinishCallbackType(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_FinishCallbackType { /** The callback is invoked when the animation logically enters the falling state, though it may still be in its long tail state.*/ @@ -2092,17 +2888,25 @@ impl ArkUI_FinishCallbackType { /** @brief Enumerates the animation onFinish callback types. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_FinishCallbackType(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ListItemAlignment { /// The list items are packed toward the start edge of the list container along the cross axis. pub const ARKUI_LIST_ITEM_ALIGNMENT_START: ArkUI_ListItemAlignment = ArkUI_ListItemAlignment(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ListItemAlignment { /// The list items are centered in the list container along the cross axis. pub const ARKUI_LIST_ITEM_ALIGNMENT_CENTER: ArkUI_ListItemAlignment = ArkUI_ListItemAlignment(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ListItemAlignment { /// The list items are packed toward the end edge of the list container along the cross axis. pub const ARKUI_LIST_ITEM_ALIGNMENT_END: ArkUI_ListItemAlignment = ArkUI_ListItemAlignment(2); @@ -2111,20 +2915,30 @@ impl ArkUI_ListItemAlignment { /** @brief Enumerates the alignment modes of items along the cross axis. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_ListItemAlignment(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BarrierDirection { /// The barrier is the leftmost of all its referencedIds. pub const ARKUI_BARRIER_DIRECTION_START: ArkUI_BarrierDirection = ArkUI_BarrierDirection(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BarrierDirection { /// The barrier is on the rightmost side of all its referencedIds. pub const ARKUI_BARRIER_DIRECTION_END: ArkUI_BarrierDirection = ArkUI_BarrierDirection(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BarrierDirection { /// The barrier is at the top of all its referencedIds. pub const ARKUI_BARRIER_DIRECTION_TOP: ArkUI_BarrierDirection = ArkUI_BarrierDirection(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_BarrierDirection { /// The barrier is at the bottom of all its referencedIds. pub const ARKUI_BARRIER_DIRECTION_BOTTOM: ArkUI_BarrierDirection = ArkUI_BarrierDirection(3); @@ -2133,19 +2947,27 @@ impl ArkUI_BarrierDirection { /** @brief defines the direction of the barrier line. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_BarrierDirection(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_RelativeLayoutChainStyle { /// Components are evenly distributed among constraint anchor points. pub const ARKUI_RELATIVE_LAYOUT_CHAIN_STYLE_SPREAD: ArkUI_RelativeLayoutChainStyle = ArkUI_RelativeLayoutChainStyle(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_RelativeLayoutChainStyle { /** Except for the first and last two sub-components, other components are evenly distributed between the constraint anchor points.*/ pub const ARKUI_RELATIVE_LAYOUT_CHAIN_STYLE_SPREAD_INSIDE: ArkUI_RelativeLayoutChainStyle = ArkUI_RelativeLayoutChainStyle(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_RelativeLayoutChainStyle { /// No gaps in subcomponents within the chain. pub const ARKUI_RELATIVE_LAYOUT_CHAIN_STYLE_PACKED: ArkUI_RelativeLayoutChainStyle = @@ -2155,12 +2977,17 @@ impl ArkUI_RelativeLayoutChainStyle { /** @brief defines the style of the chain. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_RelativeLayoutChainStyle(pub ::core::ffi::c_uint); /** @brief Describes the margins of a component. @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] #[repr(C)] +#[derive(Copy, Clone)] pub struct ArkUI_Margin { /// Top margin, in vp. pub top: f32, @@ -2171,18 +2998,26 @@ pub struct ArkUI_Margin { /// Left margin, in vp. pub left: f32, } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_LengthMetricUnit { /// Default, which is fp for fonts and vp for non-fonts. pub const ARKUI_LENGTH_METRIC_UNIT_DEFAULT: ArkUI_LengthMetricUnit = ArkUI_LengthMetricUnit(-1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_LengthMetricUnit { /// px. pub const ARKUI_LENGTH_METRIC_UNIT_PX: ArkUI_LengthMetricUnit = ArkUI_LengthMetricUnit(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_LengthMetricUnit { /// vp. pub const ARKUI_LENGTH_METRIC_UNIT_VP: ArkUI_LengthMetricUnit = ArkUI_LengthMetricUnit(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_LengthMetricUnit { /// fp. pub const ARKUI_LENGTH_METRIC_UNIT_FP: ArkUI_LengthMetricUnit = ArkUI_LengthMetricUnit(2); @@ -2191,64 +3026,90 @@ impl ArkUI_LengthMetricUnit { /** @brief Enumerates the component units. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_LengthMetricUnit(pub ::core::ffi::c_int); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_RenderFit { /** Maintains the content size of the animation's final state, and the content is always centered with the component.*/ pub const ARKUI_RENDER_FIT_CENTER: ArkUI_RenderFit = ArkUI_RenderFit(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_RenderFit { /** Maintains the content size of the animation's final state, and the content is always aligned with the top center of the component.*/ pub const ARKUI_RENDER_FIT_TOP: ArkUI_RenderFit = ArkUI_RenderFit(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_RenderFit { /** Maintains the content size of the animation's final state, and the content is always aligned with the bottom center of the component.*/ pub const ARKUI_RENDER_FIT_BOTTOM: ArkUI_RenderFit = ArkUI_RenderFit(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_RenderFit { /** Maintains the content size of the animation's final state, and the content is always aligned to the left of the component.*/ pub const ARKUI_RENDER_FIT_LEFT: ArkUI_RenderFit = ArkUI_RenderFit(3); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_RenderFit { /** Maintains the content size of the animation's final state, and the content is always right-aligned with the component.*/ pub const ARKUI_RENDER_FIT_RIGHT: ArkUI_RenderFit = ArkUI_RenderFit(4); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_RenderFit { /** Maintains the content size of the animation's final state, and the content is always aligned with the top left corner of the component.*/ pub const ARKUI_RENDER_FIT_TOP_LEFT: ArkUI_RenderFit = ArkUI_RenderFit(5); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_RenderFit { /** Keep the content size of the animation final state, and the content is always aligned with the upper right corner of the component.*/ pub const ARKUI_RENDER_FIT_TOP_RIGHT: ArkUI_RenderFit = ArkUI_RenderFit(6); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_RenderFit { /** Keep the content size of the animation final state, and the content always aligns with the lower-left corner of the component.*/ pub const ARKUI_RENDER_FIT_BOTTOM_LEFT: ArkUI_RenderFit = ArkUI_RenderFit(7); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_RenderFit { /** Keep the content size of the animation final state, and the content always aligns with the lower-right corner of the component.*/ pub const ARKUI_RENDER_FIT_BOTTOM_RIGHT: ArkUI_RenderFit = ArkUI_RenderFit(8); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_RenderFit { /** The aspect ratio of the animation's final state content is not considered, and the content is always scaled to the size of the component.*/ pub const ARKUI_RENDER_FIT_RESIZE_FILL: ArkUI_RenderFit = ArkUI_RenderFit(9); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_RenderFit { /** Reduce or enlarge the aspect ratio of the animation final state content, so that the content is fully displayed in the component, and keep the center aligned with the component.*/ pub const ARKUI_RENDER_FIT_RESIZE_CONTAIN: ArkUI_RenderFit = ArkUI_RenderFit(10); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_RenderFit { /** Keep the aspect ratio of the animation final state content to reduce or enlarge, so that the content is fully displayed in the component. @@ -2258,6 +3119,8 @@ impl ArkUI_RenderFit { the content is aligned to the top of the component.*/ pub const ARKUI_RENDER_FIT_RESIZE_CONTAIN_TOP_LEFT: ArkUI_RenderFit = ArkUI_RenderFit(11); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_RenderFit { /** Keep the aspect ratio of the animation final state content to reduce or enlarge, so that the content is fully displayed in the component. @@ -2267,12 +3130,16 @@ impl ArkUI_RenderFit { the content is aligned with the component on the bottom.*/ pub const ARKUI_RENDER_FIT_RESIZE_CONTAIN_BOTTOM_RIGHT: ArkUI_RenderFit = ArkUI_RenderFit(12); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_RenderFit { /** Keep the aspect ratio of the animation final state content reduced or enlarged, so that both sides of the content are greater than or equal to both sides of the component, and keep the center aligned with the component to display the middle part of the content.*/ pub const ARKUI_RENDER_FIT_RESIZE_COVER: ArkUI_RenderFit = ArkUI_RenderFit(13); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_RenderFit { /** Keep the aspect ratio of the final content of the animation reduced or enlarged so that both sides of the content are exactly greater than or equal to both sides of the component. @@ -2281,6 +3148,8 @@ impl ArkUI_RenderFit { the content and the component remain top aligned, showing the top side of the content.*/ pub const ARKUI_RENDER_FIT_RESIZE_COVER_TOP_LEFT: ArkUI_RenderFit = ArkUI_RenderFit(14); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_RenderFit { /** Keep the aspect ratio of the final content of the animation reduced or enlarged so that both sides of the content are exactly greater than or equal to both sides of the component. @@ -2294,16 +3163,24 @@ impl ArkUI_RenderFit { /** @brief Enumerates the render fit. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_RenderFit(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ButtonType { /// Normal button (without rounded corners by default). pub const ARKUI_BUTTON_TYPE_NORMAL: ArkUI_ButtonType = ArkUI_ButtonType(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ButtonType { /// Capsule-type button (the round corner is half of the height by default). pub const ARKUI_BUTTON_TYPE_CAPSULE: ArkUI_ButtonType = ArkUI_ButtonType(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ButtonType { /// Circle button. pub const ARKUI_BUTTON_TYPE_CIRCLE: ArkUI_ButtonType = ArkUI_ButtonType(2); @@ -2312,118 +3189,162 @@ impl ArkUI_ButtonType { /** @brief Enumerates the button types. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_ButtonType(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextInputContentType { /// Username. Password Vault, when enabled, can automatically save and fill in usernames. pub const ARKUI_TEXTINPUT_CONTENT_TYPE_USER_NAME: ArkUI_TextInputContentType = ArkUI_TextInputContentType(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextInputContentType { /// Password. Password Vault, when enabled, can automatically save and fill in passwords. pub const ARKUI_TEXTINPUT_CONTENT_TYPE_PASSWORD: ArkUI_TextInputContentType = ArkUI_TextInputContentType(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextInputContentType { /// New password. Password Vault, when enabled, can automatically generate a new password. pub const ARKUI_TEXTINPUT_CONTENT_TYPE_NEW_PASSWORD: ArkUI_TextInputContentType = ArkUI_TextInputContentType(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextInputContentType { /** Full street address. The scenario-based autofill feature, when enabled, can automatically save and fill in full street addresses.*/ pub const ARKUI_TEXTINPUT_CONTENT_TYPE_FULL_STREET_ADDRESS: ArkUI_TextInputContentType = ArkUI_TextInputContentType(3); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextInputContentType { /** House number. The scenario-based autofill feature, when enabled, can automatically save and fill in house numbers.*/ pub const ARKUI_TEXTINPUT_CONTENT_TYPE_HOUSE_NUMBER: ArkUI_TextInputContentType = ArkUI_TextInputContentType(4); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextInputContentType { /** District and county. The scenario-based autofill feature, when enabled, can automatically save and fill in districts and counties.*/ pub const ARKUI_TEXTINPUT_CONTENT_TYPE_DISTRICT_ADDRESS: ArkUI_TextInputContentType = ArkUI_TextInputContentType(5); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextInputContentType { /// City. The scenario-based autofill feature, when enabled, can automatically save and fill in cities. pub const ARKUI_TEXTINPUT_CONTENT_TYPE_CITY_ADDRESS: ArkUI_TextInputContentType = ArkUI_TextInputContentType(6); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextInputContentType { /// Province. The scenario-based autofill feature, when enabled, can automatically save and fill in provinces. pub const ARKUI_TEXTINPUT_CONTENT_TYPE_PROVINCE_ADDRESS: ArkUI_TextInputContentType = ArkUI_TextInputContentType(7); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextInputContentType { /// Country. The scenario-based autofill feature, when enabled, can automatically save and fill in countries. pub const ARKUI_TEXTINPUT_CONTENT_TYPE_COUNTRY_ADDRESS: ArkUI_TextInputContentType = ArkUI_TextInputContentType(8); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextInputContentType { /// Full name. The scenario-based autofill feature, when enabled, can automatically save and fill in full names. pub const ARKUI_TEXTINPUT_CONTENT_TYPE_PERSON_FULL_NAME: ArkUI_TextInputContentType = ArkUI_TextInputContentType(9); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextInputContentType { /// Last name. The scenario-based autofill feature, when enabled, can automatically save and fill in last names. pub const ARKUI_TEXTINPUT_CONTENT_TYPE_PERSON_LAST_NAME: ArkUI_TextInputContentType = ArkUI_TextInputContentType(10); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextInputContentType { /// First name. The scenario-based autofill feature, when enabled, can automatically save and fill in first names. pub const ARKUI_TEXTINPUT_CONTENT_TYPE_PERSON_FIRST_NAME: ArkUI_TextInputContentType = ArkUI_TextInputContentType(11); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextInputContentType { /** Phone number. The scenario-based autofill feature, when enabled, can automatically save and fill in phone numbers.*/ pub const ARKUI_TEXTINPUT_CONTENT_TYPE_PHONE_NUMBER: ArkUI_TextInputContentType = ArkUI_TextInputContentType(12); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextInputContentType { /** Country code. The scenario-based autofill feature, when enabled, can automatically save and fill in country codes.*/ pub const ARKUI_TEXTINPUT_CONTENT_TYPE_PHONE_COUNTRY_CODE: ArkUI_TextInputContentType = ArkUI_TextInputContentType(13); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextInputContentType { /** Phone number with country code. The scenario-based autofill feature, when enabled, can automatically save and fill in phone numbers with country codes.*/ pub const ARKUI_TEXTINPUT_CONTENT_TYPE_FULL_PHONE_NUMBER: ArkUI_TextInputContentType = ArkUI_TextInputContentType(14); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextInputContentType { /** Email address. The scenario-based autofill feature, when enabled, can automatically save and fill in email addresses.*/ pub const ARKUI_TEXTINPUT_CONTENT_EMAIL_ADDRESS: ArkUI_TextInputContentType = ArkUI_TextInputContentType(15); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextInputContentType { /** Bank card number. The scenario-based autofill feature, when enabled, can automatically save and fill in bank card numbers.*/ pub const ARKUI_TEXTINPUT_CONTENT_TYPE_BANK_CARD_NUMBER: ArkUI_TextInputContentType = ArkUI_TextInputContentType(16); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextInputContentType { /** ID card number. The scenario-based autofill feature, when enabled, can automatically save and fill in ID card numbers.*/ pub const ARKUI_TEXTINPUT_CONTENT_TYPE_ID_CARD_NUMBER: ArkUI_TextInputContentType = ArkUI_TextInputContentType(17); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextInputContentType { /// Nickname. The scenario-based autofill feature, when enabled, can automatically save and fill in nicknames. pub const ARKUI_TEXTINPUT_CONTENT_TYPE_NICKNAME: ArkUI_TextInputContentType = ArkUI_TextInputContentType(18); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextInputContentType { /** Address information without street address. The scenario-based autofill feature, when enabled, can automatically save and fill in address information without street addresses.*/ pub const ARKUI_TEXTINPUT_CONTENT_TYPE_DETAIL_INFO_WITHOUT_STREET: ArkUI_TextInputContentType = ArkUI_TextInputContentType(19); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextInputContentType { /** Standard address. The scenario-based autofill feature, when enabled, can automatically save and fill in standard addresses.*/ @@ -2434,13 +3355,19 @@ impl ArkUI_TextInputContentType { /** @brief Enumerates the autofill types. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_TextInputContentType(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextInputStyle { /** Default style. The caret width is fixed at 1.5 vp, and the caret height is subject to the background height and font size of the selected text.*/ pub const ARKUI_TEXTINPUT_STYLE_DEFAULT: ArkUI_TextInputStyle = ArkUI_TextInputStyle(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextInputStyle { /// Inline input style. The background height of the selected text is the same as the height of the text box. pub const ARKUI_TEXTINPUT_STYLE_INLINE: ArkUI_TextInputStyle = ArkUI_TextInputStyle(1); @@ -2449,23 +3376,33 @@ impl ArkUI_TextInputStyle { /** @brief Defines the text input style. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_TextInputStyle(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextDataDetectorType { /// Phone Number. pub const ARKUI_TEXT_DATA_DETECTOR_TYPE_PHONE_NUMBER: ArkUI_TextDataDetectorType = ArkUI_TextDataDetectorType(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextDataDetectorType { /// Link. pub const ARKUI_TEXT_DATA_DETECTOR_TYPE_URL: ArkUI_TextDataDetectorType = ArkUI_TextDataDetectorType(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextDataDetectorType { /// Mailbox. pub const ARKUI_TEXT_DATA_DETECTOR_TYPE_EMAIL: ArkUI_TextDataDetectorType = ArkUI_TextDataDetectorType(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_TextDataDetectorType { /// Address. pub const ARKUI_TEXT_DATA_DETECTOR_TYPE_ADDRESS: ArkUI_TextDataDetectorType = @@ -2475,13 +3412,19 @@ impl ArkUI_TextDataDetectorType { /** @brief Defines the entity type for text recognition. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_TextDataDetectorType(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_SwiperIndicatorType { /// dot type. pub const ARKUI_SWIPER_INDICATOR_TYPE_DOT: ArkUI_SwiperIndicatorType = ArkUI_SwiperIndicatorType(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_SwiperIndicatorType { /// digit type. pub const ARKUI_SWIPER_INDICATOR_TYPE_DIGIT: ArkUI_SwiperIndicatorType = @@ -2491,20 +3434,28 @@ impl ArkUI_SwiperIndicatorType { /** @brief Define the navigation indicator type of the swiper. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_SwiperIndicatorType(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ListItemSwipeActionState { /** In the folded state, when the ListItem slides in the opposite direction to the main axis, the operation item is hidden.*/ pub const ARKUI_LIST_ITEM_SWIPE_ACTION_STATE_COLLAPSED: ArkUI_ListItemSwipeActionState = ArkUI_ListItemSwipeActionState(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ListItemSwipeActionState { /** In the folded state, when the ListItem slides in the opposite direction to the spindle, the operation item is displayed.*/ pub const ARKUI_LIST_ITEM_SWIPE_ACTION_STATE_EXPANDED: ArkUI_ListItemSwipeActionState = ArkUI_ListItemSwipeActionState(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ListItemSwipeActionState { /// Long distance state, the state of deleting a ListItem after it enters the long distance deletion area. pub const ARKUI_LIST_ITEM_SWIPE_ACTION_STATE_ACTIONING: ArkUI_ListItemSwipeActionState = @@ -2514,13 +3465,19 @@ impl ArkUI_ListItemSwipeActionState { /** @brief Define the pattern of element arrangement in the main axis direction of the Swiper component. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_ListItemSwipeActionState(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ListItemSwipeEdgeEffect { /// The ListItem can continue to be scratched after the distance exceeds the size of the scratched component. pub const ARKUI_LIST_ITEM_SWIPE_EDGE_EFFECT_SPRING: ArkUI_ListItemSwipeEdgeEffect = ArkUI_ListItemSwipeEdgeEffect(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ListItemSwipeEdgeEffect { /// The sliding distance of the ListItem cannot exceed the size of the scratched component. pub const ARKUI_LIST_ITEM_SWIPE_EDGE_EFFECT_NONE: ArkUI_ListItemSwipeEdgeEffect = @@ -2530,66 +3487,98 @@ impl ArkUI_ListItemSwipeEdgeEffect { /** @brief Define the explicit and implicit mode of the SwipeAction method for the Listitem component. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_ListItemSwipeEdgeEffect(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ErrorCode { /// @error No errors. pub const ARKUI_ERROR_CODE_NO_ERROR: ArkUI_ErrorCode = ArkUI_ErrorCode(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ErrorCode { /// @error Parameter error. pub const ARKUI_ERROR_CODE_PARAM_INVALID: ArkUI_ErrorCode = ArkUI_ErrorCode(401); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ErrorCode { /// @error The component does not support specific properties or events. pub const ARKUI_ERROR_CODE_ATTRIBUTE_OR_EVENT_NOT_SUPPORTED: ArkUI_ErrorCode = ArkUI_ErrorCode(106102); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ErrorCode { /// @error The corresponding operation does not support nodes created by ArkTS. pub const ARKUI_ERROR_CODE_ARKTS_NODE_NOT_SUPPORTED: ArkUI_ErrorCode = ArkUI_ErrorCode(106103); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ErrorCode { /// @error The lazy loading adapter is not bound to the component. pub const ARKUI_ERROR_CODE_ADAPTER_NOT_BOUND: ArkUI_ErrorCode = ArkUI_ErrorCode(106104); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ErrorCode { /// @error The adapter already exists. pub const ARKUI_ERROR_CODE_ADAPTER_EXIST: ArkUI_ErrorCode = ArkUI_ErrorCode(106105); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ErrorCode { /// @error The corresponding node already has a child node and cannot add an adapter. pub const ARKUI_ERROR_CODE_CHILD_NODE_EXIST: ArkUI_ErrorCode = ArkUI_ErrorCode(106106); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ErrorCode { /// The parameter length in the parameter event exceeds the limit. pub const ARKUI_ERROR_CODE_NODE_EVENT_PARAM_INDEX_OUT_OF_RANGE: ArkUI_ErrorCode = ArkUI_ErrorCode(106107); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ErrorCode { /// The data does not exist in the component event. pub const ARKUI_ERROR_CODE_NODE_EVENT_PARAM_INVALID: ArkUI_ErrorCode = ArkUI_ErrorCode(106108); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ErrorCode { /// The component event does not support return values. pub const ARKUI_ERROR_CODE_NODE_EVENT_NO_RETURN: ArkUI_ErrorCode = ArkUI_ErrorCode(106109); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ErrorCode { /// The index value is invalid. pub const ARKUI_ERROR_CODE_NODE_INDEX_INVALID: ArkUI_ErrorCode = ArkUI_ErrorCode(106200); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ErrorCode { /// Failed to query route navigation information. pub const ARKUI_ERROR_CODE_GET_INFO_FAILED: ArkUI_ErrorCode = ArkUI_ErrorCode(106201); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ErrorCode { /// The buffer size is not large enough. pub const ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR: ArkUI_ErrorCode = ArkUI_ErrorCode(106202); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ErrorCode { /// The component is not a scroll container. pub const ARKUI_ERROR_CODE_NON_SCROLLABLE_CONTAINER: ArkUI_ErrorCode = ArkUI_ErrorCode(180001); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ErrorCode { /// The buffer is not large enough. pub const ARKUI_ERROR_CODE_BUFFER_SIZE_NOT_ENOUGH: ArkUI_ErrorCode = ArkUI_ErrorCode(180002); @@ -2598,20 +3587,30 @@ impl ArkUI_ErrorCode { /** @brief Define error code enumeration values. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_ErrorCode(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_AnimationStatus { /// The animation is in the initial state. pub const ARKUI_ANIMATION_STATUS_INITIAL: ArkUI_AnimationStatus = ArkUI_AnimationStatus(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_AnimationStatus { /// The animation is being played. pub const ARKUI_ANIMATION_STATUS_RUNNING: ArkUI_AnimationStatus = ArkUI_AnimationStatus(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_AnimationStatus { /// The animation is paused. pub const ARKUI_ANIMATION_STATUS_PAUSED: ArkUI_AnimationStatus = ArkUI_AnimationStatus(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_AnimationStatus { /// The animation is stopped. pub const ARKUI_ANIMATION_STATUS_STOPPED: ArkUI_AnimationStatus = ArkUI_AnimationStatus(3); @@ -2620,25 +3619,35 @@ impl ArkUI_AnimationStatus { /** @brief Defines the playback status for the image animator. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_AnimationStatus(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_AnimationFillMode { /** Before execution, the animation does not apply any styles to the target component. After execution, the animation restores the target component to its default state.*/ pub const ARKUI_ANIMATION_FILL_MODE_NONE: ArkUI_AnimationFillMode = ArkUI_AnimationFillMode(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_AnimationFillMode { /** The target component retains the state set by the last keyframe encountered during execution of the animation.*/ pub const ARKUI_ANIMATION_FILL_MODE_FORWARDS: ArkUI_AnimationFillMode = ArkUI_AnimationFillMode(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_AnimationFillMode { /** The animation applies the values defined in the first relevant keyframe once it is applied to the target component, and retains the values during the period set by delay.*/ pub const ARKUI_ANIMATION_FILL_MODE_BACKWARDS: ArkUI_AnimationFillMode = ArkUI_AnimationFillMode(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_AnimationFillMode { /** The animation follows the rules for both Forwards and Backwards, extending the animation attributes in both directions.*/ @@ -2648,13 +3657,19 @@ impl ArkUI_AnimationFillMode { /** @brief Defines the status before and after execution of the animation in the current playback direction. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_AnimationFillMode(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_AccessibilityCheckedState { /// The Checkbox unchecked. pub const ARKUI_ACCESSIBILITY_UNCHECKED: ArkUI_AccessibilityCheckedState = ArkUI_AccessibilityCheckedState(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_AccessibilityCheckedState { /// The Checkbox checked. pub const ARKUI_ACCESSIBILITY_CHECKED: ArkUI_AccessibilityCheckedState = @@ -2664,28 +3679,40 @@ impl ArkUI_AccessibilityCheckedState { /** @brief Defines the state type for the accessibility checkbox. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_AccessibilityCheckedState(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_AccessibilityActionType { /// click action. pub const ARKUI_ACCESSIBILITY_ACTION_CLICK: ArkUI_AccessibilityActionType = ArkUI_AccessibilityActionType(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_AccessibilityActionType { /// long click action. pub const ARKUI_ACCESSIBILITY_ACTION_LONG_CLICK: ArkUI_AccessibilityActionType = ArkUI_AccessibilityActionType(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_AccessibilityActionType { /// cut action. pub const ARKUI_ACCESSIBILITY_ACTION_CUT: ArkUI_AccessibilityActionType = ArkUI_AccessibilityActionType(4); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_AccessibilityActionType { /// copy action. pub const ARKUI_ACCESSIBILITY_ACTION_COPY: ArkUI_AccessibilityActionType = ArkUI_AccessibilityActionType(8); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_AccessibilityActionType { /// paste action. pub const ARKUI_ACCESSIBILITY_ACTION_PASTE: ArkUI_AccessibilityActionType = @@ -2695,18 +3722,26 @@ impl ArkUI_AccessibilityActionType { /** @brief Define accessible action types. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_AccessibilityActionType(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_AnimationDirection { /// The animation plays in forward loop mode. pub const ARKUI_ANIMATION_DIRECTION_NORMAL: ArkUI_AnimationDirection = ArkUI_AnimationDirection(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_AnimationDirection { /// The animation plays in reverse loop mode. pub const ARKUI_ANIMATION_DIRECTION_REVERSE: ArkUI_AnimationDirection = ArkUI_AnimationDirection(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_AnimationDirection { /** The animation plays in alternating loop mode. When the animation is played for an odd number of times, the playback is in forward direction. When the animation is played for an even number of times, the playback is in @@ -2714,6 +3749,8 @@ impl ArkUI_AnimationDirection { pub const ARKUI_ANIMATION_DIRECTION_ALTERNATE: ArkUI_AnimationDirection = ArkUI_AnimationDirection(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_AnimationDirection { /** The animation plays in reverse alternating loop mode. When the animation is played for an odd number of times, the playback is in reverse direction. When the animation is played for an even number of times, the playback is @@ -2725,36 +3762,54 @@ impl ArkUI_AnimationDirection { /** @brief Enumerates the animation playback modes. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_AnimationDirection(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ScrollSource { /// Finger drag. pub const ARKUI_SCROLL_SOURCE_DRAG: ArkUI_ScrollSource = ArkUI_ScrollSource(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ScrollSource { /// Inertial roll after finger drag. pub const ARKUI_SCROLL_SOURCE_FLING: ArkUI_ScrollSource = ArkUI_ScrollSource(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ScrollSource { /// Execute the EdgeEffect.Spring edge effect when crossing the boundary. pub const ARKUI_SCROLL_SOURCE_EDGE_EFFECT: ArkUI_ScrollSource = ArkUI_ScrollSource(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ScrollSource { /// Other user input other than dragging, such as mouse wheel, keyboard events, etc. pub const ARKUI_SCROLL_SOURCE_OTHER_USER_INPUT: ArkUI_ScrollSource = ArkUI_ScrollSource(3); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ScrollSource { /// Drag the scroll bar. pub const ARKUI_SCROLL_SOURCE_SCROLL_BAR: ArkUI_ScrollSource = ArkUI_ScrollSource(4); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ScrollSource { /// Inertia scrolling after dragging the scroll bar. pub const ARKUI_SCROLL_SOURCE_SCROLL_BAR_FLING: ArkUI_ScrollSource = ArkUI_ScrollSource(5); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ScrollSource { /// The scroll controller causes unanimated scrolling. pub const ARKUI_SCROLL_SOURCE_SCROLLER: ArkUI_ScrollSource = ArkUI_ScrollSource(6); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ScrollSource { /// The scroll controller causes the scroll to drive the painting. pub const ARKUI_SCROLL_SOURCE_ANIMATION: ArkUI_ScrollSource = ArkUI_ScrollSource(7); @@ -2763,12 +3818,17 @@ impl ArkUI_ScrollSource { /** @brief Define the rolling source enumeration value. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_ScrollSource(pub ::core::ffi::c_uint); /** @brief Defines the translation options for component transition. @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] #[repr(C)] +#[derive(Copy, Clone)] pub struct ArkUI_TranslationOptions { /// Translation distance along the x-axis. pub x: f32, @@ -2780,7 +3840,10 @@ pub struct ArkUI_TranslationOptions { /** @brief Defines the scaling options for component transition. @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] #[repr(C)] +#[derive(Copy, Clone)] pub struct ArkUI_ScaleOptions { /// Scale ratio along the x-axis. pub x: f32, @@ -2796,7 +3859,10 @@ pub struct ArkUI_ScaleOptions { /** @brief Defines the rotation options for component transition. @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] #[repr(C)] +#[derive(Copy, Clone)] pub struct ArkUI_RotationOptions { /// X-component of the rotation vector. pub x: f32, @@ -2827,46 +3893,64 @@ pub struct ArkUI_CustomSpanMetrics { pub struct ArkUI_CustomSpanDrawInfo { _unused: [u8; 0], } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_NavDestinationState { /// The NavDestination show. pub const ARKUI_NAV_DESTINATION_STATE_ON_SHOW: ArkUI_NavDestinationState = ArkUI_NavDestinationState(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_NavDestinationState { /// The NavDestination hide. pub const ARKUI_NAV_DESTINATION_STATE_ON_HIDE: ArkUI_NavDestinationState = ArkUI_NavDestinationState(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_NavDestinationState { /// The NavDestination is mounted to the component tree. pub const ARKUI_NAV_DESTINATION_STATE_ON_APPEAR: ArkUI_NavDestinationState = ArkUI_NavDestinationState(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_NavDestinationState { /// The NavDestination removed from the component tree. pub const ARKUI_NAV_DESTINATION_STATE_ON_DISAPPEAR: ArkUI_NavDestinationState = ArkUI_NavDestinationState(3); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_NavDestinationState { /// Before the NavDestination show. pub const ARKUI_NAV_DESTINATION_STATE_ON_WILL_SHOW: ArkUI_NavDestinationState = ArkUI_NavDestinationState(4); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_NavDestinationState { /// Before the NavDestination hide. pub const ARKUI_NAV_DESTINATION_STATE_ON_WILL_HIDE: ArkUI_NavDestinationState = ArkUI_NavDestinationState(5); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_NavDestinationState { /// Before the NavDestination mount to the component tree. pub const ARKUI_NAV_DESTINATION_STATE_ON_WILL_APPEAR: ArkUI_NavDestinationState = ArkUI_NavDestinationState(6); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_NavDestinationState { /// Before the NavDestination removed from the component tree. pub const ARKUI_NAV_DESTINATION_STATE_ON_WILL_DISAPPEAR: ArkUI_NavDestinationState = ArkUI_NavDestinationState(7); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_NavDestinationState { /// The NavDestination returns from the component. pub const ARKUI_NAV_DESTINATION_STATE_ON_BACK_PRESS: ArkUI_NavDestinationState = @@ -2876,26 +3960,38 @@ impl ArkUI_NavDestinationState { /** @brief Defines the state of the NavDestination component. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_NavDestinationState(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_RouterPageState { /// The Router Page is about to be created. pub const ARKUI_ROUTER_PAGE_STATE_ABOUT_TO_APPEAR: ArkUI_RouterPageState = ArkUI_RouterPageState(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_RouterPageState { /// The Router Page is about to be destroyed. pub const ARKUI_ROUTER_PAGE_STATE_ABOUT_TO_DISAPPEAR: ArkUI_RouterPageState = ArkUI_RouterPageState(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_RouterPageState { /// The Router Page show. pub const ARKUI_ROUTER_PAGE_STATE_ON_SHOW: ArkUI_RouterPageState = ArkUI_RouterPageState(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_RouterPageState { /// The Router Page hide. pub const ARKUI_ROUTER_PAGE_STATE_ON_HIDE: ArkUI_RouterPageState = ArkUI_RouterPageState(3); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_RouterPageState { /// The Router Page returns. pub const ARKUI_ROUTER_PAGE_STATE_ON_BACK_PRESS: ArkUI_RouterPageState = @@ -2905,16 +4001,24 @@ impl ArkUI_RouterPageState { /** @brief Define the state of Router Page. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_RouterPageState(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_SafeAreaType { /// The default security zone includes the status bar and navigation bar. pub const ARKUI_SAFE_AREA_TYPE_SYSTEM: ArkUI_SafeAreaType = ArkUI_SafeAreaType(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_SafeAreaType { /// Non-secure areas of the device, such as bangs or hole holes. pub const ARKUI_SAFE_AREA_TYPE_CUTOUT: ArkUI_SafeAreaType = ArkUI_SafeAreaType(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_SafeAreaType { /// Soft keyboard area. pub const ARKUI_SAFE_AREA_TYPE_KEYBOARD: ArkUI_SafeAreaType = ArkUI_SafeAreaType(4); @@ -2923,20 +4027,30 @@ impl ArkUI_SafeAreaType { /** @brief defines the enumerated value of the extended security zone. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_SafeAreaType(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_SafeAreaEdge { /// Upper area. pub const ARKUI_SAFE_AREA_EDGE_TOP: ArkUI_SafeAreaEdge = ArkUI_SafeAreaEdge(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_SafeAreaEdge { /// Lower area. pub const ARKUI_SAFE_AREA_EDGE_BOTTOM: ArkUI_SafeAreaEdge = ArkUI_SafeAreaEdge(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_SafeAreaEdge { /// Front area. pub const ARKUI_SAFE_AREA_EDGE_START: ArkUI_SafeAreaEdge = ArkUI_SafeAreaEdge(4); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_SafeAreaEdge { /// Tail area. pub const ARKUI_SAFE_AREA_EDGE_END: ArkUI_SafeAreaEdge = ArkUI_SafeAreaEdge(8); @@ -2945,7 +4059,9 @@ impl ArkUI_SafeAreaEdge { /** @brief defines the enumerated value of the direction of the extended security zone. @since 12*/ -#[derive(Clone, Hash, PartialEq, Eq)] +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Copy, Clone, Hash, PartialEq, Eq)] pub struct ArkUI_SafeAreaEdge(pub ::core::ffi::c_uint); #[repr(C)] pub struct ArkUI_SystemFontStyleEvent { @@ -2955,12 +4071,16 @@ extern "C" { /** @brief Creates a size constraint. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_LayoutConstraint_Create() -> *mut ArkUI_LayoutConstraint; /** @brief Creates a deep copy of a size constraint. @param Constraint Indicates the pointer to the size constraint. @return Returns the pointer to the new size constraint. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_LayoutConstraint_Copy( Constraint: *const ArkUI_LayoutConstraint, ) -> *mut ArkUI_LayoutConstraint; @@ -2968,6 +4088,8 @@ extern "C" { @param Constraint Indicates the pointer to the size constraint. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_LayoutConstraint_Dispose( Constraint: *mut ArkUI_LayoutConstraint, ) -> *mut ::core::ffi::c_void; @@ -2976,18 +4098,24 @@ extern "C" { @param Constraint Indicates the pointer to the size constraint. @return Returns the maximum width. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_LayoutConstraint_GetMaxWidth(Constraint: *const ArkUI_LayoutConstraint) -> i32; /** @brief Obtains the minimum width for a size constraint, in px. @param Constraint Indicates the pointer to the size constraint. @return Returns the minimum width. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_LayoutConstraint_GetMinWidth(Constraint: *const ArkUI_LayoutConstraint) -> i32; /** @brief Obtains the maximum height for a size constraint, in px. @param Constraint Indicates the pointer to the size constraint. @return Returns the maximum height. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_LayoutConstraint_GetMaxHeight(Constraint: *const ArkUI_LayoutConstraint) -> i32; /** @brief Obtains the minimum height for a size constraint, in px. @@ -2995,6 +4123,8 @@ extern "C" { @param Constraint Indicates the pointer to the size constraint. @return Returns the minimum height. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_LayoutConstraint_GetMinHeight(Constraint: *const ArkUI_LayoutConstraint) -> i32; /** @brief Obtains the width percentage reference for a size constraint, in px. @@ -3002,6 +4132,8 @@ extern "C" { @param Constraint Indicates the pointer to the size constraint. @return Returns the width percentage reference. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_LayoutConstraint_GetPercentReferenceWidth( Constraint: *const ArkUI_LayoutConstraint, ) -> i32; @@ -3010,6 +4142,8 @@ extern "C" { @param Constraint Indicates the pointer to the size constraint. @return Returns the height percentage reference. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_LayoutConstraint_GetPercentReferenceHeight( Constraint: *const ArkUI_LayoutConstraint, ) -> i32; @@ -3018,6 +4152,8 @@ extern "C" { @param Constraint Indicates the pointer to the size constraint. @param value Indicates the maximum width, in px. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_LayoutConstraint_SetMaxWidth( Constraint: *mut ArkUI_LayoutConstraint, value: i32, @@ -3027,6 +4163,8 @@ extern "C" { @param Constraint Indicates the pointer to the size constraint. @param value Indicates the minimum width, in px. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_LayoutConstraint_SetMinWidth( Constraint: *mut ArkUI_LayoutConstraint, value: i32, @@ -3036,6 +4174,8 @@ extern "C" { @param Constraint Indicates the pointer to the size constraint. @param value Indicates the maximum height, in px. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_LayoutConstraint_SetMaxHeight( Constraint: *mut ArkUI_LayoutConstraint, value: i32, @@ -3045,6 +4185,8 @@ extern "C" { @param Constraint Indicates the pointer to the size constraint. @param value Indicates the minimum height, in px. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_LayoutConstraint_SetMinHeight( Constraint: *mut ArkUI_LayoutConstraint, value: i32, @@ -3054,6 +4196,8 @@ extern "C" { @param Constraint Indicates the pointer to the size constraint. @param value Indicates the width percentage reference, in px. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_LayoutConstraint_SetPercentReferenceWidth( Constraint: *mut ArkUI_LayoutConstraint, value: i32, @@ -3063,6 +4207,8 @@ extern "C" { @param Constraint Indicates the pointer to the size constraint. @param value Indicates the height percentage reference, in px. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_LayoutConstraint_SetPercentReferenceHeight( Constraint: *mut ArkUI_LayoutConstraint, value: i32, @@ -3073,6 +4219,8 @@ extern "C" { @param context Indicates the pointer to the drawing context. @return Returns the pointer to the canvas for drawing. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_DrawContext_GetCanvas( context: *mut ArkUI_DrawContext, ) -> *mut ::core::ffi::c_void; @@ -3081,22 +4229,30 @@ extern "C" { @param context Indicates the pointer to the drawing context. @return Returns the size of the drawing area. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_DrawContext_GetSize(context: *mut ArkUI_DrawContext) -> ArkUI_IntSize; /** @brief Creates water flow section configuration. @return Returns the water flow section configuration. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_WaterFlowSectionOption_Create() -> *mut ArkUI_WaterFlowSectionOption; /** @brief Destroys the pointer to a water flow section configuration. @param option Indicates the pointer to a water flow section configuration. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_WaterFlowSectionOption_Dispose(option: *mut ArkUI_WaterFlowSectionOption); /** @brief Sets the FlowItem block configuration information array length. @param option FlowItem Indicates the packet configuration. @param size Array Length. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_WaterFlowSectionOption_SetSize( option: *mut ArkUI_WaterFlowSectionOption, size: i32, @@ -3107,6 +4263,8 @@ extern "C" { @return Array size. If -1 is returned, the return fails. The possible cause of the failure is that the option parameter is abnormal, such as a null pointer. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_WaterFlowSectionOption_GetSize( option: *mut ArkUI_WaterFlowSectionOption, ) -> i32; @@ -3116,6 +4274,8 @@ extern "C" { @param index Indicates the index of the target water flow section. @param itemCount Indicates the number of items in the water flow section. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_WaterFlowSectionOption_SetItemCount( option: *mut ArkUI_WaterFlowSectionOption, index: i32, @@ -3127,6 +4287,8 @@ extern "C" { @param index Indicates the index of the target water flow section. @return Returns the number of items in the water flow section. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_WaterFlowSectionOption_GetItemCount( option: *mut ArkUI_WaterFlowSectionOption, index: i32, @@ -3138,6 +4300,8 @@ extern "C" { @param index Indicates the index of the target water flow section. @param callback Gets the spindle size of the specified Item based on index. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_WaterFlowSectionOption_RegisterGetItemMainSizeCallbackByIndex( option: *mut ArkUI_WaterFlowSectionOption, index: i32, @@ -3151,6 +4315,8 @@ extern "C" { @param userData FlowItem Custom data. @param callback Gets the spindle size of the specified Item based on index. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_WaterFlowSectionOption_RegisterGetItemMainSizeCallbackByIndexWithUserData( option: *mut ArkUI_WaterFlowSectionOption, index: i32, @@ -3165,6 +4331,8 @@ extern "C" { @param index Indicates the index of the target water flow section. @param crossCount Indicates the number of columns or rows, depending on the layout direction. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_WaterFlowSectionOption_SetCrossCount( option: *mut ArkUI_WaterFlowSectionOption, index: i32, @@ -3177,6 +4345,8 @@ extern "C" { @param index Indicates the index of the target water flow section. @return Returns the number of columns or rows. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_WaterFlowSectionOption_GetCrossCount( option: *mut ArkUI_WaterFlowSectionOption, index: i32, @@ -3187,6 +4357,8 @@ extern "C" { @param index Indicates the index of the target water flow section. @param columnGap Indicates the gap between columns to set. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_WaterFlowSectionOption_SetColumnGap( option: *mut ArkUI_WaterFlowSectionOption, index: i32, @@ -3198,6 +4370,8 @@ extern "C" { @param index Indicates the index of the target water flow section. @return Returns the gap between columns. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_WaterFlowSectionOption_GetColumnGap( option: *mut ArkUI_WaterFlowSectionOption, index: i32, @@ -3208,6 +4382,8 @@ extern "C" { @param index Indicates the index of the target water flow section. @param rowGap Indicates the gap between rows to set. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_WaterFlowSectionOption_SetRowGap( option: *mut ArkUI_WaterFlowSectionOption, index: i32, @@ -3219,6 +4395,8 @@ extern "C" { @param index Indicates the index of the target water flow section. @return Returns the gap between rows. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_WaterFlowSectionOption_GetRowGap( option: *mut ArkUI_WaterFlowSectionOption, index: i32, @@ -3232,6 +4410,8 @@ extern "C" { @param marginBottom Indicates the bottom margin of the water flow section. @param marginLeft Indicates the left margin of the water flow section. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_WaterFlowSectionOption_SetMargin( option: *mut ArkUI_WaterFlowSectionOption, index: i32, @@ -3246,6 +4426,8 @@ extern "C" { @param index Indicates the index of the target water flow section. @return Returns the margins. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_WaterFlowSectionOption_GetMargin( option: *mut ArkUI_WaterFlowSectionOption, index: i32, @@ -3255,6 +4437,8 @@ extern "C" { @param type Indicates the type of the indicator. @return Returns the pointer to the new indicator. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_SwiperIndicator_Create( type_: ArkUI_SwiperIndicatorType, ) -> *mut ArkUI_SwiperIndicator; @@ -3262,12 +4446,16 @@ extern "C" { @param indicator Indicates the pointer to the indicator. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_SwiperIndicator_Dispose(indicator: *mut ArkUI_SwiperIndicator); /** @brief Sets the distance between the navigation point and the start of the swiper. @param indicator Indicates the pointer to the indicator. @param value Indicates the distance between the navigation point and the start of the swiper. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_SwiperIndicator_SetStartPosition( indicator: *mut ArkUI_SwiperIndicator, value: f32, @@ -3277,12 +4465,16 @@ extern "C" { @param indicator Indicates the pointer to the indicator. @return Returns the distance between the navigation point and the start of the swiper. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_SwiperIndicator_GetStartPosition(indicator: *mut ArkUI_SwiperIndicator) -> f32; /** @brief Sets the distance between the navigation point and the top of the swiper. @param indicator Indicates the pointer to the indicator. @param value Indicates the distance between the navigation point and the top of the swiper. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_SwiperIndicator_SetTopPosition( indicator: *mut ArkUI_SwiperIndicator, value: f32, @@ -3292,12 +4484,16 @@ extern "C" { @param indicator Indicates the pointer to the indicator. @return Returns the distance between the navigation point and the top of the swiper. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_SwiperIndicator_GetTopPosition(indicator: *mut ArkUI_SwiperIndicator) -> f32; /** @brief Sets the distance between the navigation point and the right of the swiper. @param indicator Indicates the pointer to the indicator. @param value Indicates the distance between the navigation point and the right of the swiper. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_SwiperIndicator_SetEndPosition( indicator: *mut ArkUI_SwiperIndicator, value: f32, @@ -3307,12 +4503,16 @@ extern "C" { @param indicator Indicates the pointer to the indicator. @return Returns the distance between the navigation point and the end of the swiper. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_SwiperIndicator_GetEndPosition(indicator: *mut ArkUI_SwiperIndicator) -> f32; /** @brief Sets the distance between the navigation point and the bottom of the swiper. @param indicator Indicates the pointer to the indicator. @param value Indicates the distance between the navigation point and the bottom of the swiper. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_SwiperIndicator_SetBottomPosition( indicator: *mut ArkUI_SwiperIndicator, value: f32, @@ -3322,6 +4522,8 @@ extern "C" { @param indicator Indicates the pointer to the indicator. @return Returns the distance between the navigation point and the bottom of the swiper. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_SwiperIndicator_GetBottomPosition(indicator: *mut ArkUI_SwiperIndicator) -> f32; /** @brief Sets the width of the dot for the dot indicator. @@ -3329,18 +4531,24 @@ extern "C" { @param indicator Indicates the pointer to the indicator. @param value Indicates the width of the dot for the dot indicator. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_SwiperIndicator_SetItemWidth(indicator: *mut ArkUI_SwiperIndicator, value: f32); /** @brief Obtains the width of the dot for the dot indicator. @param indicator Indicates the pointer to the indicator. @return Returns the width of the dot for the dot indicator. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_SwiperIndicator_GetItemWidth(indicator: *mut ArkUI_SwiperIndicator) -> f32; /** @brief Sets the height of the dot for the dot indicator. @param indicator Indicates the pointer to the indicator. @param value Indicates the height of the dot for the dot indicator. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_SwiperIndicator_SetItemHeight( indicator: *mut ArkUI_SwiperIndicator, value: f32, @@ -3350,12 +4558,16 @@ extern "C" { @param indicator Indicates the pointer to the indicator. @return Returns the height of the dot for the dot indicator. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_SwiperIndicator_GetItemHeight(indicator: *mut ArkUI_SwiperIndicator) -> f32; /** @brief Sets the width of the selected dot for the dot indicator. @param indicator Indicates the pointer to the indicator. @param value Indicates the width of the selected dot for the dot indicator. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_SwiperIndicator_SetSelectedItemWidth( indicator: *mut ArkUI_SwiperIndicator, value: f32, @@ -3365,6 +4577,8 @@ extern "C" { @param indicator Indicates the pointer to the indicator. @return Returns the width of the selected dot for the dot indicator. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_SwiperIndicator_GetSelectedItemWidth( indicator: *mut ArkUI_SwiperIndicator, ) -> f32; @@ -3373,6 +4587,8 @@ extern "C" { @param indicator Indicates the pointer to the indicator. @param value Indicates the height of the selected dot for the dot indicator. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_SwiperIndicator_SetSelectedItemHeight( indicator: *mut ArkUI_SwiperIndicator, value: f32, @@ -3382,6 +4598,8 @@ extern "C" { @param indicator Indicates the pointer to the indicator. @return Returns the height of the selected dot for the dot indicator. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_SwiperIndicator_GetSelectedItemHeight( indicator: *mut ArkUI_SwiperIndicator, ) -> f32; @@ -3390,30 +4608,40 @@ extern "C" { @param indicator Indicates the pointer to the indicator. @param mask Whether to display the mask style. True means to display. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_SwiperIndicator_SetMask(indicator: *mut ArkUI_SwiperIndicator, mask: i32); /** @brief Obtains whether to display the mask style of the dot navigation indicator. @param indicator Indicates the pointer to the indicator. @return Returns whether to display the mask style. True means to display. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_SwiperIndicator_GetMask(indicator: *mut ArkUI_SwiperIndicator) -> i32; /** @brief Sets the color of the dot navigation indicator. @param indicator Indicates the pointer to the indicator. @param color the color of the dot navigation indicator, in 0xARGB format. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_SwiperIndicator_SetColor(indicator: *mut ArkUI_SwiperIndicator, color: u32); /** @brief Obtains the color of the dot navigation indicator. @param indicator Indicates the pointer to the indicator. @return Returns the color of the dot navigation indicator, in 0xARGB format. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_SwiperIndicator_GetColor(indicator: *mut ArkUI_SwiperIndicator) -> u32; /** @brief Sets the color of the selected dot for the navigation indicator. @param indicator Indicates the pointer to the indicator. @param color the color of the selected dot, in 0xARGB format. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_SwiperIndicator_SetSelectedColor( indicator: *mut ArkUI_SwiperIndicator, selectedColor: u32, @@ -3423,6 +4651,8 @@ extern "C" { @param indicator Indicates the pointer to the indicator. @return Returns the color of the selected dot, in 0xARGB format. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_SwiperIndicator_GetSelectedColor(indicator: *mut ArkUI_SwiperIndicator) -> u32; /** @brief Sets the number of maxDisplayCount for the dot navigation indicator. @@ -3432,6 +4662,8 @@ extern "C" { {@link ARKUI_ERROR_CODE_PARAM_INVALID} indicator is null or maxDisplayCount less then 6 or maxDisplayCount more then 9 @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_SwiperIndicator_SetMaxDisplayCount( indicator: *mut ArkUI_SwiperIndicator, maxDisplayCount: i32, @@ -3442,6 +4674,8 @@ extern "C" { @return Returns the number of the maxDisplayCount, span is 6-9. 0 - indicator is null @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_SwiperIndicator_GetMaxDisplayCount( indicator: *mut ArkUI_SwiperIndicator, ) -> i32; @@ -3450,11 +4684,15 @@ extern "C" { @param size The number of auxiliary lines. @return auxiliary line information. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_GuidelineOption_Create(size: i32) -> *mut ArkUI_GuidelineOption; /** @brief Destroy auxiliary line information. @param guideline auxiliary line information. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_GuidelineOption_Dispose(guideline: *mut ArkUI_GuidelineOption); /** @brief Set the Id of the auxiliary line. @@ -3462,6 +4700,8 @@ extern "C" { @param value id, must be unique and cannot have the same name as the component in the container. @param index auxiliary line index value. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_GuidelineOption_SetId( guideline: *mut ArkUI_GuidelineOption, value: *const ::core::ffi::c_char, @@ -3473,6 +4713,8 @@ extern "C" { @param value direction. @param index auxiliary line index value. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_GuidelineOption_SetDirection( guideline: *mut ArkUI_GuidelineOption, value: ArkUI_Axis, @@ -3484,6 +4726,8 @@ extern "C" { @param value The distance from the left or top of the container. @param index auxiliary line index value. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_GuidelineOption_SetPositionStart( guideline: *mut ArkUI_GuidelineOption, value: f32, @@ -3495,6 +4739,8 @@ extern "C" { @param value The distance from the right side or bottom of the container. @param index auxiliary line index value. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_GuidelineOption_SetPositionEnd( guideline: *mut ArkUI_GuidelineOption, value: f32, @@ -3506,6 +4752,8 @@ extern "C" { @param index auxiliary line index value. @return Id. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_GuidelineOption_GetId( guideline: *mut ArkUI_GuidelineOption, index: i32, @@ -3516,6 +4764,8 @@ extern "C" { @param index auxiliary line index value. @return direction. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_GuidelineOption_GetDirection( guideline: *mut ArkUI_GuidelineOption, index: i32, @@ -3526,6 +4776,8 @@ extern "C" { @param index auxiliary line index value. @return The distance from the left or top of the container. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_GuidelineOption_GetPositionStart( guideline: *mut ArkUI_GuidelineOption, index: i32, @@ -3536,6 +4788,8 @@ extern "C" { @param index auxiliary line index value. @return The distance from the right side or bottom of the container. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_GuidelineOption_GetPositionEnd( guideline: *mut ArkUI_GuidelineOption, index: i32, @@ -3545,11 +4799,15 @@ extern "C" { @param size Number of barriers. @return barrier information. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_BarrierOption_Create(size: i32) -> *mut ArkUI_BarrierOption; /** @brief Destroy barrier information. @param barrierStyle barrier information. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_BarrierOption_Dispose(barrierStyle: *mut ArkUI_BarrierOption); /** @brief Set the Id of the barrier. @@ -3557,6 +4815,8 @@ extern "C" { @param value id, must be unique and cannot have the same name as the component in the container. @param index Barrier index value. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_BarrierOption_SetId( barrierStyle: *mut ArkUI_BarrierOption, value: *const ::core::ffi::c_char, @@ -3568,6 +4828,8 @@ extern "C" { @param value direction. @param index Barrier index value. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_BarrierOption_SetDirection( barrierStyle: *mut ArkUI_BarrierOption, value: ArkUI_BarrierDirection, @@ -3579,6 +4841,8 @@ extern "C" { @param value The ID of the dependent component. @param index Barrier index value. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_BarrierOption_SetReferencedId( barrierStyle: *mut ArkUI_BarrierOption, value: *const ::core::ffi::c_char, @@ -3590,6 +4854,8 @@ extern "C" { @param index auxiliary line index value. @return The Id of the barrier. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_BarrierOption_GetId( barrierStyle: *mut ArkUI_BarrierOption, index: i32, @@ -3600,6 +4866,8 @@ extern "C" { @param index auxiliary line index value. @return The direction of the barrier. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_BarrierOption_GetDirection( barrierStyle: *mut ArkUI_BarrierOption, index: i32, @@ -3611,6 +4879,8 @@ extern "C" { @param referencedIndex dependent component Id index value. @return The barrier's dependent components. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_BarrierOption_GetReferencedId( barrierStyle: *mut ArkUI_BarrierOption, index: i32, @@ -3622,6 +4892,8 @@ extern "C" { @param index auxiliary line index value. @return The number of dependent components of the barrier. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_BarrierOption_GetReferencedIdSize( barrierStyle: *mut ArkUI_BarrierOption, index: i32, @@ -3630,11 +4902,15 @@ extern "C" { @return Alignment rule information. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_AlignmentRuleOption_Create() -> *mut ArkUI_AlignmentRuleOption; /** @brief Destroys the alignment rule information of subcomponents in relative containers. @param option Alignment rule information of subcomponents in the relative container. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_AlignmentRuleOption_Dispose(option: *mut ArkUI_AlignmentRuleOption); /** @brief Set the start alignment parameter. @@ -3642,6 +4918,8 @@ extern "C" { @param id The id value of the anchor component. @param value Alignment relative to the anchor component. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_AlignmentRuleOption_SetStart( option: *mut ArkUI_AlignmentRuleOption, id: *const ::core::ffi::c_char, @@ -3653,6 +4931,8 @@ extern "C" { @param id The id value of the anchor component. @param value Alignment relative to the anchor component. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_AlignmentRuleOption_SetEnd( option: *mut ArkUI_AlignmentRuleOption, id: *const ::core::ffi::c_char, @@ -3664,6 +4944,8 @@ extern "C" { @param id The id value of the anchor component. @param value Alignment relative to anchor component @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_AlignmentRuleOption_SetCenterHorizontal( option: *mut ArkUI_AlignmentRuleOption, id: *const ::core::ffi::c_char, @@ -3675,6 +4957,8 @@ extern "C" { @param id The id value of the anchor component. @param value Alignment relative to anchor component @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_AlignmentRuleOption_SetTop( option: *mut ArkUI_AlignmentRuleOption, id: *const ::core::ffi::c_char, @@ -3686,6 +4970,8 @@ extern "C" { @param id The id value of the anchor component. @param value Alignment relative to anchor component @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_AlignmentRuleOption_SetBottom( option: *mut ArkUI_AlignmentRuleOption, id: *const ::core::ffi::c_char, @@ -3697,6 +4983,8 @@ extern "C" { @param id The id value of the anchor component. @param value Alignment relative to the anchor component. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_AlignmentRuleOption_SetCenterVertical( option: *mut ArkUI_AlignmentRuleOption, id: *const ::core::ffi::c_char, @@ -3707,6 +4995,8 @@ extern "C" { @param option Alignment rule information of subcomponents in the relative container. @param horizontal bias value in the horizontal direction. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_AlignmentRuleOption_SetBiasHorizontal( option: *mut ArkUI_AlignmentRuleOption, horizontal: f32, @@ -3716,6 +5006,8 @@ extern "C" { @param option Alignment rule information of subcomponents in the relative container. @param horizontal bias value in the vertical direction. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_AlignmentRuleOption_SetBiasVertical( option: *mut ArkUI_AlignmentRuleOption, vertical: f32, @@ -3725,6 +5017,8 @@ extern "C" { @param option Alignment rule information of subcomponents in the relative container. @return The id value of the anchor component. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_AlignmentRuleOption_GetStartId( option: *mut ArkUI_AlignmentRuleOption, ) -> *const ::core::ffi::c_char; @@ -3733,6 +5027,8 @@ extern "C" { @param option Alignment rule information of subcomponents in the relative container. @return The alignment of the parameters. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_AlignmentRuleOption_GetStartAlignment( option: *mut ArkUI_AlignmentRuleOption, ) -> ArkUI_HorizontalAlignment; @@ -3741,6 +5037,8 @@ extern "C" { @param option Alignment rule information of subcomponents in the relative container. @return End-aligned parameter id. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_AlignmentRuleOption_GetEndId( option: *mut ArkUI_AlignmentRuleOption, ) -> *const ::core::ffi::c_char; @@ -3749,6 +5047,8 @@ extern "C" { @param option Alignment rule information of subcomponents in the relative container. @return The alignment of the end-aligned parameter. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_AlignmentRuleOption_GetEndAlignment( option: *mut ArkUI_AlignmentRuleOption, ) -> ArkUI_HorizontalAlignment; @@ -3757,6 +5057,8 @@ extern "C" { @param option Alignment rule information of subcomponents in the relative container. @return The id of the parameter of horizontal center alignment. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_AlignmentRuleOption_GetCenterIdHorizontal( option: *mut ArkUI_AlignmentRuleOption, ) -> *const ::core::ffi::c_char; @@ -3765,6 +5067,8 @@ extern "C" { @param option Alignment rule information of subcomponents in the relative container. @return The alignment of the horizontally centered alignment parameter. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_AlignmentRuleOption_GetCenterAlignmentHorizontal( option: *mut ArkUI_AlignmentRuleOption, ) -> ArkUI_HorizontalAlignment; @@ -3773,6 +5077,8 @@ extern "C" { @param option Alignment rule information of subcomponents in the relative container. @return Top aligned parameter id. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_AlignmentRuleOption_GetTopId( option: *mut ArkUI_AlignmentRuleOption, ) -> *const ::core::ffi::c_char; @@ -3781,6 +5087,8 @@ extern "C" { @param option Alignment rule information of subcomponents in the relative container. @return The alignment of the top-aligned parameter. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_AlignmentRuleOption_GetTopAlignment( option: *mut ArkUI_AlignmentRuleOption, ) -> ArkUI_VerticalAlignment; @@ -3789,6 +5097,8 @@ extern "C" { @param option Alignment rule information of subcomponents in the relative container. @return The id of the bottom-aligned parameter. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_AlignmentRuleOption_GetBottomId( option: *mut ArkUI_AlignmentRuleOption, ) -> *const ::core::ffi::c_char; @@ -3797,6 +5107,8 @@ extern "C" { @param option Alignment rule information of subcomponents in the relative container. @return The alignment of the bottom-aligned parameter. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_AlignmentRuleOption_GetBottomAlignment( option: *mut ArkUI_AlignmentRuleOption, ) -> ArkUI_VerticalAlignment; @@ -3805,6 +5117,8 @@ extern "C" { @param option Alignment rule information of subcomponents in the relative container. @return The id of the vertical center alignment parameter. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_AlignmentRuleOption_GetCenterIdVertical( option: *mut ArkUI_AlignmentRuleOption, ) -> *const ::core::ffi::c_char; @@ -3813,6 +5127,8 @@ extern "C" { @param option Alignment rule information of subcomponents in the relative container. @return The alignment of the vertical center alignment parameter. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_AlignmentRuleOption_GetCenterAlignmentVertical( option: *mut ArkUI_AlignmentRuleOption, ) -> ArkUI_VerticalAlignment; @@ -3821,6 +5137,8 @@ extern "C" { @param option Alignment rule information of subcomponents in the relative container. @return The bias value in the horizontal direction. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_AlignmentRuleOption_GetBiasHorizontal( option: *mut ArkUI_AlignmentRuleOption, ) -> f32; @@ -3829,6 +5147,8 @@ extern "C" { @param option Alignment rule information of subcomponents in the relative container. @return bias value in vertical direction. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_AlignmentRuleOption_GetBiasVertical( option: *mut ArkUI_AlignmentRuleOption, ) -> f32; @@ -3837,17 +5157,23 @@ extern "C" { @return List Item SwipeActionItem configuration item instance. If the object returns a null pointer, it indicates creation failure, and the reason for the failure may be that the address space is full. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_ListItemSwipeActionItem_Create() -> *mut ArkUI_ListItemSwipeActionItem; /** @brief Destroy the ListitemSwipeActionItem instance. @param option List Item SwipeActionItem instance to be destroyed. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_ListItemSwipeActionItem_Dispose(item: *mut ArkUI_ListItemSwipeActionItem); /** @brief Set the layout content of ListItem SwipeActionItem. @param option List Item SwipeActionItem instance. @param builder Layout information. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_ListItemSwipeActionItem_SetContent( item: *mut ArkUI_ListItemSwipeActionItem, node: ArkUI_NodeHandle, @@ -3857,6 +5183,8 @@ extern "C" { @param option List Item SwipeActionItem instance. @param distance Component long-distance sliding deletion distance threshold. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_ListItemSwipeActionItem_SetActionAreaDistance( item: *mut ArkUI_ListItemSwipeActionItem, distance: f32, @@ -3867,6 +5195,8 @@ extern "C" { @return Component long-distance sliding deletion distance threshold. If -1.0f is returned, the return fails. The possible cause of the failure is that the item parameter is abnormal, such as a null pointer. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_ListItemSwipeActionItem_GetActionAreaDistance( item: *mut ArkUI_ListItemSwipeActionItem, ) -> f32; @@ -3875,6 +5205,8 @@ extern "C" { @param option List Item SwipeActionItem instance. @param callback Callback Events. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_ListItemSwipeActionItem_SetOnEnterActionArea( item: *mut ArkUI_ListItemSwipeActionItem, callback: ::core::option::Option, @@ -3885,6 +5217,8 @@ extern "C" { @param userData User defined data. @param callback Callback Events. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_ListItemSwipeActionItem_SetOnEnterActionAreaWithUserData( item: *mut ArkUI_ListItemSwipeActionItem, userData: *mut ::core::ffi::c_void, @@ -3895,6 +5229,8 @@ extern "C" { @param option List Item SwipeActionItem instance. @param callback Callback Events. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_ListItemSwipeActionItem_SetOnAction( item: *mut ArkUI_ListItemSwipeActionItem, callback: ::core::option::Option, @@ -3905,6 +5241,8 @@ extern "C" { @param userData User defined data. @param callback Callback Events. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_ListItemSwipeActionItem_SetOnActionWithUserData( item: *mut ArkUI_ListItemSwipeActionItem, userData: *mut ::core::ffi::c_void, @@ -3915,6 +5253,8 @@ extern "C" { @param option List Item SwipeActionItem instance. @param callback Callback Events. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_ListItemSwipeActionItem_SetOnExitActionArea( item: *mut ArkUI_ListItemSwipeActionItem, callback: ::core::option::Option, @@ -3925,6 +5265,8 @@ extern "C" { @param userData User defined data. @param callback Callback Events. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_ListItemSwipeActionItem_SetOnExitActionAreaWithUserData( item: *mut ArkUI_ListItemSwipeActionItem, userData: *mut ::core::ffi::c_void, @@ -3936,6 +5278,8 @@ extern "C" { @param callback Callback Events. swipeActionState The changed state. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_ListItemSwipeActionItem_SetOnStateChange( item: *mut ArkUI_ListItemSwipeActionItem, callback: ::core::option::Option< @@ -3949,6 +5293,8 @@ extern "C" { @param callback Callback Events. swipeActionState The changed state. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_ListItemSwipeActionItem_SetOnStateChangeWithUserData( item: *mut ArkUI_ListItemSwipeActionItem, userData: *mut ::core::ffi::c_void, @@ -3964,11 +5310,15 @@ extern "C" { @return List Item SwipeActionOption configuration item instance.If the object returns a null pointer, it indicates a creation failure, and the reason for the failure may be that the address space is full. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_ListItemSwipeActionOption_Create() -> *mut ArkUI_ListItemSwipeActionOption; /** @brief Destroy the ListitemSwipeActionOption instance. @param option List Item SwipeActionOption instance to be destroyed. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_ListItemSwipeActionOption_Dispose(option: *mut ArkUI_ListItemSwipeActionOption); /** @brief Set the layout content on the left (vertical layout) or top (horizontal layout) of the ListItem SwipeActionItem. @@ -3976,6 +5326,8 @@ extern "C" { @param option List Item SwipeActionItem instance. @param builder Layout information. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_ListItemSwipeActionOption_SetStart( option: *mut ArkUI_ListItemSwipeActionOption, item: *mut ArkUI_ListItemSwipeActionItem, @@ -3986,6 +5338,8 @@ extern "C" { @param option List Item SwipeActionItem instance. @param builder Layout information. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_ListItemSwipeActionOption_SetEnd( option: *mut ArkUI_ListItemSwipeActionOption, item: *mut ArkUI_ListItemSwipeActionItem, @@ -3995,6 +5349,8 @@ extern "C" { @param option List Item SwipeActionItem instance. @param edgeEffect Sliding effect. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_ListItemSwipeActionOption_SetEdgeEffect( option: *mut ArkUI_ListItemSwipeActionOption, edgeEffect: ArkUI_ListItemSwipeEdgeEffect, @@ -4005,6 +5361,8 @@ extern "C" { @return Sliding effect. The default return value is 0. If -1 is returned, the return fails. The possible cause of the failure is that the option parameter is abnormal, such as a null pointer. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_ListItemSwipeActionOption_GetEdgeEffect( option: *mut ArkUI_ListItemSwipeActionOption, ) -> i32; @@ -4014,6 +5372,8 @@ extern "C" { @param callback Callback Events. offset Slide offset. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_ListItemSwipeActionOption_SetOnOffsetChange( option: *mut ArkUI_ListItemSwipeActionOption, callback: ::core::option::Option, @@ -4025,6 +5385,8 @@ extern "C" { @param callback Callback Events. offset Slide offset. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_ListItemSwipeActionOption_SetOnOffsetChangeWithUserData( option: *mut ArkUI_ListItemSwipeActionOption, userData: *mut ::core::ffi::c_void, @@ -4037,11 +5399,15 @@ extern "C" { @return ListChildrenMainSize configuration item instance.If the object returns a null pointer, it indicates a creation failure, and the reason for the failure may be that the address space is full. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_ListChildrenMainSizeOption_Create() -> *mut ArkUI_ListChildrenMainSize; /** @brief Destroy the ListChildrenMainSize instance. @param option The ListChildrenMainSize instance to be destroyed. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_ListChildrenMainSizeOption_Dispose(option: *mut ArkUI_ListChildrenMainSize); /** @brief Set the default size of ChildrenMainSizeOption for the List component. @@ -4049,6 +5415,8 @@ extern "C" { @param defaultMainSize The default size of the ListItem under the List, measured in vp. @return 0 represents success. If defaultMainSize is less than 0 or option is a null pointer, return 401. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_ListChildrenMainSizeOption_SetDefaultMainSize( option: *mut ArkUI_ListChildrenMainSize, defaultMainSize: f32, @@ -4059,6 +5427,8 @@ extern "C" { @return The default size of the ListItem under the List is 0, measured in vp. When the option is a null pointer, it returns -1. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_ListChildrenMainSizeOption_GetDefaultMainSize( option: *mut ArkUI_ListChildrenMainSize, ) -> f32; @@ -4067,6 +5437,8 @@ extern "C" { @param option ListChildrenMainSize instance. @param totalSize Array size. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_ListChildrenMainSizeOption_Resize( option: *mut ArkUI_ListChildrenMainSize, totalSize: i32, @@ -4079,6 +5451,8 @@ extern "C" { @param addCount The number of MainSize arrays to be added starting from index. @return 0 represents success. If the function parameter is abnormal, return 401. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_ListChildrenMainSizeOption_Splice( option: *mut ArkUI_ListChildrenMainSize, index: i32, @@ -4092,6 +5466,8 @@ extern "C" { @param mainSize The actual modified value. @return 0 represents success. If the function parameter is abnormal, return 401. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_ListChildrenMainSizeOption_UpdateSize( option: *mut ArkUI_ListChildrenMainSize, index: i32, @@ -4103,6 +5479,8 @@ extern "C" { @param index The index position of the value to be obtained. @return The value of the specific position of the array. If the function parameter is abnormal, return -1. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_ListChildrenMainSizeOption_GetMainSize( option: *mut ArkUI_ListChildrenMainSize, index: i32, @@ -4112,11 +5490,15 @@ extern "C" { @return Returns a CustomSpanMeasureInfo instance.
If the result returns nullptr, there may be out of memory. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_CustomSpanMeasureInfo_Create() -> *mut ArkUI_CustomSpanMeasureInfo; /** @brief Disposes of measurement information of this custom span. @param info The CustomSpanMeasureInfo instance to be destroyed. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_CustomSpanMeasureInfo_Dispose(info: *mut ArkUI_CustomSpanMeasureInfo); /** @brief Obtains the font size of a custom span. @@ -4124,6 +5506,8 @@ extern "C" { @return Returns the font size. If a parameter error occurs, 0.0f is returned.
Possible causes: Parameter verification failed, the parameter should not be nullptr. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_CustomSpanMeasureInfo_GetFontSize( info: *mut ArkUI_CustomSpanMeasureInfo, ) -> f32; @@ -4132,11 +5516,15 @@ extern "C" { @return Returns a CustomSpanMetrics instance.
If the result returns nullptr, there may be out of memory. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_CustomSpanMetrics_Create() -> *mut ArkUI_CustomSpanMetrics; /** @brief Disposes of measurement metrics of this custom span. @param info The CustomSpanMetrics instance to be destroyed. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_CustomSpanMetrics_Dispose(metrics: *mut ArkUI_CustomSpanMetrics); /** @brief Sets the width for a custom span. @@ -4147,6 +5535,8 @@ extern "C" { Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs.
Possible causes: Parameter verification failed, the parameter should not be nullptr. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_CustomSpanMetrics_SetWidth( metrics: *mut ArkUI_CustomSpanMetrics, width: f32, @@ -4160,6 +5550,8 @@ extern "C" { Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs.
Possible causes: Parameter verification failed, the parameter should not be nullptr. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_CustomSpanMetrics_SetHeight( metrics: *mut ArkUI_CustomSpanMetrics, height: f32, @@ -4169,11 +5561,15 @@ extern "C" { @return Returns a CustomSpanDrawInfo instance.
If the result returns nullptr, there may be out of memory. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_CustomSpanDrawInfo_Create() -> *mut ArkUI_CustomSpanDrawInfo; /** @brief Disposes of drawing information for this custom span. @param info The CustomSpanDrawInfo instance to be destroyed. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_CustomSpanDrawInfo_Dispose(info: *mut ArkUI_CustomSpanDrawInfo); /** @brief Obtains the x-axis offset of the custom span relative to the mounted component. @@ -4181,6 +5577,8 @@ extern "C" { @return Returns the x-axis offset. If a parameter error occurs, 0.0f is returned.
Possible causes: Parameter verification failed, the parameter should not be nullptr. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_CustomSpanDrawInfo_GetXOffset(info: *mut ArkUI_CustomSpanDrawInfo) -> f32; /** @brief Obtains the top margin of the custom span relative to the mounted component. @@ -4188,6 +5586,8 @@ extern "C" { @return Returns the top margin. If a parameter error occurs, 0.0f is returned.
Possible causes: Parameter verification failed, the parameter should not be nullptr. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_CustomSpanDrawInfo_GetLineTop(info: *mut ArkUI_CustomSpanDrawInfo) -> f32; /** @brief Obtains the bottom margin of the custom span relative to the mounted component. @@ -4195,6 +5595,8 @@ extern "C" { @return Returns the bottom margin. If a parameter error occurs, 0.0f is returned.
Possible causes: Parameter verification failed, the parameter should not be nullptr. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_CustomSpanDrawInfo_GetLineBottom(info: *mut ArkUI_CustomSpanDrawInfo) -> f32; /** @brief Obtains the baseline offset of the custom span relative to the mounted component. @@ -4202,6 +5604,8 @@ extern "C" { @return Returns the baseline offset. If a parameter error occurs, 0.0f is returned.
Possible causes: Parameter verification failed, the parameter should not be nullptr. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_CustomSpanDrawInfo_GetBaseline(info: *mut ArkUI_CustomSpanDrawInfo) -> f32; /** @brief Create a image frame from the image path. @param src Indicates the image path. @@ -4209,6 +5613,8 @@ extern "C" { If a null pointer is returned, the object fails to be created. The possible cause is that the src parameter is abnormal, for example, the pointer is null. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_ImageAnimatorFrameInfo_CreateFromString( src: *mut ::core::ffi::c_char, ) -> *mut ArkUI_ImageAnimatorFrameInfo; @@ -4216,12 +5622,16 @@ extern "C" { @param imageInfo Indicates the pointer to the image frame. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_ImageAnimatorFrameInfo_Dispose(imageInfo: *mut ArkUI_ImageAnimatorFrameInfo); /** @brief Set the width of the image frame. @param imageInfo Indicates the pointer to the image frame. @param width Indicates the width of the image frame, and the unit is PX. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_ImageAnimatorFrameInfo_SetWidth( imageInfo: *mut ArkUI_ImageAnimatorFrameInfo, width: i32, @@ -4231,6 +5641,8 @@ extern "C" { @param imageInfo Indicates the pointer to the image frame. @return Return the width of the image frame, and the unit is PX. Return 0 when the imageInfo is null. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_ImageAnimatorFrameInfo_GetWidth( imageInfo: *mut ArkUI_ImageAnimatorFrameInfo, ) -> i32; @@ -4239,6 +5651,8 @@ extern "C" { @param imageInfo Indicates the pointer to the image frame. @param height Indicates the height of the image frame, and the unit is PX. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_ImageAnimatorFrameInfo_SetHeight( imageInfo: *mut ArkUI_ImageAnimatorFrameInfo, height: i32, @@ -4248,6 +5662,8 @@ extern "C" { @param imageInfo Indicates the pointer to the image frame. @return Return the height of the image frame, and the unit is PX. Return 0 when the imageInfo is null. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_ImageAnimatorFrameInfo_GetHeight( imageInfo: *mut ArkUI_ImageAnimatorFrameInfo, ) -> i32; @@ -4257,6 +5673,8 @@ extern "C" { @param top Indicates the vertical coordinate of the image relative to the upper left corner of the widget, and the unit is PX. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_ImageAnimatorFrameInfo_SetTop( imageInfo: *mut ArkUI_ImageAnimatorFrameInfo, top: i32, @@ -4267,6 +5685,8 @@ extern "C" { @return Returns the vertical coordinate of the image relative to the upper left corner of the widget, and the unit is PX. Return 0 when the imageInfo is null. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_ImageAnimatorFrameInfo_GetTop( imageInfo: *mut ArkUI_ImageAnimatorFrameInfo, ) -> i32; @@ -4276,6 +5696,8 @@ extern "C" { @param left Indicates the horizontal coordinate of the image relative to the upper left corner of the widget, and the unit is PX. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_ImageAnimatorFrameInfo_SetLeft( imageInfo: *mut ArkUI_ImageAnimatorFrameInfo, left: i32, @@ -4286,6 +5708,8 @@ extern "C" { @return Returns the horizontal coordinate of the image relative to the upper left corner of the widget, and the unit is PX. Return 0 when the imageInfo is null. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_ImageAnimatorFrameInfo_GetLeft( imageInfo: *mut ArkUI_ImageAnimatorFrameInfo, ) -> i32; @@ -4294,6 +5718,8 @@ extern "C" { @param imageInfo Indicates the pointer to the image frame. @param duration Indicates the playback duration of each image frame, and the unit is milliseconds. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_ImageAnimatorFrameInfo_SetDuration( imageInfo: *mut ArkUI_ImageAnimatorFrameInfo, duration: i32, @@ -4304,6 +5730,8 @@ extern "C" { @return Returns the playback duration of the image frame, and the unit is milliseconds. Return 0 when the imageInfo is null. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_ImageAnimatorFrameInfo_GetDuration( imageInfo: *mut ArkUI_ImageAnimatorFrameInfo, ) -> i32; @@ -4312,17 +5740,23 @@ extern "C" { @return Returns the pointer to the accessibility state object. If a null pointer is returned, the object fails to be created. The possible cause is that the address space is full. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_AccessibilityState_Create() -> *mut ArkUI_AccessibilityState; /** @brief Dispose accessibility state. @param state accessibility state object. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_AccessibilityState_Dispose(state: *mut ArkUI_AccessibilityState); /** @brief Set accessibility state disabled. @param state accessibility state object. @param isDisabled accessibility state disabled, Value 1 indicates disabled and 0 indicates enbled. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_AccessibilityState_SetDisabled( state: *mut ArkUI_AccessibilityState, isDisabled: i32, @@ -4333,6 +5767,8 @@ extern "C" { @return accessibility state disabled, Value 1 indicates disabled and 0 indicates enbled. The default value is 0. If the function parameter is abnormal, return the default value. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_AccessibilityState_IsDisabled(state: *mut ArkUI_AccessibilityState) -> i32; /** @brief Set accessibility state selected. @@ -4340,6 +5776,8 @@ extern "C" { @param isSelected accessibility state selected, Value 1 indicates selected, and 0 indicates not selected. The default value is 0. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_AccessibilityState_SetSelected( state: *mut ArkUI_AccessibilityState, isSelected: i32, @@ -4351,6 +5789,8 @@ extern "C" { The default value is 0. If the function parameter is abnormal, return the default value. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_AccessibilityState_IsSelected(state: *mut ArkUI_AccessibilityState) -> i32; /** @brief Set accessibility checked state. @@ -4358,6 +5798,8 @@ extern "C" { @param checkedState checked state,and uses the {@link ArkUI_AccessibilityCheckedState} enumeration value, The default value is ARKUI_ACCESSIBILITY_UNCHECKED. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_AccessibilityState_SetCheckedState( state: *mut ArkUI_AccessibilityState, checkedState: i32, @@ -4369,6 +5811,8 @@ extern "C" { The default value is ARKUI_ACCESSIBILITY_UNCHECKED. If the function parameter is abnormal, return the default value. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_AccessibilityState_GetCheckedState(state: *mut ArkUI_AccessibilityState) -> i32; /** @brief Create accessibility value. @@ -4376,17 +5820,23 @@ extern "C" { @return Returns the pointer to the accessibility state object. If a null pointer is returned, the object fails to be created. The possible cause is that the address space is full. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_AccessibilityValue_Create() -> *mut ArkUI_AccessibilityValue; /** @brief Dispose accessibility value. @param state accessibility value object. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_AccessibilityValue_Dispose(value: *mut ArkUI_AccessibilityValue); /** @brief Set accessibility minimum value. @param value accessibility value object. @param min minimum value based on range components, The default value is -1。 @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_AccessibilityValue_SetMin(value: *mut ArkUI_AccessibilityValue, min: i32); /** @brief Get accessibility minimum value. @@ -4394,12 +5844,16 @@ extern "C" { @return minimum value based on range components, The default value is -1。 If the function parameter is abnormal, return -1. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_AccessibilityValue_GetMin(value: *mut ArkUI_AccessibilityValue) -> i32; /** @brief Set accessibility minimum value. @param value accessibility value object. @param max maximum value based on range components, The default value is -1。 @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_AccessibilityValue_SetMax(value: *mut ArkUI_AccessibilityValue, max: i32); /** @brief Get accessibility minimum value. @@ -4407,12 +5861,16 @@ extern "C" { @return maximum value based on range components, The default value is -1。 If the function parameter is abnormal, return -1. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_AccessibilityValue_GetMax(value: *mut ArkUI_AccessibilityValue) -> i32; /** @brief Set accessibility current value. @param value accessibility value object. @param current value based on range components, The default value is -1。 @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_AccessibilityValue_SetCurrent( value: *mut ArkUI_AccessibilityValue, current: i32, @@ -4423,12 +5881,16 @@ extern "C" { @return current value based on range components, The default value is -1。 If the function parameter is abnormal, return -1. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_AccessibilityValue_GetCurrent(value: *mut ArkUI_AccessibilityValue) -> i32; /** @brief Set accessibility text value. @param value accessibility value object. @param text The textual description information of the component, which defaults to an empty string。 @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_AccessibilityValue_SetText( value: *mut ArkUI_AccessibilityValue, text: *const ::core::ffi::c_char, @@ -4439,6 +5901,8 @@ extern "C" { @return The textual description information of the component, which defaults to an empty string; If the function parameter is abnormal, return null. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_AccessibilityValue_GetText( value: *mut ArkUI_AccessibilityValue, ) -> *const ::core::ffi::c_char; diff --git a/components/arkui/src/ui_input_event.rs b/components/arkui/src/ui_input_event.rs index 727cc52..c77c4fb 100644 --- a/components/arkui/src/ui_input_event.rs +++ b/components/arkui/src/ui_input_event.rs @@ -1,3 +1,73 @@ #[allow(unused_imports)] -mod ui_input_event_api12; -pub use ui_input_event_api12::*; +mod ui_input_event_ffi; +pub use ui_input_event_ffi::*; + +mod ui_input_event_anon_enums_ffi; + +pub use anon_enums::*; +mod anon_enums { + use super::ui_input_event_anon_enums_ffi as bindgen_enums; + use std::ffi::c_uint; + + #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] + #[repr(transparent)] + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] + pub struct TouchEventAction(c_uint); + + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] + impl TouchEventAction { + pub const CANCEL: Self = Self(bindgen_enums::UI_TOUCH_EVENT_ACTION_CANCEL.0); + pub const DOWN: Self = Self(bindgen_enums::UI_TOUCH_EVENT_ACTION_DOWN.0); + pub const MOVE: Self = Self(bindgen_enums::UI_TOUCH_EVENT_ACTION_MOVE.0); + pub const UP: Self = Self(bindgen_enums::UI_TOUCH_EVENT_ACTION_UP.0); + } + + #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] + #[repr(transparent)] + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] + pub struct TouchEventToolType(c_uint); + + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] + impl TouchEventToolType { + pub const UNKNOWN: Self = Self(bindgen_enums::UI_INPUT_EVENT_TOOL_TYPE_UNKNOWN.0); + pub const FINGER: Self = Self(bindgen_enums::UI_INPUT_EVENT_TOOL_TYPE_FINGER.0); + pub const PEN: Self = Self(bindgen_enums::UI_INPUT_EVENT_TOOL_TYPE_PEN.0); + pub const MOUSE: Self = Self(bindgen_enums::UI_INPUT_EVENT_TOOL_TYPE_MOUSE.0); + pub const TOUCHPAD: Self = Self(bindgen_enums::UI_INPUT_EVENT_TOOL_TYPE_TOUCHPAD.0); + pub const JOYSTICK: Self = Self(bindgen_enums::UI_INPUT_EVENT_TOOL_TYPE_JOYSTICK.0); + } + + #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] + #[repr(transparent)] + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] + pub struct InputEventSourceType(c_uint); + + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] + impl InputEventSourceType { + pub const UNKNOWN: Self = Self(bindgen_enums::UI_INPUT_EVENT_SOURCE_TYPE_UNKNOWN.0); + pub const MOUSE: Self = Self(bindgen_enums::UI_INPUT_EVENT_SOURCE_TYPE_MOUSE.0); + pub const TOUCH_SCREEN: Self = + Self(bindgen_enums::UI_INPUT_EVENT_SOURCE_TYPE_TOUCH_SCREEN.0); + } + + #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] + #[repr(transparent)] + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] + pub struct MouseEventAction(c_uint); + + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] + impl MouseEventAction { + pub const UNKNOWN: Self = Self(bindgen_enums::UI_MOUSE_EVENT_ACTION_UNKNOWN.0); + pub const PRESS: Self = Self(bindgen_enums::UI_MOUSE_EVENT_ACTION_PRESS.0); + pub const RELEASE: Self = Self(bindgen_enums::UI_MOUSE_EVENT_ACTION_RELEASE.0); + pub const MOVE: Self = Self(bindgen_enums::UI_MOUSE_EVENT_ACTION_MOVE.0); + } +} diff --git a/components/arkui/src/ui_input_event/ui_input_event_anon_enums_ffi.rs b/components/arkui/src/ui_input_event/ui_input_event_anon_enums_ffi.rs new file mode 100644 index 0000000..e3041c2 --- /dev/null +++ b/components/arkui/src/ui_input_event/ui_input_event_anon_enums_ffi.rs @@ -0,0 +1,106 @@ +/* automatically generated by rust-bindgen 0.71.1 */ + +#![allow(non_upper_case_globals)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] + +/// Cancellation of touch. +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +pub const UI_TOUCH_EVENT_ACTION_CANCEL: _bindgen_ty_1 = _bindgen_ty_1(0); +/// Pressing of a touch point. +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +pub const UI_TOUCH_EVENT_ACTION_DOWN: _bindgen_ty_1 = _bindgen_ty_1(1); +/// Moving of a touch point. +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +pub const UI_TOUCH_EVENT_ACTION_MOVE: _bindgen_ty_1 = _bindgen_ty_1(2); +/// Lifting of a touch point. +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +pub const UI_TOUCH_EVENT_ACTION_UP: _bindgen_ty_1 = _bindgen_ty_1(3); +#[repr(transparent)] +/** @brief Defines the action code of the input event. + +@since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub struct _bindgen_ty_1(pub ::core::ffi::c_uint); +/// Unknown tool type. +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +pub const UI_INPUT_EVENT_TOOL_TYPE_UNKNOWN: _bindgen_ty_2 = _bindgen_ty_2(0); +/// Finger. +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +pub const UI_INPUT_EVENT_TOOL_TYPE_FINGER: _bindgen_ty_2 = _bindgen_ty_2(1); +/// Pen. +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +pub const UI_INPUT_EVENT_TOOL_TYPE_PEN: _bindgen_ty_2 = _bindgen_ty_2(2); +/// Mouse. +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +pub const UI_INPUT_EVENT_TOOL_TYPE_MOUSE: _bindgen_ty_2 = _bindgen_ty_2(3); +/// TouchPad. +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +pub const UI_INPUT_EVENT_TOOL_TYPE_TOUCHPAD: _bindgen_ty_2 = _bindgen_ty_2(4); +/// JoyStick. +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +pub const UI_INPUT_EVENT_TOOL_TYPE_JOYSTICK: _bindgen_ty_2 = _bindgen_ty_2(5); +#[repr(transparent)] +/** @brief Defines the tool type of the touch event. + +@since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub struct _bindgen_ty_2(pub ::core::ffi::c_uint); +/// Unknown source type. +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +pub const UI_INPUT_EVENT_SOURCE_TYPE_UNKNOWN: _bindgen_ty_3 = _bindgen_ty_3(0); +/// Mouse. +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +pub const UI_INPUT_EVENT_SOURCE_TYPE_MOUSE: _bindgen_ty_3 = _bindgen_ty_3(1); +/// Touchscreen. +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +pub const UI_INPUT_EVENT_SOURCE_TYPE_TOUCH_SCREEN: _bindgen_ty_3 = _bindgen_ty_3(2); +#[repr(transparent)] +/** @brief Defines the source type of the touch event. + +@since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub struct _bindgen_ty_3(pub ::core::ffi::c_uint); +/// Invalid. +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +pub const UI_MOUSE_EVENT_ACTION_UNKNOWN: _bindgen_ty_4 = _bindgen_ty_4(0); +/// Press. +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +pub const UI_MOUSE_EVENT_ACTION_PRESS: _bindgen_ty_4 = _bindgen_ty_4(1); +/// Release. +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +pub const UI_MOUSE_EVENT_ACTION_RELEASE: _bindgen_ty_4 = _bindgen_ty_4(2); +/// Move. +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +pub const UI_MOUSE_EVENT_ACTION_MOVE: _bindgen_ty_4 = _bindgen_ty_4(3); +#[repr(transparent)] +/** @brief Define the Action Code for mouse events. + +@since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub struct _bindgen_ty_4(pub ::core::ffi::c_uint); diff --git a/components/arkui/src/ui_input_event/ui_input_event_api12.rs b/components/arkui/src/ui_input_event/ui_input_event_ffi.rs similarity index 79% rename from components/arkui/src/ui_input_event/ui_input_event_api12.rs rename to components/arkui/src/ui_input_event/ui_input_event_ffi.rs index 106a475..1c56f23 100644 --- a/components/arkui/src/ui_input_event/ui_input_event_api12.rs +++ b/components/arkui/src/ui_input_event/ui_input_event_ffi.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.70.1 */ +/* automatically generated by rust-bindgen 0.71.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] @@ -9,15 +9,23 @@ use crate::native_type::*; pub struct ArkUI_UIInputEvent { _unused: [u8; 0], } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_UIInputEvent_Type { pub const ARKUI_UIINPUTEVENT_TYPE_UNKNOWN: ArkUI_UIInputEvent_Type = ArkUI_UIInputEvent_Type(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_UIInputEvent_Type { pub const ARKUI_UIINPUTEVENT_TYPE_TOUCH: ArkUI_UIInputEvent_Type = ArkUI_UIInputEvent_Type(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_UIInputEvent_Type { pub const ARKUI_UIINPUTEVENT_TYPE_AXIS: ArkUI_UIInputEvent_Type = ArkUI_UIInputEvent_Type(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_UIInputEvent_Type { /// Mouse event. pub const ARKUI_UIINPUTEVENT_TYPE_MOUSE: ArkUI_UIInputEvent_Type = ArkUI_UIInputEvent_Type(3); @@ -26,67 +34,109 @@ impl ArkUI_UIInputEvent_Type { /** @brief Enumerates the UI input event types. @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] #[derive(Clone, Hash, PartialEq, Eq)] pub struct ArkUI_UIInputEvent_Type(pub ::core::ffi::c_uint); /// Cancellation of touch. +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const UI_TOUCH_EVENT_ACTION_CANCEL: _bindgen_ty_1 = _bindgen_ty_1(0); /// Pressing of a touch point. +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const UI_TOUCH_EVENT_ACTION_DOWN: _bindgen_ty_1 = _bindgen_ty_1(1); /// Moving of a touch point. +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const UI_TOUCH_EVENT_ACTION_MOVE: _bindgen_ty_1 = _bindgen_ty_1(2); /// Lifting of a touch point. +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const UI_TOUCH_EVENT_ACTION_UP: _bindgen_ty_1 = _bindgen_ty_1(3); #[repr(transparent)] /** @brief Defines the action code of the input event. @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] #[derive(Clone, Hash, PartialEq, Eq)] pub struct _bindgen_ty_1(pub ::core::ffi::c_uint); /// Unknown tool type. +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const UI_INPUT_EVENT_TOOL_TYPE_UNKNOWN: _bindgen_ty_2 = _bindgen_ty_2(0); /// Finger. +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const UI_INPUT_EVENT_TOOL_TYPE_FINGER: _bindgen_ty_2 = _bindgen_ty_2(1); /// Pen. +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const UI_INPUT_EVENT_TOOL_TYPE_PEN: _bindgen_ty_2 = _bindgen_ty_2(2); /// Mouse. +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const UI_INPUT_EVENT_TOOL_TYPE_MOUSE: _bindgen_ty_2 = _bindgen_ty_2(3); /// TouchPad. +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const UI_INPUT_EVENT_TOOL_TYPE_TOUCHPAD: _bindgen_ty_2 = _bindgen_ty_2(4); /// JoyStick. +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const UI_INPUT_EVENT_TOOL_TYPE_JOYSTICK: _bindgen_ty_2 = _bindgen_ty_2(5); #[repr(transparent)] /** @brief Defines the tool type of the touch event. @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] #[derive(Clone, Hash, PartialEq, Eq)] pub struct _bindgen_ty_2(pub ::core::ffi::c_uint); /// Unknown source type. +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const UI_INPUT_EVENT_SOURCE_TYPE_UNKNOWN: _bindgen_ty_3 = _bindgen_ty_3(0); /// Mouse. +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const UI_INPUT_EVENT_SOURCE_TYPE_MOUSE: _bindgen_ty_3 = _bindgen_ty_3(1); /// Touchscreen. +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const UI_INPUT_EVENT_SOURCE_TYPE_TOUCH_SCREEN: _bindgen_ty_3 = _bindgen_ty_3(2); #[repr(transparent)] /** @brief Defines the source type of the touch event. @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] #[derive(Clone, Hash, PartialEq, Eq)] pub struct _bindgen_ty_3(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl HitTestMode { /** Both the node and its child node respond to the hit test of a touch event, but its sibling node is blocked from the hit test.*/ pub const HTM_DEFAULT: HitTestMode = HitTestMode(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl HitTestMode { /** The node responds to the hit test of a touch event, but its child node and sibling node are blocked from the hit test.*/ pub const HTM_BLOCK: HitTestMode = HitTestMode(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl HitTestMode { /** Both the node and its child node respond to the hit test of a touch event, and its sibling node is also considered during the hit test.*/ pub const HTM_TRANSPARENT: HitTestMode = HitTestMode(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl HitTestMode { /** The node does not respond to the hit test of a touch event, but its child node and sibling node are considered during the hit test.*/ @@ -96,60 +146,130 @@ impl HitTestMode { /** @brief Enumerates the hit test modes. @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] #[derive(Clone, Hash, PartialEq, Eq)] pub struct HitTestMode(pub ::core::ffi::c_uint); /// Invalid. +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const UI_MOUSE_EVENT_ACTION_UNKNOWN: _bindgen_ty_4 = _bindgen_ty_4(0); /// Press. +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const UI_MOUSE_EVENT_ACTION_PRESS: _bindgen_ty_4 = _bindgen_ty_4(1); /// Release. +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const UI_MOUSE_EVENT_ACTION_RELEASE: _bindgen_ty_4 = _bindgen_ty_4(2); /// Move. +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const UI_MOUSE_EVENT_ACTION_MOVE: _bindgen_ty_4 = _bindgen_ty_4(3); #[repr(transparent)] /** @brief Define the Action Code for mouse events. @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] #[derive(Clone, Hash, PartialEq, Eq)] pub struct _bindgen_ty_4(pub ::core::ffi::c_uint); /// None. +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const UI_MOUSE_EVENT_BUTTON_NONE: _bindgen_ty_5 = _bindgen_ty_5(0); /// Left. +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const UI_MOUSE_EVENT_BUTTON_LEFT: _bindgen_ty_5 = _bindgen_ty_5(1); /// Right. +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const UI_MOUSE_EVENT_BUTTON_RIGHT: _bindgen_ty_5 = _bindgen_ty_5(2); /// Middle. +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const UI_MOUSE_EVENT_BUTTON_MIDDLE: _bindgen_ty_5 = _bindgen_ty_5(3); /// Back. +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const UI_MOUSE_EVENT_BUTTON_BACK: _bindgen_ty_5 = _bindgen_ty_5(4); /// Forward. +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const UI_MOUSE_EVENT_BUTTON_FORWARD: _bindgen_ty_5 = _bindgen_ty_5(5); #[repr(transparent)] /** @brief Define the button type for mouse events. @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] #[derive(Clone, Hash, PartialEq, Eq)] pub struct _bindgen_ty_5(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ModifierKeyName { /// Ctrl. pub const ARKUI_MODIFIER_KEY_CTRL: ArkUI_ModifierKeyName = ArkUI_ModifierKeyName(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ModifierKeyName { /// Shift. pub const ARKUI_MODIFIER_KEY_SHIFT: ArkUI_ModifierKeyName = ArkUI_ModifierKeyName(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ModifierKeyName { /// Alt. pub const ARKUI_MODIFIER_KEY_ALT: ArkUI_ModifierKeyName = ArkUI_ModifierKeyName(4); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ArkUI_ModifierKeyName { /// Fn. pub const ARKUI_MODIFIER_KEY_FN: ArkUI_ModifierKeyName = ArkUI_ModifierKeyName(8); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +impl ::core::ops::BitOr for ArkUI_ModifierKeyName { + type Output = Self; + #[inline] + fn bitor(self, other: Self) -> Self { + ArkUI_ModifierKeyName(self.0 | other.0) + } +} +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +impl ::core::ops::BitOrAssign for ArkUI_ModifierKeyName { + #[inline] + fn bitor_assign(&mut self, rhs: ArkUI_ModifierKeyName) { + self.0 |= rhs.0; + } +} +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +impl ::core::ops::BitAnd for ArkUI_ModifierKeyName { + type Output = Self; + #[inline] + fn bitand(self, other: Self) -> Self { + ArkUI_ModifierKeyName(self.0 & other.0) + } +} +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +impl ::core::ops::BitAndAssign for ArkUI_ModifierKeyName { + #[inline] + fn bitand_assign(&mut self, rhs: ArkUI_ModifierKeyName) { + self.0 &= rhs.0; + } +} #[repr(transparent)] /** @brief Defines an enum for modifier keys. @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] #[derive(Clone, Hash, PartialEq, Eq)] pub struct ArkUI_ModifierKeyName(pub ::core::ffi::c_uint); extern "C" { @@ -158,30 +278,40 @@ extern "C" { @param event Indicates the pointer to the current UI input event. @return Returns the type of the current UI input event; returns 0 if any parameter error occurs. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_UIInputEvent_GetType(event: *const ArkUI_UIInputEvent) -> i32; /** @brief Obtains the action type of this UI input event. @param event Indicates the pointer to the current UI input event. @return Returns the action type of the current UI input event; returns 0 if any parameter error occurs. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_UIInputEvent_GetAction(event: *const ArkUI_UIInputEvent) -> i32; /** @brief Obtains the source type of this UI input event. @param event Indicates the pointer to the current UI input event. @return Returns the source type of the current UI input event. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_UIInputEvent_GetSourceType(event: *const ArkUI_UIInputEvent) -> i32; /** @brief Obtains the tool type of this UI input event. @param event Indicates the pointer to the current UI input event. @return Returns the tool type of the current UI input event. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_UIInputEvent_GetToolType(event: *const ArkUI_UIInputEvent) -> i32; /** @brief Obtains the time when this UI input event occurs. @param event Indicates the pointer to the current UI input event. @return Returns the time when the UI input event occurs; returns 0 if any parameter error occurs. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_UIInputEvent_GetEventTime(event: *const ArkUI_UIInputEvent) -> i64; /** @brief Obtains the number of touch points from a directional input event (such as a touch event, mouse event, or axis event). @@ -189,6 +319,8 @@ extern "C" { @param event Indicates the pointer to the current UI input event. @return Returns the number of touch points for the directional input event. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_PointerEvent_GetPointerCount(event: *const ArkUI_UIInputEvent) -> u32; /** @brief Obtains the ID of a touch point from a directional input event (such as a touch event, mouse event, or axis event). @@ -197,6 +329,8 @@ extern "C" { @param pointerIndex Indicates the index of the target touch point in the multi-touch data list. @return Returns the ID of the corresponding touch point. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_PointerEvent_GetPointerId( event: *const ArkUI_UIInputEvent, pointerIndex: u32, @@ -208,6 +342,8 @@ extern "C" { @return Returns the X coordinate relative to the upper left corner of the current component; returns 0 if any parameter error occurs. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_PointerEvent_GetX(event: *const ArkUI_UIInputEvent) -> f32; /** @brief Obtains the X coordinate of a specific touch point relative to the upper left corner of the current component from a directional input event (such as a touch event, mouse event, or axis event). @@ -217,6 +353,8 @@ extern "C" { @return Returns the X coordinate relative to the upper left corner of the current component; returns 0.0f if any parameter error occurs. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_PointerEvent_GetXByIndex( event: *const ArkUI_UIInputEvent, pointerIndex: u32, @@ -228,6 +366,8 @@ extern "C" { @return Returns the Y coordinate relative to the upper left corner of the current component; returns 0 if any parameter error occurs. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_PointerEvent_GetY(event: *const ArkUI_UIInputEvent) -> f32; /** @brief Obtains the Y coordinate of a specific touch point relative to the upper left corner of the current component from a directional input event (such as a touch event, mouse event, or axis event). @@ -237,6 +377,8 @@ extern "C" { @return Returns the Y coordinate relative to the upper left corner of the current component; returns 0.0f if any parameter error occurs. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_PointerEvent_GetYByIndex( event: *const ArkUI_UIInputEvent, pointerIndex: u32, @@ -248,6 +390,8 @@ extern "C" { @return Returns the X coordinate relative to the upper left corner of the current application window; returns 0 if any parameter error occurs. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_PointerEvent_GetWindowX(event: *const ArkUI_UIInputEvent) -> f32; /** @brief Obtains the X coordinate of a specific touch point relative to the upper left corner of the current application window from a directional input event (such as a touch event, mouse event, or axis event). @@ -257,6 +401,8 @@ extern "C" { @return Returns the X coordinate relative to the upper left corner of the current application window; returns 0.0f if any parameter error occurs. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_PointerEvent_GetWindowXByIndex( event: *const ArkUI_UIInputEvent, pointerIndex: u32, @@ -268,6 +414,8 @@ extern "C" { @return Returns the Y coordinate relative to the upper left corner of the current application window; returns 0 if any parameter error occurs. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_PointerEvent_GetWindowY(event: *const ArkUI_UIInputEvent) -> f32; /** @brief Obtains the Y coordinate of a specific touch point relative to the upper left corner of the current application window from a directional input event (such as a touch event, mouse event, or axis event). @@ -277,6 +425,8 @@ extern "C" { @return Returns the Y coordinate relative to the upper left corner of the current application window; returns 0.0f if any parameter error occurs. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_PointerEvent_GetWindowYByIndex( event: *const ArkUI_UIInputEvent, pointerIndex: u32, @@ -288,6 +438,8 @@ extern "C" { @return Returns the X coordinate relative to the upper left corner of the current screen; returns 0 if any parameter error occurs. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_PointerEvent_GetDisplayX(event: *const ArkUI_UIInputEvent) -> f32; /** @brief Obtains the X coordinate of a specific touch point relative to the upper left corner of the current screen from a directional input event (such as a touch event, mouse event, or axis event). @@ -297,6 +449,8 @@ extern "C" { @return Returns the X coordinate relative to the upper left corner of the current screen; returns 0.0f if any parameter error occurs. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_PointerEvent_GetDisplayXByIndex( event: *const ArkUI_UIInputEvent, pointerIndex: u32, @@ -308,6 +462,8 @@ extern "C" { @return Returns the Y coordinate relative to the upper left corner of the current screen; returns 0 if any parameter error occurs. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_PointerEvent_GetDisplayY(event: *const ArkUI_UIInputEvent) -> f32; /** @brief Obtains the Y coordinate of a specific touch point relative to the upper left corner of the current screen from a directional input event (such as a touch event, mouse event, or axis event). @@ -317,6 +473,8 @@ extern "C" { @return Returns the Y coordinate relative to the upper left corner of the current screen; returns 0.0f if any parameter error occurs. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_PointerEvent_GetDisplayYByIndex( event: *const ArkUI_UIInputEvent, pointerIndex: u32, @@ -327,6 +485,8 @@ extern "C" { @param pointerIndex Indicates the index of the target touch point in the multi-touch data list. @return Returns the pressure applied to the touchscreen; returns 0.0f if any parameter error occurs. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_PointerEvent_GetPressure( event: *const ArkUI_UIInputEvent, pointerIndex: u32, @@ -338,6 +498,8 @@ extern "C" { @param pointerIndex Indicates the index of the target touch point in the multi-touch data list. @return Returns the angle relative to the YZ plane. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_PointerEvent_GetTiltX( event: *const ArkUI_UIInputEvent, pointerIndex: u32, @@ -349,6 +511,8 @@ extern "C" { @param pointerIndex Indicates the index of the target touch point in the multi-touch data list. @return Returns the angle relative to the XZ plane. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_PointerEvent_GetTiltY( event: *const ArkUI_UIInputEvent, pointerIndex: u32, @@ -359,6 +523,8 @@ extern "C" { @param pointerIndex Indicates the index of the target touch point in the multi-touch data list. @return Returns the width of the touch area. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_PointerEvent_GetTouchAreaWidth( event: *const ArkUI_UIInputEvent, pointerIndex: u32, @@ -369,6 +535,8 @@ extern "C" { @param pointerIndex Indicates the index of the target touch point in the multi-touch data list. @return Returns the height of the touch area. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_PointerEvent_GetTouchAreaHeight( event: *const ArkUI_UIInputEvent, pointerIndex: u32, @@ -379,6 +547,8 @@ extern "C" { @param event Indicates the pointer to the current UI input event. @return Returns the number of historical events. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_PointerEvent_GetHistorySize(event: *const ArkUI_UIInputEvent) -> u32; /** @brief Obtains the occurrence time of a historical event from a directional input event (such as a touch event, mouse event, or axis event). @@ -387,6 +557,8 @@ extern "C" { @param historyIndex Indicates the index of the target historical event. @return Returns the time when the UI input event occurs; returns 0 if any parameter error occurs. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_PointerEvent_GetHistoryEventTime( event: *const ArkUI_UIInputEvent, historyIndex: u32, @@ -398,6 +570,8 @@ extern "C" { @param historyIndex Indicates the index of the target historical event. @return Returns the number of touch points in the specified historical event @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_PointerEvent_GetHistoryPointerCount( event: *const ArkUI_UIInputEvent, historyIndex: u32, @@ -410,6 +584,8 @@ extern "C" { @param historyIndex Indicates the index of the target historical event. @return Returns the ID of the corresponding touch point in the specified historical event. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_PointerEvent_GetHistoryPointerId( event: *const ArkUI_UIInputEvent, pointerIndex: u32, @@ -424,6 +600,8 @@ extern "C" { @return Returns the X coordinate relative to the upper left corner of the current component; returns 0.0f if any parameter error occurs. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_PointerEvent_GetHistoryX( event: *const ArkUI_UIInputEvent, pointerIndex: u32, @@ -438,6 +616,8 @@ extern "C" { @return Returns the Y coordinate relative to the upper left corner of the current component; returns 0.0f if any parameter error occurs. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_PointerEvent_GetHistoryY( event: *const ArkUI_UIInputEvent, pointerIndex: u32, @@ -452,6 +632,8 @@ extern "C" { @return Returns the X coordinate relative to the upper left corner of the current application window; returns 0.0f if any parameter error occurs. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_PointerEvent_GetHistoryWindowX( event: *const ArkUI_UIInputEvent, pointerIndex: u32, @@ -466,6 +648,8 @@ extern "C" { @return Returns the Y coordinate relative to the upper left corner of the current application window; returns 0.0f if any parameter error occurs. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_PointerEvent_GetHistoryWindowY( event: *const ArkUI_UIInputEvent, pointerIndex: u32, @@ -480,6 +664,8 @@ extern "C" { @return Returns the X coordinate relative to the upper left corner of the current screen; returns 0.0f if any parameter error occurs. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_PointerEvent_GetHistoryDisplayX( event: *const ArkUI_UIInputEvent, pointerIndex: u32, @@ -494,6 +680,8 @@ extern "C" { @return Returns the Y coordinate relative to the upper left corner of the current screen; returns 0.0f if any parameter error occurs. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_PointerEvent_GetHistoryDisplayY( event: *const ArkUI_UIInputEvent, pointerIndex: u32, @@ -507,6 +695,8 @@ extern "C" { @param historyIndex Indicates the index of the target historical event. @return Returns the pressure applied to the touchscreen; returns 0.0f if any parameter error occurs. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_PointerEvent_GetHistoryPressure( event: *const ArkUI_UIInputEvent, pointerIndex: u32, @@ -520,6 +710,8 @@ extern "C" { @param historyIndex Indicates the index of the target historical event. @return Returns the angle relative to the YZ plane. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_PointerEvent_GetHistoryTiltX( event: *const ArkUI_UIInputEvent, pointerIndex: u32, @@ -533,6 +725,8 @@ extern "C" { @param historyIndex Indicates the index of the target historical event. @return Returns the angle relative to the XZ plane. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_PointerEvent_GetHistoryTiltY( event: *const ArkUI_UIInputEvent, pointerIndex: u32, @@ -546,6 +740,8 @@ extern "C" { @param historyIndex Indicates the index of the target historical event. @return Returns the width of the touch area. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_PointerEvent_GetHistoryTouchAreaWidth( event: *const ArkUI_UIInputEvent, pointerIndex: u32, @@ -559,6 +755,8 @@ extern "C" { @param historyIndex Indicates the index of the target historical event. @return Returns the height of the touch area. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_PointerEvent_GetHistoryTouchAreaHeight( event: *const ArkUI_UIInputEvent, pointerIndex: u32, @@ -570,6 +768,8 @@ extern "C" { @return Returns the value of the vertical scroll axis of the current axis event; returns 0 if any parameter error occurs. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_AxisEvent_GetVerticalAxisValue(event: *const ArkUI_UIInputEvent) -> f64; /** @brief Obtains the value of the horizontal scroll axis for this axis event. @@ -577,6 +777,8 @@ extern "C" { @return Returns the value of the horizontal scroll axis of the current axis event; returns 0 if any parameter error occurs. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_AxisEvent_GetHorizontalAxisValue(event: *const ArkUI_UIInputEvent) -> f64; /** @brief Obtains the scale value of the pinch axis for this axis event. @@ -584,6 +786,8 @@ extern "C" { @return Returns the scale value of the pinch axis of the current axis event; returns 0 if any parameter error occurs. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_AxisEvent_GetPinchAxisScaleValue(event: *const ArkUI_UIInputEvent) -> f64; /** @brief Sets how the component behaves during hit testing. @@ -591,6 +795,8 @@ extern "C" { @param mode Indicates how the component behaves during hit testing. The parameter type is {@link HitTestMode}. @return Returns the status code of the execution. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_PointerEvent_SetInterceptHitTestMode( event: *const ArkUI_UIInputEvent, mode: HitTestMode, @@ -601,6 +807,8 @@ extern "C" { @return Return to the mouse button type, where 1 is the left button, 2 is the right button, 3 is the middle button, 4 is the back button, and 5 is the forward button. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_MouseEvent_GetMouseButton(event: *const ArkUI_UIInputEvent) -> i32; /** @brief Get the value of the mouse action type for mouse events. @@ -608,6 +816,8 @@ extern "C" { @return Returns the type of mouse action, where 1 represents button pressed, 2 represents button released, and 3 represents mouse movement. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_MouseEvent_GetMouseAction(event: *const ArkUI_UIInputEvent) -> i32; /** @brief Sets whether to prevent event bubbling. @@ -617,6 +827,8 @@ extern "C" { If 401 is returned, the execution fails. The possible cause of the failure is that the event parameter is abnormal, such as a null pointer. @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_ArkUI_PointerEvent_SetStopPropagation( event: *const ArkUI_UIInputEvent, stopPropagation: bool, diff --git a/components/deviceinfo/CHANGELOG.md b/components/deviceinfo/CHANGELOG.md new file mode 100644 index 0000000..d56fe18 --- /dev/null +++ b/components/deviceinfo/CHANGELOG.md @@ -0,0 +1,4 @@ +# 0.1.1 (2024-12-26) + +- Regenerated the bindings with new generator (no user visible changes) + diff --git a/components/deviceinfo/Cargo.toml b/components/deviceinfo/Cargo.toml index 0410aea..44f0fb6 100644 --- a/components/deviceinfo/Cargo.toml +++ b/components/deviceinfo/Cargo.toml @@ -1,12 +1,11 @@ [package] name = "ohos-deviceinfo-sys" -version = "0.1.0" +version = "0.1.1" edition = "2021" description = "Bindings to OpenHarmony OS APIs providing information about the device" license = "Apache-2.0" repository = "https://github.com/openharmony-rs/ohos-sys" keywords = ["OpenHarmony", "HarmonyOS", "ffi", "device"] -exclude = ["src/api11.rs", "src/api12.rs"] [dependencies] document-features = { version = "0.2", optional = true } diff --git a/components/deviceinfo/src/deviceinfo_api10.rs b/components/deviceinfo/src/deviceinfo_api10.rs deleted file mode 100644 index cf35272..0000000 --- a/components/deviceinfo/src/deviceinfo_api10.rs +++ /dev/null @@ -1,127 +0,0 @@ -/* automatically generated by rust-bindgen 0.69.4 */ - -#![allow(non_upper_case_globals)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] - -extern "C" { - /** Obtains the device type represented by a string, - which can be {@code phone} (or {@code default} for phones), {@code wearable}, {@code liteWearable}, - {@code tablet}, {@code tv}, {@code car}, or {@code smartVision}. - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetDeviceType() -> *const ::core::ffi::c_char; - /** Obtains the device manufacturer represented by a string. - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetManufacture() -> *const ::core::ffi::c_char; - /** Obtains the device brand represented by a string. - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetBrand() -> *const ::core::ffi::c_char; - /** Obtains the product name speaded in the market - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetMarketName() -> *const ::core::ffi::c_char; - /** Obtains the product series represented by a string. - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetProductSeries() -> *const ::core::ffi::c_char; - /** Obtains the product model represented by a string. - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetProductModel() -> *const ::core::ffi::c_char; - /** Obtains the software model represented by a string. - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetSoftwareModel() -> *const ::core::ffi::c_char; - /** Obtains the hardware model represented by a string. - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetHardwareModel() -> *const ::core::ffi::c_char; - /** Obtains the bootloader version number represented by a string. - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetBootloaderVersion() -> *const ::core::ffi::c_char; - /** Obtains the application binary interface (Abi) list represented by a string. - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetAbiList() -> *const ::core::ffi::c_char; - /** Obtains the security patch tag represented by a string. - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetSecurityPatchTag() -> *const ::core::ffi::c_char; - /** Obtains the product version displayed for customer represented by a string. - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetDisplayVersion() -> *const ::core::ffi::c_char; - /** Obtains the incremental version represented by a string. - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetIncrementalVersion() -> *const ::core::ffi::c_char; - /** Obtains the OS release type represented by a string. - -

The OS release category can be {@code Release}, {@code Beta}, or {@code Canary}. - The specific release type may be {@code Release}, {@code Beta1}, or others alike. - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetOsReleaseType() -> *const ::core::ffi::c_char; - /** Obtains the OS full version name represented by a string. - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetOSFullName() -> *const ::core::ffi::c_char; - /** Obtains the SDK API version number. - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetSdkApiVersion() -> ::core::ffi::c_int; - /** Obtains the first API version number. - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetFirstApiVersion() -> ::core::ffi::c_int; - /** Obtains the version ID by a string. - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetVersionId() -> *const ::core::ffi::c_char; - /** Obtains the build type of the current running OS. - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetBuildType() -> *const ::core::ffi::c_char; - /** Obtains the build user of the current running OS. - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetBuildUser() -> *const ::core::ffi::c_char; - /** Obtains the build host of the current running OS. - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetBuildHost() -> *const ::core::ffi::c_char; - /** Obtains the build time of the current running OS. - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetBuildTime() -> *const ::core::ffi::c_char; - /** Obtains the version hash of the current running OS. - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetBuildRootHash() -> *const ::core::ffi::c_char; - /** Obtains the Distribution OS name represented by a string. - -

Independent Software Vendor (ISV) may distribute OHOS with their own OS name. - If ISV not specified, it will return an empty string - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetDistributionOSName() -> *const ::core::ffi::c_char; - /** Obtains the ISV distribution OS version represented by a string. - If ISV not specified, it will return the same value as OH_GetOSFullName - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetDistributionOSVersion() -> *const ::core::ffi::c_char; - /** Obtains the ISV distribution OS api version represented by a integer. - If ISV not specified, it will return the same value as OH_GetSdkApiVersion - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetDistributionOSApiVersion() -> ::core::ffi::c_int; - /** Obtains the ISV distribution OS release type represented by a string. - If ISV not specified, it will return the same value as OH_GetOsReleaseType - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetDistributionOSReleaseType() -> *const ::core::ffi::c_char; -} diff --git a/components/deviceinfo/src/deviceinfo_api12.rs b/components/deviceinfo/src/deviceinfo_api12.rs deleted file mode 100644 index b626b98..0000000 --- a/components/deviceinfo/src/deviceinfo_api12.rs +++ /dev/null @@ -1,127 +0,0 @@ -/* automatically generated by rust-bindgen 0.70.1 */ - -#![allow(non_upper_case_globals)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] - -extern "C" { - /** Obtains the device type represented by a string, - which can be {@code phone} (or {@code default} for phones), {@code wearable}, {@code liteWearable}, - {@code tablet}, {@code tv}, {@code car}, or {@code smartVision}. - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetDeviceType() -> *const ::core::ffi::c_char; - /** Obtains the device manufacturer represented by a string. - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetManufacture() -> *const ::core::ffi::c_char; - /** Obtains the device brand represented by a string. - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetBrand() -> *const ::core::ffi::c_char; - /** Obtains the product name speaded in the market - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetMarketName() -> *const ::core::ffi::c_char; - /** Obtains the product series represented by a string. - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetProductSeries() -> *const ::core::ffi::c_char; - /** Obtains the product model represented by a string. - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetProductModel() -> *const ::core::ffi::c_char; - /** Obtains the software model represented by a string. - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetSoftwareModel() -> *const ::core::ffi::c_char; - /** Obtains the hardware model represented by a string. - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetHardwareModel() -> *const ::core::ffi::c_char; - /** Obtains the bootloader version number represented by a string. - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetBootloaderVersion() -> *const ::core::ffi::c_char; - /** Obtains the application binary interface (Abi) list represented by a string. - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetAbiList() -> *const ::core::ffi::c_char; - /** Obtains the security patch tag represented by a string. - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetSecurityPatchTag() -> *const ::core::ffi::c_char; - /** Obtains the product version displayed for customer represented by a string. - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetDisplayVersion() -> *const ::core::ffi::c_char; - /** Obtains the incremental version represented by a string. - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetIncrementalVersion() -> *const ::core::ffi::c_char; - /** Obtains the OS release type represented by a string. - -

The OS release category can be {@code Release}, {@code Beta}, or {@code Canary}. - The specific release type may be {@code Release}, {@code Beta1}, or others alike. - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetOsReleaseType() -> *const ::core::ffi::c_char; - /** Obtains the OS full version name represented by a string. - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetOSFullName() -> *const ::core::ffi::c_char; - /** Obtains the SDK API version number. - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetSdkApiVersion() -> ::core::ffi::c_int; - /** Obtains the first API version number. - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetFirstApiVersion() -> ::core::ffi::c_int; - /** Obtains the version ID by a string. - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetVersionId() -> *const ::core::ffi::c_char; - /** Obtains the build type of the current running OS. - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetBuildType() -> *const ::core::ffi::c_char; - /** Obtains the build user of the current running OS. - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetBuildUser() -> *const ::core::ffi::c_char; - /** Obtains the build host of the current running OS. - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetBuildHost() -> *const ::core::ffi::c_char; - /** Obtains the build time of the current running OS. - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetBuildTime() -> *const ::core::ffi::c_char; - /** Obtains the version hash of the current running OS. - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetBuildRootHash() -> *const ::core::ffi::c_char; - /** Obtains the Distribution OS name represented by a string. - -

Independent Software Vendor (ISV) may distribute OHOS with their own OS name. - If ISV not specified, it will return an empty string - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetDistributionOSName() -> *const ::core::ffi::c_char; - /** Obtains the ISV distribution OS version represented by a string. - If ISV not specified, it will return the same value as OH_GetOSFullName - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetDistributionOSVersion() -> *const ::core::ffi::c_char; - /** Obtains the ISV distribution OS api version represented by a integer. - If ISV not specified, it will return the same value as OH_GetSdkApiVersion - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetDistributionOSApiVersion() -> ::core::ffi::c_int; - /** Obtains the ISV distribution OS release type represented by a string. - If ISV not specified, it will return the same value as OH_GetOsReleaseType - @syscap SystemCapability.Startup.SystemInfo - @since 10*/ - pub fn OH_GetDistributionOSReleaseType() -> *const ::core::ffi::c_char; -} diff --git a/components/deviceinfo/src/deviceinfo_api11.rs b/components/deviceinfo/src/deviceinfo_ffi.rs similarity index 99% rename from components/deviceinfo/src/deviceinfo_api11.rs rename to components/deviceinfo/src/deviceinfo_ffi.rs index cf35272..da571ca 100644 --- a/components/deviceinfo/src/deviceinfo_api11.rs +++ b/components/deviceinfo/src/deviceinfo_ffi.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.71.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/components/deviceinfo/src/lib.rs b/components/deviceinfo/src/lib.rs index fa589e6..159d629 100644 --- a/components/deviceinfo/src/lib.rs +++ b/components/deviceinfo/src/lib.rs @@ -1,6 +1,4 @@ //! OpenHarmony functions providing device information. -mod deviceinfo_api10; -pub use deviceinfo_api10::*; - -// Note: API level 11 and 12 provide no additions or changes. +mod deviceinfo_ffi; +pub use deviceinfo_ffi::*; diff --git a/components/hilog/src/CHANGELOG.md b/components/hilog/CHANGELOG.md similarity index 66% rename from components/hilog/src/CHANGELOG.md rename to components/hilog/CHANGELOG.md index 18f1e19..2cbad06 100644 --- a/components/hilog/src/CHANGELOG.md +++ b/components/hilog/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.1.3 (2024-12-26) + +- Regenerated the bindings with new generator (Should have no user visible changes) + ## v0.1.2 (2024-10-03) - Add API-level 11 additions (feature `api-11`) diff --git a/components/hilog/Cargo.toml b/components/hilog/Cargo.toml index 0228a58..41a61bb 100644 --- a/components/hilog/Cargo.toml +++ b/components/hilog/Cargo.toml @@ -1,12 +1,11 @@ [package] name = "hilog-sys" -version = "0.1.2" +version = "0.1.3" edition = "2021" keywords = ["OpenHarmony", "HarmonyOS", "hilog", "log"] description = "Rust bindings to the HiLog logging system of OpenHarmony" repository = "https://github.com/openharmony-rs/ohos-sys" license = "Apache-2.0" -exclude = ["src/hilog_api11.rs", "src/hilog_api12.rs"] [dependencies] document-features = { version = "0.2", optional = true } diff --git a/components/hilog/src/api11_additions.rs b/components/hilog/src/api11_additions.rs deleted file mode 100644 index a85417d..0000000 --- a/components/hilog/src/api11_additions.rs +++ /dev/null @@ -1,37 +0,0 @@ -#![allow(non_upper_case_globals)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] - -use super::{LogLevel, LogType}; - -/** @brief Defines the function pointer type for the user-defined log processing function. - -@param type Indicates the log type. The type for third-party applications is defined by {@link LOG_APP}. -@param level Indicates the log level, which can be LOG_DEBUG, LOG_INFO, LOG_WARN, -LOG_ERROR, and LOG_FATAL. -@param domain Indicates the service domain of logs. Its value is a hexadecimal integer ranging from 0x0 to 0xFFFF. -@param tag Indicates the log tag, which is a string used to identify the class, file, or service behavior. -@param msg Indicates the log message itself, which is a formatted log string. -@since 11*/ -pub type LogCallback = ::core::option::Option< - unsafe extern "C" fn( - type_: LogType, - level: LogLevel, - domain: ::core::ffi::c_uint, - tag: *const ::core::ffi::c_char, - msg: *const ::core::ffi::c_char, - ), ->; -extern "C" { - /** @brief Set the user-defined log processing function. - - After calling this function, the callback function implemented by the user can receive all hilogs of the - current process. - Note that it will not change the default behavior of hilog logs of the current process, no matter whether this - interface is called or not. \n - - @param callback Indicates the callback function implemented by the user. If you do not need to process hilog logs, - you can transfer a null pointer. - @since 11*/ - pub fn OH_LOG_SetCallback(callback: LogCallback); -} diff --git a/components/hilog/src/hilog_api10.rs b/components/hilog/src/hilog_api10.rs deleted file mode 100644 index 15ef8eb..0000000 --- a/components/hilog/src/hilog_api10.rs +++ /dev/null @@ -1,95 +0,0 @@ -/* automatically generated by rust-bindgen 0.70.1 */ - -#![allow(non_upper_case_globals)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] - -impl LogType { - /// Third-party application logs - pub const LOG_APP: LogType = LogType(0); -} -#[repr(transparent)] -/** @brief Enumerates log types. - -Currently, LOG_APP is available. \n - -@since 8*/ -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct LogType(pub ::core::ffi::c_uint); -impl LogLevel { - /// Debug level to be used by {@link OH_LOG_DEBUG} - pub const LOG_DEBUG: LogLevel = LogLevel(3); -} -impl LogLevel { - /// Informational level to be used by {@link OH_LOG_INFO} - pub const LOG_INFO: LogLevel = LogLevel(4); -} -impl LogLevel { - /// Warning level to be used by {@link OH_LOG_WARN} - pub const LOG_WARN: LogLevel = LogLevel(5); -} -impl LogLevel { - /// Error level to be used by {@link OH_LOG_ERROR} - pub const LOG_ERROR: LogLevel = LogLevel(6); -} -impl LogLevel { - /// Fatal level to be used by {@link OH_LOG_FATAL} - pub const LOG_FATAL: LogLevel = LogLevel(7); -} -#[repr(transparent)] -/** @brief Enumerates log levels. - -You are advised to select log levels based on their respective usage scenarios:\n -

  • DEBUG: used for debugging and disabled from commercial releases
  • \n -
  • INFO: used for logging important system running status and steps in key processes
  • \n -
  • WARN: used for logging unexpected exceptions that have little impact on user experience and can -automatically recover. Logs at this level are generally output when such exceptions are detected and -captured.
  • \n -
  • ERROR: used for logging malfunction that affects user experience and cannot automatically -recover
  • \n -
  • FATAL: used for logging major exceptions that have severely affected user experience and should -not occur.
\n - -@since 8*/ -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct LogLevel(pub ::core::ffi::c_uint); -extern "C" { - /** @brief Outputs logs. - - You can use this function to output logs based on the specified log type, log level, service domain, log tag, - and variable parameters determined by the format specifier and privacy identifier in the printf format. - - @param type Indicates the log type. The type for third-party applications is defined by {@link LOG_APP}. - @param level Indicates the log level, which can be LOG_DEBUG, LOG_INFO, LOG_WARN, - LOG_ERROR, and LOG_FATAL. - @param domain Indicates the service domain of logs. Its value is a hexadecimal integer ranging from 0x0 to 0xFFFF. - @param tag Indicates the log tag, which is a string used to identify the class, file, or service behavior. - @param fmt Indicates the format string, which is an enhancement of a printf format string and supports the privacy - identifier. Specifically, {public} or {private} is added between the % character and the format specifier - in each parameter. \n - @param ... Indicates a list of parameters. The number and type of parameters must map onto the format specifiers - in the format string. - @return Returns 0 or a larger value if the operation is successful; returns a value smaller - than 0 otherwise. - @since 8*/ - pub fn OH_LOG_Print( - type_: LogType, - level: LogLevel, - domain: ::core::ffi::c_uint, - tag: *const ::core::ffi::c_char, - fmt: *const ::core::ffi::c_char, - ... - ) -> ::core::ffi::c_int; - /** @brief Checks whether logs of the specified service domain, log tag, and log level can be output. - - @param domain Indicates the service domain of logs. - @param tag Indicates the log tag. - @param level Indicates the log level. - @return Returns true if the specified logs can be output; returns false otherwise. - @since 8*/ - pub fn OH_LOG_IsLoggable( - domain: ::core::ffi::c_uint, - tag: *const ::core::ffi::c_char, - level: LogLevel, - ) -> bool; -} diff --git a/components/hilog/src/hilog_api12.rs b/components/hilog/src/hilog_api12.rs deleted file mode 100644 index a81cd48..0000000 --- a/components/hilog/src/hilog_api12.rs +++ /dev/null @@ -1,124 +0,0 @@ -/* automatically generated by rust-bindgen 0.70.1 */ - -#![allow(non_upper_case_globals)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] - -impl LogType { - /// Third-party application logs - pub const LOG_APP: LogType = LogType(0); -} -#[repr(transparent)] -/** @brief Enumerates log types. - -Currently, LOG_APP is available. \n - -@since 8*/ -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct LogType(pub ::core::ffi::c_uint); -impl LogLevel { - /// Debug level to be used by {@link OH_LOG_DEBUG} - pub const LOG_DEBUG: LogLevel = LogLevel(3); -} -impl LogLevel { - /// Informational level to be used by {@link OH_LOG_INFO} - pub const LOG_INFO: LogLevel = LogLevel(4); -} -impl LogLevel { - /// Warning level to be used by {@link OH_LOG_WARN} - pub const LOG_WARN: LogLevel = LogLevel(5); -} -impl LogLevel { - /// Error level to be used by {@link OH_LOG_ERROR} - pub const LOG_ERROR: LogLevel = LogLevel(6); -} -impl LogLevel { - /// Fatal level to be used by {@link OH_LOG_FATAL} - pub const LOG_FATAL: LogLevel = LogLevel(7); -} -#[repr(transparent)] -/** @brief Enumerates log levels. - -You are advised to select log levels based on their respective usage scenarios:\n -
  • DEBUG: used for debugging and disabled from commercial releases
  • \n -
  • INFO: used for logging important system running status and steps in key processes
  • \n -
  • WARN: used for logging unexpected exceptions that have little impact on user experience and can -automatically recover. Logs at this level are generally output when such exceptions are detected and -captured.
  • \n -
  • ERROR: used for logging malfunction that affects user experience and cannot automatically -recover
  • \n -
  • FATAL: used for logging major exceptions that have severely affected user experience and should -not occur.
\n - -@since 8*/ -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct LogLevel(pub ::core::ffi::c_uint); -/** @brief Defines the function pointer type for the user-defined log processing function. - -@param type Indicates the log type. The type for third-party applications is defined by {@link LOG_APP}. -@param level Indicates the log level, which can be LOG_DEBUG, LOG_INFO, LOG_WARN, -LOG_ERROR, and LOG_FATAL. -@param domain Indicates the service domain of logs. Its value is a hexadecimal integer ranging from 0x0 to 0xFFFF. -@param tag Indicates the log tag, which is a string used to identify the class, file, or service behavior. -@param msg Indicates the log message itself, which is a formatted log string. -@since 11*/ -pub type LogCallback = ::core::option::Option< - unsafe extern "C" fn( - type_: LogType, - level: LogLevel, - domain: ::core::ffi::c_uint, - tag: *const ::core::ffi::c_char, - msg: *const ::core::ffi::c_char, - ), ->; -extern "C" { - /** @brief Outputs logs. - - You can use this function to output logs based on the specified log type, log level, service domain, log tag, - and variable parameters determined by the format specifier and privacy identifier in the printf format. - - @param type Indicates the log type. The type for third-party applications is defined by {@link LOG_APP}. - @param level Indicates the log level, which can be LOG_DEBUG, LOG_INFO, LOG_WARN, - LOG_ERROR, and LOG_FATAL. - @param domain Indicates the service domain of logs. Its value is a hexadecimal integer ranging from 0x0 to 0xFFFF. - @param tag Indicates the log tag, which is a string used to identify the class, file, or service behavior. - @param fmt Indicates the format string, which is an enhancement of a printf format string and supports the privacy - identifier. Specifically, {public} or {private} is added between the % character and the format specifier - in each parameter. \n - @param ... Indicates a list of parameters. The number and type of parameters must map onto the format specifiers - in the format string. - @return Returns 0 or a larger value if the operation is successful; returns a value smaller - than 0 otherwise. - @since 8*/ - pub fn OH_LOG_Print( - type_: LogType, - level: LogLevel, - domain: ::core::ffi::c_uint, - tag: *const ::core::ffi::c_char, - fmt: *const ::core::ffi::c_char, - ... - ) -> ::core::ffi::c_int; - /** @brief Checks whether logs of the specified service domain, log tag, and log level can be output. - - @param domain Indicates the service domain of logs. - @param tag Indicates the log tag. - @param level Indicates the log level. - @return Returns true if the specified logs can be output; returns false otherwise. - @since 8*/ - pub fn OH_LOG_IsLoggable( - domain: ::core::ffi::c_uint, - tag: *const ::core::ffi::c_char, - level: LogLevel, - ) -> bool; - /** @brief Set the user-defined log processing function. - - After calling this function, the callback function implemented by the user can receive all hilogs of the - current process. - Note that it will not change the default behavior of hilog logs of the current process, no matter whether this - interface is called or not. \n - - @param callback Indicates the callback function implemented by the user. If you do not need to process hilog logs, - you can transfer a null pointer. - @since 11*/ - pub fn OH_LOG_SetCallback(callback: LogCallback); -} diff --git a/components/hilog/src/hilog_api11.rs b/components/hilog/src/hilog_ffi.rs similarity index 96% rename from components/hilog/src/hilog_api11.rs rename to components/hilog/src/hilog_ffi.rs index a81cd48..8c308f0 100644 --- a/components/hilog/src/hilog_api11.rs +++ b/components/hilog/src/hilog_ffi.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.70.1 */ +/* automatically generated by rust-bindgen 0.71.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] @@ -62,6 +62,8 @@ pub struct LogLevel(pub ::core::ffi::c_uint); @param tag Indicates the log tag, which is a string used to identify the class, file, or service behavior. @param msg Indicates the log message itself, which is a formatted log string. @since 11*/ +#[cfg(feature = "api-11")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] pub type LogCallback = ::core::option::Option< unsafe extern "C" fn( type_: LogType, @@ -120,5 +122,7 @@ extern "C" { @param callback Indicates the callback function implemented by the user. If you do not need to process hilog logs, you can transfer a null pointer. @since 11*/ + #[cfg(feature = "api-11")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] pub fn OH_LOG_SetCallback(callback: LogCallback); } diff --git a/components/hilog/src/lib.rs b/components/hilog/src/lib.rs index a951eff..94766ab 100644 --- a/components/hilog/src/lib.rs +++ b/components/hilog/src/lib.rs @@ -31,18 +31,9 @@ extern "C" {} #[allow(non_snake_case)] -mod hilog_api10; +mod hilog_ffi; -pub use hilog_api10::*; - -#[cfg(feature = "api-11")] -#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] -mod api11_additions; -#[cfg(feature = "api-11")] -#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] -pub use api11_additions::*; - -// Note: No additions in api-12 +pub use hilog_ffi::*; #[cfg(feature = "log")] impl From for LogLevel { diff --git a/components/hitrace/CHANGELOG.md b/components/hitrace/CHANGELOG.md index 71b3723..5b30837 100644 --- a/components/hitrace/CHANGELOG.md +++ b/components/hitrace/CHANGELOG.md @@ -1,3 +1,11 @@ +# 0.1.3 (2024-12-26) + +## Changes + +- Regenerated the bindings with new generator +- `HiTrace_Tracepoint_Type` is now marked as non-exhaustive. This change is not considered breaking, + since the enum is only passed towards ffi and not received from ffi functions. + # 0.1.2 (2024-09-05) ## Added diff --git a/components/hitrace/Cargo.toml b/components/hitrace/Cargo.toml index 6c07f03..516eb9b 100644 --- a/components/hitrace/Cargo.toml +++ b/components/hitrace/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hitrace-sys" -version = "0.1.2" +version = "0.1.3" edition = "2021" keywords = ["OpenHarmony", "HarmonyOS", "hitrace", "tracing"] license = "Apache-2.0" diff --git a/components/hitrace/src/api12_additions.rs b/components/hitrace/src/api12_additions.rs deleted file mode 100644 index 144428b..0000000 --- a/components/hitrace/src/api12_additions.rs +++ /dev/null @@ -1,645 +0,0 @@ -#![allow(non_upper_case_globals)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] - -#[repr(C)] -#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] -pub struct __BindgenBitfieldUnit { - storage: Storage, -} -impl __BindgenBitfieldUnit { - #[inline] - pub const fn new(storage: Storage) -> Self { - Self { storage } - } -} -impl __BindgenBitfieldUnit -where - Storage: AsRef<[u8]> + AsMut<[u8]>, -{ - #[inline] - pub fn get_bit(&self, index: usize) -> bool { - debug_assert!(index / 8 < self.storage.as_ref().len()); - let byte_index = index / 8; - let byte = self.storage.as_ref()[byte_index]; - let bit_index = if cfg!(target_endian = "big") { - 7 - (index % 8) - } else { - index % 8 - }; - let mask = 1 << bit_index; - byte & mask == mask - } - #[inline] - pub fn set_bit(&mut self, index: usize, val: bool) { - debug_assert!(index / 8 < self.storage.as_ref().len()); - let byte_index = index / 8; - let byte = &mut self.storage.as_mut()[byte_index]; - let bit_index = if cfg!(target_endian = "big") { - 7 - (index % 8) - } else { - index % 8 - }; - let mask = 1 << bit_index; - if val { - *byte |= mask; - } else { - *byte &= !mask; - } - } - #[inline] - pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { - debug_assert!(bit_width <= 64); - debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len(),); - let mut val = 0; - for i in 0..(bit_width as usize) { - if self.get_bit(i + bit_offset) { - let index = if cfg!(target_endian = "big") { - bit_width as usize - 1 - i - } else { - i - }; - val |= 1 << index; - } - } - val - } - #[inline] - pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { - debug_assert!(bit_width <= 64); - debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len(),); - for i in 0..(bit_width as usize) { - let mask = 1 << i; - let val_bit_is_set = val & mask == mask; - let index = if cfg!(target_endian = "big") { - bit_width as usize - 1 - i - } else { - i - }; - self.set_bit(index + bit_offset, val_bit_is_set); - } - } -} -impl HiTraceId_Valid { - /** @brief Invalid HiTraceId instance. - - @syscap SystemCapability.HiviewDFX.HiTrace - - @since 12*/ - pub const HITRACE_ID_INVALID: HiTraceId_Valid = HiTraceId_Valid(0); -} -impl HiTraceId_Valid { - /** @brief Valid HiTraceId instance. - - @syscap SystemCapability.HiviewDFX.HiTrace - - @since 12*/ - pub const HITRACE_ID_VALID: HiTraceId_Valid = HiTraceId_Valid(1); -} -#[repr(transparent)] -/** @brief Defines whether a HiTraceId instance is valid. - -@syscap SystemCapability.HiviewDFX.HiTrace - -@since 12*/ -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct HiTraceId_Valid(pub ::core::ffi::c_uint); -impl HiTrace_Version { - /** @brief Version 1. - - @syscap SystemCapability.HiviewDFX.HiTrace - - @since 12*/ - pub const HITRACE_VER_1: HiTrace_Version = HiTrace_Version(0); -} -#[repr(transparent)] -/** @brief Enumerates the HiTrace version numbers. - -@syscap SystemCapability.HiviewDFX.HiTrace - -@since 12*/ -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct HiTrace_Version(pub ::core::ffi::c_uint); -impl HiTrace_Flag { - /** @brief Default flag. - - @syscap SystemCapability.HiviewDFX.HiTrace - - @since 12*/ - pub const HITRACE_FLAG_DEFAULT: HiTrace_Flag = HiTrace_Flag(0); -} -impl HiTrace_Flag { - /** @brief Both synchronous and asynchronous calls are traced. By default, only synchronous calls are traced. - - @syscap SystemCapability.HiviewDFX.HiTrace - - @since 12*/ - pub const HITRACE_FLAG_INCLUDE_ASYNC: HiTrace_Flag = HiTrace_Flag(1); -} -impl HiTrace_Flag { - /** @brief No spans are created. By default, spans are created. - - @syscap SystemCapability.HiviewDFX.HiTrace - - @since 12*/ - pub const HITRACE_FLAG_DONOT_CREATE_SPAN: HiTrace_Flag = HiTrace_Flag(2); -} -impl HiTrace_Flag { - /** @brief Trace points are automatically added to spans. By default, no trace point is added. - - @syscap SystemCapability.HiviewDFX.HiTrace - - @since 12*/ - pub const HITRACE_FLAG_TP_INFO: HiTrace_Flag = HiTrace_Flag(4); -} -impl HiTrace_Flag { - /** @brief Information about the start and end of the trace task is not printed. By default, information about the - start and end of the trace task is printed. - - @syscap SystemCapability.HiviewDFX.HiTrace - - @since 12*/ - pub const HITRACE_FLAG_NO_BE_INFO: HiTrace_Flag = HiTrace_Flag(8); -} -impl HiTrace_Flag { - /** @brief The ID is not added to the log. By default, the ID is added to the log. - - @syscap SystemCapability.HiviewDFX.HiTrace - - @since 12*/ - pub const HITRACE_FLAG_DONOT_ENABLE_LOG: HiTrace_Flag = HiTrace_Flag(16); -} -impl HiTrace_Flag { - /** @brief Tracing is triggered by faults. - - @syscap SystemCapability.HiviewDFX.HiTrace - - @since 12*/ - pub const HITRACE_FLAG_FAULT_TRIGGER: HiTrace_Flag = HiTrace_Flag(32); -} -impl HiTrace_Flag { - /** @brief Trace points are added only for call chain trace between devices. - By default, device-to-device trace points are not added. - - @syscap SystemCapability.HiviewDFX.HiTrace - - @since 12*/ - pub const HITRACE_FLAG_D2D_TP_INFO: HiTrace_Flag = HiTrace_Flag(64); -} -impl ::core::ops::BitOr for HiTrace_Flag { - type Output = Self; - #[inline] - fn bitor(self, other: Self) -> Self { - HiTrace_Flag(self.0 | other.0) - } -} -impl ::core::ops::BitOrAssign for HiTrace_Flag { - #[inline] - fn bitor_assign(&mut self, rhs: HiTrace_Flag) { - self.0 |= rhs.0; - } -} -impl ::core::ops::BitAnd for HiTrace_Flag { - type Output = Self; - #[inline] - fn bitand(self, other: Self) -> Self { - HiTrace_Flag(self.0 & other.0) - } -} -impl ::core::ops::BitAndAssign for HiTrace_Flag { - #[inline] - fn bitand_assign(&mut self, rhs: HiTrace_Flag) { - self.0 &= rhs.0; - } -} -#[repr(transparent)] -/** @brief Enumerates the HiTrace flags. - -@syscap SystemCapability.HiviewDFX.HiTrace - -@since 12*/ -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct HiTrace_Flag(pub ::core::ffi::c_uint); -#[repr(u32)] -/** @brief Enumerates the HiTrace trace point types. - -@syscap SystemCapability.HiviewDFX.HiTrace - -@since 12*/ -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub enum HiTrace_Tracepoint_Type { - /** @brief CS trace point. - - @syscap SystemCapability.HiviewDFX.HiTrace - - @since 12*/ - HITRACE_TP_CS = 0, - /** @brief CR trace point. - - @syscap SystemCapability.HiviewDFX.HiTrace - - @since 12*/ - HITRACE_TP_CR = 1, - /** @brief SS trace point. - - @syscap SystemCapability.HiviewDFX.HiTrace - - @since 12*/ - HITRACE_TP_SS = 2, - /** @brief SR trace point. - - @syscap SystemCapability.HiviewDFX.HiTrace - - @since 12*/ - HITRACE_TP_SR = 3, - /** @brief General trace point. - - @syscap SystemCapability.HiviewDFX.HiTrace - - @since 12*/ - HITRACE_TP_GENERAL = 4, -} -impl HiTrace_Communication_Mode { - /** @brief Default communication mode. - - @syscap SystemCapability.HiviewDFX.HiTrace - - @since 12*/ - pub const HITRACE_CM_DEFAULT: HiTrace_Communication_Mode = HiTrace_Communication_Mode(0); -} -impl HiTrace_Communication_Mode { - /** @brief Inter-thread communication. - - @syscap SystemCapability.HiviewDFX.HiTrace - - @since 12*/ - pub const HITRACE_CM_THREAD: HiTrace_Communication_Mode = HiTrace_Communication_Mode(1); -} -impl HiTrace_Communication_Mode { - /** @brief Inter-process communication. - - @syscap SystemCapability.HiviewDFX.HiTrace - - @since 12*/ - pub const HITRACE_CM_PROCESS: HiTrace_Communication_Mode = HiTrace_Communication_Mode(2); -} -impl HiTrace_Communication_Mode { - /** @brief Inter-device communication. - - @syscap SystemCapability.HiviewDFX.HiTrace - - @since 12*/ - pub const HITRACE_CM_DEVICE: HiTrace_Communication_Mode = HiTrace_Communication_Mode(3); -} -#[repr(transparent)] -/** @brief Enumerates the HiTrace communication modes. - -@syscap SystemCapability.HiviewDFX.HiTrace - -@since 12*/ -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct HiTrace_Communication_Mode(pub ::core::ffi::c_uint); -/** @brief Defines a HiTraceId instance. - -@struct HiTraceId - -@syscap SystemCapability.HiviewDFX.HiTrace - -@since 12*/ -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct HiTraceId { - pub _bitfield_align_1: [u64; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 16usize]>, -} -impl HiTraceId { - #[inline] - pub fn valid(&self) -> u64 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u64) } - } - #[inline] - pub fn set_valid(&mut self, val: u64) { - unsafe { - let val: u64 = ::core::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) - } - } - #[inline] - pub fn ver(&self) -> u64 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 3u8) as u64) } - } - #[inline] - pub fn set_ver(&mut self, val: u64) { - unsafe { - let val: u64 = ::core::mem::transmute(val); - self._bitfield_1.set(1usize, 3u8, val as u64) - } - } - #[inline] - pub fn chainId(&self) -> u64 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 60u8) as u64) } - } - #[inline] - pub fn set_chainId(&mut self, val: u64) { - unsafe { - let val: u64 = ::core::mem::transmute(val); - self._bitfield_1.set(4usize, 60u8, val as u64) - } - } - #[inline] - pub fn flags(&self) -> u64 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(64usize, 12u8) as u64) } - } - #[inline] - pub fn set_flags(&mut self, val: u64) { - unsafe { - let val: u64 = ::core::mem::transmute(val); - self._bitfield_1.set(64usize, 12u8, val as u64) - } - } - #[inline] - pub fn spanId(&self) -> u64 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(76usize, 26u8) as u64) } - } - #[inline] - pub fn set_spanId(&mut self, val: u64) { - unsafe { - let val: u64 = ::core::mem::transmute(val); - self._bitfield_1.set(76usize, 26u8, val as u64) - } - } - #[inline] - pub fn parentSpanId(&self) -> u64 { - unsafe { ::core::mem::transmute(self._bitfield_1.get(102usize, 26u8) as u64) } - } - #[inline] - pub fn set_parentSpanId(&mut self, val: u64) { - unsafe { - let val: u64 = ::core::mem::transmute(val); - self._bitfield_1.set(102usize, 26u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - valid: u64, - ver: u64, - chainId: u64, - flags: u64, - spanId: u64, - parentSpanId: u64, - ) -> __BindgenBitfieldUnit<[u8; 16usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 16usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let valid: u64 = unsafe { ::core::mem::transmute(valid) }; - valid as u64 - }); - __bindgen_bitfield_unit.set(1usize, 3u8, { - let ver: u64 = unsafe { ::core::mem::transmute(ver) }; - ver as u64 - }); - __bindgen_bitfield_unit.set(4usize, 60u8, { - let chainId: u64 = unsafe { ::core::mem::transmute(chainId) }; - chainId as u64 - }); - __bindgen_bitfield_unit.set(64usize, 12u8, { - let flags: u64 = unsafe { ::core::mem::transmute(flags) }; - flags as u64 - }); - __bindgen_bitfield_unit.set(76usize, 26u8, { - let spanId: u64 = unsafe { ::core::mem::transmute(spanId) }; - spanId as u64 - }); - __bindgen_bitfield_unit.set(102usize, 26u8, { - let parentSpanId: u64 = unsafe { ::core::mem::transmute(parentSpanId) }; - parentSpanId as u64 - }); - __bindgen_bitfield_unit - } -} - -extern "C" { - /** @brief Starts tracing of a process. - - This API starts tracing, creates a HiTraceId instance, and sets it to the TLS of the calling thread. - This API works only when it is called for the first time. - - @param name Pointer to a process name. - @param flags Trace flag. - @return Returns the created HiTraceId instance. - - @syscap SystemCapability.HiviewDFX.HiTrace - - @since 12*/ - pub fn OH_HiTrace_BeginChain( - name: *const ::core::ffi::c_char, - flags: ::core::ffi::c_int, - ) -> HiTraceId; - /** @brief Ends tracing and clears the HiTraceId instance of the calling thread from the TLS. - - - @syscap SystemCapability.HiviewDFX.HiTrace - - @since 12*/ - pub fn OH_HiTrace_EndChain(); - /** @brief Obtains the trace ID of the calling thread from the TLS. - - - @return Returns the trace ID of the calling thread. If the calling thread does not have a trace ID, - an invalid trace ID is returned. - - @syscap SystemCapability.HiviewDFX.HiTrace - - @since 12*/ - pub fn OH_HiTrace_GetId() -> HiTraceId; - /** @brief Sets the trace ID of the calling thread. If the ID is invalid, no operation is performed. - - This API sets a HiTraceId instance to the TLS of the calling thread. - - @param id Trace ID to set. - - @syscap SystemCapability.HiviewDFX.HiTrace - - @since 12*/ - pub fn OH_HiTrace_SetId(id: *const HiTraceId); - /** @brief Clears the trace ID of the calling thread and invalidates it. - - This API clears the HiTraceId instance in the TLS of the calling thread. - - @syscap SystemCapability.HiviewDFX.HiTrace - - @since 12*/ - pub fn OH_HiTrace_ClearId(); - /** @brief Creates a span ID based on the trace ID of the calling thread. - - This API generates a new span and corresponding HiTraceId instance based on the HiTraceId - instance in the TLS of the calling thread. - - @return Returns a valid span ID. If span creation is not allowed, the ID of the calling thread is traced. - - @syscap SystemCapability.HiviewDFX.HiTrace - - @since 12*/ - pub fn OH_HiTrace_CreateSpan() -> HiTraceId; - /** @brief Prints HiTrace information, including the trace ID. - - This API prints trace point information, including the communication mode, trace point type, timestamp, and span. - - @param mode Communication mode for the trace point. - @param type Trace point type. - @param id Trace ID. - @param fmt Custom information to print. - - @syscap SystemCapability.HiviewDFX.HiTrace - - @since 12*/ - pub fn OH_HiTrace_Tracepoint( - mode: HiTrace_Communication_Mode, - type_: HiTrace_Tracepoint_Type, - id: *const HiTraceId, - fmt: *const ::core::ffi::c_char, - ... - ); - /** @brief Initializes a HiTraceId structure. - - @param id ID of the HiTraceId structure to be initialized. - - @syscap SystemCapability.HiviewDFX.HiTrace - - @since 12*/ - pub fn OH_HiTrace_InitId(id: *mut HiTraceId); - /** @brief Creates a HiTraceId structure based on a byte array. - - @param id ID of the HiTraceId structure to be created. - @param pIdArray Byte array. - @param len Length of the byte array. - - @syscap SystemCapability.HiviewDFX.HiTrace - - @since 12*/ - pub fn OH_HiTrace_IdFromBytes(id: *mut HiTraceId, pIdArray: *const u8, len: ::core::ffi::c_int); - /** @brief Checks whether a HiTraceId instance is valid. - - - @param id HiTraceId instance to check. - @return Returns true if the HiTraceId instance is valid; returns false otherwise. - - @syscap SystemCapability.HiviewDFX.HiTrace - - @since 12*/ - pub fn OH_HiTrace_IsIdValid(id: *const HiTraceId) -> bool; - /** @brief Checks whether the specified trace flag in a HiTraceId instance is enabled. - - - @param id HiTraceId instance to check. - @param flag Specified trace flag. - @return Returns true if the specified trace flag is enabled; returns false otherwise. - - @syscap SystemCapability.HiviewDFX.HiTrace - - @since 12*/ - pub fn OH_HiTrace_IsFlagEnabled(id: *const HiTraceId, flag: HiTrace_Flag) -> bool; - /** @brief Enables the specified trace flag in a HiTraceId instance. - - - @param id HiTraceId instance for which you want to enable the specified trace flag. - @param flag Specified trace flag. - - @syscap SystemCapability.HiviewDFX.HiTrace - - @since 12*/ - pub fn OH_HiTrace_EnableFlag(id: *const HiTraceId, flag: HiTrace_Flag); - /** @brief Obtains the trace flag set in a HiTraceId instance. - - @param id HiTraceId instance. - - @return Returns the trace flag set in the specified HiTraceId instance. - - @syscap SystemCapability.HiviewDFX.HiTrace - - @since 12*/ - pub fn OH_HiTrace_GetFlags(id: *const HiTraceId) -> ::core::ffi::c_int; - /** @brief Sets the trace flag for a HiTraceId instance. - - @param id HiTraceId instance. - @param flags Trace flag to set. - - @syscap SystemCapability.HiviewDFX.HiTrace - - @since 12*/ - pub fn OH_HiTrace_SetFlags(id: *mut HiTraceId, flags: ::core::ffi::c_int); - /** @brief Obtains the trace chain ID. - - @param id HiTraceId instance for which you want to obtain the trace chain ID. - - @return Returns the trace chain ID of the specified HiTraceId instance. - - @syscap SystemCapability.HiviewDFX.HiTrace - - @since 12*/ - pub fn OH_HiTrace_GetChainId(id: *const HiTraceId) -> u64; - /** @brief Sets the trace chain ID to a HiTraceId instance - - @param id HiTraceId instance. - @param chainId Trace chain ID to set. - - @syscap SystemCapability.HiviewDFX.HiTrace - - @since 12*/ - pub fn OH_HiTrace_SetChainId(id: *mut HiTraceId, chainId: u64); - /** @brief Obtains the span ID in a HiTraceId instance. - - @param id HiTraceId instance for which you want to obtain the span ID. - - @return Returns the span ID in the specified HiTraceId instance. - - @syscap SystemCapability.HiviewDFX.HiTrace - - @since 12*/ - pub fn OH_HiTrace_GetSpanId(id: *const HiTraceId) -> u64; - /** @brief Sets the span ID in a HiTraceId instance. - - @param id HiTraceId instance for which you want to set the span ID. - @param spanId Span ID to set. - - @syscap SystemCapability.HiviewDFX.HiTrace - - @since 12*/ - pub fn OH_HiTrace_SetSpanId(id: *mut HiTraceId, spanId: u64); - /** @brief Obtains the parent span ID in a HiTraceId instance. - - @param id HiTraceId instance for which you want to obtain the parent span ID. - - @return Returns the parent span ID in the specified HiTraceId instance. - - @syscap SystemCapability.HiviewDFX.HiTrace - - @since 12*/ - pub fn OH_HiTrace_GetParentSpanId(id: *const HiTraceId) -> u64; - /** @brief Sets the parent span ID in a HiTraceId instance. - - @param id HiTraceId instance for which you want to set the parent span ID. - @param parentSpanId Parent span ID to set. - - @syscap SystemCapability.HiviewDFX.HiTrace - - @since 12*/ - pub fn OH_HiTrace_SetParentSpanId(id: *mut HiTraceId, parentSpanId: u64); - /** @brief Converts a HiTraceId instance into a byte array for caching or communication. - - @param id HiTraceId instance to be converted. - @param pIdArray Byte array. - @param len Length of the byte array. - - @return Returns the length of the byte array after conversion. - - @syscap SystemCapability.HiviewDFX.HiTrace - - @since 12*/ - pub fn OH_HiTrace_IdToBytes( - id: *const HiTraceId, - pIdArray: *mut u8, - len: ::core::ffi::c_int, - ) -> ::core::ffi::c_int; -} diff --git a/components/hitrace/src/hitrace_api10.rs b/components/hitrace/src/hitrace_api10.rs deleted file mode 100644 index 24fb607..0000000 --- a/components/hitrace/src/hitrace_api10.rs +++ /dev/null @@ -1,70 +0,0 @@ -/* automatically generated by rust-bindgen 0.69.4 */ - -#![allow(non_upper_case_globals)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] - -extern "C" { - /** @brief Marks the start of a synchronous trace task. - - The OH_HiTrace_StartTrace and OH_HiTrace_FinishTrace APIs must be used in pairs. - The two APIs can be used in nested mode. The stack data structure is used for matching during trace data parsing. - - @param name Name of a trace task. - - @syscap SystemCapability.HiviewDFX.HiTrace - @since 10*/ - pub fn OH_HiTrace_StartTrace(name: *const ::core::ffi::c_char); - /** @brief Marks the end of a synchronous trace task. - - This API must be used with OH_HiTrace_StartTrace in pairs. During trace data parsing, the system matches - it with the OH_HiTrace_StartTrace API recently invoked in the service process. - - @syscap SystemCapability.HiviewDFX.HiTrace - @since 10*/ - pub fn OH_HiTrace_FinishTrace(); - /** @brief Marks the start of an asynchronous trace task. - - This API is called to implement performance trace in asynchronous manner. The start and end of an asynchronous - trace task do not occur in sequence. Therefore, a unique taskId is required to ensure proper data parsing. - It is passed as an input parameter for the asynchronous API. - This API is used with OH_HiTrace_FinishAsyncTrace in pairs. The two APIs that have the same name and - task ID together form an asynchronous timeslice trace task. - If multiple trace tasks with the same name need to be performed at the same time or a trace task needs to be - performed multiple times concurrently, different task IDs must be specified in OH_HiTrace_StartTrace. - If the trace tasks with the same name are not performed at the same time, the same taskId can be used. - - @param name Name of the asynchronous trace task. - @param taskId ID of the asynchronous trace task. The start and end of an asynchronous trace task do not occur in - sequence. Therefore, the start and end of an asynchronous trace need to be matched based on the task name and the - unique task ID together. - - @syscap SystemCapability.HiviewDFX.HiTrace - @since 10*/ - pub fn OH_HiTrace_StartAsyncTrace(name: *const ::core::ffi::c_char, taskId: i32); - /** @brief Marks the end of an asynchronous trace task. - - This API is called in the callback function after an asynchronous trace is complete. - It is used with OH_HiTrace_StartAsyncTrace in pairs. Its name and task ID must be the same as those of - OH_HiTrace_StartAsyncTrace. - - @param name Name of the asynchronous trace task. - @param taskId ID of the asynchronous trace task. The start and end of an asynchronous trace task do not occur in - sequence. Therefore, the start and end of an asynchronous trace need to be matched based on the task name and the - unique task ID together. - - @syscap SystemCapability.HiviewDFX.HiTrace - @since 10*/ - pub fn OH_HiTrace_FinishAsyncTrace(name: *const ::core::ffi::c_char, taskId: i32); - /** @brief Traces the value change of an integer variable based on its name. - - This API can be executed for multiple times to trace the value change of a given integer variable at different - time points. - - @param name Name of the integer variable. It does not need to be the same as the real variable name. - @param count Integer value. Generally, an integer variable can be passed. - - @syscap SystemCapability.HiviewDFX.HiTrace - @since 10*/ - pub fn OH_HiTrace_CountTrace(name: *const ::core::ffi::c_char, count: i64); -} diff --git a/components/hitrace/src/hitrace_api11.rs b/components/hitrace/src/hitrace_api11.rs deleted file mode 100644 index 24fb607..0000000 --- a/components/hitrace/src/hitrace_api11.rs +++ /dev/null @@ -1,70 +0,0 @@ -/* automatically generated by rust-bindgen 0.69.4 */ - -#![allow(non_upper_case_globals)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] - -extern "C" { - /** @brief Marks the start of a synchronous trace task. - - The OH_HiTrace_StartTrace and OH_HiTrace_FinishTrace APIs must be used in pairs. - The two APIs can be used in nested mode. The stack data structure is used for matching during trace data parsing. - - @param name Name of a trace task. - - @syscap SystemCapability.HiviewDFX.HiTrace - @since 10*/ - pub fn OH_HiTrace_StartTrace(name: *const ::core::ffi::c_char); - /** @brief Marks the end of a synchronous trace task. - - This API must be used with OH_HiTrace_StartTrace in pairs. During trace data parsing, the system matches - it with the OH_HiTrace_StartTrace API recently invoked in the service process. - - @syscap SystemCapability.HiviewDFX.HiTrace - @since 10*/ - pub fn OH_HiTrace_FinishTrace(); - /** @brief Marks the start of an asynchronous trace task. - - This API is called to implement performance trace in asynchronous manner. The start and end of an asynchronous - trace task do not occur in sequence. Therefore, a unique taskId is required to ensure proper data parsing. - It is passed as an input parameter for the asynchronous API. - This API is used with OH_HiTrace_FinishAsyncTrace in pairs. The two APIs that have the same name and - task ID together form an asynchronous timeslice trace task. - If multiple trace tasks with the same name need to be performed at the same time or a trace task needs to be - performed multiple times concurrently, different task IDs must be specified in OH_HiTrace_StartTrace. - If the trace tasks with the same name are not performed at the same time, the same taskId can be used. - - @param name Name of the asynchronous trace task. - @param taskId ID of the asynchronous trace task. The start and end of an asynchronous trace task do not occur in - sequence. Therefore, the start and end of an asynchronous trace need to be matched based on the task name and the - unique task ID together. - - @syscap SystemCapability.HiviewDFX.HiTrace - @since 10*/ - pub fn OH_HiTrace_StartAsyncTrace(name: *const ::core::ffi::c_char, taskId: i32); - /** @brief Marks the end of an asynchronous trace task. - - This API is called in the callback function after an asynchronous trace is complete. - It is used with OH_HiTrace_StartAsyncTrace in pairs. Its name and task ID must be the same as those of - OH_HiTrace_StartAsyncTrace. - - @param name Name of the asynchronous trace task. - @param taskId ID of the asynchronous trace task. The start and end of an asynchronous trace task do not occur in - sequence. Therefore, the start and end of an asynchronous trace need to be matched based on the task name and the - unique task ID together. - - @syscap SystemCapability.HiviewDFX.HiTrace - @since 10*/ - pub fn OH_HiTrace_FinishAsyncTrace(name: *const ::core::ffi::c_char, taskId: i32); - /** @brief Traces the value change of an integer variable based on its name. - - This API can be executed for multiple times to trace the value change of a given integer variable at different - time points. - - @param name Name of the integer variable. It does not need to be the same as the real variable name. - @param count Integer value. Generally, an integer variable can be passed. - - @syscap SystemCapability.HiviewDFX.HiTrace - @since 10*/ - pub fn OH_HiTrace_CountTrace(name: *const ::core::ffi::c_char, count: i64); -} diff --git a/components/hitrace/src/hitrace_api12.rs b/components/hitrace/src/hitrace_ffi.rs similarity index 66% rename from components/hitrace/src/hitrace_api12.rs rename to components/hitrace/src/hitrace_ffi.rs index dd86448..cc483f5 100644 --- a/components/hitrace/src/hitrace_api12.rs +++ b/components/hitrace/src/hitrace_ffi.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.71.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] @@ -20,10 +20,7 @@ where Storage: AsRef<[u8]> + AsMut<[u8]>, { #[inline] - pub fn get_bit(&self, index: usize) -> bool { - debug_assert!(index / 8 < self.storage.as_ref().len()); - let byte_index = index / 8; - let byte = self.storage.as_ref()[byte_index]; + fn extract_bit(byte: u8, index: usize) -> bool { let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { @@ -33,10 +30,21 @@ where byte & mask == mask } #[inline] - pub fn set_bit(&mut self, index: usize, val: bool) { + pub fn get_bit(&self, index: usize) -> bool { debug_assert!(index / 8 < self.storage.as_ref().len()); let byte_index = index / 8; - let byte = &mut self.storage.as_mut()[byte_index]; + let byte = self.storage.as_ref()[byte_index]; + Self::extract_bit(byte, index) + } + #[inline] + pub unsafe fn raw_get_bit(this: *const Self, index: usize) -> bool { + debug_assert!(index / 8 < core::mem::size_of::()); + let byte_index = index / 8; + let byte = *(core::ptr::addr_of!((*this).storage) as *const u8).offset(byte_index as isize); + Self::extract_bit(byte, index) + } + #[inline] + fn change_bit(byte: u8, index: usize, val: bool) -> u8 { let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { @@ -44,12 +52,27 @@ where }; let mask = 1 << bit_index; if val { - *byte |= mask; + byte | mask } else { - *byte &= !mask; + byte & !mask } } #[inline] + pub fn set_bit(&mut self, index: usize, val: bool) { + debug_assert!(index / 8 < self.storage.as_ref().len()); + let byte_index = index / 8; + let byte = &mut self.storage.as_mut()[byte_index]; + *byte = Self::change_bit(*byte, index, val); + } + #[inline] + pub unsafe fn raw_set_bit(this: *mut Self, index: usize, val: bool) { + debug_assert!(index / 8 < core::mem::size_of::()); + let byte_index = index / 8; + let byte = + (core::ptr::addr_of_mut!((*this).storage) as *mut u8).offset(byte_index as isize); + *byte = Self::change_bit(*byte, index, val); + } + #[inline] pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); @@ -68,6 +91,24 @@ where val } #[inline] + pub unsafe fn raw_get(this: *const Self, bit_offset: usize, bit_width: u8) -> u64 { + debug_assert!(bit_width <= 64); + debug_assert!(bit_offset / 8 < core::mem::size_of::()); + debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::(),); + let mut val = 0; + for i in 0..(bit_width as usize) { + if Self::raw_get_bit(this, i + bit_offset) { + let index = if cfg!(target_endian = "big") { + bit_width as usize - 1 - i + } else { + i + }; + val |= 1 << index; + } + } + val + } + #[inline] pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); @@ -83,21 +124,45 @@ where self.set_bit(index + bit_offset, val_bit_is_set); } } + #[inline] + pub unsafe fn raw_set(this: *mut Self, bit_offset: usize, bit_width: u8, val: u64) { + debug_assert!(bit_width <= 64); + debug_assert!(bit_offset / 8 < core::mem::size_of::()); + debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::(),); + for i in 0..(bit_width as usize) { + let mask = 1 << i; + let val_bit_is_set = val & mask == mask; + let index = if cfg!(target_endian = "big") { + bit_width as usize - 1 - i + } else { + i + }; + Self::raw_set_bit(this, index + bit_offset, val_bit_is_set); + } + } } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl HiTraceId_Valid { /** @brief Invalid HiTraceId instance. @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const HITRACE_ID_INVALID: HiTraceId_Valid = HiTraceId_Valid(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl HiTraceId_Valid { /** @brief Valid HiTraceId instance. @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const HITRACE_ID_VALID: HiTraceId_Valid = HiTraceId_Valid(1); } #[repr(transparent)] @@ -106,14 +171,20 @@ impl HiTraceId_Valid { @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct HiTraceId_Valid(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl HiTrace_Version { /** @brief Version 1. @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const HITRACE_VER_1: HiTrace_Version = HiTrace_Version(0); } #[repr(transparent)] @@ -122,40 +193,60 @@ impl HiTrace_Version { @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct HiTrace_Version(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl HiTrace_Flag { /** @brief Default flag. @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const HITRACE_FLAG_DEFAULT: HiTrace_Flag = HiTrace_Flag(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl HiTrace_Flag { /** @brief Both synchronous and asynchronous calls are traced. By default, only synchronous calls are traced. @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const HITRACE_FLAG_INCLUDE_ASYNC: HiTrace_Flag = HiTrace_Flag(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl HiTrace_Flag { /** @brief No spans are created. By default, spans are created. @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const HITRACE_FLAG_DONOT_CREATE_SPAN: HiTrace_Flag = HiTrace_Flag(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl HiTrace_Flag { /** @brief Trace points are automatically added to spans. By default, no trace point is added. @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const HITRACE_FLAG_TP_INFO: HiTrace_Flag = HiTrace_Flag(4); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl HiTrace_Flag { /** @brief Information about the start and end of the trace task is not printed. By default, information about the start and end of the trace task is printed. @@ -163,24 +254,36 @@ impl HiTrace_Flag { @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const HITRACE_FLAG_NO_BE_INFO: HiTrace_Flag = HiTrace_Flag(8); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl HiTrace_Flag { /** @brief The ID is not added to the log. By default, the ID is added to the log. @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const HITRACE_FLAG_DONOT_ENABLE_LOG: HiTrace_Flag = HiTrace_Flag(16); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl HiTrace_Flag { /** @brief Tracing is triggered by faults. @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const HITRACE_FLAG_FAULT_TRIGGER: HiTrace_Flag = HiTrace_Flag(32); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl HiTrace_Flag { /** @brief Trace points are added only for call chain trace between devices. By default, device-to-device trace points are not added. @@ -188,8 +291,12 @@ impl HiTrace_Flag { @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const HITRACE_FLAG_D2D_TP_INFO: HiTrace_Flag = HiTrace_Flag(64); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ::core::ops::BitOr for HiTrace_Flag { type Output = Self; #[inline] @@ -197,12 +304,16 @@ impl ::core::ops::BitOr for HiTrace_Flag { HiTrace_Flag(self.0 | other.0) } } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ::core::ops::BitOrAssign for HiTrace_Flag { #[inline] fn bitor_assign(&mut self, rhs: HiTrace_Flag) { self.0 |= rhs.0; } } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ::core::ops::BitAnd for HiTrace_Flag { type Output = Self; #[inline] @@ -210,6 +321,8 @@ impl ::core::ops::BitAnd for HiTrace_Flag { HiTrace_Flag(self.0 & other.0) } } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl ::core::ops::BitAndAssign for HiTrace_Flag { #[inline] fn bitand_assign(&mut self, rhs: HiTrace_Flag) { @@ -222,14 +335,19 @@ impl ::core::ops::BitAndAssign for HiTrace_Flag { @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct HiTrace_Flag(pub ::core::ffi::c_uint); #[repr(u32)] +#[non_exhaustive] /** @brief Enumerates the HiTrace trace point types. @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum HiTrace_Tracepoint_Type { /** @brief CS trace point. @@ -237,62 +355,88 @@ pub enum HiTrace_Tracepoint_Type { @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] HITRACE_TP_CS = 0, /** @brief CR trace point. @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] HITRACE_TP_CR = 1, /** @brief SS trace point. @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] HITRACE_TP_SS = 2, /** @brief SR trace point. @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] HITRACE_TP_SR = 3, /** @brief General trace point. @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] HITRACE_TP_GENERAL = 4, } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl HiTrace_Communication_Mode { /** @brief Default communication mode. @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const HITRACE_CM_DEFAULT: HiTrace_Communication_Mode = HiTrace_Communication_Mode(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl HiTrace_Communication_Mode { /** @brief Inter-thread communication. @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const HITRACE_CM_THREAD: HiTrace_Communication_Mode = HiTrace_Communication_Mode(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl HiTrace_Communication_Mode { /** @brief Inter-process communication. @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const HITRACE_CM_PROCESS: HiTrace_Communication_Mode = HiTrace_Communication_Mode(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl HiTrace_Communication_Mode { /** @brief Inter-device communication. @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const HITRACE_CM_DEVICE: HiTrace_Communication_Mode = HiTrace_Communication_Mode(3); } #[repr(transparent)] @@ -301,6 +445,8 @@ impl HiTrace_Communication_Mode { @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct HiTrace_Communication_Mode(pub ::core::ffi::c_uint); /** @brief Defines a HiTraceId instance. @@ -310,6 +456,8 @@ pub struct HiTrace_Communication_Mode(pub ::core::ffi::c_uint); @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct HiTraceId { @@ -329,6 +477,28 @@ impl HiTraceId { } } #[inline] + pub unsafe fn valid_raw(this: *const Self) -> u64 { + unsafe { + ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 16usize]>>::raw_get( + ::core::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_valid_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::core::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 16usize]>>::raw_set( + ::core::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] pub fn ver(&self) -> u64 { unsafe { ::core::mem::transmute(self._bitfield_1.get(1usize, 3u8) as u64) } } @@ -340,6 +510,28 @@ impl HiTraceId { } } #[inline] + pub unsafe fn ver_raw(this: *const Self) -> u64 { + unsafe { + ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 16usize]>>::raw_get( + ::core::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 3u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_ver_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::core::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 16usize]>>::raw_set( + ::core::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 3u8, + val as u64, + ) + } + } + #[inline] pub fn chainId(&self) -> u64 { unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 60u8) as u64) } } @@ -351,6 +543,28 @@ impl HiTraceId { } } #[inline] + pub unsafe fn chainId_raw(this: *const Self) -> u64 { + unsafe { + ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 16usize]>>::raw_get( + ::core::ptr::addr_of!((*this)._bitfield_1), + 4usize, + 60u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_chainId_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::core::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 16usize]>>::raw_set( + ::core::ptr::addr_of_mut!((*this)._bitfield_1), + 4usize, + 60u8, + val as u64, + ) + } + } + #[inline] pub fn flags(&self) -> u64 { unsafe { ::core::mem::transmute(self._bitfield_1.get(64usize, 12u8) as u64) } } @@ -362,6 +576,28 @@ impl HiTraceId { } } #[inline] + pub unsafe fn flags_raw(this: *const Self) -> u64 { + unsafe { + ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 16usize]>>::raw_get( + ::core::ptr::addr_of!((*this)._bitfield_1), + 64usize, + 12u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_flags_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::core::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 16usize]>>::raw_set( + ::core::ptr::addr_of_mut!((*this)._bitfield_1), + 64usize, + 12u8, + val as u64, + ) + } + } + #[inline] pub fn spanId(&self) -> u64 { unsafe { ::core::mem::transmute(self._bitfield_1.get(76usize, 26u8) as u64) } } @@ -373,6 +609,28 @@ impl HiTraceId { } } #[inline] + pub unsafe fn spanId_raw(this: *const Self) -> u64 { + unsafe { + ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 16usize]>>::raw_get( + ::core::ptr::addr_of!((*this)._bitfield_1), + 76usize, + 26u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_spanId_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::core::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 16usize]>>::raw_set( + ::core::ptr::addr_of_mut!((*this)._bitfield_1), + 76usize, + 26u8, + val as u64, + ) + } + } + #[inline] pub fn parentSpanId(&self) -> u64 { unsafe { ::core::mem::transmute(self._bitfield_1.get(102usize, 26u8) as u64) } } @@ -384,6 +642,28 @@ impl HiTraceId { } } #[inline] + pub unsafe fn parentSpanId_raw(this: *const Self) -> u64 { + unsafe { + ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 16usize]>>::raw_get( + ::core::ptr::addr_of!((*this)._bitfield_1), + 102usize, + 26u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_parentSpanId_raw(this: *mut Self, val: u64) { + unsafe { + let val: u64 = ::core::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 16usize]>>::raw_set( + ::core::ptr::addr_of_mut!((*this)._bitfield_1), + 102usize, + 26u8, + val as u64, + ) + } + } + #[inline] pub fn new_bitfield_1( valid: u64, ver: u64, @@ -433,6 +713,8 @@ extern "C" { @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_HiTrace_BeginChain( name: *const ::core::ffi::c_char, flags: ::core::ffi::c_int, @@ -443,6 +725,8 @@ extern "C" { @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_HiTrace_EndChain(); /** @brief Obtains the trace ID of the calling thread from the TLS. @@ -453,6 +737,8 @@ extern "C" { @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_HiTrace_GetId() -> HiTraceId; /** @brief Sets the trace ID of the calling thread. If the ID is invalid, no operation is performed. @@ -463,6 +749,8 @@ extern "C" { @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_HiTrace_SetId(id: *const HiTraceId); /** @brief Clears the trace ID of the calling thread and invalidates it. @@ -471,6 +759,8 @@ extern "C" { @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_HiTrace_ClearId(); /** @brief Creates a span ID based on the trace ID of the calling thread. @@ -482,6 +772,8 @@ extern "C" { @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_HiTrace_CreateSpan() -> HiTraceId; /** @brief Prints HiTrace information, including the trace ID. @@ -495,6 +787,8 @@ extern "C" { @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_HiTrace_Tracepoint( mode: HiTrace_Communication_Mode, type_: HiTrace_Tracepoint_Type, @@ -509,6 +803,8 @@ extern "C" { @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_HiTrace_InitId(id: *mut HiTraceId); /** @brief Creates a HiTraceId structure based on a byte array. @@ -519,6 +815,8 @@ extern "C" { @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_HiTrace_IdFromBytes(id: *mut HiTraceId, pIdArray: *const u8, len: ::core::ffi::c_int); /** @brief Checks whether a HiTraceId instance is valid. @@ -529,6 +827,8 @@ extern "C" { @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_HiTrace_IsIdValid(id: *const HiTraceId) -> bool; /** @brief Checks whether the specified trace flag in a HiTraceId instance is enabled. @@ -540,6 +840,8 @@ extern "C" { @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_HiTrace_IsFlagEnabled(id: *const HiTraceId, flag: HiTrace_Flag) -> bool; /** @brief Enables the specified trace flag in a HiTraceId instance. @@ -550,6 +852,8 @@ extern "C" { @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_HiTrace_EnableFlag(id: *const HiTraceId, flag: HiTrace_Flag); /** @brief Obtains the trace flag set in a HiTraceId instance. @@ -560,6 +864,8 @@ extern "C" { @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_HiTrace_GetFlags(id: *const HiTraceId) -> ::core::ffi::c_int; /** @brief Sets the trace flag for a HiTraceId instance. @@ -569,6 +875,8 @@ extern "C" { @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_HiTrace_SetFlags(id: *mut HiTraceId, flags: ::core::ffi::c_int); /** @brief Obtains the trace chain ID. @@ -579,6 +887,8 @@ extern "C" { @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_HiTrace_GetChainId(id: *const HiTraceId) -> u64; /** @brief Sets the trace chain ID to a HiTraceId instance @@ -588,6 +898,8 @@ extern "C" { @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_HiTrace_SetChainId(id: *mut HiTraceId, chainId: u64); /** @brief Obtains the span ID in a HiTraceId instance. @@ -598,6 +910,8 @@ extern "C" { @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_HiTrace_GetSpanId(id: *const HiTraceId) -> u64; /** @brief Sets the span ID in a HiTraceId instance. @@ -607,6 +921,8 @@ extern "C" { @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_HiTrace_SetSpanId(id: *mut HiTraceId, spanId: u64); /** @brief Obtains the parent span ID in a HiTraceId instance. @@ -617,6 +933,8 @@ extern "C" { @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_HiTrace_GetParentSpanId(id: *const HiTraceId) -> u64; /** @brief Sets the parent span ID in a HiTraceId instance. @@ -626,6 +944,8 @@ extern "C" { @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_HiTrace_SetParentSpanId(id: *mut HiTraceId, parentSpanId: u64); /** @brief Converts a HiTraceId instance into a byte array for caching or communication. @@ -638,6 +958,8 @@ extern "C" { @syscap SystemCapability.HiviewDFX.HiTrace @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_HiTrace_IdToBytes( id: *const HiTraceId, pIdArray: *mut u8, diff --git a/components/hitrace/src/lib.rs b/components/hitrace/src/lib.rs index 1a01b20..e63ee42 100644 --- a/components/hitrace/src/lib.rs +++ b/components/hitrace/src/lib.rs @@ -11,12 +11,5 @@ #[link(name = "hitrace_ndk.z")] extern "C" {} -mod hitrace_api10; -pub use hitrace_api10::*; - -#[cfg(feature = "api-12")] -#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] -mod api12_additions; -#[cfg(feature = "api-12")] -#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] -pub use api12_additions::*; +mod hitrace_ffi; +pub use hitrace_ffi::*; diff --git a/components/xcomponent/Cargo.toml b/components/xcomponent/Cargo.toml index 66903ea..6e94391 100644 --- a/components/xcomponent/Cargo.toml +++ b/components/xcomponent/Cargo.toml @@ -12,13 +12,16 @@ readme = "README.md" [dependencies] document-features = { version = "0.2", optional = true } keyboard-types = {version = "0.7.0", optional = true} +arkui-sys = { version = "0.1.0", optional = true} [features] default = [] api-10 = [] api-11 = ["api-10"] -api-12 = ["api-11"] +api-12 = ["api-11", "arkui-sys?/api-12"] +## Enables XComponent APIs that depend on ArkUI. +arkui = ["dep:arkui-sys"] ## Provides optional conversion from the OH keyboard enum to the keyboard-types enum. keyboard-types = ["dep:keyboard-types"] ## Document available features when building the documentation diff --git a/components/xcomponent/src/api11_additions.rs b/components/xcomponent/src/api11_additions.rs deleted file mode 100644 index 1e99935..0000000 --- a/components/xcomponent/src/api11_additions.rs +++ /dev/null @@ -1,62 +0,0 @@ -#![allow(non_upper_case_globals)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] - -use super::OH_NativeXComponent; - -/** @brief Defines the expected frame rate range struct. - -@since 11 -@version 1.0*/ -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct OH_NativeXComponent_ExpectedRateRange { - /// The minimum frame rate of dynamical callback rate range. - pub min: i32, - /// The maximum frame rate of dynamical callback rate range. - pub max: i32, - /// The expected frame rate of dynamical callback rate range. - pub expected: i32, -} - -extern "C" { - /** @brief Set the Expected FrameRateRange. - - @param component Indicates the pointer to this OH_NativeXComponent instance. - @param callback Indicates the pointer to a expected rate range. - @return Returns the status code of the execution. - @since 11 - @version 1.0*/ - pub fn OH_NativeXComponent_SetExpectedFrameRateRange( - component: *mut OH_NativeXComponent, - range: *mut OH_NativeXComponent_ExpectedRateRange, - ) -> i32; - - /** @brief Registers a callback for this OH_NativeXComponent instance. - - @param component Indicates the pointer to this OH_NativeXComponent instance. - @param callback Indicates the pointer to a onFrame callback. - @return Returns the status code of the execution. - @since 11 - @version 1.0*/ - pub fn OH_NativeXComponent_RegisterOnFrameCallback( - component: *mut OH_NativeXComponent, - callback: ::core::option::Option< - unsafe extern "C" fn( - component: *mut OH_NativeXComponent, - timestamp: u64, - targetTimestamp: u64, - ), - >, - ) -> i32; - - /** @brief UnRegister a callback for this OH_NativeXComponent instance. - - @param component Indicates the pointer to this OH_NativeXComponent instance. - @return Returns the status code of the execution. - @since 11 - @version 1.0*/ - pub fn OH_NativeXComponent_UnregisterOnFrameCallback( - component: *mut OH_NativeXComponent, - ) -> i32; -} diff --git a/components/xcomponent/src/lib.rs b/components/xcomponent/src/lib.rs index dd078d7..c9885a4 100644 --- a/components/xcomponent/src/lib.rs +++ b/components/xcomponent/src/lib.rs @@ -28,15 +28,34 @@ #[link(name = "ace_ndk.z")] extern "C" {} -mod xcomponent_api10; -pub use xcomponent_api10::*; - -#[cfg(feature = "api-11")] -#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] -mod api11_additions; -#[cfg(feature = "api-11")] -#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] -pub use api11_additions::*; +mod xcomponent_ffi; +pub use xcomponent_ffi::*; + +#[cfg(feature = "arkui")] +mod xcomponent_arkui_ffi; +#[cfg(feature = "arkui")] +pub use xcomponent_arkui_ffi::*; + +mod xcomponent_result_ffi; + +/// Enumerates the API access states. +/// +/// Available since API 8. +#[repr(transparent)] +pub struct XcomponentResult(pub std::ffi::c_int); + +impl XcomponentResult { + pub const SUCCESS: Self = Self(0); + pub const FAILED: Self = Self(-1); + pub const BAD_PARAMETER: Self = Self(-2); +} + +// assert that our handwritten binding matches the size of the generated binding. +// needs to be updated when regenerating the bindings, since the bindgen type name +// may change. +#[allow(dead_code)] +const ASSERT_SIZE_OK: () = + assert!(size_of::() == size_of::()); #[cfg(feature = "keyboard-types")] #[cfg_attr(docsrs, doc(cfg(feature = "keyboard-types")))] diff --git a/components/xcomponent/src/xcomponent_api10.rs b/components/xcomponent/src/xcomponent_api10.rs deleted file mode 100644 index 3d9068f..0000000 --- a/components/xcomponent/src/xcomponent_api10.rs +++ /dev/null @@ -1,1684 +0,0 @@ -/* automatically generated by rust-bindgen 0.69.4 */ - -#![allow(non_upper_case_globals)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] - -pub const OH_NATIVE_XCOMPONENT_OBJ: &[u8; 26] = b"__NATIVE_XCOMPONENT_OBJ__\0"; -impl OH_NativeXComponent_KeyCode { - pub const KEY_UNKNOWN: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(-1); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_FN: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(0); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_HOME: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(1); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_BACK: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_MEDIA_PLAY_PAUSE: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(10); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_MEDIA_STOP: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(11); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_MEDIA_NEXT: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(12); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_MEDIA_PREVIOUS: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(13); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_MEDIA_REWIND: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(14); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_MEDIA_FAST_FORWARD: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(15); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_VOLUME_UP: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(16); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_VOLUME_DOWN: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(17); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_POWER: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(18); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_CAMERA: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(19); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_VOLUME_MUTE: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(22); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_MUTE: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(23); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_BRIGHTNESS_UP: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(40); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_BRIGHTNESS_DOWN: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(41); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_0: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2000); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_1: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2001); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_2: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2002); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_3: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2003); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_4: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2004); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_5: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2005); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_6: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2006); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_7: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2007); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_8: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2008); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_9: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2009); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_STAR: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2010); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_POUND: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2011); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_DPAD_UP: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2012); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_DPAD_DOWN: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2013); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_DPAD_LEFT: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2014); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_DPAD_RIGHT: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2015); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_DPAD_CENTER: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2016); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_A: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2017); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_B: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2018); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_C: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2019); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_D: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2020); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_E: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2021); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_F: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2022); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_G: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2023); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_H: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2024); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_I: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2025); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_J: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2026); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_K: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2027); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_L: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2028); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_M: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2029); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_N: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2030); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_O: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2031); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_P: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2032); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_Q: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2033); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_R: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2034); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_S: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2035); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_T: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2036); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_U: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2037); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_V: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2038); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_W: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2039); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_X: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2040); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_Y: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2041); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_Z: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2042); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_COMMA: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2043); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_PERIOD: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2044); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_ALT_LEFT: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2045); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_ALT_RIGHT: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2046); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_SHIFT_LEFT: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2047); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_SHIFT_RIGHT: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2048); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_TAB: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2049); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_SPACE: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2050); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_SYM: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2051); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_EXPLORER: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2052); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_ENVELOPE: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2053); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_ENTER: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2054); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_DEL: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2055); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_GRAVE: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2056); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_MINUS: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2057); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_EQUALS: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2058); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_LEFT_BRACKET: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2059); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_RIGHT_BRACKET: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2060); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_BACKSLASH: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2061); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_SEMICOLON: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2062); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_APOSTROPHE: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2063); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_SLASH: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2064); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_AT: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2065); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_PLUS: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2066); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_MENU: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2067); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_PAGE_UP: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2068); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_PAGE_DOWN: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2069); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_ESCAPE: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2070); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_FORWARD_DEL: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2071); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_CTRL_LEFT: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2072); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_CTRL_RIGHT: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2073); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_CAPS_LOCK: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2074); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_SCROLL_LOCK: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2075); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_META_LEFT: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2076); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_META_RIGHT: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2077); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_FUNCTION: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2078); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_SYSRQ: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2079); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_BREAK: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2080); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_MOVE_HOME: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2081); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_MOVE_END: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2082); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_INSERT: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2083); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_FORWARD: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2084); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_MEDIA_PLAY: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2085); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_MEDIA_PAUSE: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2086); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_MEDIA_CLOSE: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2087); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_MEDIA_EJECT: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2088); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_MEDIA_RECORD: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2089); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_F1: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2090); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_F2: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2091); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_F3: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2092); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_F4: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2093); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_F5: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2094); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_F6: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2095); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_F7: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2096); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_F8: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2097); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_F9: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2098); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_F10: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2099); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_F11: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2100); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_F12: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2101); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_NUM_LOCK: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2102); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_NUMPAD_0: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2103); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_NUMPAD_1: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2104); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_NUMPAD_2: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2105); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_NUMPAD_3: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2106); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_NUMPAD_4: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2107); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_NUMPAD_5: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2108); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_NUMPAD_6: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2109); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_NUMPAD_7: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2110); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_NUMPAD_8: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2111); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_NUMPAD_9: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2112); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_NUMPAD_DIVIDE: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2113); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_NUMPAD_MULTIPLY: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2114); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_NUMPAD_SUBTRACT: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2115); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_NUMPAD_ADD: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2116); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_NUMPAD_DOT: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2117); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_NUMPAD_COMMA: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2118); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_NUMPAD_ENTER: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2119); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_NUMPAD_EQUALS: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2120); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_NUMPAD_LEFT_PAREN: OH_NativeXComponent_KeyCode = - OH_NativeXComponent_KeyCode(2121); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_NUMPAD_RIGHT_PAREN: OH_NativeXComponent_KeyCode = - OH_NativeXComponent_KeyCode(2122); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_VIRTUAL_MULTITASK: OH_NativeXComponent_KeyCode = - OH_NativeXComponent_KeyCode(2210); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_SLEEP: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2600); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_ZENKAKU_HANKAKU: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2601); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_102ND: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2602); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_RO: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2603); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_KATAKANA: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2604); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_HIRAGANA: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2605); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_HENKAN: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2606); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_KATAKANA_HIRAGANA: OH_NativeXComponent_KeyCode = - OH_NativeXComponent_KeyCode(2607); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_MUHENKAN: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2608); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_LINEFEED: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2609); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_MACRO: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2610); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_NUMPAD_PLUSMINUS: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2611); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_SCALE: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2612); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_HANGUEL: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2613); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_HANJA: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2614); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_YEN: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2615); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_STOP: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2616); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_AGAIN: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2617); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_PROPS: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2618); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_UNDO: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2619); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_COPY: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2620); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_OPEN: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2621); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_PASTE: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2622); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_FIND: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2623); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_CUT: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2624); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_HELP: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2625); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_CALC: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2626); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_FILE: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2627); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_BOOKMARKS: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2628); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_NEXT: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2629); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_PLAYPAUSE: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2630); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_PREVIOUS: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2631); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_STOPCD: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2632); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_CONFIG: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2634); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_REFRESH: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2635); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_EXIT: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2636); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_EDIT: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2637); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_SCROLLUP: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2638); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_SCROLLDOWN: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2639); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_NEW: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2640); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_REDO: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2641); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_CLOSE: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2642); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_PLAY: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2643); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_BASSBOOST: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2644); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_PRINT: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2645); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_CHAT: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2646); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_FINANCE: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2647); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_CANCEL: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2648); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_KBDILLUM_TOGGLE: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2649); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_KBDILLUM_DOWN: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2650); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_KBDILLUM_UP: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2651); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_SEND: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2652); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_REPLY: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2653); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_FORWARDMAIL: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2654); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_SAVE: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2655); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_DOCUMENTS: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2656); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_VIDEO_NEXT: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2657); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_VIDEO_PREV: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2658); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_BRIGHTNESS_CYCLE: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2659); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_BRIGHTNESS_ZERO: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2660); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_DISPLAY_OFF: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2661); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_BTN_MISC: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2662); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_GOTO: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2663); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_INFO: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2664); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_PROGRAM: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2665); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_PVR: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2666); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_SUBTITLE: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2667); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_FULL_SCREEN: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2668); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_KEYBOARD: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2669); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_ASPECT_RATIO: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2670); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_PC: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2671); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_TV: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2672); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_TV2: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2673); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_VCR: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2674); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_VCR2: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2675); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_SAT: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2676); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_CD: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2677); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_TAPE: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2678); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_TUNER: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2679); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_PLAYER: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2680); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_DVD: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2681); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_AUDIO: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2682); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_VIDEO: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2683); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_MEMO: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2684); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_CALENDAR: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2685); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_RED: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2686); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_GREEN: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2687); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_YELLOW: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2688); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_BLUE: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2689); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_CHANNELUP: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2690); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_CHANNELDOWN: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2691); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_LAST: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2692); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_RESTART: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2693); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_SLOW: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2694); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_SHUFFLE: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2695); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_VIDEOPHONE: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2696); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_GAMES: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2697); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_ZOOMIN: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2698); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_ZOOMOUT: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2699); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_ZOOMRESET: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2700); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_WORDPROCESSOR: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2701); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_EDITOR: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2702); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_SPREADSHEET: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2703); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_GRAPHICSEDITOR: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2704); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_PRESENTATION: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2705); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_DATABASE: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2706); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_NEWS: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2707); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_VOICEMAIL: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2708); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_ADDRESSBOOK: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2709); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_MESSENGER: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2710); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_BRIGHTNESS_TOGGLE: OH_NativeXComponent_KeyCode = - OH_NativeXComponent_KeyCode(2711); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_SPELLCHECK: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2712); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_COFFEE: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2713); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_MEDIA_REPEAT: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2714); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_IMAGES: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2715); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_BUTTONCONFIG: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2716); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_TASKMANAGER: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2717); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_JOURNAL: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2718); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_CONTROLPANEL: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2719); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_APPSELECT: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2720); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_SCREENSAVER: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2721); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_ASSISTANT: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2722); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_KBD_LAYOUT_NEXT: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2723); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_BRIGHTNESS_MIN: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2724); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_BRIGHTNESS_MAX: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2725); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_KBDINPUTASSIST_PREV: OH_NativeXComponent_KeyCode = - OH_NativeXComponent_KeyCode(2726); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_KBDINPUTASSIST_NEXT: OH_NativeXComponent_KeyCode = - OH_NativeXComponent_KeyCode(2727); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_KBDINPUTASSIST_PREVGROUP: OH_NativeXComponent_KeyCode = - OH_NativeXComponent_KeyCode(2728); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_KBDINPUTASSIST_NEXTGROUP: OH_NativeXComponent_KeyCode = - OH_NativeXComponent_KeyCode(2729); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_KBDINPUTASSIST_ACCEPT: OH_NativeXComponent_KeyCode = - OH_NativeXComponent_KeyCode(2730); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_KBDINPUTASSIST_CANCEL: OH_NativeXComponent_KeyCode = - OH_NativeXComponent_KeyCode(2731); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_FRONT: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2800); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_SETUP: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2801); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_WAKEUP: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2802); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_SENDFILE: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2803); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_DELETEFILE: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2804); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_XFER: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2805); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_PROG1: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2806); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_PROG2: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2807); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_MSDOS: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2808); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_SCREENLOCK: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2809); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_DIRECTION_ROTATE_DISPLAY: OH_NativeXComponent_KeyCode = - OH_NativeXComponent_KeyCode(2810); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_CYCLEWINDOWS: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2811); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_COMPUTER: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2812); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_EJECTCLOSECD: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2813); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_ISO: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2814); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_MOVE: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2815); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_F13: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2816); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_F14: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2817); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_F15: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2818); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_F16: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2819); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_F17: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2820); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_F18: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2821); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_F19: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2822); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_F20: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2823); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_F21: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2824); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_F22: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2825); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_F23: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2826); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_F24: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2827); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_PROG3: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2828); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_PROG4: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2829); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_DASHBOARD: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2830); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_SUSPEND: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2831); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_HP: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2832); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_SOUND: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2833); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_QUESTION: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2834); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_CONNECT: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2836); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_SPORT: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2837); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_SHOP: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2838); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_ALTERASE: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2839); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_SWITCHVIDEOMODE: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2841); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_BATTERY: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2842); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_BLUETOOTH: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2843); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_WLAN: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2844); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_UWB: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2845); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_WWAN_WIMAX: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2846); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_RFKILL: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(2847); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_CHANNEL: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(3001); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_BTN_0: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(3100); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_BTN_1: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(3101); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_BTN_2: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(3102); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_BTN_3: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(3103); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_BTN_4: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(3104); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_BTN_5: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(3105); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_BTN_6: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(3106); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_BTN_7: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(3107); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_BTN_8: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(3108); -} -impl OH_NativeXComponent_KeyCode { - pub const KEY_BTN_9: OH_NativeXComponent_KeyCode = OH_NativeXComponent_KeyCode(3109); -} -#[repr(transparent)] -/** @brief Represents the key event code. - -@since 10 -@version 1.0*/ -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct OH_NativeXComponent_KeyCode(pub ::core::ffi::c_int); -impl OH_NativeXComponent_KeyAction { - pub const OH_NATIVEXCOMPONENT_KEY_ACTION_UNKNOWN: OH_NativeXComponent_KeyAction = - OH_NativeXComponent_KeyAction(-1); -} -impl OH_NativeXComponent_KeyAction { - pub const OH_NATIVEXCOMPONENT_KEY_ACTION_DOWN: OH_NativeXComponent_KeyAction = - OH_NativeXComponent_KeyAction(0); -} -impl OH_NativeXComponent_KeyAction { - pub const OH_NATIVEXCOMPONENT_KEY_ACTION_UP: OH_NativeXComponent_KeyAction = - OH_NativeXComponent_KeyAction(1); -} -#[repr(transparent)] -/** @brief Represents the key event action. - -@since 10 -@version 1.0*/ -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct OH_NativeXComponent_KeyAction(pub ::core::ffi::c_int); -pub const OH_XCOMPONENT_ID_LEN_MAX: u32 = 128; -pub const OH_MAX_TOUCH_POINTS_NUMBER: u32 = 10; -/// Successful. -pub const OH_NATIVEXCOMPONENT_RESULT_SUCCESS: _bindgen_ty_1 = _bindgen_ty_1(0); -/// Failed. -pub const OH_NATIVEXCOMPONENT_RESULT_FAILED: _bindgen_ty_1 = _bindgen_ty_1(-1); -/// Invalid parameters. -pub const OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER: _bindgen_ty_1 = _bindgen_ty_1(-2); -#[repr(transparent)] -/** @brief Enumerates the API access states. - -@since 8 -@version 1.0*/ -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct _bindgen_ty_1(pub ::core::ffi::c_int); -impl OH_NativeXComponent_TouchEventType { - /// Trigger a touch event when a finger is pressed. - pub const OH_NATIVEXCOMPONENT_DOWN: OH_NativeXComponent_TouchEventType = - OH_NativeXComponent_TouchEventType(0); -} -impl OH_NativeXComponent_TouchEventType { - /// Trigger a touch event when a finger is lifted. - pub const OH_NATIVEXCOMPONENT_UP: OH_NativeXComponent_TouchEventType = - OH_NativeXComponent_TouchEventType(1); -} -impl OH_NativeXComponent_TouchEventType { - /// Trigger a touch event when a finger moves on the screen in pressed state. - pub const OH_NATIVEXCOMPONENT_MOVE: OH_NativeXComponent_TouchEventType = - OH_NativeXComponent_TouchEventType(2); -} -impl OH_NativeXComponent_TouchEventType { - /// Trigger an event when a touch event is canceled. - pub const OH_NATIVEXCOMPONENT_CANCEL: OH_NativeXComponent_TouchEventType = - OH_NativeXComponent_TouchEventType(3); -} -impl OH_NativeXComponent_TouchEventType { - /// Invalid touch type. - pub const OH_NATIVEXCOMPONENT_UNKNOWN: OH_NativeXComponent_TouchEventType = - OH_NativeXComponent_TouchEventType(4); -} -#[repr(transparent)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct OH_NativeXComponent_TouchEventType(pub ::core::ffi::c_uint); -impl OH_NativeXComponent_TouchPointToolType { - /// Indicates invalid tool type. - pub const OH_NATIVEXCOMPONENT_TOOL_TYPE_UNKNOWN: OH_NativeXComponent_TouchPointToolType = - OH_NativeXComponent_TouchPointToolType(0); -} -impl OH_NativeXComponent_TouchPointToolType { - /// Indicates a finger. - pub const OH_NATIVEXCOMPONENT_TOOL_TYPE_FINGER: OH_NativeXComponent_TouchPointToolType = - OH_NativeXComponent_TouchPointToolType(1); -} -impl OH_NativeXComponent_TouchPointToolType { - /// Indicates a stylus. - pub const OH_NATIVEXCOMPONENT_TOOL_TYPE_PEN: OH_NativeXComponent_TouchPointToolType = - OH_NativeXComponent_TouchPointToolType(2); -} -impl OH_NativeXComponent_TouchPointToolType { - /// Indicates a eraser. - pub const OH_NATIVEXCOMPONENT_TOOL_TYPE_RUBBER: OH_NativeXComponent_TouchPointToolType = - OH_NativeXComponent_TouchPointToolType(3); -} -impl OH_NativeXComponent_TouchPointToolType { - /// Indicates a brush. - pub const OH_NATIVEXCOMPONENT_TOOL_TYPE_BRUSH: OH_NativeXComponent_TouchPointToolType = - OH_NativeXComponent_TouchPointToolType(4); -} -impl OH_NativeXComponent_TouchPointToolType { - /// Indicates a pencil. - pub const OH_NATIVEXCOMPONENT_TOOL_TYPE_PENCIL: OH_NativeXComponent_TouchPointToolType = - OH_NativeXComponent_TouchPointToolType(5); -} -impl OH_NativeXComponent_TouchPointToolType { - /// Indicates a brush. - pub const OH_NATIVEXCOMPONENT_TOOL_TYPE_AIRBRUSH: OH_NativeXComponent_TouchPointToolType = - OH_NativeXComponent_TouchPointToolType(6); -} -impl OH_NativeXComponent_TouchPointToolType { - /// Indicates a mouse. - pub const OH_NATIVEXCOMPONENT_TOOL_TYPE_MOUSE: OH_NativeXComponent_TouchPointToolType = - OH_NativeXComponent_TouchPointToolType(7); -} -impl OH_NativeXComponent_TouchPointToolType { - /// Indicates a lens. - pub const OH_NATIVEXCOMPONENT_TOOL_TYPE_LENS: OH_NativeXComponent_TouchPointToolType = - OH_NativeXComponent_TouchPointToolType(8); -} -#[repr(transparent)] -/** @brief Represents the touch point tool type. - -@since 9 -@version 1.0*/ -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct OH_NativeXComponent_TouchPointToolType(pub ::core::ffi::c_uint); -impl OH_NativeXComponent_EventSourceType { - /// Indicates an unknown input source type. - pub const OH_NATIVEXCOMPONENT_SOURCE_TYPE_UNKNOWN: OH_NativeXComponent_EventSourceType = - OH_NativeXComponent_EventSourceType(0); -} -impl OH_NativeXComponent_EventSourceType { - /// Indicates that the input source generates a mouse multi-touch event. - pub const OH_NATIVEXCOMPONENT_SOURCE_TYPE_MOUSE: OH_NativeXComponent_EventSourceType = - OH_NativeXComponent_EventSourceType(1); -} -impl OH_NativeXComponent_EventSourceType { - /// Indicates that the input source generates a touchscreen multi-touch event. - pub const OH_NATIVEXCOMPONENT_SOURCE_TYPE_TOUCHSCREEN: OH_NativeXComponent_EventSourceType = - OH_NativeXComponent_EventSourceType(2); -} -impl OH_NativeXComponent_EventSourceType { - /// Indicates that the input source generates a touchpad multi-touch event. - pub const OH_NATIVEXCOMPONENT_SOURCE_TYPE_TOUCHPAD: OH_NativeXComponent_EventSourceType = - OH_NativeXComponent_EventSourceType(3); -} -impl OH_NativeXComponent_EventSourceType { - /// Indicates that the input source generates a joystick multi-touch event. - pub const OH_NATIVEXCOMPONENT_SOURCE_TYPE_JOYSTICK: OH_NativeXComponent_EventSourceType = - OH_NativeXComponent_EventSourceType(4); -} -impl OH_NativeXComponent_EventSourceType { - /** @brief Indicates that the input source generates a keyboard event. - - @since 10 - @version 1.0*/ - pub const OH_NATIVEXCOMPONENT_SOURCE_TYPE_KEYBOARD: OH_NativeXComponent_EventSourceType = - OH_NativeXComponent_EventSourceType(5); -} -#[repr(transparent)] -/** @brief Represents the touch event source type. - -@since 9 -@version 1.0*/ -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct OH_NativeXComponent_EventSourceType(pub ::core::ffi::c_uint); -impl OH_NativeXComponent_MouseEventAction { - pub const OH_NATIVEXCOMPONENT_MOUSE_NONE: OH_NativeXComponent_MouseEventAction = - OH_NativeXComponent_MouseEventAction(0); -} -impl OH_NativeXComponent_MouseEventAction { - pub const OH_NATIVEXCOMPONENT_MOUSE_PRESS: OH_NativeXComponent_MouseEventAction = - OH_NativeXComponent_MouseEventAction(1); -} -impl OH_NativeXComponent_MouseEventAction { - pub const OH_NATIVEXCOMPONENT_MOUSE_RELEASE: OH_NativeXComponent_MouseEventAction = - OH_NativeXComponent_MouseEventAction(2); -} -impl OH_NativeXComponent_MouseEventAction { - pub const OH_NATIVEXCOMPONENT_MOUSE_MOVE: OH_NativeXComponent_MouseEventAction = - OH_NativeXComponent_MouseEventAction(3); -} -#[repr(transparent)] -/** @brief Represents the mouse event action. - -@since 9 -@version 1.0*/ -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct OH_NativeXComponent_MouseEventAction(pub ::core::ffi::c_uint); -impl OH_NativeXComponent_MouseEventButton { - pub const OH_NATIVEXCOMPONENT_NONE_BUTTON: OH_NativeXComponent_MouseEventButton = - OH_NativeXComponent_MouseEventButton(0); -} -impl OH_NativeXComponent_MouseEventButton { - pub const OH_NATIVEXCOMPONENT_LEFT_BUTTON: OH_NativeXComponent_MouseEventButton = - OH_NativeXComponent_MouseEventButton(1); -} -impl OH_NativeXComponent_MouseEventButton { - pub const OH_NATIVEXCOMPONENT_RIGHT_BUTTON: OH_NativeXComponent_MouseEventButton = - OH_NativeXComponent_MouseEventButton(2); -} -impl OH_NativeXComponent_MouseEventButton { - pub const OH_NATIVEXCOMPONENT_MIDDLE_BUTTON: OH_NativeXComponent_MouseEventButton = - OH_NativeXComponent_MouseEventButton(4); -} -impl OH_NativeXComponent_MouseEventButton { - pub const OH_NATIVEXCOMPONENT_BACK_BUTTON: OH_NativeXComponent_MouseEventButton = - OH_NativeXComponent_MouseEventButton(8); -} -impl OH_NativeXComponent_MouseEventButton { - pub const OH_NATIVEXCOMPONENT_FORWARD_BUTTON: OH_NativeXComponent_MouseEventButton = - OH_NativeXComponent_MouseEventButton(16); -} -#[repr(transparent)] -/** @brief Represents the mouse event button. - -@since 9 -@version 1.0*/ -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct OH_NativeXComponent_MouseEventButton(pub ::core::ffi::c_uint); -impl OH_NativeXComponent_TouchEvent_SourceTool { - pub const OH_NATIVEXCOMPONENT_SOURCETOOL_UNKNOWN: OH_NativeXComponent_TouchEvent_SourceTool = - OH_NativeXComponent_TouchEvent_SourceTool(0); -} -impl OH_NativeXComponent_TouchEvent_SourceTool { - pub const OH_NATIVEXCOMPONENT_SOURCETOOL_FINGER: OH_NativeXComponent_TouchEvent_SourceTool = - OH_NativeXComponent_TouchEvent_SourceTool(1); -} -impl OH_NativeXComponent_TouchEvent_SourceTool { - pub const OH_NATIVEXCOMPONENT_SOURCETOOL_PEN: OH_NativeXComponent_TouchEvent_SourceTool = - OH_NativeXComponent_TouchEvent_SourceTool(2); -} -impl OH_NativeXComponent_TouchEvent_SourceTool { - pub const OH_NATIVEXCOMPONENT_SOURCETOOL_RUBBER: OH_NativeXComponent_TouchEvent_SourceTool = - OH_NativeXComponent_TouchEvent_SourceTool(3); -} -impl OH_NativeXComponent_TouchEvent_SourceTool { - pub const OH_NATIVEXCOMPONENT_SOURCETOOL_BRUSH: OH_NativeXComponent_TouchEvent_SourceTool = - OH_NativeXComponent_TouchEvent_SourceTool(4); -} -impl OH_NativeXComponent_TouchEvent_SourceTool { - pub const OH_NATIVEXCOMPONENT_SOURCETOOL_PENCIL: OH_NativeXComponent_TouchEvent_SourceTool = - OH_NativeXComponent_TouchEvent_SourceTool(5); -} -impl OH_NativeXComponent_TouchEvent_SourceTool { - pub const OH_NATIVEXCOMPONENT_SOURCETOOL_AIRBRUSH: OH_NativeXComponent_TouchEvent_SourceTool = - OH_NativeXComponent_TouchEvent_SourceTool(6); -} -impl OH_NativeXComponent_TouchEvent_SourceTool { - pub const OH_NATIVEXCOMPONENT_SOURCETOOL_MOUSE: OH_NativeXComponent_TouchEvent_SourceTool = - OH_NativeXComponent_TouchEvent_SourceTool(7); -} -impl OH_NativeXComponent_TouchEvent_SourceTool { - pub const OH_NATIVEXCOMPONENT_SOURCETOOL_LENS: OH_NativeXComponent_TouchEvent_SourceTool = - OH_NativeXComponent_TouchEvent_SourceTool(8); -} -impl OH_NativeXComponent_TouchEvent_SourceTool { - pub const OH_NATIVEXCOMPONENT_SOURCETOOL_TOUCHPAD: OH_NativeXComponent_TouchEvent_SourceTool = - OH_NativeXComponent_TouchEvent_SourceTool(9); -} -#[repr(transparent)] -/** @brief Represents the source tool type of TouchEvent - -@since 10 -@version 1.0*/ -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct OH_NativeXComponent_TouchEvent_SourceTool(pub ::core::ffi::c_uint); -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct OH_NativeXComponent_HistoricalPoint { - /// Unique identifier of a finger. - pub id: i32, - /// X coordinate of the touch point relative to the left edge of the screen. - pub screenX: f32, - /// Y coordinate of the touch point relative to the upper edge of the screen. - pub screenY: f32, - /// X coordinate of the touch point relative to the left edge of the element to touch. - pub x: f32, - /// Y coordinate of the touch point relative to the upper edge of the element to touch. - pub y: f32, - /// Touch type of the touch event. - pub type_: OH_NativeXComponent_TouchEventType, - /// Contact area between the finger pad and the screen. - pub size: f64, - /// Pressure of the current touch event. - pub force: f32, - /// Timestamp of the current touch event. - pub timeStamp: i64, - /// The angle betweenprojection on plane-X-Y and axis-Z of the current touch event. - pub titlX: f32, - /// The angle betweenprojection on plane-Y-Z and axis-Z of the current touch event. - pub titlY: f32, - /// The sourceTool of the current touch event. - pub sourceTool: OH_NativeXComponent_TouchEvent_SourceTool, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct OH_NativeXComponent_TouchPoint { - /// Unique identifier of a finger. - pub id: i32, - /// X coordinate of the touch point relative to the left edge of the screen. - pub screenX: f32, - /// Y coordinate of the touch point relative to the upper edge of the screen. - pub screenY: f32, - /// X coordinate of the touch point relative to the left edge of the element to touch. - pub x: f32, - /// Y coordinate of the touch point relative to the upper edge of the element to touch. - pub y: f32, - /// Touch type of the touch event. - pub type_: OH_NativeXComponent_TouchEventType, - /// Contact area between the finger pad and the screen. - pub size: f64, - /// Pressure of the current touch event. - pub force: f32, - /// Timestamp of the current touch event. - pub timeStamp: i64, - /// Whether the current point is pressed. - pub isPressed: bool, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct OH_NativeXComponent_TouchEvent { - /// Unique identifier of a finger. - pub id: i32, - /// X coordinate of the touch point relative to the left edge of the screen. - pub screenX: f32, - /// Y coordinate of the touch point relative to the upper edge of the screen. - pub screenY: f32, - /// X coordinate of the touch point relative to the left edge of the element to touch. - pub x: f32, - /// Y coordinate of the touch point relative to the upper edge of the element to touch. - pub y: f32, - /// Touch type of the touch event. - pub type_: OH_NativeXComponent_TouchEventType, - /// Contact area between the finger pad and the screen. - pub size: f64, - /// Pressure of the current touch event. - pub force: f32, - /// ID of the device where the current touch event is generated. - pub deviceId: i64, - /// Timestamp of the current touch event. - pub timeStamp: i64, - /// Array of the current touch points. - pub touchPoints: [OH_NativeXComponent_TouchPoint; 10usize], - /// Number of current touch points. - pub numPoints: u32, -} -/** @brief Represents the mouse event information. - -@since 9 -@version 1.0*/ -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct OH_NativeXComponent_MouseEvent { - /// X coordinate of the mouse point relative to the left edge of the element to mouse. - pub x: f32, - /// Y coordinate of the mouse point relative to the upper edge of the element to mouse. - pub y: f32, - /// X coordinate of the mouse point relative to the left edge of the screen. - pub screenX: f32, - /// Y coordinate of the mouse point relative to the upper edge of the screen. - pub screenY: f32, - /// Timestamp of the current mouse event. - pub timestamp: i64, - /// Mouse event action. - pub action: OH_NativeXComponent_MouseEventAction, - /// Mouse event button. - pub button: OH_NativeXComponent_MouseEventButton, -} -#[repr(C)] -pub struct OH_NativeXComponent { - _unused: [u8; 0], -} -/** @brief Registers the surface lifecycle and touch event callbacks. - -@since 8 -@version 1.0*/ -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct OH_NativeXComponent_Callback { - /// Called when the surface is created. - pub OnSurfaceCreated: ::core::option::Option< - unsafe extern "C" fn(component: *mut OH_NativeXComponent, window: *mut ::core::ffi::c_void), - >, - /// Called when the surface is changed. - pub OnSurfaceChanged: ::core::option::Option< - unsafe extern "C" fn(component: *mut OH_NativeXComponent, window: *mut ::core::ffi::c_void), - >, - /// Called when the surface is destroyed. - pub OnSurfaceDestroyed: ::core::option::Option< - unsafe extern "C" fn(component: *mut OH_NativeXComponent, window: *mut ::core::ffi::c_void), - >, - /// Called when a touch event is triggered. - pub DispatchTouchEvent: ::core::option::Option< - unsafe extern "C" fn(component: *mut OH_NativeXComponent, window: *mut ::core::ffi::c_void), - >, -} -/** @brief Registers the mouse event callbacks. - -@since 9 -@version 1.0*/ -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct OH_NativeXComponent_MouseEvent_Callback { - /// Called when a mouse event is triggered. - pub DispatchMouseEvent: ::core::option::Option< - unsafe extern "C" fn(component: *mut OH_NativeXComponent, window: *mut ::core::ffi::c_void), - >, - /// Called when a hover event is triggered. - pub DispatchHoverEvent: ::core::option::Option< - unsafe extern "C" fn(component: *mut OH_NativeXComponent, isHover: bool), - >, -} -#[repr(C)] -pub struct OH_NativeXComponent_KeyEvent { - _unused: [u8; 0], -} -extern "C" { - /** @brief Obtains the ID of the ArkUI XComponent. - - @param component Indicates the pointer to this OH_NativeXComponent instance. - @param id Indicates the char buffer to keep the ID of this OH_NativeXComponent instance.\n - Notice that a null-terminator will be appended to the char buffer, so the size of the\n - char buffer should be at least as large as the size of the real id length plus 1.\n - It is recommended that the size of the char buffer be [OH_XCOMPONENT_ID_LEN_MAX + 1]. - @param size Indicates the pointer to the length of id, which you can set and receive. - @return Returns the status code of the execution. - @since 8 - @version 1.0*/ - pub fn OH_NativeXComponent_GetXComponentId( - component: *mut OH_NativeXComponent, - id: *mut ::core::ffi::c_char, - size: *mut u64, - ) -> i32; - /** @brief Obtains the size of the surface held by the ArkUI XComponent. - - @param component Indicates the pointer to this OH_NativeXComponent instance. - @param window Indicates the native window handler. - @param width Indicates the pointer to the width of the current surface. - @param height Indicates the pointer to the height of the current surface. - @return Returns the status code of the execution. - @since 8 - @version 1.0*/ - pub fn OH_NativeXComponent_GetXComponentSize( - component: *mut OH_NativeXComponent, - window: *const ::core::ffi::c_void, - width: *mut u64, - height: *mut u64, - ) -> i32; - /** @brief Obtains the offset of the surface held by the ArkUI XComponent. - - @param component Indicates the pointer to this OH_NativeXComponent instance. - @param window Indicates the native window handler. - @param x Indicates the pointer to the x coordinate of the current surface. - @param y Indicates the pointer to the y coordinate of the current surface. - @return Returns the status code of the execution. - @since 8 - @version 1.0*/ - pub fn OH_NativeXComponent_GetXComponentOffset( - component: *mut OH_NativeXComponent, - window: *const ::core::ffi::c_void, - x: *mut f64, - y: *mut f64, - ) -> i32; - /** @brief Obtains the touch event dispatched by the ArkUI XComponent. - - @param component Indicates the pointer to this OH_NativeXComponent instance. - @param window Indicates the native window handler. - @param touchEvent Indicates the pointer to the current touch event. - @return Returns the status code of the execution. - @since 8 - @version 1.0*/ - pub fn OH_NativeXComponent_GetTouchEvent( - component: *mut OH_NativeXComponent, - window: *const ::core::ffi::c_void, - touchEvent: *mut OH_NativeXComponent_TouchEvent, - ) -> i32; - /** @brief Obtains the touch pointer tool type by the ArkUI XComponent. - - @param component Indicates the pointer to this OH_NativeXComponent instance. - @param pointIndex Indicates the pointer index in the touchPoints. - @param toolType Indicates the tool Type of the pointer. - @return Returns the status code of the execution. - @since 9 - @version 1.0*/ - pub fn OH_NativeXComponent_GetTouchPointToolType( - component: *mut OH_NativeXComponent, - pointIndex: u32, - toolType: *mut OH_NativeXComponent_TouchPointToolType, - ) -> i32; - /** @brief Obtains the touch pointer tiltX by the ArkUI XComponent. - - @param component Indicates the pointer to this OH_NativeXComponent instance. - @param pointIndex Indicates the pointer index in the touchPoints. - @param tiltX Indicates the x tilt of the pointer. - @return Returns the status code of the execution. - @since 9 - @version 1.0*/ - pub fn OH_NativeXComponent_GetTouchPointTiltX( - component: *mut OH_NativeXComponent, - pointIndex: u32, - tiltX: *mut f32, - ) -> i32; - /** @brief Obtains the touch pointer tiltX by the ArkUI XComponent. - - @param component Indicates the pointer to this OH_NativeXComponent instance. - @param pointIndex Indicates the pointer index in the touchPoints. - @param tiltY Indicates the y tilt of the pointer. - @return Returns the status code of the execution. - @since 9 - @version 1.0*/ - pub fn OH_NativeXComponent_GetTouchPointTiltY( - component: *mut OH_NativeXComponent, - pointIndex: u32, - tiltY: *mut f32, - ) -> i32; - /** @brief Obtains the touch event dispatched by the ArkUI XComponent. - - @param component Indicates the pointer to this OH_NativeXComponent instance. - @param window Indicates the native window handler. - @param historicalPoints Indicates the pointer to the current historicalPoints. - @return Returns the status code of the execution. - @since 10 - @version 1.0*/ - pub fn OH_NativeXComponent_GetHistoricalPoints( - component: *mut OH_NativeXComponent, - window: *const ::core::ffi::c_void, - size: *mut i32, - historicalPoints: *mut *mut OH_NativeXComponent_HistoricalPoint, - ) -> i32; - /** @brief Obtains the mouse event dispatched by the ArkUI XComponent. - - @param component Indicates the pointer to this OH_NativeXComponent instance. - @param window Indicates the native window handler. - @param mouseEvent Indicates the pointer to the current mouse event. - @return Returns the status code of the execution. - @since 9 - @version 1.0*/ - pub fn OH_NativeXComponent_GetMouseEvent( - component: *mut OH_NativeXComponent, - window: *const ::core::ffi::c_void, - mouseEvent: *mut OH_NativeXComponent_MouseEvent, - ) -> i32; - /** @brief Registers a callback for this OH_NativeXComponent instance. - - @param component Indicates the pointer to this OH_NativeXComponent instance. - @param callback Indicates the pointer to a surface lifecycle and touch event callback. - @return Returns the status code of the execution. - @since 8 - @version 1.0*/ - pub fn OH_NativeXComponent_RegisterCallback( - component: *mut OH_NativeXComponent, - callback: *mut OH_NativeXComponent_Callback, - ) -> i32; - /** @brief Registers a callback for this OH_NativeXComponent instance. - - @param component Indicates the pointer to this OH_NativeXComponent instance. - @param callback Indicates the pointer to a mouse event callback. - @return Returns the status code of the execution. - @since 9 - @version 1.0*/ - pub fn OH_NativeXComponent_RegisterMouseEventCallback( - component: *mut OH_NativeXComponent, - callback: *mut OH_NativeXComponent_MouseEvent_Callback, - ) -> i32; - /** @brief Registers a callback for this OH_NativeXComponent instance. - - @param component Indicates the pointer to this OH_NativeXComponent instance. - @param callback Indicates the pointer to a focus event callback. - @return Returns the status code of the execution. - @since 10 - @version 1.0*/ - pub fn OH_NativeXComponent_RegisterFocusEventCallback( - component: *mut OH_NativeXComponent, - callback: ::core::option::Option< - unsafe extern "C" fn( - component: *mut OH_NativeXComponent, - window: *mut ::core::ffi::c_void, - ), - >, - ) -> i32; - /** @brief Registers a callback for this OH_NativeXComponent instance. - - @param component Indicates the pointer to this OH_NativeXComponent instance. - @param callback Indicates the pointer to a key event callback. - @return Returns the status code of the execution. - @since 10 - @version 1.0*/ - pub fn OH_NativeXComponent_RegisterKeyEventCallback( - component: *mut OH_NativeXComponent, - callback: ::core::option::Option< - unsafe extern "C" fn( - component: *mut OH_NativeXComponent, - window: *mut ::core::ffi::c_void, - ), - >, - ) -> i32; - /** @brief Registers a callback for this OH_NativeXComponent instance. - - @param component Indicates the pointer to this OH_NativeXComponent instance. - @param callback Indicates the pointer to a blur event callback. - @return Returns the status code of the execution. - @since 10 - @version 1.0*/ - pub fn OH_NativeXComponent_RegisterBlurEventCallback( - component: *mut OH_NativeXComponent, - callback: ::core::option::Option< - unsafe extern "C" fn( - component: *mut OH_NativeXComponent, - window: *mut ::core::ffi::c_void, - ), - >, - ) -> i32; - /** @brief Obtains the key event dispatched by the ArkUI XComponent. - - @param component Indicates the pointer to this OH_NativeXComponent instance. - @param keyEvent Indicates the pointer to pointer of OH_NativeXComponent_KeyEvent instance. - @return Returns the status code of the execution. - @since 10 - @version 1.0*/ - pub fn OH_NativeXComponent_GetKeyEvent( - component: *mut OH_NativeXComponent, - keyEvent: *mut *mut OH_NativeXComponent_KeyEvent, - ) -> i32; - /** @brief Obtains the action of the key event. - - @param keyEvent Indicates the pointer to this OH_NativeXComponent_KeyEvent instance. - @param action Indicates the action of the OH_NativeXComponent_KeyEvent instance. - @return Returns the status code of the execution. - @since 10 - @version 1.0*/ - pub fn OH_NativeXComponent_GetKeyEventAction( - keyEvent: *mut OH_NativeXComponent_KeyEvent, - action: *mut OH_NativeXComponent_KeyAction, - ) -> i32; - /** @brief Obtains the keyCode of the key event. - - @param keyEvent Indicates the pointer to this OH_NativeXComponent_KeyEvent instance. - @param code Indicates the keyCode of the OH_NativeXComponent_KeyEvent instance. - @return Returns the status code of the execution. - @since 10 - @version 1.0*/ - pub fn OH_NativeXComponent_GetKeyEventCode( - keyEvent: *mut OH_NativeXComponent_KeyEvent, - code: *mut OH_NativeXComponent_KeyCode, - ) -> i32; - /** @brief Obtains the sourceType of the key event. - - @param keyEvent Indicates the pointer to this OH_NativeXComponent_KeyEvent instance. - @param sourceType Indicates the sourceType of the OH_NativeXComponent_KeyEvent instance. - @return Returns the status code of the execution. - @since 10 - @version 1.0*/ - pub fn OH_NativeXComponent_GetKeyEventSourceType( - keyEvent: *mut OH_NativeXComponent_KeyEvent, - sourceType: *mut OH_NativeXComponent_EventSourceType, - ) -> i32; - /** @brief Obtains the deviceId of the key event. - - @param keyEvent Indicates the pointer to this OH_NativeXComponent_KeyEvent instance. - @param deviceId Indicates the deviceId of the OH_NativeXComponent_KeyEvent instance. - @return Returns the status code of the execution. - @since 10 - @version 1.0*/ - pub fn OH_NativeXComponent_GetKeyEventDeviceId( - keyEvent: *mut OH_NativeXComponent_KeyEvent, - deviceId: *mut i64, - ) -> i32; - /** @brief Obtains the timestamp of the key event. - - @param keyEvent Indicates the pointer to this OH_NativeXComponent_KeyEvent instance. - @param timestamp Indicates the timestamp of the OH_NativeXComponent_KeyEvent instance. - @return Returns the status code of the execution. - @since 10 - @version 1.0*/ - pub fn OH_NativeXComponent_GetKeyEventTimestamp( - keyEvent: *mut OH_NativeXComponent_KeyEvent, - timestamp: *mut i64, - ) -> i32; -} diff --git a/components/xcomponent/src/xcomponent_arkui_ffi.rs b/components/xcomponent/src/xcomponent_arkui_ffi.rs new file mode 100644 index 0000000..24db684 --- /dev/null +++ b/components/xcomponent/src/xcomponent_arkui_ffi.rs @@ -0,0 +1,84 @@ +/* automatically generated by rust-bindgen 0.71.1 */ + +#![allow(non_upper_case_globals)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +use super::xcomponent_ffi::*; +use arkui_sys::native_type::ArkUI_NodeHandle; +use arkui_sys::ui_input_event::{ArkUI_UIInputEvent, ArkUI_UIInputEvent_Type, HitTestMode}; + +extern "C" { + /** @brief Attaches the UI component created through the native API of ArkUI to this OH_NativeXComponent instance. + + @param component Indicates the pointer to the OH_NativeXComponent instance. + @param root Indicates the pointer to the component instance created by the native API. + @return Returns the error code. + Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs. + + @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] + pub fn OH_NativeXComponent_AttachNativeRootNode( + component: *mut OH_NativeXComponent, + root: ArkUI_NodeHandle, + ) -> i32; + /** @brief Detaches the native component of ArkUI from this OH_NativeXComponent instance. + + @param component Indicates the pointer to the OH_NativeXComponent instance. + @param root Indicates the pointer to the component instance created by the native API. + @return Returns the error code. + Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs. + + @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] + pub fn OH_NativeXComponent_DetachNativeRootNode( + component: *mut OH_NativeXComponent, + root: ArkUI_NodeHandle, + ) -> i32; + /** @brief Registers a UI input event callback for this OH_NativeXComponent instance and enables the callback to + be invoked when a UI input event is received. + + @param component Indicates the pointer to the OH_NativeXComponent instance. + @param callback Indicates the pointer to the UI input event callback. + @param type Indicates the type of the current UI input event. + @return Returns the error code. + Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs. + @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] + pub fn OH_NativeXComponent_RegisterUIInputEventCallback( + component: *mut OH_NativeXComponent, + callback: ::core::option::Option< + unsafe extern "C" fn( + component: *mut OH_NativeXComponent, + event: *mut ArkUI_UIInputEvent, + type_: ArkUI_UIInputEvent_Type, + ), + >, + type_: ArkUI_UIInputEvent_Type, + ) -> i32; + /** @brief Registers a custom event intercept callback for this OH_NativeXComponent and enables the callback + during the hit test. + + @param component Indicates the pointer to the OH_NativeXComponent instance. + @param callback Indicates the pointer to the custom event intercept callback. + @return Returns the error code. + Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs. + @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] + pub fn OH_NativeXComponent_RegisterOnTouchInterceptCallback( + component: *mut OH_NativeXComponent, + callback: ::core::option::Option< + unsafe extern "C" fn( + component: *mut OH_NativeXComponent, + event: *mut ArkUI_UIInputEvent, + ) -> HitTestMode, + >, + ) -> i32; +} diff --git a/components/xcomponent/src/xcomponent_api11.rs b/components/xcomponent/src/xcomponent_ffi.rs similarity index 90% rename from components/xcomponent/src/xcomponent_api11.rs rename to components/xcomponent/src/xcomponent_ffi.rs index f64c08e..9274e14 100644 --- a/components/xcomponent/src/xcomponent_api11.rs +++ b/components/xcomponent/src/xcomponent_ffi.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.71.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] @@ -1035,19 +1035,6 @@ impl OH_NativeXComponent_KeyAction { pub struct OH_NativeXComponent_KeyAction(pub ::core::ffi::c_int); pub const OH_XCOMPONENT_ID_LEN_MAX: u32 = 128; pub const OH_MAX_TOUCH_POINTS_NUMBER: u32 = 10; -/// Successful. -pub const OH_NATIVEXCOMPONENT_RESULT_SUCCESS: _bindgen_ty_1 = _bindgen_ty_1(0); -/// Failed. -pub const OH_NATIVEXCOMPONENT_RESULT_FAILED: _bindgen_ty_1 = _bindgen_ty_1(-1); -/// Invalid parameters. -pub const OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER: _bindgen_ty_1 = _bindgen_ty_1(-2); -#[repr(transparent)] -/** @brief Enumerates the API access states. - -@since 8 -@version 1.0*/ -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct _bindgen_ty_1(pub ::core::ffi::c_int); impl OH_NativeXComponent_TouchEventType { /// Trigger a touch event when a finger is pressed. pub const OH_NATIVEXCOMPONENT_DOWN: OH_NativeXComponent_TouchEventType = @@ -1423,6 +1410,8 @@ pub struct OH_NativeXComponent_KeyEvent { @since 11 @version 1.0*/ +#[cfg(feature = "api-11")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct OH_NativeXComponent_ExpectedRateRange { @@ -1532,6 +1521,86 @@ extern "C" { pointIndex: u32, tiltY: *mut f32, ) -> i32; + /** @brief Obtains the x coordinate of a specific touch point relative to the upper left corner of\n + the current application window from the ArkUI XComponent. + + @param component Indicates the pointer to this OH_NativeXComponent instance. + @param pointIndex Indicates the pointer index in the touchPoints. + @param windowX Indicates the x coordinate relative to the upper left corner of the current\n + application window. + @return Returns the status code of the execution. + {@link OH_NATIVEXCOMPONENT_RESULT_SUCCESS} get windowX success. + {@link OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER} component is NULL, windowX is NULL\n + or native XComponent is NULL. + @since 12 + @version 1.0*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] + pub fn OH_NativeXComponent_GetTouchPointWindowX( + component: *mut OH_NativeXComponent, + pointIndex: u32, + windowX: *mut f32, + ) -> i32; + /** @brief Obtains the y coordinate of a specific touch point relative to the upper left corner of\n + the current application window from the ArkUI XComponent. + + @param component Indicates the pointer to this OH_NativeXComponent instance. + @param pointIndex Indicates the pointer index in the touchPoints. + @param windowY Indicates the y coordinate relative to the upper left corner of the current\n + application window. + @return Returns the status code of the execution. + {@link OH_NATIVEXCOMPONENT_RESULT_SUCCESS} get windowY success. + {@link OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER} component is NULL, windowY is NULL\n + or native XComponent is NULL. + @since 12 + @version 1.0*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] + pub fn OH_NativeXComponent_GetTouchPointWindowY( + component: *mut OH_NativeXComponent, + pointIndex: u32, + windowY: *mut f32, + ) -> i32; + /** @brief Obtains the x coordinate of a specific touch point relative to the upper left corner of\n + the current screen from the ArkUI XComponent. + + @param component Indicates the pointer to this OH_NativeXComponent instance. + @param pointIndex Indicates the pointer index in the touchPoints. + @param displayX Indicates the x coordinate relative to the upper left corner of the current\n + screen. + @return Returns the status code of the execution. + {@link OH_NATIVEXCOMPONENT_RESULT_SUCCESS} get displayX success. + {@link OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER} component is NULL, displayX is NULL\n + or native XComponent is NULL. + @since 12 + @version 1.0*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] + pub fn OH_NativeXComponent_GetTouchPointDisplayX( + component: *mut OH_NativeXComponent, + pointIndex: u32, + displayX: *mut f32, + ) -> i32; + /** @brief Obtains the y coordinate of a specific touch point relative to the upper left corner of\n + the current screen from the ArkUI XComponent. + + @param component Indicates the pointer to this OH_NativeXComponent instance. + @param pointIndex Indicates the pointer index in the touchPoints. + @param displayY Indicates the y coordinate relative to the upper left corner of the current\n + screen. + @return Returns the status code of the execution. + {@link OH_NATIVEXCOMPONENT_RESULT_SUCCESS} get displayY success. + {@link OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER} component is NULL, displayY is NULL\n + or native XComponent is NULL. + @since 12 + @version 1.0*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] + pub fn OH_NativeXComponent_GetTouchPointDisplayY( + component: *mut OH_NativeXComponent, + pointIndex: u32, + displayY: *mut f32, + ) -> i32; /** @brief Obtains the touch event dispatched by the ArkUI XComponent. @param component Indicates the pointer to this OH_NativeXComponent instance. @@ -1702,6 +1771,8 @@ extern "C" { @return Returns the status code of the execution. @since 11 @version 1.0*/ + #[cfg(feature = "api-11")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] pub fn OH_NativeXComponent_SetExpectedFrameRateRange( component: *mut OH_NativeXComponent, range: *mut OH_NativeXComponent_ExpectedRateRange, @@ -1713,6 +1784,8 @@ extern "C" { @return Returns the status code of the execution. @since 11 @version 1.0*/ + #[cfg(feature = "api-11")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] pub fn OH_NativeXComponent_RegisterOnFrameCallback( component: *mut OH_NativeXComponent, callback: ::core::option::Option< @@ -1729,7 +1802,75 @@ extern "C" { @return Returns the status code of the execution. @since 11 @version 1.0*/ + #[cfg(feature = "api-11")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] pub fn OH_NativeXComponent_UnregisterOnFrameCallback( component: *mut OH_NativeXComponent, ) -> i32; + /** @brief Registers a callback for this OH_NativeXComponent instance. + + @param component Indicates the pointer to this OH_NativeXComponent instance. + @param callback Indicates the pointer to a surface show event callback. + @return Returns the status code of the execution. + @since 12 + @version 1.0*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] + pub fn OH_NativeXComponent_RegisterSurfaceShowCallback( + component: *mut OH_NativeXComponent, + callback: ::core::option::Option< + unsafe extern "C" fn( + component: *mut OH_NativeXComponent, + window: *mut ::core::ffi::c_void, + ), + >, + ) -> i32; + /** @brief Registers a callback for this OH_NativeXComponent instance. + + @param component Indicates the pointer to this OH_NativeXComponent instance. + @param callback Indicates the pointer to a surface hide event callback. + @return Returns the status code of the execution. + @since 12 + @version 1.0*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] + pub fn OH_NativeXComponent_RegisterSurfaceHideCallback( + component: *mut OH_NativeXComponent, + callback: ::core::option::Option< + unsafe extern "C" fn( + component: *mut OH_NativeXComponent, + window: *mut ::core::ffi::c_void, + ), + >, + ) -> i32; + /** @brief Set whether the OH_NativeXComponent instance needs soft keyboard. + @param component Indicates the pointer to this OH_NativeXComponent instance. + @param needSoftKeyboard Indicates whether the OH_NativeXComponent instance needs soft keyboard or not. + Default value is false. + @return Returns the status code of the execution. + @since 12 + @version 1.0*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] + pub fn OH_NativeXComponent_SetNeedSoftKeyboard( + component: *mut OH_NativeXComponent, + needSoftKeyboard: bool, + ) -> i32; + /** @brief Obtains the touch event's source type dispatched by the ArkUI XComponent. + + @param component Indicates the pointer to this OH_NativeXComponent instance. + @param pointId Indicates the id of the touch point which triggers this touch event. + @param sourceType Indicates the source type of this touch event. + @return Returns OH_NATIVEXCOMPONENT_RESULT_SUCCESS if success. + Returns OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER if a parameter exception occurs. + Returns OH_NATIVEXCOMPONENT_RESULT_FAILED if other exceptions occur. + @since 12 + @version 1.0*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] + pub fn OH_NativeXComponent_GetTouchEventSourceType( + component: *mut OH_NativeXComponent, + pointId: i32, + sourceType: *mut OH_NativeXComponent_EventSourceType, + ) -> i32; } diff --git a/components/xcomponent/src/xcomponent_result_ffi.rs b/components/xcomponent/src/xcomponent_result_ffi.rs new file mode 100644 index 0000000..4856c40 --- /dev/null +++ b/components/xcomponent/src/xcomponent_result_ffi.rs @@ -0,0 +1,18 @@ +/* automatically generated by rust-bindgen 0.71.1 */ + +#![allow(non_upper_case_globals)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +#![allow(unused)] + +/// Successful. +pub const OH_NATIVEXCOMPONENT_RESULT_SUCCESS: _bindgen_ty_11 = 0; +/// Failed. +pub const OH_NATIVEXCOMPONENT_RESULT_FAILED: _bindgen_ty_11 = -1; +/// Invalid parameters. +pub const OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER: _bindgen_ty_11 = -2; +/** @brief Enumerates the API access states. + +@since 8 +@version 1.0*/ +pub type _bindgen_ty_11 = ::core::ffi::c_int; diff --git a/scripts/generator/Cargo.lock b/scripts/generator/Cargo.lock index 127b4f7..f9abaa0 100644 --- a/scripts/generator/Cargo.lock +++ b/scripts/generator/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "aho-corasick" @@ -19,9 +19,8 @@ checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775" [[package]] name = "bindgen" -version = "0.70.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" +version = "0.71.1" +source = "git+https://github.com/openharmony-rs/rust-bindgen.git?branch=jschwender%2Fdoc_cfg#4ebdbe9728ec5e039c92997a7a598c30f0d370be" dependencies = [ "bitflags", "cexpr", @@ -69,6 +68,15 @@ dependencies = [ "libloading", ] +[[package]] +name = "doxygen-rs" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "415b6ec780d34dcf624666747194393603d0373b7141eef01d12ee58881507d9" +dependencies = [ + "phf", +] + [[package]] name = "either" version = "1.13.0" @@ -82,6 +90,8 @@ dependencies = [ "anyhow", "bindgen", "clang-sys", + "doxygen-rs", + "thiserror", ] [[package]] @@ -143,6 +153,48 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "phf" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +dependencies = [ + "phf_macros", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +dependencies = [ + "phf_shared", + "rand", +] + +[[package]] +name = "phf_macros" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "phf_shared" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +dependencies = [ + "siphasher", +] + [[package]] name = "prettyplease" version = "0.2.25" @@ -171,6 +223,21 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" + [[package]] name = "regex" version = "1.11.1" @@ -202,9 +269,9 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "rustc-hash" -version = "1.1.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" [[package]] name = "shlex" @@ -212,6 +279,12 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + [[package]] name = "syn" version = "2.0.87" @@ -223,6 +296,26 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "thiserror" +version = "2.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f072643fd0190df67a8bab670c20ef5d8737177d6ac6b2e9a236cb096206b2cc" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b50fa271071aae2e6ee85f842e2e28ba8cd2c5fb67f11fcb1fd70b276f9e7d4" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "unicode-ident" version = "1.0.13" diff --git a/scripts/generator/Cargo.toml b/scripts/generator/Cargo.toml index 042a056..03d32c2 100644 --- a/scripts/generator/Cargo.toml +++ b/scripts/generator/Cargo.toml @@ -6,10 +6,13 @@ publish = false description = "Internal tool to generate the ohos-sys bindings" [dependencies] -bindgen = { version = "=0.70.1", features = ["prettyplease"] } +# We currently use a fork of bindgen with some features that haven't been upstreamed yet. +bindgen = { features = ["prettyplease"], git = "https://github.com/openharmony-rs/rust-bindgen.git", branch = "jschwender/doc_cfg" } anyhow = "1.0.93" # Keep this feature in sync with the clang version of the SDK. clang-sys = { version = "1.8.1", features = ["clang_15_0"] } +doxygen-rs = "0.4" +thiserror = "2.0.9" [profile.dev.package."*"] opt-level = 2 diff --git a/scripts/generator/src/main.rs b/scripts/generator/src/main.rs index 95f6dfd..1966293 100644 --- a/scripts/generator/src/main.rs +++ b/scripts/generator/src/main.rs @@ -1,7 +1,10 @@ use std::fs; +use std::num::ParseIntError; use anyhow::{anyhow, bail, Context}; -use bindgen::{EnumVariation, Formatter}; +use bindgen::{CodeGenAttributes, EnumVariation, Formatter}; use std::path::{Path, PathBuf}; +use std::str::FromStr; +use thiserror::Error; /// Parse the api version /// @@ -25,13 +28,126 @@ fn parse_api_version(sdk_native_dir: &Path) -> anyhow::Result { Ok(api_version) } +#[derive(Copy, Clone, PartialEq, Ord, PartialOrd, Eq)] +enum OpenHarmonyApiLevel { + Eight = 8, + Nine = 9, + Ten = 10, + Eleven = 11, + Twelve = 12, + Thirteen = 13, + Fourteen = 14, +} + +#[derive(Error, Debug)] +enum ApiLevelParseError { + #[error("Could not parse API level from interger: {0:?}")] + ParseIntError(#[from] ParseIntError), + #[error("Unknown API level {0}! Perhaps we need an update")] + UnknownApiVersion(u32), +} + +impl TryFrom<&str> for OpenHarmonyApiLevel { + type Error = ApiLevelParseError; + + fn try_from(api_level: &str) -> Result { + let num: u32 = api_level.parse()?; + let level = match num { + 8 => OpenHarmonyApiLevel::Eight, + 9 => OpenHarmonyApiLevel::Nine, + 10 => OpenHarmonyApiLevel::Ten, + 11 => OpenHarmonyApiLevel::Eleven, + 12 => OpenHarmonyApiLevel::Twelve, + 13 => OpenHarmonyApiLevel::Thirteen, + 14 => OpenHarmonyApiLevel::Fourteen, + other => { return Err(ApiLevelParseError::UnknownApiVersion(other)); } + }; + Ok(level) + } +} + +#[derive(Error, Debug)] +enum ParseDeprecatedError { + #[error("Could not parse API level: {0:?}")] + ApiLevelParseError(#[from] ApiLevelParseError), + #[error("Failed to find @deprecated in line: {0}")] + InvalidLine(String), +} + +#[derive(Debug)] +struct DoxygenCommentCb; + +fn parse_deprecated_since(line: &str) -> Result, ParseDeprecatedError> { + if line.trim() == "@deprecated" { + return Ok(None); + } + let (_, rhs) = line.split_once("@deprecated").ok_or_else(|| ParseDeprecatedError::InvalidLine(line.to_string()))?; + // Variant 1: `@deprecated(since = "XX")` + // Note: Regex parsing might be more readable, but we want to avoid pulling in more dependencies. + if let Some(api_level_str) = rhs.split_once("(since = \"") + .or_else(|| rhs.split_once("(since=\"")) + .map(|(_, rhs)| { rhs.split_once("\"").expect("String end delimiter not found").0 }) { + return Ok(Some(OpenHarmonyApiLevel::try_from(api_level_str)?)); + } + + if let Some((_, api_level_str)) = rhs.split_once("since ") { + Ok(Some(OpenHarmonyApiLevel::try_from(api_level_str.trim())?)) + } else { + Err(ParseDeprecatedError::InvalidLine(line.to_string())) + } +} + +impl bindgen::callbacks::ParseCallbacks for DoxygenCommentCb { + fn parse_comments_for_attributes(&self, comment: &str) -> Vec { + let mut attributes: Vec = vec![]; + let api_version = comment.lines() + .find_map(|line| line.split_once("@since")) + .map(|(_, since)| { + let api_level_str = since + .trim(); + let api_level: Result = + api_level_str.try_into() + .inspect_err(|err| eprintln!("Failed to parse OH API version: {:?}", err)); + api_level.expect("Failed to parse OH API version") + } + ); + if let Some(api_version) = api_version { + let cfg = format!("feature = \"api-{}\"", api_version as u32); + // Our Minimum api-level is 10, so we don't feature guard things <= API level 10. + if api_version > OpenHarmonyApiLevel::Ten { + attributes.push(CodeGenAttributes::Cfg(cfg)); + attributes.push(CodeGenAttributes::CfgAttr(format!("docsrs, doc(cfg(feature = \"api-{}\"))", api_version as u32))); + } + } + + if let Some(deprecated_line) = comment.lines().find(|line| line.contains("@deprecated")) { + let deprecated_since = parse_deprecated_since(deprecated_line).expect("Parse failed"); + let deprecated_opt = deprecated_since.map(|since | { + format!("since = \"{}\"", since as u32) + }); + // if let Some(since ) = deprecated_since { + // if since <= OpenHarmonyApiLevel::Ten { + // // We can't tell bindgen to not generate something directly, but we can add a + // // a `cfg` which will never be enabled. + // // Todo: This should be revisited once we support checking type, e.g. for + // // enum variants, we should not cfg them out. + // attributes.push(CodeGenAttributes::Cfg("ohos_sys_deprecated_removed".to_string())); + // } + // } + attributes.push(CodeGenAttributes::Deprecated(deprecated_opt)); + } + + attributes + } +} + fn base_bindgen_builder(sysroot_dir: &Path) -> anyhow::Result { let builder = bindgen::builder() .use_core() .layout_tests(false) .formatter(Formatter::Prettyplease) .merge_extern_blocks(true) - .rust_target(bindgen::RustTarget::Stable_1_77) + .rust_target(bindgen::RustTarget::from_str("1.78").expect("invalid rust target")) .blocklist_file(r".*stdint\.h") .blocklist_file(r".*stddef\.h") .blocklist_file(r".*stdarg\.h") @@ -44,6 +160,7 @@ fn base_bindgen_builder(sysroot_dir: &Path) -> anyhow::Result .raw_line("#![allow(non_upper_case_globals)]") .raw_line("#![allow(non_camel_case_types)]") .raw_line("#![allow(non_snake_case)]") + .parse_callbacks(Box::new(DoxygenCommentCb)) .clang_arg(format!("--sysroot={}", sysroot_dir.to_str().context("The OpenHarmony SDK directory must be encodable as utf-8")?) ) @@ -121,6 +238,7 @@ fn get_bindings_config(api_version: u32) -> Vec { is_global: false, }) .bitfield_enum("^HiTrace_Flag$") + .rustified_non_exhaustive_enum("HiTrace_Tracepoint_Type") .blocklist_var("LOG_DOMAIN") .clang_arg("-include") .clang_arg("stdbool.h") @@ -136,11 +254,45 @@ fn get_bindings_config(api_version: u32) -> Vec { is_global: false, }) .allowlist_file(r".*/xcomponent/native_.*xcomponent.*\.h") + .allowlist_recursively(false) .no_copy("^OH_NativeXComponent$") .no_copy("^OH_NativeXComponent_KeyEvent$") .no_debug("^OH_NativeXComponent$") .no_debug("^OH_NativeXComponent_KeyEvent$") - .blocklist_item("^ArkUI_") + .blocklist_item("ArkUI_.*") + // FIXME: this doesn't work - needs to be fixed in bindgen (anonymous enum variant) + .blocklist_item("OH_NATIVEXCOMPONENT_RESULT.*") + // Note: this needs to be updated semi-regularly .... + .blocklist_type("_bindgen_ty_11") + .blocklist_function("OH_NativeXComponent_.*NativeRootNode") + .blocklist_function("OH_NativeXComponent_RegisterUIInputEventCallback") + .blocklist_function("OH_NativeXComponent_RegisterOnTouchInterceptCallback") + .blocklist_function("OH_NativeXComponent_GetNativeXComponent") + .clang_args(&["-x", "c++"]) + }), + }, + BindingConf { + include_filename: "ace/xcomponent/native_interface_xcomponent.h".to_string(), + output_prefix: "components/xcomponent/src/xcomponent_result".to_string(), + set_builder_opts: Box::new(|builder| { + builder + .raw_line("#![allow(unused)]") + .allowlist_var("OH_NATIVEXCOMPONENT_RESULT_.*") + .clang_args(&["-x", "c++"]) + }), + }, + BindingConf { + include_filename: "ace/xcomponent/native_interface_xcomponent.h".to_string(), + output_prefix: "components/xcomponent/src/xcomponent_arkui".to_string(), + set_builder_opts: Box::new(|builder| { + builder + .raw_line("use super::xcomponent_ffi::*;") + .raw_line("use arkui_sys::native_type::ArkUI_NodeHandle;") + .raw_line("use arkui_sys::ui_input_event::{ArkUI_UIInputEvent, ArkUI_UIInputEvent_Type, HitTestMode};") + .allowlist_function("OH_NativeXComponent_.*NativeRootNode") + .allowlist_function("OH_NativeXComponent_RegisterUIInputEventCallback") + .allowlist_function("OH_NativeXComponent_RegisterOnTouchInterceptCallback") + .blocklist_type(".*") .clang_args(&["-x", "c++"]) }), }, @@ -156,11 +308,27 @@ fn get_bindings_config(api_version: u32) -> Vec { .allowlist_file(r".*/native_buffer/.*\.h") .bitfield_enum("OH_NativeBuffer_Usage") .blocklist_item("^(OH)?NativeWindow(Buffer)?") + .blocklist_function("OH_NativeBuffer_.*NativeWindow.*") .no_copy("^OH_NativeBuffer$") .no_copy("^OHIPCParcel$") .no_debug("^OH_NativeBuffer$") }), }, + BindingConf { + include_filename: "native_buffer/native_buffer.h".to_string(), + output_prefix: "src/native_buffer/native_buffer_window".to_string(), + set_builder_opts: Box::new(|builder| { + builder + .default_enum_style(EnumVariation::NewType { + is_bitfield: false, + is_global: false, + }) + .raw_line("use super::native_buffer_ffi::*;") + .raw_line("use crate::native_window::OHNativeWindowBuffer;") + .blocklist_type(".*") + .allowlist_function("OH_NativeBuffer_.*NativeWindow.*") + }), + }, BindingConf { include_filename: "native_image/native_image.h".to_string(), output_prefix: "src/native_image/native_image".to_string(), @@ -170,14 +338,31 @@ fn get_bindings_config(api_version: u32) -> Vec { is_bitfield: false, is_global: false, }) - .raw_line("use crate::native_window::OHNativeWindow;") .allowlist_file(r".*/native_image/.*\.h") .blocklist_item("^(OH)?NativeWindow(Buffer)?") + // Blocklist everything with native window, so we can feature guard it. + .blocklist_function("OH_NativeImage_.*NativeWindow.*") .no_copy("^OH_NativeImage$") .no_copy("^OH_OnFrameAvailableListener") .no_debug("^OH_NativeImage$") }), }, + BindingConf { + include_filename: "native_image/native_image.h".to_string(), + output_prefix: "src/native_image/native_image_window".to_string(), + set_builder_opts: Box::new(|builder| { + builder + .default_enum_style(EnumVariation::NewType { + is_bitfield: false, + is_global: false, + }) + .raw_line("use super::native_image_ffi::*;") + .raw_line("use crate::native_window::OHNativeWindow;") + .raw_line("use crate::native_window::OHNativeWindowBuffer;") + .allowlist_recursively(false) + .allowlist_function(".*NativeWindow.*") + }), + }, BindingConf { include_filename: "native_window/external_window.h".to_string(), output_prefix: "src/native_window/native_window".to_string(), @@ -187,7 +372,7 @@ fn get_bindings_config(api_version: u32) -> Vec { is_bitfield: false, is_global: false, }) - // todo: if API == 10, --blocklist-item=^NativeWindowOperation$ + .constified_enum_module("^NativeWindowOperation$") .derive_copy(false) }), }, @@ -209,6 +394,25 @@ fn get_bindings_config(api_version: u32) -> Vec { } }), }, + BindingConf { + include_filename: "arkui/ui_input_event.h".to_string(), + output_prefix: "components/arkui/src/ui_input_event/ui_input_event_anon_enums".to_string(), + set_builder_opts: Box::new(move |builder| { + builder + .default_enum_style(EnumVariation::NewType { + is_bitfield: false, + is_global: false, + }) + .allowlist_var("UI_TOUCH_EVENT_ACTION_.*") + .allowlist_var("UI_INPUT_EVENT_TOOL_TYPE_.*") + .allowlist_var("UI_INPUT_EVENT_SOURCE_TYPE_.*") + .allowlist_var("UI_MOUSE_EVENT_ACTION_.*") + .allowlist_var("UI_MOUSE_EVENT_BUTTON_*") + .allowlist_recursively(true) + .clang_args(["-include", "stdbool.h"]) + + }), + }, ] } @@ -404,7 +608,16 @@ fn get_module_bindings_config(api_version: u32) -> Vec { set_builder_opts: Box::new( |file_stem, header_path, builder| { let builder = if file_stem != "types" { - builder.raw_line("use crate::types::*;") + let builder = builder.raw_line("use crate::types::*;"); + if file_stem != "error_code" { + builder + .raw_line("") + .raw_line("#[allow(unused_imports)]") + .raw_line("#[cfg(feature = \"api-12\")]") + .raw_line("use crate::error_code::OH_Drawing_ErrorCode;") + } else { + builder + } } else { builder }; @@ -456,33 +669,45 @@ fn get_module_bindings_config(api_version: u32) -> Vec { } else { builder }; - let builder = match file_stem { + let builder = builder + .allowlist_file(format!("{}", header_path.to_str().unwrap())) + .allowlist_recursively(false) + .default_enum_style(EnumVariation::NewType { + is_bitfield: false, + is_global: false, + }) + .derive_copy(false) + .derive_debug(false) + .prepend_enum_name(false) + .clang_args(&["-x", "c++"]); + match file_stem { "drawable_descriptor" => { builder.blocklist_item("^OH_PixelmapNative$") }, "native_type" => { builder //.raw_line("use crate::drawable_descriptor::ArkUI_DrawableDescriptor;") .blocklist_function("^OH_ArkUI_ImageAnimatorFrameInfo_CreateFromDrawableDescriptor$") + // We want copy for the union type `ArkUI_NumberValue` + .derive_copy(true) + .no_copy("ArkUI_ContextCallback") + .no_copy("ARKUI_TextPickerRangeContent") + .no_copy("ARKUI_TextPickerCascadeRangeContent") + .no_copy("ArkUI_ColorStop") }, "native_gesture" => { builder .raw_line("use crate::ui_input_event::ArkUI_UIInputEvent;") .blocklist_function("^OH_ArkUI_GestureEvent_GetNode") - } + }, + "ui_input_event" => { + builder + .blocklist_var("^UI_TOUCH_EVENT_ACTION_*") + .bitfield_enum("ArkUI_ModifierKeyName") + + }, _ => builder, - }; - builder - .allowlist_file(format!("{}", header_path.to_str().unwrap())) - .allowlist_recursively(false) - .default_enum_style(EnumVariation::NewType { - is_bitfield: false, - is_global: false, - }) - .derive_copy(false) - .derive_debug(false) - .prepend_enum_name(false) - .clang_args(&["-x", "c++"]) + } } ), }, @@ -507,13 +732,12 @@ fn generate_bindings(sdk_native_dir: &Path, api_version: u32) -> anyhow::Result< let header_filename_str = header_filename.to_str().context("Unicode")?; let builder = base_builder .clone() - .header(header_filename_str) - .allowlist_file(header_filename_str); + .header(header_filename_str); let builder = (binding.set_builder_opts)(builder); let bindings = builder.generate().context("Bindgen failed")?; bindings - .write_to_file(root_dir.join(format!("{}_api{api_version}.rs", binding.output_prefix))) + .write_to_file(root_dir.join(format!("{}_ffi.rs", binding.output_prefix))) .context("Failed to write bindings to file")?; } @@ -550,22 +774,8 @@ fn generate_bindings(sdk_native_dir: &Path, api_version: u32) -> anyhow::Result< fs::create_dir_all(&base_path).context("Failed to create target directory for bindings")?; } - // We want to commit all generated files to version control, so we can easily see if something changed, - // when updating bindgen or the SDK patch release. - // However, we any split changes into incremental modules, and don't use any of the newer versions of the API - // besides the first one. If a binding was not introduced in the current api version, then we add a nopublish - // suffix, so we can exclude the file from cargo publish and save some download bandwidth. - let previous_version_stem = format!("{file_stem}_api{}", api_version - 1); - let no_publish_suffix = if - base_path.join(format!("{previous_version_stem}.rs")).is_file() - || base_path.join(format!("{previous_version_stem}_nopublish.rs")).is_file() { - println!("Found older API file for {}", base_path.display()); - "_nopublish" - } else { - "" - }; bindings - .write_to_file(base_path.join(format!("{file_stem}_api{api_version}{no_publish_suffix}.rs"))) + .write_to_file(base_path.join(format!("{file_stem}_ffi.rs"))) .context("Failed to write bindings to file")?; } } diff --git a/src/native_buffer.rs b/src/native_buffer.rs index 38c3253..449bc46 100644 --- a/src/native_buffer.rs +++ b/src/native_buffer.rs @@ -14,21 +14,12 @@ #[link(name = "native_buffer")] extern "C" {} -mod native_buffer_api10; -pub use native_buffer_api10::*; +mod native_buffer_ffi; +pub use native_buffer_ffi::*; -#[cfg(feature = "api-11")] -#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] -mod api11_additions; - -#[cfg(feature = "api-11")] -#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] -pub use api11_additions::*; - -#[cfg(feature = "api-12")] -#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] -mod api12_additions; - -#[cfg(feature = "api-12")] -#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] -pub use api12_additions::*; +#[cfg(feature = "native_window")] +#[cfg_attr(docsrs, doc(cfg(feature = "native_window")))] +mod native_buffer_window_ffi; +#[cfg(feature = "native_window")] +#[cfg_attr(docsrs, doc(cfg(feature = "native_window")))] +pub use native_buffer_window_ffi::*; diff --git a/src/native_buffer/api11_additions.rs b/src/native_buffer/api11_additions.rs deleted file mode 100644 index 68efe5e..0000000 --- a/src/native_buffer/api11_additions.rs +++ /dev/null @@ -1,180 +0,0 @@ -#![allow(non_upper_case_globals)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] - -use super::OH_NativeBuffer; - -impl OH_NativeBuffer_ColorSpace { - /// None color space - pub const OH_COLORSPACE_NONE: OH_NativeBuffer_ColorSpace = OH_NativeBuffer_ColorSpace(0); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_BT601_P | (TRANSFUNC_BT709 << 8) | (MATRIX_BT601_P << 16) | (RANGE_FULL << 21) - pub const OH_COLORSPACE_BT601_EBU_FULL: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(1); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_BT601_N | (TRANSFUNC_BT709 << 8) | (MATRIX_BT601_N << 16) | (RANGE_FULL << 21) - pub const OH_COLORSPACE_BT601_SMPTE_C_FULL: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(2); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_BT709 | (TRANSFUNC_BT709 << 8) | (MATRIX_BT709 << 16) | (RANGE_FULL << 21) - pub const OH_COLORSPACE_BT709_FULL: OH_NativeBuffer_ColorSpace = OH_NativeBuffer_ColorSpace(3); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_BT2020 | (TRANSFUNC_HLG << 8) | (MATRIX_BT2020 << 16) | (RANGE_FULL << 21) - pub const OH_COLORSPACE_BT2020_HLG_FULL: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(4); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_BT2020 | (TRANSFUNC_PQ << 8) | (MATRIX_BT2020 << 16) | (RANGE_FULL << 21) - pub const OH_COLORSPACE_BT2020_PQ_FULL: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(5); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_BT601_P | (TRANSFUNC_BT709 << 8) | (MATRIX_BT601_P << 16) | (RANGE_LIMITED << 21) - pub const OH_COLORSPACE_BT601_EBU_LIMIT: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(6); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_BT601_N | (TRANSFUNC_BT709 << 8) | (MATRIX_BT601_N << 16) | (RANGE_LIMITED << 21) - pub const OH_COLORSPACE_BT601_SMPTE_C_LIMIT: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(7); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_BT709 | (TRANSFUNC_BT709 << 8) | (MATRIX_BT709 << 16) | (RANGE_LIMITED << 21) - pub const OH_COLORSPACE_BT709_LIMIT: OH_NativeBuffer_ColorSpace = OH_NativeBuffer_ColorSpace(8); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_BT2020 | (TRANSFUNC_HLG << 8) | (MATRIX_BT2020 << 16) | (RANGE_LIMITED << 21) - pub const OH_COLORSPACE_BT2020_HLG_LIMIT: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(9); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_BT2020 | (TRANSFUNC_PQ << 8) | (MATRIX_BT2020 << 16) | (RANGE_LIMITED << 21) - pub const OH_COLORSPACE_BT2020_PQ_LIMIT: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(10); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_SRGB | (TRANSFUNC_SRGB << 8) | (MATRIX_BT601_N << 16) | (RANGE_FULL << 21) - pub const OH_COLORSPACE_SRGB_FULL: OH_NativeBuffer_ColorSpace = OH_NativeBuffer_ColorSpace(11); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_P3_D65 | (TRANSFUNC_SRGB << 8) | (MATRIX_P3 << 16) | (RANGE_FULL << 21) - pub const OH_COLORSPACE_P3_FULL: OH_NativeBuffer_ColorSpace = OH_NativeBuffer_ColorSpace(12); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_P3_D65 | (TRANSFUNC_HLG << 8) | (MATRIX_P3 << 16) | (RANGE_FULL << 21) - pub const OH_COLORSPACE_P3_HLG_FULL: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(13); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_P3_D65 | (TRANSFUNC_PQ << 8) | (MATRIX_P3 << 16) | (RANGE_FULL << 21) - pub const OH_COLORSPACE_P3_PQ_FULL: OH_NativeBuffer_ColorSpace = OH_NativeBuffer_ColorSpace(14); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_ADOBERGB | (TRANSFUNC_ADOBERGB << 8) | (MATRIX_ADOBERGB << 16) | (RANGE_FULL << 21) - pub const OH_COLORSPACE_ADOBERGB_FULL: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(15); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_SRGB | (TRANSFUNC_SRGB << 8) | (MATRIX_BT601_N << 16) | (RANGE_LIMITED << 21) - pub const OH_COLORSPACE_SRGB_LIMIT: OH_NativeBuffer_ColorSpace = OH_NativeBuffer_ColorSpace(16); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_P3_D65 | (TRANSFUNC_SRGB << 8) | (MATRIX_P3 << 16) | (RANGE_LIMITED << 21) - pub const OH_COLORSPACE_P3_LIMIT: OH_NativeBuffer_ColorSpace = OH_NativeBuffer_ColorSpace(17); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_P3_D65 | (TRANSFUNC_HLG << 8) | (MATRIX_P3 << 16) | (RANGE_LIMITED << 21) - pub const OH_COLORSPACE_P3_HLG_LIMIT: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(18); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_P3_D65 | (TRANSFUNC_PQ << 8) | (MATRIX_P3 << 16) | (RANGE_LIMITED << 21) - pub const OH_COLORSPACE_P3_PQ_LIMIT: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(19); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_ADOBERGB | (TRANSFUNC_ADOBERGB << 8) | (MATRIX_ADOBERGB << 16) | (RANGE_LIMITED << 21) - pub const OH_COLORSPACE_ADOBERGB_LIMIT: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(20); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_SRGB | (TRANSFUNC_LINEAR << 8) - pub const OH_COLORSPACE_LINEAR_SRGB: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(21); -} -impl OH_NativeBuffer_ColorSpace { - /// equal to OH_COLORSPACE_LINEAR_SRGB - pub const OH_COLORSPACE_LINEAR_BT709: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(22); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_P3_D65 | (TRANSFUNC_LINEAR << 8) - pub const OH_COLORSPACE_LINEAR_P3: OH_NativeBuffer_ColorSpace = OH_NativeBuffer_ColorSpace(23); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_BT2020 | (TRANSFUNC_LINEAR << 8) - pub const OH_COLORSPACE_LINEAR_BT2020: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(24); -} -impl OH_NativeBuffer_ColorSpace { - /// equal to OH_COLORSPACE_SRGB_FULL - pub const OH_COLORSPACE_DISPLAY_SRGB: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(25); -} -impl OH_NativeBuffer_ColorSpace { - /// equal to OH_COLORSPACE_P3_FULL - pub const OH_COLORSPACE_DISPLAY_P3_SRGB: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(26); -} -impl OH_NativeBuffer_ColorSpace { - /// equal to OH_COLORSPACE_P3_HLG_FULL - pub const OH_COLORSPACE_DISPLAY_P3_HLG: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(27); -} -impl OH_NativeBuffer_ColorSpace { - /// equal to OH_COLORSPACE_P3_PQ_FULL - pub const OH_COLORSPACE_DISPLAY_P3_PQ: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(28); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_BT2020 | (TRANSFUNC_SRGB << 8) | (MATRIX_BT2020 << 16) | (RANGE_FULL << 21) - pub const OH_COLORSPACE_DISPLAY_BT2020_SRGB: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(29); -} -impl OH_NativeBuffer_ColorSpace { - /// equal to OH_COLORSPACE_BT2020_HLG_FULL - pub const OH_COLORSPACE_DISPLAY_BT2020_HLG: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(30); -} -impl OH_NativeBuffer_ColorSpace { - /// equal to OH_COLORSPACE_BT2020_PQ_FULL - pub const OH_COLORSPACE_DISPLAY_BT2020_PQ: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(31); -} -#[repr(transparent)] -/** @brief Indicates the color space of a native buffer. - -@syscap SystemCapability.Graphic.Graphic2D.NativeBuffer -@since 11 -@version 1.0*/ -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct OH_NativeBuffer_ColorSpace(pub ::core::ffi::c_uint); - -extern "C" { - /** @brief Set the color space of the OH_NativeBuffer. - - @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer - @param buffer Indicates the pointer to a OH_NativeBuffer instance. - @param colorSpace Indicates the color space of native buffer, see OH_NativeBuffer_ColorSpace. - @return Returns an error code, 0 is success, otherwise, failed. - @since 11 - @version 1.0*/ - pub fn OH_NativeBuffer_SetColorSpace( - buffer: *mut OH_NativeBuffer, - colorSpace: OH_NativeBuffer_ColorSpace, - ) -> i32; -} diff --git a/src/native_buffer/api12_additions.rs b/src/native_buffer/api12_additions.rs deleted file mode 100644 index 1702b5c..0000000 --- a/src/native_buffer/api12_additions.rs +++ /dev/null @@ -1,444 +0,0 @@ -#![allow(non_upper_case_globals)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] - -use crate::native_buffer::{ - OH_NativeBuffer, OH_NativeBuffer_ColorSpace, OH_NativeBuffer_Format, OH_NativeBuffer_Usage, -}; -use crate::native_window::OHNativeWindowBuffer; - -impl OH_NativeBuffer_MetadataType { - pub const OH_VIDEO_HDR_HLG: OH_NativeBuffer_MetadataType = OH_NativeBuffer_MetadataType(0); -} -impl OH_NativeBuffer_MetadataType { - pub const OH_VIDEO_HDR_HDR10: OH_NativeBuffer_MetadataType = OH_NativeBuffer_MetadataType(1); -} -impl OH_NativeBuffer_MetadataType { - pub const OH_VIDEO_HDR_VIVID: OH_NativeBuffer_MetadataType = OH_NativeBuffer_MetadataType(2); -} -#[repr(transparent)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct OH_NativeBuffer_MetadataType(pub ::core::ffi::c_uint); -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct OH_NativeBuffer_ColorXY { - pub x: f32, - pub y: f32, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct OH_NativeBuffer_Smpte2086 { - pub displayPrimaryRed: OH_NativeBuffer_ColorXY, - pub displayPrimaryGreen: OH_NativeBuffer_ColorXY, - pub displayPrimaryBlue: OH_NativeBuffer_ColorXY, - pub whitePoint: OH_NativeBuffer_ColorXY, - pub maxLuminance: f32, - pub minLuminance: f32, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct OH_NativeBuffer_Cta861 { - pub maxContentLightLevel: f32, - pub maxFrameAverageLightLevel: f32, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct OH_NativeBuffer_StaticMetadata { - pub smpte2086: OH_NativeBuffer_Smpte2086, - pub cta861: OH_NativeBuffer_Cta861, -} -impl OH_NativeBuffer_MetadataKey { - pub const OH_HDR_METADATA_TYPE: OH_NativeBuffer_MetadataKey = OH_NativeBuffer_MetadataKey(0); -} -impl OH_NativeBuffer_MetadataKey { - pub const OH_HDR_STATIC_METADATA: OH_NativeBuffer_MetadataKey = OH_NativeBuffer_MetadataKey(1); -} -impl OH_NativeBuffer_MetadataKey { - pub const OH_HDR_DYNAMIC_METADATA: OH_NativeBuffer_MetadataKey = OH_NativeBuffer_MetadataKey(2); -} -#[repr(transparent)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct OH_NativeBuffer_MetadataKey(pub ::core::ffi::c_uint); - -impl OH_NativeBuffer_Usage { - /// < Direct memory access (DMA) buffer */ - pub const NATIVEBUFFER_USAGE_HW_RENDER: OH_NativeBuffer_Usage = OH_NativeBuffer_Usage(256); -} -impl OH_NativeBuffer_Usage { - /// < For GPU write case */ - pub const NATIVEBUFFER_USAGE_HW_TEXTURE: OH_NativeBuffer_Usage = OH_NativeBuffer_Usage(512); -} -impl OH_NativeBuffer_Usage { - /// < For GPU read case */ - pub const NATIVEBUFFER_USAGE_CPU_READ_OFTEN: OH_NativeBuffer_Usage = - OH_NativeBuffer_Usage(65536); -} -impl OH_NativeBuffer_Usage { - /// < Often be mapped for direct CPU reads */ - pub const NATIVEBUFFER_USAGE_ALIGNMENT_512: OH_NativeBuffer_Usage = - OH_NativeBuffer_Usage(262144); -} - -impl OH_NativeBuffer_Format { - /** CLUT8 format - @since 12*/ - pub const NATIVEBUFFER_PIXEL_FMT_CLUT8: OH_NativeBuffer_Format = OH_NativeBuffer_Format(0); -} -impl OH_NativeBuffer_Format { - /** CLUT1 format - @since 12*/ - pub const NATIVEBUFFER_PIXEL_FMT_CLUT1: OH_NativeBuffer_Format = OH_NativeBuffer_Format(1); -} -impl OH_NativeBuffer_Format { - /** CLUT4 format - @since 12*/ - pub const NATIVEBUFFER_PIXEL_FMT_CLUT4: OH_NativeBuffer_Format = OH_NativeBuffer_Format(2); -} - -impl OH_NativeBuffer_Format { - #[doc = " < BGRA8888 format */\n**\n* YUV422 interleaved format\n* @since 12\n*/"] - pub const NATIVEBUFFER_PIXEL_FMT_YUV_422_I: OH_NativeBuffer_Format = OH_NativeBuffer_Format(21); -} -impl OH_NativeBuffer_Format { - /** YCBCR422 semi-plannar format - @since 12*/ - pub const NATIVEBUFFER_PIXEL_FMT_YCBCR_422_SP: OH_NativeBuffer_Format = - OH_NativeBuffer_Format(22); -} -impl OH_NativeBuffer_Format { - /** YCRCB422 semi-plannar format - @since 12*/ - pub const NATIVEBUFFER_PIXEL_FMT_YCRCB_422_SP: OH_NativeBuffer_Format = - OH_NativeBuffer_Format(23); -} -impl OH_NativeBuffer_Format { - /** YCBCR420 semi-plannar format - @since 12*/ - pub const NATIVEBUFFER_PIXEL_FMT_YCBCR_420_SP: OH_NativeBuffer_Format = - OH_NativeBuffer_Format(24); -} -impl OH_NativeBuffer_Format { - /** YCRCB420 semi-plannar format - @since 12*/ - pub const NATIVEBUFFER_PIXEL_FMT_YCRCB_420_SP: OH_NativeBuffer_Format = - OH_NativeBuffer_Format(25); -} -impl OH_NativeBuffer_Format { - /** YCBCR422 plannar format - @since 12*/ - pub const NATIVEBUFFER_PIXEL_FMT_YCBCR_422_P: OH_NativeBuffer_Format = - OH_NativeBuffer_Format(26); -} -impl OH_NativeBuffer_Format { - /** YCRCB422 plannar format - @since 12*/ - pub const NATIVEBUFFER_PIXEL_FMT_YCRCB_422_P: OH_NativeBuffer_Format = - OH_NativeBuffer_Format(27); -} -impl OH_NativeBuffer_Format { - /** YCBCR420 plannar format - @since 12*/ - pub const NATIVEBUFFER_PIXEL_FMT_YCBCR_420_P: OH_NativeBuffer_Format = - OH_NativeBuffer_Format(28); -} -impl OH_NativeBuffer_Format { - /** YCRCB420 plannar format - @since 12*/ - pub const NATIVEBUFFER_PIXEL_FMT_YCRCB_420_P: OH_NativeBuffer_Format = - OH_NativeBuffer_Format(29); -} -impl OH_NativeBuffer_Format { - /** YUYV422 packed format - @since 12*/ - pub const NATIVEBUFFER_PIXEL_FMT_YUYV_422_PKG: OH_NativeBuffer_Format = - OH_NativeBuffer_Format(30); -} -impl OH_NativeBuffer_Format { - /** UYVY422 packed format - @since 12*/ - pub const NATIVEBUFFER_PIXEL_FMT_UYVY_422_PKG: OH_NativeBuffer_Format = - OH_NativeBuffer_Format(31); -} -impl OH_NativeBuffer_Format { - /** YVYU422 packed format - @since 12*/ - pub const NATIVEBUFFER_PIXEL_FMT_YVYU_422_PKG: OH_NativeBuffer_Format = - OH_NativeBuffer_Format(32); -} -impl OH_NativeBuffer_Format { - /** VYUY422 packed format - @since 12*/ - pub const NATIVEBUFFER_PIXEL_FMT_VYUY_422_PKG: OH_NativeBuffer_Format = - OH_NativeBuffer_Format(33); -} -impl OH_NativeBuffer_Format { - /** RGBA_1010102 packed format - @since 12*/ - pub const NATIVEBUFFER_PIXEL_FMT_RGBA_1010102: OH_NativeBuffer_Format = - OH_NativeBuffer_Format(34); -} -impl OH_NativeBuffer_Format { - /** YCBCR420 semi-planar 10bit packed format - @since 12*/ - pub const NATIVEBUFFER_PIXEL_FMT_YCBCR_P010: OH_NativeBuffer_Format = - OH_NativeBuffer_Format(35); -} -impl OH_NativeBuffer_Format { - /** YCRCB420 semi-planar 10bit packed format - @since 12*/ - pub const NATIVEBUFFER_PIXEL_FMT_YCRCB_P010: OH_NativeBuffer_Format = - OH_NativeBuffer_Format(36); -} -impl OH_NativeBuffer_Format { - /** Raw 10bit packed format - @since 12*/ - pub const NATIVEBUFFER_PIXEL_FMT_RAW10: OH_NativeBuffer_Format = OH_NativeBuffer_Format(37); -} -impl OH_NativeBuffer_Format { - /** vender mask format - @since 12*/ - pub const NATIVEBUFFER_PIXEL_FMT_VENDER_MASK: OH_NativeBuffer_Format = - OH_NativeBuffer_Format(2147418112); -} - -impl OH_NativeBuffer_TransformType { - ///< No rotation - pub const NATIVEBUFFER_ROTATE_NONE: OH_NativeBuffer_TransformType = - OH_NativeBuffer_TransformType(0); -} -impl OH_NativeBuffer_TransformType { - ///< Rotation by 90 degrees - pub const NATIVEBUFFER_ROTATE_90: OH_NativeBuffer_TransformType = - OH_NativeBuffer_TransformType(1); -} -impl OH_NativeBuffer_TransformType { - ///< Rotation by 180 degrees - pub const NATIVEBUFFER_ROTATE_180: OH_NativeBuffer_TransformType = - OH_NativeBuffer_TransformType(2); -} -impl OH_NativeBuffer_TransformType { - ///< Rotation by 270 degrees - pub const NATIVEBUFFER_ROTATE_270: OH_NativeBuffer_TransformType = - OH_NativeBuffer_TransformType(3); -} -impl OH_NativeBuffer_TransformType { - ///< Flip horizontally - pub const NATIVEBUFFER_FLIP_H: OH_NativeBuffer_TransformType = OH_NativeBuffer_TransformType(4); -} -impl OH_NativeBuffer_TransformType { - ///< Flip vertically - pub const NATIVEBUFFER_FLIP_V: OH_NativeBuffer_TransformType = OH_NativeBuffer_TransformType(5); -} -impl OH_NativeBuffer_TransformType { - ///< Flip horizontally and rotate 90 degrees - pub const NATIVEBUFFER_FLIP_H_ROT90: OH_NativeBuffer_TransformType = - OH_NativeBuffer_TransformType(6); -} -impl OH_NativeBuffer_TransformType { - ///< Flip vertically and rotate 90 degrees - pub const NATIVEBUFFER_FLIP_V_ROT90: OH_NativeBuffer_TransformType = - OH_NativeBuffer_TransformType(7); -} -impl OH_NativeBuffer_TransformType { - ///< Flip horizontally and rotate 180 degrees - pub const NATIVEBUFFER_FLIP_H_ROT180: OH_NativeBuffer_TransformType = - OH_NativeBuffer_TransformType(8); -} -impl OH_NativeBuffer_TransformType { - ///< Flip vertically and rotate 180 degrees - pub const NATIVEBUFFER_FLIP_V_ROT180: OH_NativeBuffer_TransformType = - OH_NativeBuffer_TransformType(9); -} -impl OH_NativeBuffer_TransformType { - ///< Flip horizontally and rotate 270 degrees - pub const NATIVEBUFFER_FLIP_H_ROT270: OH_NativeBuffer_TransformType = - OH_NativeBuffer_TransformType(10); -} -impl OH_NativeBuffer_TransformType { - ///< Flip vertically and rotate 270 degrees - pub const NATIVEBUFFER_FLIP_V_ROT270: OH_NativeBuffer_TransformType = - OH_NativeBuffer_TransformType(11); -} -#[repr(transparent)] -/** @brief Indicates the transform type of a native buffer. - -@syscap SystemCapability.Graphic.Graphic2D.NativeBuffer -@since 12 -@version 1.0*/ -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct OH_NativeBuffer_TransformType(pub ::core::ffi::c_uint); - -impl OH_NativeBuffer_ColorGamut { - ///< Native or default - pub const NATIVEBUFFER_COLOR_GAMUT_NATIVE: OH_NativeBuffer_ColorGamut = - OH_NativeBuffer_ColorGamut(0); -} -impl OH_NativeBuffer_ColorGamut { - ///< Standard BT601 - pub const NATIVEBUFFER_COLOR_GAMUT_STANDARD_BT601: OH_NativeBuffer_ColorGamut = - OH_NativeBuffer_ColorGamut(1); -} -impl OH_NativeBuffer_ColorGamut { - ///< Standard BT709 - pub const NATIVEBUFFER_COLOR_GAMUT_STANDARD_BT709: OH_NativeBuffer_ColorGamut = - OH_NativeBuffer_ColorGamut(2); -} -impl OH_NativeBuffer_ColorGamut { - ///< DCI P3 - pub const NATIVEBUFFER_COLOR_GAMUT_DCI_P3: OH_NativeBuffer_ColorGamut = - OH_NativeBuffer_ColorGamut(3); -} -impl OH_NativeBuffer_ColorGamut { - ///< SRGB - pub const NATIVEBUFFER_COLOR_GAMUT_SRGB: OH_NativeBuffer_ColorGamut = - OH_NativeBuffer_ColorGamut(4); -} -impl OH_NativeBuffer_ColorGamut { - ///< Adobe RGB - pub const NATIVEBUFFER_COLOR_GAMUT_ADOBE_RGB: OH_NativeBuffer_ColorGamut = - OH_NativeBuffer_ColorGamut(5); -} -impl OH_NativeBuffer_ColorGamut { - ///< Display P3 - pub const NATIVEBUFFER_COLOR_GAMUT_DISPLAY_P3: OH_NativeBuffer_ColorGamut = - OH_NativeBuffer_ColorGamut(6); -} -impl OH_NativeBuffer_ColorGamut { - ///< BT2020 - pub const NATIVEBUFFER_COLOR_GAMUT_BT2020: OH_NativeBuffer_ColorGamut = - OH_NativeBuffer_ColorGamut(7); -} -impl OH_NativeBuffer_ColorGamut { - ///< BT2100 PQ - pub const NATIVEBUFFER_COLOR_GAMUT_BT2100_PQ: OH_NativeBuffer_ColorGamut = - OH_NativeBuffer_ColorGamut(8); -} -impl OH_NativeBuffer_ColorGamut { - ///< BT2100 HLG - pub const NATIVEBUFFER_COLOR_GAMUT_BT2100_HLG: OH_NativeBuffer_ColorGamut = - OH_NativeBuffer_ColorGamut(9); -} -impl OH_NativeBuffer_ColorGamut { - ///< Display BT2020 - pub const NATIVEBUFFER_COLOR_GAMUT_DISPLAY_BT2020: OH_NativeBuffer_ColorGamut = - OH_NativeBuffer_ColorGamut(10); -} -#[repr(transparent)] -/** @brief Indicates the color gamut of a native buffer. - -@syscap SystemCapability.Graphic.Graphic2D.NativeBuffer -@since 12 -@version 1.0*/ -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct OH_NativeBuffer_ColorGamut(pub ::core::ffi::c_uint); - -/** @brief Holds info for a single image plane. \n - -@syscap SystemCapability.Graphic.Graphic2D.NativeBuffer -@since 12 -@version 1.0*/ -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct OH_NativeBuffer_Plane { - ///< Offset in bytes of plane. - pub offset: u64, - ///< Distance in bytes from the first value of one row of the image to the first value of the next row. - pub rowStride: u32, - ///< Distance in bytes from the first value of one column of the image to the first value of the next column. - pub columnStride: u32, -} -/** @brief Holds all image planes. \n - -@syscap SystemCapability.Graphic.Graphic2D.NativeBuffer -@since 12 -@version 1.0*/ -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct OH_NativeBuffer_Planes { - ///< Number of distinct planes. - pub planeCount: u32, - ///< Array of image planes. - pub planes: [OH_NativeBuffer_Plane; 4usize], -} - -extern "C" { - /** @brief Provide direct cpu access to the potentially multi-plannar OH_NativeBuffer in the process's address space. - - @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer - @param buffer Indicates the pointer to a OH_NativeBuffer instance. - @param virAddr Indicates the address of the OH_NativeBuffer in virtual memory. - @param outPlanes Indicates all image planes that contain the pixel data. - @return Returns an error code, 0 is sucess, otherwise, failed. - @since 12 - @version 1.0*/ - pub fn OH_NativeBuffer_MapPlanes( - buffer: *mut OH_NativeBuffer, - virAddr: *mut *mut ::core::ffi::c_void, - outPlanes: *mut OH_NativeBuffer_Planes, - ) -> i32; - /** @brief Converts an OHNativeWindowBuffer instance to an OH_NativeBuffer. - - @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer - @param nativeWindowBuffer Indicates the pointer to a OHNativeWindowBuffer instance. - @param buffer Indicates the pointer to a OH_NativeBuffer pointer. - @return Returns an error code, 0 is sucess, otherwise, failed. - @since 12 - @version 1.0*/ - pub fn OH_NativeBuffer_FromNativeWindowBuffer( - nativeWindowBuffer: *mut OHNativeWindowBuffer, - buffer: *mut *mut OH_NativeBuffer, - ) -> i32; - - /** @brief Get the color space of the OH_NativeBuffer. - - @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer - @param buffer Indicates the pointer to a OH_NativeBuffer instance. - @param colorSpace Indicates the color space of native buffer, see OH_NativeBuffer_ColorSpace. - @return {@link NATIVE_ERROR_OK} 0 - Success. - {@link NATIVE_ERROR_INVALID_ARGUMENTS} 40001000 - buffer is NULL. - {@link NATIVE_ERROR_BUFFER_STATE_INVALID} 41207000 - Incorrect colorSpace state. - @since 12 - @version 1.0*/ - pub fn OH_NativeBuffer_GetColorSpace( - buffer: *mut OH_NativeBuffer, - colorSpace: *mut OH_NativeBuffer_ColorSpace, - ) -> i32; - /** @brief Set the metadata type of the OH_NativeBuffer. - - @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer - @param buffer Indicates the pointer to a OH_NativeBuffer instance. - @param metadataKey Indicates the metadata type of native buffer, see OH_NativeBuffer_MetadataKey. - @param size Indicates the size of a uint8_t vector. - @param metadata Indicates the pointer to a uint8_t vector. - @return {@link NATIVE_ERROR_OK} 0 - Success. - {@link NATIVE_ERROR_INVALID_ARGUMENTS} 40001000 - buffer or metadata is NULL. - {@link NATIVE_ERROR_BUFFER_STATE_INVALID} 41207000 - Incorrect metadata state. - {@link NATIVE_ERROR_UNSUPPORTED} 50102000 - Unsupported metadata key. - @since 12 - @version 1.0*/ - pub fn OH_NativeBuffer_SetMetadataValue( - buffer: *mut OH_NativeBuffer, - metadataKey: OH_NativeBuffer_MetadataKey, - size: i32, - metadata: *mut u8, - ) -> i32; - /** @brief Set the metadata type of the OH_NativeBuffer. - - @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer - @param buffer Indicates the pointer to a OH_NativeBuffer instance. - @param metadataKey Indicates the metadata type of native buffer, see OH_NativeBuffer_MetadataKey. - @param size Indicates the size of a uint8_t vector. - @param metadata Indicates the pointer to a uint8_t vector. - @return {@link NATIVE_ERROR_OK} 0 - Success. - {@link NATIVE_ERROR_INVALID_ARGUMENTS} 40001000 - buffer, metadata, or size is NULL. - {@link NATIVE_ERROR_BUFFER_STATE_INVALID} 41207000 - Incorrect metadata state. - {@link NATIVE_ERROR_UNSUPPORTED} 50102000 - Unsupported metadata key. - @since 12 - @version 1.0*/ - pub fn OH_NativeBuffer_GetMetadataValue( - buffer: *mut OH_NativeBuffer, - metadataKey: OH_NativeBuffer_MetadataKey, - size: *mut i32, - metadata: *mut *mut u8, - ) -> i32; -} diff --git a/src/native_buffer/native_buffer_api10.rs b/src/native_buffer/native_buffer_api10.rs deleted file mode 100644 index af98f6e..0000000 --- a/src/native_buffer/native_buffer_api10.rs +++ /dev/null @@ -1,228 +0,0 @@ -/* automatically generated by rust-bindgen 0.69.4 */ - -#![allow(non_upper_case_globals)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] - -#[repr(C)] -pub struct OH_NativeBuffer { - _unused: [u8; 0], -} -impl OH_NativeBuffer_Usage { - pub const NATIVEBUFFER_USAGE_CPU_READ: OH_NativeBuffer_Usage = OH_NativeBuffer_Usage(1); -} -impl OH_NativeBuffer_Usage { - /// < CPU read buffer */ - pub const NATIVEBUFFER_USAGE_CPU_WRITE: OH_NativeBuffer_Usage = OH_NativeBuffer_Usage(2); -} -impl OH_NativeBuffer_Usage { - /// < CPU write memory */ - pub const NATIVEBUFFER_USAGE_MEM_DMA: OH_NativeBuffer_Usage = OH_NativeBuffer_Usage(8); -} -impl ::core::ops::BitOr for OH_NativeBuffer_Usage { - type Output = Self; - #[inline] - fn bitor(self, other: Self) -> Self { - OH_NativeBuffer_Usage(self.0 | other.0) - } -} -impl ::core::ops::BitOrAssign for OH_NativeBuffer_Usage { - #[inline] - fn bitor_assign(&mut self, rhs: OH_NativeBuffer_Usage) { - self.0 |= rhs.0; - } -} -impl ::core::ops::BitAnd for OH_NativeBuffer_Usage { - type Output = Self; - #[inline] - fn bitand(self, other: Self) -> Self { - OH_NativeBuffer_Usage(self.0 & other.0) - } -} -impl ::core::ops::BitAndAssign for OH_NativeBuffer_Usage { - #[inline] - fn bitand_assign(&mut self, rhs: OH_NativeBuffer_Usage) { - self.0 &= rhs.0; - } -} -#[repr(transparent)] -/** @brief Indicates the usage of a native buffer. - -@syscap SystemCapability.Graphic.Graphic2D.NativeBuffer -@since 10 -@version 1.0*/ -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct OH_NativeBuffer_Usage(pub ::core::ffi::c_uint); -impl OH_NativeBuffer_Format { - pub const NATIVEBUFFER_PIXEL_FMT_RGB_565: OH_NativeBuffer_Format = OH_NativeBuffer_Format(3); -} -impl OH_NativeBuffer_Format { - /// < RGB565 format */ - pub const NATIVEBUFFER_PIXEL_FMT_RGBA_5658: OH_NativeBuffer_Format = OH_NativeBuffer_Format(4); -} -impl OH_NativeBuffer_Format { - /// < RGBA5658 format */ - pub const NATIVEBUFFER_PIXEL_FMT_RGBX_4444: OH_NativeBuffer_Format = OH_NativeBuffer_Format(5); -} -impl OH_NativeBuffer_Format { - /// < RGBX4444 format */ - pub const NATIVEBUFFER_PIXEL_FMT_RGBA_4444: OH_NativeBuffer_Format = OH_NativeBuffer_Format(6); -} -impl OH_NativeBuffer_Format { - /// < RGBA4444 format */ - pub const NATIVEBUFFER_PIXEL_FMT_RGB_444: OH_NativeBuffer_Format = OH_NativeBuffer_Format(7); -} -impl OH_NativeBuffer_Format { - /// < RGB444 format */ - pub const NATIVEBUFFER_PIXEL_FMT_RGBX_5551: OH_NativeBuffer_Format = OH_NativeBuffer_Format(8); -} -impl OH_NativeBuffer_Format { - /// < RGBX5551 format */ - pub const NATIVEBUFFER_PIXEL_FMT_RGBA_5551: OH_NativeBuffer_Format = OH_NativeBuffer_Format(9); -} -impl OH_NativeBuffer_Format { - /// < RGBA5551 format */ - pub const NATIVEBUFFER_PIXEL_FMT_RGB_555: OH_NativeBuffer_Format = OH_NativeBuffer_Format(10); -} -impl OH_NativeBuffer_Format { - /// < RGB555 format */ - pub const NATIVEBUFFER_PIXEL_FMT_RGBX_8888: OH_NativeBuffer_Format = OH_NativeBuffer_Format(11); -} -impl OH_NativeBuffer_Format { - /// < RGBX8888 format */ - pub const NATIVEBUFFER_PIXEL_FMT_RGBA_8888: OH_NativeBuffer_Format = OH_NativeBuffer_Format(12); -} -impl OH_NativeBuffer_Format { - /// < RGBA8888 format */ - pub const NATIVEBUFFER_PIXEL_FMT_RGB_888: OH_NativeBuffer_Format = OH_NativeBuffer_Format(13); -} -impl OH_NativeBuffer_Format { - /// < RGB888 format */ - pub const NATIVEBUFFER_PIXEL_FMT_BGR_565: OH_NativeBuffer_Format = OH_NativeBuffer_Format(14); -} -impl OH_NativeBuffer_Format { - /// < BGR565 format */ - pub const NATIVEBUFFER_PIXEL_FMT_BGRX_4444: OH_NativeBuffer_Format = OH_NativeBuffer_Format(15); -} -impl OH_NativeBuffer_Format { - /// < BGRX4444 format */ - pub const NATIVEBUFFER_PIXEL_FMT_BGRA_4444: OH_NativeBuffer_Format = OH_NativeBuffer_Format(16); -} -impl OH_NativeBuffer_Format { - /// < BGRA4444 format */ - pub const NATIVEBUFFER_PIXEL_FMT_BGRX_5551: OH_NativeBuffer_Format = OH_NativeBuffer_Format(17); -} -impl OH_NativeBuffer_Format { - /// < BGRX5551 format */ - pub const NATIVEBUFFER_PIXEL_FMT_BGRA_5551: OH_NativeBuffer_Format = OH_NativeBuffer_Format(18); -} -impl OH_NativeBuffer_Format { - /// < BGRA5551 format */ - pub const NATIVEBUFFER_PIXEL_FMT_BGRX_8888: OH_NativeBuffer_Format = OH_NativeBuffer_Format(19); -} -impl OH_NativeBuffer_Format { - /// < BGRX8888 format */ - pub const NATIVEBUFFER_PIXEL_FMT_BGRA_8888: OH_NativeBuffer_Format = OH_NativeBuffer_Format(20); -} -impl OH_NativeBuffer_Format { - /// < BGRA8888 format */ - pub const NATIVEBUFFER_PIXEL_FMT_BUTT: OH_NativeBuffer_Format = - OH_NativeBuffer_Format(2147483647); -} -#[repr(transparent)] -/** @brief Indicates the format of a native buffer. - -@syscap SystemCapability.Graphic.Graphic2D.NativeBuffer -@since 10 -@version 1.0*/ -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct OH_NativeBuffer_Format(pub ::core::ffi::c_uint); -/** @brief OH_NativeBuffer config. \n -Used to allocating new OH_NativeBuffer andquery parameters if existing ones. - -@syscap SystemCapability.Graphic.Graphic2D.NativeBuffer -@since 9 -@version 1.0*/ -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct OH_NativeBuffer_Config { - ///< Width in pixels - pub width: i32, - ///< Height in pixels - pub height: i32, - ///< One of PixelFormat - pub format: i32, - ///< Combination of buffer usage - pub usage: i32, - ///< the stride of memory - pub stride: i32, -} -extern "C" { - /** @brief Alloc a OH_NativeBuffer that matches the passed BufferRequestConfig. \n - A new OH_NativeBuffer instance is created each time this function is called. - - @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer - @param config Indicates the pointer to a BufferRequestConfig instance. - @return Returns the pointer to the OH_NativeBuffer instance created if the operation is successful, \n - returns NULL otherwise. - @since 9 - @version 1.0*/ - pub fn OH_NativeBuffer_Alloc(config: *const OH_NativeBuffer_Config) -> *mut OH_NativeBuffer; - /** @brief Adds the reference count of a OH_NativeBuffer. - - @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer - @param buffer Indicates the pointer to a OH_NativeBuffer instance. - @return Returns an error code, 0 is success, otherwise, failed. - @since 9 - @version 1.0*/ - pub fn OH_NativeBuffer_Reference(buffer: *mut OH_NativeBuffer) -> i32; - /** @brief Decreases the reference count of a OH_NativeBuffer and, when the reference count reaches 0, \n - destroys this OH_NativeBuffer. - - @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer - @param buffer Indicates the pointer to a OH_NativeBuffer instance. - @return Returns an error code, 0 is success, otherwise, failed. - @since 9 - @version 1.0*/ - pub fn OH_NativeBuffer_Unreference(buffer: *mut OH_NativeBuffer) -> i32; - /** @brief Return a config of the OH_NativeBuffer in the passed OHNativeBufferConfig struct. - - @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer - @param buffer Indicates the pointer to a OH_NativeBuffer instance. - @param config Indicates the pointer to the NativeBufferConfig of the buffer. - @return void - @since 9 - @version 1.0*/ - pub fn OH_NativeBuffer_GetConfig( - buffer: *mut OH_NativeBuffer, - config: *mut OH_NativeBuffer_Config, - ); - /** @brief Provide direct cpu access to the OH_NativeBuffer in the process's address space. - - @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer - @param buffer Indicates the pointer to a OH_NativeBuffer instance. - @param virAddr Indicates the address of the OH_NativeBuffer in virtual memory. - @return Returns an error code, 0 is success, otherwise, failed. - @since 9 - @version 1.0*/ - pub fn OH_NativeBuffer_Map( - buffer: *mut OH_NativeBuffer, - virAddr: *mut *mut ::core::ffi::c_void, - ) -> i32; - /** @brief Remove direct cpu access ability of the OH_NativeBuffer in the process's address space. - - @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer - @param buffer Indicates the pointer to a OH_NativeBuffer instance. - @return Returns an error code, 0 is success, otherwise, failed. - @since 9 - @version 1.0*/ - pub fn OH_NativeBuffer_Unmap(buffer: *mut OH_NativeBuffer) -> i32; - /** @brief Get the systen wide unique sequence number of the OH_NativeBuffer. - - @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer - @param buffer Indicates the pointer to a OH_NativeBuffer instance. - @return Returns the sequence number, which is unique for each OH_NativeBuffer. - @since 9 - @version 1.0*/ - pub fn OH_NativeBuffer_GetSeqNum(buffer: *mut OH_NativeBuffer) -> u32; -} diff --git a/src/native_buffer/native_buffer_api11.rs b/src/native_buffer/native_buffer_api11.rs deleted file mode 100644 index 316309d..0000000 --- a/src/native_buffer/native_buffer_api11.rs +++ /dev/null @@ -1,399 +0,0 @@ -/* automatically generated by rust-bindgen 0.69.4 */ - -#![allow(non_upper_case_globals)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] - -#[repr(C)] -pub struct OH_NativeBuffer { - _unused: [u8; 0], -} -impl OH_NativeBuffer_Usage { - pub const NATIVEBUFFER_USAGE_CPU_READ: OH_NativeBuffer_Usage = OH_NativeBuffer_Usage(1); -} -impl OH_NativeBuffer_Usage { - /// < CPU read buffer */ - pub const NATIVEBUFFER_USAGE_CPU_WRITE: OH_NativeBuffer_Usage = OH_NativeBuffer_Usage(2); -} -impl OH_NativeBuffer_Usage { - /// < CPU write memory */ - pub const NATIVEBUFFER_USAGE_MEM_DMA: OH_NativeBuffer_Usage = OH_NativeBuffer_Usage(8); -} -impl ::core::ops::BitOr for OH_NativeBuffer_Usage { - type Output = Self; - #[inline] - fn bitor(self, other: Self) -> Self { - OH_NativeBuffer_Usage(self.0 | other.0) - } -} -impl ::core::ops::BitOrAssign for OH_NativeBuffer_Usage { - #[inline] - fn bitor_assign(&mut self, rhs: OH_NativeBuffer_Usage) { - self.0 |= rhs.0; - } -} -impl ::core::ops::BitAnd for OH_NativeBuffer_Usage { - type Output = Self; - #[inline] - fn bitand(self, other: Self) -> Self { - OH_NativeBuffer_Usage(self.0 & other.0) - } -} -impl ::core::ops::BitAndAssign for OH_NativeBuffer_Usage { - #[inline] - fn bitand_assign(&mut self, rhs: OH_NativeBuffer_Usage) { - self.0 &= rhs.0; - } -} -#[repr(transparent)] -/** @brief Indicates the usage of a native buffer. - -@syscap SystemCapability.Graphic.Graphic2D.NativeBuffer -@since 10 -@version 1.0*/ -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct OH_NativeBuffer_Usage(pub ::core::ffi::c_uint); -impl OH_NativeBuffer_Format { - pub const NATIVEBUFFER_PIXEL_FMT_RGB_565: OH_NativeBuffer_Format = OH_NativeBuffer_Format(3); -} -impl OH_NativeBuffer_Format { - /// < RGB565 format */ - pub const NATIVEBUFFER_PIXEL_FMT_RGBA_5658: OH_NativeBuffer_Format = OH_NativeBuffer_Format(4); -} -impl OH_NativeBuffer_Format { - /// < RGBA5658 format */ - pub const NATIVEBUFFER_PIXEL_FMT_RGBX_4444: OH_NativeBuffer_Format = OH_NativeBuffer_Format(5); -} -impl OH_NativeBuffer_Format { - /// < RGBX4444 format */ - pub const NATIVEBUFFER_PIXEL_FMT_RGBA_4444: OH_NativeBuffer_Format = OH_NativeBuffer_Format(6); -} -impl OH_NativeBuffer_Format { - /// < RGBA4444 format */ - pub const NATIVEBUFFER_PIXEL_FMT_RGB_444: OH_NativeBuffer_Format = OH_NativeBuffer_Format(7); -} -impl OH_NativeBuffer_Format { - /// < RGB444 format */ - pub const NATIVEBUFFER_PIXEL_FMT_RGBX_5551: OH_NativeBuffer_Format = OH_NativeBuffer_Format(8); -} -impl OH_NativeBuffer_Format { - /// < RGBX5551 format */ - pub const NATIVEBUFFER_PIXEL_FMT_RGBA_5551: OH_NativeBuffer_Format = OH_NativeBuffer_Format(9); -} -impl OH_NativeBuffer_Format { - /// < RGBA5551 format */ - pub const NATIVEBUFFER_PIXEL_FMT_RGB_555: OH_NativeBuffer_Format = OH_NativeBuffer_Format(10); -} -impl OH_NativeBuffer_Format { - /// < RGB555 format */ - pub const NATIVEBUFFER_PIXEL_FMT_RGBX_8888: OH_NativeBuffer_Format = OH_NativeBuffer_Format(11); -} -impl OH_NativeBuffer_Format { - /// < RGBX8888 format */ - pub const NATIVEBUFFER_PIXEL_FMT_RGBA_8888: OH_NativeBuffer_Format = OH_NativeBuffer_Format(12); -} -impl OH_NativeBuffer_Format { - /// < RGBA8888 format */ - pub const NATIVEBUFFER_PIXEL_FMT_RGB_888: OH_NativeBuffer_Format = OH_NativeBuffer_Format(13); -} -impl OH_NativeBuffer_Format { - /// < RGB888 format */ - pub const NATIVEBUFFER_PIXEL_FMT_BGR_565: OH_NativeBuffer_Format = OH_NativeBuffer_Format(14); -} -impl OH_NativeBuffer_Format { - /// < BGR565 format */ - pub const NATIVEBUFFER_PIXEL_FMT_BGRX_4444: OH_NativeBuffer_Format = OH_NativeBuffer_Format(15); -} -impl OH_NativeBuffer_Format { - /// < BGRX4444 format */ - pub const NATIVEBUFFER_PIXEL_FMT_BGRA_4444: OH_NativeBuffer_Format = OH_NativeBuffer_Format(16); -} -impl OH_NativeBuffer_Format { - /// < BGRA4444 format */ - pub const NATIVEBUFFER_PIXEL_FMT_BGRX_5551: OH_NativeBuffer_Format = OH_NativeBuffer_Format(17); -} -impl OH_NativeBuffer_Format { - /// < BGRX5551 format */ - pub const NATIVEBUFFER_PIXEL_FMT_BGRA_5551: OH_NativeBuffer_Format = OH_NativeBuffer_Format(18); -} -impl OH_NativeBuffer_Format { - /// < BGRA5551 format */ - pub const NATIVEBUFFER_PIXEL_FMT_BGRX_8888: OH_NativeBuffer_Format = OH_NativeBuffer_Format(19); -} -impl OH_NativeBuffer_Format { - /// < BGRX8888 format */ - pub const NATIVEBUFFER_PIXEL_FMT_BGRA_8888: OH_NativeBuffer_Format = OH_NativeBuffer_Format(20); -} -impl OH_NativeBuffer_Format { - /// < BGRA8888 format */ - pub const NATIVEBUFFER_PIXEL_FMT_BUTT: OH_NativeBuffer_Format = - OH_NativeBuffer_Format(2147483647); -} -#[repr(transparent)] -/** @brief Indicates the format of a native buffer. - -@syscap SystemCapability.Graphic.Graphic2D.NativeBuffer -@since 10 -@version 1.0*/ -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct OH_NativeBuffer_Format(pub ::core::ffi::c_uint); -impl OH_NativeBuffer_ColorSpace { - /// None color space - pub const OH_COLORSPACE_NONE: OH_NativeBuffer_ColorSpace = OH_NativeBuffer_ColorSpace(0); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_BT601_P | (TRANSFUNC_BT709 << 8) | (MATRIX_BT601_P << 16) | (RANGE_FULL << 21) - pub const OH_COLORSPACE_BT601_EBU_FULL: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(1); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_BT601_N | (TRANSFUNC_BT709 << 8) | (MATRIX_BT601_N << 16) | (RANGE_FULL << 21) - pub const OH_COLORSPACE_BT601_SMPTE_C_FULL: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(2); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_BT709 | (TRANSFUNC_BT709 << 8) | (MATRIX_BT709 << 16) | (RANGE_FULL << 21) - pub const OH_COLORSPACE_BT709_FULL: OH_NativeBuffer_ColorSpace = OH_NativeBuffer_ColorSpace(3); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_BT2020 | (TRANSFUNC_HLG << 8) | (MATRIX_BT2020 << 16) | (RANGE_FULL << 21) - pub const OH_COLORSPACE_BT2020_HLG_FULL: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(4); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_BT2020 | (TRANSFUNC_PQ << 8) | (MATRIX_BT2020 << 16) | (RANGE_FULL << 21) - pub const OH_COLORSPACE_BT2020_PQ_FULL: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(5); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_BT601_P | (TRANSFUNC_BT709 << 8) | (MATRIX_BT601_P << 16) | (RANGE_LIMITED << 21) - pub const OH_COLORSPACE_BT601_EBU_LIMIT: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(6); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_BT601_N | (TRANSFUNC_BT709 << 8) | (MATRIX_BT601_N << 16) | (RANGE_LIMITED << 21) - pub const OH_COLORSPACE_BT601_SMPTE_C_LIMIT: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(7); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_BT709 | (TRANSFUNC_BT709 << 8) | (MATRIX_BT709 << 16) | (RANGE_LIMITED << 21) - pub const OH_COLORSPACE_BT709_LIMIT: OH_NativeBuffer_ColorSpace = OH_NativeBuffer_ColorSpace(8); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_BT2020 | (TRANSFUNC_HLG << 8) | (MATRIX_BT2020 << 16) | (RANGE_LIMITED << 21) - pub const OH_COLORSPACE_BT2020_HLG_LIMIT: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(9); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_BT2020 | (TRANSFUNC_PQ << 8) | (MATRIX_BT2020 << 16) | (RANGE_LIMITED << 21) - pub const OH_COLORSPACE_BT2020_PQ_LIMIT: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(10); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_SRGB | (TRANSFUNC_SRGB << 8) | (MATRIX_BT601_N << 16) | (RANGE_FULL << 21) - pub const OH_COLORSPACE_SRGB_FULL: OH_NativeBuffer_ColorSpace = OH_NativeBuffer_ColorSpace(11); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_P3_D65 | (TRANSFUNC_SRGB << 8) | (MATRIX_P3 << 16) | (RANGE_FULL << 21) - pub const OH_COLORSPACE_P3_FULL: OH_NativeBuffer_ColorSpace = OH_NativeBuffer_ColorSpace(12); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_P3_D65 | (TRANSFUNC_HLG << 8) | (MATRIX_P3 << 16) | (RANGE_FULL << 21) - pub const OH_COLORSPACE_P3_HLG_FULL: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(13); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_P3_D65 | (TRANSFUNC_PQ << 8) | (MATRIX_P3 << 16) | (RANGE_FULL << 21) - pub const OH_COLORSPACE_P3_PQ_FULL: OH_NativeBuffer_ColorSpace = OH_NativeBuffer_ColorSpace(14); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_ADOBERGB | (TRANSFUNC_ADOBERGB << 8) | (MATRIX_ADOBERGB << 16) | (RANGE_FULL << 21) - pub const OH_COLORSPACE_ADOBERGB_FULL: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(15); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_SRGB | (TRANSFUNC_SRGB << 8) | (MATRIX_BT601_N << 16) | (RANGE_LIMITED << 21) - pub const OH_COLORSPACE_SRGB_LIMIT: OH_NativeBuffer_ColorSpace = OH_NativeBuffer_ColorSpace(16); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_P3_D65 | (TRANSFUNC_SRGB << 8) | (MATRIX_P3 << 16) | (RANGE_LIMITED << 21) - pub const OH_COLORSPACE_P3_LIMIT: OH_NativeBuffer_ColorSpace = OH_NativeBuffer_ColorSpace(17); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_P3_D65 | (TRANSFUNC_HLG << 8) | (MATRIX_P3 << 16) | (RANGE_LIMITED << 21) - pub const OH_COLORSPACE_P3_HLG_LIMIT: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(18); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_P3_D65 | (TRANSFUNC_PQ << 8) | (MATRIX_P3 << 16) | (RANGE_LIMITED << 21) - pub const OH_COLORSPACE_P3_PQ_LIMIT: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(19); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_ADOBERGB | (TRANSFUNC_ADOBERGB << 8) | (MATRIX_ADOBERGB << 16) | (RANGE_LIMITED << 21) - pub const OH_COLORSPACE_ADOBERGB_LIMIT: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(20); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_SRGB | (TRANSFUNC_LINEAR << 8) - pub const OH_COLORSPACE_LINEAR_SRGB: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(21); -} -impl OH_NativeBuffer_ColorSpace { - /// equal to OH_COLORSPACE_LINEAR_SRGB - pub const OH_COLORSPACE_LINEAR_BT709: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(22); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_P3_D65 | (TRANSFUNC_LINEAR << 8) - pub const OH_COLORSPACE_LINEAR_P3: OH_NativeBuffer_ColorSpace = OH_NativeBuffer_ColorSpace(23); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_BT2020 | (TRANSFUNC_LINEAR << 8) - pub const OH_COLORSPACE_LINEAR_BT2020: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(24); -} -impl OH_NativeBuffer_ColorSpace { - /// equal to OH_COLORSPACE_SRGB_FULL - pub const OH_COLORSPACE_DISPLAY_SRGB: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(25); -} -impl OH_NativeBuffer_ColorSpace { - /// equal to OH_COLORSPACE_P3_FULL - pub const OH_COLORSPACE_DISPLAY_P3_SRGB: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(26); -} -impl OH_NativeBuffer_ColorSpace { - /// equal to OH_COLORSPACE_P3_HLG_FULL - pub const OH_COLORSPACE_DISPLAY_P3_HLG: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(27); -} -impl OH_NativeBuffer_ColorSpace { - /// equal to OH_COLORSPACE_P3_PQ_FULL - pub const OH_COLORSPACE_DISPLAY_P3_PQ: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(28); -} -impl OH_NativeBuffer_ColorSpace { - /// COLORPRIMARIES_BT2020 | (TRANSFUNC_SRGB << 8) | (MATRIX_BT2020 << 16) | (RANGE_FULL << 21) - pub const OH_COLORSPACE_DISPLAY_BT2020_SRGB: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(29); -} -impl OH_NativeBuffer_ColorSpace { - /// equal to OH_COLORSPACE_BT2020_HLG_FULL - pub const OH_COLORSPACE_DISPLAY_BT2020_HLG: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(30); -} -impl OH_NativeBuffer_ColorSpace { - /// equal to OH_COLORSPACE_BT2020_PQ_FULL - pub const OH_COLORSPACE_DISPLAY_BT2020_PQ: OH_NativeBuffer_ColorSpace = - OH_NativeBuffer_ColorSpace(31); -} -#[repr(transparent)] -/** @brief Indicates the color space of a native buffer. - -@syscap SystemCapability.Graphic.Graphic2D.NativeBuffer -@since 11 -@version 1.0*/ -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct OH_NativeBuffer_ColorSpace(pub ::core::ffi::c_uint); -/** @brief OH_NativeBuffer config. \n -Used to allocating new OH_NativeBuffer andquery parameters if existing ones. - -@syscap SystemCapability.Graphic.Graphic2D.NativeBuffer -@since 9 -@version 1.0*/ -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct OH_NativeBuffer_Config { - ///< Width in pixels - pub width: i32, - ///< Height in pixels - pub height: i32, - ///< One of PixelFormat - pub format: i32, - ///< Combination of buffer usage - pub usage: i32, - ///< the stride of memory - pub stride: i32, -} -extern "C" { - /** @brief Alloc a OH_NativeBuffer that matches the passed BufferRequestConfig. \n - A new OH_NativeBuffer instance is created each time this function is called. - - @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer - @param config Indicates the pointer to a BufferRequestConfig instance. - @return Returns the pointer to the OH_NativeBuffer instance created if the operation is successful, \n - returns NULL otherwise. - @since 9 - @version 1.0*/ - pub fn OH_NativeBuffer_Alloc(config: *const OH_NativeBuffer_Config) -> *mut OH_NativeBuffer; - /** @brief Adds the reference count of a OH_NativeBuffer. - - @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer - @param buffer Indicates the pointer to a OH_NativeBuffer instance. - @return Returns an error code, 0 is success, otherwise, failed. - @since 9 - @version 1.0*/ - pub fn OH_NativeBuffer_Reference(buffer: *mut OH_NativeBuffer) -> i32; - /** @brief Decreases the reference count of a OH_NativeBuffer and, when the reference count reaches 0, \n - destroys this OH_NativeBuffer. - - @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer - @param buffer Indicates the pointer to a OH_NativeBuffer instance. - @return Returns an error code, 0 is success, otherwise, failed. - @since 9 - @version 1.0*/ - pub fn OH_NativeBuffer_Unreference(buffer: *mut OH_NativeBuffer) -> i32; - /** @brief Return a config of the OH_NativeBuffer in the passed OHNativeBufferConfig struct. - - @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer - @param buffer Indicates the pointer to a OH_NativeBuffer instance. - @param config Indicates the pointer to the NativeBufferConfig of the buffer. - @return void - @since 9 - @version 1.0*/ - pub fn OH_NativeBuffer_GetConfig( - buffer: *mut OH_NativeBuffer, - config: *mut OH_NativeBuffer_Config, - ); - /** @brief Provide direct cpu access to the OH_NativeBuffer in the process's address space. - - @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer - @param buffer Indicates the pointer to a OH_NativeBuffer instance. - @param virAddr Indicates the address of the OH_NativeBuffer in virtual memory. - @return Returns an error code, 0 is success, otherwise, failed. - @since 9 - @version 1.0*/ - pub fn OH_NativeBuffer_Map( - buffer: *mut OH_NativeBuffer, - virAddr: *mut *mut ::core::ffi::c_void, - ) -> i32; - /** @brief Remove direct cpu access ability of the OH_NativeBuffer in the process's address space. - - @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer - @param buffer Indicates the pointer to a OH_NativeBuffer instance. - @return Returns an error code, 0 is success, otherwise, failed. - @since 9 - @version 1.0*/ - pub fn OH_NativeBuffer_Unmap(buffer: *mut OH_NativeBuffer) -> i32; - /** @brief Get the systen wide unique sequence number of the OH_NativeBuffer. - - @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer - @param buffer Indicates the pointer to a OH_NativeBuffer instance. - @return Returns the sequence number, which is unique for each OH_NativeBuffer. - @since 9 - @version 1.0*/ - pub fn OH_NativeBuffer_GetSeqNum(buffer: *mut OH_NativeBuffer) -> u32; - /** @brief Set the color space of the OH_NativeBuffer. - - @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer - @param buffer Indicates the pointer to a OH_NativeBuffer instance. - @param colorSpace Indicates the color space of native buffer, see OH_NativeBuffer_ColorSpace. - @return Returns an error code, 0 is success, otherwise, failed. - @since 11 - @version 1.0*/ - pub fn OH_NativeBuffer_SetColorSpace( - buffer: *mut OH_NativeBuffer, - colorSpace: OH_NativeBuffer_ColorSpace, - ) -> i32; -} diff --git a/src/native_buffer/native_buffer_api12.rs b/src/native_buffer/native_buffer_ffi.rs similarity index 86% rename from src/native_buffer/native_buffer_api12.rs rename to src/native_buffer/native_buffer_ffi.rs index f24874a..1a5982a 100644 --- a/src/native_buffer/native_buffer_api12.rs +++ b/src/native_buffer/native_buffer_ffi.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.70.1 */ +/* automatically generated by rust-bindgen 0.71.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] @@ -248,21 +248,29 @@ pub struct OH_NativeBuffer_Usage(pub ::core::ffi::c_uint); impl OH_NativeBuffer_Format { /** CLUT8 format @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const NATIVEBUFFER_PIXEL_FMT_CLUT8: OH_NativeBuffer_Format = OH_NativeBuffer_Format(0); } impl OH_NativeBuffer_Format { /** CLUT1 format @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const NATIVEBUFFER_PIXEL_FMT_CLUT1: OH_NativeBuffer_Format = OH_NativeBuffer_Format(1); } impl OH_NativeBuffer_Format { /** CLUT4 format @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const NATIVEBUFFER_PIXEL_FMT_CLUT4: OH_NativeBuffer_Format = OH_NativeBuffer_Format(2); } impl OH_NativeBuffer_Format { /** CLUT4 format @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const NATIVEBUFFER_PIXEL_FMT_RGB_565: OH_NativeBuffer_Format = OH_NativeBuffer_Format(3); } impl OH_NativeBuffer_Format { @@ -335,112 +343,150 @@ impl OH_NativeBuffer_Format { } impl OH_NativeBuffer_Format { #[doc = " < BGRA8888 format */\n**\n* YUV422 interleaved format\n* @since 12\n*/"] + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const NATIVEBUFFER_PIXEL_FMT_YUV_422_I: OH_NativeBuffer_Format = OH_NativeBuffer_Format(21); } impl OH_NativeBuffer_Format { /** YCBCR422 semi-plannar format @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const NATIVEBUFFER_PIXEL_FMT_YCBCR_422_SP: OH_NativeBuffer_Format = OH_NativeBuffer_Format(22); } impl OH_NativeBuffer_Format { /** YCRCB422 semi-plannar format @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const NATIVEBUFFER_PIXEL_FMT_YCRCB_422_SP: OH_NativeBuffer_Format = OH_NativeBuffer_Format(23); } impl OH_NativeBuffer_Format { /** YCBCR420 semi-plannar format @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const NATIVEBUFFER_PIXEL_FMT_YCBCR_420_SP: OH_NativeBuffer_Format = OH_NativeBuffer_Format(24); } impl OH_NativeBuffer_Format { /** YCRCB420 semi-plannar format @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const NATIVEBUFFER_PIXEL_FMT_YCRCB_420_SP: OH_NativeBuffer_Format = OH_NativeBuffer_Format(25); } impl OH_NativeBuffer_Format { /** YCBCR422 plannar format @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const NATIVEBUFFER_PIXEL_FMT_YCBCR_422_P: OH_NativeBuffer_Format = OH_NativeBuffer_Format(26); } impl OH_NativeBuffer_Format { /** YCRCB422 plannar format @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const NATIVEBUFFER_PIXEL_FMT_YCRCB_422_P: OH_NativeBuffer_Format = OH_NativeBuffer_Format(27); } impl OH_NativeBuffer_Format { /** YCBCR420 plannar format @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const NATIVEBUFFER_PIXEL_FMT_YCBCR_420_P: OH_NativeBuffer_Format = OH_NativeBuffer_Format(28); } impl OH_NativeBuffer_Format { /** YCRCB420 plannar format @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const NATIVEBUFFER_PIXEL_FMT_YCRCB_420_P: OH_NativeBuffer_Format = OH_NativeBuffer_Format(29); } impl OH_NativeBuffer_Format { /** YUYV422 packed format @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const NATIVEBUFFER_PIXEL_FMT_YUYV_422_PKG: OH_NativeBuffer_Format = OH_NativeBuffer_Format(30); } impl OH_NativeBuffer_Format { /** UYVY422 packed format @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const NATIVEBUFFER_PIXEL_FMT_UYVY_422_PKG: OH_NativeBuffer_Format = OH_NativeBuffer_Format(31); } impl OH_NativeBuffer_Format { /** YVYU422 packed format @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const NATIVEBUFFER_PIXEL_FMT_YVYU_422_PKG: OH_NativeBuffer_Format = OH_NativeBuffer_Format(32); } impl OH_NativeBuffer_Format { /** VYUY422 packed format @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const NATIVEBUFFER_PIXEL_FMT_VYUY_422_PKG: OH_NativeBuffer_Format = OH_NativeBuffer_Format(33); } impl OH_NativeBuffer_Format { /** RGBA_1010102 packed format @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const NATIVEBUFFER_PIXEL_FMT_RGBA_1010102: OH_NativeBuffer_Format = OH_NativeBuffer_Format(34); } impl OH_NativeBuffer_Format { /** YCBCR420 semi-planar 10bit packed format @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const NATIVEBUFFER_PIXEL_FMT_YCBCR_P010: OH_NativeBuffer_Format = OH_NativeBuffer_Format(35); } impl OH_NativeBuffer_Format { /** YCRCB420 semi-planar 10bit packed format @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const NATIVEBUFFER_PIXEL_FMT_YCRCB_P010: OH_NativeBuffer_Format = OH_NativeBuffer_Format(36); } impl OH_NativeBuffer_Format { /** Raw 10bit packed format @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const NATIVEBUFFER_PIXEL_FMT_RAW10: OH_NativeBuffer_Format = OH_NativeBuffer_Format(37); } impl OH_NativeBuffer_Format { /** vender mask format @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const NATIVEBUFFER_PIXEL_FMT_VENDER_MASK: OH_NativeBuffer_Format = OH_NativeBuffer_Format(2147418112); } impl OH_NativeBuffer_Format { /** vender mask format @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub const NATIVEBUFFER_PIXEL_FMT_BUTT: OH_NativeBuffer_Format = OH_NativeBuffer_Format(2147483647); } @@ -452,59 +498,83 @@ impl OH_NativeBuffer_Format { @version 1.0*/ #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct OH_NativeBuffer_Format(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl OH_NativeBuffer_TransformType { ///< No rotation pub const NATIVEBUFFER_ROTATE_NONE: OH_NativeBuffer_TransformType = OH_NativeBuffer_TransformType(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl OH_NativeBuffer_TransformType { ///< Rotation by 90 degrees pub const NATIVEBUFFER_ROTATE_90: OH_NativeBuffer_TransformType = OH_NativeBuffer_TransformType(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl OH_NativeBuffer_TransformType { ///< Rotation by 180 degrees pub const NATIVEBUFFER_ROTATE_180: OH_NativeBuffer_TransformType = OH_NativeBuffer_TransformType(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl OH_NativeBuffer_TransformType { ///< Rotation by 270 degrees pub const NATIVEBUFFER_ROTATE_270: OH_NativeBuffer_TransformType = OH_NativeBuffer_TransformType(3); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl OH_NativeBuffer_TransformType { ///< Flip horizontally pub const NATIVEBUFFER_FLIP_H: OH_NativeBuffer_TransformType = OH_NativeBuffer_TransformType(4); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl OH_NativeBuffer_TransformType { ///< Flip vertically pub const NATIVEBUFFER_FLIP_V: OH_NativeBuffer_TransformType = OH_NativeBuffer_TransformType(5); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl OH_NativeBuffer_TransformType { ///< Flip horizontally and rotate 90 degrees pub const NATIVEBUFFER_FLIP_H_ROT90: OH_NativeBuffer_TransformType = OH_NativeBuffer_TransformType(6); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl OH_NativeBuffer_TransformType { ///< Flip vertically and rotate 90 degrees pub const NATIVEBUFFER_FLIP_V_ROT90: OH_NativeBuffer_TransformType = OH_NativeBuffer_TransformType(7); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl OH_NativeBuffer_TransformType { ///< Flip horizontally and rotate 180 degrees pub const NATIVEBUFFER_FLIP_H_ROT180: OH_NativeBuffer_TransformType = OH_NativeBuffer_TransformType(8); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl OH_NativeBuffer_TransformType { ///< Flip vertically and rotate 180 degrees pub const NATIVEBUFFER_FLIP_V_ROT180: OH_NativeBuffer_TransformType = OH_NativeBuffer_TransformType(9); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl OH_NativeBuffer_TransformType { ///< Flip horizontally and rotate 270 degrees pub const NATIVEBUFFER_FLIP_H_ROT270: OH_NativeBuffer_TransformType = OH_NativeBuffer_TransformType(10); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl OH_NativeBuffer_TransformType { ///< Flip vertically and rotate 270 degrees pub const NATIVEBUFFER_FLIP_V_ROT270: OH_NativeBuffer_TransformType = @@ -516,58 +586,82 @@ impl OH_NativeBuffer_TransformType { @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer @since 12 @version 1.0*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct OH_NativeBuffer_TransformType(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl OH_NativeBuffer_ColorGamut { ///< Native or default pub const NATIVEBUFFER_COLOR_GAMUT_NATIVE: OH_NativeBuffer_ColorGamut = OH_NativeBuffer_ColorGamut(0); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl OH_NativeBuffer_ColorGamut { ///< Standard BT601 pub const NATIVEBUFFER_COLOR_GAMUT_STANDARD_BT601: OH_NativeBuffer_ColorGamut = OH_NativeBuffer_ColorGamut(1); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl OH_NativeBuffer_ColorGamut { ///< Standard BT709 pub const NATIVEBUFFER_COLOR_GAMUT_STANDARD_BT709: OH_NativeBuffer_ColorGamut = OH_NativeBuffer_ColorGamut(2); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl OH_NativeBuffer_ColorGamut { ///< DCI P3 pub const NATIVEBUFFER_COLOR_GAMUT_DCI_P3: OH_NativeBuffer_ColorGamut = OH_NativeBuffer_ColorGamut(3); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl OH_NativeBuffer_ColorGamut { ///< SRGB pub const NATIVEBUFFER_COLOR_GAMUT_SRGB: OH_NativeBuffer_ColorGamut = OH_NativeBuffer_ColorGamut(4); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl OH_NativeBuffer_ColorGamut { ///< Adobe RGB pub const NATIVEBUFFER_COLOR_GAMUT_ADOBE_RGB: OH_NativeBuffer_ColorGamut = OH_NativeBuffer_ColorGamut(5); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl OH_NativeBuffer_ColorGamut { ///< Display P3 pub const NATIVEBUFFER_COLOR_GAMUT_DISPLAY_P3: OH_NativeBuffer_ColorGamut = OH_NativeBuffer_ColorGamut(6); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl OH_NativeBuffer_ColorGamut { ///< BT2020 pub const NATIVEBUFFER_COLOR_GAMUT_BT2020: OH_NativeBuffer_ColorGamut = OH_NativeBuffer_ColorGamut(7); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl OH_NativeBuffer_ColorGamut { ///< BT2100 PQ pub const NATIVEBUFFER_COLOR_GAMUT_BT2100_PQ: OH_NativeBuffer_ColorGamut = OH_NativeBuffer_ColorGamut(8); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl OH_NativeBuffer_ColorGamut { ///< BT2100 HLG pub const NATIVEBUFFER_COLOR_GAMUT_BT2100_HLG: OH_NativeBuffer_ColorGamut = OH_NativeBuffer_ColorGamut(9); } +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] impl OH_NativeBuffer_ColorGamut { ///< Display BT2020 pub const NATIVEBUFFER_COLOR_GAMUT_DISPLAY_BT2020: OH_NativeBuffer_ColorGamut = @@ -579,6 +673,8 @@ impl OH_NativeBuffer_ColorGamut { @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer @since 12 @version 1.0*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub struct OH_NativeBuffer_ColorGamut(pub ::core::ffi::c_uint); /** @brief OH_NativeBuffer config. \n @@ -606,6 +702,8 @@ pub struct OH_NativeBuffer_Config { @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer @since 12 @version 1.0*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct OH_NativeBuffer_Plane { @@ -621,6 +719,8 @@ pub struct OH_NativeBuffer_Plane { @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer @since 12 @version 1.0*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct OH_NativeBuffer_Planes { @@ -706,23 +806,13 @@ extern "C" { @return Returns an error code, 0 is sucess, otherwise, failed. @since 12 @version 1.0*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_NativeBuffer_MapPlanes( buffer: *mut OH_NativeBuffer, virAddr: *mut *mut ::core::ffi::c_void, outPlanes: *mut OH_NativeBuffer_Planes, ) -> i32; - /** @brief Converts an OHNativeWindowBuffer instance to an OH_NativeBuffer. - - @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer - @param nativeWindowBuffer Indicates the pointer to a OHNativeWindowBuffer instance. - @param buffer Indicates the pointer to a OH_NativeBuffer pointer. - @return Returns an error code, 0 is sucess, otherwise, failed. - @since 12 - @version 1.0*/ - pub fn OH_NativeBuffer_FromNativeWindowBuffer( - nativeWindowBuffer: *mut OHNativeWindowBuffer, - buffer: *mut *mut OH_NativeBuffer, - ) -> i32; /** @brief Set the color space of the OH_NativeBuffer. @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer @@ -731,6 +821,8 @@ extern "C" { @return Returns an error code, 0 is success, otherwise, failed. @since 11 @version 1.0*/ + #[cfg(feature = "api-11")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] pub fn OH_NativeBuffer_SetColorSpace( buffer: *mut OH_NativeBuffer, colorSpace: OH_NativeBuffer_ColorSpace, @@ -745,6 +837,8 @@ extern "C" { {@link NATIVE_ERROR_BUFFER_STATE_INVALID} 41207000 - Incorrect colorSpace state. @since 12 @version 1.0*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_NativeBuffer_GetColorSpace( buffer: *mut OH_NativeBuffer, colorSpace: *mut OH_NativeBuffer_ColorSpace, @@ -762,6 +856,8 @@ extern "C" { {@link NATIVE_ERROR_UNSUPPORTED} 50102000 - Unsupported metadata key. @since 12 @version 1.0*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_NativeBuffer_SetMetadataValue( buffer: *mut OH_NativeBuffer, metadataKey: OH_NativeBuffer_MetadataKey, @@ -781,6 +877,8 @@ extern "C" { {@link NATIVE_ERROR_UNSUPPORTED} 50102000 - Unsupported metadata key. @since 12 @version 1.0*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_NativeBuffer_GetMetadataValue( buffer: *mut OH_NativeBuffer, metadataKey: OH_NativeBuffer_MetadataKey, diff --git a/src/native_buffer/native_buffer_window_ffi.rs b/src/native_buffer/native_buffer_window_ffi.rs new file mode 100644 index 0000000..db3de52 --- /dev/null +++ b/src/native_buffer/native_buffer_window_ffi.rs @@ -0,0 +1,24 @@ +/* automatically generated by rust-bindgen 0.71.1 */ + +#![allow(non_upper_case_globals)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +use super::native_buffer_ffi::*; +use crate::native_window::OHNativeWindowBuffer; + +extern "C" { + /** @brief Converts an OHNativeWindowBuffer instance to an OH_NativeBuffer. + + @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer + @param nativeWindowBuffer Indicates the pointer to a OHNativeWindowBuffer instance. + @param buffer Indicates the pointer to a OH_NativeBuffer pointer. + @return Returns an error code, 0 is sucess, otherwise, failed. + @since 12 + @version 1.0*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] + pub fn OH_NativeBuffer_FromNativeWindowBuffer( + nativeWindowBuffer: *mut OHNativeWindowBuffer, + buffer: *mut *mut OH_NativeBuffer, + ) -> i32; +} diff --git a/src/native_image.rs b/src/native_image.rs index a10e83a..889d87e 100644 --- a/src/native_image.rs +++ b/src/native_image.rs @@ -17,20 +17,12 @@ #[link(name = "native_image")] extern "C" {} -mod native_image_api10; -pub use native_image_api10::*; +mod native_image_ffi; +pub use native_image_ffi::*; -#[cfg(feature = "api-11")] -#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] -mod api11_additions; -#[cfg(feature = "api-11")] -#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] -pub use api11_additions::*; - -#[cfg(feature = "api-12")] -#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] -mod api12_additions; - -#[cfg(feature = "api-12")] -#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] -pub use api12_additions::*; +#[cfg(feature = "native_window")] +#[cfg_attr(docsrs, doc(cfg(feature = "native_window")))] +mod native_image_window_ffi; +#[cfg(feature = "native_window")] +#[cfg_attr(docsrs, doc(cfg(feature = "native_window")))] +pub use native_image_window_ffi::*; diff --git a/src/native_image/api11_additions.rs b/src/native_image/api11_additions.rs deleted file mode 100644 index 6d67343..0000000 --- a/src/native_image/api11_additions.rs +++ /dev/null @@ -1,58 +0,0 @@ -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] - -use super::OH_NativeImage; - -/** @brief The callback function of frame available. - -@syscap SystemCapability.Graphic.Graphic2D.NativeImage -@param context User defined context, returned to the user in the callback function -@since 11 -@version 1.0*/ -pub type OH_OnFrameAvailable = - ::core::option::Option; -/** @brief A listener for native image, use OH_NativeImage_SetOnFrameAvailableListener to register \n -the listener object to OH_NativeImage, the callback will be triggered when there is available frame - -@since 11 -@version 1.0*/ -#[repr(C)] -#[derive(Debug)] -pub struct OH_OnFrameAvailableListener { - /// User defined context, returned to the user in the callback function - pub context: *mut ::core::ffi::c_void, - /// The callback function of frame available. - pub onFrameAvailable: OH_OnFrameAvailable, -} - -extern "C" { - /** @brief Return the native image's surface id. - - @syscap SystemCapability.Graphic.Graphic2D.NativeImage - @param image Indicates the pointer to a OH_NativeImage instance. - @param surfaceId Indicates the surface id. - @return Returns an error code, 0 is success, otherwise, failed. - @since 11 - @version 1.0*/ - pub fn OH_NativeImage_GetSurfaceId(image: *mut OH_NativeImage, surfaceId: *mut u64) -> i32; - /** @brief Set the frame available callback. - - @syscap SystemCapability.Graphic.Graphic2D.NativeImage - @param image Indicates the pointer to a OH_NativeImage instance. - @param listener Indicates the callback function. - @return Returns an error code, 0 is success, otherwise, failed. - @since 11 - @version 1.0*/ - pub fn OH_NativeImage_SetOnFrameAvailableListener( - image: *mut OH_NativeImage, - listener: OH_OnFrameAvailableListener, - ) -> i32; - /** @brief Unset the frame available callback. - - @syscap SystemCapability.Graphic.Graphic2D.NativeImage - @param image Indicates the pointer to a OH_NativeImage instance. - @return Returns an error code, 0 is success, otherwise, failed. - @since 11 - @version 1.0*/ - pub fn OH_NativeImage_UnsetOnFrameAvailableListener(image: *mut OH_NativeImage) -> i32; -} diff --git a/src/native_image/native_image_api10.rs b/src/native_image/native_image_api10.rs deleted file mode 100644 index 2f7eaeb..0000000 --- a/src/native_image/native_image_api10.rs +++ /dev/null @@ -1,84 +0,0 @@ -/* automatically generated by rust-bindgen 0.69.4 */ - -#![allow(non_upper_case_globals)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -use crate::native_window::OHNativeWindow; - -#[repr(C)] -pub struct OH_NativeImage { - _unused: [u8; 0], -} -extern "C" { - /** @brief Create a OH_NativeImage related to an Opengl ES texture and target. \n - - @syscap SystemCapability.Graphic.Graphic2D.NativeImage - @param textureId Indicates the id of the Opengl ES texture which the native image attached to. - @param textureTarget Indicates the Opengl ES target. - @return Returns the pointer to the OH_NativeImage instance created if the operation is successful, \n - returns NULL otherwise. - @since 9 - @version 1.0*/ - pub fn OH_NativeImage_Create(textureId: u32, textureTarget: u32) -> *mut OH_NativeImage; - /** @brief Acquire the OHNativeWindow for the OH_NativeImage. This OHNativeWindow should be released by \n - OH_NativeWindow_DestroyNativeWindow when no longer needed. - - @syscap SystemCapability.Graphic.Graphic2D.NativeImage - @param image Indicates the pointer to a OH_NativeImage instance. - @return Returns the pointer to the OHNativeWindow if the operation is successful, returns NULL otherwise. - @since 9 - @version 1.0*/ - pub fn OH_NativeImage_AcquireNativeWindow(image: *mut OH_NativeImage) -> *mut OHNativeWindow; - /** @brief Attach the OH_NativeImage to Opengl ES context, and the Opengl ES texture is bound to the \n - GL_TEXTURE_EXTERNAL_OES, which will update by the OH_NativeImage. - - @syscap SystemCapability.Graphic.Graphic2D.NativeImage - @param image Indicates the pointer to a OH_NativeImage instance. - @param textureId Indicates the id of the Opengl ES texture which the native image attached to. - @return Returns an error code, 0 is success, otherwise, failed. - @since 9 - @version 1.0*/ - pub fn OH_NativeImage_AttachContext(image: *mut OH_NativeImage, textureId: u32) -> i32; - /** @brief Detach the OH_NativeImage from the Opengl ES context. - - @syscap SystemCapability.Graphic.Graphic2D.NativeImage - @param image Indicates the pointer to a OH_NativeImage instance. - @return Returns an error code, 0 is success, otherwise, failed. - @since 9 - @version 1.0*/ - pub fn OH_NativeImage_DetachContext(image: *mut OH_NativeImage) -> i32; - /** @brief Update the related Opengl ES texture with the OH_NativeImage acquired buffer. - - @syscap SystemCapability.Graphic.Graphic2D.NativeImage - @param image Indicates the pointer to a OH_NativeImage instance. - @return Returns an error code, 0 is success, otherwise, failed. - @since 9 - @version 1.0*/ - pub fn OH_NativeImage_UpdateSurfaceImage(image: *mut OH_NativeImage) -> i32; - /** @brief Get the timestamp of the texture image set by the most recent call to OH_NativeImage_UpdateSurfaceImage. - - @syscap SystemCapability.Graphic.Graphic2D.NativeImage - @param image Indicates the pointer to a OH_NativeImage instance. - @return Returns the timestamp associated to the texture image. - @since 9 - @version 1.0*/ - pub fn OH_NativeImage_GetTimestamp(image: *mut OH_NativeImage) -> i64; - /** @brief Return the transform matrix of the texture image set by the most recent call to \n - OH_NativeImage_UpdateSurfaceImage. - - @syscap SystemCapability.Graphic.Graphic2D.NativeImage - @param image Indicates the pointer to a OH_NativeImage instance. - @param matrix Indicates the retrieved 4*4 transform matrix . - @return Returns an error code, 0 is success, otherwise, failed. - @since 9 - @version 1.0*/ - pub fn OH_NativeImage_GetTransformMatrix(image: *mut OH_NativeImage, matrix: *mut f32) -> i32; - /** @brief Destroy the OH_NativeImage created by OH_NativeImage_Create, and the pointer to \n - OH_NativeImage will be null after this operation. - - @syscap SystemCapability.Graphic.Graphic2D.NativeImage - @param image Indicates the pointer to a OH_NativeImage pointer. - @since 9 - @version 1.0*/ - pub fn OH_NativeImage_Destroy(image: *mut *mut OH_NativeImage); -} diff --git a/src/native_image/native_image_api12.rs b/src/native_image/native_image_api12.rs deleted file mode 100644 index 8ca2116..0000000 --- a/src/native_image/native_image_api12.rs +++ /dev/null @@ -1,200 +0,0 @@ -/* automatically generated by rust-bindgen 0.70.1 */ - -#![allow(non_upper_case_globals)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -use crate::native_window::OHNativeWindow; - -#[repr(C)] -pub struct OH_NativeImage { - _unused: [u8; 0], -} -/** @brief The callback function of frame available. - -@syscap SystemCapability.Graphic.Graphic2D.NativeImage -@param context User defined context, returned to the user in the callback function -@since 11 -@version 1.0*/ -pub type OH_OnFrameAvailable = - ::core::option::Option; -/** @brief A listener for native image, use OH_NativeImage_SetOnFrameAvailableListener to register \n -the listener object to OH_NativeImage, the callback will be triggered when there is available frame - -@since 11 -@version 1.0*/ -#[repr(C)] -#[derive(Debug)] -pub struct OH_OnFrameAvailableListener { - /// User defined context, returned to the user in the callback function - pub context: *mut ::core::ffi::c_void, - /// The callback function of frame available. - pub onFrameAvailable: OH_OnFrameAvailable, -} -extern "C" { - /** @brief Create a OH_NativeImage related to an Opengl ES texture and target. \n - - @syscap SystemCapability.Graphic.Graphic2D.NativeImage - @param textureId Indicates the id of the Opengl ES texture which the native image attached to. - @param textureTarget Indicates the Opengl ES target. - @return Returns the pointer to the OH_NativeImage instance created if the operation is successful, \n - returns NULL otherwise. - @since 9 - @version 1.0*/ - pub fn OH_NativeImage_Create(textureId: u32, textureTarget: u32) -> *mut OH_NativeImage; - /** @brief Acquire the OHNativeWindow for the OH_NativeImage. - - @syscap SystemCapability.Graphic.Graphic2D.NativeImage - @param image Indicates the pointer to a OH_NativeImage instance. - @return Returns the pointer to the OHNativeWindow if the operation is successful, returns NULL otherwise. - @since 9 - @version 1.0*/ - pub fn OH_NativeImage_AcquireNativeWindow(image: *mut OH_NativeImage) -> *mut OHNativeWindow; - /** @brief Attach the OH_NativeImage to Opengl ES context, and the Opengl ES texture is bound to the \n - GL_TEXTURE_EXTERNAL_OES, which will update by the OH_NativeImage. - - @syscap SystemCapability.Graphic.Graphic2D.NativeImage - @param image Indicates the pointer to a OH_NativeImage instance. - @param textureId Indicates the id of the Opengl ES texture which the native image attached to. - @return Returns an error code, 0 is success, otherwise, failed. - @since 9 - @version 1.0*/ - pub fn OH_NativeImage_AttachContext(image: *mut OH_NativeImage, textureId: u32) -> i32; - /** @brief Detach the OH_NativeImage from the Opengl ES context. - - @syscap SystemCapability.Graphic.Graphic2D.NativeImage - @param image Indicates the pointer to a OH_NativeImage instance. - @return Returns an error code, 0 is success, otherwise, failed. - @since 9 - @version 1.0*/ - pub fn OH_NativeImage_DetachContext(image: *mut OH_NativeImage) -> i32; - /** @brief Update the related Opengl ES texture with the OH_NativeImage acquired buffer. - - @syscap SystemCapability.Graphic.Graphic2D.NativeImage - @param image Indicates the pointer to a OH_NativeImage instance. - @return Returns an error code, 0 is success, otherwise, failed. - @since 9 - @version 1.0*/ - pub fn OH_NativeImage_UpdateSurfaceImage(image: *mut OH_NativeImage) -> i32; - /** @brief Get the timestamp of the texture image set by the most recent call to OH_NativeImage_UpdateSurfaceImage. - - @syscap SystemCapability.Graphic.Graphic2D.NativeImage - @param image Indicates the pointer to a OH_NativeImage instance. - @return Returns the timestamp associated to the texture image. - @since 9 - @version 1.0*/ - pub fn OH_NativeImage_GetTimestamp(image: *mut OH_NativeImage) -> i64; - /** @brief Return the transform matrix of the texture image set by the most recent call to \n - OH_NativeImage_UpdateSurfaceImage. - - @syscap SystemCapability.Graphic.Graphic2D.NativeImage - @param image Indicates the pointer to a OH_NativeImage instance. - @param matrix Indicates the retrieved 4*4 transform matrix . - @return Returns an error code, 0 is success, otherwise, failed. - @since 9 - @version 1.0 - @deprecated since 12 - @useinstead OH_NativeImage_GetTransformMatrixV2*/ - pub fn OH_NativeImage_GetTransformMatrix(image: *mut OH_NativeImage, matrix: *mut f32) -> i32; - /** @brief Return the native image's surface id. - - @syscap SystemCapability.Graphic.Graphic2D.NativeImage - @param image Indicates the pointer to a OH_NativeImage instance. - @param surfaceId Indicates the surface id. - @return Returns an error code, 0 is success, otherwise, failed. - @since 11 - @version 1.0*/ - pub fn OH_NativeImage_GetSurfaceId(image: *mut OH_NativeImage, surfaceId: *mut u64) -> i32; - /** @brief Set the frame available callback. - - @syscap SystemCapability.Graphic.Graphic2D.NativeImage - @param image Indicates the pointer to a OH_NativeImage instance. - @param listener Indicates the callback function. - @return Returns an error code, 0 is success, otherwise, failed. - @since 11 - @version 1.0*/ - pub fn OH_NativeImage_SetOnFrameAvailableListener( - image: *mut OH_NativeImage, - listener: OH_OnFrameAvailableListener, - ) -> i32; - /** @brief Unset the frame available callback. - - @syscap SystemCapability.Graphic.Graphic2D.NativeImage - @param image Indicates the pointer to a OH_NativeImage instance. - @return Returns an error code, 0 is success, otherwise, failed. - @since 11 - @version 1.0*/ - pub fn OH_NativeImage_UnsetOnFrameAvailableListener(image: *mut OH_NativeImage) -> i32; - /** @brief Destroy the OH_NativeImage created by OH_NativeImage_Create, and the pointer to \n - OH_NativeImage will be null after this operation. - - @syscap SystemCapability.Graphic.Graphic2D.NativeImage - @param image Indicates the pointer to a OH_NativeImage pointer. - @since 9 - @version 1.0*/ - pub fn OH_NativeImage_Destroy(image: *mut *mut OH_NativeImage); - /** @brief Obtains the transform matrix of the texture image by producer transform type.\n - - @syscap SystemCapability.Graphic.Graphic2D.NativeImage - @param image Indicates the pointer to a OH_NativeImage instance. - @param matrix Indicates the retrieved 4*4 transform matrix . - @return 0 - Success. - 40001000 - image is NULL. - @since 12 - @version 1.0*/ - pub fn OH_NativeImage_GetTransformMatrixV2(image: *mut OH_NativeImage, matrix: *mut f32) - -> i32; - /** @brief Acquire an OHNativeWindowBuffer through an OH_NativeImage instance for content consumer.\n - This method can not be used at the same time with OH_NativeImage_UpdateSurfaceImage.\n - This method will create an OHNativeWindowBuffer.\n - When using OHNativeWindowBuffer, need to increase its reference count - by OH_NativeWindow_NativeObjectReference.\n - When the OHNativeWindowBuffer is used up, its reference count needs to be decremented - by OH_NativeWindow_NativeObjectUnreference.\n - This interface needs to be used in conjunction with OH_NativeImage_ReleaseNativeWindowBuffer<\b>, - otherwise memory leaks will occur.\n - When the fenceFd is used up, you need to close it.\n - - @syscap SystemCapability.Graphic.Graphic2D.NativeImage - @param image Indicates the pointer to a OH_NativeImage instance. - @param nativeWindowBuffer Indicates the pointer to an OHNativeWindowBuffer point. - @param fenceFd Indicates the pointer to a file descriptor handle. - @return {@link NATIVE_ERROR_OK} 0 - Success. - {@link NATIVE_ERROR_INVALID_ARGUMENTS} 40001000 - image, nativeWindowBuffer, fenceFd is NULL. - {@link NATIVE_ERROR_NO_BUFFER} 40601000 - No buffer for consume. - @since 12 - @version 1.0*/ - pub fn OH_NativeImage_AcquireNativeWindowBuffer( - image: *mut OH_NativeImage, - nativeWindowBuffer: *mut *mut OHNativeWindowBuffer, - fenceFd: *mut ::core::ffi::c_int, - ) -> i32; - /** @brief Release the OHNativeWindowBuffer to the buffer queue through an - OH_NativeImage instance for reuse.\n - The fenceFd will be close by system.\n - - @syscap SystemCapability.Graphic.Graphic2D.NativeImage - @param image Indicates the pointer to a OH_NativeImage instance. - @param nativeWindowBuffer Indicates the pointer to an OHNativeWindowBuffer instance. - @param fenceFd Indicates a file descriptor handle, which is used for timing synchronization. - @return {@link NATIVE_ERROR_OK} 0 - Success. - {@link NATIVE_ERROR_INVALID_ARGUMENTS} 40001000 - image, nativeWindowBuffer is NULL. - {@link NATIVE_ERROR_BUFFER_STATE_INVALID} 41207000 - nativeWindowBuffer state invalid. - {@link NATIVE_ERROR_BUFFER_NOT_IN_CACHE} 41210000 - nativeWindowBuffer not in cache. - @since 12 - @version 1.0*/ - pub fn OH_NativeImage_ReleaseNativeWindowBuffer( - image: *mut OH_NativeImage, - nativeWindowBuffer: *mut OHNativeWindowBuffer, - fenceFd: ::core::ffi::c_int, - ) -> i32; - /** @brief Create a OH_NativeImage as a consumerSurface. \n - This method can not be used at the same time with OH_NativeImage_UpdateSurfaceImage.\n - This interface needs to be used in conjunction with OH_NativeImage_Destroy<\b>, - otherwise memory leaks will occur.\n - @syscap SystemCapability.Graphic.Graphic2D.NativeImage - @return Returns the pointer to the OH_NativeImage instance created if the operation is successful, \n - returns NULL otherwise. - @since 12 - @version 1.0*/ - pub fn OH_ConsumerSurface_Create() -> *mut OH_NativeImage; -} diff --git a/src/native_image/native_image_api11.rs b/src/native_image/native_image_ffi.rs similarity index 77% rename from src/native_image/native_image_api11.rs rename to src/native_image/native_image_ffi.rs index 92ef158..a6fce6a 100644 --- a/src/native_image/native_image_api11.rs +++ b/src/native_image/native_image_ffi.rs @@ -1,9 +1,8 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.71.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -use crate::native_window::OHNativeWindow; #[repr(C)] pub struct OH_NativeImage { @@ -15,6 +14,8 @@ pub struct OH_NativeImage { @param context User defined context, returned to the user in the callback function @since 11 @version 1.0*/ +#[cfg(feature = "api-11")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] pub type OH_OnFrameAvailable = ::core::option::Option; /** @brief A listener for native image, use OH_NativeImage_SetOnFrameAvailableListener to register \n @@ -22,6 +23,8 @@ the listener object to OH_NativeImage, the callback will be triggered whe @since 11 @version 1.0*/ +#[cfg(feature = "api-11")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] #[repr(C)] #[derive(Debug)] pub struct OH_OnFrameAvailableListener { @@ -41,15 +44,6 @@ extern "C" { @since 9 @version 1.0*/ pub fn OH_NativeImage_Create(textureId: u32, textureTarget: u32) -> *mut OH_NativeImage; - /** @brief Acquire the OHNativeWindow for the OH_NativeImage. This OHNativeWindow should be released by \n - OH_NativeWindow_DestroyNativeWindow when no longer needed. - - @syscap SystemCapability.Graphic.Graphic2D.NativeImage - @param image Indicates the pointer to a OH_NativeImage instance. - @return Returns the pointer to the OHNativeWindow if the operation is successful, returns NULL otherwise. - @since 9 - @version 1.0*/ - pub fn OH_NativeImage_AcquireNativeWindow(image: *mut OH_NativeImage) -> *mut OHNativeWindow; /** @brief Attach the OH_NativeImage to Opengl ES context, and the Opengl ES texture is bound to the \n GL_TEXTURE_EXTERNAL_OES, which will update by the OH_NativeImage. @@ -92,7 +86,10 @@ extern "C" { @param matrix Indicates the retrieved 4*4 transform matrix . @return Returns an error code, 0 is success, otherwise, failed. @since 9 - @version 1.0*/ + @version 1.0 + @deprecated since 12 + @useinstead OH_NativeImage_GetTransformMatrixV2*/ + #[deprecated(since = "12")] pub fn OH_NativeImage_GetTransformMatrix(image: *mut OH_NativeImage, matrix: *mut f32) -> i32; /** @brief Return the native image's surface id. @@ -102,6 +99,8 @@ extern "C" { @return Returns an error code, 0 is success, otherwise, failed. @since 11 @version 1.0*/ + #[cfg(feature = "api-11")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] pub fn OH_NativeImage_GetSurfaceId(image: *mut OH_NativeImage, surfaceId: *mut u64) -> i32; /** @brief Set the frame available callback. @@ -111,6 +110,8 @@ extern "C" { @return Returns an error code, 0 is success, otherwise, failed. @since 11 @version 1.0*/ + #[cfg(feature = "api-11")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] pub fn OH_NativeImage_SetOnFrameAvailableListener( image: *mut OH_NativeImage, listener: OH_OnFrameAvailableListener, @@ -122,6 +123,8 @@ extern "C" { @return Returns an error code, 0 is success, otherwise, failed. @since 11 @version 1.0*/ + #[cfg(feature = "api-11")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] pub fn OH_NativeImage_UnsetOnFrameAvailableListener(image: *mut OH_NativeImage) -> i32; /** @brief Destroy the OH_NativeImage created by OH_NativeImage_Create, and the pointer to \n OH_NativeImage will be null after this operation. @@ -131,4 +134,29 @@ extern "C" { @since 9 @version 1.0*/ pub fn OH_NativeImage_Destroy(image: *mut *mut OH_NativeImage); + /** @brief Obtains the transform matrix of the texture image by producer transform type.\n + + @syscap SystemCapability.Graphic.Graphic2D.NativeImage + @param image Indicates the pointer to a OH_NativeImage instance. + @param matrix Indicates the retrieved 4*4 transform matrix . + @return 0 - Success. + 40001000 - image is NULL. + @since 12 + @version 1.0*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] + pub fn OH_NativeImage_GetTransformMatrixV2(image: *mut OH_NativeImage, matrix: *mut f32) + -> i32; + /** @brief Create a OH_NativeImage as a consumerSurface. \n + This method can not be used at the same time with OH_NativeImage_UpdateSurfaceImage.\n + This interface needs to be used in conjunction with OH_NativeImage_Destroy<\b>, + otherwise memory leaks will occur.\n + @syscap SystemCapability.Graphic.Graphic2D.NativeImage + @return Returns the pointer to the OH_NativeImage instance created if the operation is successful, \n + returns NULL otherwise. + @since 12 + @version 1.0*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] + pub fn OH_ConsumerSurface_Create() -> *mut OH_NativeImage; } diff --git a/src/native_image/api12_additions.rs b/src/native_image/native_image_window_ffi.rs similarity index 73% rename from src/native_image/api12_additions.rs rename to src/native_image/native_image_window_ffi.rs index e1862a6..52c3fef 100644 --- a/src/native_image/api12_additions.rs +++ b/src/native_image/native_image_window_ffi.rs @@ -1,26 +1,21 @@ +/* automatically generated by rust-bindgen 0.71.1 */ + +#![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] - -use super::OH_NativeImage; -#[cfg(feature = "native_window")] +use super::native_image_ffi::*; +use crate::native_window::OHNativeWindow; use crate::native_window::OHNativeWindowBuffer; extern "C" { - /** @brief Obtains the transform matrix of the texture image by producer transform type.\n + /** @brief Acquire the OHNativeWindow for the OH_NativeImage. @syscap SystemCapability.Graphic.Graphic2D.NativeImage @param image Indicates the pointer to a OH_NativeImage instance. - @param matrix Indicates the retrieved 4*4 transform matrix . - @return 0 - Success. - 40001000 - image is NULL. - @since 12 + @return Returns the pointer to the OHNativeWindow if the operation is successful, returns NULL otherwise. + @since 9 @version 1.0*/ - pub fn OH_NativeImage_GetTransformMatrixV2(image: *mut OH_NativeImage, matrix: *mut f32) - -> i32; -} - -#[cfg(feature = "native_window")] -extern "C" { + pub fn OH_NativeImage_AcquireNativeWindow(image: *mut OH_NativeImage) -> *mut OHNativeWindow; /** @brief Acquire an OHNativeWindowBuffer through an OH_NativeImage instance for content consumer.\n This method can not be used at the same time with OH_NativeImage_UpdateSurfaceImage.\n This method will create an OHNativeWindowBuffer.\n @@ -41,6 +36,8 @@ extern "C" { {@link NATIVE_ERROR_NO_BUFFER} 40601000 - No buffer for consume. @since 12 @version 1.0*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_NativeImage_AcquireNativeWindowBuffer( image: *mut OH_NativeImage, nativeWindowBuffer: *mut *mut OHNativeWindowBuffer, @@ -60,19 +57,11 @@ extern "C" { {@link NATIVE_ERROR_BUFFER_NOT_IN_CACHE} 41210000 - nativeWindowBuffer not in cache. @since 12 @version 1.0*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_NativeImage_ReleaseNativeWindowBuffer( image: *mut OH_NativeImage, nativeWindowBuffer: *mut OHNativeWindowBuffer, fenceFd: ::core::ffi::c_int, ) -> i32; - /** @brief Create a OH_NativeImage as a consumerSurface. \n - This method can not be used at the same time with OH_NativeImage_UpdateSurfaceImage.\n - This interface needs to be used in conjunction with OH_NativeImage_Destroy<\b>, - otherwise memory leaks will occur.\n - @syscap SystemCapability.Graphic.Graphic2D.NativeImage - @return Returns the pointer to the OH_NativeImage instance created if the operation is successful, \n - returns NULL otherwise. - @since 12 - @version 1.0*/ - pub fn OH_ConsumerSurface_Create() -> *mut OH_NativeImage; } diff --git a/src/native_window.rs b/src/native_window.rs index a33331b..b84d45a 100644 --- a/src/native_window.rs +++ b/src/native_window.rs @@ -16,15 +16,5 @@ #[link(name = "native_window")] extern "C" {} -mod native_window_api10; -pub use native_window_api10::*; - -mod native_window_api10_fixup; -pub use native_window_api10_fixup::NativeWindowOperation; - -#[cfg(feature = "api-11")] -#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] -mod api11_additions; -#[cfg(feature = "api-11")] -#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] -pub use api11_additions::*; +mod native_window_ffi; +pub use native_window_ffi::*; diff --git a/src/native_window/api11_additions.rs b/src/native_window/api11_additions.rs deleted file mode 100644 index 1674fae..0000000 --- a/src/native_window/api11_additions.rs +++ /dev/null @@ -1,46 +0,0 @@ -#![allow(non_upper_case_globals)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] - -use super::{OHNativeWindow, OHNativeWindowBuffer}; -#[cfg(feature = "native_buffer")] -use crate::native_buffer::OH_NativeBuffer; - -#[cfg(not(feature = "native_buffer"))] -#[repr(C)] -pub struct OH_NativeBuffer { - _unused: [u8; 0], -} - -extern "C" { - /** @brief Creates a OHNativeWindowBuffer instance. - A new OHNativeWindowBuffer instance is created each time this function is called. - - @syscap SystemCapability.Graphic.Graphic2D.NativeWindow - @param nativeBuffer Indicates the pointer to a native buffer. The type is OH_NativeBuffer*. - @return Returns the pointer to the OHNativeWindowBuffer instance created. - @since 11 - @version 1.0*/ - pub fn OH_NativeWindow_CreateNativeWindowBufferFromNativeBuffer( - nativeBuffer: *mut OH_NativeBuffer, - ) -> *mut OHNativeWindowBuffer; -} - -extern "C" { - /** @brief Get the last flushed OHNativeWindowBuffer from a OHNativeWindow instance. - - @syscap SystemCapability.Graphic.Graphic2D.NativeWindow - @param window Indicates the pointer to a OHNativeWindow instance. - @param buffer Indicates the pointer to a OHNativeWindowBuffer pointer. - @param fenceFd Indicates the pointer to a file descriptor handle. - @param matrix Indicates the retrieved 4*4 transform matrix. - @return Returns an error code, 0 is success, otherwise, failed. - @since 11 - @version 1.0*/ - pub fn OH_NativeWindow_GetLastFlushedBuffer( - window: *mut OHNativeWindow, - buffer: *mut *mut OHNativeWindowBuffer, - fenceFd: *mut ::core::ffi::c_int, - matrix: *mut f32, - ) -> i32; -} diff --git a/src/native_window/native_window_api10.rs b/src/native_window/native_window_api10.rs deleted file mode 100644 index 37a3fcc..0000000 --- a/src/native_window/native_window_api10.rs +++ /dev/null @@ -1,385 +0,0 @@ -/* automatically generated by rust-bindgen 0.69.4 */ - -#![allow(non_upper_case_globals)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] - -#[repr(C)] -#[derive(Default)] -pub struct __IncompleteArrayField(::core::marker::PhantomData, [T; 0]); -impl __IncompleteArrayField { - #[inline] - pub const fn new() -> Self { - __IncompleteArrayField(::core::marker::PhantomData, []) - } - #[inline] - pub fn as_ptr(&self) -> *const T { - self as *const _ as *const T - } - #[inline] - pub fn as_mut_ptr(&mut self) -> *mut T { - self as *mut _ as *mut T - } - #[inline] - pub unsafe fn as_slice(&self, len: usize) -> &[T] { - ::core::slice::from_raw_parts(self.as_ptr(), len) - } - #[inline] - pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { - ::core::slice::from_raw_parts_mut(self.as_mut_ptr(), len) - } -} -impl ::core::fmt::Debug for __IncompleteArrayField { - fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - fmt.write_str("__IncompleteArrayField") - } -} -#[repr(C)] -#[derive(Debug)] -pub struct BufferHandle { - ///< buffer fd, -1 if not supported - pub fd: i32, - ///< the width of memory - pub width: i32, - ///< the stride of memory - pub stride: i32, - ///< the height of memory - pub height: i32, - pub size: i32, - ///< the format of memory - pub format: i32, - ///< the usage of memory - pub usage: u64, - ///< Virtual address of memory - pub virAddr: *mut ::core::ffi::c_void, - ///< Shared memory key - pub key: i32, - ///< Physical address - pub phyAddr: u64, - ///< the number of reserved fd value - pub reserveFds: u32, - ///< the number of reserved integer value - pub reserveInts: u32, - ///< the data - pub reserve: __IncompleteArrayField, -} -/** @brief native window. -@since 8*/ -#[repr(C)] -#[derive(Debug)] -pub struct NativeWindow { - _unused: [u8; 0], -} -/** @brief native window buffer. -@since 8*/ -#[repr(C)] -#[derive(Debug)] -pub struct NativeWindowBuffer { - _unused: [u8; 0], -} -/** @brief define the new type name OHNativeWindow for struct NativeWindow. -@since 8*/ -pub type OHNativeWindow = NativeWindow; -/** @brief define the new type name OHNativeWindowBuffer for struct NativeWindowBuffer. -@since 8*/ -pub type OHNativeWindowBuffer = NativeWindowBuffer; -/** @brief indicates a dirty region where content is updated. -@since 8*/ -#[repr(C)] -#[derive(Debug)] -pub struct Region { - pub rects: *mut Region_Rect, - /// if rectNumber is 0, fill the Buffer dirty size by default - pub rectNumber: i32, -} -/// if rects is nullptr, fill the Buffer dirty size by default -#[repr(C)] -#[derive(Debug)] -pub struct Region_Rect { - pub x: i32, - pub y: i32, - pub w: u32, - pub h: u32, -} -impl OHScalingMode { - /** the window content is not updated until a buffer of - the window size is received*/ - pub const OH_SCALING_MODE_FREEZE: OHScalingMode = OHScalingMode(0); -} -impl OHScalingMode { - /// the buffer is scaled in two dimensions to match the window size - pub const OH_SCALING_MODE_SCALE_TO_WINDOW: OHScalingMode = OHScalingMode(1); -} -impl OHScalingMode { - /** the buffer is uniformly scaled so that the smaller size of - the buffer matches the window size*/ - pub const OH_SCALING_MODE_SCALE_CROP: OHScalingMode = OHScalingMode(2); -} -impl OHScalingMode { - /** the window is clipped to the size of the buffer's clipping rectangle - pixels outside the clipping rectangle are considered fully transparent.*/ - pub const OH_SCALING_MODE_NO_SCALE_CROP: OHScalingMode = OHScalingMode(3); -} -#[repr(transparent)] -/** @brief Indicates Scaling Mode. -@since 9 -@deprecated(since = "10")*/ -#[derive(Debug, Clone, Hash, PartialEq, Eq)] -pub struct OHScalingMode(pub ::core::ffi::c_uint); -impl OHHDRMetadataKey { - pub const OH_METAKEY_RED_PRIMARY_X: OHHDRMetadataKey = OHHDRMetadataKey(0); -} -impl OHHDRMetadataKey { - pub const OH_METAKEY_RED_PRIMARY_Y: OHHDRMetadataKey = OHHDRMetadataKey(1); -} -impl OHHDRMetadataKey { - pub const OH_METAKEY_GREEN_PRIMARY_X: OHHDRMetadataKey = OHHDRMetadataKey(2); -} -impl OHHDRMetadataKey { - pub const OH_METAKEY_GREEN_PRIMARY_Y: OHHDRMetadataKey = OHHDRMetadataKey(3); -} -impl OHHDRMetadataKey { - pub const OH_METAKEY_BLUE_PRIMARY_X: OHHDRMetadataKey = OHHDRMetadataKey(4); -} -impl OHHDRMetadataKey { - pub const OH_METAKEY_BLUE_PRIMARY_Y: OHHDRMetadataKey = OHHDRMetadataKey(5); -} -impl OHHDRMetadataKey { - pub const OH_METAKEY_WHITE_PRIMARY_X: OHHDRMetadataKey = OHHDRMetadataKey(6); -} -impl OHHDRMetadataKey { - pub const OH_METAKEY_WHITE_PRIMARY_Y: OHHDRMetadataKey = OHHDRMetadataKey(7); -} -impl OHHDRMetadataKey { - pub const OH_METAKEY_MAX_LUMINANCE: OHHDRMetadataKey = OHHDRMetadataKey(8); -} -impl OHHDRMetadataKey { - pub const OH_METAKEY_MIN_LUMINANCE: OHHDRMetadataKey = OHHDRMetadataKey(9); -} -impl OHHDRMetadataKey { - pub const OH_METAKEY_MAX_CONTENT_LIGHT_LEVEL: OHHDRMetadataKey = OHHDRMetadataKey(10); -} -impl OHHDRMetadataKey { - pub const OH_METAKEY_MAX_FRAME_AVERAGE_LIGHT_LEVEL: OHHDRMetadataKey = OHHDRMetadataKey(11); -} -impl OHHDRMetadataKey { - pub const OH_METAKEY_HDR10_PLUS: OHHDRMetadataKey = OHHDRMetadataKey(12); -} -impl OHHDRMetadataKey { - pub const OH_METAKEY_HDR_VIVID: OHHDRMetadataKey = OHHDRMetadataKey(13); -} -#[repr(transparent)] -/** @brief Enumerates the HDR metadata keys. -@since 9 -@deprecated(since = "10")*/ -#[derive(Debug, Clone, Hash, PartialEq, Eq)] -pub struct OHHDRMetadataKey(pub ::core::ffi::c_uint); -/** @brief Defines the HDR metadata. -@since 9 -@deprecated(since = "10")*/ -#[repr(C)] -#[derive(Debug)] -pub struct OHHDRMetaData { - pub key: OHHDRMetadataKey, - pub value: f32, -} -/** @brief Defines the ExtData Handle -@since 9 -@deprecated(since = "10")*/ -#[repr(C)] -#[derive(Debug)] -pub struct OHExtDataHandle { - pub fd: i32, - pub reserveInts: u32, - pub reserve: __IncompleteArrayField, -} -extern "C" { - /** @brief Creates a OHNativeWindow instance. A new OHNativeWindow instance is created each time this function is called. - - @syscap SystemCapability.Graphic.Graphic2D.NativeWindow - @param pSurface Indicates the pointer to a ProduceSurface. The type is a pointer to sptr. - @return Returns the pointer to the OHNativeWindow instance created. - @since 8 - @version 1.0*/ - pub fn OH_NativeWindow_CreateNativeWindow( - pSurface: *mut ::core::ffi::c_void, - ) -> *mut OHNativeWindow; - /** @brief Decreases the reference count of a OHNativeWindow instance by 1, and when the reference count reaches 0, destroys the instance. - - @syscap SystemCapability.Graphic.Graphic2D.NativeWindow - @param window Indicates the pointer to a OHNativeWindow instance. - @since 8 - @version 1.0*/ - pub fn OH_NativeWindow_DestroyNativeWindow(window: *mut OHNativeWindow); - /** @brief Creates a OHNativeWindowBuffer instance. A new OHNativeWindowBuffer instance is created each time this function is called. - - @syscap SystemCapability.Graphic.Graphic2D.NativeWindow - @param pSurfaceBuffer Indicates the pointer to a produce buffer. The type is sptr. - @return Returns the pointer to the OHNativeWindowBuffer instance created. - @since 8 - @version 1.0*/ - pub fn OH_NativeWindow_CreateNativeWindowBufferFromSurfaceBuffer( - pSurfaceBuffer: *mut ::core::ffi::c_void, - ) -> *mut OHNativeWindowBuffer; - /** @brief Decreases the reference count of a OHNativeWindowBuffer instance by 1 and, when the reference count reaches 0, destroys the instance. - - @syscap SystemCapability.Graphic.Graphic2D.NativeWindow - @param buffer Indicates the pointer to a OHNativeWindowBuffer instance. - @since 8 - @version 1.0*/ - pub fn OH_NativeWindow_DestroyNativeWindowBuffer(buffer: *mut OHNativeWindowBuffer); - /** @brief Requests a OHNativeWindowBuffer through a OHNativeWindow instance for content production. - - @syscap SystemCapability.Graphic.Graphic2D.NativeWindow - @param window Indicates the pointer to a OHNativeWindow instance. - @param buffer Indicates the double pointer to a OHNativeWindowBuffer instance. - @param fenceFd Indicates the pointer to a file descriptor handle. - @return Returns an error code, 0 is success, otherwise, failed. - @since 8 - @version 1.0*/ - pub fn OH_NativeWindow_NativeWindowRequestBuffer( - window: *mut OHNativeWindow, - buffer: *mut *mut OHNativeWindowBuffer, - fenceFd: *mut ::core::ffi::c_int, - ) -> i32; - /** @brief Flushes the OHNativeWindowBuffer filled with the content to the buffer queue through a OHNativeWindow instance for content consumption. - - @syscap SystemCapability.Graphic.Graphic2D.NativeWindow - @param window Indicates the pointer to a OHNativeWindow instance. - @param buffer Indicates the pointer to a OHNativeWindowBuffer instance. - @param fenceFd Indicates a file descriptor handle, which is used for timing synchronization. - @param region Indicates a dirty region where content is updated. - @return Returns an error code, 0 is success, otherwise, failed. - @since 8 - @version 1.0*/ - pub fn OH_NativeWindow_NativeWindowFlushBuffer( - window: *mut OHNativeWindow, - buffer: *mut OHNativeWindowBuffer, - fenceFd: ::core::ffi::c_int, - region: Region, - ) -> i32; - /** @brief Returns the OHNativeWindowBuffer to the buffer queue through a OHNativeWindow instance, without filling in any content. The OHNativeWindowBuffer can be used for another request. - - @syscap SystemCapability.Graphic.Graphic2D.NativeWindow - @param window Indicates the pointer to a OHNativeWindow instance. - @param buffer Indicates the pointer to a OHNativeWindowBuffer instance. - @return Returns an error code, 0 is success, otherwise, failed. - @since 8 - @version 1.0*/ - pub fn OH_NativeWindow_NativeWindowAbortBuffer( - window: *mut OHNativeWindow, - buffer: *mut OHNativeWindowBuffer, - ) -> i32; - /** @brief Sets or obtains the attributes of a native window, including the width, height, and content format. - - @syscap SystemCapability.Graphic.Graphic2D.NativeWindow - @param window Indicates the pointer to a OHNativeWindow instance. - @param code Indicates the operation code, pointer to NativeWindowOperation. - @param ... variable parameter, must correspond to code one-to-one. - @return Returns an error code, 0 is success, otherwise, failed. - @since 8 - @version 1.0*/ - pub fn OH_NativeWindow_NativeWindowHandleOpt( - window: *mut OHNativeWindow, - code: ::core::ffi::c_int, - ... - ) -> i32; - /** @brief Obtains the pointer to a BufferHandle of a OHNativeWindowBuffer instance. - - @syscap SystemCapability.Graphic.Graphic2D.NativeWindow - @param buffer Indicates the pointer to a OHNativeWindowBuffer instance. - @return Returns the pointer to the BufferHandle instance obtained. - @since 8 - @version 1.0*/ - pub fn OH_NativeWindow_GetBufferHandleFromNative( - buffer: *mut OHNativeWindowBuffer, - ) -> *mut BufferHandle; - /** @brief Adds the reference count of a native object. - - @syscap SystemCapability.Graphic.Graphic2D.NativeWindow - @param obj Indicates the pointer to a OHNativeWindow or OHNativeWindowBuffer instance. - @return Returns an error code, 0 is success, otherwise, failed. - @since 8 - @version 1.0*/ - pub fn OH_NativeWindow_NativeObjectReference(obj: *mut ::core::ffi::c_void) -> i32; - /** @brief Decreases the reference count of a native object and, when the reference count reaches 0, destroys this object. - - @syscap SystemCapability.Graphic.Graphic2D.NativeWindow - @param obj Indicates the pointer to a OHNativeWindow or OHNativeWindowBuffer instance. - @return Returns an error code, 0 is success, otherwise, failed. - @since 8 - @version 1.0*/ - pub fn OH_NativeWindow_NativeObjectUnreference(obj: *mut ::core::ffi::c_void) -> i32; - /** @brief Obtains the magic ID of a native object. - - @syscap SystemCapability.Graphic.Graphic2D.NativeWindow - @param obj Indicates the pointer to a OHNativeWindow or OHNativeWindowBuffer instance. - @return Returns the magic ID, which is unique for each native object. - @since 8 - @version 1.0*/ - pub fn OH_NativeWindow_GetNativeObjectMagic(obj: *mut ::core::ffi::c_void) -> i32; - /** @brief Sets scalingMode of a native window. - - @syscap SystemCapability.Graphic.Graphic2D.NativeWindow - @param window Indicates the pointer to a OHNativeWindow instance. - @param sequence Indicates the sequence to a produce buffer. - @param scalingMode Indicates the enum value to OHScalingMode - @return Returns an error code, 0 is success, otherwise, failed. - @since 9 - @version 1.0 - @deprecated(since = "10")*/ - pub fn OH_NativeWindow_NativeWindowSetScalingMode( - window: *mut OHNativeWindow, - sequence: u32, - scalingMode: OHScalingMode, - ) -> i32; - /** @brief Sets metaData of a native window. - - @syscap SystemCapability.Graphic.Graphic2D.NativeWindow - @param window Indicates the pointer to a OHNativeWindow instance. - @param sequence Indicates the sequence to a produce buffer. - @param size Indicates the size of a OHHDRMetaData vector. - @param metaDate Indicates the pointer to a OHHDRMetaData vector. - @return Returns an error code, 0 is success, otherwise, failed. - @since 9 - @version 1.0 - @deprecated(since = "10")*/ - pub fn OH_NativeWindow_NativeWindowSetMetaData( - window: *mut OHNativeWindow, - sequence: u32, - size: i32, - metaData: *const OHHDRMetaData, - ) -> i32; - /** @brief Sets metaDataSet of a native window. - - @syscap SystemCapability.Graphic.Graphic2D.NativeWindow - @param window Indicates the pointer to a OHNativeWindow instance. - @param sequence Indicates the sequence to a produce buffer. - @param key Indicates the enum value to OHHDRMetadataKey - @param size Indicates the size of a uint8_t vector. - @param metaDate Indicates the pointer to a uint8_t vector. - @return Returns an error code, 0 is success, otherwise, failed. - @since 9 - @version 1.0 - @deprecated(since = "10")*/ - pub fn OH_NativeWindow_NativeWindowSetMetaDataSet( - window: *mut OHNativeWindow, - sequence: u32, - key: OHHDRMetadataKey, - size: i32, - metaData: *const u8, - ) -> i32; - /** @brief Sets tunnel handle of a native window. - - @syscap SystemCapability.Graphic.Graphic2D.NativeWindow - @param window Indicates the pointer to a OHNativeWindow instance. - @param handle Indicates the pointer to a OHExtDataHandle. - @return Returns an error code, 0 is success, otherwise, failed. - @since 9 - @version 1.0 - @deprecated(since = "10")*/ - pub fn OH_NativeWindow_NativeWindowSetTunnelHandle( - window: *mut OHNativeWindow, - handle: *const OHExtDataHandle, - ) -> i32; -} diff --git a/src/native_window/native_window_api10_fixup.rs b/src/native_window/native_window_api10_fixup.rs deleted file mode 100644 index e9f5380..0000000 --- a/src/native_window/native_window_api10_fixup.rs +++ /dev/null @@ -1,78 +0,0 @@ -//! Contains manual bindings -#![allow(non_snake_case)] - -/// Indicates the operation code in the function [`OH_NativeWindow_NativeWindowHandleOpt`]. -/// -/// @since 8 -pub mod NativeWindowOperation { - - pub type Type = ::core::ffi::c_uint; - /** set native window buffer geometry, - variable parameter in function is - [in] int32_t width, [in] int32_t height*/ - pub const SET_BUFFER_GEOMETRY: Type = 0; - /** get native window buffer geometry, - variable parameter in function is - [out] int32_t *height, [out] int32_t *width*/ - pub const GET_BUFFER_GEOMETRY: Type = 1; - /** get native window buffer format, - variable parameter in function is - [out] int32_t *format*/ - pub const GET_FORMAT: Type = 2; - /** set native window buffer format, - variable parameter in function is - [in] int32_t format*/ - pub const SET_FORMAT: Type = 3; - /** get native window buffer usage, - variable parameter in function is - [out] int32_t *usage.*/ - pub const GET_USAGE: Type = 4; - /** set native window buffer usage, - variable parameter in function is - [in] int32_t usage.*/ - pub const SET_USAGE: Type = 5; - /** set native window buffer stride, - variable parameter in function is - [in] int32_t stride.*/ - pub const SET_STRIDE: Type = 6; - /** get native window buffer stride, - variable parameter in function is - [out] int32_t *stride.*/ - pub const GET_STRIDE: Type = 7; - /** set native window buffer swap interval, - variable parameter in function is - [in] int32_t interval.*/ - pub const SET_SWAP_INTERVAL: Type = 8; - /** get native window buffer swap interval, - variable parameter in function is - [out] int32_t *interval.*/ - pub const GET_SWAP_INTERVAL: Type = 9; - /** set native window buffer timeout, - variable parameter in function is - [in] int32_t timeout.*/ - pub const SET_TIMEOUT: Type = 10; - /** get native window buffer timeout, - variable parameter in function is - [out] int32_t *timeout.*/ - pub const GET_TIMEOUT: Type = 11; - /** set native window buffer colorGamut, - variable parameter in function is - [in] int32_t colorGamut.*/ - pub const SET_COLOR_GAMUT: Type = 12; - /** get native window buffer colorGamut, - variable parameter in function is - [out int32_t *colorGamut].*/ - pub const GET_COLOR_GAMUT: Type = 13; - /** set native window buffer transform, - variable parameter in function is - [in] int32_t transform.*/ - pub const SET_TRANSFORM: Type = 14; - /** get native window buffer transform, - variable parameter in function is - [out] int32_t *transform.*/ - pub const GET_TRANSFORM: Type = 15; - /** set native window buffer uiTimestamp, - variable parameter in function is - [in] uint64_t uiTimestamp.*/ - pub const SET_UI_TIMESTAMP: Type = 16; -} diff --git a/src/native_window/native_window_api11.rs b/src/native_window/native_window_api11.rs deleted file mode 100644 index 200541c..0000000 --- a/src/native_window/native_window_api11.rs +++ /dev/null @@ -1,524 +0,0 @@ -/* automatically generated by rust-bindgen 0.69.4 */ - -#![allow(non_upper_case_globals)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] - -#[repr(C)] -#[derive(Default)] -pub struct __IncompleteArrayField(::core::marker::PhantomData, [T; 0]); -impl __IncompleteArrayField { - #[inline] - pub const fn new() -> Self { - __IncompleteArrayField(::core::marker::PhantomData, []) - } - #[inline] - pub fn as_ptr(&self) -> *const T { - self as *const _ as *const T - } - #[inline] - pub fn as_mut_ptr(&mut self) -> *mut T { - self as *mut _ as *mut T - } - #[inline] - pub unsafe fn as_slice(&self, len: usize) -> &[T] { - ::core::slice::from_raw_parts(self.as_ptr(), len) - } - #[inline] - pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { - ::core::slice::from_raw_parts_mut(self.as_mut_ptr(), len) - } -} -impl ::core::fmt::Debug for __IncompleteArrayField { - fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - fmt.write_str("__IncompleteArrayField") - } -} -#[repr(C)] -#[derive(Debug)] -pub struct BufferHandle { - ///< buffer fd, -1 if not supported - pub fd: i32, - ///< the width of memory - pub width: i32, - ///< the stride of memory - pub stride: i32, - ///< the height of memory - pub height: i32, - pub size: i32, - ///< the format of memory - pub format: i32, - ///< the usage of memory - pub usage: u64, - ///< Virtual address of memory - pub virAddr: *mut ::core::ffi::c_void, - ///< Shared memory key - pub key: i32, - ///< Physical address - pub phyAddr: u64, - ///< the number of reserved fd value - pub reserveFds: u32, - ///< the number of reserved integer value - pub reserveInts: u32, - ///< the data - pub reserve: __IncompleteArrayField, -} -#[repr(C)] -#[derive(Debug)] -pub struct OH_NativeBuffer { - _unused: [u8; 0], -} -/** @brief native window. -@since 8*/ -#[repr(C)] -#[derive(Debug)] -pub struct NativeWindow { - _unused: [u8; 0], -} -/** @brief native window buffer. -@since 8*/ -#[repr(C)] -#[derive(Debug)] -pub struct NativeWindowBuffer { - _unused: [u8; 0], -} -/** @brief define the new type name OHNativeWindow for struct NativeWindow. -@since 8*/ -pub type OHNativeWindow = NativeWindow; -/** @brief define the new type name OHNativeWindowBuffer for struct NativeWindowBuffer. -@since 8*/ -pub type OHNativeWindowBuffer = NativeWindowBuffer; -/** @brief indicates a dirty region where content is updated. -@since 8*/ -#[repr(C)] -#[derive(Debug)] -pub struct Region { - pub rects: *mut Region_Rect, - /// if rectNumber is 0, fill the Buffer dirty size by default - pub rectNumber: i32, -} -/// if rects is nullptr, fill the Buffer dirty size by default -#[repr(C)] -#[derive(Debug)] -pub struct Region_Rect { - pub x: i32, - pub y: i32, - pub w: u32, - pub h: u32, -} -impl NativeWindowOperation { - /** set native window buffer geometry, - variable parameter in function is - [in] int32_t width, [in] int32_t height*/ - pub const SET_BUFFER_GEOMETRY: NativeWindowOperation = NativeWindowOperation(0); -} -impl NativeWindowOperation { - /** get native window buffer geometry, - variable parameter in function is - [out] int32_t *height, [out] int32_t *width*/ - pub const GET_BUFFER_GEOMETRY: NativeWindowOperation = NativeWindowOperation(1); -} -impl NativeWindowOperation { - /** get native window buffer format, - variable parameter in function is - [out] int32_t *format*/ - pub const GET_FORMAT: NativeWindowOperation = NativeWindowOperation(2); -} -impl NativeWindowOperation { - /** set native window buffer format, - variable parameter in function is - [in] int32_t format*/ - pub const SET_FORMAT: NativeWindowOperation = NativeWindowOperation(3); -} -impl NativeWindowOperation { - /** get native window buffer usage, - variable parameter in function is - [out] int32_t *usage.*/ - pub const GET_USAGE: NativeWindowOperation = NativeWindowOperation(4); -} -impl NativeWindowOperation { - /** set native window buffer usage, - variable parameter in function is - [in] int32_t usage.*/ - pub const SET_USAGE: NativeWindowOperation = NativeWindowOperation(5); -} -impl NativeWindowOperation { - /** set native window buffer stride, - variable parameter in function is - [in] int32_t stride.*/ - pub const SET_STRIDE: NativeWindowOperation = NativeWindowOperation(6); -} -impl NativeWindowOperation { - /** get native window buffer stride, - variable parameter in function is - [out] int32_t *stride.*/ - pub const GET_STRIDE: NativeWindowOperation = NativeWindowOperation(7); -} -impl NativeWindowOperation { - /** set native window buffer swap interval, - variable parameter in function is - [in] int32_t interval.*/ - pub const SET_SWAP_INTERVAL: NativeWindowOperation = NativeWindowOperation(8); -} -impl NativeWindowOperation { - /** get native window buffer swap interval, - variable parameter in function is - [out] int32_t *interval.*/ - pub const GET_SWAP_INTERVAL: NativeWindowOperation = NativeWindowOperation(9); -} -impl NativeWindowOperation { - /** set native window buffer timeout, - variable parameter in function is - [in] int32_t timeout.*/ - pub const SET_TIMEOUT: NativeWindowOperation = NativeWindowOperation(10); -} -impl NativeWindowOperation { - /** get native window buffer timeout, - variable parameter in function is - [out] int32_t *timeout.*/ - pub const GET_TIMEOUT: NativeWindowOperation = NativeWindowOperation(11); -} -impl NativeWindowOperation { - /** set native window buffer colorGamut, - variable parameter in function is - [in] int32_t colorGamut.*/ - pub const SET_COLOR_GAMUT: NativeWindowOperation = NativeWindowOperation(12); -} -impl NativeWindowOperation { - /** get native window buffer colorGamut, - variable parameter in function is - [out int32_t *colorGamut].*/ - pub const GET_COLOR_GAMUT: NativeWindowOperation = NativeWindowOperation(13); -} -impl NativeWindowOperation { - /** set native window buffer transform, - variable parameter in function is - [in] int32_t transform.*/ - pub const SET_TRANSFORM: NativeWindowOperation = NativeWindowOperation(14); -} -impl NativeWindowOperation { - /** get native window buffer transform, - variable parameter in function is - [out] int32_t *transform.*/ - pub const GET_TRANSFORM: NativeWindowOperation = NativeWindowOperation(15); -} -impl NativeWindowOperation { - /** set native window buffer uiTimestamp, - variable parameter in function is - [in] uint64_t uiTimestamp.*/ - pub const SET_UI_TIMESTAMP: NativeWindowOperation = NativeWindowOperation(16); -} -#[repr(transparent)] -/** @brief Indicates the operation code in the function OH_NativeWindow_NativeWindowHandleOpt. -@since 8*/ -#[derive(Debug, Clone, Hash, PartialEq, Eq)] -pub struct NativeWindowOperation(pub ::core::ffi::c_uint); -impl OHScalingMode { - /** the window content is not updated until a buffer of - the window size is received*/ - pub const OH_SCALING_MODE_FREEZE: OHScalingMode = OHScalingMode(0); -} -impl OHScalingMode { - /// the buffer is scaled in two dimensions to match the window size - pub const OH_SCALING_MODE_SCALE_TO_WINDOW: OHScalingMode = OHScalingMode(1); -} -impl OHScalingMode { - /** the buffer is uniformly scaled so that the smaller size of - the buffer matches the window size*/ - pub const OH_SCALING_MODE_SCALE_CROP: OHScalingMode = OHScalingMode(2); -} -impl OHScalingMode { - /** the window is clipped to the size of the buffer's clipping rectangle - pixels outside the clipping rectangle are considered fully transparent.*/ - pub const OH_SCALING_MODE_NO_SCALE_CROP: OHScalingMode = OHScalingMode(3); -} -#[repr(transparent)] -/** @brief Indicates Scaling Mode. -@since 9 -@deprecated(since = "10")*/ -#[derive(Debug, Clone, Hash, PartialEq, Eq)] -pub struct OHScalingMode(pub ::core::ffi::c_uint); -impl OHHDRMetadataKey { - pub const OH_METAKEY_RED_PRIMARY_X: OHHDRMetadataKey = OHHDRMetadataKey(0); -} -impl OHHDRMetadataKey { - pub const OH_METAKEY_RED_PRIMARY_Y: OHHDRMetadataKey = OHHDRMetadataKey(1); -} -impl OHHDRMetadataKey { - pub const OH_METAKEY_GREEN_PRIMARY_X: OHHDRMetadataKey = OHHDRMetadataKey(2); -} -impl OHHDRMetadataKey { - pub const OH_METAKEY_GREEN_PRIMARY_Y: OHHDRMetadataKey = OHHDRMetadataKey(3); -} -impl OHHDRMetadataKey { - pub const OH_METAKEY_BLUE_PRIMARY_X: OHHDRMetadataKey = OHHDRMetadataKey(4); -} -impl OHHDRMetadataKey { - pub const OH_METAKEY_BLUE_PRIMARY_Y: OHHDRMetadataKey = OHHDRMetadataKey(5); -} -impl OHHDRMetadataKey { - pub const OH_METAKEY_WHITE_PRIMARY_X: OHHDRMetadataKey = OHHDRMetadataKey(6); -} -impl OHHDRMetadataKey { - pub const OH_METAKEY_WHITE_PRIMARY_Y: OHHDRMetadataKey = OHHDRMetadataKey(7); -} -impl OHHDRMetadataKey { - pub const OH_METAKEY_MAX_LUMINANCE: OHHDRMetadataKey = OHHDRMetadataKey(8); -} -impl OHHDRMetadataKey { - pub const OH_METAKEY_MIN_LUMINANCE: OHHDRMetadataKey = OHHDRMetadataKey(9); -} -impl OHHDRMetadataKey { - pub const OH_METAKEY_MAX_CONTENT_LIGHT_LEVEL: OHHDRMetadataKey = OHHDRMetadataKey(10); -} -impl OHHDRMetadataKey { - pub const OH_METAKEY_MAX_FRAME_AVERAGE_LIGHT_LEVEL: OHHDRMetadataKey = OHHDRMetadataKey(11); -} -impl OHHDRMetadataKey { - pub const OH_METAKEY_HDR10_PLUS: OHHDRMetadataKey = OHHDRMetadataKey(12); -} -impl OHHDRMetadataKey { - pub const OH_METAKEY_HDR_VIVID: OHHDRMetadataKey = OHHDRMetadataKey(13); -} -#[repr(transparent)] -/** @brief Enumerates the HDR metadata keys. -@since 9 -@deprecated(since = "10")*/ -#[derive(Debug, Clone, Hash, PartialEq, Eq)] -pub struct OHHDRMetadataKey(pub ::core::ffi::c_uint); -/** @brief Defines the HDR metadata. -@since 9 -@deprecated(since = "10")*/ -#[repr(C)] -#[derive(Debug)] -pub struct OHHDRMetaData { - pub key: OHHDRMetadataKey, - pub value: f32, -} -/** @brief Defines the ExtData Handle -@since 9 -@deprecated(since = "10")*/ -#[repr(C)] -#[derive(Debug)] -pub struct OHExtDataHandle { - pub fd: i32, - pub reserveInts: u32, - pub reserve: __IncompleteArrayField, -} -extern "C" { - /** @brief Creates a OHNativeWindow instance. A new OHNativeWindow instance is created each time this function is called. - - @syscap SystemCapability.Graphic.Graphic2D.NativeWindow - @param pSurface Indicates the pointer to a ProduceSurface. The type is a pointer to sptr. - @return Returns the pointer to the OHNativeWindow instance created. - @since 8 - @version 1.0*/ - pub fn OH_NativeWindow_CreateNativeWindow( - pSurface: *mut ::core::ffi::c_void, - ) -> *mut OHNativeWindow; - /** @brief Decreases the reference count of a OHNativeWindow instance by 1, and when the reference count reaches 0, destroys the instance. - - @syscap SystemCapability.Graphic.Graphic2D.NativeWindow - @param window Indicates the pointer to a OHNativeWindow instance. - @since 8 - @version 1.0*/ - pub fn OH_NativeWindow_DestroyNativeWindow(window: *mut OHNativeWindow); - /** @brief Creates a OHNativeWindowBuffer instance. A new OHNativeWindowBuffer instance is created each time this function is called. - - @syscap SystemCapability.Graphic.Graphic2D.NativeWindow - @param pSurfaceBuffer Indicates the pointer to a produce buffer. The type is sptr. - @return Returns the pointer to the OHNativeWindowBuffer instance created. - @since 8 - @version 1.0*/ - pub fn OH_NativeWindow_CreateNativeWindowBufferFromSurfaceBuffer( - pSurfaceBuffer: *mut ::core::ffi::c_void, - ) -> *mut OHNativeWindowBuffer; - /** @brief Creates a OHNativeWindowBuffer instance. - A new OHNativeWindowBuffer instance is created each time this function is called. - - @syscap SystemCapability.Graphic.Graphic2D.NativeWindow - @param nativeBuffer Indicates the pointer to a native buffer. The type is OH_NativeBuffer*. - @return Returns the pointer to the OHNativeWindowBuffer instance created. - @since 11 - @version 1.0*/ - pub fn OH_NativeWindow_CreateNativeWindowBufferFromNativeBuffer( - nativeBuffer: *mut OH_NativeBuffer, - ) -> *mut OHNativeWindowBuffer; - /** @brief Decreases the reference count of a OHNativeWindowBuffer instance by 1 and, when the reference count reaches 0, destroys the instance. - - @syscap SystemCapability.Graphic.Graphic2D.NativeWindow - @param buffer Indicates the pointer to a OHNativeWindowBuffer instance. - @since 8 - @version 1.0*/ - pub fn OH_NativeWindow_DestroyNativeWindowBuffer(buffer: *mut OHNativeWindowBuffer); - /** @brief Requests a OHNativeWindowBuffer through a OHNativeWindow instance for content production. - - @syscap SystemCapability.Graphic.Graphic2D.NativeWindow - @param window Indicates the pointer to a OHNativeWindow instance. - @param buffer Indicates the double pointer to a OHNativeWindowBuffer instance. - @param fenceFd Indicates the pointer to a file descriptor handle. - @return Returns an error code, 0 is success, otherwise, failed. - @since 8 - @version 1.0*/ - pub fn OH_NativeWindow_NativeWindowRequestBuffer( - window: *mut OHNativeWindow, - buffer: *mut *mut OHNativeWindowBuffer, - fenceFd: *mut ::core::ffi::c_int, - ) -> i32; - /** @brief Flushes the OHNativeWindowBuffer filled with the content to the buffer queue through a OHNativeWindow instance for content consumption. - - @syscap SystemCapability.Graphic.Graphic2D.NativeWindow - @param window Indicates the pointer to a OHNativeWindow instance. - @param buffer Indicates the pointer to a OHNativeWindowBuffer instance. - @param fenceFd Indicates a file descriptor handle, which is used for timing synchronization. - @param region Indicates a dirty region where content is updated. - @return Returns an error code, 0 is success, otherwise, failed. - @since 8 - @version 1.0*/ - pub fn OH_NativeWindow_NativeWindowFlushBuffer( - window: *mut OHNativeWindow, - buffer: *mut OHNativeWindowBuffer, - fenceFd: ::core::ffi::c_int, - region: Region, - ) -> i32; - /** @brief Get the last flushed OHNativeWindowBuffer from a OHNativeWindow instance. - - @syscap SystemCapability.Graphic.Graphic2D.NativeWindow - @param window Indicates the pointer to a OHNativeWindow instance. - @param buffer Indicates the pointer to a OHNativeWindowBuffer pointer. - @param fenceFd Indicates the pointer to a file descriptor handle. - @param matrix Indicates the retrieved 4*4 transform matrix. - @return Returns an error code, 0 is success, otherwise, failed. - @since 11 - @version 1.0*/ - pub fn OH_NativeWindow_GetLastFlushedBuffer( - window: *mut OHNativeWindow, - buffer: *mut *mut OHNativeWindowBuffer, - fenceFd: *mut ::core::ffi::c_int, - matrix: *mut f32, - ) -> i32; - /** @brief Returns the OHNativeWindowBuffer to the buffer queue through a OHNativeWindow instance, without filling in any content. The OHNativeWindowBuffer can be used for another request. - - @syscap SystemCapability.Graphic.Graphic2D.NativeWindow - @param window Indicates the pointer to a OHNativeWindow instance. - @param buffer Indicates the pointer to a OHNativeWindowBuffer instance. - @return Returns an error code, 0 is success, otherwise, failed. - @since 8 - @version 1.0*/ - pub fn OH_NativeWindow_NativeWindowAbortBuffer( - window: *mut OHNativeWindow, - buffer: *mut OHNativeWindowBuffer, - ) -> i32; - /** @brief Sets or obtains the attributes of a native window, including the width, height, and content format. - - @syscap SystemCapability.Graphic.Graphic2D.NativeWindow - @param window Indicates the pointer to a OHNativeWindow instance. - @param code Indicates the operation code, pointer to NativeWindowOperation. - @param ... variable parameter, must correspond to code one-to-one. - @return Returns an error code, 0 is success, otherwise, failed. - @since 8 - @version 1.0*/ - pub fn OH_NativeWindow_NativeWindowHandleOpt( - window: *mut OHNativeWindow, - code: ::core::ffi::c_int, - ... - ) -> i32; - /** @brief Obtains the pointer to a BufferHandle of a OHNativeWindowBuffer instance. - - @syscap SystemCapability.Graphic.Graphic2D.NativeWindow - @param buffer Indicates the pointer to a OHNativeWindowBuffer instance. - @return Returns the pointer to the BufferHandle instance obtained. - @since 8 - @version 1.0*/ - pub fn OH_NativeWindow_GetBufferHandleFromNative( - buffer: *mut OHNativeWindowBuffer, - ) -> *mut BufferHandle; - /** @brief Adds the reference count of a native object. - - @syscap SystemCapability.Graphic.Graphic2D.NativeWindow - @param obj Indicates the pointer to a OHNativeWindow or OHNativeWindowBuffer instance. - @return Returns an error code, 0 is success, otherwise, failed. - @since 8 - @version 1.0*/ - pub fn OH_NativeWindow_NativeObjectReference(obj: *mut ::core::ffi::c_void) -> i32; - /** @brief Decreases the reference count of a native object and, when the reference count reaches 0, destroys this object. - - @syscap SystemCapability.Graphic.Graphic2D.NativeWindow - @param obj Indicates the pointer to a OHNativeWindow or OHNativeWindowBuffer instance. - @return Returns an error code, 0 is success, otherwise, failed. - @since 8 - @version 1.0*/ - pub fn OH_NativeWindow_NativeObjectUnreference(obj: *mut ::core::ffi::c_void) -> i32; - /** @brief Obtains the magic ID of a native object. - - @syscap SystemCapability.Graphic.Graphic2D.NativeWindow - @param obj Indicates the pointer to a OHNativeWindow or OHNativeWindowBuffer instance. - @return Returns the magic ID, which is unique for each native object. - @since 8 - @version 1.0*/ - pub fn OH_NativeWindow_GetNativeObjectMagic(obj: *mut ::core::ffi::c_void) -> i32; - /** @brief Sets scalingMode of a native window. - - @syscap SystemCapability.Graphic.Graphic2D.NativeWindow - @param window Indicates the pointer to a OHNativeWindow instance. - @param sequence Indicates the sequence to a produce buffer. - @param scalingMode Indicates the enum value to OHScalingMode - @return Returns an error code, 0 is success, otherwise, failed. - @since 9 - @version 1.0 - @deprecated(since = "10")*/ - pub fn OH_NativeWindow_NativeWindowSetScalingMode( - window: *mut OHNativeWindow, - sequence: u32, - scalingMode: OHScalingMode, - ) -> i32; - /** @brief Sets metaData of a native window. - - @syscap SystemCapability.Graphic.Graphic2D.NativeWindow - @param window Indicates the pointer to a OHNativeWindow instance. - @param sequence Indicates the sequence to a produce buffer. - @param size Indicates the size of a OHHDRMetaData vector. - @param metaDate Indicates the pointer to a OHHDRMetaData vector. - @return Returns an error code, 0 is success, otherwise, failed. - @since 9 - @version 1.0 - @deprecated(since = "10")*/ - pub fn OH_NativeWindow_NativeWindowSetMetaData( - window: *mut OHNativeWindow, - sequence: u32, - size: i32, - metaData: *const OHHDRMetaData, - ) -> i32; - /** @brief Sets metaDataSet of a native window. - - @syscap SystemCapability.Graphic.Graphic2D.NativeWindow - @param window Indicates the pointer to a OHNativeWindow instance. - @param sequence Indicates the sequence to a produce buffer. - @param key Indicates the enum value to OHHDRMetadataKey - @param size Indicates the size of a uint8_t vector. - @param metaDate Indicates the pointer to a uint8_t vector. - @return Returns an error code, 0 is success, otherwise, failed. - @since 9 - @version 1.0 - @deprecated(since = "10")*/ - pub fn OH_NativeWindow_NativeWindowSetMetaDataSet( - window: *mut OHNativeWindow, - sequence: u32, - key: OHHDRMetadataKey, - size: i32, - metaData: *const u8, - ) -> i32; - /** @brief Sets tunnel handle of a native window. - - @syscap SystemCapability.Graphic.Graphic2D.NativeWindow - @param window Indicates the pointer to a OHNativeWindow instance. - @param handle Indicates the pointer to a OHExtDataHandle. - @return Returns an error code, 0 is success, otherwise, failed. - @since 9 - @version 1.0 - @deprecated(since = "10")*/ - pub fn OH_NativeWindow_NativeWindowSetTunnelHandle( - window: *mut OHNativeWindow, - handle: *const OHExtDataHandle, - ) -> i32; -} diff --git a/src/native_window/native_window_ffi.rs b/src/native_window/native_window_ffi.rs new file mode 100644 index 0000000..7a3645c --- /dev/null +++ b/src/native_window/native_window_ffi.rs @@ -0,0 +1,1178 @@ +/* automatically generated by rust-bindgen 0.71.1 */ + +#![allow(non_upper_case_globals)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] + +#[repr(C)] +#[derive(Default)] +pub struct __IncompleteArrayField(::core::marker::PhantomData, [T; 0]); +impl __IncompleteArrayField { + #[inline] + pub const fn new() -> Self { + __IncompleteArrayField(::core::marker::PhantomData, []) + } + #[inline] + pub fn as_ptr(&self) -> *const T { + self as *const _ as *const T + } + #[inline] + pub fn as_mut_ptr(&mut self) -> *mut T { + self as *mut _ as *mut T + } + #[inline] + pub unsafe fn as_slice(&self, len: usize) -> &[T] { + ::core::slice::from_raw_parts(self.as_ptr(), len) + } + #[inline] + pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { + ::core::slice::from_raw_parts_mut(self.as_mut_ptr(), len) + } +} +impl ::core::fmt::Debug for __IncompleteArrayField { + fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fmt.write_str("__IncompleteArrayField") + } +} +#[repr(C)] +#[derive(Debug)] +pub struct BufferHandle { + ///< buffer fd, -1 if not supported + pub fd: i32, + ///< the width of memory + pub width: i32, + ///< the stride of memory + pub stride: i32, + ///< the height of memory + pub height: i32, + pub size: i32, + ///< the format of memory + pub format: i32, + ///< the usage of memory + pub usage: u64, + ///< Virtual address of memory + pub virAddr: *mut ::core::ffi::c_void, + ///< Shared memory key + pub key: i32, + ///< Physical address + pub phyAddr: u64, + ///< the number of reserved fd value + pub reserveFds: u32, + ///< the number of reserved integer value + pub reserveInts: u32, + ///< the data + pub reserve: __IncompleteArrayField, +} +#[cfg(feature = "api-11")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] +impl OH_NativeBuffer_ColorSpace { + /// None color space + pub const OH_COLORSPACE_NONE: OH_NativeBuffer_ColorSpace = OH_NativeBuffer_ColorSpace(0); +} +#[cfg(feature = "api-11")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] +impl OH_NativeBuffer_ColorSpace { + /// COLORPRIMARIES_BT601_P | (TRANSFUNC_BT709 << 8) | (MATRIX_BT601_P << 16) | (RANGE_FULL << 21) + pub const OH_COLORSPACE_BT601_EBU_FULL: OH_NativeBuffer_ColorSpace = + OH_NativeBuffer_ColorSpace(1); +} +#[cfg(feature = "api-11")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] +impl OH_NativeBuffer_ColorSpace { + /// COLORPRIMARIES_BT601_N | (TRANSFUNC_BT709 << 8) | (MATRIX_BT601_N << 16) | (RANGE_FULL << 21) + pub const OH_COLORSPACE_BT601_SMPTE_C_FULL: OH_NativeBuffer_ColorSpace = + OH_NativeBuffer_ColorSpace(2); +} +#[cfg(feature = "api-11")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] +impl OH_NativeBuffer_ColorSpace { + /// COLORPRIMARIES_BT709 | (TRANSFUNC_BT709 << 8) | (MATRIX_BT709 << 16) | (RANGE_FULL << 21) + pub const OH_COLORSPACE_BT709_FULL: OH_NativeBuffer_ColorSpace = OH_NativeBuffer_ColorSpace(3); +} +#[cfg(feature = "api-11")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] +impl OH_NativeBuffer_ColorSpace { + /// COLORPRIMARIES_BT2020 | (TRANSFUNC_HLG << 8) | (MATRIX_BT2020 << 16) | (RANGE_FULL << 21) + pub const OH_COLORSPACE_BT2020_HLG_FULL: OH_NativeBuffer_ColorSpace = + OH_NativeBuffer_ColorSpace(4); +} +#[cfg(feature = "api-11")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] +impl OH_NativeBuffer_ColorSpace { + /// COLORPRIMARIES_BT2020 | (TRANSFUNC_PQ << 8) | (MATRIX_BT2020 << 16) | (RANGE_FULL << 21) + pub const OH_COLORSPACE_BT2020_PQ_FULL: OH_NativeBuffer_ColorSpace = + OH_NativeBuffer_ColorSpace(5); +} +#[cfg(feature = "api-11")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] +impl OH_NativeBuffer_ColorSpace { + /// COLORPRIMARIES_BT601_P | (TRANSFUNC_BT709 << 8) | (MATRIX_BT601_P << 16) | (RANGE_LIMITED << 21) + pub const OH_COLORSPACE_BT601_EBU_LIMIT: OH_NativeBuffer_ColorSpace = + OH_NativeBuffer_ColorSpace(6); +} +#[cfg(feature = "api-11")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] +impl OH_NativeBuffer_ColorSpace { + /// COLORPRIMARIES_BT601_N | (TRANSFUNC_BT709 << 8) | (MATRIX_BT601_N << 16) | (RANGE_LIMITED << 21) + pub const OH_COLORSPACE_BT601_SMPTE_C_LIMIT: OH_NativeBuffer_ColorSpace = + OH_NativeBuffer_ColorSpace(7); +} +#[cfg(feature = "api-11")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] +impl OH_NativeBuffer_ColorSpace { + /// COLORPRIMARIES_BT709 | (TRANSFUNC_BT709 << 8) | (MATRIX_BT709 << 16) | (RANGE_LIMITED << 21) + pub const OH_COLORSPACE_BT709_LIMIT: OH_NativeBuffer_ColorSpace = OH_NativeBuffer_ColorSpace(8); +} +#[cfg(feature = "api-11")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] +impl OH_NativeBuffer_ColorSpace { + /// COLORPRIMARIES_BT2020 | (TRANSFUNC_HLG << 8) | (MATRIX_BT2020 << 16) | (RANGE_LIMITED << 21) + pub const OH_COLORSPACE_BT2020_HLG_LIMIT: OH_NativeBuffer_ColorSpace = + OH_NativeBuffer_ColorSpace(9); +} +#[cfg(feature = "api-11")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] +impl OH_NativeBuffer_ColorSpace { + /// COLORPRIMARIES_BT2020 | (TRANSFUNC_PQ << 8) | (MATRIX_BT2020 << 16) | (RANGE_LIMITED << 21) + pub const OH_COLORSPACE_BT2020_PQ_LIMIT: OH_NativeBuffer_ColorSpace = + OH_NativeBuffer_ColorSpace(10); +} +#[cfg(feature = "api-11")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] +impl OH_NativeBuffer_ColorSpace { + /// COLORPRIMARIES_SRGB | (TRANSFUNC_SRGB << 8) | (MATRIX_BT601_N << 16) | (RANGE_FULL << 21) + pub const OH_COLORSPACE_SRGB_FULL: OH_NativeBuffer_ColorSpace = OH_NativeBuffer_ColorSpace(11); +} +#[cfg(feature = "api-11")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] +impl OH_NativeBuffer_ColorSpace { + /// COLORPRIMARIES_P3_D65 | (TRANSFUNC_SRGB << 8) | (MATRIX_P3 << 16) | (RANGE_FULL << 21) + pub const OH_COLORSPACE_P3_FULL: OH_NativeBuffer_ColorSpace = OH_NativeBuffer_ColorSpace(12); +} +#[cfg(feature = "api-11")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] +impl OH_NativeBuffer_ColorSpace { + /// COLORPRIMARIES_P3_D65 | (TRANSFUNC_HLG << 8) | (MATRIX_P3 << 16) | (RANGE_FULL << 21) + pub const OH_COLORSPACE_P3_HLG_FULL: OH_NativeBuffer_ColorSpace = + OH_NativeBuffer_ColorSpace(13); +} +#[cfg(feature = "api-11")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] +impl OH_NativeBuffer_ColorSpace { + /// COLORPRIMARIES_P3_D65 | (TRANSFUNC_PQ << 8) | (MATRIX_P3 << 16) | (RANGE_FULL << 21) + pub const OH_COLORSPACE_P3_PQ_FULL: OH_NativeBuffer_ColorSpace = OH_NativeBuffer_ColorSpace(14); +} +#[cfg(feature = "api-11")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] +impl OH_NativeBuffer_ColorSpace { + /// COLORPRIMARIES_ADOBERGB | (TRANSFUNC_ADOBERGB << 8) | (MATRIX_ADOBERGB << 16) | (RANGE_FULL << 21) + pub const OH_COLORSPACE_ADOBERGB_FULL: OH_NativeBuffer_ColorSpace = + OH_NativeBuffer_ColorSpace(15); +} +#[cfg(feature = "api-11")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] +impl OH_NativeBuffer_ColorSpace { + /// COLORPRIMARIES_SRGB | (TRANSFUNC_SRGB << 8) | (MATRIX_BT601_N << 16) | (RANGE_LIMITED << 21) + pub const OH_COLORSPACE_SRGB_LIMIT: OH_NativeBuffer_ColorSpace = OH_NativeBuffer_ColorSpace(16); +} +#[cfg(feature = "api-11")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] +impl OH_NativeBuffer_ColorSpace { + /// COLORPRIMARIES_P3_D65 | (TRANSFUNC_SRGB << 8) | (MATRIX_P3 << 16) | (RANGE_LIMITED << 21) + pub const OH_COLORSPACE_P3_LIMIT: OH_NativeBuffer_ColorSpace = OH_NativeBuffer_ColorSpace(17); +} +#[cfg(feature = "api-11")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] +impl OH_NativeBuffer_ColorSpace { + /// COLORPRIMARIES_P3_D65 | (TRANSFUNC_HLG << 8) | (MATRIX_P3 << 16) | (RANGE_LIMITED << 21) + pub const OH_COLORSPACE_P3_HLG_LIMIT: OH_NativeBuffer_ColorSpace = + OH_NativeBuffer_ColorSpace(18); +} +#[cfg(feature = "api-11")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] +impl OH_NativeBuffer_ColorSpace { + /// COLORPRIMARIES_P3_D65 | (TRANSFUNC_PQ << 8) | (MATRIX_P3 << 16) | (RANGE_LIMITED << 21) + pub const OH_COLORSPACE_P3_PQ_LIMIT: OH_NativeBuffer_ColorSpace = + OH_NativeBuffer_ColorSpace(19); +} +#[cfg(feature = "api-11")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] +impl OH_NativeBuffer_ColorSpace { + /// COLORPRIMARIES_ADOBERGB | (TRANSFUNC_ADOBERGB << 8) | (MATRIX_ADOBERGB << 16) | (RANGE_LIMITED << 21) + pub const OH_COLORSPACE_ADOBERGB_LIMIT: OH_NativeBuffer_ColorSpace = + OH_NativeBuffer_ColorSpace(20); +} +#[cfg(feature = "api-11")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] +impl OH_NativeBuffer_ColorSpace { + /// COLORPRIMARIES_SRGB | (TRANSFUNC_LINEAR << 8) + pub const OH_COLORSPACE_LINEAR_SRGB: OH_NativeBuffer_ColorSpace = + OH_NativeBuffer_ColorSpace(21); +} +#[cfg(feature = "api-11")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] +impl OH_NativeBuffer_ColorSpace { + /// equal to OH_COLORSPACE_LINEAR_SRGB + pub const OH_COLORSPACE_LINEAR_BT709: OH_NativeBuffer_ColorSpace = + OH_NativeBuffer_ColorSpace(22); +} +#[cfg(feature = "api-11")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] +impl OH_NativeBuffer_ColorSpace { + /// COLORPRIMARIES_P3_D65 | (TRANSFUNC_LINEAR << 8) + pub const OH_COLORSPACE_LINEAR_P3: OH_NativeBuffer_ColorSpace = OH_NativeBuffer_ColorSpace(23); +} +#[cfg(feature = "api-11")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] +impl OH_NativeBuffer_ColorSpace { + /// COLORPRIMARIES_BT2020 | (TRANSFUNC_LINEAR << 8) + pub const OH_COLORSPACE_LINEAR_BT2020: OH_NativeBuffer_ColorSpace = + OH_NativeBuffer_ColorSpace(24); +} +#[cfg(feature = "api-11")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] +impl OH_NativeBuffer_ColorSpace { + /// equal to OH_COLORSPACE_SRGB_FULL + pub const OH_COLORSPACE_DISPLAY_SRGB: OH_NativeBuffer_ColorSpace = + OH_NativeBuffer_ColorSpace(25); +} +#[cfg(feature = "api-11")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] +impl OH_NativeBuffer_ColorSpace { + /// equal to OH_COLORSPACE_P3_FULL + pub const OH_COLORSPACE_DISPLAY_P3_SRGB: OH_NativeBuffer_ColorSpace = + OH_NativeBuffer_ColorSpace(26); +} +#[cfg(feature = "api-11")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] +impl OH_NativeBuffer_ColorSpace { + /// equal to OH_COLORSPACE_P3_HLG_FULL + pub const OH_COLORSPACE_DISPLAY_P3_HLG: OH_NativeBuffer_ColorSpace = + OH_NativeBuffer_ColorSpace(27); +} +#[cfg(feature = "api-11")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] +impl OH_NativeBuffer_ColorSpace { + /// equal to OH_COLORSPACE_P3_PQ_FULL + pub const OH_COLORSPACE_DISPLAY_P3_PQ: OH_NativeBuffer_ColorSpace = + OH_NativeBuffer_ColorSpace(28); +} +#[cfg(feature = "api-11")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] +impl OH_NativeBuffer_ColorSpace { + /// COLORPRIMARIES_BT2020 | (TRANSFUNC_SRGB << 8) | (MATRIX_BT2020 << 16) | (RANGE_FULL << 21) + pub const OH_COLORSPACE_DISPLAY_BT2020_SRGB: OH_NativeBuffer_ColorSpace = + OH_NativeBuffer_ColorSpace(29); +} +#[cfg(feature = "api-11")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] +impl OH_NativeBuffer_ColorSpace { + /// equal to OH_COLORSPACE_BT2020_HLG_FULL + pub const OH_COLORSPACE_DISPLAY_BT2020_HLG: OH_NativeBuffer_ColorSpace = + OH_NativeBuffer_ColorSpace(30); +} +#[cfg(feature = "api-11")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] +impl OH_NativeBuffer_ColorSpace { + /// equal to OH_COLORSPACE_BT2020_PQ_FULL + pub const OH_COLORSPACE_DISPLAY_BT2020_PQ: OH_NativeBuffer_ColorSpace = + OH_NativeBuffer_ColorSpace(31); +} +#[repr(transparent)] +#[doc = " @brief Indicates the color space of a native buffer.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @since 11\n @version 1.0\n/\n/**\n @brief Indicates the color space of a native buffer.\n Move from native_buffer.h to native_common.h\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @since 12\n @version 1.0"] +#[cfg(feature = "api-11")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] +#[derive(Debug, Clone, Hash, PartialEq, Eq)] +pub struct OH_NativeBuffer_ColorSpace(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +impl OH_NativeBuffer_MetadataType { + /// HLG + pub const OH_VIDEO_HDR_HLG: OH_NativeBuffer_MetadataType = OH_NativeBuffer_MetadataType(0); +} +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +impl OH_NativeBuffer_MetadataType { + /// HDR10 + pub const OH_VIDEO_HDR_HDR10: OH_NativeBuffer_MetadataType = OH_NativeBuffer_MetadataType(1); +} +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +impl OH_NativeBuffer_MetadataType { + /// HDR VIVID + pub const OH_VIDEO_HDR_VIVID: OH_NativeBuffer_MetadataType = OH_NativeBuffer_MetadataType(2); +} +#[repr(transparent)] +/** @brief Indicates the HDR metadata type of a native buffer. + +@syscap SystemCapability.Graphic.Graphic2D.NativeBuffer +@since 12 +@version 1.0*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Debug, Clone, Hash, PartialEq, Eq)] +pub struct OH_NativeBuffer_MetadataType(pub ::core::ffi::c_uint); +/** @brief Indicates the color x and y. + +@syscap SystemCapability.Graphic.Graphic2D.NativeBuffer +@since 12 +@version 1.0*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[repr(C)] +#[derive(Debug)] +pub struct OH_NativeBuffer_ColorXY { + /// color X + pub x: f32, + /// color Y + pub y: f32, +} +/** @brief Indicates the smpte2086 metadata. + +@syscap SystemCapability.Graphic.Graphic2D.NativeBuffer +@since 12 +@version 1.0*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[repr(C)] +#[derive(Debug)] +pub struct OH_NativeBuffer_Smpte2086 { + /// primary red + pub displayPrimaryRed: OH_NativeBuffer_ColorXY, + /// primary green + pub displayPrimaryGreen: OH_NativeBuffer_ColorXY, + /// primary blue + pub displayPrimaryBlue: OH_NativeBuffer_ColorXY, + /// white point + pub whitePoint: OH_NativeBuffer_ColorXY, + /// max luminance + pub maxLuminance: f32, + /// min luminance + pub minLuminance: f32, +} +/** @brief Indicates the cta861.3 metadata. + +@syscap SystemCapability.Graphic.Graphic2D.NativeBuffer +@since 12 +@version 1.0*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[repr(C)] +#[derive(Debug)] +pub struct OH_NativeBuffer_Cta861 { + /// max content lightLevel + pub maxContentLightLevel: f32, + /// max frame average light level + pub maxFrameAverageLightLevel: f32, +} +/** @brief Indicates the HDR static metadata. + +@syscap SystemCapability.Graphic.Graphic2D.NativeBuffer +@since 12 +@version 1.0*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[repr(C)] +#[derive(Debug)] +pub struct OH_NativeBuffer_StaticMetadata { + /// smpte 2086 metadata + pub smpte2086: OH_NativeBuffer_Smpte2086, + /// CTA-861.3 metadata + pub cta861: OH_NativeBuffer_Cta861, +} +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +impl OH_NativeBuffer_MetadataKey { + /// value: OH_NativeBuffer_MetadataType + pub const OH_HDR_METADATA_TYPE: OH_NativeBuffer_MetadataKey = OH_NativeBuffer_MetadataKey(0); +} +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +impl OH_NativeBuffer_MetadataKey { + /// value: OH_NativeBuffer_StaticMetadata + pub const OH_HDR_STATIC_METADATA: OH_NativeBuffer_MetadataKey = OH_NativeBuffer_MetadataKey(1); +} +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +impl OH_NativeBuffer_MetadataKey { + /// byte stream of SEI in video stream + pub const OH_HDR_DYNAMIC_METADATA: OH_NativeBuffer_MetadataKey = OH_NativeBuffer_MetadataKey(2); +} +#[repr(transparent)] +/** @brief Indicates the HDR metadata key of a native buffer. + +@syscap SystemCapability.Graphic.Graphic2D.NativeBuffer +@since 12 +@version 1.0*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Debug, Clone, Hash, PartialEq, Eq)] +pub struct OH_NativeBuffer_MetadataKey(pub ::core::ffi::c_uint); +#[repr(C)] +pub struct OH_NativeBuffer { + _unused: [u8; 0], +} +#[repr(C)] +pub struct OHIPCParcel { + _unused: [u8; 0], +} +/** @brief native window. +@since 8*/ +#[repr(C)] +pub struct NativeWindow { + _unused: [u8; 0], +} +/** @brief native window buffer. +@since 8*/ +#[repr(C)] +pub struct NativeWindowBuffer { + _unused: [u8; 0], +} +/** @brief define the new type name OHNativeWindow for struct NativeWindow. +@since 8*/ +pub type OHNativeWindow = NativeWindow; +/** @brief define the new type name OHNativeWindowBuffer for struct NativeWindowBuffer. +@since 8*/ +pub type OHNativeWindowBuffer = NativeWindowBuffer; +/** @brief indicates a dirty region where content is updated. +@since 8*/ +#[repr(C)] +#[derive(Debug)] +pub struct Region { + pub rects: *mut Region_Rect, + /// if rectNumber is 0, fill the Buffer dirty size by default + pub rectNumber: i32, +} +/// if rects is nullptr, fill the Buffer dirty size by default +#[repr(C)] +#[derive(Debug)] +pub struct Region_Rect { + pub x: i32, + pub y: i32, + pub w: u32, + pub h: u32, +} +pub mod NativeWindowOperation { + /** @brief Indicates the operation code in the function OH_NativeWindow_NativeWindowHandleOpt. + @since 8*/ + pub type Type = ::core::ffi::c_uint; + /** set native window buffer geometry, + variable parameter in function is + [in] int32_t width, [in] int32_t height*/ + pub const SET_BUFFER_GEOMETRY: Type = 0; + /** get native window buffer geometry, + variable parameter in function is + [out] int32_t *height, [out] int32_t *width*/ + pub const GET_BUFFER_GEOMETRY: Type = 1; + /** get native window buffer format, + variable parameter in function is + [out] int32_t *format*/ + pub const GET_FORMAT: Type = 2; + /** set native window buffer format, + variable parameter in function is + [in] int32_t format*/ + pub const SET_FORMAT: Type = 3; + /** get native window buffer usage, + variable parameter in function is + [out] uint64_t *usage.*/ + pub const GET_USAGE: Type = 4; + /** set native window buffer usage, + variable parameter in function is + [in] uint64_t usage.*/ + pub const SET_USAGE: Type = 5; + /** set native window buffer stride, + variable parameter in function is + [in] int32_t stride.*/ + pub const SET_STRIDE: Type = 6; + /** get native window buffer stride, + variable parameter in function is + [out] int32_t *stride.*/ + pub const GET_STRIDE: Type = 7; + /** set native window buffer swap interval, + variable parameter in function is + [in] int32_t interval.*/ + pub const SET_SWAP_INTERVAL: Type = 8; + /** get native window buffer swap interval, + variable parameter in function is + [out] int32_t *interval.*/ + pub const GET_SWAP_INTERVAL: Type = 9; + /** set native window buffer timeout, + variable parameter in function is + [in] int32_t timeout.*/ + pub const SET_TIMEOUT: Type = 10; + /** get native window buffer timeout, + variable parameter in function is + [out] int32_t *timeout.*/ + pub const GET_TIMEOUT: Type = 11; + /** set native window buffer colorGamut, + variable parameter in function is + [in] int32_t colorGamut.*/ + pub const SET_COLOR_GAMUT: Type = 12; + /** get native window buffer colorGamut, + variable parameter in function is + [out int32_t *colorGamut].*/ + pub const GET_COLOR_GAMUT: Type = 13; + /** set native window buffer transform, + variable parameter in function is + [in] int32_t transform.*/ + pub const SET_TRANSFORM: Type = 14; + /** get native window buffer transform, + variable parameter in function is + [out] int32_t *transform.*/ + pub const GET_TRANSFORM: Type = 15; + /** set native window buffer uiTimestamp, + variable parameter in function is + [in] uint64_t uiTimestamp.*/ + pub const SET_UI_TIMESTAMP: Type = 16; + /** get native window bufferqueue size, + variable parameter in function is + [out] int32_t *size. + @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] + pub const GET_BUFFERQUEUE_SIZE: Type = 17; + /** set surface source type, + variable parameter in function is + [in] int32_t sourceType. + @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] + pub const SET_SOURCE_TYPE: Type = 18; + /** get surface source type, + variable parameter in function is + [out] int32_t *sourceType. + @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] + pub const GET_SOURCE_TYPE: Type = 19; + /** set app framework type, + variable parameter in function is + [in] char* frameworkType. maximum length is 64 bytes, otherwise the setting fails. + @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] + pub const SET_APP_FRAMEWORK_TYPE: Type = 20; + /** get app framework type, + variable parameter in function is + [out] char** frameworkType. + @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] + pub const GET_APP_FRAMEWORK_TYPE: Type = 21; + /** set hdr white point brightness, + variable parameter in function is + [in] float brightness. the value range is 0.0f to 1.0f. + @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] + pub const SET_HDR_WHITE_POINT_BRIGHTNESS: Type = 22; + /** set sdr white point brightness, + variable parameter in function is + [in] float brightness. the value range is 0.0f to 1.0f. + @since 12*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] + pub const SET_SDR_WHITE_POINT_BRIGHTNESS: Type = 23; +} +impl OHScalingMode { + /** the window content is not updated until a buffer of + the window size is received*/ + pub const OH_SCALING_MODE_FREEZE: OHScalingMode = OHScalingMode(0); +} +impl OHScalingMode { + /// the buffer is scaled in two dimensions to match the window size + pub const OH_SCALING_MODE_SCALE_TO_WINDOW: OHScalingMode = OHScalingMode(1); +} +impl OHScalingMode { + /** the buffer is uniformly scaled so that the smaller size of + the buffer matches the window size*/ + pub const OH_SCALING_MODE_SCALE_CROP: OHScalingMode = OHScalingMode(2); +} +impl OHScalingMode { + /** the window is clipped to the size of the buffer's clipping rectangle + pixels outside the clipping rectangle are considered fully transparent.*/ + pub const OH_SCALING_MODE_NO_SCALE_CROP: OHScalingMode = OHScalingMode(3); +} +#[repr(transparent)] +/** @brief Indicates Scaling Mode. +@since 9 +@deprecated(since = "10")*/ +#[deprecated(since = "10")] +#[derive(Debug, Clone, Hash, PartialEq, Eq)] +pub struct OHScalingMode(pub ::core::ffi::c_uint); +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +impl OHScalingModeV2 { + /** the window content is not updated until a buffer of + the window size is received*/ + pub const OH_SCALING_MODE_FREEZE_V2: OHScalingModeV2 = OHScalingModeV2(0); +} +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +impl OHScalingModeV2 { + /// the buffer is scaled in two dimensions to match the window size + pub const OH_SCALING_MODE_SCALE_TO_WINDOW_V2: OHScalingModeV2 = OHScalingModeV2(1); +} +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +impl OHScalingModeV2 { + /** the buffer is uniformly scaled so that the smaller size of + the buffer matches the window size*/ + pub const OH_SCALING_MODE_SCALE_CROP_V2: OHScalingModeV2 = OHScalingModeV2(2); +} +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +impl OHScalingModeV2 { + /** the window is clipped to the size of the buffer's clipping rectangle + pixels outside the clipping rectangle are considered fully transparent.*/ + pub const OH_SCALING_MODE_NO_SCALE_CROP_V2: OHScalingModeV2 = OHScalingModeV2(3); +} +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +impl OHScalingModeV2 { + /** Adapt to the buffer and scale proportionally to the buffer size. Prioritize displaying all buffer content. + If the size is not the same as the window size, fill the unfilled area of the window with a background color.*/ + pub const OH_SCALING_MODE_SCALE_FIT_V2: OHScalingModeV2 = OHScalingModeV2(4); +} +#[repr(transparent)] +/** @brief Indicates Scaling Mode. +@since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Debug, Clone, Hash, PartialEq, Eq)] +pub struct OHScalingModeV2(pub ::core::ffi::c_uint); +impl OHHDRMetadataKey { + pub const OH_METAKEY_RED_PRIMARY_X: OHHDRMetadataKey = OHHDRMetadataKey(0); +} +impl OHHDRMetadataKey { + pub const OH_METAKEY_RED_PRIMARY_Y: OHHDRMetadataKey = OHHDRMetadataKey(1); +} +impl OHHDRMetadataKey { + pub const OH_METAKEY_GREEN_PRIMARY_X: OHHDRMetadataKey = OHHDRMetadataKey(2); +} +impl OHHDRMetadataKey { + pub const OH_METAKEY_GREEN_PRIMARY_Y: OHHDRMetadataKey = OHHDRMetadataKey(3); +} +impl OHHDRMetadataKey { + pub const OH_METAKEY_BLUE_PRIMARY_X: OHHDRMetadataKey = OHHDRMetadataKey(4); +} +impl OHHDRMetadataKey { + pub const OH_METAKEY_BLUE_PRIMARY_Y: OHHDRMetadataKey = OHHDRMetadataKey(5); +} +impl OHHDRMetadataKey { + pub const OH_METAKEY_WHITE_PRIMARY_X: OHHDRMetadataKey = OHHDRMetadataKey(6); +} +impl OHHDRMetadataKey { + pub const OH_METAKEY_WHITE_PRIMARY_Y: OHHDRMetadataKey = OHHDRMetadataKey(7); +} +impl OHHDRMetadataKey { + pub const OH_METAKEY_MAX_LUMINANCE: OHHDRMetadataKey = OHHDRMetadataKey(8); +} +impl OHHDRMetadataKey { + pub const OH_METAKEY_MIN_LUMINANCE: OHHDRMetadataKey = OHHDRMetadataKey(9); +} +impl OHHDRMetadataKey { + pub const OH_METAKEY_MAX_CONTENT_LIGHT_LEVEL: OHHDRMetadataKey = OHHDRMetadataKey(10); +} +impl OHHDRMetadataKey { + pub const OH_METAKEY_MAX_FRAME_AVERAGE_LIGHT_LEVEL: OHHDRMetadataKey = OHHDRMetadataKey(11); +} +impl OHHDRMetadataKey { + pub const OH_METAKEY_HDR10_PLUS: OHHDRMetadataKey = OHHDRMetadataKey(12); +} +impl OHHDRMetadataKey { + pub const OH_METAKEY_HDR_VIVID: OHHDRMetadataKey = OHHDRMetadataKey(13); +} +#[repr(transparent)] +/** @brief Enumerates the HDR metadata keys. +@since 9 +@deprecated(since = "10")*/ +#[deprecated(since = "10")] +#[derive(Debug, Clone, Hash, PartialEq, Eq)] +pub struct OHHDRMetadataKey(pub ::core::ffi::c_uint); +/** @brief Defines the HDR metadata. +@since 9 +@deprecated(since = "10")*/ +#[deprecated(since = "10")] +#[repr(C)] +#[derive(Debug)] +pub struct OHHDRMetaData { + pub key: OHHDRMetadataKey, + pub value: f32, +} +/** @brief Defines the ExtData Handle +@since 9 +@deprecated(since = "10")*/ +#[deprecated(since = "10")] +#[repr(C)] +#[derive(Debug)] +pub struct OHExtDataHandle { + pub fd: i32, + pub reserveInts: u32, + pub reserve: __IncompleteArrayField, +} +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +impl OHSurfaceSource { + pub const OH_SURFACE_SOURCE_DEFAULT: OHSurfaceSource = OHSurfaceSource(0); +} +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +impl OHSurfaceSource { + pub const OH_SURFACE_SOURCE_UI: OHSurfaceSource = OHSurfaceSource(1); +} +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +impl OHSurfaceSource { + pub const OH_SURFACE_SOURCE_GAME: OHSurfaceSource = OHSurfaceSource(2); +} +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +impl OHSurfaceSource { + pub const OH_SURFACE_SOURCE_CAMERA: OHSurfaceSource = OHSurfaceSource(3); +} +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +impl OHSurfaceSource { + pub const OH_SURFACE_SOURCE_VIDEO: OHSurfaceSource = OHSurfaceSource(4); +} +#[repr(transparent)] +/** @brief Indicates the source type of surface. +@since 12*/ +#[cfg(feature = "api-12")] +#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] +#[derive(Debug, Clone, Hash, PartialEq, Eq)] +pub struct OHSurfaceSource(pub ::core::ffi::c_uint); +extern "C" { + /** @brief Creates a OHNativeWindow instance. A new OHNativeWindow instance is created each time this function is called. + + @syscap SystemCapability.Graphic.Graphic2D.NativeWindow + @param pSurface Indicates the pointer to a ProduceSurface. The type is a pointer to sptr. + @return Returns the pointer to the OHNativeWindow instance created. + @since 8 + @version 1.0 + @deprecated since 12*/ + #[deprecated(since = "12")] + pub fn OH_NativeWindow_CreateNativeWindow( + pSurface: *mut ::core::ffi::c_void, + ) -> *mut OHNativeWindow; + /** @brief Decreases the reference count of a OHNativeWindow instance by 1, and when the reference count reaches 0, destroys the instance. + + @syscap SystemCapability.Graphic.Graphic2D.NativeWindow + @param window Indicates the pointer to a OHNativeWindow instance. + @since 8 + @version 1.0*/ + pub fn OH_NativeWindow_DestroyNativeWindow(window: *mut OHNativeWindow); + /** @brief Creates a OHNativeWindowBuffer instance. A new OHNativeWindowBuffer instance is created each time this function is called. + + @syscap SystemCapability.Graphic.Graphic2D.NativeWindow + @param pSurfaceBuffer Indicates the pointer to a produce buffer. The type is sptr. + @return Returns the pointer to the OHNativeWindowBuffer instance created. + @since 8 + @version 1.0 + @deprecated since 12 + @useinstead OH_NativeWindow_CreateNativeWindowBufferFromNativeBuffer*/ + #[deprecated(since = "12")] + pub fn OH_NativeWindow_CreateNativeWindowBufferFromSurfaceBuffer( + pSurfaceBuffer: *mut ::core::ffi::c_void, + ) -> *mut OHNativeWindowBuffer; + /** @brief Creates a OHNativeWindowBuffer instance. + A new OHNativeWindowBuffer instance is created each time this function is called. + + @syscap SystemCapability.Graphic.Graphic2D.NativeWindow + @param nativeBuffer Indicates the pointer to a native buffer. The type is OH_NativeBuffer*. + @return Returns the pointer to the OHNativeWindowBuffer instance created. + @since 11 + @version 1.0*/ + #[cfg(feature = "api-11")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] + pub fn OH_NativeWindow_CreateNativeWindowBufferFromNativeBuffer( + nativeBuffer: *mut OH_NativeBuffer, + ) -> *mut OHNativeWindowBuffer; + /** @brief Decreases the reference count of a OHNativeWindowBuffer instance by 1 and, when the reference count reaches 0, destroys the instance. + + @syscap SystemCapability.Graphic.Graphic2D.NativeWindow + @param buffer Indicates the pointer to a OHNativeWindowBuffer instance. + @since 8 + @version 1.0*/ + pub fn OH_NativeWindow_DestroyNativeWindowBuffer(buffer: *mut OHNativeWindowBuffer); + /** @brief Requests a OHNativeWindowBuffer through a OHNativeWindow instance for content production. + + @syscap SystemCapability.Graphic.Graphic2D.NativeWindow + @param window Indicates the pointer to a OHNativeWindow instance. + @param buffer Indicates the double pointer to a OHNativeWindowBuffer instance. + @param fenceFd Indicates the pointer to a file descriptor handle. + @return Returns an error code, 0 is success, otherwise, failed. + @since 8 + @version 1.0*/ + pub fn OH_NativeWindow_NativeWindowRequestBuffer( + window: *mut OHNativeWindow, + buffer: *mut *mut OHNativeWindowBuffer, + fenceFd: *mut ::core::ffi::c_int, + ) -> i32; + /** @brief Flushes the OHNativeWindowBuffer filled with the content to the buffer queue through a OHNativeWindow instance for content consumption. + + @syscap SystemCapability.Graphic.Graphic2D.NativeWindow + @param window Indicates the pointer to a OHNativeWindow instance. + @param buffer Indicates the pointer to a OHNativeWindowBuffer instance. + @param fenceFd Indicates a file descriptor handle, which is used for timing synchronization. + @param region Indicates a dirty region where content is updated. + @return Returns an error code, 0 is success, otherwise, failed. + @since 8 + @version 1.0*/ + pub fn OH_NativeWindow_NativeWindowFlushBuffer( + window: *mut OHNativeWindow, + buffer: *mut OHNativeWindowBuffer, + fenceFd: ::core::ffi::c_int, + region: Region, + ) -> i32; + /** @brief Get the last flushed OHNativeWindowBuffer from a OHNativeWindow instance. + + @syscap SystemCapability.Graphic.Graphic2D.NativeWindow + @param window Indicates the pointer to a OHNativeWindow instance. + @param buffer Indicates the pointer to a OHNativeWindowBuffer pointer. + @param fenceFd Indicates the pointer to a file descriptor handle. + @param matrix Indicates the retrieved 4*4 transform matrix. + @return Returns an error code, 0 is success, otherwise, failed. + @since 11 + @version 1.0 + @deprecated since 12 + @useinstead OH_NativeWindow_GetLastFlushedBufferV2*/ + #[cfg(feature = "api-11")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))] + #[deprecated(since = "12")] + pub fn OH_NativeWindow_GetLastFlushedBuffer( + window: *mut OHNativeWindow, + buffer: *mut *mut OHNativeWindowBuffer, + fenceFd: *mut ::core::ffi::c_int, + matrix: *mut f32, + ) -> i32; + /** @brief Returns the OHNativeWindowBuffer to the buffer queue through a OHNativeWindow instance, without filling in any content. The OHNativeWindowBuffer can be used for another request. + + @syscap SystemCapability.Graphic.Graphic2D.NativeWindow + @param window Indicates the pointer to a OHNativeWindow instance. + @param buffer Indicates the pointer to a OHNativeWindowBuffer instance. + @return Returns an error code, 0 is success, otherwise, failed. + @since 8 + @version 1.0*/ + pub fn OH_NativeWindow_NativeWindowAbortBuffer( + window: *mut OHNativeWindow, + buffer: *mut OHNativeWindowBuffer, + ) -> i32; + /** @brief Sets or obtains the attributes of a native window, including the width, height, and content format. + + @syscap SystemCapability.Graphic.Graphic2D.NativeWindow + @param window Indicates the pointer to a OHNativeWindow instance. + @param code Indicates the operation code, pointer to NativeWindowOperation. + @param ... variable parameter, must correspond to code one-to-one. + @return Returns an error code, 0 is success, otherwise, failed. + @since 8 + @version 1.0*/ + pub fn OH_NativeWindow_NativeWindowHandleOpt( + window: *mut OHNativeWindow, + code: ::core::ffi::c_int, + ... + ) -> i32; + /** @brief Obtains the pointer to a BufferHandle of a OHNativeWindowBuffer instance. + + @syscap SystemCapability.Graphic.Graphic2D.NativeWindow + @param buffer Indicates the pointer to a OHNativeWindowBuffer instance. + @return Returns the pointer to the BufferHandle instance obtained. + @since 8 + @version 1.0*/ + pub fn OH_NativeWindow_GetBufferHandleFromNative( + buffer: *mut OHNativeWindowBuffer, + ) -> *mut BufferHandle; + /** @brief Adds the reference count of a native object. + + @syscap SystemCapability.Graphic.Graphic2D.NativeWindow + @param obj Indicates the pointer to a OHNativeWindow or OHNativeWindowBuffer instance. + @return Returns an error code, 0 is success, otherwise, failed. + @since 8 + @version 1.0*/ + pub fn OH_NativeWindow_NativeObjectReference(obj: *mut ::core::ffi::c_void) -> i32; + /** @brief Decreases the reference count of a native object and, when the reference count reaches 0, destroys this object. + + @syscap SystemCapability.Graphic.Graphic2D.NativeWindow + @param obj Indicates the pointer to a OHNativeWindow or OHNativeWindowBuffer instance. + @return Returns an error code, 0 is success, otherwise, failed. + @since 8 + @version 1.0*/ + pub fn OH_NativeWindow_NativeObjectUnreference(obj: *mut ::core::ffi::c_void) -> i32; + /** @brief Obtains the magic ID of a native object. + + @syscap SystemCapability.Graphic.Graphic2D.NativeWindow + @param obj Indicates the pointer to a OHNativeWindow or OHNativeWindowBuffer instance. + @return Returns the magic ID, which is unique for each native object. + @since 8 + @version 1.0*/ + pub fn OH_NativeWindow_GetNativeObjectMagic(obj: *mut ::core::ffi::c_void) -> i32; + /** @brief Sets scalingMode of a native window. + + @syscap SystemCapability.Graphic.Graphic2D.NativeWindow + @param window Indicates the pointer to a OHNativeWindow instance. + @param sequence Indicates the sequence to a produce buffer. + @param scalingMode Indicates the enum value to OHScalingMode + @return Returns an error code, 0 is success, otherwise, failed. + @since 9 + @version 1.0 + @deprecated(since = "10")*/ + #[deprecated(since = "10")] + pub fn OH_NativeWindow_NativeWindowSetScalingMode( + window: *mut OHNativeWindow, + sequence: u32, + scalingMode: OHScalingMode, + ) -> i32; + /** @brief Sets metaData of a native window. + + @syscap SystemCapability.Graphic.Graphic2D.NativeWindow + @param window Indicates the pointer to a OHNativeWindow instance. + @param sequence Indicates the sequence to a produce buffer. + @param size Indicates the size of a OHHDRMetaData vector. + @param metaDate Indicates the pointer to a OHHDRMetaData vector. + @return Returns an error code, 0 is success, otherwise, failed. + @since 9 + @version 1.0 + @deprecated(since = "10")*/ + #[deprecated(since = "10")] + pub fn OH_NativeWindow_NativeWindowSetMetaData( + window: *mut OHNativeWindow, + sequence: u32, + size: i32, + metaData: *const OHHDRMetaData, + ) -> i32; + /** @brief Sets metaDataSet of a native window. + + @syscap SystemCapability.Graphic.Graphic2D.NativeWindow + @param window Indicates the pointer to a OHNativeWindow instance. + @param sequence Indicates the sequence to a produce buffer. + @param key Indicates the enum value to OHHDRMetadataKey + @param size Indicates the size of a uint8_t vector. + @param metaDate Indicates the pointer to a uint8_t vector. + @return Returns an error code, 0 is success, otherwise, failed. + @since 9 + @version 1.0 + @deprecated(since = "10")*/ + #[deprecated(since = "10")] + pub fn OH_NativeWindow_NativeWindowSetMetaDataSet( + window: *mut OHNativeWindow, + sequence: u32, + key: OHHDRMetadataKey, + size: i32, + metaData: *const u8, + ) -> i32; + /** @brief Sets tunnel handle of a native window. + + @syscap SystemCapability.Graphic.Graphic2D.NativeWindow + @param window Indicates the pointer to a OHNativeWindow instance. + @param handle Indicates the pointer to a OHExtDataHandle. + @return Returns an error code, 0 is success, otherwise, failed. + @since 9 + @version 1.0 + @deprecated(since = "10")*/ + #[deprecated(since = "10")] + pub fn OH_NativeWindow_NativeWindowSetTunnelHandle( + window: *mut OHNativeWindow, + handle: *const OHExtDataHandle, + ) -> i32; + /** @brief Attach a buffer to an OHNativeWindow instance. + + @syscap SystemCapability.Graphic.Graphic2D.NativeWindow + @param window Indicates the pointer to an OHNativeWindow instance. + @param buffer Indicates the pointer to a OHNativeWindowBuffer instance. + @return Returns an error code, 0 is success, otherwise, failed. + @since 12 + @version 1.0*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] + pub fn OH_NativeWindow_NativeWindowAttachBuffer( + window: *mut OHNativeWindow, + buffer: *mut OHNativeWindowBuffer, + ) -> i32; + /** @brief Detach a buffer from an OHNativeWindow instance. + + @syscap SystemCapability.Graphic.Graphic2D.NativeWindow + @param window Indicates the pointer to an OHNativeWindow instance. + @param buffer Indicates the pointer to a OHNativeWindowBuffer instance. + @return Returns an error code, 0 is success, otherwise, failed. + @since 12 + @version 1.0*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] + pub fn OH_NativeWindow_NativeWindowDetachBuffer( + window: *mut OHNativeWindow, + buffer: *mut OHNativeWindowBuffer, + ) -> i32; + /** @brief Get surfaceId from native window. + + @syscap SystemCapability.Graphic.Graphic2D.NativeWindow + @param window Indicates the pointer to an OHNativeWindow instance. + @param surfaceId Indicates the pointer to a surfaceId. + @return Returns an error code, 0 is success, otherwise, failed. + @since 12 + @version 1.0*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] + pub fn OH_NativeWindow_GetSurfaceId(window: *mut OHNativeWindow, surfaceId: *mut u64) -> i32; + /** @brief Creates an OHNativeWindow instance.\n + + @syscap SystemCapability.Graphic.Graphic2D.NativeWindow + @param surfaceId Indicates the surfaceId to a surface. + @param window indicates the pointer to an OHNativeWindow instance. + @return Returns an error code, 0 is Success, otherwise, failed. + @since 12 + @version 1.0*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] + pub fn OH_NativeWindow_CreateNativeWindowFromSurfaceId( + surfaceId: u64, + window: *mut *mut OHNativeWindow, + ) -> i32; + /** @brief Sets scalingMode of a native window. + + @syscap SystemCapability.Graphic.Graphic2D.NativeWindow + @param window indicates the pointer to an OHNativeWindow instance. + @param scalingMode Indicates the enum value to OHScalingModeV2 + @return Returns an error code, 0 is Success, otherwise, failed. + @since 12 + @version 1.0*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] + pub fn OH_NativeWindow_NativeWindowSetScalingModeV2( + window: *mut OHNativeWindow, + scalingMode: OHScalingModeV2, + ) -> i32; + /** @brief Set native window buffer hold. + + @syscap SystemCapability.Graphic.Graphic2D.NativeWindow + @param window Indicates the pointer to an OHNativeWindow instance. + @since 12 + @version 1.0*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] + pub fn OH_NativeWindow_SetBufferHold(window: *mut OHNativeWindow); + /** @brief Write an OHNativeWindow to an OHIPCParcel. + + @syscap SystemCapability.Graphic.Graphic2D.NativeWindow + @param window Indicates the pointer to an OHNativeWindow instance. + @param parcel Indicates the pointer to an OHIPCParcel instance. + @return 0 - Success. + 40001000 - parcel is NULL or window is NULL. + @since 12 + @version 1.0*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] + pub fn OH_NativeWindow_WriteToParcel( + window: *mut OHNativeWindow, + parcel: *mut OHIPCParcel, + ) -> i32; + /** @brief Read an OHNativeWindow from an OHIPCParcel. + + @syscap SystemCapability.Graphic.Graphic2D.NativeWindow + @param parcel Indicates the pointer to an OHIPCParcel instance. + @param window Indicates the pointer to an OHNativeWindow instance. + @return 0 - Success. + 40001000 - parcel is NULL or parcel does not contain the window. + @since 12 + @version 1.0*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] + pub fn OH_NativeWindow_ReadFromParcel( + parcel: *mut OHIPCParcel, + window: *mut *mut OHNativeWindow, + ) -> i32; + /** @brief Get the last flushed OHNativeWindowBuffer from an OHNativeWindow instance. + + @syscap SystemCapability.Graphic.Graphic2D.NativeWindow + @param window Indicates the pointer to an OHNativeWindow instance. + @param buffer Indicates the pointer to an OHNativeWindowBuffer pointer. + @param fenceFd Indicates the pointer to a file descriptor handle. + @param matrix Indicates the retrieved 4*4 transform matrix. + @return 0 - Success. + 40001000 - window is NULL or buffer is NULL or fenceFd is NULL. + 41207000 - buffer state is wrong. + @since 12 + @version 1.0*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] + pub fn OH_NativeWindow_GetLastFlushedBufferV2( + window: *mut OHNativeWindow, + buffer: *mut *mut OHNativeWindowBuffer, + fenceFd: *mut ::core::ffi::c_int, + matrix: *mut f32, + ) -> i32; + /** @brief Set the color space of the native window. + + @syscap SystemCapability.Graphic.Graphic2D.NativeWindow + @param window Indicates the pointer to a OHNativeWindow instance. + @param colorSpace Indicates the color space of native window, see OH_NativeBuffer_ColorSpace. + @return {@link NATIVE_ERROR_OK} 0 - Success. + {@link NATIVE_ERROR_INVALID_ARGUMENTS} 40001000 - window is NULL. + {@link NATIVE_ERROR_BUFFER_STATE_INVALID} 41207000 - Incorrect colorSpace state. + @since 12 + @version 1.0*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] + pub fn OH_NativeWindow_SetColorSpace( + window: *mut OHNativeWindow, + colorSpace: OH_NativeBuffer_ColorSpace, + ) -> i32; + /** @brief Get the color space of the native window. + + @syscap SystemCapability.Graphic.Graphic2D.NativeWindow + @param window Indicates the pointer to a OHNativeWindow instance. + @param colorSpace Indicates the color space of native window, see OH_NativeBuffer_ColorSpace. + @return {@link NATIVE_ERROR_OK} 0 - Success. + {@link NATIVE_ERROR_INVALID_ARGUMENTS} 40001000 - window is NULL. + {@link NATIVE_ERROR_BUFFER_STATE_INVALID} 41207000 - Incorrect colorSpace state. + @since 12 + @version 1.0*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] + pub fn OH_NativeWindow_GetColorSpace( + window: *mut OHNativeWindow, + colorSpace: *mut OH_NativeBuffer_ColorSpace, + ) -> i32; + /** @brief Set the metadata type of the native window. + + @syscap SystemCapability.Graphic.Graphic2D.NativeWindow + @param window Indicates the pointer to a OHNativeWindow instance. + @param metadataKey Indicates the metadata type of native window, see OH_NativeBuffer_MetadataKey. + @param size Indicates the size of a uint8_t vector. + @param metadata Indicates the pointer to a uint8_t vector. + @return {@link NATIVE_ERROR_OK} 0 - Success. + {@link NATIVE_ERROR_INVALID_ARGUMENTS} 40001000 - window or metadata is NULL. + {@link NATIVE_ERROR_BUFFER_STATE_INVALID} 41207000 - Incorrect metadata state. + {@link NATIVE_ERROR_UNSUPPORTED} 50102000 - Unsupported metadata key. + @since 12 + @version 1.0*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] + pub fn OH_NativeWindow_SetMetadataValue( + window: *mut OHNativeWindow, + metadataKey: OH_NativeBuffer_MetadataKey, + size: i32, + metadata: *mut u8, + ) -> i32; + /** @brief Set the metadata type of the native window. + + @syscap SystemCapability.Graphic.Graphic2D.NativeWindow + @param window Indicates the pointer to a OHNativeWindow instance. + @param metadataKey Indicates the metadata type of native window, see OH_NativeBuffer_MetadataKey. + @param size Indicates the size of a uint8_t vector. + @param metadata Indicates the pointer to a uint8_t vector. + @return {@link NATIVE_ERROR_OK} 0 - Success. + {@link NATIVE_ERROR_INVALID_ARGUMENTS} 40001000 - window, metadata, or size is NULL. + {@link NATIVE_ERROR_BUFFER_STATE_INVALID} 41207000 - Incorrect metadata state. + {@link NATIVE_ERROR_UNSUPPORTED} 50102000 - Unsupported metadata key. + @since 12 + @version 1.0*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] + pub fn OH_NativeWindow_GetMetadataValue( + window: *mut OHNativeWindow, + metadataKey: OH_NativeBuffer_MetadataKey, + size: *mut i32, + metadata: *mut *mut u8, + ) -> i32; +} diff --git a/src/syscap.rs b/src/syscap.rs index 63087e1..dbf0cc7 100644 --- a/src/syscap.rs +++ b/src/syscap.rs @@ -1,5 +1,5 @@ ///! Bindings to check a devices system capabilites at runtime /// /// [Official SystemCapability Documentation](https://docs.openharmony.cn/pages/v5.0/en/application-dev/reference/syscap.md) -mod syscap_api10; -pub use syscap_api10::*; +mod syscap_ffi; +pub use syscap_ffi::*; diff --git a/src/syscap/syscap_api11.rs b/src/syscap/syscap_api11.rs deleted file mode 100644 index 78bc105..0000000 --- a/src/syscap/syscap_api11.rs +++ /dev/null @@ -1,9 +0,0 @@ -/* automatically generated by rust-bindgen 0.69.4 */ - -#![allow(non_upper_case_globals)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] - -extern "C" { - pub fn canIUse(cap: *const ::core::ffi::c_char) -> bool; -} diff --git a/src/syscap/syscap_api12.rs b/src/syscap/syscap_api12.rs deleted file mode 100644 index 58d3d41..0000000 --- a/src/syscap/syscap_api12.rs +++ /dev/null @@ -1,9 +0,0 @@ -/* automatically generated by rust-bindgen 0.70.1 */ - -#![allow(non_upper_case_globals)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] - -extern "C" { - pub fn canIUse(cap: *const ::core::ffi::c_char) -> bool; -} diff --git a/src/syscap/syscap_api10.rs b/src/syscap/syscap_ffi.rs similarity index 76% rename from src/syscap/syscap_api10.rs rename to src/syscap/syscap_ffi.rs index 78bc105..cecf6d6 100644 --- a/src/syscap/syscap_api10.rs +++ b/src/syscap/syscap_ffi.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.71.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] diff --git a/src/vsync.rs b/src/vsync.rs index 1173611..06bad98 100644 --- a/src/vsync.rs +++ b/src/vsync.rs @@ -3,12 +3,5 @@ #[link(name = "native_vsync")] extern "C" {} -mod vsync_api10; -pub use vsync_api10::*; - -#[cfg(feature = "api-12")] -#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] -mod api12_additions; -#[cfg(feature = "api-12")] -#[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] -pub use api12_additions::*; +mod vsync_ffi; +pub use vsync_ffi::*; diff --git a/src/vsync/api12_additions.rs b/src/vsync/api12_additions.rs deleted file mode 100644 index 94390ed..0000000 --- a/src/vsync/api12_additions.rs +++ /dev/null @@ -1,25 +0,0 @@ -#![allow(non_upper_case_globals)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] - -use crate::vsync::{OH_NativeVSync, OH_NativeVSync_FrameCallback}; - -extern "C" { - /** @brief Request next vsync with callback. - If this function is called multiple times in one vsync period, all these callbacks and dataset will be called. - - @syscap SystemCapability.Graphic.Graphic2D.NativeVsync - @param nativeVsync Indicates the pointer to a NativeVsync. - @param callback Indicates the OH_NativeVSync_FrameCallback which will be called when next vsync coming. - @param data Indicates data whick will be used in callback. - @return {@link NATIVE_ERROR_OK} 0 - Success. - {@link NATIVE_ERROR_INVALID_ARGUMENTS} 40001000 - the parameter nativeVsync is NULL or callback is NULL. - {@link NATIVE_ERROR_BINDER_ERROR} 50401000 - ipc send failed. - @since 12 - @version 1.0*/ - pub fn OH_NativeVSync_RequestFrameWithMultiCallback( - nativeVsync: *mut OH_NativeVSync, - callback: OH_NativeVSync_FrameCallback, - data: *mut ::core::ffi::c_void, - ) -> ::core::ffi::c_int; -} diff --git a/src/vsync/vsync_api10.rs b/src/vsync/vsync_api10.rs deleted file mode 100644 index 890e46f..0000000 --- a/src/vsync/vsync_api10.rs +++ /dev/null @@ -1,62 +0,0 @@ -/* automatically generated by rust-bindgen 0.69.4 */ - -#![allow(non_upper_case_globals)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] - -#[repr(C)] -pub struct OH_NativeVSync { - _unused: [u8; 0], -} -pub type OH_NativeVSync_FrameCallback = ::core::option::Option< - unsafe extern "C" fn(timestamp: ::core::ffi::c_longlong, data: *mut ::core::ffi::c_void), ->; -extern "C" { - /** @brief Creates a NativeVsync instance.\n - A new NativeVsync instance is created each time this function is called. - - @syscap SystemCapability.Graphic.Graphic2D.NativeVsync - @param name Indicates the vsync connection name. - @param length Indicates the name's length. - @return Returns the pointer to the NativeVsync instance created. - @since 9 - @version 1.0*/ - pub fn OH_NativeVSync_Create( - name: *const ::core::ffi::c_char, - length: ::core::ffi::c_uint, - ) -> *mut OH_NativeVSync; - /** @brief Delete the NativeVsync instance. - - @syscap SystemCapability.Graphic.Graphic2D.NativeVsync - @param window Indicates the pointer to a NativeVsync instance. - @return Returns int32_t, return value == 0, success, otherwise, failed. - @since 9 - @version 1.0*/ - pub fn OH_NativeVSync_Destroy(nativeVsync: *mut OH_NativeVSync); - /** @brief Request next vsync with callback. - - @syscap SystemCapability.Graphic.Graphic2D.NativeVsync - @param nativeVsync Indicates the pointer to a NativeVsync. - @param callback Indicates the OH_NativeVSync_FrameCallback which will be called when next vsync coming. - @param data Indicates data whick will be used in callback. - @return Returns int32_t, return value == 0, success, otherwise, failed. - @since 9 - @version 1.0*/ - pub fn OH_NativeVSync_RequestFrame( - nativeVsync: *mut OH_NativeVSync, - callback: OH_NativeVSync_FrameCallback, - data: *mut ::core::ffi::c_void, - ) -> ::core::ffi::c_int; - /** @brief Get vsync period. - - @syscap SystemCapability.Graphic.Graphic2D.NativeVsync - @param nativeVsync Indicates the pointer to a NativeVsync. - @param period Indicates the vsync period. - @return Returns int32_t, return value == 0, success, otherwise, failed. - @since 10 - @version 1.0*/ - pub fn OH_NativeVSync_GetPeriod( - nativeVsync: *mut OH_NativeVSync, - period: *mut ::core::ffi::c_longlong, - ) -> ::core::ffi::c_int; -} diff --git a/src/vsync/vsync_api11.rs b/src/vsync/vsync_api11.rs deleted file mode 100644 index 890e46f..0000000 --- a/src/vsync/vsync_api11.rs +++ /dev/null @@ -1,62 +0,0 @@ -/* automatically generated by rust-bindgen 0.69.4 */ - -#![allow(non_upper_case_globals)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] - -#[repr(C)] -pub struct OH_NativeVSync { - _unused: [u8; 0], -} -pub type OH_NativeVSync_FrameCallback = ::core::option::Option< - unsafe extern "C" fn(timestamp: ::core::ffi::c_longlong, data: *mut ::core::ffi::c_void), ->; -extern "C" { - /** @brief Creates a NativeVsync instance.\n - A new NativeVsync instance is created each time this function is called. - - @syscap SystemCapability.Graphic.Graphic2D.NativeVsync - @param name Indicates the vsync connection name. - @param length Indicates the name's length. - @return Returns the pointer to the NativeVsync instance created. - @since 9 - @version 1.0*/ - pub fn OH_NativeVSync_Create( - name: *const ::core::ffi::c_char, - length: ::core::ffi::c_uint, - ) -> *mut OH_NativeVSync; - /** @brief Delete the NativeVsync instance. - - @syscap SystemCapability.Graphic.Graphic2D.NativeVsync - @param window Indicates the pointer to a NativeVsync instance. - @return Returns int32_t, return value == 0, success, otherwise, failed. - @since 9 - @version 1.0*/ - pub fn OH_NativeVSync_Destroy(nativeVsync: *mut OH_NativeVSync); - /** @brief Request next vsync with callback. - - @syscap SystemCapability.Graphic.Graphic2D.NativeVsync - @param nativeVsync Indicates the pointer to a NativeVsync. - @param callback Indicates the OH_NativeVSync_FrameCallback which will be called when next vsync coming. - @param data Indicates data whick will be used in callback. - @return Returns int32_t, return value == 0, success, otherwise, failed. - @since 9 - @version 1.0*/ - pub fn OH_NativeVSync_RequestFrame( - nativeVsync: *mut OH_NativeVSync, - callback: OH_NativeVSync_FrameCallback, - data: *mut ::core::ffi::c_void, - ) -> ::core::ffi::c_int; - /** @brief Get vsync period. - - @syscap SystemCapability.Graphic.Graphic2D.NativeVsync - @param nativeVsync Indicates the pointer to a NativeVsync. - @param period Indicates the vsync period. - @return Returns int32_t, return value == 0, success, otherwise, failed. - @since 10 - @version 1.0*/ - pub fn OH_NativeVSync_GetPeriod( - nativeVsync: *mut OH_NativeVSync, - period: *mut ::core::ffi::c_longlong, - ) -> ::core::ffi::c_int; -} diff --git a/src/vsync/vsync_api12.rs b/src/vsync/vsync_ffi.rs similarity index 96% rename from src/vsync/vsync_api12.rs rename to src/vsync/vsync_ffi.rs index 372350a..150fd4f 100644 --- a/src/vsync/vsync_api12.rs +++ b/src/vsync/vsync_ffi.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.70.1 */ +/* automatically generated by rust-bindgen 0.71.1 */ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] @@ -61,6 +61,8 @@ extern "C" { {@link NATIVE_ERROR_BINDER_ERROR} 50401000 - ipc send failed. @since 12 @version 1.0*/ + #[cfg(feature = "api-12")] + #[cfg_attr(docsrs, doc(cfg(feature = "api-12")))] pub fn OH_NativeVSync_RequestFrameWithMultiCallback( nativeVsync: *mut OH_NativeVSync, callback: OH_NativeVSync_FrameCallback,