From 3e34808804abf387f69f0f745bffe0b743ba1f5f Mon Sep 17 00:00:00 2001 From: "Wonsik, Jung" Date: Tue, 13 Feb 2018 16:28:13 +0900 Subject: [PATCH] ecore-wl2: applying ecore-wl2 This patch is for supporting ecore-wl2 In addition, it is considered boht ecore-wl2 and ecore-wayland Change-Id: I8423feea5c9a133ec51a19324f36d9df10afe20c Signed-off-by: huiyu.eun --- configure.ac | 12 +++++++++++- dali-csharp-binder.pc.in | 2 +- dali-csharp-binder/Makefile.am | 7 ++++++- dali-csharp-binder/src/key-grab.cpp | 9 ++++++++- packaging/dali-csharp-binder.spec | 18 ++++++++++++++++-- 5 files changed, 42 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index e54f733..b9ffe05 100755 --- a/configure.ac +++ b/configure.ac @@ -18,14 +18,24 @@ AC_ARG_ENABLE(tizenBuild, enable_tizenBuild=yes, enable_tizenBuild=no) +AC_ARG_ENABLE(Ecore_Wl2, + [ --enable-ecore-wl2 build with ecorewl2 on tizen], + enable_ecore_wl2=yes, + enable_ecore_wl2=no) + AM_CONDITIONAL([TIZENBUILD], [test x$enable_tizenBuild = xyes]) +AM_CONDITIONAL([ECOREWL2], [test "x$enable_ecore_wl2" = "xyes"]) PKG_PROG_PKG_CONFIG # Checks for libraries. added for widget_viewer_dali binding only for tizen # added for key grab binding only for tizen if test x$enable_tizenBuild = xyes; then PKG_CHECK_MODULES(DALI, dali-core dali-adaptor dali-toolkit widget_viewer_dali) - PKG_CHECK_MODULES(ECORE_WAYLAND, ecore-wayland) + if test x$enable_ecore_wl2 = xyes; then + PKG_CHECK_MODULES(ECORE_WL2, ecore-wl2) + else + PKG_CHECK_MODULES(ECORE_WAYLAND, ecore-wayland) + fi else PKG_CHECK_MODULES(DALI, dali-core dali-adaptor dali-toolkit) fi diff --git a/dali-csharp-binder.pc.in b/dali-csharp-binder.pc.in index 4b4d20d..7a19185 100755 --- a/dali-csharp-binder.pc.in +++ b/dali-csharp-binder.pc.in @@ -8,6 +8,6 @@ includedir=@INC_DIR@ Name: DALi C# binder Description: DALi C# binder Libaray Version: @VERSION@ -Requires: dali-core dali-adaptor dali-toolkit ecore-wayland +Requires: dali-core dali-adaptor dali-toolkit Libs: -L${libdir} -ldali-csharp-binder Cflags: -I${includedir}/dali-csharp-binder diff --git a/dali-csharp-binder/Makefile.am b/dali-csharp-binder/Makefile.am index 70e3672..361998c 100755 --- a/dali-csharp-binder/Makefile.am +++ b/dali-csharp-binder/Makefile.am @@ -11,10 +11,15 @@ libdali_csharp_binder_la_LDFLAGS = ${LDFLAGS} libdali_csharp_binder_la_CXXFLAGS = \ ${CFLAGS} \ $(DALI_CFLAGS) \ - $(ECORE_WAYLAND_CFLAGS) \ $(viewer_dali_CFLAGS) \ $(dali_csharp_binder_includes) +if ECOREWL2 +libdali_csharp_binder_la_CXXFLAGS+= $(ECORE_WL2_CFLAGS) +else +libdali_csharp_binder_la_CXXFLAGS+= $(ECORE_WAYLAND_CFLAGS) +endif + # added for key grab binding only for tizen if TIZENBUILD libdali_csharp_binder_la_CXXFLAGS += -DTIZEN_BUILD diff --git a/dali-csharp-binder/src/key-grab.cpp b/dali-csharp-binder/src/key-grab.cpp index d931585..8b3007b 100755 --- a/dali-csharp-binder/src/key-grab.cpp +++ b/dali-csharp-binder/src/key-grab.cpp @@ -28,8 +28,12 @@ #ifdef TIZEN_BUILD +#ifdef ECORE_WL2 +#include +#else #include #endif +#endif #undef LOG //#define LOG DALI_LOG_ERROR @@ -191,8 +195,11 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_GetNativeWindowHandler( void* window ) Dali::Any result; try { result = _win->GetNativeHandle(); - +#ifdef ECORE_WL2 + Ecore_Wl2_Window * ecore_win = Dali::AnyCast(result); +#else Ecore_Wl_Window * ecore_win = Dali::AnyCast(result); +#endif ret = (void*)ecore_win; } catch (std::out_of_range& e) { diff --git a/packaging/dali-csharp-binder.spec b/packaging/dali-csharp-binder.spec index c851b50..c956399 100755 --- a/packaging/dali-csharp-binder.spec +++ b/packaging/dali-csharp-binder.spec @@ -10,12 +10,24 @@ Source: %{name}-%{version}.tar.xz BuildRequires: pkgconfig(dali-core) BuildRequires: pkgconfig(dali-adaptor) BuildRequires: pkgconfig(dali-toolkit) -BuildRequires: pkgconfig(ecore-wayland) BuildRequires: pkgconfig(widget_viewer_dali) +# dali-adaptor uses ecore mainloop +%if 0%{?tizen_version_major} >= 5 +BuildRequires: pkgconfig(ecore-wl2) +%else +BuildRequires: pkgconfig(ecore-wayland) +%endif + %description dali-csharp-binder +%if 0%{?tizen_version_major} >= 5 +CFLAGS+=" -DECORE_WL2 -DEFL_BETA_API_SUPPORT" +CXXFLAGS+=" -DECORE_WL2 -DEFL_BETA_API_SUPPORT" +configure_flags="--enable-ecore-wl2" +%endif + ############################## # devel ############################## @@ -39,7 +51,9 @@ This package includes developer files common to all packages. %build %autogen # added for key grab binding only for tizen -%configure --enable-tizenBuild=yes +%configure --enable-tizenBuild=yes \ + $configure_flags + make %{?_smp_mflags} ############################## -- 2.7.4