Remove conditional compilation associated with window manager 42/108142/4
authorInkyun Kil <inkyun.kil@samsung.com>
Tue, 3 Jan 2017 06:30:42 +0000 (15:30 +0900)
committerInkyun Kil <inkyun.kil@samsung.com>
Mon, 23 Jan 2017 02:05:47 +0000 (11:05 +0900)
- Since Tizen 3.0, wayland is the only display server.
  That's why the conditional compilation is useless.

Change-Id: I26567d5709a40e146027bfd01650b04bae702bea
Signed-off-by: Inkyun Kil <inkyun.kil@samsung.com>
CMakeLists.txt
appcore-common-x.pc.in [deleted file]
appcore-common.pc.in [moved from appcore-common-wayland.pc.in with 100% similarity]
include/appcore-internal.h
packaging/app-core.spec
src/appcore-X.c [deleted file]
src/appcore-efl.c
src/appcore-group.c
src/appcore-rotation.c

index 98ff66a..58e0e4b 100644 (file)
@@ -24,26 +24,12 @@ SET(CMAKE_SKIP_BUILD_RPATH TRUE)
 SET(APPCORE_COMMON "appcore-common")
 SET(SRCS_common src/appcore.c src/appcore-i18n.c src/appcore-measure.c src/appcore-rotation.c)
 
-IF(_WITH_WAYLAND)
-       ADD_DEFINITIONS("-DWAYLAND")
-ENDIF(_WITH_WAYLAND)
-
-IF(_WITH_X11)
-       ADD_DEFINITIONS("-DX11")
-       SET(SRCS_common ${SRCS_common} src/appcore-X.c)
-ENDIF(_WITH_X11)
 
 SET(HEADERS_common appcore-common.h)
 
 INCLUDE(FindPkgConfig)
 SET(APPCORE_PKG_CHECK_MODULES "gio-2.0 vconf sensor aul dlog ecore capi-system-info")
-IF(_WITH_X11)
-       SET(APPCORE_PKG_CHECK_MODULES "${APPCORE_PKG_CHECK_MODULES} x11 eina ecore-x")
-ENDIF(_WITH_X11)
-IF(_WITH_WAYLAND)
-       SET(APPCORE_PKG_CHECK_MODULES "${APPCORE_PKG_CHECK_MODULES} ecore-wayland wayland-client tizen-extension-client wayland-tbm-client")
-ENDIF(_WITH_WAYLAND)
-
+SET(APPCORE_PKG_CHECK_MODULES "${APPCORE_PKG_CHECK_MODULES} ecore-wayland wayland-client tizen-extension-client wayland-tbm-client")
 
 pkg_check_modules(pkg_common REQUIRED ${APPCORE_PKG_CHECK_MODULES})
 
@@ -57,12 +43,7 @@ SET_TARGET_PROPERTIES(${APPCORE_COMMON} PROPERTIES VERSION ${FULLVER})
 SET_TARGET_PROPERTIES(${APPCORE_COMMON} PROPERTIES COMPILE_FLAGS ${EXTRA_CFLAGS_common})
 TARGET_LINK_LIBRARIES(${APPCORE_COMMON} ${pkg_common_LDFLAGS} "-ldl")
 
-IF(_WITH_WAYLAND)
-       CONFIGURE_FILE(${APPCORE_COMMON}-wayland.pc.in ${APPCORE_COMMON}.pc @ONLY)
-ENDIF(_WITH_WAYLAND)
-IF(_WITH_X11)
-       CONFIGURE_FILE(${APPCORE_COMMON}-x.pc.in ${APPCORE_COMMON}.pc @ONLY)
-ENDIF(_WITH_X11)
+CONFIGURE_FILE(${APPCORE_COMMON}.pc.in ${APPCORE_COMMON}.pc @ONLY)
 
 INSTALL(TARGETS ${APPCORE_COMMON} DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries)
 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${APPCORE_COMMON}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
