From 47c186ef3fd29e34e11a9915625c5925703cf5be Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Wed, 10 Jan 2018 16:29:38 +0900 Subject: Remove unnecessary build configuration Tizen only supports wayland. Change-Id: I05530f238faca0dad84d8dac84f53f2d5d47f4b8 Signed-off-by: Hwankyu Jhun --- CMakeLists.txt | 12 +--- client/CMakeLists.txt | 8 +-- include/ug-manager.h | 9 --- packaging/ui-gadget-1.spec | 20 ++---- src/manager.c | 148 +------------------------------------------ src/ug.c | 18 ------ ug-efl-engine/CMakeLists.txt | 11 +--- 7 files changed, 8 insertions(+), 218 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 69662f0..d56859e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,17 +23,7 @@ AUX_SOURCE_DIRECTORY(src SRCS) ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS}) SET(PKGS_CHECK_MODULES "glib-2.0 bundle dlog capi-appfw-application appsvc capi-appfw-app-manager ecore dbus-glib-1 elementary pkgmgr-info libtzplatform-config") -IF (with_x) - PKG_CHECK_MODULES(PKGS REQUIRED ${PKGS_CHECK_MODULES} x11) - SET(UG_FLAG "") -ENDIF(with_x) - -IF (with_wayland) - ADD_DEFINITIONS("-DUG_WAYLAND") - PKG_CHECK_MODULES(PKGS REQUIRED ${PKGS_CHECK_MODULES}) - SET(UG_FLAG "-DUG_WAYLAND") -ENDIF (with_wayland) - +PKG_CHECK_MODULES(PKGS REQUIRED ${PKGS_CHECK_MODULES}) FOREACH(flag ${PKGS_CFLAGS}) SET(CFLAGS "${CFLAGS} ${flag}") ENDFOREACH(flag) diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index 7f507fb..da22dbf 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -9,13 +9,7 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) INCLUDE(FindPkgConfig) SET(CLIENT_PKGS_CHECK_MODULES "capi-appfw-application appcore-efl appsvc bundle edje dlog elementary evas vconf") -IF (with_x) - PKG_CHECK_MODULES(CLIENT_PKGS REQUIRED ${CLIENT_PKGS_CHECK_MODULES} ecore-x x11) -ENDIF(with_x) - -IF (with_wayland) - PKG_CHECK_MODULES(CLIENT_PKGS REQUIRED ${CLIENT_PKGS_CHECK_MODULES}) -ENDIF(with_wayland) +PKG_CHECK_MODULES(CLIENT_PKGS REQUIRED ${CLIENT_PKGS_CHECK_MODULES}) FOREACH(flag ${CLIENT_PKGS_CFLAGS}) SET(CLIENT_CFLAGS "${CLIENT_CFLAGS} ${flag} -fPIE") diff --git a/include/ug-manager.h b/include/ug-manager.h index 27126e7..0f75183 100644 --- a/include/ug-manager.h +++ b/include/ug-manager.h @@ -22,10 +22,6 @@ #ifndef __UG_MANAGER_H__ #define __UG_MANAGER_H__ -#ifndef UG_WAYLAND -#include -#endif - #include #include "ug.h" @@ -38,12 +34,7 @@ ui_gadget_h ugman_ug_load(ui_gadget_h parent, int ugman_ug_del(ui_gadget_h ug); int ugman_ug_del_all(void); -#ifndef UG_WAYLAND -int ugman_init(Display *disp, Window xid, void *win, enum ug_option opt); -#else int ugman_init(void *win, enum ug_option opt); -#endif - int ugman_init_efl(Evas_Object *win, enum ug_option opt); int ugman_resume(void); diff --git a/packaging/ui-gadget-1.spec b/packaging/ui-gadget-1.spec index 0c44937..7ea06fa 100644 --- a/packaging/ui-gadget-1.spec +++ b/packaging/ui-gadget-1.spec @@ -1,6 +1,3 @@ -%bcond_with x -%bcond_with wayland - Name: ui-gadget-1 Summary: UI Gadget Library Version: 0.2.5 @@ -15,9 +12,6 @@ BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(appcore-efl) BuildRequires: pkgconfig(bundle) BuildRequires: pkgconfig(dlog) -%if %{with x} -BuildRequires: pkgconfig(x11) -%endif BuildRequires: pkgconfig(appsvc) BuildRequires: pkgconfig(elementary) BuildRequires: pkgconfig(capi-appfw-application) @@ -36,9 +30,6 @@ UI gadget library (development headers) Summary: Development files for %{name} Group: Development/Libraries Requires: %{name} = %{version}-%{release} -%if %{with x} -Requires: pkgconfig(x11) -%endif %description devel Development files for %{name} @@ -49,13 +40,10 @@ cp %{SOURCE1001} . %build MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` -%cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER} \ --DTZ_SYS_ETC=%TZ_SYS_ETC \ -%if %{with wayland} && !%{with x} --Dwith_wayland=TRUE -%else --Dwith_x=TRUE -%endif +%cmake -DFULLVER=%{version} \ + -DMAJORVER=${MAJORVER} \ + -DTZ_SYS_ETC=%TZ_SYS_ETC \ + . make %{?jobs:-j%jobs} diff --git a/src/manager.c b/src/manager.c index e7b7f41..5ee7416 100644 --- a/src/manager.c +++ b/src/manager.c @@ -25,15 +25,7 @@ #include #include #include - -#ifndef UG_WAYLAND -#include -#include -#include -#else #include -#endif - #include #include "ug.h" @@ -58,12 +50,6 @@ struct ug_manager { GSList *fv_list; void *win; - -#ifndef UG_WAYLAND - Window win_id; - Display *disp; -#endif - enum ug_option base_opt; enum ug_event last_rotate_evt; @@ -135,102 +121,6 @@ static int ug_fvlist_del(ui_gadget_h c) return 0; } -#ifndef UG_WAYLAND -static int __ug_x_get_window_property(Display *dpy, Window win, Atom atom, - Atom type, unsigned int *val, - unsigned int len) -{ - unsigned char *prop_ret; - Atom type_ret; - unsigned long bytes_after; - unsigned long num_ret; - int format_ret; - unsigned int i; - int num; - - prop_ret = NULL; - if (XGetWindowProperty(dpy, win, atom, 0, 0x7fffffff, False, - type, &type_ret, &format_ret, &num_ret, - &bytes_after, &prop_ret) != Success) - return -1; - - if (type_ret != type || format_ret != 32) - num = -1; - else if (num_ret == 0 || !prop_ret) - num = 0; - else { - if (num_ret < len) - len = num_ret; - for (i = 0; i < len; i++) - val[i] = ((unsigned long *)prop_ret)[i]; - num = len; - } - - if (prop_ret) - XFree(prop_ret); - - return num; -} -#endif - -#ifndef UG_WAYLAND -static enum ug_event __ug_x_rotation_get(Display *dpy, Window win) -{ - Window active_win; - Window root_win; - int rotation = -1; - int ret = -1; - enum ug_event func_ret; - - Atom atom_active_win; - Atom atom_win_rotate_angle; - - root_win = XDefaultRootWindow(dpy); - - atom_active_win = XInternAtom(dpy, "_NET_ACTIVE_WINDOW", False); - ret = __ug_x_get_window_property(dpy, root_win, atom_active_win, - XA_WINDOW, - (unsigned int *)&active_win, 1); - if (ret < 0) { - func_ret = UG_EVENT_ROTATE_PORTRAIT; - goto func_out; - } - - atom_win_rotate_angle = - XInternAtom(dpy, "_E_ILLUME_ROTATE_ROOT_ANGLE", False); - ret = __ug_x_get_window_property(dpy, root_win, - atom_win_rotate_angle, XA_CARDINAL, - (unsigned int *)&rotation, 1); - - _DBG("x_rotation_get / ret(%d),degree(%d)", ret, rotation); - - if (ret == -1) - func_ret = UG_EVENT_ROTATE_PORTRAIT; - else { - switch (rotation) { - case 0: - func_ret = UG_EVENT_ROTATE_PORTRAIT; - break; - case 90: - func_ret = UG_EVENT_ROTATE_LANDSCAPE_UPSIDEDOWN; - break; - case 180: - func_ret = UG_EVENT_ROTATE_PORTRAIT_UPSIDEDOWN; - break; - case 270: - func_ret = UG_EVENT_ROTATE_LANDSCAPE; - break; - default: - func_ret = UG_EVENT_ROTATE_PORTRAIT; - break; - } - } - -func_out: - return func_ret; -} -#endif - static enum ug_event __ug_evas_rotation_get(Evas_Object *win) { @@ -500,7 +390,6 @@ static int ugman_ug_resume(void *data) return 0; } -#ifdef UG_WAYLAND static void _ugman_enable_indicator(Evas_Object *win, int enable) { Ecore_Wl_Window *wlwin = elm_win_wl_window_get(win); @@ -527,13 +416,9 @@ static int _ugman_get_indicator_state(Evas_Object *win) return ret; } -#endif static int ugman_indicator_update(enum ug_option opt, enum ug_event event) { -#ifndef UG_WAYLAND - _ERR("controlling indicator is disabled"); -#else int enable; int cur_state; @@ -578,7 +463,6 @@ static int ugman_indicator_update(enum ug_option opt, enum ug_event event) _ugman_enable_indicator(ug_man.win, enable); } -#endif return 0; } @@ -774,13 +658,8 @@ static int ugman_ug_create(void *data) ugman_indicator_update(ug->opt, UG_EVENT_NONE); } - if (ug_man.last_rotate_evt == UG_EVENT_NONE) { -#ifndef UG_WAYLAND - ug_man.last_rotate_evt = __ug_x_rotation_get(ug_man.disp, ug_man.win_id); -#else + if (ug_man.last_rotate_evt == UG_EVENT_NONE) ug_man.last_rotate_evt = __ug_evas_rotation_get((Evas_Object *)ug_man.win); -#endif - } ugman_ug_event(ug, ug_man.last_rotate_evt); if (ug->mode == UG_MODE_FRAMEVIEW) @@ -1107,23 +986,6 @@ int ugman_ug_del_all(void) return 0; } -#ifndef UG_WAYLAND -int ugman_init(Display *disp, Window xid, void *win, enum ug_option opt) -{ - ug_man.win = win; - ug_man.disp = disp; - ug_man.win_id = xid; - ug_man.base_opt = opt; - ug_man.last_rotate_evt = UG_EVENT_NONE; - - if (!ug_man.is_initted) - ug_man.engine = ug_engine_load(); - - ug_man.is_initted = 1; - - return 0; -} -#else int ugman_init(void *win, enum ug_option opt) { ug_man.win = win; @@ -1137,18 +999,10 @@ int ugman_init(void *win, enum ug_option opt) return 0; } -#endif int ugman_init_efl(Evas_Object *win, enum ug_option opt) { -#ifndef UG_WAYLAND - Ecore_X_Window xwin = elm_win_xwindow_get(win); - if (xwin) - return ugman_init((Display *)ecore_x_display_get(), xwin, win, opt); -#else return ugman_init(win, opt); -#endif - return -1; } int ugman_resume(void) diff --git a/src/ug.c b/src/ug.c index 8f2fb9f..a32f752 100644 --- a/src/ug.c +++ b/src/ug.c @@ -97,23 +97,6 @@ UG_API ui_gadget_h ug_create(ui_gadget_h parent, return ugman_ug_load(parent, name, mode, app_control, cbs); } -#ifndef UG_WAYLAND -UG_API int ug_init(void *disp, unsigned long xid, void *win, enum ug_option opt) -{ - if (!win || !xid || !disp) { - _ERR("ug_init() failed: Invalid arguments"); - return -1; - } - - if (opt < UG_OPT_INDICATOR_ENABLE || opt >= UG_OPT_MAX) { - _ERR("ug_init() failed: Invalid option"); - return -1; - } - - return ugman_init((Display *)disp, (Window)xid, win, opt); -} -#else - /* LCOV_EXCL_START */ UG_API int ug_init(void *disp, unsigned long xid, void *win, enum ug_option opt) { @@ -125,7 +108,6 @@ UG_API int ug_init(void *disp, unsigned long xid, void *win, enum ug_option opt) return ugman_init(win, opt); } /* LCOV_EXCL_STOP */ -#endif /* LCOV_EXCL_START */ UG_API int UG_INIT_EFL(void *win, enum ug_option opt) diff --git a/ug-efl-engine/CMakeLists.txt b/ug-efl-engine/CMakeLists.txt index cff47ad..857ea77 100644 --- a/ug-efl-engine/CMakeLists.txt +++ b/ug-efl-engine/CMakeLists.txt @@ -3,16 +3,7 @@ SET(UG_EFL_ENGINE_SRCS ug-efl-engine.c) SET(UG_ENGINE_EDJ_DIR "${CMAKE_INSTALL_PREFIX}/share/edje") SET(UG_EFL_ENGINE_PKGS_CHECK_MODULES "dlog elementary ecore edje capi-appfw-application evas") -IF (with_x) - PKG_CHECK_MODULES(UG_EFL_ENGINE_PKGS REQUIRED - ${UG_EFL_ENGINE_PKGS_CHECK_MODULES} - ecore-x) -ENDIF(with_x) - -IF (with_wayland) - PKG_CHECK_MODULES(UG_EFL_ENGINE_PKGS REQUIRED - ${UG_EFL_ENGINE_PKGS_CHECK_MODULES}) -ENDIF(with_wayland) +PKG_CHECK_MODULES(UG_EFL_ENGINE_PKGS REQUIRED ${UG_EFL_ENGINE_PKGS_CHECK_MODULES}) FOREACH(flag ${UG_EFL_ENGINE_PKGS_CFLAGS}) SET(UG_EFL_ENGINE_CFLAGS "${UG_EFL_ENGINE_CFLAGS} ${flag}") -- cgit v1.2.3