From c374ed9938fd067b835e400ff5ba88d4cccdccf3 Mon Sep 17 00:00:00 2001 From: Youngsoo Choi Date: Thu, 9 Nov 2017 09:46:22 +0900 Subject: [PATCH] [Tizen][TV] Support mouse cursor on product tv This supports mouse cursor on product tv. Change-Id: I5daa456e3ee27a430dfd0c3a7a2806faa07e12e8 Signed-off-by: Youngsoo Choi --- atom/browser/native_window_efl.cc | 37 +++++++++++++++++++++++++++++++++++++ atom/browser/native_window_efl.h | 4 ++++ efl/build/system.gyp | 21 +++++++++++++++++++++ electron.gyp | 10 ++++++++++ packaging/electron-efl.spec | 3 +++ 5 files changed, 75 insertions(+) diff --git a/atom/browser/native_window_efl.cc b/atom/browser/native_window_efl.cc index cff4769..4968f0b 100644 --- a/atom/browser/native_window_efl.cc +++ b/atom/browser/native_window_efl.cc @@ -22,6 +22,11 @@ #include "content/public/browser/render_frame_host.h" #endif +#if defined(OS_TIZEN_TV_PRODUCT) +#include +#include +#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_); diff --git a/atom/browser/native_window_efl.h b/atom/browser/native_window_efl.h index cfb2c7c..fc04293 100644 --- a/atom/browser/native_window_efl.h +++ b/atom/browser/native_window_efl.h @@ -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_; diff --git a/efl/build/system.gyp b/efl/build/system.gyp index b244657..df2852f 100644 --- a/efl/build/system.gyp +++ b/efl/build/system.gyp @@ -130,5 +130,26 @@ ], }, }, # efl-extension + { + 'target_name': 'vd-win-util', + 'type': 'none', + 'conditions': [ + ['tizen_product_tv==1', { + 'direct_dependent_settings': { + 'cflags': [ + '