fix: ea_screen_reader_support_set support wayland 66/17166/1 accepted/tizen/generic/20140304.153857 accepted/tizen/generic/20140312.095340 accepted/tizen/ivi/20140304.190711 accepted/tizen/ivi/panda/20140312.095820 accepted/tizen/ivi/release/20140312.124207 submit/tizen/20140304.153118 submit/tizen/20140312.070715 submit/tizen_ivi_release/20140312.071154
authorPhilippe Coval <philippe.coval@open.eurogiciel.org>
Tue, 4 Mar 2014 14:36:30 +0000 (15:36 +0100)
committerPhilippe Coval <philippe.coval@open.eurogiciel.org>
Tue, 4 Mar 2014 15:23:04 +0000 (16:23 +0100)
Note wayland gets priority over x11 when both available

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

index fe0bcb5..25a48c0 100644 (file)
@@ -35,6 +35,9 @@ ADD_DEFINITIONS("-DPLUGINDIR=\"${PLUGINDIR}\"")
 IF(X11_SUPPORT)
        ADD_DEFINITIONS("-DHAVE_X11")
 ENDIF(X11_SUPPORT)
+IF(WAYLAND_SUPPORT)
+       ADD_DEFINITIONS("-DHAVE_WAYLAND")
+ENDIF(WAYLAND_SUPPORT)
 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden -Wall")
 
 INCLUDE(FindPkgConfig)
index 7cdcda1..b24b14c 100644 (file)
@@ -1,4 +1,5 @@
 %bcond_with x
+%bcond_with wayland
 
 Name:       efl-assist
 Summary:    EFL assist library
@@ -17,6 +18,9 @@ BuildRequires:  pkgconfig(capi-appfw-application)
 %if %{with x}
 BuildRequires:  pkgconfig(ecore-x)
 %endif
+%if %{with wayland}
+BuildRequires:  pkgconfig(ecore-wayland)
+%endif
 
 Requires(post): /sbin/ldconfig
 Requires(postun): /sbin/ldconfig
@@ -49,6 +53,13 @@ export LDFLAGS+=" -fvisibility=hidden"
     -DCMAKE_INSTALL_PREFIX=/usr \
 %if %{with x}
     -DX11_SUPPORT=On \
+%else
+    -DX11_SUPPORT=Off \
+%endif
+%if %{with wayland}
+    -DWAYLAND_SUPPORT=On \
+%else
+    -DWAYLAND_SUPPORT=Off \
 %endif
     #eol
 
index be7bd84..d5740e5 100644 (file)
@@ -1,9 +1,14 @@
 #include "efl_assist.h"
 #include "efl_assist_private.h"
 
+#include <Ecore.h>
+
 #ifdef HAVE_X
 #include <Ecore_X.h>
 #endif
+#ifdef HAVE_WAYLAND
+#include <Ecore_Wayland.h>
+#endif
 
 #include <vconf.h>
 #include <tts.h>
@@ -116,30 +121,43 @@ static void _tts_init(void)
 
 static void _timeout_cb(void *data, Evas_Object *obj, void *event_info)
 {
-#ifdef HAVE_X
-   Ecore_X_Window xwin;
+#ifdef HAVE_WAYLAND
+    Ecore_Wl_Window *w;
+#elif HAVE_X
+    Ecore_X_Window w;
+#endif
+
    unsigned int val;
 
-   xwin = elm_win_xwindow_get(data);
-   if (!xwin) return;
+#ifdef HAVE_WAYLAND
+   w = elm_win_wl_window_get(data);
+#elif HAVE_X
+   w = elm_win_xwindow_get(data);
+#endif
+   if (!w) return;
 
    evas_object_del(obj);
 
+#ifdef HAVE_X
    val = 2;
    ecore_x_window_prop_card32_set
-     (xwin, ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL, &val, 1);
-
-   _tts_shutdown();
+     (win, ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL, &val, 1);
 #else
-   fprintf(stderr, "TODO: workaround: disabled code from " __FILE__ );
+   fprintf(stderr, "TODO: workaround: disabled code from "
+          __FILE__ ":%d:", __LINE__);
 #endif
+   _tts_shutdown();
+
 }
 
 EAPI Eina_Bool
 ea_screen_reader_support_set(Evas_Object *win, Eina_Bool support)
 {
-#ifdef HAVE_X
-   Ecore_X_Window xwin;
+#ifdef HAVE_WAYLAND
+   Ecore_Wl_Window *w;
+#elif HAVE_X
+   Ecore_X_Window w;
+#endif
    unsigned int val;
    int tts_val;
    Evas_Object *base;
@@ -153,16 +171,25 @@ ea_screen_reader_support_set(Evas_Object *win, Eina_Bool support)
 
    if (!win) return EINA_FALSE;
 
-   xwin = elm_win_xwindow_get(win);
-   if (!xwin) return EINA_FALSE;
+#ifdef HAVE_WAYLAND
+   w = elm_win_wl_window_get(win);
+#elif HAVE_X
+   w = elm_win_xwindow_get(win);
+#endif
+
+   if (!w) return EINA_FALSE;
 
    if (support)
      {
         val = 0;
         elm_config_access_set(EINA_TRUE);
-
+#ifdef HAVE_X
         ecore_x_window_prop_card32_set
-          (xwin, ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL, &val, 1);
+          (w, ECORE_X_ATOM_E_ILLUME_ACCESS_CONTROL, &val, 1);
+#else
+        fprintf(stderr, "TODO: workaround: disabled code from "
+               __FILE__ ":%d:", __LINE__);
+#endif
      }
    else
      {
@@ -179,9 +206,6 @@ 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