e_test_event: add getWlSurface method 75/180475/1
authorJunSeok, Kim <juns.kim@samsung.com>
Tue, 29 May 2018 12:04:26 +0000 (21:04 +0900)
committerJunSeok, Kim <juns.kim@samsung.com>
Tue, 29 May 2018 12:15:34 +0000 (21:15 +0900)
Change-Id: I2b30d599c139a9bc8683df2504a22d229def25b7

src/e_test_event.cpp
src/e_test_event.h

index 6437480..e198d67 100644 (file)
@@ -388,15 +388,11 @@ etRunner::setLastWinInfoList(Eina_List *list)
 Ecore_Window
 etRunner::getWinId(Evas_Object *elm_win)
 {
-   Ecore_Wl2_Window *wlwin = NULL;
    struct wl_surface *surf = NULL;
    Ecore_Window id = 0;
    struct tizen_resource *tzres = NULL;
 
-   wlwin = (Ecore_Wl2_Window *)elm_win_wl_window_get(elm_win);
-   EINA_SAFETY_ON_NULL_RETURN_VAL(wlwin, 0);
-
-   surf = ecore_wl2_window_surface_get(wlwin);
+   surf = getWlSurface(elm_win);
    EINA_SAFETY_ON_NULL_RETURN_VAL(surf, 0);
 
    tzres = tizen_surface_get_tizen_resource(tzSurface, surf);
@@ -412,6 +408,23 @@ etRunner::getWinId(Evas_Object *elm_win)
    return id;
 }
 
+struct wl_surface *
+etRunner::getWlSurface(Evas_Object *elm_win)
+{
+   Ecore_Wl2_Window *wlwin = NULL;
+   struct wl_surface *surf = NULL;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(elm_win, NULL);
+
+   wlwin = (Ecore_Wl2_Window *)elm_win_wl_window_get(elm_win);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(wlwin, NULL);
+
+   surf = ecore_wl2_window_surface_get(wlwin);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(surf, NULL);
+
+   return surf;
+}
+
 Eina_Bool
 etRunner::setDpms(Eina_Bool on)
 {
index c40beba..9a3f484 100644 (file)
@@ -85,6 +85,7 @@ public:
    Eina_Bool     hasLastWinInfoList() { return !!listWinInfo; };
    void          setLastWinInfoList(Eina_List *list);
    Ecore_Window  getWinId(Evas_Object *elm_win);
+   struct wl_surface *getWlSurface(Evas_Object *elm_win);
    Eina_Bool     setDpms(Eina_Bool on);
    Eina_Bool     feedMouseDown(int x, int y);
    Eina_Bool     feedMouseMove(int x, int y);