Remove unused files
[platform/core/appfw/app-core.git] / src / appcore-rotation.c
old mode 100755 (executable)
new mode 100644 (file)
index 4fb934d..f0280f0
 #include <stdlib.h>
 #include <unistd.h>
 
-#include <sensor.h>
+#include <sensor_internal.h>
 #include <vconf.h>
-#include <Ecore_X.h>
 #include <Ecore.h>
-#include <X11/Xlib.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);                      \
 
 static Ecore_X_Atom ATOM_ROTATION_LOCK = 0;
 static Ecore_X_Window root;
+#endif
 
 struct rot_s {
        int handle;
-       int (*callback) (enum appcore_rm, void *);
+       int (*callback) (void *event_info, enum appcore_rm, void *);
        enum appcore_rm mode;
        int lock;
        void *cbdata;
@@ -122,7 +125,7 @@ static void __changed_cb(unsigned int event_type, sensor_event_data_t *event,
        if (rot.callback) {
                if (rot.cb_set && rot.mode != m) {
                        _DBG("[APP %d] Rotation: %d -> %d", getpid(), rot.mode, m);
-                       rot.callback(m, data);
+                       rot.callback((void *)&m, m, data);
                        rot.mode = m;
                }
        }
@@ -139,7 +142,7 @@ static void __lock_cb(keynode_t *node, void *data)
        if (rot.lock) {
                m = APPCORE_RM_PORTRAIT_NORMAL;
                if (rot.mode != m) {
-                       rot.callback(m, data);
+                       rot.callback((void *)&m, m, data);
                        rot.mode = m;
                }
                _DBG("[APP %d] Rotation locked", getpid());
@@ -153,7 +156,7 @@ static void __lock_cb(keynode_t *node, void *data)
                        _DBG("[APP %d] Rotmode prev %d -> curr %d", getpid(),
                             rot.mode, m);
                        if (!r && rot.mode != m) {
-                               rot.callback(m, data);
+                               rot.callback((void *)&m, m, data);
                                rot.mode = m;
                        }
                }
@@ -183,7 +186,7 @@ static void __del_rotlock(void)
        rot.lock = 0;
 }
 
-EXPORT_API int appcore_set_rotation_cb(int (*cb) (enum appcore_rm, void *),
+EXPORT_API int appcore_set_rotation_cb(int (*cb) (void *evnet_info, enum appcore_rm, void *),
                                       void *data)
 {
        if (rot.wm_rotate) {
@@ -240,9 +243,11 @@ EXPORT_API int appcore_set_rotation_cb(int (*cb) (enum appcore_rm, void *),
                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;
 }
@@ -396,7 +401,7 @@ EXPORT_API int appcore_resume_rotation_cb(void)
                r = appcore_get_rotation_state(&m);
                _DBG("[APP %d] Rotmode prev %d -> curr %d", getpid(), rot.mode, m);
                if (!r && rot.mode != m && rot.lock == 0) {
-                       rot.callback(m, rot.cbdata);
+                       rot.callback((void *)&m, m, rot.cbdata);
                        rot.mode = m;
                }
        }