this patch is for supporting ecore-wl2.
In additional, it can support both ecore-wl2 and ecore-wayland
Change-Id: Idb6edf805dfafe53a04e2fb59a2ae29b4b23b959
SET(LOCALE_DIR "${TZ_SYS_SHARE}/${PROJECT_NAME}/locale")
SET(ROOT_SRC_DIR ${CMAKE_SOURCE_DIR}/../..)
+IF("${ENABLE_ECOREWL2}" STREQUAL "On")
+ OPTION(USE_ECOREWL2 "Use ecorewl2" ON)
+ENDIF()
+
+IF(USE_ECOREWL2)
+ ADD_DEFINITIONS("-DECORE_WL2")
+ ADD_DEFINITIONS("-DEFL_BETA_API_SUPPORT")
+ENDIF()
+
INCLUDE(FindPkgConfig)
+IF(USE_ECOREWL2)
pkg_check_modules(viewer_dali REQUIRED
dlog
widget_service
dali-adaptor
dali-toolkit
cynara-client
- ecore-wayland
+ ecore-wl2
ecore-input
tizen-remote-surface-client
screen_connector_watcher
)
+ELSE()
+pkg_check_modules(viewer_dali REQUIRED
+ dlog
+ widget_service
+ capi-system-info
+ dali-core
+ dali-adaptor
+ dali-toolkit
+ cynara-client
+ ecore-wayland
+ ecore-input
+ tizen-remote-surface-client
+ screen_connector_watcher
+)
+ENDIF()
SET(BUILD_SOURCE
${ROOT_SRC_DIR}/widget_viewer_dali/public_api/widget_view/widget_view.cpp
-%bcond_with wayland
+%bcond_without wayland
+%bcond_with x
Name: libwidget_viewer_dali
Summary: Library for developing the application
BuildRequires: pkgconfig(dali-adaptor)
BuildRequires: pkgconfig(dali-toolkit)
BuildRequires: pkgconfig(cynara-client)
-BuildRequires: pkgconfig(ecore-wayland)
BuildRequires: pkgconfig(wayland-tbm-client)
BuildRequires: pkgconfig(screen_connector_watcher)
+%if 0%{?tizen_version_major} >= 5
+BuildRequires: pkgconfig(ecore-wl2)
+%else
+BuildRequires: pkgconfig(ecore-wayland)
+%endif
+
%description
API for creating a new instance of the widget and managing its life-cycle.
CXXFLAGS+=" -D_ARCH_ARM_"
%endif
+%if 0%{?tizen_version_major} >= 5
+ export CFLAGS+=" -DECORE_WL2 -DEFL_BETA_API_SUPPORT "
+ export CXXFLAGS+=" -DECORE_WL2 -DEFL_BETA_API_SUPPORT "
+ %define ENABLE_ECOREWL2 On
+%else
+ %define ENABLE_ECOREWL2 Off
+%endif
+
cd %{_builddir}/%{name}-%{version}/build/tizen
MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
%cmake -DWIDGET_ENABLED=On \
-DTZ_SYS_SHARE=/usr/share \
+ -DENABLE_ECOREWL2=%{ENABLE_ECOREWL2} \
-DFULLVER=%{version} \
-DMAJORVER=${MAJORVER} \
.
#include <dali/integration-api/debug.h>
#include <dali/devel-api/images/texture-set-image.h>
#include <string.h>
+#ifdef ECORE_WL2
+#include <Ecore_Wl2.h>
+#else
#include <Ecore_Wayland.h>
+#endif
#include <Ecore_Input.h>
#include <widget_service.h>
#include <widget_instance.h>
static bool GetKeyCode( std::string keyName, int32_t& keyCode )
{
xkb_keymap* keyMap = NULL;
- Ecore_Wl_Input* ecoreWlInput = NULL;
xkb_keysym_t sym = XKB_KEY_NoSymbol;
KeyCodeMap foundKeyCode;
+#ifdef ECORE_WL2
+ Ecore_Wl2_Input* ecoreWlInput = NULL;
+
+ Ecore_Wl2_Display *wl2_display = ecore_wl2_connected_display_get(NULL);
+ ecoreWlInput = ecore_wl2_input_default_input_get(wl2_display);
+ if( !ecoreWlInput )
+ {
+ DALI_LOG_ERROR( "Failed to get Ecore_Wl2_Input in WidgetView\n" );
+ return false;
+ }
+
+ keyMap = ecore_wl2_input_keymap_get( ecoreWlInput );
+ if( !keyMap )
+ {
+ DALI_LOG_ERROR( "Failed to get keymap in WidgetView\n" );
+ return false;
+ }
+#else
+ Ecore_Wl_Input* ecoreWlInput = NULL;
+
ecoreWlInput = ecore_wl_input_get();
+
if( !ecoreWlInput )
{
DALI_LOG_ERROR( "Failed to get Ecore_Wl_Input in WidgetView\n" );
DALI_LOG_ERROR( "Failed to get keymap in WidgetView\n" );
return false;
}
-
+#endif
sym = xkb_keysym_from_name( keyName.c_str(), XKB_KEYSYM_NO_FLAGS );
if( sym == XKB_KEY_NoSymbol )
{