diff options
Diffstat (limited to 'src/manager.c')
-rw-r--r-- | src/manager.c | 148 |
1 files changed, 1 insertions, 147 deletions
diff --git a/src/manager.c b/src/manager.c index e7b7f41..5ee7416 100644 --- a/src/manager.c +++ b/src/manager.c @@ -25,15 +25,7 @@ #include <errno.h> #include <glib.h> #include <Elementary.h> - -#ifndef UG_WAYLAND -#include <X11/Xatom.h> -#include <X11/Xutil.h> -#include <Ecore_X.h> -#else #include <Ecore_Wayland.h> -#endif - #include <Ecore.h> #include "ug.h" @@ -58,12 +50,6 @@ struct ug_manager { GSList *fv_list; void *win; - -#ifndef UG_WAYLAND - Window win_id; - Display *disp; -#endif - enum ug_option base_opt; enum ug_event last_rotate_evt; @@ -135,102 +121,6 @@ static int ug_fvlist_del(ui_gadget_h c) return 0; } -#ifndef UG_WAYLAND -static int __ug_x_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; -} -#endif - -#ifndef UG_WAYLAND -static enum ug_event __ug_x_rotation_get(Display *dpy, Window win) -{ - Window active_win; - Window root_win; - int rotation = -1; - int ret = -1; - enum ug_event func_ret; - - Atom atom_active_win; - Atom atom_win_rotate_angle; - - root_win = XDefaultRootWindow(dpy); - - atom_active_win = XInternAtom(dpy, "_NET_ACTIVE_WINDOW", False); - ret = __ug_x_get_window_property(dpy, root_win, atom_active_win, - XA_WINDOW, - (unsigned int *)&active_win, 1); - if (ret < 0) { - func_ret = UG_EVENT_ROTATE_PORTRAIT; - goto func_out; - } - - atom_win_rotate_angle = - XInternAtom(dpy, "_E_ILLUME_ROTATE_ROOT_ANGLE", False); - ret = __ug_x_get_window_property(dpy, root_win, - atom_win_rotate_angle, XA_CARDINAL, - (unsigned int *)&rotation, 1); - - _DBG("x_rotation_get / ret(%d),degree(%d)", ret, rotation); - - if (ret == -1) - func_ret = UG_EVENT_ROTATE_PORTRAIT; - else { - switch (rotation) { - case 0: - func_ret = UG_EVENT_ROTATE_PORTRAIT; - break; - case 90: - func_ret = UG_EVENT_ROTATE_LANDSCAPE_UPSIDEDOWN; - break; - case 180: - func_ret = UG_EVENT_ROTATE_PORTRAIT_UPSIDEDOWN; - break; - case 270: - func_ret = UG_EVENT_ROTATE_LANDSCAPE; - break; - default: - func_ret = UG_EVENT_ROTATE_PORTRAIT; - break; - } - } - -func_out: - return func_ret; -} -#endif - static enum ug_event __ug_evas_rotation_get(Evas_Object *win) { @@ -500,7 +390,6 @@ static int ugman_ug_resume(void *data) return 0; } -#ifdef UG_WAYLAND static void _ugman_enable_indicator(Evas_Object *win, int enable) { Ecore_Wl_Window *wlwin = elm_win_wl_window_get(win); @@ -527,13 +416,9 @@ static int _ugman_get_indicator_state(Evas_Object *win) return ret; } -#endif static int ugman_indicator_update(enum ug_option opt, enum ug_event event) { -#ifndef UG_WAYLAND - _ERR("controlling indicator is disabled"); -#else int enable; int cur_state; @@ -578,7 +463,6 @@ static int ugman_indicator_update(enum ug_option opt, enum ug_event event) _ugman_enable_indicator(ug_man.win, enable); } -#endif return 0; } @@ -774,13 +658,8 @@ static int ugman_ug_create(void *data) ugman_indicator_update(ug->opt, UG_EVENT_NONE); } - if (ug_man.last_rotate_evt == UG_EVENT_NONE) { -#ifndef UG_WAYLAND - ug_man.last_rotate_evt = __ug_x_rotation_get(ug_man.disp, ug_man.win_id); -#else + if (ug_man.last_rotate_evt == UG_EVENT_NONE) ug_man.last_rotate_evt = __ug_evas_rotation_get((Evas_Object *)ug_man.win); -#endif - } ugman_ug_event(ug, ug_man.last_rotate_evt); if (ug->mode == UG_MODE_FRAMEVIEW) @@ -1107,23 +986,6 @@ int ugman_ug_del_all(void) return 0; } -#ifndef UG_WAYLAND -int ugman_init(Display *disp, Window xid, void *win, enum ug_option opt) -{ - ug_man.win = win; - ug_man.disp = disp; - ug_man.win_id = xid; - ug_man.base_opt = opt; - ug_man.last_rotate_evt = UG_EVENT_NONE; - - if (!ug_man.is_initted) - ug_man.engine = ug_engine_load(); - - ug_man.is_initted = 1; - - return 0; -} -#else int ugman_init(void *win, enum ug_option opt) { ug_man.win = win; @@ -1137,18 +999,10 @@ int ugman_init(void *win, enum ug_option opt) return 0; } -#endif int ugman_init_efl(Evas_Object *win, enum ug_option opt) { -#ifndef UG_WAYLAND - Ecore_X_Window xwin = elm_win_xwindow_get(win); - if (xwin) - return ugman_init((Display *)ecore_x_display_get(), xwin, win, opt); -#else return ugman_init(win, opt); -#endif - return -1; } int ugman_resume(void) |