[Tizen][TV] Support mouse cursor on product tv 17/159417/1
authorYoungsoo Choi <kenshin.choi@samsung.com>
Thu, 9 Nov 2017 00:46:22 +0000 (09:46 +0900)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Thu, 9 Nov 2017 00:46:22 +0000 (09:46 +0900)
This supports mouse cursor on product tv.

Change-Id: I5daa456e3ee27a430dfd0c3a7a2806faa07e12e8
Signed-off-by: Youngsoo Choi <kenshin.choi@samsung.com>
atom/browser/native_window_efl.cc
atom/browser/native_window_efl.h
efl/build/system.gyp
electron.gyp
packaging/electron-efl.spec

index cff4769763ef898fc8e04ec7998bec5af1895d2f..4968f0bb4c07d917840b72183559bc6874e09527 100644 (file)
 #include "content/public/browser/render_frame_host.h"
 #endif
 
+#if defined(OS_TIZEN_TV_PRODUCT)
+#include <Ecore_Wayland.h>
+#include <cursor_module.h>
+#endif
+
 namespace atom {
 
 namespace {
@@ -88,6 +93,11 @@ NativeWindowEfl::NativeWindowEfl(
   eext_object_event_callback_add(web_view_, EEXT_CALLBACK_MORE,
       &HWMoreKeyCallback, this);
 #endif
+
+#if defined(OS_TIZEN_TV_PRODUCT)
+  CreateMouseCursor(box);
+#endif
+
 }
 
 NativeWindowEfl::~NativeWindowEfl() {
@@ -97,6 +107,33 @@ NativeWindowEfl::~NativeWindowEfl() {
       &HWBackKeyCallback);
 }
 
+#if defined(OS_TIZEN_TV_PRODUCT)
+void NativeWindowEfl::CreateMouseCursor(Evas_Object* window) {
+  const char* t_cursor = "tizen_cursor";
+  Ecore_Wl_Global* global_data = NULL;
+  unsigned int cursormgr_id = 0;
+
+  EINA_INLIST_FOREACH(ecore_wl_globals_get(), global_data) {
+    if (0 == strncmp(global_data->interface, t_cursor, strlen(t_cursor))) {
+      cursormgr_id = global_data->id;  // to get the id of cursormgr object
+      break;
+    }
+  }
+
+  struct wl_surface* const surface =
+      ecore_wl_window_surface_get(elm_win_wl_window_get(window));
+  ecore_wl_sync();
+
+  const int ret_cursormod = CursorModule_Initialize(
+      ecore_wl_display_get(), ecore_wl_registry_get(),
+      ecore_wl_input_seat_get(ecore_wl_input_get()), cursormgr_id);
+  if (ret_cursormod) {
+    Cursor_Set_Config(surface, TIZEN_CURSOR_CONFIG_CURSOR_AVAILABLE, NULL);
+  }
+  CursorModule_Finalize();
+}
+#endif
+
 void NativeWindowEfl::Close() {
   if(window_)
     evas_object_del(window_);
index cfb2c7ca3c16634551edf98c3a0049affc56a2c3..fc04293469f71097d84e7bf65cc77b81e3ba4dca 100644 (file)
@@ -103,6 +103,10 @@ class NativeWindowEfl : public NativeWindow {
   static void HWMoreKeyCallback(void*, Evas_Object*, void*);
 #endif
 
+#if defined(OS_TIZEN_TV_PRODUCT)
+  void CreateMouseCursor(Evas_Object* window);
+#endif
+
   Evas_Object* window_;
   Evas_Object* web_view_;
 
index b244657d670d100962b20b41a83e253bd07eed30..df2852f2070d1badbbc61b8c7900ab24ea817a8b 100644 (file)
         ],
       },
     }, # efl-extension
+    {
+      'target_name': 'vd-win-util',
+      'type': 'none',
+      'conditions': [
+        ['tizen_product_tv==1', {
+          'direct_dependent_settings': {
+            'cflags': [
+              '<!@(pkg-config --cflags ecore-wayland vd-win-util)',
+            ],
+          },
+          'link_settings': {
+            'ldflags': [
+              '<!@(pkg-config --libs-only-L --libs-only-other ecore-wayland vd-win-util)',
+            ],
+            'libraries': [
+              '<!@(pkg-config --libs-only-l ecore-wayland vd-win-util)',
+            ],
+          },
+        }], # building_for_tizen_tv==1
+      ],
+    }, # vd-win-util
   ],
 }
index 4e52801b567fd2ea6daaab6bc5f2a6ca1ff4d9c5..e53c89a2062658b04a1ecac1b181a5f2587759af 100644 (file)
                 'electron_shell_copy',
               ],
             }],
+            ['tizen_product_tv==1', {
+              'dependencies': [
+                '<(DEPTH)/efl/build/system.gyp:elementary',
+                '<(DEPTH)/efl/build/system.gyp:efl-extension',
+                '<(DEPTH)/efl/build/system.gyp:evas',
+                '<(DEPTH)/efl/build/system.gyp:icu',
+                '<(DEPTH)/efl/build/system.gyp:vd-win-util',
+                'electron_shell_copy',
+              ],
+            }],
           ],
           'defines': [
             'USE_SYSTEM_ICU',
index 46437295845c21c7f0d914ed40291cfb76b2eeb9..8f2ff2804653485b488af2158c9bf017d43d4ed1 100755 (executable)
@@ -28,6 +28,9 @@ BuildRequires: pkgconfig(icu-i18n)
 # It's added to use TZ_SYS_RO_PACKAGES.
 BuildRequires: pkgconfig(libtzplatform-config)
 BuildRequires: pkgconfig(nss)
+%if "%{?TIZEN_PRODUCT_TV}" == "1"
+BuildRequires: pkgconfig(vd-win-util)
+%endif
 
 Requires: /usr/bin/systemctl