Add more replacements for Ecore_Wl2 migration 43/173043/1
authorJi-hoon Lee <dalton.lee@samsung.com>
Thu, 25 Jan 2018 13:11:54 +0000 (22:11 +0900)
committerJi-hoon Lee <dalton.lee@samsung.com>
Mon, 19 Mar 2018 08:56:31 +0000 (17:56 +0900)
Change-Id: I7e903f73d41d7598dd80c59c52f7bf066217e1ae

scl/gwes/efl/sclevents-efl.cpp
scl/utils/linux/sclutils-linux.cpp

index 868f653..a886a55 100644 (file)
@@ -28,7 +28,8 @@
 #include <Elementary.h>
 #include <dlog.h>
 #ifdef WAYLAND
-#include <Ecore_Wayland.h>
+#define EFL_BETA_API_SUPPORT
+#include <Ecore_Wl2.h>
 #else
 #include <Ecore_X.h>
 #endif
@@ -403,9 +404,9 @@ static Eina_Bool mouse_press(void *data, int type, void *event_info)
 {
     SCL_DEBUG();
 #ifdef WAYLAND
-    Ecore_Wl_Window *wl_base_window;
-    Ecore_Wl_Window *wl_magnifier_window;
-    Ecore_Wl_Window *wl_window;
+    Ecore_Wl2_Window *wl_base_window;
+    Ecore_Wl2_Window *wl_magnifier_window;
+    Ecore_Wl2_Window *wl_window;
 #endif
 
     CSCLController *controller = CSCLController::get_instance();
@@ -454,11 +455,11 @@ static Eina_Bool mouse_press(void *data, int type, void *event_info)
         sclboolean is_scl_window = FALSE;
 #ifdef WAYLAND
         sclboolean is_magnifier_window = FALSE;
-        wl_base_window = elm_win_wl_window_get(static_cast<Evas_Object*>(windows->get_base_window()));
-        wl_magnifier_window = (elm_win_wl_window_get(static_cast<Evas_Object*>(windows->get_magnifier_window())));
-        if (wl_base_window && (unsigned int)ecore_wl_window_id_get(wl_base_window) == ev->window) {
+        wl_base_window = (Ecore_Wl2_Window*)elm_win_wl_window_get(static_cast<Evas_Object*>(windows->get_base_window()));
+        wl_magnifier_window = (Ecore_Wl2_Window*)(elm_win_wl_window_get(static_cast<Evas_Object*>(windows->get_magnifier_window())));
+        if (wl_base_window && (unsigned int)ecore_wl2_window_id_get(wl_base_window) == ev->window) {
             is_scl_window = TRUE;
-        } else if (wl_magnifier_window && (unsigned int)ecore_wl_window_id_get(wl_magnifier_window) == ev->window) {
+        } else if (wl_magnifier_window && (unsigned int)ecore_wl2_window_id_get(wl_magnifier_window) == ev->window) {
             is_scl_window = TRUE;
             is_magnifier_window = TRUE;
 #else
@@ -475,8 +476,8 @@ static Eina_Bool mouse_press(void *data, int type, void *event_info)
                     if (window_context->is_virtual) {
                         is_scl_window  = TRUE;
 #ifdef WAYLAND
-                    } else if ((wl_window = elm_win_wl_window_get(static_cast<Evas_Object*>(window)))) {
-                        if ((unsigned int)ecore_wl_window_id_get(wl_window) == ev->window)
+                    } else if ((wl_window = (Ecore_Wl2_Window*)elm_win_wl_window_get(static_cast<Evas_Object*>(window)))) {
+                        if ((unsigned int)ecore_wl2_window_id_get(wl_window) == ev->window)
                             is_scl_window = TRUE;
 #else
                     } else if (elm_win_xwindow_get(static_cast<Evas_Object*>(window)) == ev->window) {
@@ -651,10 +652,10 @@ static Eina_Bool mouse_release(void *data, int type, void *event_info)
 #ifdef WAYLAND
                             int root_x = 0;
                             int root_y = 0;
-                            Ecore_Wl_Window *wl_magnifier_window =
-                                (elm_win_wl_window_get(static_cast<Evas_Object*>(windows->get_magnifier_window())));
+                            Ecore_Wl2_Window *wl_magnifier_window =
+                                (Ecore_Wl2_Window*)(elm_win_wl_window_get(static_cast<Evas_Object*>(windows->get_magnifier_window())));
                             if (wl_magnifier_window &&
-                                (unsigned int)ecore_wl_window_id_get(wl_magnifier_window) == ev->window) {
+                                (unsigned int)ecore_wl2_window_id_get(wl_magnifier_window) == ev->window) {
                                 SclRectangle magnifier_rect = { 0, 0, 0, 0 };
                                 if (get_window_rect(windows->get_magnifier_window(), &magnifier_rect)) {
                                     root_x = ev->x + magnifier_rect.x;
@@ -883,17 +884,17 @@ static Eina_Bool mouse_move(void *data, int type, void *event_info)
             int root_x = 0;
             int root_y = 0;
 
-            Ecore_Wl_Window *wl_base_window =
-                elm_win_wl_window_get(static_cast<Evas_Object*>(windows->get_base_window()));
-            Ecore_Wl_Window  *wl_magnifier_window =
-                (elm_win_wl_window_get(static_cast<Evas_Object*>(windows->get_magnifier_window())));
-            if (wl_base_window && (unsigned int)ecore_wl_window_id_get(wl_base_window) == ev->window) {
+            Ecore_Wl2_Window *wl_base_window =
+                (Ecore_Wl2_Window*)elm_win_wl_window_get(static_cast<Evas_Object*>(windows->get_base_window()));
+            Ecore_Wl2_Window  *wl_magnifier_window =
+                (Ecore_Wl2_Window*)(elm_win_wl_window_get(static_cast<Evas_Object*>(windows->get_magnifier_window())));
+            if (wl_base_window && (unsigned int)ecore_wl2_window_id_get(wl_base_window) == ev->window) {
                 SclRectangle base_rect;
                 if (get_window_rect(windows->get_base_window(), &base_rect)) {
                     root_x = ev->x + base_rect.x;
                     root_y = ev->y + base_rect.y;
                 }
-            } else if (wl_magnifier_window && (unsigned int)ecore_wl_window_id_get(wl_magnifier_window) == ev->window) {
+            } else if (wl_magnifier_window && (unsigned int)ecore_wl2_window_id_get(wl_magnifier_window) == ev->window) {
                 SclRectangle magnifier_rect = { 0, 0, 0, 0 };
                 if (get_window_rect(windows->get_magnifier_window(), &magnifier_rect)) {
                     root_x = ev->x + magnifier_rect.x;
@@ -1165,10 +1166,10 @@ CSCLEventsImplEfl::generate_mouse_event(SCLMouseEvent type, scl16 x, scl16 y)
                         pressed[loop] = TRUE;
                         Ecore_Event_Mouse_Button evt;
 #ifdef WAYLAND
-                        Ecore_Wl_Window *wl_base_window;
-                        wl_base_window = elm_win_wl_window_get(static_cast<Evas_Object*>(windows->get_base_window()));
+                        Ecore_Wl2_Window *wl_base_window;
+                        wl_base_window = (Ecore_Wl2_Window*)elm_win_wl_window_get(static_cast<Evas_Object*>(windows->get_base_window()));
                         if (wl_base_window)
-                            evt.window = (unsigned int)ecore_wl_window_id_get(wl_base_window);
+                            evt.window = (unsigned int)ecore_wl2_window_id_get(wl_base_window);
 #else
                         evt.window = elm_win_xwindow_get(static_cast<Evas_Object*>(windows->get_base_window()));
 #endif
@@ -1193,10 +1194,10 @@ CSCLEventsImplEfl::generate_mouse_event(SCLMouseEvent type, scl16 x, scl16 y)
                         pressed[loop] = FALSE;
                         Ecore_Event_Mouse_Button evt;
 #ifdef WAYLAND
-                        Ecore_Wl_Window *wl_base_window;
-                        wl_base_window = elm_win_wl_window_get(static_cast<Evas_Object*>(windows->get_base_window()));
+                        Ecore_Wl2_Window *wl_base_window;
+                        wl_base_window = (Ecore_Wl2_Window*)elm_win_wl_window_get(static_cast<Evas_Object*>(windows->get_base_window()));
                         if (wl_base_window)
-                            evt.window = (unsigned int)ecore_wl_window_id_get(wl_base_window);
+                            evt.window = (unsigned int)ecore_wl2_window_id_get(wl_base_window);
 #else
                         evt.window = elm_win_xwindow_get(static_cast<Evas_Object*>(windows->get_base_window()));
 #endif
@@ -1220,10 +1221,10 @@ CSCLEventsImplEfl::generate_mouse_event(SCLMouseEvent type, scl16 x, scl16 y)
                     if (pressed[loop] == TRUE) {
                         Ecore_Event_Mouse_Move evt;
 #ifdef WAYLAND
-                        Ecore_Wl_Window *wl_base_window;
-                        wl_base_window = elm_win_wl_window_get(static_cast<Evas_Object*>(windows->get_base_window()));
+                        Ecore_Wl2_Window *wl_base_window;
+                        wl_base_window = (Ecore_Wl2_Window*)elm_win_wl_window_get(static_cast<Evas_Object*>(windows->get_base_window()));
                         if (wl_base_window)
-                            evt.window = (unsigned int)ecore_wl_window_id_get(wl_base_window);
+                            evt.window = (unsigned int)ecore_wl2_window_id_get(wl_base_window);
 #else
                         evt.window = elm_win_xwindow_get(static_cast<Evas_Object*>(windows->get_base_window()));
 #endif
index 89d07cc..dae4998 100644 (file)
 
 #include <stdarg.h>
 
-#include <Ecore.h>
+#include <Elementary.h>
 #ifdef WAYLAND
-#include <Ecore_Wayland.h>
+#define EFL_BETA_API_SUPPORT
+#include <Ecore_Wl2.h>
 #else
 #include <Ecore_X.h>
 #endif
-#include <Ecore_Evas.h>
 #include <feedback.h>
-#include <Elementary.h>
 #include <tts.h>
 #include <vconf.h>
 
@@ -164,8 +163,11 @@ CSCLUtilsImplLinux::get_screen_resolution(sclint *x, sclint *y) {
     sclint scr_h = m_scr_size.height;
     if (m_scr_size.width == 0 || m_scr_size.height == 0) {
 #ifdef WAYLAND
-        ecore_wl_sync();
-        ecore_wl_screen_size_get(&scr_w, &scr_h);
+        ecore_wl2_sync();
+        Ecore_Wl2_Display *ewd;
+        if (!(ewd = ecore_wl2_connected_display_get(NULL)))
+            return FALSE;
+        ecore_wl2_display_screen_size_get(ewd, &scr_w, &scr_h);
 #else
         scluint w, h;
         w = h = 0;