efl_util: change version of tizen_policy from 1 to 7.
[platform/core/api/efl-util.git] / src / efl_util.c
index 9860db6..aff5a0d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011-2015 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2011-2017 Samsung Electronics Co., Ltd All Rights Reserved
  *
  * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
 #include <tbm_surface_internal.h>
 #include <Elementary.h>
 #include <Ecore_Evas.h>
+#include <pthread.h>
 
-#if X11
-#include <X11/Xlib.h>
-#include <X11/extensions/Xvlib.h>
-#include <X11/extensions/Xvproto.h>
-#include <X11/extensions/Xdamage.h>
-#include <dri2.h>
-#include <Ecore_X.h>
-#include <utilX.h>
-#endif /* end of X11 */
-
-#if WAYLAND
 #include <Ecore_Wayland.h>
 #include <wayland-client.h>
 #include <wayland-tbm-client.h>
 #include <tizen-extension-client-protocol.h>
 #include <screenshooter-client-protocol.h>
-#endif /* end of WAYLAND */
+
+#include <efl_util_screenshot_extension.h>
+
+#include <dlog.h>
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+
+/* Determine Tizen profile at runtime */
+#include <system_info.h>
+typedef enum {
+   TIZEN_PROFILE_UNKNOWN = 0,
+   TIZEN_PROFILE_MOBILE = 0x1,
+   TIZEN_PROFILE_WEARABLE = 0x2,
+   TIZEN_PROFILE_TV = 0x4,
+   TIZEN_PROFILE_IVI = 0x8,
+   TIZEN_PROFILE_COMMON = 0x10,
+} tizen_profile_t;
+static tizen_profile_t profile = TIZEN_PROFILE_UNKNOWN;
+static tizen_profile_t _get_tizen_profile()
+{
+   char *profileName;
+   system_info_get_platform_string("http://tizen.org/feature/profile", &profileName);
+   switch (*profileName) {
+   case 'm':
+   case 'M':
+     profile = TIZEN_PROFILE_MOBILE;
+     break;
+   case 'w':
+   case 'W':
+     profile = TIZEN_PROFILE_WEARABLE;
+     break;
+   case 't':
+   case 'T':
+     profile = TIZEN_PROFILE_TV;
+     break;
+   case 'i':
+   case 'I':
+     profile = TIZEN_PROFILE_IVI;
+     break;
+   default: // common or unknown ==> ALL ARE COMMON.
+     profile = TIZEN_PROFILE_COMMON;
+   }
+   free(profileName);
+
+   return profile;
+}
+static inline tizen_profile_t get_tizen_profile()
+{
+   if (__builtin_expect(profile != TIZEN_PROFILE_UNKNOWN, 1))
+     return profile;
+   return _get_tizen_profile();
+}
+
+
+#define LOG_TAG "TIZEN_N_EFL_UTIL"
+
 
 /* callback handler index */
 #define CBH_NOTI_LEV 0
@@ -63,7 +109,6 @@ typedef struct _Efl_Util_Callback_Info
    void *data;
 } Efl_Util_Callback_Info;
 
-#if WAYLAND
 typedef struct _Efl_Util_Wl_Surface_Lv_Info
 {
    void *surface; /* wl_surface */
@@ -80,32 +125,70 @@ typedef struct _Efl_Util_Wl_Surface_Scr_Mode_Info
    uint32_t state;
 } Efl_Util_Wl_Surface_Scr_Mode_Info;
 
+typedef struct _Efl_Util_Wl_Surface_Brightness_Info
+{
+   void *surface; /* wl_surface */
+   int brightness;
+   Eina_Bool wait_for_done;
+   uint32_t state;
+} Efl_Util_Wl_Surface_Brightness_Info;
+
 typedef struct _Efl_Util_Wl_Output_Info
 {
     struct wl_output *output;
     int offset_x, offset_y, width, height;
 } Efl_Util_Wl_Output_Info;
-#endif
 
-typedef struct _Efl_Util_Data
+typedef struct _Efl_Util_Gesture_Common_Grab_Data
 {
-#if X11
-   /* x11 related stuffs */
-   struct
-   {
-      Eina_Bool init;
-      Ecore_Event_Handler *handler; /* x11 client message handler */
-      Ecore_X_Display *dpy;
-   } x11;
-#endif /* end of X11 */
+   int type;
+} Efl_Util_Gesture_Common_Grab_Data;
+
+typedef struct _Efl_Util_Gesture_Edge_Swipe_Grab_Data
+{
+   Efl_Util_Gesture_Common_Grab_Data base;
+
+   unsigned int fingers;
+   efl_util_gesture_edge_e edge;
+   efl_util_gesture_edge_size_e edge_size;
+   unsigned int start_point;
+   unsigned int end_point;
+} Efl_Util_Gesture_Edge_Swipe_Grab_Data;
+
+typedef struct _Efl_Util_Gesture_Edge_Drag_Grab_Data
+{
+   Efl_Util_Gesture_Common_Grab_Data base;
+
+   unsigned int fingers;
+   efl_util_gesture_edge_e edge;
+   efl_util_gesture_edge_size_e edge_size;
+   unsigned int start_point;
+   unsigned int end_point;
+} Efl_Util_Gesture_Edge_Drag_Grab_Data;
+
+typedef struct _Efl_Util_Gesture_Tap_Grab_Data
+{
+   Efl_Util_Gesture_Common_Grab_Data base;
+
+   unsigned int fingers;
+   unsigned int repeats;
+} Efl_Util_Gesture_Tap_Grab_Data;
+
+typedef struct _Efl_Util_Gesture_Palm_Cover_Grab_Data
+{
+   Efl_Util_Gesture_Common_Grab_Data base;
+} Efl_Util_Gesture_Palm_Cover_Grab_Data;
 
-#if WAYLAND
+typedef struct _Efl_Util_Data
+{
    /* wayland related stuffs */
    struct
    {
       Eina_Bool init;
       struct wl_display *dpy;
       struct wl_event_queue *queue;
+      int dpy_fd;
+      Ecore_Fd_Handler *fd_hdl;
 
       struct
       {
@@ -115,12 +198,30 @@ typedef struct _Efl_Util_Data
       } policy;
       struct
       {
+         struct wl_event_queue *queue;
          struct screenshooter *screenshooter;
+         struct tizen_screenshooter *tz_screenshooter;
          struct wayland_tbm_client *tbm_client;
          Eina_List *output_list;
+         uint32_t noti;
       } shot;
+      struct
+      {
+         struct tizen_input_device_manager *devicemgr;
+         int request_notified;
+      } devmgr;
+      struct
+      {
+         struct tizen_display_policy *proto;
+         Eina_Hash *hash_brightness;
+      } display_policy;
+      struct
+      {
+         struct tizen_gesture *proto;
+         int request_notified;
+         int event_init;
+      } gesture;
    } wl;
-#endif /* end of WAYLAND */
 
    struct
    {
@@ -131,21 +232,16 @@ typedef struct _Efl_Util_Data
 
 static Efl_Util_Data _eflutil =
 {
-#if X11
-   {
-      EINA_FALSE,
-      NULL,
-      NULL
-   },
-#endif /* end of X11 */
-#if WAYLAND
    {
       EINA_FALSE,
       NULL, NULL,
+      -1, NULL,
       { NULL, NULL, NULL }, /* tizen_policy protocol */
-      { NULL, NULL, NULL }  /* screenshooter protocol */
+      { NULL, NULL, NULL, NULL, NULL, 0 }, /* screenshooter protocol */
+      { NULL, -1 }, /* tizen_input_device_manager protocol */
+      { NULL, NULL }, /* display_policy protocol */
+      { NULL, -1, EINA_FALSE } /* tizen_gesture protocol */
    },
-#endif /* end of WAYLAND */
    {
       { NULL, 0 }, /* handler for notification level */
       { NULL, 0 }  /* handler for screen mode */
@@ -156,21 +252,40 @@ static Eina_Bool               _cb_info_add(Evas_Object *win, Efl_Util_Cb cb, vo
 static Eina_Bool               _cb_info_del_by_win(Evas_Object *win, int idx);
 static Eina_List              *_cb_info_list_get(int idx);
 static Efl_Util_Callback_Info *_cb_info_find_by_win(Evas_Object *win, int idx);
-#if X11
-static Efl_Util_Callback_Info *_cb_info_find_by_xwin(unsigned int xwin, int idx);
-static Eina_Bool               _cb_x11_client_msg(void *data, int type, void *event);
-static Eina_Bool               _x11_init(void);
-#endif /* end of X11 */
-#if WAYLAND
 static Eina_Bool               _wl_init(void);
 static void                    _cb_wl_reg_global(void *data, struct wl_registry *reg, unsigned int name, const char *interface, unsigned int version);
 static void                    _cb_wl_reg_global_remove(void *data, struct wl_registry *reg, unsigned int name);
+static void                    _cb_wl_reg_screenshooter_global(void *data, struct wl_registry *reg, unsigned int name, const char *interface, unsigned int version);
+static void                    _cb_wl_reg_screenshooter_global_remove(void *data, struct wl_registry *reg, unsigned int name);
 static Efl_Util_Callback_Info *_cb_info_find_by_wlsurf(void *wlsurf, int idx);
 static void                    _cb_wl_tz_policy_conformant(void *data, struct tizen_policy *tizen_policy, struct wl_surface *surface, uint32_t is_conformant);
 static void                    _cb_wl_tz_policy_conformant_area(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);
 static void                    _cb_wl_tz_policy_notification_done(void *data, struct tizen_policy *tizen_policy, struct wl_surface *surface, int32_t level, uint32_t state);
 static void                    _cb_wl_tz_policy_transient_for_done(void *data, struct tizen_policy *tizen_policy, uint32_t child_id);
 static void                    _cb_wl_tz_policy_scr_mode_done(void *data, struct tizen_policy *tizen_policy, struct wl_surface *surface, uint32_t mode, uint32_t state);
+static void                    _cb_wl_tz_policy_iconify_state_changed(void *data, struct tizen_policy *tizen_policy, struct wl_surface *surface_resource, uint32_t iconified, uint32_t force);
+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);
+
+static void                    _cb_device_add(void *data EINA_UNUSED, struct tizen_input_device_manager *tizen_input_device_manager EINA_UNUSED, uint32_t serial  EINA_UNUSED, const char *identifier  EINA_UNUSED, struct tizen_input_device *device  EINA_UNUSED, struct wl_seat *seat EINA_UNUSED);
+static void                    _cb_device_remove(void *data EINA_UNUSED, struct tizen_input_device_manager *tizen_input_device_manager EINA_UNUSED, uint32_t serial EINA_UNUSED, const char *identifier  EINA_UNUSED, struct tizen_input_device *device EINA_UNUSED, struct wl_seat *seat EINA_UNUSED);
+static void                    _cb_error(void *data EINA_UNUSED, struct tizen_input_device_manager *tizen_input_device_manager EINA_UNUSED, uint32_t errorcode);
+static void                    _cb_block_expired(void *data EINA_UNUSED, struct tizen_input_device_manager *tizen_input_device_manager EINA_UNUSED);
+
+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);
+static void                    _cb_gesture_edge_swipe(void *data EINA_UNUSED, struct tizen_gesture *tizen_gesture EINA_UNUSED, uint32_t mode, uint32_t fingers, int sx, int sy, uint32_t edge);
+static void                    _cb_gesture_edge_drag_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);
+static void                    _cb_gesture_edge_drag(void *data EINA_UNUSED, struct tizen_gesture *tizen_gesture EINA_UNUSED, uint32_t mode, uint32_t fingers, int cx, int cy, uint32_t edge);
+static void                    _cb_gesture_tap_notify(void *data EINA_UNUSED, struct tizen_gesture *tizen_gesture EINA_UNUSED, uint32_t fingers EINA_UNUSED, uint32_t repeats EINA_UNUSED, uint32_t error);
+static void                    _cb_gesture_tap(void *data EINA_UNUSED, struct tizen_gesture *tizen_gesture EINA_UNUSED, uint32_t mode, uint32_t fingers, uint32_t repeats);
+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);
+static void                    _cb_gesture_palm_cover(void *data EINA_UNUSED, struct tizen_gesture *tizen_gesture EINA_UNUSED, struct wl_surface *surface EINA_UNUSED, uint32_t mode, uint32_t duration, int cx, int cy, uint32_t size, wl_fixed_t pressure);
+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);
+
 
 static const struct wl_registry_listener _wl_reg_listener =
 {
@@ -178,15 +293,51 @@ static const struct wl_registry_listener _wl_reg_listener =
    _cb_wl_reg_global_remove
 };
 
+static const struct wl_registry_listener _wl_reg_screenshooter_listener =
+{
+   _cb_wl_reg_screenshooter_global,
+   _cb_wl_reg_screenshooter_global_remove
+};
+
 struct tizen_policy_listener _wl_tz_policy_listener =
 {
    _cb_wl_tz_policy_conformant,
    _cb_wl_tz_policy_conformant_area,
    _cb_wl_tz_policy_notification_done,
    _cb_wl_tz_policy_transient_for_done,
-   _cb_wl_tz_policy_scr_mode_done
+   _cb_wl_tz_policy_scr_mode_done,
+   _cb_wl_tz_policy_iconify_state_changed,
+   _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 =
+{
+   _cb_device_add,
+   _cb_device_remove,
+   _cb_error,
+   _cb_block_expired
+};
+
+struct tizen_display_policy_listener _wl_tz_display_policy_listener =
+{
+   _cb_wl_tz_display_policy_brightness_done,
+};
+
+struct tizen_gesture_listener _wl_tz_gesture_listener =
+{
+   _cb_gesture_edge_swipe_notify,
+   _cb_gesture_edge_swipe,
+   _cb_gesture_edge_drag_notify,
+   _cb_gesture_edge_drag,
+   _cb_gesture_tap_notify,
+   _cb_gesture_tap,
+   _cb_gesture_palm_cover_notify,
+   _cb_gesture_palm_cover,
+   _cb_gesture_activate_notify
 };
-#endif /* end of WAYLAND */
 
 static Eina_Bool
 _cb_info_add(Evas_Object *win,
@@ -216,13 +367,6 @@ _cb_info_add(Evas_Object *win,
       = eina_list_append(_eflutil.cb_handler[idx].info_list,
                          info);
 
-#if X11
-   if (!_eflutil.x11.handler)
-     _eflutil.x11.handler = ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE,
-                                                    _cb_x11_client_msg,
-                                                    NULL);
-#endif /* end of X11 */
-
    return EINA_TRUE;
 }
 
@@ -240,15 +384,6 @@ _cb_info_del_by_win(Evas_Object *win,
                          info);
    free(info);
 
-#if X11
-   unsigned int count = eina_list_count(_eflutil.cb_handler[idx].info_list);
-   if ((count == 0) && (_eflutil.x11.handler))
-     {
-        ecore_event_handler_del(_eflutil.x11.handler);
-        _eflutil.x11.handler = NULL;
-     }
-#endif
-
    return EINA_TRUE;
 }
 
@@ -274,89 +409,10 @@ _cb_info_find_by_win(Evas_Object *win,
    return NULL;
 }
 
