Add FeedHover for HoverEvent 76/294676/13
authorjoogab.yun <joogab.yun@samsung.com>
Wed, 28 Jun 2023 06:24:28 +0000 (15:24 +0900)
committerjoogab.yun <joogab.yun@samsung.com>
Wed, 28 Jun 2023 09:35:22 +0000 (18:35 +0900)
Change-Id: I0f712811c35fbd069f3ac0ea4449ddab5c059579

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
dali/integration-api/adaptor-framework/scene-holder.cpp
dali/integration-api/adaptor-framework/scene-holder.h

index 897ea9f..c56a354 100644 (file)
@@ -239,6 +239,12 @@ void FeedKeyEvent(Window window, const Dali::KeyEvent& keyEvent)
   GetImplementation(window).FeedKeyEvent(convertedEvent);
 }
 
+void FeedHoverEvent(Window window, const Dali::TouchPoint& point)
+{
+  Integration::Point convertedPoint(point);
+  GetImplementation(window).FeedHoverEvent(convertedPoint);
+}
+
 void Maximize(Window window, bool maximize)
 {
   GetImplementation(window).Maximize(maximize);
index 9cfaa8f..ca8be54 100644 (file)
@@ -427,6 +427,13 @@ DALI_ADAPTOR_API void FeedWheelEvent(Window window, const Dali::WheelEvent& whee
 DALI_ADAPTOR_API void FeedKeyEvent(Window window, const Dali::KeyEvent& keyEvent);
 
 /**
+ * @brief Feed (Send) hover event to window
+ * @param[in] window The window instance
+ * @param[in] point The touch point that create a hover event
+ */
+DALI_ADAPTOR_API void FeedHoverEvent(Window window, const Dali::TouchPoint& point);
+
+/**
  * @brief Maximizes window's size.
  * If this function is called with true, window will be resized with screen size.
  * Otherwise window will be resized with previous size.
index 7dbc5e1..e56b7ff 100644 (file)
@@ -353,6 +353,22 @@ void SceneHolder::FeedKeyEvent(Dali::Integration::KeyEvent& keyEvent)
   mAdaptor->ProcessCoreEvents();
 }
 
+void SceneHolder::FeedHoverEvent(Dali::Integration::Point& point)
+{
+  Integration::HoverEvent hoverEvent;
+
+  // Signals can be emitted while processing core events, and the scene holder could be deleted in the signal callback.
+  // Keep the handle alive until the core events are processed.
+  Dali::BaseHandle sceneHolder(this);
+
+  // Create send HoverEvent to Core.
+  hoverEvent.time = TimeService::GetMilliSeconds();
+  hoverEvent.AddPoint(point);
+
+  mScene.QueueEvent(hoverEvent);
+  mAdaptor->ProcessCoreEvents();
+}
+
 void SceneHolder::AddFrameRenderedCallback(std::unique_ptr<CallbackBase> callback, int32_t frameId)
 {
   mScene.AddFrameRenderedCallback(std::move(callback), frameId);
index f4b2216..c2e6c93 100644 (file)
@@ -199,6 +199,11 @@ public:
   void FeedKeyEvent(Dali::Integration::KeyEvent& keyEvent);
 
   /**
+   * @copydoc Dali::Integration::SceneHolder::FeedHoverEvent
+   */
+  void FeedHoverEvent(Dali::Integration::Point& point);
+
+  /**
    * @brief Adds a callback that is called when the frame rendering is done by the graphics driver.
    *
    * @param[in] callback The function to call
index 33baa43..fb05c5d 100644 (file)
@@ -105,6 +105,12 @@ void SceneHolder::FeedKeyEvent(Dali::KeyEvent& keyEvent)
   GetImplementation(*this).FeedKeyEvent(event);
 }
 
+void SceneHolder::FeedHoverEvent(Dali::TouchPoint& point)
+{
+  Integration::Point convertedPoint(point);
+  GetImplementation(*this).FeedHoverEvent(convertedPoint);
+}
+
 RenderTaskList SceneHolder::GetRenderTaskList()
 {
   return GetImplementation(*this).GetRenderTaskList();
index 20c8aba..61a8506 100644 (file)
@@ -159,6 +159,12 @@ public:
   void FeedKeyEvent(Dali::KeyEvent& keyEvent);
 
   /**
+   * @brief Feed (Send) hover event to core
+   * @param[in] point The touch point that create a hover event
+   */
+  void FeedHoverEvent(Dali::TouchPoint& point);
+
+  /**
    * @brief Retrieves the list of render-tasks.
    * @return A valid handle to a RenderTaskList
    */