From 2571e577fce73a9bbacaa0bb3c2e412628ebb5cc Mon Sep 17 00:00:00 2001 From: liyujie Date: Wed, 30 Jul 2025 10:42:26 +0800 Subject: [PATCH] Add drawable descriptor from Resource/DrawableDescriptor to native node ani interface Signed-off-by: liyujie Change-Id: I30798048824b627877af3c51767e61874a567966 --- arkui/ace_engine/native/libace.ndk.json | 10 +++++++- arkui/ace_engine/native/native_node_ani.h | 30 +++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index d320274f4..d34c30ea6 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -3043,7 +3043,7 @@ "first_introduced": "20", "name": "OH_ArkUI_DragEvent_SetDataLoadParams" }, - { + { "first_introduced": "20", "name": "OH_ArkUI_DragAction_SetDataLoadParams" }, @@ -3530,5 +3530,13 @@ { "first_introduced": "20", "name": "OH_ArkUI_NativeModule_GetNavDestinationAniParam" + }, + { + "first_introduced": "20", + "name": "OH_ArkUI_NativeModule_GetDrawableDescriptorFromAniValue" + }, + { + "first_introduced": "20", + "name": "OH_ArkUI_NativeModule_GetDrawableDescriptorFromResourceAniValue" } ] \ No newline at end of file diff --git a/arkui/ace_engine/native/native_node_ani.h b/arkui/ace_engine/native/native_node_ani.h index 549871cf9..630c5ece1 100644 --- a/arkui/ace_engine/native/native_node_ani.h +++ b/arkui/ace_engine/native/native_node_ani.h @@ -104,6 +104,36 @@ int32_t OH_ArkUI_NativeModule_GetNodeContentFromAniValue( */ ArkUI_ErrorCode OH_ArkUI_NativeModule_GetNavDestinationAniParam(ArkUI_NodeHandle node, ani_env* env, ani_value* param); +/** + * @brief Obtains a DrawableDescriptor object on the ArkTS side and maps it to an + * ArkUI_DrawableDescriptro object on the native side. + * + * @param env Indicates the ANI environment pointer. + * @param drawable Indicates the DrawableDescriptor object created on the ArkTS side. + * @param drawableDescriptor Indicates the pointer to the ArkUI_DrawableDescriptro object. + * @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 20 + */ +int32_t OH_ArkUI_NativeModule_GetDrawableDescriptorFromAniValue( + ani_env *env, ani_object drawable, ArkUI_DrawableDescriptor **drawableDescriptor); + +/** + * @brief Obtains a Resource object on the ArkTS side and maps it to an + * ArkUI_DrawableDescriptro object on the native side. + * + * @param env Indicates the ANI environment pointer. + * @param resource Indicates the Resource object created on the ArkTS side. + * @param drawableDescriptor Indicates the pointer to the ArkUI_DrawableDescriptro object. + * @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 20 + */ +int32_t OH_ArkUI_NativeModule_GetDrawableDescriptorFromResourceAniValue( + ani_env *env, ani_object resource, ArkUI_DrawableDescriptor **drawableDescriptor); + #ifdef __cplusplus }; #endif -- Gitee