-#if X11
-static Efl_Util_Callback_Info *
-_cb_info_find_by_xwin(unsigned int xwin,
-                      int idx)
-{
-   Eina_List *l, *ll;
-   Efl_Util_Callback_Info *info;
-   unsigned int xwin2;
-
-   l = _cb_info_list_get(idx);
-   EINA_LIST_FOREACH(l, ll, info)
-     {
-        xwin2 = elm_win_xwindow_get(info->win);
-        if (xwin == xwin2) return info;
-     }
-
-   return NULL;
-}
-
-static Eina_Bool
-_cb_x11_client_msg(void *data,
-                   int type,
-                   void *event)
-{
-   Ecore_X_Event_Client_Message *ev;
-   Ecore_X_Window xwin;
-   Efl_Util_Callback_Info *info;
-
-   ev = event;
-   if (!ev) return ECORE_CALLBACK_PASS_ON;
-
-   xwin = ev->win;
-   if (xwin == 0) return ECORE_CALLBACK_PASS_ON;
-
-   if (ev->message_type == _eflutil.cb_handler[CBH_NOTI_LEV].atom)
-     {
-        info = _cb_info_find_by_xwin(xwin, CBH_NOTI_LEV);
-
-        /* permission denied */
-        if ((ev->data.l[1] == 0) &&
-            (info) &&
-            (info->cb))
-          {
-             info->cb(info->win,
-                      EFL_UTIL_ERROR_PERMISSION_DENIED,
-                      info->data);
-          }
-     }
-   else if (ev->message_type == _eflutil.cb_handler[CBH_SCR_MODE].atom)
-     {
-        info = _cb_info_find_by_xwin(xwin, CBH_SCR_MODE);
-
-        /* permission denied */
-        if ((ev->data.l[1] == 0) &&
-            (info) &&
-            (info->cb))
-          {
-             info->cb(info->win,
-                      EFL_UTIL_ERROR_PERMISSION_DENIED,
-                      info->data);
-          }
-     }
-   return ECORE_CALLBACK_PASS_ON;
-}
-
-static Eina_Bool
-_x11_init(void)
-{
-   if (_eflutil.x11.init) return EINA_TRUE;
-
-   _eflutil.x11.dpy = ecore_x_display_get();
-   EINA_SAFETY_ON_NULL_RETURN_VAL(_eflutil.x11.dpy, EINA_FALSE);
-
-   _eflutil.x11.init = EINA_TRUE;
-
-   return EINA_TRUE;
-}
-#endif /* end of X11 */
-
-#if WAYLAND
 static Eina_Bool
 _wl_init(void)
 {
+   struct wl_display *display_wrapper = NULL;
    struct wl_registry *reg = NULL;
 
    if (_eflutil.wl.init) return EINA_TRUE;
@@ -366,27 +422,34 @@ _wl_init(void)
    _eflutil.wl.dpy = ecore_wl_display_get();
    EINA_SAFETY_ON_NULL_GOTO(_eflutil.wl.dpy, fail);
 
+   display_wrapper = wl_proxy_create_wrapper(_eflutil.wl.dpy);
+   EINA_SAFETY_ON_NULL_GOTO(display_wrapper, fail);
+
    _eflutil.wl.queue = wl_display_create_queue(_eflutil.wl.dpy);
    EINA_SAFETY_ON_NULL_GOTO(_eflutil.wl.queue, fail);
 
-   reg = wl_display_get_registry(_eflutil.wl.dpy);
+   wl_proxy_set_queue((struct wl_proxy *)display_wrapper, _eflutil.wl.queue);
+
+   reg = wl_display_get_registry(display_wrapper);
+   wl_proxy_wrapper_destroy(display_wrapper);
+   display_wrapper = NULL;
    EINA_SAFETY_ON_NULL_GOTO(reg, fail);
 
-   wl_proxy_set_queue((struct wl_proxy*)reg, _eflutil.wl.queue);
    wl_registry_add_listener(reg, &_wl_reg_listener, NULL);
 
    _eflutil.wl.init = EINA_TRUE;
 
    return EINA_TRUE;
 fail:
+   if (display_wrapper)
+     wl_proxy_wrapper_destroy(display_wrapper);
+
    if (_eflutil.wl.queue)
      {
         wl_event_queue_destroy(_eflutil.wl.queue);
         _eflutil.wl.queue = NULL;
      }
 
-   if (reg)
-     wl_registry_destroy(reg);
    ecore_wl_shutdown();
    return EINA_FALSE;
 }
@@ -448,6 +511,23 @@ static const struct screenshooter_listener screenshooter_listener =
 };
 
 static void
+_cb_tz_screenshot_format(void *data, struct tizen_screenshooter *tz_screenshooter, uint32_t format)
+{
+}
+
+static void
+_cb_tz_screenshot_noti(void *data, struct tizen_screenshooter *tz_screenshooter, uint32_t noti)
+{
+   _eflutil.wl.shot.noti = noti;
+}
+
+static const struct tizen_screenshooter_listener tz_screenshooter_listener =
+{
+    _cb_tz_screenshot_format,
+    _cb_tz_screenshot_noti
+};
+
+static void
 _cb_wl_reg_global(void *data,
                   struct wl_registry *reg,
                   unsigned int name,
@@ -460,7 +540,7 @@ _cb_wl_reg_global(void *data,
         proto = wl_registry_bind(reg,
                                   name,
                                   &tizen_policy_interface,
-                                  1);
+                                  7);
         if (!proto) return;
 
         tizen_policy_add_listener(proto,
@@ -481,13 +561,29 @@ _cb_wl_reg_global(void *data,
         output->output = wl_registry_bind(reg, name, &wl_output_interface, version);
         wl_output_add_listener(output->output, &output_listener, output);
      }
-   else if (strcmp(interface, "screenshooter") == 0)
+   else if (strcmp(interface, "tizen_input_device_manager") == 0)
      {
-        _eflutil.wl.shot.screenshooter = wl_registry_bind(reg, name, &screenshooter_interface, version);
-        screenshooter_add_listener(_eflutil.wl.shot.screenshooter, &screenshooter_listener, NULL);
+        _eflutil.wl.devmgr.devicemgr = wl_registry_bind(reg, name, &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);
+        if (!_eflutil.wl.display_policy.proto) return;
+
+        tizen_display_policy_add_listener(_eflutil.wl.display_policy.proto,
+                                          &_wl_tz_display_policy_listener,
+                                          NULL);
 
+        _eflutil.wl.display_policy.hash_brightness = eina_hash_pointer_new(free);
+     }
+   else if (strcmp(interface, "tizen_gesture") == 0)
+     {
+        _eflutil.wl.gesture.proto = wl_registry_bind(reg, name, &tizen_gesture_interface, version);
+        tizen_gesture_add_listener(_eflutil.wl.gesture.proto, &_wl_tz_gesture_listener, NULL);
+     }
+}
+/* LCOV_EXCL_START */
 static void
 _cb_wl_reg_global_remove(void *data,
                          struct wl_registry *reg,
@@ -496,6 +592,39 @@ _cb_wl_reg_global_remove(void *data,
    _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);
+}
+/* LCOV_EXCL_STOP */
+
+static void
+_cb_wl_reg_screenshooter_global(void *data,
+                  struct wl_registry *reg,
+                  unsigned int name,
+                  const char *interface,
+                  unsigned int version)
+{
+   if (strcmp(interface, "screenshooter") == 0)
+     {
+        _eflutil.wl.shot.screenshooter = wl_registry_bind(reg, name, &screenshooter_interface, version);
+        screenshooter_add_listener(_eflutil.wl.shot.screenshooter, &screenshooter_listener, NULL);
+     }
+   else if (strcmp(interface, "tizen_screenshooter") == 0)
+     {
+        _eflutil.wl.shot.tz_screenshooter = wl_registry_bind(reg, name, &tizen_screenshooter_interface, version);
+        tizen_screenshooter_add_listener(_eflutil.wl.shot.tz_screenshooter, &tz_screenshooter_listener, NULL);
+
+        wl_display_roundtrip_queue(_eflutil.wl.dpy, _eflutil.wl.shot.queue);
+     }
+}
+
+/* LCOV_EXCL_START */
+static void
+_cb_wl_reg_screenshooter_global_remove(void *data,
+                         struct wl_registry *reg,
+                         unsigned int name)
+{
 }
 
 static Efl_Util_Callback_Info *
@@ -530,6 +659,7 @@ _cb_wl_tz_policy_conformant_area(void *data, struct tizen_policy *tizen_policy,
                                  uint32_t state, int32_t x, int32_t y, int32_t w, int32_t h)
 {
 }
+/* LCOV_EXCL_STOP */
 
 static void
 _cb_wl_tz_policy_notification_done(void *data,
@@ -560,10 +690,12 @@ _cb_wl_tz_policy_notification_done(void *data,
                cb_info->data);
 }
 
+/* LCOV_EXCL_START */
 static void
 _cb_wl_tz_policy_transient_for_done(void *data, struct tizen_policy *tizen_policy, uint32_t child_id)
 {
 }
+/* LCOV_EXCL_STOP */
 
 static void
 _cb_wl_tz_policy_scr_mode_done(void *data,
@@ -594,7 +726,57 @@ _cb_wl_tz_policy_scr_mode_done(void *data,
                EFL_UTIL_ERROR_PERMISSION_DENIED,
                cb_info->data);
 }
-#endif /* end of WAYLAND */
+
+/* LCOV_EXCL_START */
+static void                    _cb_wl_tz_policy_iconify_state_changed(void *data, struct tizen_policy *tizen_policy, struct wl_surface *surface_resource, uint32_t iconified, uint32_t force)
+{
+}
+
+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)
+{
+}
+/* LCOV_EXCL_STOP */
+
+static void
+_cb_wl_tz_display_policy_brightness_done(void *data,
+                                 struct tizen_display_policy *tizen_display_policy,
+                                 struct wl_surface *surface,
+                                 int32_t brightness,
+                                 uint32_t state)
+{
+   Efl_Util_Wl_Surface_Brightness_Info *brightness_info;
+
+   brightness_info = eina_hash_find(_eflutil.wl.display_policy.hash_brightness, &surface);
+   if (brightness_info)
+     {
+        brightness_info->brightness = brightness;
+        brightness_info->wait_for_done = EINA_FALSE;
+        brightness_info->state = state;
+     }
+}
+
+static void
+_cb_window_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+   Efl_Util_Wl_Surface_Lv_Info *lv_info;
+
+   lv_info = data;
+   if (EINA_UNLIKELY(!lv_info))
+     return;
+
+   eina_hash_del(_eflutil.wl.policy.hash_noti_lv, &lv_info->surface, lv_info);
+}
 
 API int
 efl_util_set_notification_window_level(Evas_Object *window,
@@ -607,38 +789,22 @@ efl_util_set_notification_window_level(Evas_Object *window,
                                    (level <= EFL_UTIL_NOTIFICATION_LEVEL_TOP),
                                    EFL_UTIL_ERROR_INVALID_PARAMETER);
 
-#if X11
-   Ecore_X_Window_Type window_type;
-   Ecore_X_Window xwin;
-
-   res = _x11_init();
-   EINA_SAFETY_ON_FALSE_RETURN_VAL(res, EFL_UTIL_ERROR_INVALID_PARAMETER);
-
-   xwin = elm_win_xwindow_get(window);
-   if (xwin)
+   if (level == EFL_UTIL_NOTIFICATION_LEVEL_1)
      {
-        if (ecore_x_netwm_window_type_get(xwin, &window_type) == EINA_TRUE)
-          {
-             // success to get window type
-             if (window_type != ECORE_X_WINDOW_TYPE_NOTIFICATION)
-               {
-                  // given EFL window's type is not notification type.
-                  return EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE;
-               }
-          }
-        else
-          return EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE;
-
-        utilx_set_system_notification_level(_eflutil.x11.dpy,
-                                            xwin,
-                                            level);
-        return EFL_UTIL_ERROR_NONE;
+        dlog_print(DLOG_WARN, LOG_TAG,
+          "DEPRECATION WARNING: EFL_UTIL_NOTIFICATION_LEVEL_1 is deprecated and will be removed from next release. Use EFL_UTIL_NOTIFICATION_LEVEL_DEFAULT instead.");
+     }
+   else if (level == EFL_UTIL_NOTIFICATION_LEVEL_2)
+     {
+        dlog_print(DLOG_WARN, LOG_TAG,
+          "DEPRECATION WARNING: EFL_UTIL_NOTIFICATION_LEVEL_2 is deprecated and will be removed from next release. Use EFL_UTIL_NOTIFICATION_LEVEL_MEDIUM instead.");
+     }
+   else if (level == EFL_UTIL_NOTIFICATION_LEVEL_3)
+     {
+        dlog_print(DLOG_WARN, LOG_TAG,
+          "DEPRECATION WARNING: EFL_UTIL_NOTIFICATION_LEVEL_3 is deprecated and will be removed from next release. Use EFL_UTIL_NOTIFICATION_LEVEL_TOP instead.");
      }
 
-   return EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE;
-#endif /* end of X11 */
-
-#if WAYLAND
    Elm_Win_Type type;
    Ecore_Wl_Window *wlwin;
    struct wl_surface *surface;
@@ -679,6 +845,9 @@ efl_util_set_notification_window_level(Evas_Object *window,
         eina_hash_add(_eflutil.wl.policy.hash_noti_lv,
                       &surface,
                       lv_info);
+
+        evas_object_event_callback_add(window, EVAS_CALLBACK_DEL,
+                                       _cb_window_del, lv_info);
      }
    else
      {
@@ -687,6 +856,7 @@ efl_util_set_notification_window_level(Evas_Object *window,
         lv_info->state = TIZEN_POLICY_ERROR_STATE_NONE;
      }
 
+
    tizen_policy_set_notification_level(_eflutil.wl.policy.proto,
                                        surface, (int)level);
 
@@ -714,7 +884,6 @@ efl_util_set_notification_window_level(Evas_Object *window,
      }
 
    return EFL_UTIL_ERROR_NONE;
-#endif /* end of WAYLAND */
 }
 
 API int
@@ -726,46 +895,6 @@ efl_util_get_notification_window_level(Evas_Object *window,
    EINA_SAFETY_ON_NULL_RETURN_VAL(window, EFL_UTIL_ERROR_INVALID_PARAMETER);
    EINA_SAFETY_ON_NULL_RETURN_VAL(level, EFL_UTIL_ERROR_INVALID_PARAMETER);
 
-#if X11
-   Ecore_X_Window_Type window_type;
-   Utilx_Notification_Level utilx_level;
-   Ecore_X_Window xwin;
-
-   res = _x11_init();
-   EINA_SAFETY_ON_FALSE_RETURN_VAL(res, EFL_UTIL_ERROR_INVALID_PARAMETER);
-
-   xwin = elm_win_xwindow_get(window);
-   if (xwin)
-     {
-        if (ecore_x_netwm_window_type_get(xwin, &window_type) == EINA_TRUE)
-          {
-             // success to get window type
-             if (window_type != ECORE_X_WINDOW_TYPE_NOTIFICATION)
-               {
-                  // given EFL window's type is not notification type.
-                  return EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE;
-               }
-
-             utilx_level = utilx_get_system_notification_level(_eflutil.x11.dpy, xwin);
-             if (utilx_level == UTILX_NOTIFICATION_LEVEL_LOW)
-               *level = EFL_UTIL_NOTIFICATION_LEVEL_1;
-             else if(utilx_level == UTILX_NOTIFICATION_LEVEL_NORMAL)
-               *level = EFL_UTIL_NOTIFICATION_LEVEL_2;
-             else if(utilx_level == UTILX_NOTIFICATION_LEVEL_HIGH)
-               *level = EFL_UTIL_NOTIFICATION_LEVEL_3;
-             else
-               return EFL_UTIL_ERROR_INVALID_PARAMETER;
-          }
-        else
-          return EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE;
-
-        return EFL_UTIL_ERROR_NONE;
-     }
-
-   return EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE;
-#endif /* end of X11 */
-
-#if WAYLAND
    Elm_Win_Type type;
    Ecore_Wl_Window *wlwin;
    struct wl_surface *surface;
@@ -832,7 +961,6 @@ efl_util_get_notification_window_level(Evas_Object *window,
      *level = EFL_UTIL_NOTIFICATION_LEVEL_DEFAULT;
 
    return EFL_UTIL_ERROR_NONE;
-#endif /* end of WAYLAND */
 }
 
 API int
@@ -840,6 +968,9 @@ efl_util_set_notification_window_level_error_cb(Evas_Object *window,
                                                 efl_util_notification_window_level_error_cb callback,
                                                 void *user_data)
 {
+   dlog_print(DLOG_WARN, LOG_TAG,
+     "DEPRECATION WARNING: efl_util_set_notification_window_level_error_cb() is deprecated and will be removed from next release. Use the return value of efl_util_set_notification_window_level() instead.");
+
    Eina_Bool ret = EINA_FALSE;
 
    EINA_SAFETY_ON_NULL_RETURN_VAL(window, EFL_UTIL_ERROR_INVALID_PARAMETER);
@@ -851,17 +982,15 @@ efl_util_set_notification_window_level_error_cb(Evas_Object *window,
                       CBH_NOTI_LEV);
    if (!ret) return EFL_UTIL_ERROR_OUT_OF_MEMORY;
 
-#if X11
-   if (!_eflutil.cb_handler[CBH_NOTI_LEV].atom)
-     _eflutil.cb_handler[CBH_NOTI_LEV].atom = ecore_x_atom_get("_E_NOTIFICATION_LEVEL_ACCESS_RESULT");
-#endif /* end of X11 */
-
    return EFL_UTIL_ERROR_NONE;
 }
 
 API int
 efl_util_unset_notification_window_level_error_cb(Evas_Object *window)
 {
+   dlog_print(DLOG_WARN, LOG_TAG,
+     "DEPRECATION WARNING: efl_util_unset_notification_window_level_error_cb() is deprecated and will be removed from next release. Use the return value of efl_util_set_notification_window_level() instead.");
+
    Eina_Bool ret = EINA_FALSE;
 
    EINA_SAFETY_ON_NULL_RETURN_VAL(window, EFL_UTIL_ERROR_INVALID_PARAMETER);
@@ -882,33 +1011,6 @@ efl_util_set_window_opaque_state(Evas_Object *window,
    EINA_SAFETY_ON_FALSE_RETURN_VAL(((opaque >= 0) && (opaque <= 1)),
                                    EFL_UTIL_ERROR_INVALID_PARAMETER);
 
-#if X11
-   Ecore_X_Window xwin;
-   Utilx_Opaque_State state;
-   int ret;
-
-   res = _x11_init();
-   EINA_SAFETY_ON_FALSE_RETURN_VAL(res, EFL_UTIL_ERROR_INVALID_PARAMETER);
-
-   xwin = elm_win_xwindow_get(window);
-   EINA_SAFETY_ON_FALSE_RETURN_VAL(xwin > 0, EFL_UTIL_ERROR_INVALID_PARAMETER);
-
-   if (opaque)
-     state = UTILX_OPAQUE_STATE_ON;
-   else
-     state = UTILX_OPAQUE_STATE_OFF;
-
-   ret = utilx_set_window_opaque_state(_eflutil.x11.dpy,
-                                       xwin,
-                                       state);
-
-   if (!ret)
-     return EFL_UTIL_ERROR_INVALID_PARAMETER;
-   else
-     return EFL_UTIL_ERROR_NONE;
-#endif /* end of X11 */
-
-#if WAYLAND
    Ecore_Wl_Window *wlwin;
    struct wl_surface *surface;
 
@@ -936,7 +1038,6 @@ efl_util_set_window_opaque_state(Evas_Object *window,
    tizen_policy_set_opaque_state(_eflutil.wl.policy.proto, surface, opaque);
 
    return EFL_UTIL_ERROR_NONE;
-#endif /* end of WAYLAND */
 }
 
 API int
@@ -948,39 +1049,6 @@ efl_util_set_window_screen_mode(Evas_Object *window,
                                     (mode <= EFL_UTIL_SCREEN_MODE_ALWAYS_ON)),
                                    EFL_UTIL_ERROR_INVALID_PARAMETER);
 
-#if X11
-   Evas *e;
-   Ecore_Evas *ee;
-   int id;
-
-   e = evas_object_evas_get(window);
-   EINA_SAFETY_ON_NULL_RETURN_VAL(e, EFL_UTIL_ERROR_INVALID_PARAMETER);
-
-   ee = ecore_evas_ecore_evas_get(e);
-   EINA_SAFETY_ON_NULL_RETURN_VAL(ee, EFL_UTIL_ERROR_INVALID_PARAMETER);
-
-   id = ecore_evas_aux_hint_id_get(ee, "wm.policy.win.lcd.lock");
-   if (mode == EFL_UTIL_SCREEN_MODE_ALWAYS_ON)
-     {
-        if (id == -1)
-          ecore_evas_aux_hint_add(ee, "wm.policy.win.lcd.lock", "1");
-        else
-          ecore_evas_aux_hint_val_set(ee, id, "1");
-     }
-   else if (mode == EFL_UTIL_SCREEN_MODE_DEFAULT)
-     {
-        if (id == -1)
-          ecore_evas_aux_hint_add(ee, "wm.policy.win.lcd.lock", "0");
-        else
-          ecore_evas_aux_hint_val_set(ee, id, "0");
-     }
-   else
-     return EFL_UTIL_ERROR_INVALID_PARAMETER;
-
-   return EFL_UTIL_ERROR_NONE;
-#endif /* end of X11 */
-
-#if WAYLAND
    Ecore_Wl_Window *wlwin;
    struct wl_surface *surface;
    Efl_Util_Wl_Surface_Scr_Mode_Info *scr_mode_info;
@@ -1050,7 +1118,6 @@ efl_util_set_window_screen_mode(Evas_Object *window,
      }
    else
      return EFL_UTIL_ERROR_INVALID_PARAMETER;
-#endif /* end of WAYLAND */
 }
 
 API int
@@ -1060,33 +1127,6 @@ 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);
 
-#if X11
-   Evas *e;
-   Ecore_Evas *ee;
-   const char *str;
-   int id;
-
-   e = evas_object_evas_get(window);
-   EINA_SAFETY_ON_NULL_RETURN_VAL(e, EFL_UTIL_ERROR_INVALID_PARAMETER);
-
-   ee = ecore_evas_ecore_evas_get(e);
-   EINA_SAFETY_ON_NULL_RETURN_VAL(ee, EFL_UTIL_ERROR_INVALID_PARAMETER);
-
-   id = ecore_evas_aux_hint_id_get(ee, "wm.policy.win.lcd.lock");
-   EINA_SAFETY_ON_TRUE_RETURN_VAL((id == -1), EFL_UTIL_ERROR_INVALID_PARAMETER);
-
-   str = ecore_evas_aux_hint_val_get(ee, id);
-   EINA_SAFETY_ON_NULL_RETURN_VAL(str, EFL_UTIL_ERROR_INVALID_PARAMETER);
-
-   if (strncmp(str, "1", strlen("1")) == 0)
-     *mode = EFL_UTIL_SCREEN_MODE_ALWAYS_ON;
-   else
-     *mode = EFL_UTIL_SCREEN_MODE_DEFAULT;
-
-   return EFL_UTIL_ERROR_NONE;
-#endif /* end of X11 */
-
-#if WAYLAND
    Ecore_Wl_Window *wlwin;
    struct wl_surface *surface;
    Efl_Util_Wl_Surface_Scr_Mode_Info *scr_mode_info;
@@ -1134,7 +1174,6 @@ efl_util_get_window_screen_mode(Evas_Object *window,
      }
    else
      return EFL_UTIL_ERROR_INVALID_PARAMETER;
-#endif /* end of WAYLAND */
 }
 
 API int
