From: Hwankyu Jhun Date: Mon, 24 Apr 2017 22:33:59 +0000 (+0900) Subject: Remove unnecessary build configuration X-Git-Tag: submit/tizen/20170425.040634~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F88%2F126688%2F1;p=platform%2Fcore%2Fapi%2Fmedia-key.git Remove unnecessary build configuration Tizen only supports wayland. Change-Id: Iea93aef2de64e1224672d9e2a77820f011bbef4e Signed-off-by: Hwankyu Jhun --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c81578..6f070b7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,16 +10,7 @@ SET(PREFIX ${CMAKE_INSTALL_PREFIX}) SET(INC_DIR include) INCLUDE_DIRECTORIES(${INC_DIR}) -SET(requires "dlog capi-base-common ecore ecore-input evas") -IF (WITH_WAYLAND) - ADD_DEFINITIONS("-DWAYLAND") - SET(requires "${requires} ecore-wayland") -ENDIF (WITH_WAYLAND) -IF (WITH_X11) - ADD_DEFINITIONS("-DX11") - SET(requires "${requires} ecore-x utilX") -ENDIF (WITH_X11) - +SET(requires "dlog capi-base-common ecore ecore-input evas ecore-wayland") SET(pc_requires "capi-base-common") INCLUDE(FindPkgConfig) diff --git a/packaging/capi-system-media-key.spec b/packaging/capi-system-media-key.spec index 16df96e..d59296d 100644 --- a/packaging/capi-system-media-key.spec +++ b/packaging/capi-system-media-key.spec @@ -1,6 +1,3 @@ -%bcond_with x -%bcond_with wayland - Name: capi-system-media-key Summary: A System Information library in SLP C API Version: 0.1.0 @@ -15,19 +12,11 @@ BuildRequires: pkgconfig(capi-base-common) BuildRequires: pkgconfig(ecore) BuildRequires: pkgconfig(ecore-input) BuildRequires: pkgconfig(evas) - -%if %{with x} -BuildRequires: pkgconfig(x11) -BuildRequires: pkgconfig(utilX) -%endif -%if %{with wayland} BuildRequires: pkgconfig(ecore-wayland) -%endif %description %{summary}. - %package devel Summary: A Media Key library in SLP C API (Development) Group: System/API @@ -42,13 +31,9 @@ cp %{SOURCE1001} . %build MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'` -%cmake . -DFULLVER=%{version} -DMAJORVER=${MAJORVER} \ -%if %{with wayland} --DWITH_WAYLAND=TRUE -%endif -%if %{with x} --DWITH_X11=TRUE -%endif +%cmake -DFULLVER=%{version} \ + -DMAJORVER=${MAJORVER} \ + . make %{?jobs:-j%jobs} @@ -61,7 +46,7 @@ make %{?jobs:-j%jobs} %files %manifest %{name}.manifest -%license LICENSE +%license LICENSE %{_libdir}/libcapi-system-media-key.so.* %manifest capi-system-media-key.manifest @@ -70,5 +55,3 @@ make %{?jobs:-j%jobs} %{_includedir}/system/media_key.h %{_libdir}/pkgconfig/*.pc %{_libdir}/libcapi-system-media-key.so - - diff --git a/src/media_key.c b/src/media_key.c index 62546e4..1bced86 100644 --- a/src/media_key.c +++ b/src/media_key.c @@ -20,12 +20,7 @@ #include #include #include -#if defined(X11) -#include -#include -#elif defined(WAYLAND) #include -#endif #include @@ -62,29 +57,12 @@ static int _media_key_initialized; static Ecore_Event_Handler *media_key_up; static Ecore_Event_Handler *media_key_down; -#if defined(X11) -static Ecore_X_Window win; -#endif - static int _media_key_init(void) { if (_media_key_initialized) return 0; -#if defined(X11) - ecore_x_init(NULL); - - win = ecore_x_window_input_new(ecore_x_window_root_first_get(), 0, 0, 1, 1); - if (!win) { - LOGE("failed to create input window"); - return -1; - } - ecore_x_icccm_title_set(win, "media key receiver"); - ecore_x_netwm_name_set(win, "media key receiver"); - ecore_x_netwm_pid_set(win, getpid()); -#elif defined(WAYLAND) ecore_wl_init(NULL); -#endif _media_key_initialized = 1; return 0; @@ -92,12 +70,7 @@ static int _media_key_init(void) static void _media_key_fini(void) { -#if defined(X11) - ecore_x_window_free(win); - ecore_x_shutdown(); -#elif defined(WAYLAND) ecore_wl_shutdown(); -#endif _media_key_initialized = 0; } @@ -150,26 +123,9 @@ static Eina_Bool _media_key_release_cb(void *data, int type, void *event) static int _grab_media_key(void) { int i; -#if defined(X11) - int ret; -#elif defined(WAYLAND) Eina_Bool ret; -#endif - for (i = 0; media_keys[i].key_str; i++) { -#if defined(X11) - ret = utilx_grab_key(ecore_x_display_get(), win, - media_keys[i].key_str, OR_EXCLUSIVE_GRAB); - if (ret < 0) { - LOGE("failed to grab key: %s", media_keys[i].key_str); - for (i = i - 1; i >= 0; i--) - utilx_ungrab_key(ecore_x_display_get(), win, - media_keys[i].key_str); - - return ret; - } -#elif defined(WAYLAND) ret = ecore_wl_window_keygrab_set(NULL, media_keys[i].key_str, 0, 0, 0, ECORE_WL_WINDOW_KEYGRAB_OVERRIDE_EXCLUSIVE); if (ret != EINA_TRUE) { @@ -179,7 +135,6 @@ static int _grab_media_key(void) return -1; } -#endif } return 0; @@ -188,23 +143,12 @@ static int _grab_media_key(void) static int _ungrab_media_key(void) { int i; -#if defined(X11) - int ret; -#elif defined(WAYLAND) Eina_Bool ret; -#endif for (i = 0; media_keys[i].key_str; i++) { -#if defined(X11) - ret = utilx_ungrab_key(ecore_x_display_get(), win, - media_keys[i].key_str); - if (ret) - LOGE("failed to ungrab key: %s", media_keys[i].key_str); -#elif defined(WAYLAND) ret = ecore_wl_window_keygrab_unset(NULL, media_keys[i].key_str, 0, 0); if (ret != EINA_TRUE) LOGE("failed to ungrab key: %s", media_keys[i].key_str); -#endif } return 0;