@@ -80,9 +61,6 @@ SET(HEADERS_efl appcore-efl.h)
 
 INCLUDE(FindPkgConfig)
 SET(APPCORE_PKG_CHECK_MODULES2 "elementary dlog ecore gobject-2.0 glib-2.0 aul pkgmgr-info ttrace capi-system-info")
-IF(_WITH_X11)
-        SET(APPCORE_PKG_CHECK_MODULES2 "${APPCORE_PKG_CHECK_MODULES2} ecore-x")
-ENDIF(_WITH_X11)
 
 pkg_check_modules(pkg_efl REQUIRED ${APPCORE_PKG_CHECK_MODULES2})
 
diff --git a/appcore-common-x.pc.in b/appcore-common-x.pc.in
deleted file mode 100644 (file)
index 3d3f755..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-# Package Information for pkg-config
-
-prefix=@PREFIX@
-exec_prefix=@EXEC_PREFIX@
-libdir=@LIB_INSTALL_DIR@
-includedir=@INCLUDEDIR@
-
-Name: app-core-common
-Description: SAMSUNG Linux platform application library
-Version: @VERSION@
-Requires.private: sensor vconf aul dlog x11
-Libs: -L${libdir} -lappcore-common
-Cflags: -I${includedir} -I${includedir}/appcore
index c1f9bb3..ff6ced3 100644 (file)
@@ -184,9 +184,7 @@ int appcore_set_wm_rotation(struct ui_wm_rotate* wm_rotate);
 void appcore_group_attach();
 void appcore_group_lower();
 unsigned int appcore_get_main_window(void);
-#if defined(WAYLAND)
 unsigned int appcore_get_main_surface(void);
-#endif
 void appcore_get_app_core(struct appcore **ac);
 
 #define ENV_START "APP_START_TIME"
index 6fb3533..c9572a4 100644 (file)
@@ -1,6 +1,3 @@
-%bcond_with x
-%bcond_with wayland
-
 Name:           app-core
 Summary:        Application basic
 Version:        1.3.0
@@ -8,18 +5,10 @@ Release:        0
 Group:          Application Framework/Libraries
 License:        Apache-2.0
 Source0:        app-core-%{version}.tar.gz
-%if %{with x}
-BuildRequires:  pkgconfig(x11)
-BuildRequires:  pkgconfig(ecore-x)
-BuildRequires:  pkgconfig(eina)
-%else
-%if %{with wayland}
 BuildRequires:  pkgconfig(ecore-wayland)
 BuildRequires:  pkgconfig(wayland-client)
 BuildRequires:  pkgconfig(tizen-extension-client)
 BuildRequires:  pkgconfig(wayland-tbm-client)
-%endif
-%endif
 Source1001:     app-core.manifest
 BuildRequires:  pkgconfig(gio-2.0)
 BuildRequires:  pkgconfig(sensor)
@@ -78,9 +67,6 @@ Requires:   pkgconfig(sensor)
 Requires:   pkgconfig(vconf)
 Requires:   pkgconfig(elementary)
 Requires:   pkgconfig(aul)
-%if %{with x}
-Requires:   pkgconfig(x11)
-%endif
 
 %description common-devel
 Application basics common (devel)
@@ -98,17 +84,8 @@ Application basics template
 cp %{SOURCE1001} .
 
 %build
-%if %{with wayland}
-_WITH_WAYLAND=ON
-%endif
-%if %{with x}
-_WITH_X11=ON
-%endif
-
 MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
 %cmake . \
-       -D_WITH_WAYLAND:BOOL=${_WITH_WAYLAND} \
-       -D_WITH_X11:BOOL=${_WITH_X11} \
        -DENABLE_GTK=OFF \
        -DFULLVER=%{version} \
        -DMAJORVER=${MAJORVER}
