From fb854ccfd6a9039e9bbda5e40478a641fd2fe688 Mon Sep 17 00:00:00 2001 From: "joogab.yun" Date: Thu, 1 Aug 2024 12:41:34 +0900 Subject: [PATCH] Add GetLastPanGestureState Change-Id: Iead50eff64d6da91762da339d50c7f684116458e --- automated-tests/src/dali-adaptor/utc-Dali-Window.cpp | 15 +++++++++++++++ dali/devel-api/adaptor-framework/window-devel.cpp | 5 +++++ dali/devel-api/adaptor-framework/window-devel.h | 9 +++++++++ .../adaptor-framework/scene-holder-impl.cpp | 11 +++++++++++ .../integration-api/adaptor-framework/scene-holder-impl.h | 8 ++++++++ 5 files changed, 48 insertions(+) diff --git a/automated-tests/src/dali-adaptor/utc-Dali-Window.cpp b/automated-tests/src/dali-adaptor/utc-Dali-Window.cpp index 6024db5..aee9cb8 100644 --- a/automated-tests/src/dali-adaptor/utc-Dali-Window.cpp +++ b/automated-tests/src/dali-adaptor/utc-Dali-Window.cpp @@ -1667,3 +1667,18 @@ int UtcDaliWindowPointerConstraintsSignalNegative(void) } END_TEST; } + +int UtcDaliWindowGetLastPanGestureState(void) +{ + try + { + Dali::Window arg1; + DevelWindow::GetLastPanGestureState(arg1); + DALI_TEST_CHECK(false); // Should not get here + } + catch(...) + { + DALI_TEST_CHECK(true); // We expect an assert + } + END_TEST; +} diff --git a/dali/devel-api/adaptor-framework/window-devel.cpp b/dali/devel-api/adaptor-framework/window-devel.cpp index cb0644e..a3efe86 100644 --- a/dali/devel-api/adaptor-framework/window-devel.cpp +++ b/dali/devel-api/adaptor-framework/window-devel.cpp @@ -304,6 +304,11 @@ const HoverEvent& GetLastHoverEvent(Window window) return GetImplementation(window).GetLastHoverEvent(); } +GestureState GetLastPanGestureState(Window window) +{ + return GetImplementation(window).GetLastPanGestureState(); +} + bool PointerConstraintsLock(Window window) { return GetImplementation(window).PointerConstraintsLock(); diff --git a/dali/devel-api/adaptor-framework/window-devel.h b/dali/devel-api/adaptor-framework/window-devel.h index 51de5ee..2b28982 100644 --- a/dali/devel-api/adaptor-framework/window-devel.h +++ b/dali/devel-api/adaptor-framework/window-devel.h @@ -20,6 +20,7 @@ // EXTERNAL INCLUDES #include +#include // INTERNAL INCLUDES #include @@ -552,6 +553,14 @@ DALI_ADAPTOR_API const TouchEvent& GetLastTouchEvent(Window window); DALI_ADAPTOR_API const HoverEvent& GetLastHoverEvent(Window window); /** + * @brief Gets the last pan gesture state the window gets. + * + * @param[in] window The window instance. + * @return The last pan gesture state the window gets. + */ +DALI_ADAPTOR_API GestureState GetLastPanGestureState(Window window); + +/** * @brief Sets the pointer constraints lock. * * @param[in] window The window instance. diff --git a/dali/integration-api/adaptor-framework/scene-holder-impl.cpp b/dali/integration-api/adaptor-framework/scene-holder-impl.cpp index e96747d..8465ecd 100644 --- a/dali/integration-api/adaptor-framework/scene-holder-impl.cpp +++ b/dali/integration-api/adaptor-framework/scene-holder-impl.cpp @@ -419,6 +419,17 @@ const Dali::HoverEvent& SceneHolder::GetLastHoverEvent() const return mLastHoverEvent; } +Dali::GestureState SceneHolder::GetLastPanGestureState() +{ + if(DALI_UNLIKELY(!mAdaptorStarted)) + { + DALI_LOG_ERROR("Adaptor is stopped, or not be started yet. Ignore this GetLastPanGestureState.\n"); + return Dali::GestureState::CLEAR; + } + + return mScene.GetLastPanGestureState(); +} + void SceneHolder::FeedWheelEvent(Dali::Integration::WheelEvent& wheelEvent) { if(DALI_UNLIKELY(!mAdaptorStarted)) diff --git a/dali/integration-api/adaptor-framework/scene-holder-impl.h b/dali/integration-api/adaptor-framework/scene-holder-impl.h index 031a7f5..0ce626c 100644 --- a/dali/integration-api/adaptor-framework/scene-holder-impl.h +++ b/dali/integration-api/adaptor-framework/scene-holder-impl.h @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -202,6 +203,13 @@ public: const Dali::HoverEvent& GetLastHoverEvent() const; /** + * @brief Gets the last pan gesture state + * + * @return Dali::GestureState + */ + Dali::GestureState GetLastPanGestureState(); + + /** * @copydoc Dali::Integration::SceneHolder::FeedWheelEvent */ void FeedWheelEvent(Dali::Integration::WheelEvent& wheelEvent); -- 2.7.4