Replace ecore-x by ecore-wayland in Pure Wayland.
No font change notification on wayland, I don't know
if it's possible.
Also support X11+wayland configuration (else FTBFS)
Bug-Tizen: PTREL-653/part
Change-Id: Ia9cccb44babc3aeaaeaa82586c0a51a31cb05ed3
Signed-off-by: Ronan Le Martret <ronan@fridu.net>
Signed-off-by: Philippe Coval <philippe.coval@open.eurogiciel.org>
SET(INC_DIR include)
INCLUDE_DIRECTORIES(${INC_DIR})
-SET(requires "elementary ecore ecore-x ecore-file dlog vconf appcore-efl capi-base-common glib-2.0 gobject-2.0 fontconfig libxml-2.0")
+IF(X11_SUPPORT)
+SET(ecore "ecore ecore-x")
+ENDIF(X11_SUPPORT)
+
+IF(WAYLAND_SUPPORT)
+SET(ecore "ecore ecore-wayland")
+ENDIF(WAYLAND_SUPPORT)
+
+SET(requires
+ dlog vconf
+ elementary ${ecore} ecore-file appcore-efl
+ capi-base-common
+ glib-2.0 gobject-2.0 fontconfig libxml-2.0
+)
+
SET(pc_requires "capi-base-common")
ADD_EXECUTABLE(test_gui TC_gui/main.c)
INCLUDE(FindPkgConfig)
-pkg_check_modules(test_gui REQUIRED "elementary appcore-efl ecore-imf ecore-x ecore-x eina ecore ecore-evas ecore-input")
+
+IF(X11_SUPPORT)
+ ADD_DEFINITIONS("-DUSE_X11")
+ENDIF(X11_SUPPORT)
+IF(WAYLAND_SUPPORT)
+ ADD_DEFINITIONS("-DUSE_WAYLAND")
+ENDIF(WAYLAND_SUPPORT)
+
+pkg_check_modules(test_gui REQUIRED ${ecore} "elementary appcore-efl eina ecore-imf ecore-evas ecore-input")
+
FOREACH(flag ${test_gui_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
ENDFOREACH(flag)
ADD_CUSTOM_TARGET (distclean @echo cleaning for source distribution)
ADD_CUSTOM_COMMAND(
- DEPENDS clean
+ DEPENDS clean
COMMENT "distribution clean"
COMMAND find
- ARGS .
+ ARGS .
-not -name config.cmake -and \(
-name tester.c -or
-name Testing -or
elm_win_borderless_set(eo, EINA_TRUE);
elm_win_autodel_set(eo, EINA_TRUE);
evas_object_smart_callback_add(eo, "delete,request", _quit_cb, NULL);
- ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, &h);
+
+#ifdef USE_X11
+ Ecore_X_Window xwin = 0;
+ xwin = elm_win_xwindow_get(eo);
+ if (xwin > 0) ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, &h);
+ else {
+#endif
+#ifdef USE_WAYLAND
+ Ecore_Wl_Window *wlwin = NULL;
+ wlwin = elm_win_wl_window_get(eo);
+ if (wlwin != NULL) ecore_wl_screen_size_get(&w, &h);
+#endif
+#ifdef USE_X11
+ }
+#endif
+
evas_object_resize(eo, w, h);
return eo;
#include <stdio.h>
#include <Elementary.h>
#include <appcore-efl.h>
-#include <Ecore_X.h>
+#ifdef USE_X11
+#include <Ecore_X.h>
+#endif
+#ifdef USE_WAYLAND
+#include <Ecore.h>
+#include <Ecore_Wayland.h>
+#endif
#define PACKAGE "com.samsung.appcore-mini"
+%bcond_with x
+%bcond_with wayland
+
Name: capi-system-system-settings
Summary: A System Settings library in Tizen Native API
Version: 0.0.2
BuildRequires: pkgconfig(capi-base-common)
BuildRequires: pkgconfig(elementary)
BuildRequires: pkgconfig(ecore)
-BuildRequires: pkgconfig(ecore-x)
+%if %{with x}
+BuildRequires: pkgconfig(ecore-x)
+%endif
+%if %{with wayland}
+BuildRequires: pkgconfig(ecore-wayland)
+%endif
BuildRequires: pkgconfig(ecore-file)
BuildRequires: pkgconfig(appcore-efl)
BuildRequires: pkgconfig(capi-base-common)
%build
MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
-%cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
+%cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER} \
+%if %{with x}
+ -DX11_SUPPORT=On \
+%else
+ -DX11_SUPPORT=Off \
+%endif
+%if %{with wayland}
+ -DWAYLAND_SUPPORT=On
+%else
+ -DWAYLAND_SUPPORT=Off
+%endif
make %{?jobs:-j%jobs}
#include <libxml/xmlmemory.h>
#include <libxml/parser.h>
+#ifdef USE_X11
#include <Ecore_X.h>
+#endif
+#ifdef USE_WAYLAND
+#include <Ecore.h>
+#include <Ecore_Wayland.h>
+#endif
+
#include <Elementary.h>
#include <system_settings.h>
int ret = access(path ,R_OK);
if (ret == 0)
{
- SETTING_TRACE("found the file %s", path);
+ SETTING_TRACE("found the file %s", path);
return 0;
}
else
static void font_config_set_notification()
{
+#ifdef USE_X11
/* notification */
- Ecore_X_Window ecore_win = ecore_x_window_root_first_get();
- Ecore_X_Atom atom = ecore_x_atom_get("FONT_TYPE_change");
- ecore_x_window_prop_string_set(ecore_win, atom, "tizen");
+ Ecore_X_Window ecore_xwin = ecore_x_window_root_first_get();
+ if (ecore_xwin != 0) {
+ Ecore_X_Atom atom = ecore_x_atom_get("FONT_TYPE_change");
+ ecore_x_window_prop_string_set(ecore_xwin, atom, "tizen");
+ }
+ else {
+#endif
+#ifdef USE_WAYLAND
+ //No font change notification on Wayland.(yet?)
+#endif
+#ifdef USE_X11
+ }
+#endif
}
static void font_config_set(char *font_name)