fixup! [VD] support enable/disable mouse event for smart monitor 89/291389/3
authorshurong.chen <shurong.chen@samsung.com>
Thu, 13 Apr 2023 06:40:06 +0000 (14:40 +0800)
committerBot Blink <blinkbot@samsung.com>
Mon, 17 Apr 2023 09:05:39 +0000 (09:05 +0000)
As the ewk_view_mouse_events_enabled_set api been used to enable/disable
touch event.
So provide a new api to enable/disable mouse event and cursor:
ewk_view_mouse_pointer_support_set
ewk_view_mouse_pointer_support_get

Change-Id: Ic9530b689c46688f46f8b8fee361ceab4c5392f9
Signed-off-by: shurong.chen <shurong.chen@samsung.com>
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 b0af71251c35f9df17fc72450e7b28816313bf36..e954aee073fb5ac29e14eeddd4674d2884e70d9d 100644 (file)
 #include "public/ewk_media_subtitle_info_product.h"
 #include "public/ewk_user_media_internal.h"
 #include "third_party/blink/public/platform/web_media_player.h"
-#include "tizen_src/chromium_impl/tizen/tizen_tv_platform.h"
 #endif
 
 #if defined(TIZEN_PEPPER_EXTENSIONS)
@@ -1186,13 +1185,6 @@ bool EWebView::MouseEventsEnabled() const {
 }
 
 void EWebView::SetMouseEventsEnabled(bool enabled) {
-#if defined(OS_TIZEN_TV_PRODUCT)
-  if (IsSmartMonitorType()) {
-    if (rwhv())
-      rwhv()->SetMouseEventsEnabled(enabled);
-  }
-#endif
-
   if (mouse_events_enabled_ == enabled)
     return;
 
@@ -4397,4 +4389,23 @@ void EWebView::NotifyMediaDeviceConnectionChanged(int device_type) {
   SmartCallback<EWebViewCallbacks::DeviceConnectionChanged>().call(
       &device_type);
 }
+
+bool EWebView::SetMousePointerSupport(bool support) {
+  if (mouse_pointer_support_ == support)
+    return true;
+
+  if (!rwhv()) {
+    LOG(ERROR) << __FUNCTION__ << "rwhv is null,just return!";
+    return false;
+  }
+
+  rwhv()->SetMouseEventsEnabled(support);
+  mouse_pointer_support_ = support;
+
+  return true;
+}
+
+bool EWebView::MousePointerSupport() const {
+  return mouse_pointer_support_;
+}
 #endif
index eded73bbf3bb2a5640e88bdebe5ac467af257de4..9786c5f3f74623dcd18719811a75bfded83853c9 100644 (file)
@@ -905,6 +905,8 @@ class EWebView {
                                uint32_t current);
   void NotifyMediaDeviceConnectionChanged(int device_type);
   const std::string& GetActiveDRM() const;
+  bool SetMousePointerSupport(bool supported);
+  bool MousePointerSupport() const;
 #if defined(TIZEN_MULTIMEDIA_DRMMANAGER_SUPPORT)
   void NotifyDRMInitData(int init_type, const std::vector<unsigned char>& data);
   int NotifyDRMInitComplete(unsigned int pssh_data_length,
@@ -1163,6 +1165,7 @@ class EWebView {
 
 #if defined(OS_TIZEN_TV_PRODUCT)
   base::OnceClosure pending_setfocus_closure_;
+  bool mouse_pointer_support_ = true;
 #endif
   base::WeakPtrFactory<EWebView> weak_factory_ {this};
 
index 3c7f6447bc00e126b2a5b7081ff90946fec2e74d..659c806f471a4bec1f5fa48a2a947a3c44cbaee4 100644 (file)
@@ -2061,4 +2061,28 @@ void ewk_view_media_device_list_get(Evas_Object* o, Ewk_Media_Device_List_Get_Ca
 #endif
 }
 
+/* LCOV_EXCL_START */
+Eina_Bool ewk_view_mouse_pointer_support_set(Evas_Object *view, Eina_Bool support)
+{
+#if defined(OS_TIZEN_TV_PRODUCT)
+  EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, EINA_FALSE);
+  LOG(INFO) << "ewk_view_mouse_pointer_support_set:"<<(!!support);
+  return impl->SetMousePointerSupport(!!support);
+#else
+  LOG_EWK_API_MOCKUP("Only for Tizen TV.");
+  return EINA_FALSE;
+#endif
+}
+
+Eina_Bool ewk_view_mouse_pointer_support_get(const Evas_Object *view)
+{
+#if defined(OS_TIZEN_TV_PRODUCT)
+  EWK_VIEW_IMPL_GET_OR_RETURN(view, impl, false);
+  return impl->MousePointerSupport();
+#else
+  LOG_EWK_API_MOCKUP("Only for Tizen TV.");
+  return EINA_FALSE;
+#endif
+}
+
 /* LCOV_EXCL_STOP */
index 115ce0cabaa39091691e6a8e95fbb7d263387df1..fc067eff03a5d681df9eeba7205087920e43b4f6 100644 (file)
@@ -1561,6 +1561,30 @@ EXPORT_API Eina_Bool ewk_view_send_key_event(Evas_Object* o, void* key_event, Ei
 
 EXPORT_API void ewk_view_media_device_list_get(Evas_Object* o, Ewk_Media_Device_List_Get_Callback callback, void* user_data);
 
+
+/**
+ * Sets whether the ewk_view supports the mouse pointer(include support the mouse event and update the cursor) or not.
+ *
+ * The ewk_view will support the mouse pointer(include support the mouse event and update the cursor) if EINA_TRUE
+ * or not support the mouse pointer otherwise. The default value is EINA_TRUE.
+ *
+ * @param o view object to support/don't support the mouse pointer
+ * @param supported a state to set
+ *
+ * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
+ */
+EXPORT_API Eina_Bool ewk_view_mouse_pointer_support_set(Evas_Object *view, Eina_Bool support);
+
+/**
+ * Queries if the ewk_view supports the mouse pointer(include support the mouse event and update the cursor).
+ *
+ * @param o view object to query if the mouse pointer are suppored
+ *
+ * @return @c EINA_TRUE if the mouse pointer are enabled or @c EINA_FALSE otherwise
+ */
+EXPORT_API Eina_Bool ewk_view_mouse_pointer_support_get(const Evas_Object *view);
+
+
 #ifdef __cplusplus
 }
 #endif