From 00e564c99da29bdacb3fca608b6dc25532d4b405 Mon Sep 17 00:00:00 2001 From: "Li,Limin" Date: Thu, 19 Dec 2013 10:27:31 +0800 Subject: init wayland support The display server based on X or Wayland, is now a choice of different profile in Tizen 3.0. Basically and consistently, two macros were used "with wayland" and "with x". Below summarize the combination of the macros: | wayland | x | meaning |--------------------------- | 0 | 1 | pure X11 platform(no wayland) | 1 | 0 | pure wayland platform (no X11) | 1 | 1 | wayland but X compatibility | 0 | 0 | no X and no wayland This method unifies the meaning and usage. Deploy this method to app-svc package. Signed-off-by: Li,Limin Change-Id: Ic8867f2c35a3192088de91e592ddf6e169511607 --- CMakeLists.txt | 15 +++++++++++++-- packaging/app-svc.spec | 15 +++++++++++++-- src/appsvc.c | 27 ++++++++++++++++++++++++++- 3 files changed, 52 insertions(+), 5 deletions(-) mode change 100755 => 100644 CMakeLists.txt mode change 100755 => 100644 src/appsvc.c diff --git a/CMakeLists.txt b/CMakeLists.txt old mode 100755 new mode 100644 index b531550..f6326fa --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,8 +22,19 @@ MESSAGE("Build type: ${CMAKE_BUILD_TYPE}") # Set required packages INCLUDE(FindPkgConfig) -pkg_check_modules(pkgs REQUIRED dlog ecore x11 libprivilege-control aul) -pkg_check_modules(libpkgs REQUIRED dlog bundle dbus-glib-1 ail xdgmime aul glib-2.0 ecore-x ecore libsoup-2.4 iniparser pkgmgr-info) +SET(APPSVC_PKGS_CHECK_MODULES "dlog ecore libprivilege-control aul") +SET(APPSVC_LIBPKGS_CHECK_MODULES "dlog bundle dbus-glib-1 ail xdgmime aul glib-2.0 ecore libsoup-2.4 iniparser pkgmgr-info") + +IF (with_x) +pkg_check_modules(pkgs REQUIRED ${APPSVC_PKGS_CHECK_MODULES} x11) +pkg_check_modules(libpkgs REQUIRED ${APPSVC_LIBPKGS_CHECK_MODULES} ecore-x) +ENDIF(with_x) + +IF (with_wayland) +ADD_DEFINITIONS("-DWAYLAND") +pkg_check_modules(pkgs REQUIRED ${APPSVC_PKGS_CHECK_MODULES}) +pkg_check_modules(libpkgs REQUIRED ${APPSVC_LIBPKGS_CHECK_MODULES}) +ENDIF (with_wayland) FIND_LIBRARY(LIB_DL dl) diff --git a/packaging/app-svc.spec b/packaging/app-svc.spec index e6b930e..57bb777 100644 --- a/packaging/app-svc.spec +++ b/packaging/app-svc.spec @@ -1,3 +1,6 @@ +%bcond_with x +%bcond_with wayland + Name: app-svc Summary: Application Service Version: 0.1.53 @@ -13,7 +16,10 @@ BuildRequires: cmake BuildRequires: sqlite3 BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(ecore) +%if %{with x} BuildRequires: pkgconfig(x11) +BuildRequires: pkgconfig(ecore-x) +%endif BuildRequires: pkgconfig(libprivilege-control) BuildRequires: pkgconfig(bundle) BuildRequires: pkgconfig(dbus-glib-1) @@ -40,9 +46,14 @@ Requires: %{name} = %{version}-%{release} %setup -q cp %{SOURCE1001} . - %build -%cmake . +%cmake . \ +%if %{with wayland} && !%{with x} +-Dwith_wayland=TRUE +%else +-Dwith_x=TRUE +%endif + make %{?jobs:-j%jobs} %install diff --git a/src/appsvc.c b/src/appsvc.c old mode 100755 new mode 100644 index a94ff2d..603b3ab --- a/src/appsvc.c +++ b/src/appsvc.c @@ -28,7 +28,11 @@ #include #include #include + +#ifndef WAYLAND #include +#endif + #include #include #include @@ -612,6 +616,7 @@ static int __get_list_with_submode(char *win_id, GSList **pkg_list) ail_appinfo_h handle; char *submode_mainid = NULL; +#ifndef WAYLAND for (iter = *pkg_list; iter != NULL; ) { find_item = NULL; submode_mainid = NULL; @@ -649,6 +654,7 @@ static int __get_list_with_submode(char *win_id, GSList **pkg_list) iter = g_slist_next(iter); } } +#endif for (iter = *pkg_list; iter != NULL; iter = g_slist_next(iter)) { appid = (char *)iter->data; @@ -1049,12 +1055,17 @@ SLPAPI int appsvc_data_is_array(bundle *b, const char *key) typedef struct _appsvc_transient_cb_info_t{ appsvc_host_res_fn cb_func; + +#ifndef WAYLAND Ecore_X_Window win_id; +#endif + void *data; }appsvc_transient_cb_info_t; static Eina_Bool __transient_cb(void *data, int type, void *event) { +#ifndef WAYLAND Ecore_X_Event_Window_Hide *ev; appsvc_transient_cb_info_t* cb_info; @@ -1065,7 +1076,7 @@ static Eina_Bool __transient_cb(void *data, int type, void *event) cb_info->cb_func(cb_info->data); ecore_main_loop_quit(); } - +#endif return ECORE_CALLBACK_RENEW; } @@ -1081,6 +1092,7 @@ int __aul_subapp_cb(void *data) return 0; } +#ifndef WAYLAND SLPAPI int appsvc_allow_transient_app(bundle *b, Ecore_X_Window id) { char win_id[MAX_LOCAL_BUFSZ]; @@ -1094,7 +1106,14 @@ SLPAPI int appsvc_allow_transient_app(bundle *b, Ecore_X_Window id) return __set_bundle(b, APP_SVC_K_WIN_ID, win_id); } +#else +SLPAPI int appsvc_allow_transient_app(bundle *b, unsigned int id) +{ + return 0; +} +#endif +#ifndef WAYLAND SLPAPI int appsvc_request_transient_app(bundle *b, Ecore_X_Window callee_id, appsvc_host_res_fn cbfunc, void *data) { char *caller = NULL; @@ -1125,6 +1144,12 @@ SLPAPI int appsvc_request_transient_app(bundle *b, Ecore_X_Window callee_id, app return 0; } +#else +SLPAPI int appsvc_request_transient_app(bundle *b, unsigned int callee_id, appsvc_host_res_fn cbfunc, void *data) +{ + return 0; +} +#endif SLPAPI int appsvc_subapp_terminate_request_pid(int pid) { -- cgit v1.2.3