summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLi,Limin <liminx.li@intel.com>2014-01-08 18:01:31 +0800
committerLi,Limin <liminx.li@intel.com>2014-01-08 18:03:38 +0800
commit3a86573c836fcbe7cb6072e5607b4216c6c5c133 (patch)
treefb2b812369b88727e6c8d2365f3a4f0d831bcbb0 /src
parentbc0915cd3c899263c1be54730be7df3ecb9b54dd (diff)
downloadui-gadget-1-3a86573c836fcbe7cb6072e5607b4216c6c5c133.tar.gz
ui-gadget-1-3a86573c836fcbe7cb6072e5607b4216c6c5c133.tar.bz2
ui-gadget-1-3a86573c836fcbe7cb6072e5607b4216c6c5c133.zip
The display server based on X or Wayland, is now a choice of different profile in Tizen 3.0. Basically and consistently, two macros were used "with wayland" and "with x". Below summarize the combination of the macros: | wayland | x | meaning |--------------------------- | 0 | 1 | pure X11 platform(no wayland) | 1 | 0 | pure wayland platform (no X11) | 1 | 1 | wayland but X compatibility | 0 | 0 | no X and no wayland This method unifies the meaning and usage. Deploy this method to ui-gadget package. Signed-off-by: Li,Limin <liminx.li@intel.com> Change-Id: Iceb95b03f824860b2aac74f35c0945380f6cc22a
Diffstat (limited to 'src')
-rw-r--r--[-rwxr-xr-x]src/manager.c22
-rw-r--r--[-rwxr-xr-x]src/ug.c2
2 files changed, 24 insertions, 0 deletions
diff --git a/src/manager.c b/src/manager.c
index bc3de24..c96d5b2 100755..100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -24,9 +24,12 @@
#include <string.h>
#include <errno.h>
#include <glib.h>
+
+#ifndef WAYLAND
#include <utilX.h>
#include <X11/Xatom.h>
#include <X11/Xutil.h>
+#endif
#include <Ecore.h>
@@ -41,8 +44,12 @@ struct ug_manager {
GSList *fv_list;
void *win;
+
+#ifndef WAYLAND
Window win_id;
Display *disp;
+#endif
+
void *conform;
enum ug_option base_opt;
@@ -110,6 +117,7 @@ static int ug_fvlist_del(ui_gadget_h c)
return 0;
}
+#ifndef WAYLAND
static int __ug_x_get_window_property(Display *dpy, Window win, Atom atom,
Atom type, unsigned int *val,
unsigned int len)
@@ -146,7 +154,9 @@ static int __ug_x_get_window_property(Display *dpy, Window win, Atom atom,
return num;
}
+#endif
+#ifndef WAYLAND
static enum ug_event __ug_x_rotation_get(Display *dpy, Window win)
{
Window active_win;
@@ -202,6 +212,7 @@ static enum ug_event __ug_x_rotation_get(Display *dpy, Window win)
func_out:
return func_ret;
}
+#endif
static void ugman_tree_dump(ui_gadget_h ug)
{
@@ -382,7 +393,11 @@ static int ugman_indicator_update(enum ug_option opt, enum ug_event event)
int enable;
int cur_state;
+#ifndef WAYLAND
cur_state = utilx_get_indicator_state(ug_man.disp, ug_man.win_id);
+#else
+ cur_state = -1; //state is -1 (unknown)
+#endif
_DBG("indicator update opt(%d) cur_state(%d)", opt, cur_state);
@@ -411,7 +426,10 @@ static int ugman_indicator_update(enum ug_option opt, enum ug_event event)
if(cur_state != enable) {
_DBG("set indicator as %d", enable);
+
+#ifndef WAYLAND
utilx_enable_indicator(ug_man.disp, ug_man.win_id, enable);
+#endif
}
return 0;
}
@@ -586,7 +604,9 @@ static int ugman_ug_create(void *data)
}
if(ug_man.last_rotate_evt == UG_EVENT_NONE) {
+#ifndef WAYLAND
ug_man.last_rotate_evt = __ug_x_rotation_get(ug_man.disp, ug_man.win_id);
+#endif
}
ugman_ug_event(ug, ug_man.last_rotate_evt);
@@ -798,6 +818,7 @@ int ugman_ug_del_all(void)
return 0;
}
+#ifndef WAYLAND
int ugman_init(Display *disp, Window xid, void *win, enum ug_option opt)
{
ug_man.is_initted = 1;
@@ -810,6 +831,7 @@ int ugman_init(Display *disp, Window xid, void *win, enum ug_option opt)
return 0;
}
+#endif
int ugman_resume(void)
{
diff --git a/src/ug.c b/src/ug.c
index 3ee636f..af5bc47 100755..100644
--- a/src/ug.c
+++ b/src/ug.c
@@ -94,6 +94,7 @@ UG_API ui_gadget_h ug_create(ui_gadget_h parent,
return ugman_ug_load(parent, name, mode, service, cbs);
}
+#ifndef WAYLAND
UG_API int ug_init(Display *disp, Window xid, void *win, enum ug_option opt)
{
if (!win || !xid || !disp) {
@@ -108,6 +109,7 @@ UG_API int ug_init(Display *disp, Window xid, void *win, enum ug_option opt)
return ugman_init(disp, xid, win, opt);
}
+#endif
UG_API int ug_pause(void)
{