diff --git a/src/appcore-X.c b/src/appcore-X.c
deleted file mode 100644 (file)
index b87f3bf..0000000
+++ /dev/null
@@ -1,260 +0,0 @@
-/*
- *  app-core
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>, Jaeho Lee <jaeho81.lee@samsung.com>
- *
- * 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 <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <signal.h>
-
-#include <Eina.h>
-#include <X11/Xlib.h>
-#include <X11/Xatom.h>
-
-#include "appcore-internal.h"
-
-static Atom a_pid;
-static Atom a_active_win;
-
-static pid_t __get_win_pid(Display *d, Window win)
-{
-       int r;
-       pid_t pid;
-
-       Atom a_type;
-       int format;
-       unsigned long nitems;
-       unsigned long bytes_after;
-       unsigned char *prop_ret;
-       XWindowAttributes attr;
-
-       _retv_if(d == NULL || !a_pid, -1);
-
-       if (!XGetWindowAttributes(d, win, &attr))
-               return -1;
-
-       if (attr.override_redirect || attr.class == InputOnly)
-               return -1;
-
-       prop_ret = NULL;
-       r = XGetWindowProperty(d, win, a_pid, 0, 1, False, XA_CARDINAL,
-                              &a_type, &format, &nitems, &bytes_after,
-                              &prop_ret);
-       if (r != Success || prop_ret == NULL)
-               return -1;
-
-       if (a_type == XA_CARDINAL && format == 32)
-               pid = *(unsigned long *)prop_ret;
-       else
-               pid = -1;
-
-       XFree(prop_ret);
-
-       return pid;
-}
-
-static int __find_win(Display *d, Window *win, pid_t pid)
-{
-       int r;
-       pid_t p;
-       unsigned int n;
-       Window root, parent, *child;
-
-       p = __get_win_pid(d, *win);
-       if (p == pid)
-               return 1;
-
-       r = XQueryTree(d, *win, &root, &parent, &child, &n);
-       if (r) {
-               int i;
-               int found = 0;
-
-               for (i = 0; i < n; i++) {
-                       found = __find_win(d, &child[i], pid);
-                       if (found) {
-                               *win = child[i];
-                               break;
-                       }
-               }
-               XFree(child);
-
-               if (found)
-                       return 1;
-       }
-
-       return 0;
-}
-
-static void __add_win_list(Eina_List **list, Window *win)
-{
-       void *w;
-       Eina_List *l;
-
-       if (!list || !win)
-               return;
-
-       EINA_LIST_FOREACH(*list, l, w) {
-               if ((Window)w == *win)
-                       return;
-       }
-
-       *list = eina_list_append(*list, (void *)*win);
-}
-
-static void __foreach_win(Eina_List **list, Display *d, Window *win, pid_t pid)
-{
-       int i;
-       int r;
-       pid_t p;
-       unsigned int n;
-       Window root, parent, *child;
-
-       p = __get_win_pid(d, *win);
-       if (p == pid)
-               __add_win_list(list, win);
-
-       r = XQueryTree(d, *win, &root, &parent, &child, &n);
-       if (r) {
-               for (i = 0; i < n; i++)
-                       __foreach_win(list, d, &child[i], pid);
-
-               XFree(child);
-       }
-}
-
-static int __iconify_win(Eina_List *list, Display *d)
-{
-       void *w;
-       Eina_List *l;
-
-       if (!list || !d)
-               return -1;
-
-       EINA_LIST_FOREACH(list, l, w) {
-               XIconifyWindow(d, (Window)w, 0);
-       }
-
-       return 0;
-}
-
-static int __raise_win(Display *d, Window win)
-{
-       XEvent xev;
-       Window root;
-
-       if (!a_active_win)
-               a_active_win = XInternAtom(d, "_NET_ACTIVE_WINDOW", False);
-
-       root = XDefaultRootWindow(d);
-
-       xev.xclient.type = ClientMessage;
-       xev.xclient.display = d;
-       xev.xclient.window = win;
-       xev.xclient.message_type = a_active_win;
-       xev.xclient.format = 32;
-       xev.xclient.data.l[0] = 1;
-       xev.xclient.data.l[1] = CurrentTime;
-       xev.xclient.data.l[2] = 0;
-       xev.xclient.data.l[3] = 0;
-       xev.xclient.data.l[4] = 0;
-       XSendEvent(d, root, False,
-                  SubstructureRedirectMask | SubstructureNotifyMask, &xev);
-
-       return 0;
-}
-
-EXPORT_API int x_raise_win(pid_t pid)
-{
-
-       int r;
-       int found;
-       Display *d;
-       Window win;
-
-       if (pid < 1) {
-               errno = EINVAL;
-               return -1;
-       }
-
-       r = kill(pid, 0);
-       if (r == -1) {
-               errno = ESRCH;  /* No such process */
-               return -1;
-       }
-
-       d = XOpenDisplay(NULL);
-       _retv_if(d == NULL, -1);
-
-       win = XDefaultRootWindow(d);
-
-       if (!a_pid)
-               a_pid = XInternAtom(d, "_NET_WM_PID", True);
-
-       found = __find_win(d, &win, pid);
-       if (!found) {
-               XCloseDisplay(d);
-               errno = ENOENT;
-               return -1;
-       }
-
-       r = __raise_win(d, win);
-
-       XCloseDisplay(d);
-
-       return r;
-}
-
-EXPORT_API int x_pause_win(pid_t pid)
-{
-       int r;
-       Display *d;
-       Window win;
-       Eina_List *list_win = NULL;
-
-       if (pid < 1) {
-               errno = EINVAL;
-               return -1;
-       }
-
-       r = kill(pid, 0);
-       if (r == -1) {
-               errno = ESRCH;
-               return -1;
-       }
-
-       d = XOpenDisplay(NULL);
-       _retv_if(d == NULL, -1);
-
-       win = XDefaultRootWindow(d);
-       if (!a_pid)
-               a_pid = XInternAtom(d, "_NET_WM_PID", True);
-
-       __foreach_win(&list_win, d, &win, pid);
-       r = __iconify_win(list_win, d);
-
-       XCloseDisplay(d);
-
-       if (list_win)
-               eina_list_free(list_win);
-
-       return r;
-}
index 6ff2939..2c0a8a5 100644 (file)
 #include <string.h>
 #include <stdlib.h>
 
