From 9207e5883d13a998dbbe8b8b7b53bd0c61c10ff3 Mon Sep 17 00:00:00 2001 From: Philippe Coval Date: Fri, 28 Feb 2014 11:54:48 +0100 Subject: [PATCH] workaround: disable X code on when building without X To be squashed when evas/wayland replace the todo parts Change-Id: I1ffc2b87a7206598107fac629d6bf77a9aa5d602 Bug-Tizen: PTREL-589 Signed-off-by: Philippe Coval --- CMakeLists.txt | 3 +++ packaging/efl-assist.spec | 14 +++++++++++++- src/lib/efl_assist_screen_reader.c | 12 ++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index de88413..fe0bcb5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,6 +32,9 @@ ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"") ADD_DEFINITIONS("-DVERSION=\"${VERSION}\"") ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE}\"") ADD_DEFINITIONS("-DPLUGINDIR=\"${PLUGINDIR}\"") +IF(X11_SUPPORT) + ADD_DEFINITIONS("-DHAVE_X11") +ENDIF(X11_SUPPORT) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden -Wall") INCLUDE(FindPkgConfig) diff --git a/packaging/efl-assist.spec b/packaging/efl-assist.spec index ccb0ce9..017ebb5 100644 --- a/packaging/efl-assist.spec +++ b/packaging/efl-assist.spec @@ -1,3 +1,5 @@ +%bcond_with x + Name: efl-assist Summary: EFL assist library Version: 0.1.18r02 @@ -12,7 +14,10 @@ BuildRequires: pkgconfig(vconf) BuildRequires: pkgconfig(tts) BuildRequires: pkgconfig(capi-base-common) BuildRequires: pkgconfig(capi-appfw-application) +%if %{with x} BuildRequires: pkgconfig(ecore-x) +%endif + Requires(post): /sbin/ldconfig Requires(postun): /sbin/ldconfig @@ -39,7 +44,14 @@ EFL assist library providing small utility functions (devel) %build export CFLAGS+=" -fvisibility=hidden" export LDFLAGS+=" -fvisibility=hidden" -%cmake . -DCMAKE_INSTALL_PREFIX=/usr + +%cmake . \ + -DCMAKE_INSTALL_PREFIX=/usr \ +%if %{with x} + -DX11_SUPPORT=On \ +%endif + #eol + make %{?jobs:-j%jobs} diff --git a/src/lib/efl_assist_screen_reader.c b/src/lib/efl_assist_screen_reader.c index 506308f..be7bd84 100644 --- a/src/lib/efl_assist_screen_reader.c +++ b/src/lib/efl_assist_screen_reader.c @@ -1,6 +1,10 @@ #include "efl_assist.h" #include "efl_assist_private.h" + +#ifdef HAVE_X #include +#endif + #include #include #define UNAVAILABLE_TEXT "Screen reader is unavailable during using this application. You can press home or back key to go back to home screen." @@ -112,6 +116,7 @@ static void _tts_init(void) static void _timeout_cb(void *data, Evas_Object *obj, void *event_info) { +#ifdef HAVE_X Ecore_X_Window xwin; unsigned int val; @@ -125,11 +130,15 @@ static void _timeout_cb(void *data, Evas_Object *obj, void *event_info) (xwin, ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL, &val, 1); _tts_shutdown(); +#else + fprintf(stderr, "TODO: workaround: disabled code from " __FILE__ ); +#endif } EAPI Eina_Bool ea_screen_reader_support_set(Evas_Object *win, Eina_Bool support) { +#ifdef HAVE_X Ecore_X_Window xwin; unsigned int val; int tts_val; @@ -170,6 +179,9 @@ ea_screen_reader_support_set(Evas_Object *win, Eina_Bool support) } return EINA_TRUE; +#else + fprintf(stderr, "TODO: workaround: disabled code from " __FILE__ ); +#endif } EAPI Eina_Bool -- 2.7.4