[M120 Migration][NUI] Add internal mouse event API for NUI. 92/309692/3
authorAkshay Kanagali <a.kanagali@partner.samsung.com>
Mon, 15 Apr 2024 09:14:00 +0000 (14:44 +0530)
committerBot Blink <blinkbot@samsung.com>
Thu, 18 Apr 2024 21:28:12 +0000 (21:28 +0000)
1. ewk_view_feed_mouse_down
2. ewk_view_feed_mouse_up
3. ewk_view_feed_mouse_move
4. ewk_view_feed_mouse_wheel
5. ewk_view_feed_mouse_out

Reference: https://review.tizen.org/gerrit/291431/

Change-Id: I87ffb054777aab42d78038c058548e5f68263551
Signed-off-by: Akshay Kanagali <a.kanagali@partner.samsung.com>
tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_common_helper_efl.cc
tizen_src/chromium_impl/content/browser/renderer_host/rwhv_aura_common_helper_efl.h
tizen_src/ewk/efl_integration/eweb_view.cc
tizen_src/ewk/efl_integration/eweb_view.h
tizen_src/ewk/efl_integration/public/ewk_view.cc
tizen_src/ewk/efl_integration/public/ewk_view_internal.h

index ed20861..139a85c 100644 (file)
@@ -621,6 +621,34 @@ bool RWHVAuraCommonHelperEfl::TouchEventsEnabled() {
   return false;
 }
 
+void RWHVAuraCommonHelperEfl::SendMouseDown(int button, int x, int y) {
+  if (auto* event_handler = GetEventHandler())
+    event_handler->SendMouseDown(button, x, y);
+}
+
+void RWHVAuraCommonHelperEfl::SendMouseUp(int button, int x, int y) {
+  if (auto* event_handler = GetEventHandler())
+    event_handler->SendMouseUp(button, x, y);
+}
+
+void RWHVAuraCommonHelperEfl::SendMouseMove(int x, int y) {
+  if (auto* event_handler = GetEventHandler())
+    event_handler->SendMouseMove(x, y);
+}
+
+void RWHVAuraCommonHelperEfl::SendMouseWheel(bool y_direction,
+                                             int step,
+                                             int x,
+                                             int y) {
+  if (auto* event_handler = GetEventHandler())
+    event_handler->SendMouseWheel(y_direction, step, x, y);
+}
+
+void RWHVAuraCommonHelperEfl::SendMouseOut() {
+  if (auto* event_handler = GetEventHandler())
+    event_handler->SendMouseOut();
+}
+
 void RWHVAuraCommonHelperEfl::OnGestureEvent(ui::GestureEvent* event) {
   if (event->type() == ui::ET_GESTURE_BEGIN)
     HandleGestureBegin();
index 55e9235..4a3367f 100644 (file)
@@ -120,6 +120,11 @@ class CONTENT_EXPORT RWHVAuraCommonHelperEfl {
   }
   void SetTouchEventsEnabled(bool enabled);
   bool TouchEventsEnabled();
+  void SendMouseDown(int button, int x, int y);
+  void SendMouseUp(int button, int x, int y);
+  void SendMouseMove(int x, int y);
+  void SendMouseWheel(bool y_direction, int step, int x, int y);
+  void SendMouseOut();
   bool IsFocusedNodeContentEditable() const { return is_content_editable_; }
 
   void SetKeyEventsEnabled(bool enabled);
index fd1d49c..a0349fb 100644 (file)
@@ -1011,6 +1011,51 @@ void EWebView::HandleTouchEvents(Ewk_Touch_Event_Type type,
   }
 }
 
