workaround: disable X code on when building without X 09/17009/1
authorPhilippe Coval <philippe.coval@open.eurogiciel.org>
Fri, 28 Feb 2014 10:54:48 +0000 (11:54 +0100)
committerPhilippe Coval <philippe.coval@open.eurogiciel.org>
Fri, 28 Feb 2014 10:54:48 +0000 (11:54 +0100)
To be squashed when evas/wayland replace the todo parts

Change-Id: I1ffc2b87a7206598107fac629d6bf77a9aa5d602
Bug-Tizen: PTREL-589
Signed-off-by: Philippe Coval <philippe.coval@open.eurogiciel.org>
CMakeLists.txt
packaging/efl-assist.spec
src/lib/efl_assist_screen_reader.c

index de88413..fe0bcb5 100644 (file)
@@ -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)
index ccb0ce9..017ebb5 100644 (file)
@@ -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}
 
index 506308f..be7bd84 100644 (file)
@@ -1,6 +1,10 @@
 #include "efl_assist.h"
 #include "efl_assist_private.h"
+
+#ifdef HAVE_X
 #include <Ecore_X.h>
+#endif
+
 #include <vconf.h>
 #include <tts.h>
 #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