-#if defined(WAYLAND)
 #include <Ecore_Wayland.h>
 #include <wayland-client.h>
 #include <wayland-tbm-client.h>
 #include <tizen-extension-client-protocol.h>
-#elif defined(X11)
-#include <X11/Xatom.h>
-#include <X11/Xlib.h>
-#include <Ecore_X.h>
-#endif
 
 #include <Ecore.h>
 #include <Ecore_Evas.h>
@@ -64,9 +58,7 @@ struct ui_priv {
        Ecore_Event_Handler *hshow;
        Ecore_Event_Handler *hhide;
        Ecore_Event_Handler *hvchange;
-#if defined(WAYLAND)
        Ecore_Event_Handler *hlower;
-#endif
        Ecore_Event_Handler *hcmsg; /* WM_ROTATE */
 
        Ecore_Timer *mftimer; /* Ecore Timer for memory flushing */
@@ -114,15 +106,10 @@ static bool first_launch = TRUE;
 
 struct win_node {
        unsigned int win;
-#if defined(WAYLAND)
        unsigned int surf;
-#endif
        bool bfobscured;
 };
 
-#if defined(X11)
-static struct ui_wm_rotate wm_rotate;
-#endif
 static Eina_Bool __visibility_cb(void *data, int type, void *event);
 static GSList *g_winnode_list;
 
@@ -325,7 +312,6 @@ static void __appcore_efl_memory_flush_cb(void)
        _DBG("[APP %d]   __appcore_efl_memory_flush_cb()", _pid);
        elm_cache_all_flush();
 }
-#if defined(WAYLAND)
 static void wl_raise_win(void)
 {
        Ecore_Wl_Window *win;
@@ -355,7 +341,6 @@ static void wl_pause_win(void)
        }
 }
 
-#endif
 
 static void __do_app(enum app_event event, void *data, bundle * b)
 {
@@ -395,20 +380,12 @@ static void __do_app(enum app_event event, void *data, bundle * b)
        }
 
        if (event == AE_RAISE) {
-#if defined(X11)
-               x_raise_win(getpid());
-#elif defined(WAYLAND)
                wl_raise_win();
-#endif
                return;
        }
 
        if (event == AE_LOWER) {
-#if defined(X11)
-               x_pause_win(getpid());
-#elif defined(WAYLAND)
                wl_pause_win();
-#endif
                return;
        }
 
