Add GetLastPanGestureState 45/315445/3
authorjoogab.yun <joogab.yun@samsung.com>
Thu, 1 Aug 2024 03:41:34 +0000 (12:41 +0900)
committerjoogab.yun <joogab.yun@samsung.com>
Thu, 1 Aug 2024 07:08:40 +0000 (16:08 +0900)
Change-Id: Iead50eff64d6da91762da339d50c7f684116458e

automated-tests/src/dali-adaptor/utc-Dali-Window.cpp
dali/devel-api/adaptor-framework/window-devel.cpp
dali/devel-api/adaptor-framework/window-devel.h
dali/integration-api/adaptor-framework/scene-holder-impl.cpp
dali/integration-api/adaptor-framework/scene-holder-impl.h

index 6024db5..aee9cb8 100644 (file)
@@ -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;
+}
index cb0644e..a3efe86 100644 (file)
@@ -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();
index 51de5ee..2b28982 100644 (file)
@@ -20,6 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <memory>
+#include <dali/public-api/events/gesture-enumerations.h>
 
 // INTERNAL INCLUDES
 #include <dali/devel-api/adaptor-framework/mouse-in-out-event.h>
@@ -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.
index e96747d..8465ecd 100644 (file)
@@ -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))
index 031a7f5..0ce626c 100644 (file)
@@ -29,6 +29,7 @@
 #include <dali/public-api/common/intrusive-ptr.h>
 #include <dali/public-api/events/hover-event.h>
 #include <dali/public-api/events/touch-event.h>
+#include <dali/public-api/events/gesture-enumerations.h>
 #include <dali/public-api/math/uint-16-pair.h>
 #include <dali/public-api/object/base-object.h>
 #include <atomic>
@@ -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);