+void EWebView::SendMouseDown(int button, int x, int y) {
+  if (!rwhva() || !rwhva()->offscreen_helper()) {
+    LOG(WARNING) << "RWHV is not created yet!";
+    return;
+  }
+
+  rwhva()->offscreen_helper()->SendMouseDown(button, x, y);
+}
+
+void EWebView::SendMouseUp(int button, int x, int y) {
+  if (!rwhva() || !rwhva()->offscreen_helper()) {
+    LOG(WARNING) << "RWHV is not created yet!";
+    return;
+  }
+
+  rwhva()->offscreen_helper()->SendMouseUp(button, x, y);
+}
+
+void EWebView::SendMouseMove(int x, int y) {
+  if (!rwhva() || !rwhva()->offscreen_helper()) {
+    LOG(WARNING) << "RWHV is not created yet!";
+    return;
+  }
+
+  rwhva()->offscreen_helper()->SendMouseMove(x, y);
+}
+
+void EWebView::SendMouseWheel(bool y_direction, int step, int x, int y) {
+  if (!rwhva() || !rwhva()->offscreen_helper()) {
+    LOG(WARNING) << "RWHV is not created yet!";
+    return;
+  }
+
+  rwhva()->offscreen_helper()->SendMouseWheel(y_direction, step, x, y);
+}
+
+void EWebView::SendMouseOut() {
+  if (!rwhva() || !rwhva()->offscreen_helper()) {
+    LOG(WARNING) << "RWHV is not created yet!";
+    return;
+  }
+
+  rwhva()->offscreen_helper()->SendMouseOut();
+}
+
 bool EWebView::TouchEventsEnabled() const {
   return rwhva()->offscreen_helper()->TouchEventsEnabled();
 }
index b7d349d..4420a33 100644 (file)
@@ -425,6 +425,11 @@ class EWebView {
   void HandleTouchEvents(Ewk_Touch_Event_Type type,
                          const Eina_List* points,
                          const Evas_Modifier* modifiers);
+  void SendMouseDown(int button, int x, int y);
+  void SendMouseUp(int button, int x, int y);
+  void SendMouseMove(int x, int y);
+  void SendMouseWheel(bool y_direction, int step, int x, int y);
+  void SendMouseOut();
   void Show();
   void Hide();
   bool ExecuteJavaScript(const char* script,
index e85e612..f9bc785 100644 (file)
@@ -1873,18 +1873,22 @@ void ewk_view_feed_mouse_down(Evas_Object* view,
                               Ewk_Mouse_Button_Type button,
                               int x,
                               int y) {
-  LOG_EWK_API_MOCKUP("NUI feature is not enabled");
+  EWK_VIEW_IMPL_GET_OR_RETURN(view, impl);
+  LOG(INFO) << "ewk_view_feed_mouse_down";
+  impl->SendMouseDown(button, x, y);
 }
 
 void ewk_view_feed_mouse_up(Evas_Object* view,
                             Ewk_Mouse_Button_Type button,
                             int x,
                             int y) {
-  LOG_EWK_API_MOCKUP("NUI feature is not enabled");
+  EWK_VIEW_IMPL_GET_OR_RETURN(view, impl);
+  impl->SendMouseUp(button, x, y);
 }
 
 void ewk_view_feed_mouse_move(Evas_Object* view, int x, int y) {
-  LOG_EWK_API_MOCKUP("NUI feature is not enabled");
+  EWK_VIEW_IMPL_GET_OR_RETURN(view, impl);
+  impl->SendMouseMove(x, y);
 }
 
 void ewk_view_feed_mouse_wheel(Evas_Object* view,
@@ -1892,9 +1896,14 @@ void ewk_view_feed_mouse_wheel(Evas_Object* view,
                                int step,
                                int x,
                                int y) {
-  LOG_EWK_API_MOCKUP("NUI feature is not enabled");
+  EWK_VIEW_IMPL_GET_OR_RETURN(view, impl);
+  impl->SendMouseWheel(!!y_direction, step, x, y);
 }
 
+void ewk_view_feed_mouse_out(Evas_Object* view) {
+  EWK_VIEW_IMPL_GET_OR_RETURN(view, impl);
+  impl->SendMouseOut();
+}
 void ewk_view_auto_login(Evas_Object *view, const char* user_name, const char* password)
 {
   LOG_EWK_API_MOCKUP("This API is not supported.");
index d57cc5a..cdf7866 100644 (file)
@@ -1506,6 +1506,15 @@ EXPORT_API void ewk_view_feed_mouse_wheel(Evas_Object* o,
                                           int y);
 
 /**
+ * Sends mouse out event.
+ *
+ * @since_tizen 6.0
+ *
+ * @param[in] o view object
+ */
+EXPORT_API void ewk_view_feed_mouse_out(Evas_Object* o);
+
+/**
  * @brief Sends key event.
  *
  * @since_tizen 2.4