@@ -454,11 +431,7 @@ static void __do_app(enum app_event event, void *data, bundle * b)
                                if (!bg_launch || strcmp(bg_launch, "enable"))
                                        __unset_bg_state();
                        }
-#ifdef X11
-                       x_raise_win(getpid());
-#else
                        wl_raise_win();
-#endif
                }
                LOG(LOG_DEBUG, "LAUNCH", "[%s:Application:reset:done]",
                    ui->name);
@@ -584,33 +557,6 @@ static GSList *__find_win(unsigned int win)
        return NULL;
 }
 
-#if defined(X11)
-static bool __add_win(unsigned int win)
-{
-       struct win_node *t;
-       GSList *f;
-
-       _DBG("[EVENT_TEST][EVENT] __add_win WIN:%x\n", win);
-
-       f = __find_win(win);
-       if (f) {
-               errno = ENOENT;
-               _DBG("[EVENT_TEST][EVENT] ERROR There is already window : %x \n", win);
-               return FALSE;
-       }
-
-       t = calloc(1, sizeof(struct win_node));
-       if (t == NULL)
-               return FALSE;
-
-       t->win = win;
-       t->bfobscured = FALSE;
-
-       g_winnode_list = g_slist_append(g_winnode_list, t);
-
-       return TRUE;
-}
-#elif defined(WAYLAND)
 static bool __add_win(unsigned int win, unsigned int surf)
 {
        struct win_node *t;
@@ -637,7 +583,6 @@ static bool __add_win(unsigned int win, unsigned int surf)
 
        return TRUE;
 }
-#endif
 
 static bool __delete_win(unsigned int win)
 {
@@ -657,29 +602,6 @@ static bool __delete_win(unsigned int win)
        return TRUE;
 }
 
-#if defined(X11)
-static bool __update_win(unsigned int win, bool bfobscured)
-{
-       GSList *f;
-       struct win_node *t;
-
-       _DBG("[EVENT_TEST][EVENT] __update_win WIN:%x fully_obscured %d\n", win,
-            bfobscured);
-
-       f = __find_win(win);
-       if (!f) {
-               errno = ENOENT;
-               _DBG("[EVENT_TEST][EVENT] ERROR There is no window : %x \n", win);
-               return FALSE;
-       }
-
-       t = (struct win_node *)f->data;
-       t->win = win;
-       t->bfobscured = bfobscured;
-
-       return TRUE;
-}
-#elif defined(WAYLAND)
 static bool __update_win(unsigned int win, unsigned int surf, bool bfobscured)
 {
        GSList *f;
@@ -703,73 +625,9 @@ static bool __update_win(unsigned int win, unsigned int surf, bool bfobscured)
 
        return TRUE;
 }
