diff options
author | Hwankyu Jhun <h.jhun@samsung.com> | 2017-04-25 07:33:59 +0900 |
---|---|---|
committer | Hwankyu Jhun <h.jhun@samsung.com> | 2017-04-25 07:33:59 +0900 |
commit | 35600cc0bd04c23ed8059da723a363ee5ac5db19 (patch) | |
tree | 7c37bcc38dc3eb49822d1f4e0efdf07406c72beb | |
parent | cf9f6148a4e16338e93fee5390552865316ffc12 (diff) | |
download | media-key-35600cc0bd04c23ed8059da723a363ee5ac5db19.tar.gz media-key-35600cc0bd04c23ed8059da723a363ee5ac5db19.tar.bz2 media-key-35600cc0bd04c23ed8059da723a363ee5ac5db19.zip |
Remove unnecessary build configuration
Tizen only supports wayland.
Change-Id: Iea93aef2de64e1224672d9e2a77820f011bbef4e
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
-rw-r--r-- | CMakeLists.txt | 11 | ||||
-rw-r--r-- | packaging/capi-system-media-key.spec | 25 | ||||
-rw-r--r-- | src/media_key.c | 56 |
3 files changed, 5 insertions, 87 deletions
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 <Evas.h> #include <Ecore.h> #include <Ecore_Input.h> -#if defined(X11) -#include <Ecore_X.h> -#include <utilX.h> -#elif defined(WAYLAND) #include <Ecore_Wayland.h> -#endif #include <dlog.h> @@ -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; |