From: joogab.yun Date: Wed, 28 Jun 2023 06:24:28 +0000 (+0900) Subject: Add FeedHover for HoverEvent X-Git-Tag: dali_2.2.33~1^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=74c5c461c37923a6f1b5416f6a7f615a426b451f;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git Add FeedHover for HoverEvent Change-Id: I0f712811c35fbd069f3ac0ea4449ddab5c059579 --- diff --git a/dali/devel-api/adaptor-framework/window-devel.cpp b/dali/devel-api/adaptor-framework/window-devel.cpp index 897ea9f..c56a354 100644 --- a/dali/devel-api/adaptor-framework/window-devel.cpp +++ b/dali/devel-api/adaptor-framework/window-devel.cpp @@ -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); diff --git a/dali/devel-api/adaptor-framework/window-devel.h b/dali/devel-api/adaptor-framework/window-devel.h index 9cfaa8f..ca8be54 100644 --- a/dali/devel-api/adaptor-framework/window-devel.h +++ b/dali/devel-api/adaptor-framework/window-devel.h @@ -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. diff --git a/dali/integration-api/adaptor-framework/scene-holder-impl.cpp b/dali/integration-api/adaptor-framework/scene-holder-impl.cpp index 7dbc5e1..e56b7ff 100644 --- a/dali/integration-api/adaptor-framework/scene-holder-impl.cpp +++ b/dali/integration-api/adaptor-framework/scene-holder-impl.cpp @@ -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 callback, int32_t frameId) { mScene.AddFrameRenderedCallback(std::move(callback), frameId); diff --git a/dali/integration-api/adaptor-framework/scene-holder-impl.h b/dali/integration-api/adaptor-framework/scene-holder-impl.h index f4b2216..c2e6c93 100644 --- a/dali/integration-api/adaptor-framework/scene-holder-impl.h +++ b/dali/integration-api/adaptor-framework/scene-holder-impl.h @@ -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 diff --git a/dali/integration-api/adaptor-framework/scene-holder.cpp b/dali/integration-api/adaptor-framework/scene-holder.cpp index 33baa43..fb05c5d 100644 --- a/dali/integration-api/adaptor-framework/scene-holder.cpp +++ b/dali/integration-api/adaptor-framework/scene-holder.cpp @@ -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(); diff --git a/dali/integration-api/adaptor-framework/scene-holder.h b/dali/integration-api/adaptor-framework/scene-holder.h index 20c8aba..61a8506 100644 --- a/dali/integration-api/adaptor-framework/scene-holder.h +++ b/dali/integration-api/adaptor-framework/scene-holder.h @@ -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 */