-#endif
-
-/* WM_ROTATE */
-#ifdef X11
-static Ecore_X_Atom _WM_WINDOW_ROTATION_SUPPORTED = 0;
-static Ecore_X_Atom _WM_WINDOW_ROTATION_CHANGE_REQUEST = 0;
-
-static int __check_wm_rotation_support(void)
-{
-       _DBG("Disable window manager rotation");
-       return -1;
-
-       Ecore_X_Window root, win, win2;
-       int ret;
-
-       if (!_WM_WINDOW_ROTATION_SUPPORTED) {
-               _WM_WINDOW_ROTATION_SUPPORTED =
-                                       ecore_x_atom_get("_E_WINDOW_ROTATION_SUPPORTED");
-       }
-
-       if (!_WM_WINDOW_ROTATION_CHANGE_REQUEST) {
-               _WM_WINDOW_ROTATION_CHANGE_REQUEST =
-                                       ecore_x_atom_get("_E_WINDOW_ROTATION_CHANGE_REQUEST");
-       }
-
-       root = ecore_x_window_root_first_get();
-       ret = ecore_x_window_prop_xid_get(root,
-                       _WM_WINDOW_ROTATION_SUPPORTED,
-                       ECORE_X_ATOM_WINDOW,
-                       &win, 1);
-       if ((ret == 1) && (win)) {
-               ret = ecore_x_window_prop_xid_get(win,
-                               _WM_WINDOW_ROTATION_SUPPORTED,
-                               ECORE_X_ATOM_WINDOW,
-                               &win2, 1);
-               if ((ret == 1) && (win2 == win))
-                       return 0;
-       }
-
-       return -1;
-}
-
-static void __set_wm_rotation_support(unsigned int win, unsigned int set)
-{
-       GSList *iter = NULL;
-       struct win_node *entry = NULL;
-
-       if (win == 0) {
-               for (iter = g_winnode_list; iter != NULL; iter = g_slist_next(iter)) {
-                       entry = iter->data;
-                       if (entry->win) {
-                               ecore_x_window_prop_card32_set(entry->win,
-                                               _WM_WINDOW_ROTATION_SUPPORTED,
-                                               &set, 1);
-                       }
-               }
-       } else {
-               ecore_x_window_prop_card32_set(win,
-                               _WM_WINDOW_ROTATION_SUPPORTED,
-                               &set, 1);
-       }
-}
-#endif
 
 static Eina_Bool __show_cb(void *data, int type, void *event)
 {
-#if defined(WAYLAND)
        Ecore_Wl_Event_Window_Show *ev;
 
        ev = event;
@@ -785,22 +643,6 @@ static Eina_Bool __show_cb(void *data, int type, void *event)
        else
                __update_win((unsigned int)ev->win, (unsigned int)ev->data[0], FALSE);
 
-#elif defined(X11)
-       Ecore_X_Event_Window_Show *ev;
-
-       ev = event;
-
-       _DBG("[EVENT_TEST][EVENT] GET SHOW EVENT!!!. WIN:%x\n", ev->win);
-
-       if (!__find_win((unsigned int)ev->win)) {
-               /* WM_ROTATE */
-               if ((priv.wm_rot_supported) && (1 == priv.rot_started))
-                       __set_wm_rotation_support(ev->win, 1);
-               __add_win((unsigned int)ev->win);
-       } else {
-               __update_win((unsigned int)ev->win, FALSE);
-       }
-#endif
 
        appcore_group_attach();
        return ECORE_CALLBACK_RENEW;
@@ -808,11 +650,7 @@ static Eina_Bool __show_cb(void *data, int type, void *event)
 
 static Eina_Bool __hide_cb(void *data, int type, void *event)
 {
-#if defined(WAYLAND)
        Ecore_Wl_Event_Window_Hide *ev;
-#elif defined(X11)
-       Ecore_X_Event_Window_Hide *ev;
-#endif
        int bvisibility = 0;
 
        ev = event;
@@ -832,7 +670,6 @@ static Eina_Bool __hide_cb(void *data, int type, void *event)
        return ECORE_CALLBACK_RENEW;
 }
 
-#if defined(WAYLAND)
 static Eina_Bool __lower_cb(void *data, int type, void *event)
 {
        Ecore_Wl_Event_Window_Lower *ev;
@@ -842,23 +679,13 @@ static Eina_Bool __lower_cb(void *data, int type, void *event)
        appcore_group_lower();
        return ECORE_CALLBACK_RENEW;
 }
-#endif
 
 static Eina_Bool __visibility_cb(void *data, int type, void *event)
 {
-#if defined(WAYLAND)
        Ecore_Wl_Event_Window_Visibility_Change *ev;
        int bvisibility = 0;
        ev = event;
        __update_win((unsigned int)ev->win, 0, ev->fully_obscured);
-#elif defined(X11)
-       Ecore_X_Event_Window_Visibility_Change *ev;
-       int bvisibility = 0;
-
-       ev = event;
-
-       __update_win((unsigned int)ev->win, ev->fully_obscured);
-#endif
        bvisibility = __check_visible();
 
        _DBG("bvisibility %d, b_active %d", bvisibility, b_active);
@@ -879,59 +706,9 @@ static Eina_Bool __visibility_cb(void *data, int type, void *event)
 
 }
 
-#if defined(X11)
-/* WM_ROTATE */
-static Eina_Bool __cmsg_cb(void *data, int type, void *event)
-{
-       struct ui_priv *ui = (struct ui_priv *)data;
-       Ecore_X_Event_Client_Message *e = event;
-
-       if (!ui)
-               return ECORE_CALLBACK_PASS_ON;
-
-       if (e->format != 32)
-               return ECORE_CALLBACK_PASS_ON;
-
-       if (e->message_type == _WM_WINDOW_ROTATION_CHANGE_REQUEST) {
-               if ((ui->wm_rot_supported == 0)
-                       || (ui->rot_started == 0)
-                       || (ui->rot_cb == NULL)) {
-                       return ECORE_CALLBACK_PASS_ON;
-               }
-
-               enum appcore_rm rm;
-               switch (e->data.l[1]) {
-               case 0:
-                       rm = APPCORE_RM_PORTRAIT_NORMAL;
-                       break;
-               case 90:
-                       rm = APPCORE_RM_LANDSCAPE_REVERSE;
-                       break;
-               case 180:
-                       rm = APPCORE_RM_PORTRAIT_REVERSE;
-                       break;
-               case 270:
-                       rm = APPCORE_RM_LANDSCAPE_NORMAL;
-                       break;
-               default:
-                       rm = APPCORE_RM_UNKNOWN;
-                       break;
-               }
-
-               ui->rot_mode = rm;
-
-               if (APPCORE_RM_UNKNOWN != rm)
-                       ui->rot_cb((void *)&rm, rm, ui->rot_cb_data);
-       }
-
-       return ECORE_CALLBACK_PASS_ON;
-}
-#endif
-
 static void __add_climsg_cb(struct ui_priv *ui)
 {
        _ret_if(ui == NULL);
-#if defined(WAYLAND)
        ui->hshow =
                ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_SHOW, __show_cb, ui);
        ui->hhide =
@@ -942,23 +719,6 @@ static void __add_climsg_cb(struct ui_priv *ui)
        ui->hlower =
                ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_LOWER,
                                __lower_cb, ui);
