From 25c444a400bb17d433a15125ba27d7dce4bc3f75 Mon Sep 17 00:00:00 2001 From: sunbees Date: Fri, 15 Mar 2024 14:33:17 +0800 Subject: [PATCH] add OH_NativeXComponent_GetTouchEventSourceType Signed-off-by: sunbees Change-Id: I77ef9b7e81d031ba6432c85caaf821b06f8db8e2 --- arkui/ace_engine/native/libace.ndk.json | 4 ++++ .../native/native_interface_xcomponent.h | 15 +++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index e650b1257..cd0a1bdfa 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -174,5 +174,9 @@ { "first_introduced": "12", "name": "OH_ArkUI_QueryModuleInterface" + }, + { + "first_introduced": "12", + "name": "OH_NativeXComponent_GetTouchEventSourceType" } ] \ 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 e3b615076..e1ae0dbef 100644 --- a/arkui/ace_engine/native/native_interface_xcomponent.h +++ b/arkui/ace_engine/native/native_interface_xcomponent.h @@ -717,6 +717,21 @@ int32_t OH_NativeXComponent_RegisterSurfaceHideCallback( int32_t OH_NativeXComponent_RegisterOnTouchInterceptCallback( OH_NativeXComponent* component, HitTestMode (*callback)(OH_NativeXComponent* component, ArkUI_UIInputEvent* event)); +/** + * @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 + */ +int32_t OH_NativeXComponent_GetTouchEventSourceType( + OH_NativeXComponent* component, int32_t pointId, OH_NativeXComponent_EventSourceType* sourceType); + #ifdef __cplusplus }; #endif -- Gitee