@@ -1142,6 +1181,13 @@ efl_util_set_window_screen_mode_error_cb(Evas_Object *window,
                                          efl_util_window_screen_mode_error_cb callback,
                                          void *user_data)
 {
+   /* Wearable device cannot use this. */
+   if (get_tizen_profile() == TIZEN_PROFILE_WEARABLE)
+     return EFL_UTIL_ERROR_NO_SUCH_DEVICE;
+
+   dlog_print(DLOG_WARN, LOG_TAG,
+     "DEPRECATION WARNING: efl_util_set_window_screen_mode_error_cb() is deprecated and will be removed from next release. Use the return value of efl_util_set_window_screen_mode() instead.");
+
    Eina_Bool ret = EINA_FALSE;
 
    EINA_SAFETY_ON_NULL_RETURN_VAL(window, EFL_UTIL_ERROR_INVALID_PARAMETER);
@@ -1153,17 +1199,19 @@ efl_util_set_window_screen_mode_error_cb(Evas_Object *window,
                       CBH_SCR_MODE);
    if (!ret) return EFL_UTIL_ERROR_OUT_OF_MEMORY;
 
-#if X11
-   if (!_eflutil.cb_handler[CBH_SCR_MODE].atom)
-     _eflutil.cb_handler[CBH_SCR_MODE].atom = ecore_x_atom_get("_E_SCREEN_MODE_ACCESS_RESULT");
-#endif /* end of X11 */
-
    return EFL_UTIL_ERROR_NONE;
 }
 
 API int
 efl_util_unset_window_screen_mode_error_cb(Evas_Object *window)
 {
+   /* Wearable device cannot use this. */
+   if (get_tizen_profile() == TIZEN_PROFILE_WEARABLE)
+     return EFL_UTIL_ERROR_NO_SUCH_DEVICE;
+
+   dlog_print(DLOG_WARN, LOG_TAG,
+     "DEPRECATION WARNING: efl_util_unset_window_screen_mode_error_cb() is deprecated and will be removed from next release. Use the return value of efl_util_set_window_screen_mode() instead.");
+
    Eina_Bool ret = EINA_FALSE;
 
    EINA_SAFETY_ON_NULL_RETURN_VAL(window, EFL_UTIL_ERROR_INVALID_PARAMETER);
@@ -1175,329 +1223,575 @@ efl_util_unset_window_screen_mode_error_cb(Evas_Object *window)
 }
 
 API int
-efl_util_input_initialize_generator(efl_util_input_device_type_e dev_type)
+efl_util_set_window_brightness(Evas_Object *window, int brightness)
 {
-   return EFL_UTIL_ERROR_NONE;
-}
+   Ecore_Wl_Window *wlwin;
+   struct wl_surface *surface;
+   Efl_Util_Wl_Surface_Brightness_Info *brightness_info;
+   Eina_Bool res;
 
-API void
-efl_util_input_deinitialize_generator(void)
-{
-   return;
-}
+   EINA_SAFETY_ON_NULL_RETURN_VAL(window, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(brightness <= 100, EFL_UTIL_ERROR_INVALID_PARAMETER);
+
+   res = _wl_init();
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(res, EFL_UTIL_ERROR_INVALID_PARAMETER);
+
+   wlwin = 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);
+        EINA_SAFETY_ON_NULL_RETURN_VAL(surface,
+                                       EFL_UTIL_ERROR_INVALID_PARAMETER);
+
+        brightness_info = eina_hash_find(_eflutil.wl.display_policy.hash_brightness, &surface);
+        if (!brightness_info)
+          {
+             brightness_info = calloc(1, sizeof(Efl_Util_Wl_Surface_Brightness_Info));
+             EINA_SAFETY_ON_NULL_RETURN_VAL(brightness_info, EFL_UTIL_ERROR_OUT_OF_MEMORY);
+
+             brightness_info->surface = surface;
+             brightness_info->brightness = brightness;
+             brightness_info->wait_for_done = EINA_TRUE;
+             brightness_info->state = TIZEN_DISPLAY_POLICY_ERROR_STATE_NONE;
+
+             eina_hash_add(_eflutil.wl.display_policy.hash_brightness,
+                           &surface,
+                           brightness_info);
+           }
+         else
+           {
+              brightness_info->brightness = brightness;
+              brightness_info->wait_for_done = EINA_TRUE;
+              brightness_info->state = TIZEN_DISPLAY_POLICY_ERROR_STATE_NONE;
+           }
+
+         tizen_display_policy_set_window_brightness(_eflutil.wl.display_policy.proto,
+                                                    surface, brightness);
+         if (brightness_info->wait_for_done)
+           {
+              int count = 0;
+              while (brightness_info->wait_for_done && (count < 3))
+                {
+                   ecore_wl_flush();
+                   wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+                   count++;
+                }
+
+              if (brightness_info->wait_for_done)
+                {
+                   return EFL_UTIL_ERROR_INVALID_PARAMETER;
+                }
+              else
+                {
+                   if (brightness_info->state == TIZEN_DISPLAY_POLICY_ERROR_STATE_PERMISSION_DENIED)
+                     {
+                        return EFL_UTIL_ERROR_PERMISSION_DENIED;
+                     }
+                }
+           }
+        return EFL_UTIL_ERROR_NONE;
+     }
+   else
+     return EFL_UTIL_ERROR_INVALID_PARAMETER;
+}
 
 API int
-efl_util_input_generate_key(const char *key_name,
-                            int pressed)
+efl_util_get_window_brightness(Evas_Object *window, int *brightness)
 {
+   Ecore_Wl_Window *wlwin;
+   struct wl_surface *surface;
+   Efl_Util_Wl_Surface_Brightness_Info *brightness_info;
+   Eina_Bool res;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(window, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(brightness, EFL_UTIL_ERROR_INVALID_PARAMETER);
+
+   res = _wl_init();
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(res, EFL_UTIL_ERROR_INVALID_PARAMETER);
+
+   wlwin = 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);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(surface,
+                                  EFL_UTIL_ERROR_INVALID_PARAMETER);
+
+   brightness_info = eina_hash_find(_eflutil.wl.display_policy.hash_brightness, &surface);
+   if (brightness_info)
+     {
+        if (brightness_info->wait_for_done)
+          {
+             while (brightness_info->wait_for_done)
+               {
+                  ecore_wl_flush();
+                  wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+               }
+          }
+         *brightness = brightness_info->brightness;
+     }
+   else
+     *brightness = -1;
+
    return EFL_UTIL_ERROR_NONE;
 }
 
-API int
-efl_util_input_generate_touch(int idx,
-                              efl_util_input_touch_type_e touch_type,
-                              int x,
-                              int y)
+
+struct _efl_util_inputgen_h
 {
-   return EFL_UTIL_ERROR_NONE;
+   unsigned int init_type;
+   char name[32];
+};
+
+static void
+_cb_device_add(void *data EINA_UNUSED,
+               struct tizen_input_device_manager *tizen_input_device_manager EINA_UNUSED,
+               uint32_t serial EINA_UNUSED,
+               const char *identifier EINA_UNUSED,
+               struct tizen_input_device *device EINA_UNUSED,
+               struct wl_seat *seat EINA_UNUSED)
+{
+   ;
 }
 