-#elif defined(X11)
-       ui->hshow =
-               ecore_event_handler_add(ECORE_X_EVENT_WINDOW_SHOW, __show_cb, ui);
-       ui->hhide =
-               ecore_event_handler_add(ECORE_X_EVENT_WINDOW_HIDE, __hide_cb, ui);
-       ui->hvchange =
-               ecore_event_handler_add(ECORE_X_EVENT_WINDOW_VISIBILITY_CHANGE,
-                               __visibility_cb, ui);
-
-       /* Add client message callback for WM_ROTATE */
-       if (!__check_wm_rotation_support()) {
-               ui->hcmsg = ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE,
-                               __cmsg_cb, ui);
-               ui->wm_rot_supported = 1;
-               appcore_set_wm_rotation(&wm_rotate);
-       }
-#endif
 }
 
 static int __before_loop(struct ui_priv *ui, int *argc, char ***argv)
@@ -1067,10 +827,8 @@ static void __after_loop(struct ui_priv *ui)
                ecore_event_handler_del(ui->hhide);
        if (ui->hvchange)
                ecore_event_handler_del(ui->hvchange);
-#if defined(WAYLAND)
        if (ui->hlower)
                ecore_event_handler_del(ui->hlower);
-#endif
 
        __appcore_timer_del(ui);
 
@@ -1135,78 +893,6 @@ static void __unset_data(struct ui_priv *ui)
        memset(ui, 0, sizeof(struct ui_priv));
 }
 
