From 9fe318c695ea299293bd6521e3d4be4c5d577562 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=B0=B8=E5=87=AF?= Date: Wed, 21 May 2025 17:29:09 +0800 Subject: [PATCH] get sdk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 刘永凯 --- arkui/ace_engine/native/libace.ndk.json | 8 +++++ arkui/ace_engine/native/native_gesture.h | 37 ++++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index 29a073a02..48c300a22 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -3362,5 +3362,13 @@ { "first_introduced": "20", "name": "OH_ArkUI_DragEvent_IsRemote" + }, + { + "first_introduced": "20", + "name": "OH_ArkUI_PreventGestureRecognizerBegin" + }, + { + "first_introduced": "20", + "name": "OH_ArkUI_SetTouchTestDoneCallback" } ] \ No newline at end of file diff --git a/arkui/ace_engine/native/native_gesture.h b/arkui/ace_engine/native/native_gesture.h index aa4b37c23..e553f1911 100644 --- a/arkui/ace_engine/native/native_gesture.h +++ b/arkui/ace_engine/native/native_gesture.h @@ -867,6 +867,43 @@ ArkUI_ErrorCode OH_ArkUI_PanGesture_SetDistanceMap( */ ArkUI_ErrorCode OH_ArkUI_PanGesture_GetDistanceByToolType( ArkUI_GestureRecognizer* recognizer, int toolType, double* distance); +/** + * @brief Registers a callback to be executed after all gesture recognizers have been collected. + * When the user begins touching the screen, the system performs hit testing and collects gesture + * recognizers based on the touch location. + * Subsequently, before processing any move events, the component can use this API to determine + * the gesture recognizers that will participate in the recognition and compete with each other. + * + * @param node Node to set the callback for gesture collection completion. + * @param userData Indicates the custom data. + * @param recognizerCollected Callback for gesture collection completion. + * @return Returns the result 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 + */ +ArkUI_ErrorCode OH_ArkUI_SetTouchTestDoneCallback( + ArkUI_NodeHandle node, + void* userData, + void (*touchTestDone)( + ArkUI_GestureEvent* event, + ArkUI_GestureRecognizerHandleArray recognizers, + int32_t count, + void* userData + ) +); + +/** + * @brief Prevents a gesture recognizer from participating in the current gesture recognition + * before all fingers are lifted. If the system has already determined the result of this gesture + * recognizer (whether successful or not), calling this API will have no effect. + * + * @param recognizer Pointer to the gesture recognizer. + * @return 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 + */ +ArkUI_ErrorCode OH_ArkUI_PreventGestureRecognizerBegin(ArkUI_GestureRecognizer* recognizer); /** * @brief Defines the gesture APIs. -- Gitee