-struct _efl_util_screenshot_h
+/* LCOV_EXCL_START */
+static void
+_cb_device_remove(void *data EINA_UNUSED,
+               struct tizen_input_device_manager *tizen_input_device_manager EINA_UNUSED,
+               uint32_t serial  EINA_UNUSED,
+               const char *identifier  EINA_UNUSED,
+               struct tizen_input_device *device  EINA_UNUSED,
+               struct wl_seat *seat  EINA_UNUSED)
 {
-   int width;
-   int height;
+   ;
+}
+/* LCOV_EXCL_STOP */
 
-#if X11
-   Ecore_X_Display *dpy;
-   int internal_display;
-   int screen;
-   Window root;
-   Pixmap pixmap;
-   GC gc;
-   Atom atom_capture;
-
-   /* port */
-   int port;
-
-   /* damage */
-   Damage   damage;
-   int      damage_base;
-
-   /* dri2 */
-   int eventBase, errorBase;
-   int dri2Major, dri2Minor;
-   char *driver_name, *device_name;
-   drm_magic_t magic;
-
-   /* drm */
-   int drm_fd;
-#endif
+static void
+_cb_error(void *data EINA_UNUSED,
+          struct tizen_input_device_manager *tizen_input_device_manager EINA_UNUSED,
+          uint32_t errorcode)
+{
+   _eflutil.wl.devmgr.request_notified = errorcode;
+}
 
-   Eina_Bool shot_done;
+/* LCOV_EXCL_START */
+static void
+_cb_block_expired(void *data EINA_UNUSED,
+                  struct tizen_input_device_manager *tizen_input_device_manager EINA_UNUSED)
+{
+   ;
+}
+/* LCOV_EXCL_STOP */
 
-   /* tbm bufmgr */
-   tbm_bufmgr bufmgr;
-};
+static efl_util_error_e
+_efl_util_input_convert_input_generator_error(int ret)
+{
+   switch (ret)
+     {
+        case TIZEN_INPUT_DEVICE_MANAGER_ERROR_NONE:
+           return EFL_UTIL_ERROR_NONE;
+        case TIZEN_INPUT_DEVICE_MANAGER_ERROR_NO_PERMISSION:
+           return EFL_UTIL_ERROR_PERMISSION_DENIED;
+        case TIZEN_INPUT_DEVICE_MANAGER_ERROR_NO_SYSTEM_RESOURCES:
+           return EFL_UTIL_ERROR_OUT_OF_MEMORY;
+        case TIZEN_INPUT_DEVICE_MANAGER_ERROR_INVALID_PARAMETER:
+           return EFL_UTIL_ERROR_INVALID_PARAMETER;
+        default :
+           return EFL_UTIL_ERROR_NONE;
+     }
+}
 