-#if defined(X11)
-/* WM_ROTATE */
-static int __wm_set_rotation_cb(int (*cb) (void *event_info, enum appcore_rm, void *), void *data)
-{
-       if (cb == NULL) {
-               errno = EINVAL;
-               return -1;
-       }
-
-       if ((priv.wm_rot_supported) && (0 == priv.rot_started))
-               __set_wm_rotation_support(0, 1);
-
-       priv.rot_cb = cb;
-       priv.rot_cb_data = data;
-       priv.rot_started = 1;
-
-       return 0;
-}
-
-static int __wm_unset_rotation_cb(void)
-{
-       if ((priv.wm_rot_supported) && (1 == priv.rot_started))
-               __set_wm_rotation_support(0, 0);
-
-       priv.rot_cb = NULL;
-       priv.rot_cb_data = NULL;
-       priv.rot_started = 0;
-
-       return 0;
-}
-
-static int __wm_get_rotation_state(enum appcore_rm *curr)
-{
-       if (curr == NULL) {
-               errno = EINVAL;
-               return -1;
-       }
-
-       *curr = priv.rot_mode;
-
-       return 0;
-}
-
-static int __wm_pause_rotation_cb(void)
-{
-       if ((priv.rot_started == 1) && (priv.wm_rot_supported))
-               __set_wm_rotation_support(0, 0);
-
-       priv.rot_started = 0;
-
-       return 0;
-}
-
-static int __wm_resume_rotation_cb(void)
-{
-       if ((priv.rot_started == 0) && (priv.wm_rot_supported))
-               __set_wm_rotation_support(0, 1);
-
-       priv.rot_started = 1;
-
-       return 0;
-}
-
-static struct ui_wm_rotate wm_rotate = {
-       __wm_set_rotation_cb,
-       __wm_unset_rotation_cb,
-       __wm_get_rotation_state,
-       __wm_pause_rotation_cb,
-       __wm_resume_rotation_cb
-};
-#endif
-
 EXPORT_API int appcore_efl_init(const char *name, int *argc, char ***argv,
                     struct appcore_ops *ops)
 {
@@ -1308,7 +994,6 @@ EXPORT_API unsigned int appcore_get_main_window(void)
        return 0;
 }
 
-#if defined(WAYLAND)
 EXPORT_API unsigned int appcore_get_main_surface(void)
 {
        struct win_node *entry = NULL;
@@ -1320,7 +1005,6 @@ EXPORT_API unsigned int appcore_get_main_surface(void)
 
        return 0;
 }
-#endif
 
 tizen_profile_t _get_tizen_profile()
 {
index dcdcb6f..4ac1e6f 100644 (file)
@@ -15,11 +15,7 @@ void appcore_group_attach()
        if (attached)
                return;
 
-#ifdef X11
-       int wid = appcore_get_main_window();
-#else
        int wid = appcore_get_main_surface();
-#endif
        if (wid == 0) {
                _ERR("window wasn't ready");
                return;
index 5d90526..d86c9cd 100644 (file)
 #include <Ecore.h>
 #include "appcore-internal.h"
 
-#ifdef X11
-#include <Ecore_X.h>
-#include <X11/Xlib.h>
-
-/* Fixme: to be added for wayland works */
-#define _MAKE_ATOM(a, s)                               \
-       do {                                            \
-               a = ecore_x_atom_get(s);                \
-               if (!a)                                 \
-                       _ERR("##s creation failed.\n"); \
-       } while (0)
-
-#define STR_ATOM_ROTATION_LOCK "_E_ROTATION_LOCK"
-
-static Ecore_X_Atom ATOM_ROTATION_LOCK = 0;
-static Ecore_X_Window root;
-#endif
-
 struct rot_s {
        int handle;
        int (*callback) (void *event_info, enum appcore_rm, void *);
@@ -243,12 +225,6 @@ EXPORT_API int appcore_set_rotation_cb(int (*cb) (void *evnet_info, enum appcore
 
                rot.handle = handle;
                __add_rotlock(data);
-
-#ifdef X11
-               _MAKE_ATOM(ATOM_ROTATION_LOCK, STR_ATOM_ROTATION_LOCK);
-               root =  ecore_x_window_root_first_get();
-               XSelectInput(ecore_x_display_get(), root, PropertyChangeMask);
-#endif
        }
        return 0;
 }