e-tizen-testcase: use ecore_wl2 instead of ecore_wl library 65/173265/1
authorJunSeok, Kim <juns.kim@samsung.com>
Tue, 20 Mar 2018 08:03:45 +0000 (17:03 +0900)
committerJunSeok, Kim <juns.kim@samsung.com>
Tue, 20 Mar 2018 08:03:45 +0000 (17:03 +0900)
Change-Id: Ieccf43415b15fefb6aa03e49c086e8fb25b57bb0

configure.ac
packaging/e-tizen-testcase.spec
src/e_test_event.cpp
src/e_test_util.h

index 32345e2..d9c3d68 100644 (file)
@@ -28,7 +28,7 @@ requirements="\
    enlightenment \
    capi-ui-efl-util \
    wayland-client \
-   ecore-wayland \
+   ecore-wl2 \
    tizen-extension-client \
    tzsh-screensaver-manager-service \
    tzsh-screensaver-service \
index e309be5..bea6220 100644 (file)
@@ -9,6 +9,7 @@ License: BSD-2-Clause
 BuildRequires: pkgconfig(enlightenment)
 BuildRequires: pkgconfig(eldbus)
 BuildRequires: pkgconfig(capi-ui-efl-util)
+BuildRequires: pkgconfig(ecore-wl2)
 BuildRequires: gettext
 BuildRequires: pkgconfig(tizen-extension-client)
 BuildRequires: pkgconfig(tzsh-screensaver-manager-service)
@@ -23,7 +24,7 @@ This package is a test case runner for enlightenment.
 
 %build
 export GC_SECTIONS_FLAGS="-fdata-sections -ffunction-sections -Wl,--gc-sections"
-export CXXFLAGS+=" -Wall -g -fPIC -rdynamic ${GC_SECTIONS_FLAGS}"
+export CXXFLAGS+=" -Wall -g -fPIC -rdynamic ${GC_SECTIONS_FLAGS} -DEFL_BETA_API_SUPPORT "
 export LDFLAGS+=" -Wl,--hash-style=both -Wl,--as-needed -Wl,--rpath=/usr/lib"
 
 %autogen
index 78b4ddb..574470b 100644 (file)
@@ -1,3 +1,5 @@
+#include <Ecore_Wl2.h>
+
 #include "e_test_event.h"
 
 #define E_TEST_WORK_TIME 3.0
@@ -105,6 +107,10 @@ Eina_Bool EtEventLoop::Init()
 
    this->log_dom_ = eina_log_domain_register("e-tc", EINA_COLOR_BLUE);
 
+   // Init Ecore_Wl2
+   if (!ecore_wl2_connected_display_get(NULL))
+     ecore_wl2_display_connect(NULL);
+
    // init tizen_extension protocol
    result = GetTizenPolicy();
    EINA_SAFETY_ON_FALSE_RETURN_VAL(result, EINA_FALSE);
@@ -706,15 +712,15 @@ void EtEventLoop::WaitForDestroy()
 
 Ecore_Window EtEventLoop::GetWinId(Evas_Object *elm_win)
 {
-   Ecore_Wl_Window *wlwin = NULL;
+   Ecore_Wl2_Window *wlwin = NULL;
    struct wl_surface *surf = NULL;
    Ecore_Window id = 0;
    struct tizen_resource *tzres = NULL;
 
-   wlwin = elm_win_wl_window_get(elm_win);
+   wlwin = (Ecore_Wl2_Window *)elm_win_wl_window_get(elm_win);
    EINA_SAFETY_ON_NULL_RETURN_VAL(wlwin, 0);
 
-   surf = ecore_wl_window_surface_get(wlwin);
+   surf = ecore_wl2_window_surface_get(wlwin);
    EINA_SAFETY_ON_NULL_RETURN_VAL(surf, 0);
 
    if (!this->tizen_surface_)
@@ -735,19 +741,19 @@ Ecore_Window EtEventLoop::GetWinId(Evas_Object *elm_win)
 
 Eina_Bool EtEventLoop::GetTizenPolicy()
 {
-   Eina_Inlist *globals = NULL;
-   Ecore_Wl_Global *global = NULL;
+   Eina_Iterator *globals = NULL;
+   Ecore_Wl2_Global *global = NULL;
    struct wl_registry *registry = NULL;
 
    if (!this->tizen_policy_)
      {
-        registry = ecore_wl_registry_get();
-        globals = ecore_wl_globals_get();
+        registry = ecore_wl2_display_registry_get(ecore_wl2_connected_display_get(NULL));
+        globals = ecore_wl2_display_globals_get(ecore_wl2_connected_display_get(NULL));
 
         EINA_SAFETY_ON_NULL_RETURN_VAL(registry, EINA_FALSE);
         EINA_SAFETY_ON_NULL_RETURN_VAL(globals, EINA_FALSE);
 
-        EINA_INLIST_FOREACH(globals, global)
+        EINA_ITERATOR_FOREACH(globals, global)
           {
              if (!strcmp(global->interface, "tizen_policy"))
                {
@@ -755,7 +761,7 @@ Eina_Bool EtEventLoop::GetTizenPolicy()
                      wl_registry_bind(registry,
                                       global->id,
                                       &tizen_policy_interface,
-                                      7);
+                                      (global->version > 7)? 7 : global->version);
                }
           }
 
@@ -767,19 +773,19 @@ Eina_Bool EtEventLoop::GetTizenPolicy()
 
 Eina_Bool EtEventLoop::GetTizenSurface()
 {
-   Eina_Inlist *globals = NULL;
-   Ecore_Wl_Global *global = NULL;
+   Eina_Iterator *globals = NULL;
+   Ecore_Wl2_Global *global = NULL;
    struct wl_registry *registry = NULL;
 
    if (!this->tizen_surface_)
      {
-        registry = ecore_wl_registry_get();
-        globals = ecore_wl_globals_get();
+        registry = ecore_wl2_display_registry_get(ecore_wl2_connected_display_get(NULL));
+        globals = ecore_wl2_display_globals_get(ecore_wl2_connected_display_get(NULL));
 
         EINA_SAFETY_ON_NULL_RETURN_VAL(registry, EINA_FALSE);
         EINA_SAFETY_ON_NULL_RETURN_VAL(globals, EINA_FALSE);
 
-        EINA_INLIST_FOREACH(globals, global)
+        EINA_ITERATOR_FOREACH(globals, global)
           {
              if (!strcmp(global->interface, "tizen_surface"))
                {
@@ -787,7 +793,7 @@ Eina_Bool EtEventLoop::GetTizenSurface()
                      wl_registry_bind(registry,
                                       global->id,
                                       &tizen_surface_interface,
-                                      1);
+                                      (global->version > 1)? 1 : global->version);
                }
           }
 
index 793cc96..702e3ec 100644 (file)
@@ -9,7 +9,6 @@ extern "C" {
 #include "eina_list_ext.h"
 #include <Eldbus.h>
 #include <Elementary.h>
-#include <Ecore_Wayland.h>
 #include <wayland-client.h>
 #include <tizen-extension-client-protocol.h>