-/* scrrenshot handle */
-static efl_util_screenshot_h g_screenshot;
+API efl_util_inputgen_h
+efl_util_input_initialize_generator(unsigned int dev_type)
+{
+   int ret = EFL_UTIL_ERROR_NONE;
+   efl_util_inputgen_h inputgen_h = NULL;
+   unsigned int clas = 0x0;
+
+   if (!dev_type ||
+        dev_type & ~(EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN
+                    | EFL_UTIL_INPUT_DEVTYPE_KEYBOARD
+                    | EFL_UTIL_INPUT_DEVTYPE_POINTER))
+     {
+        set_last_result(EFL_UTIL_ERROR_NO_SUCH_DEVICE);
+        goto out;
+     }
 
-#if X11
-#define FOURCC(a,b,c,d) (((unsigned)d&0xff)<<24 | ((unsigned)c&0xff)<<16 | ((unsigned)b&0xff)<<8 | ((unsigned)a&0xff))
-#define FOURCC_RGB32    FOURCC('R','G','B','4')
-#define TIMEOUT_CAPTURE 3
+   inputgen_h = (efl_util_inputgen_h)calloc(1, sizeof(struct _efl_util_inputgen_h));
+   if (!inputgen_h)
+     {
+        set_last_result(EFL_UTIL_ERROR_OUT_OF_MEMORY);
+        goto out;
+     }
 
-/* x error handling */
-static Bool g_efl_util_x_error_caught;
+   inputgen_h->init_type |= dev_type;
 
-static int
-_efl_util_screenshot_x_error_handle(Display *dpy, XErrorEvent *ev)
-{
-   if (!g_screenshot || (dpy != g_screenshot->dpy))
-     return 0;
+   ret = _wl_init();
+   if (ret == (int)EINA_FALSE)
+     {
+        set_last_result(EFL_UTIL_ERROR_INVALID_PARAMETER);
+        goto out;
+     }
+
+   if (dev_type & EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN)
+     clas |= TIZEN_INPUT_DEVICE_MANAGER_CLAS_TOUCHSCREEN;
+   if (dev_type & EFL_UTIL_INPUT_DEVTYPE_KEYBOARD)
+     clas |= TIZEN_INPUT_DEVICE_MANAGER_CLAS_KEYBOARD;
+   if (dev_type & EFL_UTIL_INPUT_DEVTYPE_POINTER)
+     clas |= TIZEN_INPUT_DEVICE_MANAGER_CLAS_MOUSE;
+
+   while (!_eflutil.wl.devmgr.devicemgr)
+     wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+
+   tizen_input_device_manager_init_generator(_eflutil.wl.devmgr.devicemgr, clas);
+
+   while (_eflutil.wl.devmgr.request_notified == -1)
+     wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+
+   ret = _efl_util_input_convert_input_generator_error(_eflutil.wl.devmgr.request_notified);
+   _eflutil.wl.devmgr.request_notified = -1;
+
+   set_last_result(ret);
+   if (ret != TIZEN_INPUT_DEVICE_MANAGER_ERROR_NONE)
+     goto out;
 
-   g_efl_util_x_error_caught = True;
+   return inputgen_h;
 
-   return 0;
+out:
+   if (inputgen_h)
+     {
+        free(inputgen_h);
+        inputgen_h = NULL;
+     }
+   return NULL;
 }
 
-static int
-_efl_util_screenshot_get_port(Display *dpy, unsigned int id, Window win)
+API efl_util_inputgen_h
+efl_util_input_initialize_generator_with_name(unsigned int dev_type, const char *name)
 {
-   unsigned int ver, rev, req_base, evt_base, err_base;
-   unsigned int adaptors;
-   XvAdaptorInfo *ai = NULL;
-   XvImageFormatValues *fo = NULL;
-   int formats;
-   int i, j, p;
-
-   if (XvQueryExtension(dpy, &ver, &rev, &req_base, &evt_base, &err_base) != Success)
+   int ret = EFL_UTIL_ERROR_NONE;
+   efl_util_inputgen_h inputgen_h = NULL;
+   unsigned int clas = 0x0;
+
+   if (!dev_type ||
+        dev_type & ~(EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN
+                    | EFL_UTIL_INPUT_DEVTYPE_KEYBOARD
+                    | EFL_UTIL_INPUT_DEVTYPE_POINTER))
      {
-        fprintf(stderr, "[screenshot] fail: no XV extension. \n");
-        return -1;
+        set_last_result(EFL_UTIL_ERROR_NO_SUCH_DEVICE);
+        goto out;
      }
 
-   if (XvQueryAdaptors(dpy, win, &adaptors, &ai) != Success)
+   inputgen_h = (efl_util_inputgen_h)calloc(1, sizeof(struct _efl_util_inputgen_h));
+   if (!inputgen_h)
      {
-        fprintf(stderr, "[screenshot] fail: query adaptors. \n");
-        return -1;
+        set_last_result(EFL_UTIL_ERROR_OUT_OF_MEMORY);
+        goto out;
      }
 
-   EINA_SAFETY_ON_NULL_RETURN_VAL(ai, -1);
+   inputgen_h->init_type |= dev_type;
+   strncpy(inputgen_h->name, name, 31);
 
-   for (i = 0; i < adaptors; i++)
+   ret = _wl_init();
+   if (ret == (int)EINA_FALSE)
      {
-        int support_format = False;
+        set_last_result(EFL_UTIL_ERROR_INVALID_PARAMETER);
+        goto out;
+     }
+
+   if (dev_type & EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN)
+     clas |= TIZEN_INPUT_DEVICE_MANAGER_CLAS_TOUCHSCREEN;
+   if (dev_type & EFL_UTIL_INPUT_DEVTYPE_KEYBOARD)
+     clas |= TIZEN_INPUT_DEVICE_MANAGER_CLAS_KEYBOARD;
+   if (dev_type & EFL_UTIL_INPUT_DEVTYPE_POINTER)
+     clas |= TIZEN_INPUT_DEVICE_MANAGER_CLAS_MOUSE;
 
-        if (!(ai[i].type & XvInputMask) ||
-            !(ai[i].type & XvStillMask))
-          continue;
+   while (!_eflutil.wl.devmgr.devicemgr)
+     wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
 
-        p = ai[i].base_id;
+   tizen_input_device_manager_init_generator_with_name(_eflutil.wl.devmgr.devicemgr, clas, inputgen_h->name);
 
-        fo = XvListImageFormats(dpy, p, &formats);
-        for (j = 0; j < formats; j++)
-          if (fo[j].id == (int)id)
-            support_format = True;
+   while (_eflutil.wl.devmgr.request_notified == -1)
+     wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
 
-        if (fo)
-          XFree(fo);
+   ret = _efl_util_input_convert_input_generator_error(_eflutil.wl.devmgr.request_notified);
+   _eflutil.wl.devmgr.request_notified = -1;
 
-        if (!support_format)
-          continue;
+   set_last_result(ret);
+   if (ret != TIZEN_INPUT_DEVICE_MANAGER_ERROR_NONE)
+     goto out;
 
-        for (; p < ai[i].base_id + ai[i].num_ports; p++)
-          {
-             if (XvGrabPort(dpy, p, 0) == Success)
-               {
-                  XvFreeAdaptorInfo(ai);
-                  return p;
-               }
-          }
+   return inputgen_h;
+
+out:
+   if (inputgen_h)
+     {
+        free(inputgen_h);
+        inputgen_h = NULL;
      }
+   return NULL;
+}
+
+
+API int
+efl_util_input_deinitialize_generator(efl_util_inputgen_h inputgen_h)
+{
+   int ret = EFL_UTIL_ERROR_NONE;
+   unsigned int clas = 0x0;
+   EINA_SAFETY_ON_NULL_RETURN_VAL(inputgen_h, EFL_UTIL_ERROR_INVALID_PARAMETER);
+
+   if (inputgen_h->init_type & EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN)
+     clas |= TIZEN_INPUT_DEVICE_MANAGER_CLAS_TOUCHSCREEN;
+   if (inputgen_h->init_type & EFL_UTIL_INPUT_DEVTYPE_KEYBOARD)
+     clas |= TIZEN_INPUT_DEVICE_MANAGER_CLAS_KEYBOARD;
+   if (inputgen_h->init_type & EFL_UTIL_INPUT_DEVTYPE_POINTER)
+     clas |= TIZEN_INPUT_DEVICE_MANAGER_CLAS_MOUSE;
+
+   free(inputgen_h);
+   inputgen_h = NULL;
 
-   XvFreeAdaptorInfo(ai);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(_eflutil.wl.devmgr.devicemgr, EFL_UTIL_ERROR_INVALID_PARAMETER);
 
-   XSync(dpy, False);
+   tizen_input_device_manager_deinit_generator(_eflutil.wl.devmgr.devicemgr, clas);
 
-   return -1;
+   while (_eflutil.wl.devmgr.request_notified == -1)
+     wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+
+   ret = _efl_util_input_convert_input_generator_error(_eflutil.wl.devmgr.request_notified);
+   _eflutil.wl.devmgr.request_notified = -1;
+
+   return ret;
 }
 
-static int _efl_util_screenshot_get_best_size(Display *dpy, int port, int width, int height, unsigned int *best_width, unsigned int *best_height)
+API int
+efl_util_input_generate_key(efl_util_inputgen_h inputgen_h, const char *key_name, int pressed)
 {
-   XErrorHandler old_handler = NULL;
+   int ret = EFL_UTIL_ERROR_NONE;
 
-   Atom atom_capture = XInternAtom(dpy, "_USER_WM_PORT_ATTRIBUTE_CAPTURE", False);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(inputgen_h, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(key_name, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(pressed == 0 || pressed == 1, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(inputgen_h->init_type & EFL_UTIL_INPUT_DEVTYPE_KEYBOARD, EFL_UTIL_ERROR_NO_SUCH_DEVICE);
 
-   g_efl_util_x_error_caught = False;
-   old_handler = XSetErrorHandler(_efl_util_screenshot_x_error_handle);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(_eflutil.wl.devmgr.devicemgr, EFL_UTIL_ERROR_INVALID_PARAMETER);
 
-   XvSetPortAttribute(dpy, port, atom_capture, 1);
-   XSync(dpy, False);
+   tizen_input_device_manager_generate_key(_eflutil.wl.devmgr.devicemgr, key_name, pressed);
 
-   g_efl_util_x_error_caught = False;
-   XSetErrorHandler(old_handler);
+   while (_eflutil.wl.devmgr.request_notified == -1)
+     wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
 
-   XvQueryBestSize(dpy, port, 0, 0, 0, width, height, best_width, best_height);
-   if (best_width <= 0 || best_height <= 0)
-     return 0;
+   ret = _efl_util_input_convert_input_generator_error(_eflutil.wl.devmgr.request_notified);
+   _eflutil.wl.devmgr.request_notified = -1;
 
-   return 1;
+   return ret;
 }
-#endif
 
-API efl_util_screenshot_h efl_util_screenshot_initialize(int width, int height)
+API int
+efl_util_input_generate_touch(efl_util_inputgen_h inputgen_h, int idx,
+                              efl_util_input_touch_type_e touch_type, int x, int y)
 {
-#if X11
-   efl_util_screenshot_h screenshot = NULL;
-   int depth = 0;
-   int damage_err_base = 0;
-   unsigned int best_width = 0;
-   unsigned int best_height = 0;
+   int ret;
+   enum tizen_input_device_manager_pointer_event_type type;
 
-   EINA_SAFETY_ON_FALSE_GOTO(width > 0, fail_param);
-   EINA_SAFETY_ON_FALSE_GOTO(height > 0, fail_param);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(inputgen_h, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(idx >= 0, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_FALSE_RETURN_VAL((x > 0 && y > 0), EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(inputgen_h->init_type & EFL_UTIL_INPUT_DEVTYPE_TOUCHSCREEN, EFL_UTIL_ERROR_NO_SUCH_DEVICE);
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(_eflutil.wl.devmgr.devicemgr, EFL_UTIL_ERROR_INVALID_PARAMETER);
 
-   if (g_screenshot != NULL)
+   switch(touch_type)
      {
-        if (g_screenshot->width != width || g_screenshot->height != height)
-          {
-             // TODO: recreate pixmap and update information
-             if (!_efl_util_screenshot_get_best_size(screenshot->dpy, screenshot->port, width, height, &best_width, &best_height))
-               {
-                  set_last_result(EFL_UTIL_ERROR_SCREENSHOT_INIT_FAIL);
-                  return NULL;
-               }
+        case EFL_UTIL_INPUT_TOUCH_BEGIN:
+           type = TIZEN_INPUT_DEVICE_MANAGER_POINTER_EVENT_TYPE_BEGIN;
+           break;
+        case EFL_UTIL_INPUT_TOUCH_UPDATE:
+           type = TIZEN_INPUT_DEVICE_MANAGER_POINTER_EVENT_TYPE_UPDATE;
+           break;
+        case EFL_UTIL_INPUT_TOUCH_END:
+           type = TIZEN_INPUT_DEVICE_MANAGER_POINTER_EVENT_TYPE_END;
+           break;
+        default:
+           return EFL_UTIL_ERROR_INVALID_PARAMETER;
+     }
 
-             g_screenshot->width = width;
-             g_screenshot->height = height;
-          }
+   tizen_input_device_manager_generate_touch(_eflutil.wl.devmgr.devicemgr, type, x, y, idx);
 
-        return g_screenshot;
-     }
+   while (_eflutil.wl.devmgr.request_notified == -1)
+     wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
 
-   screenshot = calloc(1, sizeof(struct _efl_util_screenshot_h));
-   EINA_SAFETY_ON_NULL_GOTO(screenshot, fail_memory);
+   ret = _efl_util_input_convert_input_generator_error(_eflutil.wl.devmgr.request_notified);
+   _eflutil.wl.devmgr.request_notified = -1;
 
-   /* set dpy */
-   screenshot->dpy = ecore_x_display_get();
-   if (!screenshot->dpy)
-     {
-        screenshot->dpy = XOpenDisplay(0);
-        EINA_SAFETY_ON_NULL_GOTO(screenshot, fail_init);
+   return ret;
+}
 
-        /* for XCloseDisplay at denitialization */
-        screenshot->internal_display = 1;
-     }
+API int
+efl_util_input_generate_pointer(efl_util_inputgen_h inputgen_h, int buttons, efl_util_input_pointer_type_e pointer_type, int x, int y)
+{
+   int ret;
+   enum tizen_input_device_manager_pointer_event_type type;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(inputgen_h, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(buttons > 0, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_FALSE_RETURN_VAL((x >= 0 && y >= 0), EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(inputgen_h->init_type & EFL_UTIL_INPUT_DEVTYPE_POINTER, EFL_UTIL_ERROR_NO_SUCH_DEVICE);
 
-   /* set screen */
-   screenshot->screen = DefaultScreen(screenshot->dpy);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(_eflutil.wl.devmgr.devicemgr, EFL_UTIL_ERROR_INVALID_PARAMETER);
 
-   /* set root window */
-   screenshot->root = DefaultRootWindow(screenshot->dpy);
+   switch(pointer_type)
+     {
+        case EFL_UTIL_INPUT_POINTER_BUTTON_DOWN:
+           type = TIZEN_INPUT_DEVICE_MANAGER_POINTER_EVENT_TYPE_BEGIN;
+           break;
+        case EFL_UTIL_INPUT_POINTER_MOVE:
+           type = TIZEN_INPUT_DEVICE_MANAGER_POINTER_EVENT_TYPE_UPDATE;
+           break;
+        case EFL_UTIL_INPUT_POINTER_BUTTON_UP:
+           type = TIZEN_INPUT_DEVICE_MANAGER_POINTER_EVENT_TYPE_END;
+           break;
+        default:
+           return EFL_UTIL_ERROR_INVALID_PARAMETER;
+     }
 
-   /* initialize capture adaptor */
-   screenshot->port = _efl_util_screenshot_get_port(screenshot->dpy, FOURCC_RGB32, screenshot->root);
-   EINA_SAFETY_ON_FALSE_GOTO(screenshot->port > 0, fail_init);
+   tizen_input_device_manager_generate_pointer(_eflutil.wl.devmgr.devicemgr, type, x, y, buttons);
+
+   while (_eflutil.wl.devmgr.request_notified == -1)
+     wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
 
-   /* get the best size */
-   _efl_util_screenshot_get_best_size(screenshot->dpy, screenshot->port, width, height, &best_width, &best_height);
-   EINA_SAFETY_ON_FALSE_GOTO(best_width > 0, fail_init);
-   EINA_SAFETY_ON_FALSE_GOTO(best_height > 0, fail_init);
+   ret = _efl_util_input_convert_input_generator_error(_eflutil.wl.devmgr.request_notified);
+   _eflutil.wl.devmgr.request_notified = -1;
 
-   /* set the width and the height */
-   screenshot->width = best_width;
-   screenshot->height = best_height;
+   return ret;
+}
 
-   /* create a pixmap */
-   depth = DefaultDepth(screenshot->dpy, screenshot->screen);
-   screenshot->pixmap = XCreatePixmap(screenshot->dpy, screenshot->root, screenshot->width, screenshot->height, depth);
-   EINA_SAFETY_ON_FALSE_GOTO(screenshot->pixmap > 0, fail_init);
 
-   screenshot->gc = XCreateGC(screenshot->dpy, screenshot->pixmap, 0, 0);
-   EINA_SAFETY_ON_NULL_GOTO(screenshot->gc, fail_init);
+struct _efl_util_screenshot_h
+{
+   int width;
+   int height;
 
-   XSetForeground(screenshot->dpy, screenshot->gc, 0xFF000000);
-   XFillRectangle(screenshot->dpy, screenshot->pixmap, screenshot->gc, 0, 0, width, height);
+   Eina_Bool shot_done;
 
-   /* initialize damage */
-   if (!XDamageQueryExtension(screenshot->dpy, &screenshot->damage_base, &damage_err_base))
-     goto fail_init;
+   /* tbm bufmgr */
+   tbm_bufmgr bufmgr;
 
-   screenshot->damage = XDamageCreate(screenshot->dpy, screenshot->pixmap, XDamageReportNonEmpty);
-   EINA_SAFETY_ON_FALSE_GOTO(screenshot->damage > 0, fail_init);
+   Eina_Bool auto_rotation;
+};
 
-   /* initialize dri3 and dri2 */
-   if (!DRI2QueryExtension(screenshot->dpy, &screenshot->eventBase, &screenshot->errorBase))
-     {
-        fprintf(stderr, "[screenshot] fail: DRI2QueryExtention\n");
-        goto fail_init;
-     }
+/* scrrenshot handle */
+static efl_util_screenshot_h g_screenshot;
+static Eina_Bool shot_mutex_init;
+static pthread_mutex_t shot_lock;
 
-   if (!DRI2QueryVersion(screenshot->dpy, &screenshot->dri2Major, &screenshot->dri2Minor))
-     {
-        fprintf(stderr, "[screenshot] fail: DRI2QueryVersion\n");
-        goto fail_init;
-     }
+static Eina_Bool
+_screenshot_mutex_init(void)
+{
+   if (shot_mutex_init)
+     return EINA_TRUE;
 
-   if (!DRI2Connect(screenshot->dpy, screenshot->root, &screenshot->driver_name, &screenshot->device_name))
+   if (pthread_mutex_init(&shot_lock, NULL))
      {
-        fprintf(stderr, "[screenshot] fail: DRI2Connect\n");
-        goto fail_init;
+        fprintf(stderr, "[screenshot] fail: mutex init"); /*LCOV_EXCL_LINE*/
+        return EINA_FALSE; /*LCOV_EXCL_LINE*/
      }
 
-   screenshot->drm_fd = open(screenshot->device_name, O_RDWR);
-   EINA_SAFETY_ON_FALSE_GOTO(screenshot->drm_fd >= 0, fail_init);
+   shot_mutex_init = EINA_TRUE;
 
-   if (drmGetMagic(screenshot->drm_fd, &screenshot->magic))
-     {
-        fprintf(stderr, "[screenshot] fail: drmGetMagic\n");
-        goto fail_init;
-     }
+   return EINA_TRUE;
+}
 
-   if (!DRI2Authenticate(screenshot->dpy, screenshot->root, screenshot->magic))
-     {
-        fprintf(stderr, "[screenshot] fail: DRI2Authenticate\n");
-        goto fail_init;
-     }
+static Eina_Bool
+_screenshot_mutex_destory(void)
+{
+   if (!shot_mutex_init)
+     return EINA_TRUE;
 
-   if (!drmAuthMagic(screenshot->drm_fd, screenshot->magic))
+   if (pthread_mutex_destroy(&shot_lock))
      {
-        fprintf(stderr, "[screenshot] fail: drmAuthMagic\n");
-        goto fail_init;
+        fprintf(stderr, "[screenshot] fail: mutex destory"); /*LCOV_EXCL_LINE*/
+        return EINA_FALSE; /*LCOV_EXCL_LINE*/
      }
 
-   DRI2CreateDrawable(screenshot->dpy, screenshot->pixmap);
+   shot_mutex_init = EINA_FALSE;
 
-   /* tbm bufmgr */
-   screenshot->bufmgr = tbm_bufmgr_init(screenshot->drm_fd);
-   EINA_SAFETY_ON_NULL_GOTO(screenshot->bufmgr, fail_init);
+   return EINA_TRUE;
+}
 
-   XFlush(screenshot->dpy);
+void
+_screenshot_mutex_lock(void)
+{
+   if (!_screenshot_mutex_init())
+     return;
 
-   g_screenshot = screenshot;
-   set_last_result(EFL_UTIL_ERROR_NONE);
+   pthread_mutex_lock(&shot_lock);
+}
 
-   return g_screenshot;
-#endif
+void
+_screenshot_mutex_unlock(void)
+{
+   pthread_mutex_unlock(&shot_lock);
+}
 
-#if WAYLAND
+API efl_util_screenshot_h
+efl_util_screenshot_initialize(int width, int height)
+{
    efl_util_screenshot_h screenshot = NULL;
+   struct wl_display *display_wrapper = NULL;
+   struct wl_registry *reg = NULL;
+   int ret = 0;
+
+   EINA_SAFETY_ON_FALSE_GOTO(width > 0, fail_param);
+   EINA_SAFETY_ON_FALSE_GOTO(height > 0, fail_param);
+
+   _screenshot_mutex_lock();
 
    if (!_eflutil.wl.shot.screenshooter)
      {
-        int ret = 0;
-        _wl_init();
-        while (!_eflutil.wl.shot.screenshooter && ret != -1)
-          ret = wl_display_roundtrip_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+        ret = _wl_init();
+        if (ret == (int)EINA_FALSE)
+          {
+             set_last_result(EFL_UTIL_ERROR_INVALID_PARAMETER);
+             _screenshot_mutex_unlock();
+             return NULL;
+          }
+        wl_display_roundtrip_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+
+        display_wrapper = wl_proxy_create_wrapper(_eflutil.wl.dpy);
+        EINA_SAFETY_ON_NULL_GOTO(display_wrapper, fail_memory);
+
+        _eflutil.wl.shot.queue = wl_display_create_queue(_eflutil.wl.dpy);
+        EINA_SAFETY_ON_NULL_GOTO(_eflutil.wl.shot.queue, fail_memory);
+
+        wl_proxy_set_queue((struct wl_proxy *)display_wrapper, _eflutil.wl.shot.queue);
+
+        reg = wl_display_get_registry(display_wrapper);
+        wl_proxy_wrapper_destroy(display_wrapper);
+        display_wrapper = NULL;
+        EINA_SAFETY_ON_NULL_GOTO(reg, fail_init);
+
+        wl_registry_add_listener(reg, &_wl_reg_screenshooter_listener, NULL);
+
+        ret = wl_display_roundtrip_queue(_eflutil.wl.dpy, _eflutil.wl.shot.queue);
+        EINA_SAFETY_ON_TRUE_GOTO(ret == -1, fail_init);
         EINA_SAFETY_ON_NULL_GOTO(_eflutil.wl.shot.screenshooter, fail_init);
+        EINA_SAFETY_ON_NULL_GOTO(_eflutil.wl.shot.tz_screenshooter, fail_init);
 
-       _eflutil.wl.shot.tbm_client = wayland_tbm_client_init(_eflutil.wl.dpy);
-       EINA_SAFETY_ON_NULL_GOTO(_eflutil.wl.shot.tbm_client, fail_init);
+        _eflutil.wl.shot.tbm_client = wayland_tbm_client_init(_eflutil.wl.dpy);
+        EINA_SAFETY_ON_NULL_GOTO(_eflutil.wl.shot.tbm_client, fail_init);
      }
 
-   EINA_SAFETY_ON_FALSE_GOTO(width > 0, fail_param);
-   EINA_SAFETY_ON_FALSE_GOTO(height > 0, fail_param);
+   if (_eflutil.wl.shot.noti == 0)
+     {
+        fprintf(stderr, "[screenshot] fail: privilege error\n"); /* LCOV_EXCL_LINE */
+        goto fail_init;
+     }
 
    if (g_screenshot)
      {
@@ -1507,6 +1801,8 @@ API efl_util_screenshot_h efl_util_screenshot_initialize(int width, int height)
              g_screenshot->height = height;
           }
 
+        _screenshot_mutex_unlock();
+
         return g_screenshot;
      }
 
@@ -1515,6 +1811,7 @@ API efl_util_screenshot_h efl_util_screenshot_initialize(int width, int height)
 
    screenshot->width = width;
    screenshot->height = height;
+   screenshot->auto_rotation = EINA_TRUE;
 
    screenshot->bufmgr = wayland_tbm_client_get_bufmgr(_eflutil.wl.shot.tbm_client);
    EINA_SAFETY_ON_NULL_GOTO(screenshot->bufmgr, fail_init);
@@ -1524,286 +1821,1109 @@ API efl_util_screenshot_h efl_util_screenshot_initialize(int width, int height)
 
    screenshooter_set_user_data(_eflutil.wl.shot.screenshooter, &screenshot->shot_done);
 
+   _screenshot_mutex_unlock();
+
    return g_screenshot;
-#endif
+
 fail_param:
-   if (screenshot)
-     efl_util_screenshot_deinitialize(screenshot);
    set_last_result(EFL_UTIL_ERROR_INVALID_PARAMETER);
    return NULL;
 fail_memory:
-   if (screenshot)
-     efl_util_screenshot_deinitialize(screenshot);
+/* LCOV_EXCL_START */
+   if (display_wrapper)
+     wl_proxy_wrapper_destroy(display_wrapper);
    set_last_result(EFL_UTIL_ERROR_OUT_OF_MEMORY);
    return NULL;
 fail_init:
    if (screenshot)
      efl_util_screenshot_deinitialize(screenshot);
+   _screenshot_mutex_unlock();
    set_last_result(EFL_UTIL_ERROR_SCREENSHOT_INIT_FAIL);
    return NULL;
+/* LCOV_EXCL_STOP */
 }
 
-API int efl_util_screenshot_deinitialize(efl_util_screenshot_h screenshot)
+API int
+efl_util_screenshot_deinitialize(efl_util_screenshot_h screenshot)
 {
-#if X11
-   if (!screenshot)
-     return EFL_UTIL_ERROR_INVALID_PARAMETER;
+   _screenshot_mutex_lock();
 
-   /* tbm bufmgr */
-   if (screenshot->bufmgr)
-     tbm_bufmgr_deinit(screenshot->bufmgr);
+   if (!screenshot)
+     {
+        _screenshot_mutex_unlock();
+        _screenshot_mutex_destory();
+        return EFL_UTIL_ERROR_INVALID_PARAMETER;
+     }
 
-   DRI2DestroyDrawable(screenshot->dpy, screenshot->pixmap);
+   free(screenshot);
+   g_screenshot = NULL;
 
-   /* dri2 */
-   if (screenshot->drm_fd)
-     close(screenshot->drm_fd);
-   if (screenshot->driver_name)
-     free(screenshot->driver_name);
-   if (screenshot->device_name)
-     free(screenshot->device_name);
+   if (_eflutil.wl.shot.queue)
+     {
+        wl_event_queue_destroy(_eflutil.wl.shot.queue);
+        _eflutil.wl.shot.queue = NULL;
+     }
 
-   /* xv */
-   if (screenshot->port > 0 && screenshot->pixmap > 0)
-     XvStopVideo(screenshot->dpy, screenshot->port, screenshot->pixmap);
+   if (_eflutil.wl.shot.screenshooter)
+     {
+        screenshooter_destroy(_eflutil.wl.shot.screenshooter);
+        _eflutil.wl.shot.screenshooter = NULL;
+     }
+   if (_eflutil.wl.shot.tz_screenshooter)
+     {
+        tizen_screenshooter_destroy(_eflutil.wl.shot.tz_screenshooter);
+        _eflutil.wl.shot.tz_screenshooter = NULL;
+     }
 
-   /* damage */
-   if (screenshot->damage)
-     XDamageDestroy(screenshot->dpy, screenshot->damage);
+   _screenshot_mutex_unlock();
+   _screenshot_mutex_destory();
 
-   /* gc */
-   if (screenshot->gc)
-     XFreeGC(screenshot->dpy, screenshot->gc);
+   return EFL_UTIL_ERROR_NONE;
+}
 
-   /* pixmap */
-   if (screenshot->pixmap > 0)
-     XFreePixmap(screenshot->dpy, screenshot->pixmap);
 
-   /* port */
-   if (screenshot->port > 0)
-     XvUngrabPort(screenshot->dpy, screenshot->port, 0);
+API tbm_surface_h
+efl_util_screenshot_take_tbm_surface(efl_util_screenshot_h screenshot)
+{
+   tbm_surface_h t_surface = NULL;
+   struct wl_buffer *buffer = NULL;
+   Efl_Util_Wl_Output_Info *output;
+   int ret = 0;
 
-   XSync(screenshot->dpy, False);
+   _screenshot_mutex_lock();
 
-   /* dpy */
-   if (screenshot->internal_display ==1 && screenshot->dpy)
-     XCloseDisplay(screenshot->dpy);
+   if (!screenshot || (screenshot != g_screenshot))
+     {
+        set_last_result(EFL_UTIL_ERROR_INVALID_PARAMETER);
+        _screenshot_mutex_unlock();
+        return NULL;
+     }
 
-   free(screenshot);
-   g_screenshot = NULL;
+   output = eina_list_nth(_eflutil.wl.shot.output_list, 0);
+   if (!output)
+     {
+        fprintf(stderr, "[screenshot] fail: no output for screenshot\n"); /* LCOV_EXCL_LINE */
+        goto fail;
+     }
+
+   t_surface = tbm_surface_create(screenshot->width, screenshot->height, TBM_FORMAT_XRGB8888);
+   if (!t_surface)
+     {
+        fprintf(stderr, "[screenshot] fail: tbm_surface_create\n"); /* LCOV_EXCL_LINE */
+        goto fail;
+     }
+
+   buffer = wayland_tbm_client_create_buffer(_eflutil.wl.shot.tbm_client, t_surface);
+   if (!buffer)
+     {
+        fprintf(stderr, "[screenshot] fail: create wl_buffer for screenshot\n"); /* LCOV_EXCL_LINE */
+        goto fail;
+     }
+
+   screenshooter_shoot(_eflutil.wl.shot.screenshooter, output->output, buffer);
+
+   screenshot->shot_done = EINA_FALSE;
+   while (!screenshot->shot_done && ret != -1)
+     ret = wl_display_roundtrip_queue(_eflutil.wl.dpy, _eflutil.wl.shot.queue);
+
+   if (ret == -1)
+     {
+        fprintf(stderr, "[screenshot] fail: screenshooter_shoot\n"); /* LCOV_EXCL_LINE */
+        goto fail;
+     }
+
+   wl_buffer_destroy(buffer);
+
+   /* reset shot_done for next screenshot */
+   screenshot->shot_done = EINA_FALSE;
+
+   set_last_result(EFL_UTIL_ERROR_NONE);
+
+   _screenshot_mutex_unlock();
+
+   return t_surface;
+
+fail:
+   if (t_surface)
+     tbm_surface_destroy(t_surface);
+   if (buffer)
+     wl_buffer_destroy(buffer);
+
+   set_last_result(EFL_UTIL_ERROR_SCREENSHOT_EXECUTION_FAIL);
+
+   _screenshot_mutex_unlock();
+
+   return NULL;
+}
+
+/* LCOV_EXCL_START */
+API int
+efl_util_screenshot_set_auto_rotation(efl_util_screenshot_h screenshot, int set)
+{
+   if (!screenshot || (screenshot != g_screenshot))
+     return EFL_UTIL_ERROR_INVALID_PARAMETER;
+
+   if (!(set == 0 || set == 1))
+     return EFL_UTIL_ERROR_INVALID_PARAMETER;
+
+   if (set)
+     g_screenshot->auto_rotation = EINA_TRUE;
+   else
+     g_screenshot->auto_rotation = EINA_FALSE;
+
+   tizen_screenshooter_set_oneshot_auto_rotation(_eflutil.wl.shot.tz_screenshooter, g_screenshot->auto_rotation);
 
    return EFL_UTIL_ERROR_NONE;
-#endif
-#if WAYLAND
-   if (!screenshot)
-     return EFL_UTIL_ERROR_NONE;
+}
 
-   free(screenshot);
-   g_screenshot = NULL;
+API int
+efl_util_screenshot_get_auto_rotation(efl_util_screenshot_h screenshot, int *set)
+{
+   if (!screenshot || (screenshot != g_screenshot) || !set)
+     return EFL_UTIL_ERROR_INVALID_PARAMETER;
 
-   if (_eflutil.wl.shot.screenshooter)
-     screenshooter_set_user_data(_eflutil.wl.shot.screenshooter, NULL);
+   *set = g_screenshot->auto_rotation;
 
    return EFL_UTIL_ERROR_NONE;
-#endif
 }
+/* LCOV_EXCL_STOP */
+
+struct _efl_util_gesture_h
+{
+   Eina_Bool init;
+};
 
+API int EFL_UTIL_EVENT_GESTURE_EDGE_SWIPE = 0;
+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;
 
-API tbm_surface_h efl_util_screenshot_take_tbm_surface(efl_util_screenshot_h screenshot)
+/* 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)
 {
-#if X11
-   XEvent ev = {0,};
-   XErrorHandler old_handler = NULL;
-   unsigned int attachment = DRI2BufferFrontLeft;
-   int nbufs = 0;
-   DRI2Buffer *bufs = NULL;
-   tbm_bo t_bo = NULL;
-   tbm_surface_h t_surface = NULL;
-   int buf_width = 0;
-   int buf_height = 0;
-   tbm_surface_info_s surf_info;
-   int i;
+   _eflutil.wl.gesture.request_notified = error;
+}
+
+static void
+_cb_gesture_edge_swipe(void *data EINA_UNUSED, struct tizen_gesture *tizen_gesture EINA_UNUSED, uint32_t mode, uint32_t fingers, int sx, int sy, uint32_t edge)
+{
+   efl_util_event_gesture_edge_swipe_s *ev = NULL;
+
+   ev = (efl_util_event_gesture_edge_swipe_s *)calloc(1, sizeof(*ev));
+   if (!ev) return;
+
+   ev->mode = mode;
+
+   ev->fingers = fingers;
+   ev->sx = sx;
+   ev->sy = sy;
+   ev->edge = edge;
+
+   ecore_event_add(EFL_UTIL_EVENT_GESTURE_EDGE_SWIPE, ev, NULL, NULL);
+}
+
+static void
+_cb_gesture_edge_drag_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)
+{
+   _eflutil.wl.gesture.request_notified = error;
+}
+
+static void
+_cb_gesture_edge_drag(void *data EINA_UNUSED, struct tizen_gesture *tizen_gesture EINA_UNUSED, uint32_t mode, uint32_t fingers, int cx, int cy, uint32_t edge)
+{
+   efl_util_event_gesture_edge_drag_s *ev = NULL;
+
+   ev = (efl_util_event_gesture_edge_drag_s *)calloc(1, sizeof(*ev));
+   if (!ev) return;
+
+   ev->mode = mode;
+
+   ev->fingers = fingers;
+   ev->cx = cx;
+   ev->cy = cy;
+   ev->edge = edge;
+
+   ecore_event_add(EFL_UTIL_EVENT_GESTURE_EDGE_DRAG, ev, NULL, NULL);
+}
+
+static void
+_cb_gesture_tap_notify(void *data EINA_UNUSED, struct tizen_gesture *tizen_gesture EINA_UNUSED, uint32_t fingers EINA_UNUSED, uint32_t repeat EINA_UNUSED, uint32_t error)
+{
+   _eflutil.wl.gesture.request_notified = error;
+}
+
+static void
+_cb_gesture_tap(void *data EINA_UNUSED, struct tizen_gesture *tizen_gesture EINA_UNUSED, uint32_t mode, uint32_t fingers, uint32_t repeats)
+{
+   efl_util_event_gesture_tap_s *ev = NULL;
+
+   ev = (efl_util_event_gesture_tap_s *)calloc(1, sizeof(*ev));
+   if (!ev) return;
+
+   ev->mode = mode;
+
+   ev->fingers = fingers;
+   ev->repeats = repeats;
+
+   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)
+{
+   _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)
+{
+   efl_util_event_gesture_palm_cover_s *ev = NULL;
+
+   ev = (efl_util_event_gesture_palm_cover_s *)calloc(1, sizeof(*ev));
+   if (!ev) return;
+
+   ev->mode = mode;
+
+   ev->duration = duration;
+   ev->cx = cx;
+   ev->cy = cy;
+   ev->size = size;
+   ev->pressure = wl_fixed_to_int(pressure);
+
+   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)
+{
+   _eflutil.wl.gesture.request_notified = error;
+}
+
+static efl_util_error_e
+_efl_util_gesture_convert_error(int ret)
+{
+   switch (ret)
+     {
+        case TIZEN_GESTURE_ERROR_NONE:
+           return EFL_UTIL_ERROR_NONE;
+        case TIZEN_GESTURE_ERROR_INVALID_DATA:
+           return EFL_UTIL_ERROR_INVALID_PARAMETER;
+        case TIZEN_GESTURE_ERROR_NO_PERMISSION:
+           return EFL_UTIL_ERROR_PERMISSION_DENIED;
+        case TIZEN_GESTURE_ERROR_NO_SYSTEM_RESOURCES:
+           return EFL_UTIL_ERROR_OUT_OF_MEMORY;
+        case TIZEN_GESTURE_ERROR_GRABBED_ALREADY:
+           return EFL_UTIL_ERROR_NO_RESOURCE_AVAILABLE;
+        case TIZEN_GESTURE_ERROR_NOT_SUPPORTED:
+           return EFL_UTIL_ERROR_NOT_SUPPORTED;
+        default :
+           return EFL_UTIL_ERROR_NONE;
+     }
+}
+
+/* LCOV_EXCL_START */
+static int
+_efl_util_gesture_grab_edge_swipe(efl_util_gesture_data data)
+{
+   int ret = EFL_UTIL_ERROR_NONE;
+   Efl_Util_Gesture_Common_Grab_Data *base_data = NULL;
+   Efl_Util_Gesture_Edge_Swipe_Grab_Data *edge_swipe_data = NULL;
+   unsigned int fingers = 0;
+   unsigned int edge = 0;
+   unsigned int edge_size = 0;
+   unsigned int start_point = 0;
+   unsigned int end_point = 0;
+
+   base_data = (Efl_Util_Gesture_Common_Grab_Data *)data;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(_eflutil.wl.gesture.proto, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(base_data, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(base_data->type == TIZEN_GESTURE_TYPE_EDGE_SWIPE,
+                                  EFL_UTIL_ERROR_INVALID_PARAMETER);
+
+   edge_swipe_data = (Efl_Util_Gesture_Edge_Swipe_Grab_Data *)data;
+
+   fingers = edge_swipe_data->fingers;
+   edge = edge_swipe_data->edge;
+   edge_size = edge_swipe_data->edge_size;
+   start_point = edge_swipe_data->start_point;
+   end_point = edge_swipe_data->end_point;
+
+   tizen_gesture_grab_edge_swipe(_eflutil.wl.gesture.proto, fingers, edge, edge_size, start_point, end_point);
+
+   while (_eflutil.wl.gesture.request_notified == -1)
+     wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+
+   ret = _efl_util_gesture_convert_error(_eflutil.wl.gesture.request_notified);
+   _eflutil.wl.gesture.request_notified = -1;
+
+   return ret;
+}
+
+static int
+_efl_util_gesture_ungrab_edge_swipe(efl_util_gesture_data data)
+{
+   int ret = EFL_UTIL_ERROR_NONE;
+   Efl_Util_Gesture_Common_Grab_Data *base_data = NULL;
+   Efl_Util_Gesture_Edge_Swipe_Grab_Data *edge_swipe_data = NULL;
+   unsigned int fingers = 0;
+   unsigned int edge = 0;
+   unsigned int edge_size = 0;
+   unsigned int start_point = 0;
+   unsigned int end_point = 0;
+
+   base_data = (Efl_Util_Gesture_Common_Grab_Data *)data;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(_eflutil.wl.gesture.proto, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(base_data, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(base_data->type == TIZEN_GESTURE_TYPE_EDGE_SWIPE,
+                                  EFL_UTIL_ERROR_INVALID_PARAMETER);
+
+   edge_swipe_data = (Efl_Util_Gesture_Edge_Swipe_Grab_Data *)data;
+
+   fingers = edge_swipe_data->fingers;
+   edge = edge_swipe_data->edge;
+   edge_size = edge_swipe_data->edge_size;
+   start_point = edge_swipe_data->start_point;
+   end_point = edge_swipe_data->end_point;
+
+   tizen_gesture_ungrab_edge_swipe(_eflutil.wl.gesture.proto, fingers, edge, edge_size, start_point, end_point);
+
+   while (_eflutil.wl.gesture.request_notified == -1)
+     wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+
+   ret = _efl_util_gesture_convert_error(_eflutil.wl.gesture.request_notified);
+   _eflutil.wl.gesture.request_notified = -1;
+
+   return ret;
+}
+
+static int
+_efl_util_gesture_grab_edge_drag(efl_util_gesture_data data)
+{
+   int ret = EFL_UTIL_ERROR_NONE;
+   Efl_Util_Gesture_Common_Grab_Data *base_data = NULL;
+   Efl_Util_Gesture_Edge_Drag_Grab_Data *edge_drag_data = NULL;
+   unsigned int fingers = 0;
+   unsigned int edge = 0;
+   unsigned int edge_size = 0;
+   unsigned int start_point = 0;
+   unsigned int end_point = 0;
+
+   base_data = (Efl_Util_Gesture_Common_Grab_Data *)data;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(_eflutil.wl.gesture.proto, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(base_data, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(base_data->type == TIZEN_GESTURE_TYPE_EDGE_DRAG,
+                                  EFL_UTIL_ERROR_INVALID_PARAMETER);
+
+   edge_drag_data = (Efl_Util_Gesture_Edge_Drag_Grab_Data *)data;
+
+   fingers = edge_drag_data->fingers;
+   edge = edge_drag_data->edge;
+   edge_size = edge_drag_data->edge_size;
+   start_point = edge_drag_data->start_point;
+   end_point = edge_drag_data->end_point;
+
+   tizen_gesture_grab_edge_drag(_eflutil.wl.gesture.proto, fingers, edge, edge_size, start_point, end_point);
+
+   while (_eflutil.wl.gesture.request_notified == -1)
+     wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+
+   ret = _efl_util_gesture_convert_error(_eflutil.wl.gesture.request_notified);
+   _eflutil.wl.gesture.request_notified = -1;
+
+   return ret;
+}
+
+static int
+_efl_util_gesture_ungrab_edge_drag(efl_util_gesture_data data)
+{
+   int ret = EFL_UTIL_ERROR_NONE;
+   Efl_Util_Gesture_Common_Grab_Data *base_data = NULL;
+   Efl_Util_Gesture_Edge_Drag_Grab_Data *edge_drag_data = NULL;
+   unsigned int fingers = 0;
+   unsigned int edge = 0;
+   unsigned int edge_size = 0;
+   unsigned int start_point = 0;
+   unsigned int end_point = 0;
+
+   base_data = (Efl_Util_Gesture_Common_Grab_Data *)data;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(_eflutil.wl.gesture.proto, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(base_data, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(base_data->type == TIZEN_GESTURE_TYPE_EDGE_DRAG,
+                                  EFL_UTIL_ERROR_INVALID_PARAMETER);
+
+   edge_drag_data = (Efl_Util_Gesture_Edge_Drag_Grab_Data *)data;
+
+   fingers = edge_drag_data->fingers;
+   edge = edge_drag_data->edge;
+   edge_size = edge_drag_data->edge_size;
+   start_point = edge_drag_data->start_point;
+   end_point = edge_drag_data->end_point;
+
+   tizen_gesture_ungrab_edge_drag(_eflutil.wl.gesture.proto, fingers, edge, edge_size, start_point, end_point);
+
+   while (_eflutil.wl.gesture.request_notified == -1)
+     wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+
+   ret = _efl_util_gesture_convert_error(_eflutil.wl.gesture.request_notified);
+   _eflutil.wl.gesture.request_notified = -1;
+
+   return ret;
+}
+
+
+static int
+_efl_util_gesture_grab_tap(efl_util_gesture_data data)
+{
+   int ret = EFL_UTIL_ERROR_NONE;
+   Efl_Util_Gesture_Common_Grab_Data *base_data = NULL;
+   Efl_Util_Gesture_Tap_Grab_Data *tap_data = NULL;
+   unsigned int fingers = 0;
+   unsigned int repeats = 0;
+
+   base_data = (Efl_Util_Gesture_Common_Grab_Data *)data;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(_eflutil.wl.gesture.proto, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(base_data, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(base_data->type == TIZEN_GESTURE_TYPE_TAP,
+                                  EFL_UTIL_ERROR_INVALID_PARAMETER);
+
+   tap_data = (Efl_Util_Gesture_Tap_Grab_Data *)data;
+
+   fingers = tap_data->fingers;
+   repeats = tap_data->repeats;
+
+   tizen_gesture_grab_tap(_eflutil.wl.gesture.proto, fingers, repeats);
+
+   while (_eflutil.wl.gesture.request_notified == -1)
+     wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+
+   ret = _efl_util_gesture_convert_error(_eflutil.wl.gesture.request_notified);
+   _eflutil.wl.gesture.request_notified = -1;
+
+   return ret;
+}
+
+static int
+_efl_util_gesture_ungrab_tap(efl_util_gesture_data data)
+{
+   int ret = EFL_UTIL_ERROR_NONE;
+   Efl_Util_Gesture_Common_Grab_Data *base_data = NULL;
+   Efl_Util_Gesture_Tap_Grab_Data *tap_data = NULL;
+   unsigned int fingers = 0;
+   unsigned int repeats = 0;
+
+   base_data = (Efl_Util_Gesture_Common_Grab_Data *)data;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(_eflutil.wl.gesture.proto, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(base_data, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(base_data->type == TIZEN_GESTURE_TYPE_TAP,
+                                  EFL_UTIL_ERROR_INVALID_PARAMETER);
+
+   tap_data = (Efl_Util_Gesture_Tap_Grab_Data *)data;
+
+   fingers = tap_data->fingers;
+   repeats = tap_data->repeats;
+
+   tizen_gesture_ungrab_tap(_eflutil.wl.gesture.proto, fingers, repeats);
+
+   while (_eflutil.wl.gesture.request_notified == -1)
+     wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+
+   ret = _efl_util_gesture_convert_error(_eflutil.wl.gesture.request_notified);
+   _eflutil.wl.gesture.request_notified = -1;
+
+   return ret;
+}
+
+static int
+_efl_util_gesture_grab_palm_cover(efl_util_gesture_data data)
+{
+   int ret = EFL_UTIL_ERROR_NONE;
+   Efl_Util_Gesture_Common_Grab_Data *base_data = NULL;
+
+   base_data = (Efl_Util_Gesture_Common_Grab_Data *)data;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(_eflutil.wl.gesture.proto, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(base_data, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(base_data->type == TIZEN_GESTURE_TYPE_PALM_COVER,
+                                  EFL_UTIL_ERROR_INVALID_PARAMETER);
+
+   tizen_gesture_grab_palm_cover(_eflutil.wl.gesture.proto);
+
+   while (_eflutil.wl.gesture.request_notified == -1)
+     wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+
+   ret = _efl_util_gesture_convert_error(_eflutil.wl.gesture.request_notified);
+   _eflutil.wl.gesture.request_notified = -1;
+
+   return ret;
+}
+
+static int
+_efl_util_gesture_ungrab_palm_cover(efl_util_gesture_data data)
+{
+   int ret = EFL_UTIL_ERROR_NONE;
+   Efl_Util_Gesture_Common_Grab_Data *base_data = NULL;
+
+   base_data = (Efl_Util_Gesture_Common_Grab_Data *)data;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(_eflutil.wl.gesture.proto, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(base_data, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(base_data->type == TIZEN_GESTURE_TYPE_PALM_COVER,
+                                  EFL_UTIL_ERROR_INVALID_PARAMETER);
+
+   tizen_gesture_ungrab_palm_cover(_eflutil.wl.gesture.proto);
+
+   while (_eflutil.wl.gesture.request_notified == -1)
+     wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+
+   ret = _efl_util_gesture_convert_error(_eflutil.wl.gesture.request_notified);
+   _eflutil.wl.gesture.request_notified = -1;
+
+   return ret;
+}
+
+static Eina_Bool
+_efl_util_fd_cb(void *data, Ecore_Fd_Handler *hdl)
+{
+   if (_eflutil.wl.dpy && _eflutil.wl.queue)
+     {
+        wl_display_roundtrip_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+        return ECORE_CALLBACK_RENEW;
+     }
+   else
+     {
+        return ECORE_CALLBACK_CANCEL;
+     }
+}
+/* LCOV_EXCL_STOP */
+
+API efl_util_gesture_h
+efl_util_gesture_initialize(void)
+{
+   efl_util_gesture_h gesture_h = NULL;
+   int dpy_fd = -1;
+
+   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); /* LCOV_EXCL_LINE */
+        goto out; /* LCOV_EXCL_LINE */
+     }
+
+   if (_wl_init() == (int)EINA_FALSE)
+     {
+        set_last_result(EFL_UTIL_ERROR_NOT_SUPPORTED); /* LCOV_EXCL_LINE */
+        goto out; /* LCOV_EXCL_LINE */
+     }
 
-   if (screenshot != g_screenshot)
+   while (!_eflutil.wl.gesture.proto)
+     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); /* 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();
+        EFL_UTIL_EVENT_GESTURE_TAP = ecore_event_type_new();
+        EFL_UTIL_EVENT_GESTURE_PALM_COVER = ecore_event_type_new();
+
+        dpy_fd = wl_display_get_fd(_eflutil.wl.dpy);
+        _eflutil.wl.dpy_fd = fcntl(dpy_fd, F_DUPFD_CLOEXEC, 0);
+        if (_eflutil.wl.dpy_fd >= 0)
+          _eflutil.wl.fd_hdl = ecore_main_fd_handler_add(_eflutil.wl.dpy_fd,
+                                 ECORE_FD_READ | ECORE_FD_WRITE | ECORE_FD_ERROR,
+                                 _efl_util_fd_cb, NULL,
+                                 NULL, NULL);
+     }
+   _eflutil.wl.gesture.event_init++;
+   gesture_h->init = EINA_TRUE;
+
+   set_last_result(EFL_UTIL_ERROR_NONE);
+   return gesture_h;
+
+out:
+/* LCOV_EXCL_START */
+   if (gesture_h)
+     {
+        free(gesture_h);
+        gesture_h = NULL;
+     }
+   return gesture_h;
+/* LCOV_EXCL_STOP */
+}
+
+API int
+efl_util_gesture_deinitialize(efl_util_gesture_h gesture_h)
+{
+   EINA_SAFETY_ON_NULL_RETURN_VAL(gesture_h, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(gesture_h->init, EFL_UTIL_ERROR_INVALID_PARAMETER);
+
+   free(gesture_h);
+   gesture_h = NULL;
+
+   _eflutil.wl.gesture.event_init--;
+
+   if (_eflutil.wl.gesture.event_init <= 0)
+     {
+        _eflutil.wl.gesture.event_init = 0;
+        ecore_event_shutdown();
+        EFL_UTIL_EVENT_GESTURE_EDGE_SWIPE = 0;
+        EFL_UTIL_EVENT_GESTURE_EDGE_DRAG = 0;
+        EFL_UTIL_EVENT_GESTURE_TAP = 0;
+        EFL_UTIL_EVENT_GESTURE_PALM_COVER = 0;
+        if (_eflutil.wl.dpy_fd >= 0)
+          {
+             ecore_main_fd_handler_del(_eflutil.wl.fd_hdl);
+             _eflutil.wl.fd_hdl = NULL;
+             close(_eflutil.wl.dpy_fd);
+             _eflutil.wl.dpy_fd = -1;
+          }
+     }
+
+   return EFL_UTIL_ERROR_NONE;
+}
+
+API efl_util_gesture_data
+efl_util_gesture_edge_swipe_new(efl_util_gesture_h gesture_h, unsigned int fingers, efl_util_gesture_edge_e edge)
+{
+   Efl_Util_Gesture_Edge_Swipe_Grab_Data *data;
+
+   if (!gesture_h || gesture_h->init == EINA_FALSE)
+     {
+        set_last_result(EFL_UTIL_ERROR_INVALID_PARAMETER);
+        return NULL;
+     }
+
+   if (edge <= EFL_UTIL_GESTURE_EDGE_NONE || edge > EFL_UTIL_GESTURE_EDGE_LEFT)
      {
         set_last_result(EFL_UTIL_ERROR_INVALID_PARAMETER);
         return NULL;
      }
 
-   /* for flush other pending requests and pending events */
-   XSync(screenshot->dpy, 0);
+   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); /* LCOV_EXCL_LINE */
+        return NULL; /* LCOV_EXCL_LINE */
+     }
 
-   g_efl_util_x_error_caught = False;
-   old_handler = XSetErrorHandler(_efl_util_screenshot_x_error_handle);
+   data->base.type = TIZEN_GESTURE_TYPE_EDGE_SWIPE;
+   data->fingers = fingers;
+   data->edge = edge;
+   data->edge_size = EFL_UTIL_GESTURE_EDGE_SIZE_FULL;
 
-   /* dump here */
-   XvPutStill(screenshot->dpy, screenshot->port, screenshot->pixmap, screenshot->gc,
-              0, 0, screenshot->width, screenshot->height,
-              0, 0, screenshot->width, screenshot->height);
+   set_last_result(EFL_UTIL_ERROR_NONE);
 
-   XSync(screenshot->dpy, 0);
+   return (void *)data;
+}
 
-   if (g_efl_util_x_error_caught)
+API int
+efl_util_gesture_edge_swipe_free(efl_util_gesture_h gesture_h, efl_util_gesture_data data)
+{
+   if (!gesture_h || gesture_h->init == EINA_FALSE)
      {
-        g_efl_util_x_error_caught = False;
-        XSetErrorHandler(old_handler);
-        goto fail;
+        return EFL_UTIL_ERROR_INVALID_PARAMETER;
      }
 
-   g_efl_util_x_error_caught = False;
-   XSetErrorHandler(old_handler);
+   if (!data)
+     {
+        return EFL_UTIL_ERROR_INVALID_PARAMETER;
+     }
 
-   if (XPending(screenshot->dpy))
-     XNextEvent(screenshot->dpy, &ev);
-   else
+   free(data);
+   data = NULL;
+
+   return EFL_UTIL_ERROR_NONE;
+}
+
+API int
+efl_util_gesture_edge_swipe_size_set(efl_util_gesture_data data, efl_util_gesture_edge_size_e edge_size, unsigned int start_point, unsigned int end_point)
+{
+   Efl_Util_Gesture_Edge_Swipe_Grab_Data *edge_swipe_data = data;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(edge_swipe_data, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(edge_swipe_data->base.type == TIZEN_GESTURE_TYPE_EDGE_SWIPE,
+                                   EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(edge_size == EFL_UTIL_GESTURE_EDGE_SIZE_PARTIAL,
+                                   EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(end_point > start_point, EFL_UTIL_ERROR_INVALID_PARAMETER);
+
+   edge_swipe_data->edge_size = edge_size;
+   edge_swipe_data->start_point = start_point;
+   edge_swipe_data->end_point = end_point;
+
+   return EFL_UTIL_ERROR_NONE;
+}
+
+API efl_util_gesture_data
+efl_util_gesture_edge_drag_new(efl_util_gesture_h gesture_h, unsigned int fingers, efl_util_gesture_edge_e edge)
+{
+   Efl_Util_Gesture_Edge_Drag_Grab_Data *data;
+
+   if (!gesture_h || gesture_h->init == EINA_FALSE)
      {
-        int fd = ConnectionNumber(screenshot->dpy);
-        fd_set mask;
-        struct timeval tv;
-        int ret;
+        set_last_result(EFL_UTIL_ERROR_INVALID_PARAMETER);
+        return NULL;
+     }
 
-        FD_ZERO(&mask);
-        FD_SET(fd, &mask);
+   if (edge <= EFL_UTIL_GESTURE_EDGE_NONE || edge > EFL_UTIL_GESTURE_EDGE_LEFT)
+     {
+        set_last_result(EFL_UTIL_ERROR_INVALID_PARAMETER);
+        return NULL;
+     }
+
+   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); /* LCOV_EXCL_LINE */
+        return NULL; /* LCOV_EXCL_LINE */
+     }
 
-        tv.tv_usec = 0;
-        tv.tv_sec = TIMEOUT_CAPTURE;
+   data->base.type = TIZEN_GESTURE_TYPE_EDGE_DRAG;
+   data->fingers = fingers;
+   data->edge = edge;
+   data->edge_size = EFL_UTIL_GESTURE_EDGE_SIZE_FULL;
 
-        ret = select(fd + 1, &mask, 0, 0, &tv);
-        if (ret < 0)
-          fprintf(stderr, "[screenshot] fail: select.\n");
-        else if (ret == 0)
-          fprintf(stderr, "[screenshot] fail: timeout(%d sec)!\n", TIMEOUT_CAPTURE);
-        else if (XPending(screenshot->dpy))
-          XNextEvent(screenshot->dpy, &ev);
-        else
-          fprintf(stderr, "[screenshot] fail: not passed a event!\n");
+   set_last_result(EFL_UTIL_ERROR_NONE);
+
+   return (void *)data;
+}
+
+API int
+efl_util_gesture_edge_drag_free(efl_util_gesture_h gesture_h, efl_util_gesture_data data)
+{
+   if (!gesture_h || gesture_h->init == EINA_FALSE)
+     {
+        return EFL_UTIL_ERROR_INVALID_PARAMETER;
      }
 
-   /* check if the capture is done by xserver and pixmap has got the captured image */
-   if (ev.type == (screenshot->damage_base + XDamageNotify))
+   if (!data)
      {
-        XDamageNotifyEvent *damage_ev = (XDamageNotifyEvent *)&ev;
-        if (damage_ev->drawable == screenshot->pixmap)
-          {
-             /* Get DRI2 FrontLeft buffer of the pixmap */
-             bufs = DRI2GetBuffers(screenshot->dpy, screenshot->pixmap, &buf_width, &buf_height, &attachment, 1, &nbufs);
-             if (!bufs)
-               {
-                  fprintf(stderr, "[screenshot] fail: DRI2GetBuffers\n");
-                  goto fail;
-               }
+        return EFL_UTIL_ERROR_INVALID_PARAMETER;
+     }
 
-             t_bo = tbm_bo_import(screenshot->bufmgr, bufs[0].name);
-             if (!t_bo)
-               {
-                  fprintf(stderr, "[screenshot] fail: import tbm_bo!\n");
-                  goto fail;
-               }
+   free(data);
+   data = NULL;
 
-             surf_info.width = buf_width;
-             surf_info.height = buf_height;
-             surf_info.format = TBM_FORMAT_XRGB8888;
-             surf_info.bpp = 32;
-             surf_info.size = bufs->pitch * surf_info.height;
-             surf_info.num_planes = 1;
-             for (i = 0; i < surf_info.num_planes; i++)
-               {
-                  surf_info.planes[i].size = bufs->pitch * surf_info.height;
-                  surf_info.planes[i].stride = bufs->pitch;
-                  surf_info.planes[i].offset = 0;
-               }
-             t_surface = tbm_surface_internal_create_with_bos(&surf_info, &t_bo, 1);
-             if (!t_surface)
-               {
-                  fprintf(stderr, "[screenshot] fail: get tbm_surface!\n");
-                  goto fail;
-               }
+   return EFL_UTIL_ERROR_NONE;
+}
 
-             tbm_bo_unref(t_bo);
-             free(bufs);
+API int
+efl_util_gesture_edge_drag_size_set(efl_util_gesture_data data, efl_util_gesture_edge_size_e edge_size, unsigned int start_point, unsigned int end_point)
+{
+   Efl_Util_Gesture_Edge_Drag_Grab_Data *edge_drag_data = data;
 
-             XDamageSubtract(screenshot->dpy, screenshot->damage, None, None );
+   EINA_SAFETY_ON_NULL_RETURN_VAL(edge_drag_data, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(edge_drag_data->base.type == TIZEN_GESTURE_TYPE_EDGE_DRAG,
+                                   EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(edge_size == EFL_UTIL_GESTURE_EDGE_SIZE_PARTIAL,
+                                   EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(end_point > start_point, EFL_UTIL_ERROR_INVALID_PARAMETER);
 
-             set_last_result(EFL_UTIL_ERROR_NONE);
+   edge_drag_data->edge_size = edge_size;
+   edge_drag_data->start_point = start_point;
+   edge_drag_data->end_point = end_point;
 
-             return t_surface;
-          }
+   return EFL_UTIL_ERROR_NONE;
+}
+
+API efl_util_gesture_data
+efl_util_gesture_tap_new(efl_util_gesture_h gesture_h, unsigned int fingers, unsigned int repeats)
+{
+   Efl_Util_Gesture_Tap_Grab_Data *data;
 
-        XDamageSubtract(screenshot->dpy, screenshot->damage, None, None );
+   if (!gesture_h || gesture_h->init == EINA_FALSE)
+     {
+        set_last_result(EFL_UTIL_ERROR_INVALID_PARAMETER);
+        return NULL;
      }
 
-fail:
+   if (fingers <= 1 || repeats <= 1)
+     {
+        set_last_result(EFL_UTIL_ERROR_NOT_SUPPORTED);
+        return NULL;
+     }
 
-   if (t_bo)
-     tbm_bo_unref(t_bo);
-   if (bufs)
-     free(bufs);
+   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); /* LCOV_EXCL_LINE */
+        return NULL; /* LCOV_EXCL_LINE */
+     }
 
-   set_last_result(EFL_UTIL_ERROR_SCREENSHOT_EXECUTION_FAIL);
+   data->base.type = TIZEN_GESTURE_TYPE_TAP;
+   data->fingers = fingers;
+   data->repeats = repeats;
 
-   return NULL;
-#endif
+   set_last_result(EFL_UTIL_ERROR_NONE);
 
-#if WAYLAND
-   tbm_surface_h t_surface = NULL;
-   struct wl_buffer *buffer = NULL;
-   Efl_Util_Wl_Output_Info *output;
-   int ret = 0;
+   return (void *)data;
+}
+
+API int
+efl_util_gesture_tap_free(efl_util_gesture_h gesture_h, efl_util_gesture_data data)
+{
+   if (!gesture_h || gesture_h->init == EINA_FALSE)
+     {
+        return EFL_UTIL_ERROR_INVALID_PARAMETER;
+     }
+
+   if (!data)
+     {
+        return EFL_UTIL_ERROR_INVALID_PARAMETER;
+     }
 
-   if (screenshot != g_screenshot)
+   free(data);
+   data = NULL;
+
+   return EFL_UTIL_ERROR_NONE;
+}
+
+API efl_util_gesture_data
+efl_util_gesture_palm_cover_new(efl_util_gesture_h gesture_h)
+{
+   Efl_Util_Gesture_Palm_Cover_Grab_Data *data;
+
+   if (!gesture_h || gesture_h->init == EINA_FALSE)
      {
         set_last_result(EFL_UTIL_ERROR_INVALID_PARAMETER);
         return NULL;
      }
 
-   output = eina_list_nth(_eflutil.wl.shot.output_list, 0);
-   if (!output)
+   data = (Efl_Util_Gesture_Palm_Cover_Grab_Data *)calloc(1, sizeof(Efl_Util_Gesture_Palm_Cover_Grab_Data));
+   if (!data)
      {
-        fprintf(stderr, "[screenshot] fail: no output for screenshot\n");
-        goto fail;
+        set_last_result(EFL_UTIL_ERROR_OUT_OF_MEMORY); /* LCOV_EXCL_LINE */
+        return NULL; /* LCOV_EXCL_LINE */
      }
 
-   t_surface = tbm_surface_create(screenshot->width, screenshot->height, TBM_FORMAT_XRGB8888);
-   if (!t_surface)
+   data->base.type = TIZEN_GESTURE_TYPE_PALM_COVER;
+
+   set_last_result(EFL_UTIL_ERROR_NONE);
+
+   return (void *)data;
+}
+
+API int
+efl_util_gesture_palm_cover_free(efl_util_gesture_h gesture_h, efl_util_gesture_data data)
+{
+   if (!gesture_h || gesture_h->init == EINA_FALSE)
      {
-        fprintf(stderr, "[screenshot] fail: tbm_surface_create\n");
-        goto fail;
+        return EFL_UTIL_ERROR_INVALID_PARAMETER;
      }
 
-   buffer = wayland_tbm_client_create_buffer(_eflutil.wl.shot.tbm_client, t_surface);
-   if (!buffer)
+   if (!data)
      {
-        fprintf(stderr, "[screenshot] fail: create wl_buffer for screenshot\n");
-        goto fail;
+        return EFL_UTIL_ERROR_INVALID_PARAMETER;
      }
 
-   screenshooter_shoot(_eflutil.wl.shot.screenshooter, output->output, buffer);
+   free(data);
+   data = NULL;
 
-   screenshot->shot_done = EINA_FALSE;
-   while (!screenshot->shot_done && ret != -1)
-     ret = wl_display_roundtrip_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+   return EFL_UTIL_ERROR_NONE;
+}
 
-   if (ret == -1)
+/* LCOV_EXCL_START */
+API int
+efl_util_gesture_grab(efl_util_gesture_h gesture_h, efl_util_gesture_data data)
+{
+   int ret = EFL_UTIL_ERROR_NONE;
+   Efl_Util_Gesture_Common_Grab_Data *base_data = NULL;
+
+   base_data = (Efl_Util_Gesture_Common_Grab_Data *)data;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(gesture_h, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(gesture_h->init, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(base_data, EFL_UTIL_ERROR_INVALID_PARAMETER);
+
+   switch (base_data->type)
      {
-        fprintf(stderr, "[screenshot] fail: screenshooter_shoot\n");
-        goto fail;
+        case TIZEN_GESTURE_TYPE_EDGE_SWIPE:
+           ret = _efl_util_gesture_grab_edge_swipe(data);
+           break;
+        case TIZEN_GESTURE_TYPE_EDGE_DRAG:
+           ret = _efl_util_gesture_grab_edge_drag(data);
+           break;
+        case TIZEN_GESTURE_TYPE_TAP:
+           ret = _efl_util_gesture_grab_tap(data);
+           break;
+        case TIZEN_GESTURE_TYPE_PALM_COVER:
+           ret = _efl_util_gesture_grab_palm_cover(data);
+           break;
+        default:
+           return EFL_UTIL_ERROR_INVALID_PARAMETER;
      }
 
-   wl_buffer_destroy(buffer);
+   return ret;
+}
 
-   /* reset shot_done for next screenshot */
-   screenshot->shot_done = EINA_FALSE;
+API int
+efl_util_gesture_ungrab(efl_util_gesture_h gesture_h, efl_util_gesture_data data)
+{
+   int ret = EFL_UTIL_ERROR_NONE;
+   Efl_Util_Gesture_Common_Grab_Data *base_data = NULL;
 
-   return t_surface;
+   base_data = (Efl_Util_Gesture_Common_Grab_Data *)data;
 
-fail:
-   if (t_surface)
-     tbm_surface_destroy(t_surface);
-   if (buffer)
-     wl_buffer_destroy(buffer);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(gesture_h, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(gesture_h->init, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(base_data, EFL_UTIL_ERROR_INVALID_PARAMETER);
 
-   set_last_result(EFL_UTIL_ERROR_SCREENSHOT_EXECUTION_FAIL);
+   switch (base_data->type)
+     {
+        case TIZEN_GESTURE_TYPE_EDGE_SWIPE:
+           ret = _efl_util_gesture_ungrab_edge_swipe(data);
+           break;
+        case TIZEN_GESTURE_TYPE_EDGE_DRAG:
+           ret = _efl_util_gesture_ungrab_edge_drag(data);
+           break;
+        case TIZEN_GESTURE_TYPE_TAP:
+           ret = _efl_util_gesture_ungrab_tap(data);
+           break;
+        case TIZEN_GESTURE_TYPE_PALM_COVER:
+           ret = _efl_util_gesture_ungrab_palm_cover(data);
+           break;
+        default:
+           return EFL_UTIL_ERROR_INVALID_PARAMETER;
+     }
 
-   return NULL;
-#endif
+   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;
+   struct wl_surface *surface;
+   int ret;
+
+   base_data = (Efl_Util_Gesture_Common_Grab_Data *)data;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(gesture_h, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(gesture_h->init, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(window, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(base_data, EFL_UTIL_ERROR_INVALID_PARAMETER);
+
+   if (base_data->type != TIZEN_GESTURE_TYPE_PALM_COVER)
+     return EFL_UTIL_ERROR_NOT_SUPPORTED;
+
+   wlwin = elm_win_wl_window_get(window);
+   if (!wlwin) return EFL_UTIL_ERROR_INVALID_PARAMETER;
+
+   surface = ecore_wl_window_surface_get(wlwin);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(surface,
+                                  EFL_UTIL_ERROR_INVALID_PARAMETER);
+
+   tizen_gesture_select_palm_cover(_eflutil.wl.gesture.proto, surface);
+
+   while (_eflutil.wl.gesture.request_notified == -1)
+     wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+
+   ret = _efl_util_gesture_convert_error(_eflutil.wl.gesture.request_notified);
+   _eflutil.wl.gesture.request_notified = -1;
+
+   return ret;
+}
+
+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;
+   struct wl_surface *surface;
+   int ret;
+
+   base_data = (Efl_Util_Gesture_Common_Grab_Data *)data;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(gesture_h, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(gesture_h->init, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(window, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(base_data, EFL_UTIL_ERROR_INVALID_PARAMETER);
+
+   if (base_data->type != TIZEN_GESTURE_TYPE_PALM_COVER)
+     return EFL_UTIL_ERROR_NOT_SUPPORTED;
+
+   wlwin = elm_win_wl_window_get(window);
+   if (!wlwin) return EFL_UTIL_ERROR_INVALID_PARAMETER;
+
+   surface = ecore_wl_window_surface_get(wlwin);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(surface,
+                                  EFL_UTIL_ERROR_INVALID_PARAMETER);
+
+   tizen_gesture_deselect_palm_cover(_eflutil.wl.gesture.proto, surface);
+
+   while (_eflutil.wl.gesture.request_notified == -1)
+     wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+
+   ret = _efl_util_gesture_convert_error(_eflutil.wl.gesture.request_notified);
+   _eflutil.wl.gesture.request_notified = -1;
+
+   return ret;
+}
+
+/* LCOV_EXCL_START */
+API int
+efl_util_gesture_activate_set(efl_util_gesture_h gesture_h, unsigned int type, Eina_Bool active)
+{
+   int ret;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(gesture_h, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(gesture_h->init, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_TRUE_RETURN_VAL(type == EFL_UTIL_GESTURE_TYPE_NONE, EFL_UTIL_ERROR_INVALID_PARAMETER);
+
+   tizen_gesture_activate_set(_eflutil.wl.gesture.proto, NULL, type, active);
+
+   while (_eflutil.wl.gesture.request_notified == -1)
+     wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+
+   ret = _efl_util_gesture_convert_error(_eflutil.wl.gesture.request_notified);
+   _eflutil.wl.gesture.request_notified = -1;
+
+   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;
+   struct wl_surface *surface;
+   int ret;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(gesture_h, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(gesture_h->init, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   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);
+   if (!wlwin) return EFL_UTIL_ERROR_INVALID_PARAMETER;
+
+   surface = ecore_wl_window_surface_get(wlwin);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(surface,
+                                  EFL_UTIL_ERROR_INVALID_PARAMETER);
+
+   tizen_gesture_activate_set(_eflutil.wl.gesture.proto, surface, type, active);
+
+   while (_eflutil.wl.gesture.request_notified == -1)
+     wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+
+   ret = _efl_util_gesture_convert_error(_eflutil.wl.gesture.request_notified);
+   _eflutil.wl.gesture.request_notified = -1;
+
+   return ret;
 }