Remove unnecessary build configuration 18/133118/1
authorHwankyu Jhun <h.jhun@samsung.com>
Fri, 9 Jun 2017 04:08:17 +0000 (13:08 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Fri, 9 Jun 2017 04:08:17 +0000 (13:08 +0900)
Now, Tizen only supports Wayland.

Change-Id: Iedc44716abe1154cc1cb106189d09f75a36e1e2d
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
CMakeLists.txt
packaging/syspopup.spec
syspopup/CMakeLists.txt
syspopup/syspopup_efl.c
syspopup/syspopup_x.c [deleted file]
syspopup/syspopup_x.h [deleted file]

index 1b63904..7726297 100644 (file)
@@ -18,13 +18,6 @@ MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
 # Set required packages
 INCLUDE(FindPkgConfig)
 
-IF(with_wayland)
-       ADD_DEFINITIONS("-DWAYLAND")
-ENDIF(with_wayland)
-IF(with_x11)
-       ADD_DEFINITIONS("-DX11")
-ENDIF(with_x11)
-
 pkg_check_modules(libpkgs REQUIRED dlog bundle sqlite3 glib-2.0 gio-2.0 libtzplatform-config)
 
 FOREACH(flag ${libpkgs_CFLAGS})
index 7bf891e..a490a80 100644 (file)
@@ -1,6 +1,3 @@
-%bcond_with x
-%bcond_with wayland
-
 Name:           syspopup
 Summary:        Syspopup package
 Version:        0.2.0
@@ -19,16 +16,8 @@ BuildRequires:  pkgconfig(bundle)
 BuildRequires:  pkgconfig(dlog)
 BuildRequires:  pkgconfig(glib-2.0)
 BuildRequires:  pkgconfig(gio-2.0)
-%if %{with wayland}
 BuildRequires:  pkgconfig(ecore-wayland)
 BuildRequires:  pkgconfig(capi-ui-efl-util)
-%else
-%if %{with x}
-BuildRequires:  pkgconfig(utilX)
-BuildRequires:  pkgconfig(x11)
-BuildRequires:  pkgconfig(ecore-x)
-%endif
-%endif
 BuildRequires:  pkgconfig(evas)
 BuildRequires:  pkgconfig(elementary)
 BuildRequires:  pkgconfig(libtzplatform-config)
@@ -74,15 +63,7 @@ cp %{SOURCE1001} %{SOURCE1002} %{SOURCE1003} %{SOURCE1004} .
 %build
 
 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
-%cmake \
-%if %{with wayland}
-       -Dwith_wayland=TRUE \
-%else
-%if %{with x}
-       -Dwith_x11=TRUE \
-%endif
-%endif
-       -DTZ_SYS_RO_PACKAGES=%{TZ_SYS_RO_PACKAGES} \
+%cmake -DTZ_SYS_RO_PACKAGES=%{TZ_SYS_RO_PACKAGES} \
        -DTZ_SYS_RO_SHARE=%{TZ_SYS_RO_SHARE} \
        -DEXTRA_CFLAGS=-fPIC \
        -DFULLVER=%{version} \
index 42401fa..7945013 100644 (file)
@@ -18,17 +18,12 @@ MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
 # Set required packages
 INCLUDE(FindPkgConfig)
 
-SET(APPSVC_SPPPGS_CHECK_MODULES "dlog bundle sqlite3 glib-2.0 gio-2.0 evas elementary ecore ecore-input libtzplatform-config")
+SET(SYSPOPUP_CHECK_MODULES "dlog bundle sqlite3 glib-2.0 gio-2.0 evas elementary ecore ecore-input libtzplatform-config ecore-wayland capi-ui-efl-util")
 SET(pc_requires "bundle elementary")
 
-IF(with_wayland)
-       pkg_check_modules(sppkgs REQUIRED ${APPSVC_SPPPGS_CHECK_MODULES} ecore-wayland capi-ui-efl-util)
-ENDIF(with_wayland)
-IF(with_x11)
-       pkg_check_modules(sppkgs REQUIRED ${APPSVC_SPPPGS_CHECK_MODULES} utilX ecore-x x11)
-ENDIF(with_x11)
+PKG_CHECK_MODULES(SP_PKGS REQUIRED ${SYSPOPUP_CHECK_MODULES})
 
-FOREACH(flag ${sppkgs_CFLAGS})
+FOREACH(flag ${SP_PKGS_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
 ENDFOREACH(flag)
 
@@ -58,14 +53,9 @@ SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
 
 
 ### Build ###
-IF(with_wayland)
-       add_library(syspopup SHARED syspopup.c syspopup_efl.c syspopup_wayland.c)
-ENDIF(with_wayland)
-IF(with_x11)
-       add_library(syspopup SHARED syspopup.c syspopup_efl.c syspopup_x.c)
-ENDIF(with_x11)
-
-target_link_libraries(syspopup syspopup_mods ${sppkgs_LDFLAGS})
+add_library(syspopup SHARED syspopup.c syspopup_efl.c syspopup_wayland.c)
+
+target_link_libraries(syspopup syspopup_mods ${SP_PKGS_LDFLAGS})
 SET_TARGET_PROPERTIES(syspopup PROPERTIES SOVERSION ${MAJORVER})
 SET_TARGET_PROPERTIES(syspopup PROPERTIES VERSION ${FULLVER})
 
index 6b0b8d4..ee17b54 100755 (executable)
 #include "syspopup.h"
 #include "syspopup_api.h"
 #include "simple_util.h"
-#if defined(X11)
-#include "syspopup_x.h"
-#elif defined(WAYLAND)
 #include "syspopup_wayland.h"
-#endif
 
 static Eina_Bool __keydown_cb(void *data, int type, void *event)
 {
@@ -42,11 +38,7 @@ static Eina_Bool __keydown_cb(void *data, int type, void *event)
        if (ev == NULL)
                return ECORE_CALLBACK_DONE;
 
-#if defined(X11)
-       x_syspopup_process_keypress(id, ev->keyname);
-#elif defined(WAYLAND)
        wl_syspopup_process_keypress(id, ev->keyname);
-#endif
 
        return ECORE_CALLBACK_PASS_ON;
 }
@@ -87,21 +79,12 @@ int syspopup_efl_create(const char *popup_name, bundle *b, Evas_Object *parent,
        _syspopup_set_term_type(sp, info);
        _syspopup_set_endkey_type(sp, info);
 
-#if defined(X11)
-       sp->internal_data = (void *)elm_win_xwindow_get(parent);
-       if (x_syspopup_init(sp, info) < 0) {
-               _syspopup_info_free(info);
-               _syspopup_del(sp->id);
-               return -1;
-       }
-#elif defined(WAYLAND)
        sp->internal_data = (void *)elm_win_wl_window_get(parent);
        if (wl_syspopup_init(sp, info) < 0) {
                _syspopup_info_free(info);
                _syspopup_del(sp->id);
                return -1;
        }
-#endif
 
        _syspopup_reset_timeout(sp, info);
        if (sp->endkey_act != SYSPOPUP_KEYEND_IGNORE) {
@@ -116,9 +99,5 @@ int syspopup_efl_create(const char *popup_name, bundle *b, Evas_Object *parent,
 
 int syspopup_efl_reset(bundle *b)
 {
-#if defined(X11)
-       return x_syspopup_reset(b);
-#elif defined(WAYLAND)
        return wl_syspopup_reset(b);
-#endif
 }
diff --git a/syspopup/syspopup_x.c b/syspopup/syspopup_x.c
deleted file mode 100644 (file)
index 2775385..0000000
+++ /dev/null
@@ -1,373 +0,0 @@
-/*
- * syspopup x11
- *
- * Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <utilX.h>
-#include <X11/Xatom.h>
-#include <X11/Xutil.h>
-#include <Ecore_X.h>
-
-#include "syspopup.h"
-#include "syspopup_x.h"
-#include "simple_util.h"
-
-static void __x_rotation_set(Display *dpy, Window win, syspopup *sp);
-
-static void __x_syspopup_term_handler(gpointer data, gpointer user_data)
-{
-       syspopup *sp = data;
-       Display *dpy;
-       Window win;
-
-       if (sp == NULL)
-               return;
-
-       dpy = XOpenDisplay(NULL);
-       win = (Window)sp->internal_data;
-       _D("term action %d - %s", sp->term_act, sp->name);
-
-       switch (sp->term_act) {
-       case SYSPOPUP_TERM:
-               if (sp->def_term_fn)
-                       sp->def_term_fn(sp->dupped_bundle, sp->user_data);
-               XKillClient(dpy, win);
-               break;
-       case SYSPOPUP_HIDE:
-               if (sp->def_term_fn)
-                       sp->def_term_fn(sp->dupped_bundle, sp->user_data);
-               XUnmapWindow(dpy, win);
-               break;
-       default:
-               _D("term action IGNORED: %s", sp->name);
-               break;
-       }
-
-       XCloseDisplay(dpy);
-}
-
-static gboolean __x_syspopup_timeout_handler(gpointer user_data)
-{
-       int id = (int)((intptr_t)user_data);
-       syspopup *sp;
-       Display *dpy;
-       Window win;
-
-       sp = _syspopup_find_by_id(id);
-       if (sp == NULL) {
-               _E("Failed to find the syspopup");
-               return FALSE;
-       }
-
-       dpy = XOpenDisplay(NULL);
-
-       _D("find timeout - %s", sp->name);
-       if (sp->def_timeout_fn != NULL)
-               sp->def_timeout_fn(sp->dupped_bundle, sp->user_data);
-
-       win = (Window)sp->internal_data;
-       XKillClient(dpy, win);
-       XCloseDisplay(dpy);
-
-       return FALSE;
-}
-
-static int __x_syspopup_change_xwin_type(Display *dpy, Window win)
-{
-       Atom win_type_atom;
-       Atom win_type_utility_atom;
-
-       win_type_atom = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False);
-       win_type_utility_atom =
-           XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_NOTIFICATION", False);
-       XChangeProperty(dpy, win, win_type_atom, XA_ATOM, 32, PropModeReplace,
-                       (unsigned char *)&win_type_utility_atom, 1);
-
-       return 0;
-}
-
-static int __x_syspopup_disable_focus(Display *dpy, Window win)
-{
-       XWMHints *hints;
-
-       hints = XAllocWMHints();
-       if (hints == NULL)
-               return -1;
-
-       hints->flags = InputHint | StateHint;
-       hints->input = 0;
-       hints->initial_state = NormalState;
-
-       XSetWMHints(dpy, win, hints);
-       XFree(hints);
-
-       return 0;
-}
-
-#ifdef ROTATE_USING_X_CLIENT
-static int __utilx_ss_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;
-}
-
-static int x_syspopup_rotation_get(Display *dpy, Window win)
-{
-       Window active_win;
-       Window root_win;
-       Atom atom_active_win;
-       Atom atom_win_rotate_angle;
-       int rotation = -1;
-       int ret;
-
-       root_win = XDefaultRootWindow(dpy);
-
-       atom_active_win = XInternAtom(dpy, "_NET_ACTIVE_WINDOW", False);
-       ret = __utilx_ss_get_window_property(dpy, root_win, atom_active_win,
-                                            XA_WINDOW,
-                                            (unsigned int *)&active_win, 1);
-       if (ret < 0)
-               return ret;
-
-       atom_win_rotate_angle = XInternAtom(dpy,
-                                       "_E_ILLUME_ROTATE_ROOT_ANGLE", False);
-       ret = __utilx_ss_get_window_property(dpy, root_win,
-                                         atom_win_rotate_angle, XA_CARDINAL,
-                                         (unsigned int *)&rotation, 1);
-       if (ret != -1)
-               return rotation;
-
-       return -1;
-}
-
-static int x_syspopup_process_rotate(int id)
-{
-       Display *dpy;
-       Window win;
-       syspopup *sp;
-
-       sp = _syspopup_find_by_id(id);
-       if (sp == NULL)
-               return -1;
-
-       win = (Window) sp->internal_data;
-       dpy = XOpenDisplay(NULL);
-       __x_rotation_set(dpy, win, sp);
-       XCloseDisplay(dpy);
-
-       return 0;
-}
-
-static Eina_Bool __x_rotate_cb(void *data, int type, void *event)
-{
-       int id = (intptr_t)data;
-       Ecore_X_Event_Client_Message *ev = event;
-
-       if (ev && ev->message_type == ECORE_X_ATOM_E_ILLUME_ROTATE_ROOT_ANGLE)
-               x_syspopup_process_rotate(id);
-
-       return ECORE_CALLBACK_RENEW;
-}
-
-static void __x_rotation_set(Display *dpy, Window win, syspopup *sp)
-{
-       int rotation;
-
-       rotation = x_syspopup_rotation_get(dpy, win);
-       if (rotation == -1)
-               rotation = 0;
-
-       elm_win_rotation_with_resize_set(sp->win, rotation);
-
-       return 0;
-}
-#else
-static void __x_rotation_set(Display *dpy, Window win, syspopup *sp)
-{
-       int rots[] = {0, 90, 180, 270};
-
-       ecore_x_icccm_name_class_set(win, WIN_PROP_NAME, WIN_PROP_NAME);
-       if (elm_win_wm_rotation_supported_get(sp->win))
-               elm_win_wm_rotation_available_rotations_set(sp->win, rots, 4);
-       else
-               _E("win rotation is not supported");
-}
-#endif
-
-int x_syspopup_init(syspopup *sp, syspopup_info_t *info)
-{
-       Ecore_X_Window xwin;
-       Display *dpy;
-       XWindowAttributes attr;
-       int is_unviewable = 0;
-
-       if (_syspopup_init(__x_syspopup_term_handler,
-                               __x_syspopup_timeout_handler) < 0)
-               return -1;
-
-       xwin = (Ecore_X_Window)sp->internal_data;
-       dpy = ecore_x_display_get();
-       XGetWindowAttributes(dpy, xwin, &attr);
-       if (attr.map_state == IsViewable) {
-               XUnmapWindow(dpy, xwin);
-               is_unviewable = 1;
-       }
-
-       __x_syspopup_change_xwin_type(dpy, xwin);
-       utilx_set_system_notification_level(dpy, xwin, info->prio);
-       if (info->focus)
-               __x_syspopup_disable_focus(dpy, xwin);
-
-       __x_rotation_set(dpy, xwin, sp);
-
-       if (is_unviewable)
-               XMapWindow(dpy, xwin);
-
-#ifdef ROTATE_USING_X_CLIENT
-       ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, __x_rotate_cb,
-                                       (const void *)((intptr_t)sp->id));
-#endif
-
-       return 0;
-}
-
-int x_syspopup_reset(bundle *b)
-{
-       const char *popup_name;
-       syspopup_info_t *info;
-       syspopup *sp;
-       Display *d;
-       Window win;
-
-       popup_name = _syspopup_get_name_from_bundle(b);
-       if (popup_name == NULL)
-               return -1;
-
-       sp = _syspopup_find(popup_name);
-       if (sp == NULL)
-               return -1;
-
-       info = _syspopup_info_get(popup_name);
-       if (info == NULL)
-               return -1;
-
-       _syspopup_reset_timeout(sp, info);
-
-       if (sp->dupped_bundle)
-               free(sp->dupped_bundle);
-
-       sp->dupped_bundle = bundle_dup(b);
-
-       do {
-               d = XOpenDisplay(NULL);
-               if (d == NULL)
-                       break;
-
-               win = (Window)sp->internal_data;
-               if (win == NULL)
-                       break;
-
-               utilx_set_system_notification_level(d, win, info->prio);
-
-               if (info->focus)
-                       __x_syspopup_disable_focus(d, win);
-
-               __x_rotation_set(d, win, sp);
-               XMapWindow(d, win);
-               XCloseDisplay(d);
-       } while (0);
-
-       _syspopup_info_free(info);
-
-       return 0;
-}
-
-int x_syspopup_process_keypress(int id, const char *keyname)
-{
-       Display *dpy;
-       Window win;
-       syspopup *sp = NULL;
-
-       if (keyname == NULL)
-               return -1;
-
-       _D("key press - %s", keyname);
-
-       if (strcmp(keyname, KEY_END) != 0)
-               return -1;
-
-       sp = _syspopup_find_by_id(id);
-       if (sp == NULL)
-               return -1;
-
-       dpy = XOpenDisplay(NULL);
-
-       _D("find key down: %s", sp->name);
-       if (sp->endkey_act == SYSPOPUP_KEYEND_TERM) {
-               if (sp->def_term_fn)
-                       sp->def_term_fn(sp->dupped_bundle,
-                                       sp->user_data);
-
-               win = (Window)sp->internal_data;
-               XKillClient(dpy, win);
-       } else if (sp->endkey_act == SYSPOPUP_KEYEND_HIDE) {
-               if (sp->def_term_fn)
-                       sp->def_term_fn(sp->dupped_bundle,
-                                       sp->user_data);
-
-               win = (Window)sp->internal_data;
-               XUnmapWindow(dpy, win);
-       } else {
-               _E("no find key down");
-       }
-
-       XCloseDisplay(dpy);
-
-       return 0;
-}
diff --git a/syspopup/syspopup_x.h b/syspopup/syspopup_x.h
deleted file mode 100644 (file)
index e0e55ab..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * syspopup x11
- *
- * Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef __SYSPOPUP_X_H__
-#define __SYSPOPUP_X_H__
-
-#include <bundle.h>
-
-#include "syspopup_core.h"
-#include "syspopup_db.h"
-
-int x_syspopup_init(syspopup *sp, syspopup_info_t *info);
-int x_syspopup_reset(bundle *b);
-int x_syspopup_process_keypress(int id, const char *keyname);
-
-#endif /* __SYSPOPUP_X_H__ */