Remove unnecessary build configuration 88/126688/1
authorHwankyu Jhun <h.jhun@samsung.com>
Mon, 24 Apr 2017 22:33:59 +0000 (07:33 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Mon, 24 Apr 2017 22:33:59 +0000 (07:33 +0900)
Tizen only supports wayland.

Change-Id: Iea93aef2de64e1224672d9e2a77820f011bbef4e
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
CMakeLists.txt
packaging/capi-system-media-key.spec
src/media_key.c

index 9c81578972fc812ce9140aabfe5b5914681c0e11..6f070b715b08f1745a22559cfde25be9c9ee5b47 100644 (file)
@@ -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)
index 16df96e55a982de11ca89f9b8516ddd2b8fdd5d6..d59296d5e34b65faf36fc0f9216d2393ed7b816b 100644 (file)
@@ -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
-
-
index 62546e4217155103678e2cfd05a6a137d9c6acdc..1bced86dba90e928793145cf8e994af749e4fbe5 100644 (file)
 #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;