From d24c75256f15cb74a4c2aa6c1782ba5700e4420d Mon Sep 17 00:00:00 2001 From: sunbees Date: Sat, 13 Sep 2025 21:01:08 +0800 Subject: [PATCH] add xcomponent opaque interface Signed-off-by: sunbees --- arkui/ace_engine/native/libace.ndk.json | 16 +++++++ .../native/native_interface_xcomponent.h | 46 +++++++++++++++++++ 2 files changed, 62 insertions(+) diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index dc3d30be4c1..1b92896e6b3 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -4138,5 +4138,21 @@ { "first_introduced": "21", "name": "OH_ArkUI_ContentTransitionEffect_Create" + }, + { + "first_introduced": "22", + "name": "OH_ArkUI_XComponentSurfaceOptions_Create" + }, + { + "first_introduced": "22", + "name": "OH_ArkUI_XComponentSurfaceOptions_Dispose" + }, + { + "first_introduced": "22", + "name": "OH_ArkUI_XComponentSurfaceOptions_SetIsOpaque" + }, + { + "first_introduced": "22", + "name": "OH_ArkUI_SurfaceHolder_SetSurfaceOptions" } ] \ No newline at end of file diff --git a/arkui/ace_engine/native/native_interface_xcomponent.h b/arkui/ace_engine/native/native_interface_xcomponent.h index 35dfa7934ec..e86aceec6d7 100644 --- a/arkui/ace_engine/native/native_interface_xcomponent.h +++ b/arkui/ace_engine/native/native_interface_xcomponent.h @@ -1308,6 +1308,52 @@ void OH_ArkUI_SurfaceCallback_SetSurfaceShowEvent( void OH_ArkUI_SurfaceCallback_SetSurfaceHideEvent( OH_ArkUI_SurfaceCallback* callback, void (*onSurfaceHide)(OH_ArkUI_SurfaceHolder* surfaceHolder)); + +/** + * @brief Declares the options for Surface held by XComponent. + * + * @since 22 + */ +typedef struct ArkUI_XComponentSurfaceOptions ArkUI_XComponentSurfaceOptions; + +/** + * @brief Create an ArkUI_XComponentSurfaceOptions object. + * + * @return A pointer to the object of the XComponent's surface options. + * @since 22 + */ +ArkUI_XComponentSurfaceOptions* OH_ArkUI_XComponentSurfaceOptions_Create(); + +/** + * @brief Dispose of an ArkUI_XComponentSurfaceOptions object. + * + * @param option A pointer to the object of the XComponent's surface options to be destroyed. + * @since 22 + */ +void OH_ArkUI_XComponentSurfaceOptions_Dispose(ArkUI_XComponentSurfaceOptions* options); + +/** + * @brief Set whether the surface held by XComponent is opaque. + * + * @param option A pointer to the object of the XComponent's surface options. + * @param isOpaque Indicates whether the surface held by XComponent is opaque. + * @since 22 + */ +void OH_ArkUI_XComponentSurfaceOptions_SetIsOpaque(ArkUI_XComponentSurfaceOptions* option, bool isOpaque); + +/** + * @brief Set surface options for this OH_ArkUI_SurfaceHolder instance. + * + * @param surfaceHolder Indicates the pointer to this OH_ArkUI_SurfaceHolder instance. + * @param options Indicates the pointer to the XComponent's surface options. + * @return Returns the status code of the execution. + * {@link ARKUI_ERROR_CODE_NO_ERROR} the execution is successful. + * {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs. + * @since 22 + */ +int32_t OH_ArkUI_SurfaceHolder_SetSurfaceOptions( + OH_ArkUI_SurfaceHolder *surfaceHolder, + ArkUI_XComponentSurfaceOptions *options); #ifdef __cplusplus }; #endif -- Gitee