From e83f8cbe8476b1756f4d73fe0f3e2a90576db3e3 Mon Sep 17 00:00:00 2001 From: wangweiyuan Date: Mon, 2 Jun 2025 11:32:57 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=85=A8=E5=B1=80=E5=9D=90=E6=A0=87?= =?UTF-8?q?=E7=B3=BB=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangweiyuan --- arkui/ace_engine/native/drag_and_drop.h | 20 ++++++++++++++++++++ arkui/ace_engine/native/ui_input_event.h | 23 +++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/arkui/ace_engine/native/drag_and_drop.h b/arkui/ace_engine/native/drag_and_drop.h index a006c72b7..71393e5c1 100644 --- a/arkui/ace_engine/native/drag_and_drop.h +++ b/arkui/ace_engine/native/drag_and_drop.h @@ -391,6 +391,26 @@ float OH_ArkUI_DragEvent_GetTouchPointXToDisplay(ArkUI_DragEvent* event); */ float OH_ArkUI_DragEvent_GetTouchPointYToDisplay(ArkUI_DragEvent* event); +/** + * @brief Obtains the X coordinate of the touch point relative to the current display from a drag event. + * + * @param event Indicates the pointer to an ArkUI_DragEvent object. + * @return Returns the X coordinate of the touch point relative to the current display, in px. + * Returns the default value 0 if the input parameter is invalid. + * @since 20 + */ +float OH_ArkUI_DragEvent_GetTouchPointXToGlobalDisplay(ArkUI_DragEvent* event); + +/** + * @brief Obtains the Y coordinate of the touch point relative to the current display from a drag event. + * + * @param event Indicates the pointer to an ArkUI_DragEvent object. + * @return Returns the Y coordinate of the touch point relative to the current display, in px. + * Returns the default value 0 if the input parameter is invalid. + * @since 20 + */ +float OH_ArkUI_DragEvent_GetTouchPointYToGlobalDisplay(ArkUI_DragEvent* event); + /** * @brief Obtains the dragging velocity along the x-axis. * diff --git a/arkui/ace_engine/native/ui_input_event.h b/arkui/ace_engine/native/ui_input_event.h index fac4d040d..6c5c3047e 100644 --- a/arkui/ace_engine/native/ui_input_event.h +++ b/arkui/ace_engine/native/ui_input_event.h @@ -526,6 +526,24 @@ float OH_ArkUI_PointerEvent_GetDisplayY(const ArkUI_UIInputEvent* event); */ float OH_ArkUI_PointerEvent_GetDisplayYByIndex(const ArkUI_UIInputEvent* event, uint32_t pointerIndex); +/** + * @brief Obtains the X coordinate relative to the global display from a directional input + * event (such as a touch event, mouse event, or axis event). Only the pointer-likely event can be + * obtained the position information from. + * + * @param event Indicates the pointer to the UI input event. + * @return Returns the X coordinate relative to the global display; + * returns 0 if any parameter error occurs, such as one event passed which does not own position information. + * @since 20 + */ +float OH_ArkUI_PointerEvent_GetGlobalDisplayX(const ArkUI_UIInputEvent* event); + +float OH_ArkUI_PointerEvent_GetGlobalDisplayXByIndex(const ArkUI_UIInputEvent* event, uint32_t pointerIndex); + +float OH_ArkUI_PointerEvent_GetGlobalDisplayY(const ArkUI_UIInputEvent* event); + +float OH_ArkUI_PointerEvent_GetGlobalDisplayYByIndex(const ArkUI_UIInputEvent* event, uint32_t pointerIndex); + /** * @brief Obtains the pressure applied to the touchscreen from a directional input event (for example, a touch event). * @@ -758,6 +776,11 @@ float OH_ArkUI_PointerEvent_GetHistoryDisplayX( float OH_ArkUI_PointerEvent_GetHistoryDisplayY( const ArkUI_UIInputEvent* event, uint32_t pointerIndex, uint32_t historyIndex); +float OH_ArkUI_PointerEvent_GetHistoryGlobalDisplayX( + const ArkUI_UIInputEvent* event, uint32_t pointerIndex, uint32_t historyIndex); +float OH_ArkUI_PointerEvent_GetHistoryGlobalDisplayY( + const ArkUI_UIInputEvent* event, uint32_t pointerIndex, uint32_t historyIndex); + /** * @brief Obtains the pressure applied to the touchscreen in a specific historical event from a directional input event * (for example, a touch event).. -- Gitee From c667c40a1f32de685872c2d3a6828b8d2a9e4eab Mon Sep 17 00:00:00 2001 From: wangweiyuan Date: Tue, 3 Jun 2025 21:57:22 +0800 Subject: [PATCH 2/3] =?UTF-8?q?json=E6=96=87=E4=BB=B6=E4=B8=AD=E8=A1=A5?= =?UTF-8?q?=E5=85=85=E6=96=B0=E5=A2=9E=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangweiyuan --- arkui/ace_engine/native/libace.ndk.json | 32 +++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index a8f6e0e5c..af73b4039 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -3423,6 +3423,38 @@ "first_introduced": "20", "name": "OH_ArkUI_SurfaceCallback_SetSurfaceShowEvent" }, + { + "first_introduced": "20", + "name": "OH_ArkUI_DragEvent_GetTouchPointXToGlobalDisplay" + }, + { + "first_introduced": "20", + "name": "OH_ArkUI_DragEvent_GetTouchPointYToGlobalDisplay" + }, + { + "first_introduced": "20", + "name": "OH_ArkUI_PointerEvent_GetGlobalDisplayX" + }, + { + "first_introduced": "20", + "name": "OH_ArkUI_PointerEvent_GetGlobalDisplayY" + }, + { + "first_introduced": "20", + "name": "OH_ArkUI_PointerEvent_GetGlobalDisplayXByIndex" + }, + { + "first_introduced": "20", + "name": "OH_ArkUI_PointerEvent_GetGlobalDisplayYByIndex" + }, + { + "first_introduced": "20", + "name": "OH_ArkUI_PointerEvent_GetHistoryGlobalDisplayX" + }, + { + "first_introduced": "20", + "name": "OH_ArkUI_PointerEvent_GetHistoryGlobalDisplayY" + }, { "first_introduced": "20", "name": "OH_ArkUI_SurfaceCallback_SetSurfaceHideEvent" -- Gitee From bde4fb214d049ed81dd837d40651fac313e3e3c5 Mon Sep 17 00:00:00 2001 From: wangweiyuan Date: Mon, 16 Jun 2025 19:18:20 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangweiyuan --- arkui/ace_engine/native/drag_and_drop.h | 16 +++---- arkui/ace_engine/native/ui_input_event.h | 57 +++++++++++++++++++++--- 2 files changed, 59 insertions(+), 14 deletions(-) diff --git a/arkui/ace_engine/native/drag_and_drop.h b/arkui/ace_engine/native/drag_and_drop.h index 71393e5c1..1930df2fa 100644 --- a/arkui/ace_engine/native/drag_and_drop.h +++ b/arkui/ace_engine/native/drag_and_drop.h @@ -392,21 +392,21 @@ float OH_ArkUI_DragEvent_GetTouchPointXToDisplay(ArkUI_DragEvent* event); float OH_ArkUI_DragEvent_GetTouchPointYToDisplay(ArkUI_DragEvent* event); /** - * @brief Obtains the X coordinate of the touch point relative to the current display from a drag event. + * @brief Obtains the global display X coordinate of the touch point from an ArkUI_DragEvent object. * - * @param event Indicates the pointer to an ArkUI_DragEvent object. - * @return Returns the X coordinate of the touch point relative to the current display, in px. - * Returns the default value 0 if the input parameter is invalid. + * @param event Pointer to an ArkUI_DragEvent object. + * @return float Global display X coordinate of the touch point, in px. + * If the input parameter is invalid, the default value 0 is returned. * @since 20 */ float OH_ArkUI_DragEvent_GetTouchPointXToGlobalDisplay(ArkUI_DragEvent* event); /** - * @brief Obtains the Y coordinate of the touch point relative to the current display from a drag event. + * @brief Obtains the global display Y coordinate of the touch point from an ArkUI_DragEvent object. * - * @param event Indicates the pointer to an ArkUI_DragEvent object. - * @return Returns the Y coordinate of the touch point relative to the current display, in px. - * Returns the default value 0 if the input parameter is invalid. + * @param event Pointer to an ArkUI_DragEvent object. + * @return float Global display Y coordinate of the touch point, in px. + * If the input parameter is invalid, the default value 0 is returned. * @since 20 */ float OH_ArkUI_DragEvent_GetTouchPointYToGlobalDisplay(ArkUI_DragEvent* event); diff --git a/arkui/ace_engine/native/ui_input_event.h b/arkui/ace_engine/native/ui_input_event.h index 6c5c3047e..0f7d3fb73 100644 --- a/arkui/ace_engine/native/ui_input_event.h +++ b/arkui/ace_engine/native/ui_input_event.h @@ -527,21 +527,45 @@ float OH_ArkUI_PointerEvent_GetDisplayY(const ArkUI_UIInputEvent* event); float OH_ArkUI_PointerEvent_GetDisplayYByIndex(const ArkUI_UIInputEvent* event, uint32_t pointerIndex); /** - * @brief Obtains the X coordinate relative to the global display from a directional input - * event (such as a touch event, mouse event, or axis event). Only the pointer-likely event can be - * obtained the position information from. + * @brief Obtains the global display X coordinate from a pointer event (such as a touch, mouse, or axis event). * - * @param event Indicates the pointer to the UI input event. - * @return Returns the X coordinate relative to the global display; - * returns 0 if any parameter error occurs, such as one event passed which does not own position information. + * @param event Indicates the pointer to the current UI input event. + * @return float Global display X coordinate; 0.0f if any parameter error occurs. * @since 20 */ float OH_ArkUI_PointerEvent_GetGlobalDisplayX(const ArkUI_UIInputEvent* event); +/** + * @brief Obtains the global display X coordinate of a specific contact point from a pointer event + * (such as a touch, mouse, or axis event). + * For mouse and axis events, this API returns the default value of 0.0f if the given index is greater than 0. + * + * @param event Pointer to the current UI input event. + * @param pointerIndex Index of the target contact point in the contact point list. + * @return float Global display X coordinate; 0.0f if any parameter error occurs. + * @since 20 + */ float OH_ArkUI_PointerEvent_GetGlobalDisplayXByIndex(const ArkUI_UIInputEvent* event, uint32_t pointerIndex); +/** + * @brief Obtains the global display Y coordinate from a pointer event (such as a touch, mouse, or axis event). + * + * @param event Indicates the pointer to the current UI input event. + * @return float Global display Y coordinate; 0.0f if any parameter error occurs. + * @since 20 + */ float OH_ArkUI_PointerEvent_GetGlobalDisplayY(const ArkUI_UIInputEvent* event); +/** + * @brief Obtains the global display Y coordinate of a specific contact point from a pointer event + * (such as a touch, mouse, or axis event). + * For mouse and axis events, this API returns the default value of 0.0f if the given index is greater than 0. + * + * @param event Pointer to the current UI input event. + * @param pointerIndex Index of the target contact point in the contact point list. + * @return float Global display Y coordinate; 0.0f if any parameter error occurs. + * @since 20 + */ float OH_ArkUI_PointerEvent_GetGlobalDisplayYByIndex(const ArkUI_UIInputEvent* event, uint32_t pointerIndex); /** @@ -776,8 +800,29 @@ float OH_ArkUI_PointerEvent_GetHistoryDisplayX( float OH_ArkUI_PointerEvent_GetHistoryDisplayY( const ArkUI_UIInputEvent* event, uint32_t pointerIndex, uint32_t historyIndex); +/** + * @brief Obtains the global display X coordinate of a specific touch point in a historical event from a pointer event + * (such as a touch, mouse, or axis event). + * + * @param event Pointer to the current UI input event. + * @param pointerIndex Index of the target touch point in the multi-touch data list. + * @param historyIndex Index of the target historical event. + * @return float Global display X coordinate; 0.0f if any parameter error occurs. + * @since 20 + */ float OH_ArkUI_PointerEvent_GetHistoryGlobalDisplayX( const ArkUI_UIInputEvent* event, uint32_t pointerIndex, uint32_t historyIndex); + +/** + * @brief Obtains the global display Y coordinate of a specific touch point in a historical event from a pointer event + * (such as a touch, mouse, or axis event). + * + * @param event Pointer to the current UI input event. + * @param pointerIndex Index of the target touch point in the multi-touch data list. + * @param historyIndex Index of the target historical event. + * @return float Global display Y coordinate; 0.0f if any parameter error occurs. + * @since 20 + */ float OH_ArkUI_PointerEvent_GetHistoryGlobalDisplayY( const ArkUI_UIInputEvent* event, uint32_t pointerIndex, uint32_t historyIndex); -- Gitee