Fixed double free problem for hashes of tizen_policy and display_policy.
[platform/core/api/efl-util.git] / src / efl_util.c
index 7b987e1..72295c3 100644 (file)
@@ -32,7 +32,7 @@
 #include <Ecore_Evas.h>
 #include <pthread.h>
 
-#include <Ecore_Wayland.h>
+#include <Ecore_Wl2.h>
 #include <wayland-client.h>
 #include <wayland-tbm-client.h>
 #include <tizen-extension-client-protocol.h>
@@ -185,6 +185,7 @@ typedef struct _Efl_Util_Data
    struct
    {
       Eina_Bool init;
+      Ecore_Wl2_Display *wl2_display;
       struct wl_display *dpy;
       struct wl_event_queue *queue;
       int dpy_fd;
@@ -192,6 +193,7 @@ typedef struct _Efl_Util_Data
 
       struct
       {
+         unsigned int id;
          struct tizen_policy *proto;
          Eina_Hash *hash_noti_lv;
          Eina_Hash *hash_scr_mode;
@@ -212,6 +214,7 @@ typedef struct _Efl_Util_Data
       } devmgr;
       struct
       {
+         unsigned int id;
          struct tizen_display_policy *proto;
          Eina_Hash *hash_brightness;
       } display_policy;
@@ -234,12 +237,12 @@ static Efl_Util_Data _eflutil =
 {
    {
       EINA_FALSE,
-      NULL, NULL,
+      NULL, NULL, NULL,
       -1, NULL,
-      { NULL, NULL, NULL }, /* tizen_policy protocol */
+      { 0, NULL, NULL, NULL }, /* tizen_policy protocol */
       { NULL, NULL, NULL, NULL, NULL, 0 }, /* screenshooter protocol */
       { NULL, -1 }, /* tizen_input_device_manager protocol */
-      { NULL, NULL }, /* display_policy protocol */
+      { 0, NULL, NULL }, /* display_policy protocol */
       { NULL, -1, EINA_FALSE } /* tizen_gesture protocol */
    },
    {
@@ -267,6 +270,7 @@ static void                    _cb_wl_tz_policy_iconify_state_changed(void *data
 static void                    _cb_wl_tz_policy_supported_aux_hints(void *data, struct tizen_policy *tizen_policy, struct wl_surface *surface_resource, struct wl_array *hints, uint32_t num_hints);
 static void                    _cb_wl_tz_policy_allowed_aux_hint(void *data, struct tizen_policy *tizen_policy, struct wl_surface *surface_resource, int id);
 static void                    _cb_wl_tz_policy_aux_message(void *data, struct tizen_policy *tizen_policy, struct wl_surface *surface_resource, const char *key, const char *val, struct wl_array *options);
+static void                    _cb_wl_conformant_region(void *data, struct tizen_policy *tizen_policy, struct wl_surface *surface, uint32_t conformant_part, uint32_t state, int32_t x, int32_t y, int32_t w, int32_t h, uint32_t serial);
 
 static void                    _cb_wl_tz_display_policy_brightness_done(void *data, struct tizen_display_policy *tizen_display_policy, struct wl_surface *surface_resource, int32_t brightness, uint32_t state);
 
@@ -309,6 +313,7 @@ struct tizen_policy_listener _wl_tz_policy_listener =
    _cb_wl_tz_policy_supported_aux_hints,
    _cb_wl_tz_policy_allowed_aux_hint,
    _cb_wl_tz_policy_aux_message,
+   _cb_wl_conformant_region,
 };
 
 struct tizen_input_device_manager_listener _wl_tz_devmgr_listener =
@@ -415,9 +420,11 @@ _wl_init(void)
 
    if (_eflutil.wl.init) return EINA_TRUE;
 
-   ecore_wl_init(NULL);
+   ecore_wl2_init();
 
-   _eflutil.wl.dpy = ecore_wl_display_get();
+   _eflutil.wl.wl2_display = ecore_wl2_display_connect(NULL);
+   EINA_SAFETY_ON_NULL_GOTO(_eflutil.wl.wl2_display, fail);
+   _eflutil.wl.dpy = ecore_wl2_display_get(_eflutil.wl.wl2_display);
    EINA_SAFETY_ON_NULL_GOTO(_eflutil.wl.dpy, fail);
 
    display_wrapper = wl_proxy_create_wrapper(_eflutil.wl.dpy);
@@ -448,7 +455,7 @@ fail:
         _eflutil.wl.queue = NULL;
      }
 
-   ecore_wl_shutdown();
+   ecore_wl2_shutdown();
    return EINA_FALSE;
 }
 
@@ -528,7 +535,7 @@ static const struct tizen_screenshooter_listener tz_screenshooter_listener =
 static void
 _cb_wl_reg_global(void *data,
                   struct wl_registry *reg,
-                  unsigned int name,
+                  unsigned int id,
                   const char *interface,
                   unsigned int version)
 {
@@ -536,9 +543,9 @@ _cb_wl_reg_global(void *data,
      {
         struct tizen_policy *proto;
         proto = wl_registry_bind(reg,
-                                  name,
+                                  id,
                                   &tizen_policy_interface,
-                                  1);
+                                  7);
         if (!proto) return;
 
         tizen_policy_add_listener(proto,
@@ -548,6 +555,7 @@ _cb_wl_reg_global(void *data,
         _eflutil.wl.policy.hash_noti_lv = eina_hash_pointer_new(free);
         _eflutil.wl.policy.hash_scr_mode = eina_hash_pointer_new(free);
         _eflutil.wl.policy.proto = proto;
+        _eflutil.wl.policy.id = id;
      }
    else if (strcmp(interface, "wl_output") == 0)
      {
@@ -556,17 +564,17 @@ _cb_wl_reg_global(void *data,
 
         _eflutil.wl.shot.output_list = eina_list_append(_eflutil.wl.shot.output_list, output);
 
-        output->output = wl_registry_bind(reg, name, &wl_output_interface, version);
+        output->output = wl_registry_bind(reg, id, &wl_output_interface, version);
         wl_output_add_listener(output->output, &output_listener, output);
      }
    else if (strcmp(interface, "tizen_input_device_manager") == 0)
      {
-        _eflutil.wl.devmgr.devicemgr = wl_registry_bind(reg, name, &tizen_input_device_manager_interface, version);
+        _eflutil.wl.devmgr.devicemgr = wl_registry_bind(reg, id, &tizen_input_device_manager_interface, version);
         tizen_input_device_manager_add_listener(_eflutil.wl.devmgr.devicemgr, &_wl_tz_devmgr_listener, NULL);
      }
    else if (!strcmp(interface, "tizen_display_policy"))
      {
-        _eflutil.wl.display_policy.proto = wl_registry_bind(reg, name, &tizen_display_policy_interface, version);
+        _eflutil.wl.display_policy.proto = wl_registry_bind(reg, id, &tizen_display_policy_interface, version);
         if (!_eflutil.wl.display_policy.proto) return;
 
         tizen_display_policy_add_listener(_eflutil.wl.display_policy.proto,
@@ -574,10 +582,11 @@ _cb_wl_reg_global(void *data,
                                           NULL);
 
         _eflutil.wl.display_policy.hash_brightness = eina_hash_pointer_new(free);
+        _eflutil.wl.display_policy.id = id;
      }
    else if (strcmp(interface, "tizen_gesture") == 0)
      {
-        _eflutil.wl.gesture.proto = wl_registry_bind(reg, name, &tizen_gesture_interface, version);
+        _eflutil.wl.gesture.proto = wl_registry_bind(reg, id, &tizen_gesture_interface, version);
         tizen_gesture_add_listener(_eflutil.wl.gesture.proto, &_wl_tz_gesture_listener, NULL);
      }
 }
@@ -585,14 +594,24 @@ _cb_wl_reg_global(void *data,
 static void
 _cb_wl_reg_global_remove(void *data,
                          struct wl_registry *reg,
-                         unsigned int name)
+                         unsigned int id)
 {
-   _eflutil.wl.policy.proto = NULL;
-   eina_hash_free(_eflutil.wl.policy.hash_noti_lv);
-   eina_hash_free(_eflutil.wl.policy.hash_scr_mode);
-
-   _eflutil.wl.display_policy.proto = NULL;
-   eina_hash_free(_eflutil.wl.display_policy.hash_brightness);
+   /* unset each global id number to 0 since global id is started
+    * from number 1 on server side display structure
+    */
+   if (id == _eflutil.wl.policy.id)
+     {
+        _eflutil.wl.policy.id = 0;
+        _eflutil.wl.policy.proto = NULL;
+        eina_hash_free(_eflutil.wl.policy.hash_noti_lv);
+        eina_hash_free(_eflutil.wl.policy.hash_scr_mode);
+     }
+   else if (id == _eflutil.wl.display_policy.id)
+     {
+        _eflutil.wl.display_policy.id = 0;
+        _eflutil.wl.display_policy.proto = NULL;
+        eina_hash_free(_eflutil.wl.display_policy.hash_brightness);
+     }
 }
 /* LCOV_EXCL_STOP */
 
@@ -631,14 +650,14 @@ _cb_info_find_by_wlsurf(void *wlsurf,
 {
    Eina_List *l, *ll;
    Efl_Util_Callback_Info *info;
-   Ecore_Wl_Window *wlwin2 = NULL;
+   Ecore_Wl2_Window *wlwin2 = NULL;
    void *wlsurf2 = NULL;
 
    l = _cb_info_list_get(idx);
    EINA_LIST_FOREACH(l, ll, info)
      {
-        wlwin2 = elm_win_wl_window_get(info->win);
-        wlsurf2 = ecore_wl_window_surface_get(wlwin2);
+        wlwin2 = (Ecore_Wl2_Window *)elm_win_wl_window_get(info->win);
+        wlsurf2 = ecore_wl2_window_surface_get(wlwin2);
         if (wlsurf== wlsurf2) return info;
      }
 
@@ -741,6 +760,9 @@ static void                    _cb_wl_tz_policy_allowed_aux_hint(void *data, str
 static void                    _cb_wl_tz_policy_aux_message(void *data, struct tizen_policy *tizen_policy, struct wl_surface *surface_resource, const char *key, const char *val, struct wl_array *options)
 {
 }
+static void                    _cb_wl_conformant_region(void *data, struct tizen_policy *tizen_policy, struct wl_surface *surface, uint32_t conformant_part, uint32_t state, int32_t x, int32_t y, int32_t w, int32_t h, uint32_t serial)
+{
+}
 /* LCOV_EXCL_STOP */
 
 static void
@@ -801,29 +823,29 @@ efl_util_set_notification_window_level(Evas_Object *window,
      }
 
    Elm_Win_Type type;
-   Ecore_Wl_Window *wlwin;
+   Ecore_Wl2_Window *wlwin;
    struct wl_surface *surface;
    Efl_Util_Wl_Surface_Lv_Info *lv_info;
-   Ecore_Wl_Window_Type wl_type;
+   Ecore_Wl2_Window_Type wl_type;
 
    res = _wl_init();
    EINA_SAFETY_ON_FALSE_RETURN_VAL(res, EFL_UTIL_ERROR_INVALID_PARAMETER);
 
-   wlwin = elm_win_wl_window_get(window);
+   wlwin = (Ecore_Wl2_Window *)elm_win_wl_window_get(window);
    EINA_SAFETY_ON_NULL_RETURN_VAL(wlwin, EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE);
 
    type = elm_win_type_get(window);
    if (type != ELM_WIN_NOTIFICATION)
      {
-        wl_type = ecore_wl_window_type_get(wlwin);
-        EINA_SAFETY_ON_FALSE_RETURN_VAL((wl_type == ECORE_WL_WINDOW_TYPE_NOTIFICATION),
+        wl_type = ecore_wl2_window_type_get(wlwin);
+        EINA_SAFETY_ON_FALSE_RETURN_VAL((wl_type == ECORE_WL2_WINDOW_TYPE_NOTIFICATION),
                                         EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE);
      }
 
    while (!_eflutil.wl.policy.proto)
      wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
 
-   surface = ecore_wl_window_surface_get(wlwin);
+   surface = ecore_wl2_window_surface_get(wlwin);
    EINA_SAFETY_ON_NULL_RETURN_VAL(surface,
                                   EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE);
 
@@ -860,7 +882,7 @@ efl_util_set_notification_window_level(Evas_Object *window,
         int count = 0;
         while (lv_info->wait_for_done && (count < 3))
           {
-             ecore_wl_flush();
+             ecore_wl2_display_flush(_eflutil.wl.wl2_display);
              wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
              count++;
           }
@@ -891,29 +913,29 @@ efl_util_get_notification_window_level(Evas_Object *window,
    EINA_SAFETY_ON_NULL_RETURN_VAL(level, EFL_UTIL_ERROR_INVALID_PARAMETER);
 
    Elm_Win_Type type;
-   Ecore_Wl_Window *wlwin;
+   Ecore_Wl2_Window *wlwin;
    struct wl_surface *surface;
    Efl_Util_Wl_Surface_Lv_Info *lv_info;
-   Ecore_Wl_Window_Type wl_type;
+   Ecore_Wl2_Window_Type wl_type;
 
    res = _wl_init();
    EINA_SAFETY_ON_FALSE_RETURN_VAL(res, EFL_UTIL_ERROR_INVALID_PARAMETER);
 
-   wlwin = elm_win_wl_window_get(window);
+   wlwin = (Ecore_Wl2_Window *)elm_win_wl_window_get(window);
    EINA_SAFETY_ON_NULL_RETURN_VAL(wlwin, EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE);
 
    type = elm_win_type_get(window);
    if (type != ELM_WIN_NOTIFICATION)
      {
-        wl_type = ecore_wl_window_type_get(wlwin);
-        EINA_SAFETY_ON_FALSE_RETURN_VAL((wl_type == ECORE_WL_WINDOW_TYPE_NOTIFICATION),
+        wl_type = ecore_wl2_window_type_get(wlwin);
+        EINA_SAFETY_ON_FALSE_RETURN_VAL((wl_type == ECORE_WL2_WINDOW_TYPE_NOTIFICATION),
                                         EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE);
      }
 
    while (!_eflutil.wl.policy.proto)
      wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
 
-   surface = ecore_wl_window_surface_get(wlwin);
+   surface = ecore_wl2_window_surface_get(wlwin);
    EINA_SAFETY_ON_NULL_RETURN_VAL(surface,
                                   EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE);
 
@@ -925,7 +947,7 @@ efl_util_get_notification_window_level(Evas_Object *window,
              int count = 0;
              while ((lv_info->wait_for_done) && (count < 3))
                {
-                  ecore_wl_flush();
+                  ecore_wl2_display_flush(_eflutil.wl.wl2_display);
                   wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
                   count++;
                }
@@ -1006,7 +1028,7 @@ efl_util_set_window_opaque_state(Evas_Object *window,
    EINA_SAFETY_ON_FALSE_RETURN_VAL(((opaque >= 0) && (opaque <= 1)),
                                    EFL_UTIL_ERROR_INVALID_PARAMETER);
 
-   Ecore_Wl_Window *wlwin;
+   Ecore_Wl2_Window *wlwin;
    struct wl_surface *surface;
 
    if (!_eflutil.wl.policy.proto)
@@ -1022,11 +1044,11 @@ efl_util_set_window_opaque_state(Evas_Object *window,
         EINA_SAFETY_ON_NULL_RETURN_VAL(_eflutil.wl.policy.proto, EFL_UTIL_ERROR_INVALID_PARAMETER);
      }
 
-   wlwin = elm_win_wl_window_get(window);
+   wlwin = (Ecore_Wl2_Window *)elm_win_wl_window_get(window);
    if (!wlwin)
       return EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE;
 
-   surface  = ecore_wl_window_surface_get(wlwin);
+   surface  = ecore_wl2_window_surface_get(wlwin);
    if (!surface)
       return EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE;
 
@@ -1044,7 +1066,7 @@ efl_util_set_window_screen_mode(Evas_Object *window,
                                     (mode <= EFL_UTIL_SCREEN_MODE_ALWAYS_ON)),
                                    EFL_UTIL_ERROR_INVALID_PARAMETER);
 
-   Ecore_Wl_Window *wlwin;
+   Ecore_Wl2_Window *wlwin;
    struct wl_surface *surface;
    Efl_Util_Wl_Surface_Scr_Mode_Info *scr_mode_info;
    Eina_Bool res;
@@ -1052,13 +1074,13 @@ efl_util_set_window_screen_mode(Evas_Object *window,
    res = _wl_init();
    EINA_SAFETY_ON_FALSE_RETURN_VAL(res, EFL_UTIL_ERROR_INVALID_PARAMETER);
 
-   wlwin = elm_win_wl_window_get(window);
+   wlwin = (Ecore_Wl2_Window *)elm_win_wl_window_get(window);
    if (wlwin)
      {
         while (!_eflutil.wl.policy.proto)
           wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
 
-        surface = ecore_wl_window_surface_get(wlwin);
+        surface = ecore_wl2_window_surface_get(wlwin);
         EINA_SAFETY_ON_NULL_RETURN_VAL(surface,
                                        EFL_UTIL_ERROR_INVALID_PARAMETER);
 
@@ -1091,7 +1113,7 @@ efl_util_set_window_screen_mode(Evas_Object *window,
              int count = 0;
              while (scr_mode_info->wait_for_done && (count < 3))
                {
-                  ecore_wl_flush();
+                  ecore_wl2_display_flush(_eflutil.wl.wl2_display);
                   wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
                   count++;
                }
@@ -1122,7 +1144,7 @@ efl_util_get_window_screen_mode(Evas_Object *window,
    EINA_SAFETY_ON_NULL_RETURN_VAL(window, EFL_UTIL_ERROR_INVALID_PARAMETER);
    EINA_SAFETY_ON_NULL_RETURN_VAL(mode, EFL_UTIL_ERROR_INVALID_PARAMETER);
 
-   Ecore_Wl_Window *wlwin;
+   Ecore_Wl2_Window *wlwin;
    struct wl_surface *surface;
    Efl_Util_Wl_Surface_Scr_Mode_Info *scr_mode_info;
    Eina_Bool res;
@@ -1130,13 +1152,13 @@ efl_util_get_window_screen_mode(Evas_Object *window,
    res = _wl_init();
    EINA_SAFETY_ON_FALSE_RETURN_VAL(res, EFL_UTIL_ERROR_INVALID_PARAMETER);
 
-   wlwin = elm_win_wl_window_get(window);
+   wlwin = (Ecore_Wl2_Window *)elm_win_wl_window_get(window);
    if (wlwin)
      {
         while (!_eflutil.wl.policy.proto)
           wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
 
-        surface = ecore_wl_window_surface_get(wlwin);
+        surface = ecore_wl2_window_surface_get(wlwin);
         EINA_SAFETY_ON_NULL_RETURN_VAL(surface,
                                        EFL_UTIL_ERROR_INVALID_PARAMETER);
 
@@ -1147,7 +1169,7 @@ efl_util_get_window_screen_mode(Evas_Object *window,
                {
                   while (scr_mode_info->wait_for_done)
                     {
-                       ecore_wl_flush();
+                       ecore_wl2_display_flush(_eflutil.wl.wl2_display);
                        wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
                     }
                }
@@ -1220,7 +1242,7 @@ efl_util_unset_window_screen_mode_error_cb(Evas_Object *window)
 API int
 efl_util_set_window_brightness(Evas_Object *window, int brightness)
 {
-   Ecore_Wl_Window *wlwin;
+   Ecore_Wl2_Window *wlwin;
    struct wl_surface *surface;
    Efl_Util_Wl_Surface_Brightness_Info *brightness_info;
    Eina_Bool res;
@@ -1231,13 +1253,13 @@ efl_util_set_window_brightness(Evas_Object *window, int brightness)
    res = _wl_init();
    EINA_SAFETY_ON_FALSE_RETURN_VAL(res, EFL_UTIL_ERROR_INVALID_PARAMETER);
 
-   wlwin = elm_win_wl_window_get(window);
+   wlwin = (Ecore_Wl2_Window *)elm_win_wl_window_get(window);
    if (wlwin)
      {
         while (!_eflutil.wl.display_policy.proto)
           wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
 
-        surface = ecore_wl_window_surface_get(wlwin);
+        surface = ecore_wl2_window_surface_get(wlwin);
         EINA_SAFETY_ON_NULL_RETURN_VAL(surface,
                                        EFL_UTIL_ERROR_INVALID_PARAMETER);
 
@@ -1270,7 +1292,7 @@ efl_util_set_window_brightness(Evas_Object *window, int brightness)
               int count = 0;
               while (brightness_info->wait_for_done && (count < 3))
                 {
-                   ecore_wl_flush();
+                   ecore_wl2_display_flush(_eflutil.wl.wl2_display);
                    wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
                    count++;
                 }
@@ -1296,7 +1318,7 @@ efl_util_set_window_brightness(Evas_Object *window, int brightness)
 API int
 efl_util_get_window_brightness(Evas_Object *window, int *brightness)
 {
-   Ecore_Wl_Window *wlwin;
+   Ecore_Wl2_Window *wlwin;
    struct wl_surface *surface;
    Efl_Util_Wl_Surface_Brightness_Info *brightness_info;
    Eina_Bool res;
@@ -1307,13 +1329,13 @@ efl_util_get_window_brightness(Evas_Object *window, int *brightness)
    res = _wl_init();
    EINA_SAFETY_ON_FALSE_RETURN_VAL(res, EFL_UTIL_ERROR_INVALID_PARAMETER);
 
-   wlwin = elm_win_wl_window_get(window);
+   wlwin = (Ecore_Wl2_Window *)elm_win_wl_window_get(window);
    if (!wlwin) return EFL_UTIL_ERROR_INVALID_PARAMETER;
 
    while (!_eflutil.wl.display_policy.proto)
      wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
 
-   surface = ecore_wl_window_surface_get(wlwin);
+   surface = ecore_wl2_window_surface_get(wlwin);
    EINA_SAFETY_ON_NULL_RETURN_VAL(surface,
                                   EFL_UTIL_ERROR_INVALID_PARAMETER);
 
@@ -1324,7 +1346,7 @@ efl_util_get_window_brightness(Evas_Object *window, int *brightness)
           {
              while (brightness_info->wait_for_done)
                {
-                  ecore_wl_flush();
+                  ecore_wl2_display_flush(_eflutil.wl.wl2_display);
                   wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
                }
           }
@@ -1951,6 +1973,7 @@ fail:
    return NULL;
 }
 
+/* LCOV_EXCL_START */
 API int
 efl_util_screenshot_set_auto_rotation(efl_util_screenshot_h screenshot, int set)
 {
@@ -1980,6 +2003,7 @@ efl_util_screenshot_get_auto_rotation(efl_util_screenshot_h screenshot, int *set
 
    return EFL_UTIL_ERROR_NONE;
 }
+/* LCOV_EXCL_STOP */
 
 struct _efl_util_gesture_h
 {
@@ -1991,6 +2015,7 @@ API int EFL_UTIL_EVENT_GESTURE_EDGE_DRAG = 0;
 API int EFL_UTIL_EVENT_GESTURE_TAP = 0;
 API int EFL_UTIL_EVENT_GESTURE_PALM_COVER = 0;
 
+/* LCOV_EXCL_START */
 static void
 _cb_gesture_edge_swipe_notify(void *data EINA_UNUSED, struct tizen_gesture *tizen_gesture EINA_UNUSED, uint32_t fingers EINA_UNUSED, uint32_t edge EINA_UNUSED, uint32_t edge_size EINA_UNUSED, uint32_t start_point EINA_UNUSED, uint32_t end_point EINA_UNUSED, uint32_t error)
 {
@@ -2060,6 +2085,7 @@ _cb_gesture_tap(void *data EINA_UNUSED, struct tizen_gesture *tizen_gesture EINA
 
    ecore_event_add(EFL_UTIL_EVENT_GESTURE_TAP, ev, NULL, NULL);
 }
+/* LCOV_EXCL_STOP */
 
 static void
 _cb_gesture_palm_cover_notify(void *data EINA_UNUSED, struct tizen_gesture *tizen_gesture EINA_UNUSED, struct wl_surface *surface EINA_UNUSED, uint32_t error)
@@ -2067,6 +2093,7 @@ _cb_gesture_palm_cover_notify(void *data EINA_UNUSED, struct tizen_gesture *tize
    _eflutil.wl.gesture.request_notified = error;
 }
 
+/* LCOV_EXCL_START */
 static void
 _cb_gesture_palm_cover(void *data EINA_UNUSED, struct tizen_gesture *tizen_gesture EINA_UNUSED, struct wl_surface *surface, uint32_t mode, uint32_t duration, int cx, int cy, uint32_t size, wl_fixed_t pressure)
 {
@@ -2085,6 +2112,7 @@ _cb_gesture_palm_cover(void *data EINA_UNUSED, struct tizen_gesture *tizen_gestu
 
    ecore_event_add(EFL_UTIL_EVENT_GESTURE_PALM_COVER, ev, NULL, NULL);
 }
+/* LCOV_EXCL_STOP */
 
 static void
 _cb_gesture_activate_notify(void *data EINA_UNUSED, struct tizen_gesture *tizen_gesture EINA_UNUSED, struct wl_surface *surface EINA_UNUSED, uint32_t type EINA_UNUSED, uint32_t active EINA_UNUSED, uint32_t error)
@@ -2114,6 +2142,7 @@ _efl_util_gesture_convert_error(int ret)
      }
 }
 
+/* LCOV_EXCL_START */
 static int
 _efl_util_gesture_grab_edge_swipe(efl_util_gesture_data data)
 {
@@ -2392,6 +2421,7 @@ _efl_util_fd_cb(void *data, Ecore_Fd_Handler *hdl)
         return ECORE_CALLBACK_CANCEL;
      }
 }
+/* LCOV_EXCL_STOP */
 
 API efl_util_gesture_h
 efl_util_gesture_initialize(void)
@@ -2402,25 +2432,25 @@ efl_util_gesture_initialize(void)
    gesture_h = (efl_util_gesture_h)calloc(1, sizeof(struct _efl_util_gesture_h));
    if (!gesture_h)
      {
-        set_last_result(EFL_UTIL_ERROR_OUT_OF_MEMORY);
-        goto out;
+        set_last_result(EFL_UTIL_ERROR_OUT_OF_MEMORY); /* LCOV_EXCL_LINE */
+        goto out; /* LCOV_EXCL_LINE */
      }
 
    if (_wl_init() == (int)EINA_FALSE)
      {
-        set_last_result(EFL_UTIL_ERROR_NOT_SUPPORTED);
-        goto out;
+        set_last_result(EFL_UTIL_ERROR_NOT_SUPPORTED); /* LCOV_EXCL_LINE */
+        goto out; /* LCOV_EXCL_LINE */
      }
 
    while (!_eflutil.wl.gesture.proto)
-     wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+     wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue); /* LCOV_EXCL_LINE */
 
    if (_eflutil.wl.gesture.event_init <= 0)
      {
         if (ecore_event_init() <= 0)
           {
-             set_last_result(EFL_UTIL_ERROR_NOT_SUPPORTED);
-             goto out;
+             set_last_result(EFL_UTIL_ERROR_NOT_SUPPORTED); /* LCOV_EXCL_LINE */
+             goto out; /* LCOV_EXCL_LINE */
           }
         EFL_UTIL_EVENT_GESTURE_EDGE_SWIPE = ecore_event_type_new();
         EFL_UTIL_EVENT_GESTURE_EDGE_DRAG = ecore_event_type_new();
@@ -2442,12 +2472,14 @@ efl_util_gesture_initialize(void)
    return gesture_h;
 
 out:
+/* LCOV_EXCL_START */
    if (gesture_h)
      {
         free(gesture_h);
         gesture_h = NULL;
      }
    return gesture_h;
+/* LCOV_EXCL_STOP */
 }
 
 API int
@@ -2501,8 +2533,8 @@ efl_util_gesture_edge_swipe_new(efl_util_gesture_h gesture_h, unsigned int finge
    data = (Efl_Util_Gesture_Edge_Swipe_Grab_Data *)calloc(1, sizeof(Efl_Util_Gesture_Edge_Swipe_Grab_Data));
    if (!data)
      {
-        set_last_result(EFL_UTIL_ERROR_OUT_OF_MEMORY);
-        return NULL;
+        set_last_result(EFL_UTIL_ERROR_OUT_OF_MEMORY); /* LCOV_EXCL_LINE */
+        return NULL; /* LCOV_EXCL_LINE */
      }
 
    data->base.type = TIZEN_GESTURE_TYPE_EDGE_SWIPE;
@@ -2573,8 +2605,8 @@ efl_util_gesture_edge_drag_new(efl_util_gesture_h gesture_h, unsigned int finger
    data = (Efl_Util_Gesture_Edge_Drag_Grab_Data *)calloc(1, sizeof(Efl_Util_Gesture_Edge_Drag_Grab_Data));
    if (!data)
      {
-        set_last_result(EFL_UTIL_ERROR_OUT_OF_MEMORY);
-        return NULL;
+        set_last_result(EFL_UTIL_ERROR_OUT_OF_MEMORY); /* LCOV_EXCL_LINE */
+        return NULL; /* LCOV_EXCL_LINE */
      }
 
    data->base.type = TIZEN_GESTURE_TYPE_EDGE_DRAG;
@@ -2645,8 +2677,8 @@ efl_util_gesture_tap_new(efl_util_gesture_h gesture_h, unsigned int fingers, uns
    data = (Efl_Util_Gesture_Tap_Grab_Data *)calloc(1, sizeof(Efl_Util_Gesture_Tap_Grab_Data));
    if (!data)
      {
-        set_last_result(EFL_UTIL_ERROR_OUT_OF_MEMORY);
-        return NULL;
+        set_last_result(EFL_UTIL_ERROR_OUT_OF_MEMORY); /* LCOV_EXCL_LINE */
+        return NULL; /* LCOV_EXCL_LINE */
      }
 
    data->base.type = TIZEN_GESTURE_TYPE_TAP;
@@ -2691,8 +2723,8 @@ efl_util_gesture_palm_cover_new(efl_util_gesture_h gesture_h)
    data = (Efl_Util_Gesture_Palm_Cover_Grab_Data *)calloc(1, sizeof(Efl_Util_Gesture_Palm_Cover_Grab_Data));
    if (!data)
      {
-        set_last_result(EFL_UTIL_ERROR_OUT_OF_MEMORY);
-        return NULL;
+        set_last_result(EFL_UTIL_ERROR_OUT_OF_MEMORY); /* LCOV_EXCL_LINE */
+        return NULL; /* LCOV_EXCL_LINE */
      }
 
    data->base.type = TIZEN_GESTURE_TYPE_PALM_COVER;
@@ -2721,6 +2753,7 @@ efl_util_gesture_palm_cover_free(efl_util_gesture_h gesture_h, efl_util_gesture_
    return EFL_UTIL_ERROR_NONE;
 }
 
+/* LCOV_EXCL_START */
 API int
 efl_util_gesture_grab(efl_util_gesture_h gesture_h, efl_util_gesture_data data)
 {
@@ -2786,12 +2819,13 @@ efl_util_gesture_ungrab(efl_util_gesture_h gesture_h, efl_util_gesture_data data
 
    return ret;
 }
+/* LCOV_EXCL_STOP */
 
 API int
 efl_util_gesture_select(efl_util_gesture_h gesture_h, Evas_Object *window, efl_util_gesture_data data)
 {
    Efl_Util_Gesture_Common_Grab_Data *base_data = NULL;
-   Ecore_Wl_Window *wlwin;
+   Ecore_Wl2_Window *wlwin;
    struct wl_surface *surface;
    int ret;
 
@@ -2805,10 +2839,10 @@ efl_util_gesture_select(efl_util_gesture_h gesture_h, Evas_Object *window, efl_u
    if (base_data->type != TIZEN_GESTURE_TYPE_PALM_COVER)
      return EFL_UTIL_ERROR_NOT_SUPPORTED;
 
-   wlwin = elm_win_wl_window_get(window);
+   wlwin = (Ecore_Wl2_Window *)elm_win_wl_window_get(window);
    if (!wlwin) return EFL_UTIL_ERROR_INVALID_PARAMETER;
 
-   surface = ecore_wl_window_surface_get(wlwin);
+   surface = ecore_wl2_window_surface_get(wlwin);
    EINA_SAFETY_ON_NULL_RETURN_VAL(surface,
                                   EFL_UTIL_ERROR_INVALID_PARAMETER);
 
@@ -2827,7 +2861,7 @@ API int
 efl_util_gesture_deselect(efl_util_gesture_h gesture_h, Evas_Object *window, efl_util_gesture_data data)
 {
    Efl_Util_Gesture_Common_Grab_Data *base_data = NULL;
-   Ecore_Wl_Window *wlwin;
+   Ecore_Wl2_Window *wlwin;
    struct wl_surface *surface;
    int ret;
 
@@ -2841,10 +2875,10 @@ efl_util_gesture_deselect(efl_util_gesture_h gesture_h, Evas_Object *window, efl
    if (base_data->type != TIZEN_GESTURE_TYPE_PALM_COVER)
      return EFL_UTIL_ERROR_NOT_SUPPORTED;
 
-   wlwin = elm_win_wl_window_get(window);
+   wlwin = (Ecore_Wl2_Window *)elm_win_wl_window_get(window);
    if (!wlwin) return EFL_UTIL_ERROR_INVALID_PARAMETER;
 
-   surface = ecore_wl_window_surface_get(wlwin);
+   surface = ecore_wl2_window_surface_get(wlwin);
    EINA_SAFETY_ON_NULL_RETURN_VAL(surface,
                                   EFL_UTIL_ERROR_INVALID_PARAMETER);
 
@@ -2859,6 +2893,7 @@ efl_util_gesture_deselect(efl_util_gesture_h gesture_h, Evas_Object *window, efl
    return ret;
 }
 
+/* LCOV_EXCL_START */
 API int
 efl_util_gesture_activate_set(efl_util_gesture_h gesture_h, unsigned int type, Eina_Bool active)
 {
@@ -2878,11 +2913,12 @@ efl_util_gesture_activate_set(efl_util_gesture_h gesture_h, unsigned int type, E
 
    return ret;
 }
+/* LCOV_EXCL_STOP */
 
 API int
 efl_util_gesture_activate_set_on_window(efl_util_gesture_h gesture_h, Evas_Object *window, unsigned int type, Eina_Bool active)
 {
-   Ecore_Wl_Window *wlwin;
+   Ecore_Wl2_Window *wlwin;
    struct wl_surface *surface;
    int ret;
 
@@ -2891,10 +2927,10 @@ efl_util_gesture_activate_set_on_window(efl_util_gesture_h gesture_h, Evas_Objec
    EINA_SAFETY_ON_NULL_RETURN_VAL(window, EFL_UTIL_ERROR_INVALID_PARAMETER);
    EINA_SAFETY_ON_TRUE_RETURN_VAL(type == EFL_UTIL_GESTURE_TYPE_NONE, EFL_UTIL_ERROR_INVALID_PARAMETER);
 
-   wlwin = elm_win_wl_window_get(window);
+   wlwin = (Ecore_Wl2_Window *)elm_win_wl_window_get(window);
    if (!wlwin) return EFL_UTIL_ERROR_INVALID_PARAMETER;
 
-   surface = ecore_wl_window_surface_get(wlwin);
+   surface = ecore_wl2_window_surface_get(wlwin);
    EINA_SAFETY_ON_NULL_RETURN_VAL(surface,
                                   EFL_UTIL_ERROR_INVALID_PARAMETER);