SET(APPCORE_COMMON "appcore-common")
SET(SRCS_common src/appcore.c src/appcore-i18n.c src/appcore-measure.c
# src/appcore-noti.c src/appcore-pmcontrol.c
- src/appcore-rotation.c
-# src/appcore-util.c
- src/appcore-X.c)
+ src/appcore-rotation.c)
SET(HEADERS_common appcore-common.h)
INCLUDE(FindPkgConfig)
-#pkg_check_modules(pkg_common REQUIRED pmapi vconf sensor aul rua dlog x11)
-pkg_check_modules(pkg_common REQUIRED vconf sensor aul dlog x11 ecore-x)
+#pkg_check_modules(pkg_common REQUIRED pmapi vconf sensor aul rua dlog)
+pkg_check_modules(pkg_common REQUIRED vconf sensor aul dlog)
FOREACH(flag ${pkg_common_CFLAGS})
SET(EXTRA_CFLAGS_common "${EXTRA_CFLAGS_common} ${flag}")
ENDFOREACH(flag)
#include <errno.h>
#include <string.h>
#include <stdlib.h>
+
+#if HAVE_X
#include <X11/Xatom.h>
#include <X11/Xlib.h>
#include <Ecore_X.h>
+#endif
+
#include <Elementary.h>
+#include <Ecore_Wayland.h>
#include <glib-object.h>
#include <malloc.h>
#include <sysman.h>
}
+#if HAVE_X
Ecore_X_Atom atom_parent;
+#endif
static Eina_Bool __show_cb(void *data, int type, void *event)
{
+
+#if HAVE_X
+ //There is no Wayland equivelent show event yet, this is stubbed out until there is
+
Ecore_X_Event_Window_Show *ev;
+ Ecore_Wl_Event_Window_Configure *ev; //there is no Window_Show for wayland
int ret;
Ecore_X_Window parent;
else
__update_win((unsigned int)ev->win, FALSE);
+#endif
return ECORE_CALLBACK_RENEW;
}
static Eina_Bool __hide_cb(void *data, int type, void *event)
{
+
+#if HAVE_X
+ //There is no Wayland equivelent for hide event yet, this is stubbed out until there is
Ecore_X_Event_Window_Hide *ev;
+ Ecore_Wl_Event_Window_Configure *ev;
int bvisibility = 0;
ev = event;
}
}
+#endif
return ECORE_CALLBACK_RENEW;
}
static Eina_Bool __visibility_cb(void *data, int type, void *event)
{
+
+#if HAVE_X
+ //There is no Wayland equivelent for visibility event yet, this is stubbed out until there is
Ecore_X_Event_Window_Visibility_Change *ev;
int bvisibility = 0;
__do_app(AE_PAUSE, data, NULL);
} else
_DBG(" No change state \n");
-
+#endif
return ECORE_CALLBACK_RENEW;
}
static void __add_climsg_cb(struct ui_priv *ui)
{
+
+#if HAVE_X
_ret_if(ui == NULL);
atom_parent = ecore_x_atom_get("_E_PARENT_BORDER_WINDOW");
ui->hvchange =
ecore_event_handler_add(ECORE_X_EVENT_WINDOW_VISIBILITY_CHANGE,
__visibility_cb, ui);
-
+#endif
}
static int __before_loop(struct ui_priv *ui, int *argc, char ***argv)
#include <sensor.h>
#include <vconf.h>
+
+#if HAVE_X
#include <Ecore_X.h>
#include <Ecore.h>
#include <X11/Xlib.h>
+#endif
+#include <Ecore_Wayland.h>
#include "appcore-internal.h"
+#if HAVE_X
#define _MAKE_ATOM(a, s) \
do { \
a = ecore_x_atom_get(s); \
if (!a) \
_ERR("##s creation failed.\n"); \
} while(0)
+#endif
#define STR_ATOM_ROTATION_LOCK "_E_ROTATION_LOCK"
-static Ecore_X_Atom ATOM_ROTATION_LOCK = 0;
+
+static int ATOM_ROTATION_LOCK = 0;
+
+#if HAVE_X
static Ecore_X_Window root;
+#endif
struct rot_s {
int handle;
static Eina_Bool __property(void *data, int type, void *event)
{
- Ecore_X_Event_Window_Property *ev = event;
+ Ecore_Wl_Event_Window_Configure *ev =event;
if (!ev)
return ECORE_CALLBACK_PASS_ON;
- if (ev->atom == ATOM_ROTATION_LOCK) {
+ if (ev->event_win == ATOM_ROTATION_LOCK) {
_DBG("[APP %d] Rotation: %d -> %d, cb_set : %d", getpid(), rot.mode, changed_m, rot.cb_set);
if (rot.cb_set && rot.mode != changed_m) {
rot.callback(changed_m, changed_data);
_DBG("[APP %d] Rotation: %d -> %d", getpid(), rot.mode, m);
+#if HAVE_X
+ //Missing wayland equivelent
if (rot.callback) {
if (rot.cb_set && rot.mode != m) {
ret = ecore_x_window_prop_card32_get(root, ATOM_ROTATION_LOCK, &val, 1);
}
changed_m = m;
}
+#endif
}
static void __lock_cb(keynode_t *node, void *data)
ecore_event_handler_del(changed_handle);
changed_handle = NULL;
}
- changed_handle = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_PROPERTY, __property, NULL);
+ changed_handle = ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_CONFIGURE, __property, NULL);
}
}
rot.handle = handle;
__add_rotlock(data);
+#if HAVE_X
_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;
}
static int __app_resume(void *data)
{
+ #if HAVE_X
x_raise_win(getpid());
+ #endif
return 0;
}