Add listeners for tizen_input_device
[platform/core/api/efl-util.git] / src / efl_util.c
index cf8d9c6..0d977d2 100644 (file)
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <xf86drm.h>
+#include <tbm_bufmgr.h>
+#include <tbm_surface.h>
+#include <tbm_surface_internal.h>
 #include <Elementary.h>
 #include <Ecore_Evas.h>
+#include <pthread.h>
 
-#if X11
-#include <Ecore_X.h>
-#include <utilX.h>
-#endif /* end of X11 */
-
-#if WAYLAND
 #include <Ecore_Wayland.h>
 #include <wayland-client.h>
-#include "tizen_notification-client-protocol.h"
-#include "tizen_window_screen-client-protocol.h"
-#endif /* end of WAYLAND */
+#include <wayland-tbm-client.h>
+#include <tizen-extension-client-protocol.h>
+#include <screenshooter-client-protocol.h>
+
+#include <efl_util_screenshot_extension.h>
+
+#include <dlog.h>
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+
+#define LOG_TAG "TIZEN_N_EFL_UTIL"
+
 
 /* callback handler index */
 #define CBH_NOTI_LEV 0
@@ -54,6 +67,7 @@ typedef struct _Efl_Util_Wl_Surface_Lv_Info
    void *surface; /* wl_surface */
    int level;
    Eina_Bool wait_for_done;
+   uint32_t state;
 } Efl_Util_Wl_Surface_Lv_Info;
 
 typedef struct _Efl_Util_Wl_Surface_Scr_Mode_Info
@@ -61,69 +75,118 @@ typedef struct _Efl_Util_Wl_Surface_Scr_Mode_Info
    void *surface; /* wl_surface */
    unsigned int mode;
    Eina_Bool wait_for_done;
+   uint32_t state;
 } Efl_Util_Wl_Surface_Scr_Mode_Info;
 
-typedef struct _Efl_Util_Data
+typedef struct _Efl_Util_Wl_Surface_Brightness_Info
 {
-   Ecore_Event_Handler *handler; /* x11 client message handler */
-   struct
-   {
-      Eina_List *info_list; /* list of callback info */
-      unsigned int atom; /* x11 atom */
-   } cb_handler[CBH_MAX];
+   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;
 
+typedef struct _Efl_Util_Data
+{
    /* wayland related stuffs */
    struct
    {
       Eina_Bool init;
-      #if WAYLAND
+      int ref_count;
+
       struct wl_display *dpy;
+      struct wl_registry *reg;
+
+      struct wl_event_queue *queue;
+
+      struct
+      {
+         struct tizen_policy *proto;
+         Eina_Hash *hash_noti_lv;
+         Eina_Hash *hash_scr_mode;
+      } 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_notification *proto;
-         Eina_Hash *hash;
-      } noti_lv;
+         struct tizen_input_device_manager *devicemgr;
+         int request_notified;
+         Eina_List *device_list;
+      } devmgr;
       struct
       {
-         struct tizen_window_screen *proto;
-         Eina_Hash *hash;
-      } win_scr_mode;
-      #endif /* end of WAYLAND */
+         struct tizen_display_policy *proto;
+         Eina_Hash *hash_brightness;
+      } display_policy;
    } wl;
+
+   struct
+   {
+      Eina_List *info_list; /* list of callback info */
+      unsigned int atom; /* x11 atom */
+   } cb_handler[CBH_MAX];
 } Efl_Util_Data;
 
 static Efl_Util_Data _eflutil =
 {
-   NULL,
+   {
+      EINA_FALSE,
+      0,
+      NULL, NULL, NULL,
+      { NULL, NULL, NULL }, /* tizen_policy protocol */
+      { NULL, NULL, NULL, NULL, NULL, 0 }, /* screenshooter protocol */
+      { NULL, -1 } /* tizen_input_device_manager protocol */
+   },
    {
       { NULL, 0 }, /* handler for notification level */
       { NULL, 0 }  /* handler for screen mode */
    },
-   {
-      EINA_FALSE,
-      #if WAYLAND
-      NULL,
-      { NULL, NULL }, /* tizen_notification protocol */
-      { NULL, NULL }  /* tizen_window_screen protocol */
-      #endif /* end of WAYLAND */
-   }
 };
 
 static Eina_Bool               _cb_info_add(Evas_Object *win, Efl_Util_Cb cb, void *data, int idx);
 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);
-static Eina_Bool               _cb_x11_client_msg(void *data, int type, void *event);
-#endif /* end of X11 */
-#if WAYLAND
 static Eina_Bool               _wl_init(void);
+static void                    _wl_shutdown(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_noti_lv_done(void *data, struct tizen_notification *proto, struct wl_surface *surface, int32_t level, uint32_t state);
-static void                    _cb_wl_tz_win_scr_mode_done(void *data, struct tizen_window_screen *proto, struct wl_surface *surface, uint32_t mode, uint32_t state);
+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_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_device_info(void *data EINA_UNUSED, struct tizen_input_device *tizen_input_device EINA_UNUSED, const char *name EINA_UNUSED, uint32_t clas EINA_UNUSED, uint32_t subclas EINA_UNUSED, struct wl_array *axes EINA_UNUSED);
+static void                    _cb_event_device(void *data EINA_UNUSED, struct tizen_input_device *tizen_input_device EINA_UNUSED, unsigned int serial EINA_UNUSED, const char *name EINA_UNUSED, uint32_t time EINA_UNUSED);
+static void                    _cb_axis(void *data EINA_UNUSED, struct tizen_input_device *tizen_input_device EINA_UNUSED, uint32_t axis_type EINA_UNUSED, wl_fixed_t value EINA_UNUSED);
 
 static const struct wl_registry_listener _wl_reg_listener =
 {
@@ -131,16 +194,44 @@ static const struct wl_registry_listener _wl_reg_listener =
    _cb_wl_reg_global_remove
 };
 
-struct tizen_notification_listener _wl_tz_noti_lv_listener =
+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_noti_lv_done
+   _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_iconify_state_changed,
+   _cb_wl_tz_policy_supported_aux_hints,
+   _cb_wl_tz_policy_allowed_aux_hint,
+   _cb_wl_tz_policy_aux_message,
 };
 
-struct tizen_window_screen_listener _wl_tz_win_scr_mode_listener =
+struct tizen_input_device_manager_listener _wl_tz_devmgr_listener =
 {
-   _cb_wl_tz_win_scr_mode_done
+   _cb_device_add,
+   _cb_device_remove,
+   _cb_error,
+   _cb_block_expired
+};
+
+struct tizen_input_device_listener _wl_tz_dev_listener =
+{
+   _cb_device_info,
+   _cb_event_device,
+   _cb_axis,
+};
+
+struct tizen_display_policy_listener _wl_tz_display_policy_listener =
+{
+   _cb_wl_tz_display_policy_brightness_done,
 };
-#endif /* end of WAYLAND */
 
 static Eina_Bool
 _cb_info_add(Evas_Object *win,
@@ -170,13 +261,6 @@ _cb_info_add(Evas_Object *win,
       = eina_list_append(_eflutil.cb_handler[idx].info_list,
                          info);
 
-#if X11
-   if (!_eflutil.handler)
-     _eflutil.handler = ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE,
-                                                _cb_x11_client_msg,
-                                                NULL);
-#endif /* end of X11 */
-
    return EINA_TRUE;
 }
 
@@ -185,7 +269,6 @@ _cb_info_del_by_win(Evas_Object *win,
                     int idx)
 {
    Efl_Util_Callback_Info *info;
-   unsigned int count;
 
    info = _cb_info_find_by_win(win, idx);
    if (!info) return EINA_FALSE;
@@ -195,13 +278,6 @@ _cb_info_del_by_win(Evas_Object *win,
                          info);
    free(info);
 
-   count = eina_list_count(_eflutil.cb_handler[idx].info_list);
-   if ((count == 0) && (_eflutil.handler))
-     {
-        ecore_event_handler_del(_eflutil.handler);
-        _eflutil.handler = NULL;
-     }
-
    return EINA_TRUE;
 }
 
@@ -227,93 +303,199 @@ _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)
+static Eina_Bool
+_wl_init(void)
 {
-   Eina_List *l, *ll;
-   Efl_Util_Callback_Info *info;
-   unsigned int xwin2;
+   _eflutil.wl.ref_count++;
 
-   l = _cb_info_list_get(idx);
-   EINA_LIST_FOREACH(l, ll, info)
+   if (_eflutil.wl.init) return EINA_TRUE;
+
+   ecore_wl_init(NULL);
+
+   _eflutil.wl.dpy = ecore_wl_display_get();
+   EINA_SAFETY_ON_NULL_GOTO(_eflutil.wl.dpy, fail);
+
+   _eflutil.wl.queue = wl_display_create_queue(_eflutil.wl.dpy);
+   EINA_SAFETY_ON_NULL_GOTO(_eflutil.wl.queue, fail);
+
+   _eflutil.wl.reg = wl_display_get_registry(_eflutil.wl.dpy);
+   EINA_SAFETY_ON_NULL_GOTO(_eflutil.wl.reg, fail);
+
+   wl_proxy_set_queue((struct wl_proxy*)_eflutil.wl.reg, _eflutil.wl.queue);
+   wl_registry_add_listener(_eflutil.wl.reg, &_wl_reg_listener, NULL);
+
+   _eflutil.wl.init = EINA_TRUE;
+
+   return EINA_TRUE;
+fail:
+   if (_eflutil.wl.queue)
      {
-        xwin2 = elm_win_xwindow_get(info->win);
-        if (xwin == xwin2) return info;
+        wl_event_queue_destroy(_eflutil.wl.queue);
+        _eflutil.wl.queue = NULL;
      }
 
-   return NULL;
+   if (_eflutil.wl.reg)
+     {
+        wl_registry_destroy(_eflutil.wl.reg);
+        _eflutil.wl.reg = NULL;
+     }
+
+   _eflutil.wl.dpy = NULL;
+
+   ecore_wl_shutdown();
+   return EINA_FALSE;
 }
 
-static Eina_Bool
-_cb_x11_client_msg(void *data,
-                   int type,
-                   void *event)
+static void
+_wl_shutdown(void)
 {
-   Ecore_X_Event_Client_Message *ev;
-   Ecore_X_Window xwin;
-   Efl_Util_Callback_Info *info;
+   Eina_List *l, *ll;
+   struct tizen_input_device *data;
+   Efl_Util_Wl_Output_Info *output;
 
-   ev = event;
-   if (!ev) return ECORE_CALLBACK_PASS_ON;
+   if (!_eflutil.wl.init) return;
 
-   xwin = ev->win;
-   if (xwin == 0) return ECORE_CALLBACK_PASS_ON;
+   _eflutil.wl.ref_count--;
+   if (_eflutil.wl.ref_count > 0)
+     return;
 
-   if (ev->message_type == _eflutil.atom.noti_lv)
-     {
-        info = _cb_info_find_by_xwin(xwin, CBH_NOTI_LEV);
+   // tizen_policy
+   if (_eflutil.wl.policy.proto)
+     tizen_policy_destroy(_eflutil.wl.policy.proto);
+   _eflutil.wl.policy.proto = NULL;
 
-        /* permission denied */
-        if ((ev->data.l[1] == 0) &&
-            (info) &&
-            (info->cb))
+   eina_hash_free(_eflutil.wl.policy.hash_noti_lv);
+   _eflutil.wl.policy.hash_noti_lv = NULL;
+   eina_hash_free(_eflutil.wl.policy.hash_scr_mode);
+   _eflutil.wl.policy.hash_scr_mode = NULL;
+
+   // wl_output
+   if (_eflutil.wl.shot.output_list)
+     {
+        EINA_LIST_FREE(_eflutil.wl.shot.output_list, output)
           {
-             info->cb(info->win,
-                      EFL_UTIL_ERROR_PERMISSION_DENIED,
-                      info->data);
+             wl_output_destroy(output->output);
+             free(output);
           }
      }
-   else if (ev->message_type == _eflutil.atom.scr_mode)
+   _eflutil.wl.shot.output_list = NULL;
+
+   // screenshooter
+   if (_eflutil.wl.shot.screenshooter)
+     screenshooter_destroy(_eflutil.wl.shot.screenshooter);
+   _eflutil.wl.shot.screenshooter = NULL;
+
+   // tizen_input_device_manager
+   EINA_LIST_FOREACH_SAFE(_eflutil.wl.devmgr.device_list, l, ll, data)
      {
-        info = _cb_info_find_by_xwin(xwin, CBH_SCR_MODE);
+        tizen_input_device_release(data);
+        _eflutil.wl.devmgr.device_list = eina_list_remove_list(_eflutil.wl.devmgr.device_list, l);
+     }
+   ecore_wl_sync();
+   if (_eflutil.wl.devmgr.devicemgr)
+     tizen_input_device_manager_destroy(_eflutil.wl.devmgr.devicemgr);
+   _eflutil.wl.devmgr.devicemgr = NULL;
 
-        /* permission denied */
-        if ((ev->data.l[1] == 0) &&
-            (info) &&
-            (info->cb))
-          {
-             info->cb(info->win,
-                      EFL_UTIL_ERROR_PERMISSION_DENIED,
-                      info->data);
-          }
+   // tizen_display_policy
+   if (_eflutil.wl.display_policy.proto)
+     tizen_display_policy_destroy(_eflutil.wl.display_policy.proto);
+   _eflutil.wl.display_policy.proto = NULL;
+
+   eina_hash_free(_eflutil.wl.display_policy.hash_brightness);
+   _eflutil.wl.display_policy.hash_brightness = NULL;
+
+   if (_eflutil.wl.reg)
+     {
+        wl_proxy_set_queue((struct wl_proxy*)_eflutil.wl.reg, NULL);
+        wl_registry_destroy(_eflutil.wl.reg);
+        _eflutil.wl.reg = NULL;
      }
-   return ECORE_CALLBACK_PASS_ON;
+
+   if (_eflutil.wl.queue)
+     {
+        wl_event_queue_destroy(_eflutil.wl.queue);
+        _eflutil.wl.queue = NULL;
+     }
+
+   _eflutil.wl.dpy = NULL;
+   _eflutil.wl.init = EINA_FALSE;
+
+   ecore_wl_shutdown();
 }
-#endif /* end of X11 */
 
-#if WAYLAND
-static Eina_Bool
-_wl_init(void)
+static void
+_cb_wl_output_geometry(void *data, struct wl_output *wl_output, int x, int y,
+                       int physical_width, int physical_height, int subpixel,
+                       const char *make, const char *model, int transform)
 {
-   struct wl_registry *reg;
+   Efl_Util_Wl_Output_Info *output = wl_output_get_user_data(wl_output);
+   if (wl_output == output->output)
+     {
+        output->offset_x = x;
+        output->offset_y = y;
+     }
+}
 
-   if (_eflutil.wl.init) return EINA_TRUE;
+static void
+_cb_wl_output_mode(void *data, struct wl_output *wl_output, uint32_t flags,
+                   int width, int height, int refresh)
+{
+   Efl_Util_Wl_Output_Info *output = wl_output_get_user_data(wl_output);
+   if (wl_output == output->output && (flags & WL_OUTPUT_MODE_CURRENT))
+     {
+        output->width = width;
+        output->height = height;
+     }
+}
 
-   _eflutil.wl.dpy = ecore_wl_display_get();
-   EINA_SAFETY_ON_NULL_RETURN_VAL(_eflutil.wl.dpy, EINA_FALSE);
+static void
+_cb_wl_output_done(void *data, struct wl_output *wl_output)
+{
+}
+
+static void
+_cb_wl_output_scale(void *data, struct wl_output *wl_output, int32_t factor)
+{
+}
 
-   reg = wl_display_get_registry(_eflutil.wl.dpy);
-   EINA_SAFETY_ON_NULL_RETURN_VAL(reg, EINA_FALSE);
+static const struct wl_output_listener output_listener =
+{
+    _cb_wl_output_geometry,
+    _cb_wl_output_mode,
+    _cb_wl_output_done,
+    _cb_wl_output_scale
+};
 
-   wl_registry_add_listener(reg, &_wl_reg_listener, NULL);
+static void
+_cb_wl_screenshot_done(void *data, struct screenshooter *screenshooter)
+{
+   Eina_Bool *shot_done = (Eina_Bool*)data;
+   if (shot_done)
+     *shot_done = EINA_TRUE;
+}
 
-   _eflutil.wl.init = EINA_TRUE;
+static const struct screenshooter_listener screenshooter_listener =
+{
+    _cb_wl_screenshot_done
+};
 
-   return EINA_TRUE;
+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,
@@ -321,49 +503,134 @@ _cb_wl_reg_global(void *data,
                   const char *interface,
                   unsigned int version)
 {
-   if (!strcmp(interface, "tizen_notification"))
+   if (!strcmp(interface, "tizen_policy"))
      {
-        struct tizen_notification *proto;
+        struct tizen_policy *proto;
         proto = wl_registry_bind(reg,
-                                 name,
-                                 &tizen_notification_interface,
-                                 1);
+                                  name,
+                                  &tizen_policy_interface,
+                                  1);
         if (!proto) return;
 
-        tizen_notification_add_listener(proto,
-                                        &_wl_tz_noti_lv_listener,
-                                        NULL);
+        tizen_policy_add_listener(proto,
+                                  &_wl_tz_policy_listener,
+                                  NULL);
 
-        _eflutil.wl.noti_lv.hash = eina_hash_pointer_new(free);
-        _eflutil.wl.noti_lv.proto = proto;
+        _eflutil.wl.policy.hash_noti_lv = eina_hash_pointer_new(free);
+        _eflutil.wl.policy.hash_scr_mode = eina_hash_pointer_new(free);
+        _eflutil.wl.policy.proto = proto;
      }
-   else if (!strcmp(interface, "tizen_window_screen"))
+   else if (strcmp(interface, "wl_output") == 0)
      {
-        struct tizen_window_screen *proto;
-        proto = wl_registry_bind(reg,
-                                 name,
-                                 &tizen_window_screen_interface,
-                                 1);
-        if (!proto) return;
+        Efl_Util_Wl_Output_Info *output = calloc(1, sizeof(Efl_Util_Wl_Output_Info));
+        EINA_SAFETY_ON_NULL_RETURN(output);
 
-        tizen_window_screen_add_listener(proto,
-                                         &_wl_tz_win_scr_mode_listener,
-                                         NULL);
+        _eflutil.wl.shot.output_list = eina_list_append(_eflutil.wl.shot.output_list, output);
 
-        _eflutil.wl.win_scr_mode.hash = eina_hash_pointer_new(free);
-        _eflutil.wl.win_scr_mode.proto = proto;
+        output->output = wl_registry_bind(reg, name, &wl_output_interface, version);
+        wl_output_add_listener(output->output, &output_listener, output);
+     }
+   else if (strcmp(interface, "tizen_input_device_manager") == 0)
+     {
+        _eflutil.wl.devmgr.devicemgr = wl_registry_bind(reg, name, &tizen_input_device_manager_interface, version);
+        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);
      }
-}
 
+}
+/* LCOV_EXCL_START */
 static void
 _cb_wl_reg_global_remove(void *data,
                          struct wl_registry *reg,
                          unsigned int name)
 {
-   _eflutil.wl.noti_lv.proto = NULL;
-   eina_hash_free(_eflutil.wl.noti_lv.hash);
-   _eflutil.wl.win_scr_mode.proto = NULL;
-   eina_hash_free(_eflutil.wl.win_scr_mode.hash);
+   Eina_List *l, *ll;
+   struct tizen_input_device *ddata;
+   Efl_Util_Wl_Output_Info *output;
+
+   // tizen_policy
+   if (_eflutil.wl.policy.proto)
+     tizen_policy_destroy(_eflutil.wl.policy.proto);
+   _eflutil.wl.policy.proto = NULL;
+
+   eina_hash_free(_eflutil.wl.policy.hash_noti_lv);
+   _eflutil.wl.policy.hash_noti_lv = NULL;
+   eina_hash_free(_eflutil.wl.policy.hash_scr_mode);
+   _eflutil.wl.policy.hash_scr_mode = NULL;
+
+   // wl_output
+   if (_eflutil.wl.shot.output_list)
+     {
+        EINA_LIST_FREE(_eflutil.wl.shot.output_list, output)
+          {
+             wl_output_destroy(output->output);
+             free(output);
+          }
+     }
+   _eflutil.wl.shot.output_list = NULL;
+
+   // screenshooter
+   if (_eflutil.wl.shot.screenshooter)
+     screenshooter_destroy(_eflutil.wl.shot.screenshooter);
+   _eflutil.wl.shot.screenshooter = NULL;
+
+   // tizen_input_device_manager
+   EINA_LIST_FOREACH_SAFE(_eflutil.wl.devmgr.device_list, l, ll, ddata)
+     {
+        tizen_input_device_release(ddata);
+        _eflutil.wl.devmgr.device_list = eina_list_remove_list(_eflutil.wl.devmgr.device_list, l);
+     }
+   if (_eflutil.wl.devmgr.devicemgr)
+     tizen_input_device_manager_destroy(_eflutil.wl.devmgr.devicemgr);
+   _eflutil.wl.devmgr.devicemgr = NULL;
+
+   // tizen_display_policy
+   if (_eflutil.wl.display_policy.proto)
+     tizen_display_policy_destroy(_eflutil.wl.display_policy.proto);
+   _eflutil.wl.display_policy.proto = NULL;
+
+   eina_hash_free(_eflutil.wl.display_policy.hash_brightness);
+   _eflutil.wl.display_policy.hash_brightness = NULL;
+}
+/* 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 *
@@ -387,23 +654,38 @@ _cb_info_find_by_wlsurf(void *wlsurf,
 }
 
 static void
-_cb_wl_tz_noti_lv_done(void *data,
-                       struct tizen_notification *proto,
-                       struct wl_surface *surface,
-                       int32_t level,
-                       uint32_t state)
+_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)
+{
+}
+/* LCOV_EXCL_STOP */
+
+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)
 {
    Efl_Util_Wl_Surface_Lv_Info *lv_info;
    Efl_Util_Callback_Info *cb_info;
 
-   lv_info = eina_hash_find(_eflutil.wl.noti_lv.hash, &surface);
+   lv_info = eina_hash_find(_eflutil.wl.policy.hash_noti_lv, &surface);
    if (lv_info)
      {
         lv_info->level = level;
         lv_info->wait_for_done = EINA_FALSE;
+        lv_info->state = state;
      }
 
-   if (state != TIZEN_NOTIFICATION_ERROR_STATE_PERMISSION_DENIED) return;
+   if (state != TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED) return;
 
    cb_info = _cb_info_find_by_wlsurf((void *)surface, CBH_NOTI_LEV);
    if (!cb_info) return;
@@ -414,25 +696,33 @@ _cb_wl_tz_noti_lv_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_win_scr_mode_done(void *data,
-                          struct tizen_window_screen *proto,
-                          struct wl_surface *surface,
-                          uint32_t mode,
-                          uint32_t state)
+_cb_wl_tz_policy_scr_mode_done(void *data,
+                               struct tizen_policy *tizen_policy,
+                               struct wl_surface *surface,
+                               uint32_t mode,
+                               uint32_t state)
 {
 
    Efl_Util_Wl_Surface_Scr_Mode_Info *scr_mode_info;
    Efl_Util_Callback_Info *cb_info;
 
-   scr_mode_info = eina_hash_find(_eflutil.wl.win_scr_mode.hash, &surface);
+   scr_mode_info = eina_hash_find(_eflutil.wl.policy.hash_scr_mode, &surface);
    if (scr_mode_info)
      {
         scr_mode_info->mode = mode;
         scr_mode_info->wait_for_done = EINA_FALSE;
+        scr_mode_info->state = state;
      }
 
-   if (state != TIZEN_WINDOW_SCREEN_ERROR_STATE_PERMISSION_DENIED) return;
+   if (state != TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED) return;
 
    cb_info = _cb_info_find_by_wlsurf((void *)surface, CBH_SCR_MODE);
    if (!cb_info) return;
@@ -442,196 +732,257 @@ _cb_wl_tz_win_scr_mode_done(void *data,
                EFL_UTIL_ERROR_PERMISSION_DENIED,
                cb_info->data);
 }
-#endif /* end of WAYLAND */
 
-API int
-efl_util_set_notification_window_level(Evas_Object *window,
-                                       efl_util_notification_level_e level)
+/* 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)
 {
-   EINA_SAFETY_ON_NULL_RETURN_VAL(window, EFL_UTIL_ERROR_INVALID_PARAMETER);
-   EINA_SAFETY_ON_FALSE_RETURN_VAL((level >= EFL_UTIL_NOTIFICATION_LEVEL_1) &&
-                                   (level <= EFL_UTIL_NOTIFICATION_LEVEL_TOP),
-                                   EFL_UTIL_ERROR_INVALID_PARAMETER);
+}
 
-#if X11
-   Ecore_X_Window xwin = elm_win_xwindow_get(window);
-   if (xwin)
-     {
-        Ecore_X_Window_Type window_type;
-        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;
+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)
+{
+}
 
-        utilx_set_system_notification_level(ecore_x_display_get(), xwin, level);
-        return EFL_UTIL_ERROR_NONE;
-     }
-#endif /* end of X11 */
+static void                    _cb_wl_tz_policy_allowed_aux_hint(void *data, struct tizen_policy *tizen_policy, struct wl_surface *surface_resource, int id)
+{
+}
 
-#if WAYLAND
-   Elm_Win_Type type;
-   Ecore_Wl_Window *wlwin;
-   struct wl_surface *surface;
-   Efl_Util_Wl_Surface_Lv_Info *lv_info;
+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)
+{
+}
+/* LCOV_EXCL_STOP */
 
-   type = elm_win_type_get(window);
-   EINA_SAFETY_ON_FALSE_RETURN_VAL((type == ELM_WIN_NOTIFICATION),
-                                   EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE);
+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;
 
-   wlwin = elm_win_wl_window_get(window);
-   if (wlwin)
+   brightness_info = eina_hash_find(_eflutil.wl.display_policy.hash_brightness, &surface);
+   if (brightness_info)
      {
-        _wl_init();
-
-        while (!_eflutil.wl.noti_lv.proto)
-          wl_display_dispatch(_eflutil.wl.dpy);
-
-        surface = ecore_wl_window_surface_get(wlwin);
-        EINA_SAFETY_ON_NULL_RETURN_VAL(surface,
-                                       EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE);
+        brightness_info->brightness = brightness;
+        brightness_info->wait_for_done = EINA_FALSE;
+        brightness_info->state = state;
+     }
+}
 
-        lv_info = eina_hash_find(_eflutil.wl.noti_lv.hash, &surface);
-        if (!lv_info)
-          {
-             lv_info = calloc(1, sizeof(Efl_Util_Wl_Surface_Lv_Info));
-             EINA_SAFETY_ON_NULL_RETURN_VAL(lv_info, EFL_UTIL_ERROR_OUT_OF_MEMORY);
+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->surface = surface;
-             lv_info->level = (int)level;
-             lv_info->wait_for_done = EINA_TRUE;
+   lv_info = data;
+   if (EINA_UNLIKELY(!lv_info))
+     return;
 
-             eina_hash_add(_eflutil.wl.noti_lv.hash,
-                           &surface,
-                           lv_info);
-          }
-        else
-          {
-             lv_info->level = (int)level;
-             lv_info->wait_for_done = EINA_TRUE;
-          }
+   eina_hash_del(_eflutil.wl.policy.hash_noti_lv, &lv_info->surface, lv_info);
 
-        tizen_notification_set_level(_eflutil.wl.noti_lv.proto,
-                                     surface,
-                                     (int)level);
+   eina_hash_population(_eflutil.wl.policy.hash_noti_lv);
 
-        return EFL_UTIL_ERROR_NONE;
+   if (eina_hash_population(_eflutil.wl.policy.hash_noti_lv) == 0)
+     {
+        _wl_shutdown();
      }
-#endif /* end of WAYLAND */
-
-   return EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE;
 }
 
-API int
-efl_util_get_notification_window_level(Evas_Object *window,
-                                       efl_util_notification_level_e *level)
+static Eina_Bool
+_init_tizen_policy_proto(void)
 {
-   EINA_SAFETY_ON_NULL_RETURN_VAL(window, EFL_UTIL_ERROR_INVALID_PARAMETER);
-   EINA_SAFETY_ON_NULL_RETURN_VAL(level, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   int ret = 0;
 
-#if X11
-   Ecore_X_Window_Type window_type;
-   Utilx_Notification_Level utilx_level;
-   Ecore_X_Window xwin = elm_win_xwindow_get(window);
-   if (xwin)
+   if (!_eflutil.wl.policy.proto)
      {
-        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;
-               }
+        ret = _wl_init();
+        EINA_SAFETY_ON_FALSE_RETURN_VAL(ret, EINA_FALSE);
 
-             utilx_level = utilx_get_system_notification_level(ecore_x_display_get(), 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;
+        ret = 0;
+        while (!_eflutil.wl.policy.proto && ret != -1)
+          ret = wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
 
-        return EFL_UTIL_ERROR_NONE;
+        EINA_SAFETY_ON_NULL_RETURN_VAL(_eflutil.wl.policy.proto, EINA_FALSE);
      }
-#endif /* end of X11 */
 
-#if WAYLAND
+   return EINA_TRUE;
+}
+
+API int
+efl_util_set_notification_window_level(Evas_Object *window,
+                                       efl_util_notification_level_e level)
+{
+   Eina_Bool ret;
    Elm_Win_Type type;
    Ecore_Wl_Window *wlwin;
    struct wl_surface *surface;
    Efl_Util_Wl_Surface_Lv_Info *lv_info;
+   Ecore_Wl_Window_Type wl_type;
 
-   type = elm_win_type_get(window);
-   EINA_SAFETY_ON_FALSE_RETURN_VAL((type == ELM_WIN_NOTIFICATION),
-                                   EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(window, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_FALSE_RETURN_VAL((level >= EFL_UTIL_NOTIFICATION_LEVEL_NONE) &&
+                                   (level <= EFL_UTIL_NOTIFICATION_LEVEL_TOP),
+                                   EFL_UTIL_ERROR_INVALID_PARAMETER);
 
-   wlwin = elm_win_wl_window_get(window);
-   if (wlwin)
+   if (level == EFL_UTIL_NOTIFICATION_LEVEL_1)
      {
-        _wl_init();
-
-        while (!_eflutil.wl.noti_lv.proto)
-          wl_display_dispatch(_eflutil.wl.dpy);
-
-        surface = ecore_wl_window_surface_get(wlwin);
-        EINA_SAFETY_ON_NULL_RETURN_VAL(surface,
-                                       EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE);
+        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.");
+     }
+
+   wlwin = elm_win_wl_window_get(window);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(wlwin, EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE);
 
-        lv_info = eina_hash_find(_eflutil.wl.noti_lv.hash, &surface);
-        if (lv_info)
+   type = elm_win_type_get(window);
+   if (type != ELM_WIN_NOTIFICATION)
+     {
+        wl_type = ecore_wl_window_type_get(wlwin);
+        EINA_SAFETY_ON_FALSE_RETURN_VAL((wl_type == ECORE_WL_WINDOW_TYPE_NOTIFICATION),
+                                        EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE);
+     }
+
+   ret = _init_tizen_policy_proto();
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(ret, EFL_UTIL_ERROR_NOT_SUPPORTED);
+
+   surface = ecore_wl_window_surface_get(wlwin);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(surface,
+                                  EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE);
+
+   lv_info = eina_hash_find(_eflutil.wl.policy.hash_noti_lv, &surface);
+   if (!lv_info)
+     {
+        lv_info = calloc(1, sizeof(Efl_Util_Wl_Surface_Lv_Info));
+        EINA_SAFETY_ON_NULL_RETURN_VAL(lv_info, EFL_UTIL_ERROR_OUT_OF_MEMORY);
+
+        lv_info->surface = surface;
+        lv_info->level = (int)level;
+        lv_info->wait_for_done = EINA_TRUE;
+        lv_info->state = TIZEN_POLICY_ERROR_STATE_NONE;
+        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
+     {
+        lv_info->level = (int)level;
+        lv_info->wait_for_done = EINA_TRUE;
+        lv_info->state = TIZEN_POLICY_ERROR_STATE_NONE;
+     }
+
+
+   tizen_policy_set_notification_level(_eflutil.wl.policy.proto,
+                                       surface, (int)level);
+
+   if (lv_info->wait_for_done)
+     {
+        int count = 0;
+        while (lv_info->wait_for_done && (count < 3))
           {
-             if (lv_info->wait_for_done)
+             ecore_wl_flush();
+             wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+             count++;
+          }
+
+        if (lv_info->wait_for_done)
+          {
+             return EFL_UTIL_ERROR_INVALID_PARAMETER;
+          }
+        else
+          {
+             if (lv_info->state == TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED)
+               {
+                  return EFL_UTIL_ERROR_PERMISSION_DENIED;
+               }
+          }
+     }
+
+   return EFL_UTIL_ERROR_NONE;
+}
+
+API int
+efl_util_get_notification_window_level(Evas_Object *window,
+                                       efl_util_notification_level_e *level)
+{
+   Eina_Bool ret;
+   Elm_Win_Type type;
+   Ecore_Wl_Window *wlwin;
+   struct wl_surface *surface;
+   Efl_Util_Wl_Surface_Lv_Info *lv_info;
+   Ecore_Wl_Window_Type wl_type;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(window, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(level, EFL_UTIL_ERROR_INVALID_PARAMETER);
+
+   wlwin = elm_win_wl_window_get(window);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(wlwin, EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE);
+
+   type = elm_win_type_get(window);
+   if (type != ELM_WIN_NOTIFICATION)
+     {
+        wl_type = ecore_wl_window_type_get(wlwin);
+        EINA_SAFETY_ON_FALSE_RETURN_VAL((wl_type == ECORE_WL_WINDOW_TYPE_NOTIFICATION),
+                                        EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE);
+     }
+
+   surface = ecore_wl_window_surface_get(wlwin);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(surface,
+                                  EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE);
+
+   ret = _init_tizen_policy_proto();
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(ret, EFL_UTIL_ERROR_NOT_SUPPORTED);
+
+   lv_info = eina_hash_find(_eflutil.wl.policy.hash_noti_lv, &surface);
+   if (lv_info)
+     {
+        if (lv_info->wait_for_done)
+          {
+             int count = 0;
+             while ((lv_info->wait_for_done) && (count < 3))
                {
-                  if (ecore_wl_window_shell_surface_get(wlwin) ||
-                      ecore_wl_window_xdg_surface_get(wlwin))
-                    {
-                       while (lv_info->wait_for_done)
-                         {
-                            ecore_wl_flush();
-                            wl_display_dispatch(_eflutil.wl.dpy);
-                         }
-                    }
-                  else
-                    {
-                       *level = EFL_UTIL_NOTIFICATION_LEVEL_DEFAULT;
-                       return EFL_UTIL_ERROR_INVALID_PARAMETER;
-                    }
+                  ecore_wl_flush();
+                  wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+                  count++;
                }
 
-            switch (lv_info->level)
-              {
-                 case TIZEN_NOTIFICATION_LEVEL_1:       *level = EFL_UTIL_NOTIFICATION_LEVEL_1;       break;
-                 case TIZEN_NOTIFICATION_LEVEL_2:       *level = EFL_UTIL_NOTIFICATION_LEVEL_2;       break;
-                 case TIZEN_NOTIFICATION_LEVEL_3:       *level = EFL_UTIL_NOTIFICATION_LEVEL_3;       break;
-                 case TIZEN_NOTIFICATION_LEVEL_NONE:    *level = EFL_UTIL_NOTIFICATION_LEVEL_NONE;    break;
-                 case TIZEN_NOTIFICATION_LEVEL_DEFAULT: *level = EFL_UTIL_NOTIFICATION_LEVEL_DEFAULT; break;
-                 case TIZEN_NOTIFICATION_LEVEL_MEDIUM:  *level = EFL_UTIL_NOTIFICATION_LEVEL_MEDIUM;  break;
-                 case TIZEN_NOTIFICATION_LEVEL_HIGH:    *level = EFL_UTIL_NOTIFICATION_LEVEL_HIGH;    break;
-                 case TIZEN_NOTIFICATION_LEVEL_TOP:     *level = EFL_UTIL_NOTIFICATION_LEVEL_TOP;     break;
-                 default:                               *level = EFL_UTIL_NOTIFICATION_LEVEL_DEFAULT;
-                   return EFL_UTIL_ERROR_INVALID_PARAMETER;
-              }
-            return EFL_UTIL_ERROR_NONE;
+             if (lv_info->wait_for_done)
+               {
+                  *level = EFL_UTIL_NOTIFICATION_LEVEL_DEFAULT;
+                  return EFL_UTIL_ERROR_INVALID_PARAMETER;
+               }
           }
-        else
-          *level = EFL_UTIL_NOTIFICATION_LEVEL_DEFAULT;
 
+        switch (lv_info->level)
+          {
+           case TIZEN_POLICY_LEVEL_1:       *level = EFL_UTIL_NOTIFICATION_LEVEL_1;       break;
+           case TIZEN_POLICY_LEVEL_2:       *level = EFL_UTIL_NOTIFICATION_LEVEL_2;       break;
+           case TIZEN_POLICY_LEVEL_3:       *level = EFL_UTIL_NOTIFICATION_LEVEL_3;       break;
+           case TIZEN_POLICY_LEVEL_NONE:    *level = EFL_UTIL_NOTIFICATION_LEVEL_NONE;    break;
+           case TIZEN_POLICY_LEVEL_DEFAULT: *level = EFL_UTIL_NOTIFICATION_LEVEL_DEFAULT; break;
+           case TIZEN_POLICY_LEVEL_MEDIUM:  *level = EFL_UTIL_NOTIFICATION_LEVEL_MEDIUM;  break;
+           case TIZEN_POLICY_LEVEL_HIGH:    *level = EFL_UTIL_NOTIFICATION_LEVEL_HIGH;    break;
+           case TIZEN_POLICY_LEVEL_TOP:     *level = EFL_UTIL_NOTIFICATION_LEVEL_TOP;     break;
+           default:                         *level = EFL_UTIL_NOTIFICATION_LEVEL_DEFAULT;
+            return EFL_UTIL_ERROR_INVALID_PARAMETER;
+          }
         return EFL_UTIL_ERROR_NONE;
      }
-#endif /* end of WAYLAND */
-   return EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE;
+   else
+     *level = EFL_UTIL_NOTIFICATION_LEVEL_DEFAULT;
+
+   return EFL_UTIL_ERROR_NONE;
 }
 
 API int
@@ -639,6 +990,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);
@@ -650,17 +1004,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.atom.noti_lv)
-     _eflutil.atom.noti_lv = 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);
@@ -675,53 +1027,28 @@ API int
 efl_util_set_window_opaque_state(Evas_Object *window,
                                  int opaque)
 {
+   Eina_Bool ret;
+   Ecore_Wl_Window *wlwin;
+   struct wl_surface *surface;
+
    EINA_SAFETY_ON_NULL_RETURN_VAL(window, EFL_UTIL_ERROR_INVALID_PARAMETER);
    EINA_SAFETY_ON_FALSE_RETURN_VAL(((opaque >= 0) && (opaque <= 1)),
                                    EFL_UTIL_ERROR_INVALID_PARAMETER);
 
-#if X11
-   Ecore_X_Window xwin = elm_win_xwindow_get(window);
-   Ecore_X_Display *xdpy = ecore_x_display_get();
-   Utilx_Opaque_State state;
-   int ret;
-
-   EINA_SAFETY_ON_NULL_RETURN_VAL(xwin, EFL_UTIL_ERROR_INVALID_PARAMETER);
-   EINA_SAFETY_ON_NULL_RETURN_VAL(xdpy, EFL_UTIL_ERROR_INVALID_PARAMETER);
-
-   if (opaque)
-     state = UTILX_OPAQUE_STATE_ON;
-   else
-     state = UTILX_OPAQUE_STATE_OFF;
-
-   ret = utilx_set_window_opaque_state(xdpy, 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;
-   int x, y, w, h;
-
    wlwin = elm_win_wl_window_get(window);
-   if (wlwin)
-     {
-        _wl_init();
+   if (!wlwin)
+      return EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE;
 
-        evas_object_geometry_get(window, &x, &y, &w, &h);
+   surface  = ecore_wl_window_surface_get(wlwin);
+   if (!surface)
+      return EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE;
 
-        if (opaque)
-          ecore_wl_window_opaque_region_set(wlwin, x, y, w, h);
-        else
-          ecore_wl_window_opaque_region_set(wlwin, 0, 0, 0, 0);
+   ret = _init_tizen_policy_proto();
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(ret, EFL_UTIL_ERROR_NOT_SUPPORTED);
 
-        return EFL_UTIL_ERROR_NONE;
-     }
+   tizen_policy_set_opaque_state(_eflutil.wl.policy.proto, surface, opaque);
 
-   return EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE;
-#endif /* end of WAYLAND */
+   return EFL_UTIL_ERROR_NONE;
 }
 
 API int
@@ -733,84 +1060,68 @@ 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;
+   Eina_Bool ret;
 
    wlwin = elm_win_wl_window_get(window);
-   if (wlwin)
+   EINA_SAFETY_ON_NULL_RETURN_VAL(wlwin, EFL_UTIL_ERROR_INVALID_PARAMETER);
+
+   surface = ecore_wl_window_surface_get(wlwin);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(surface, EFL_UTIL_ERROR_INVALID_PARAMETER);
+
+   ret = _init_tizen_policy_proto();
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(ret, EFL_UTIL_ERROR_NOT_SUPPORTED);
+
+   scr_mode_info = eina_hash_find(_eflutil.wl.policy.hash_scr_mode, &surface);
+   if (!scr_mode_info)
      {
-        _wl_init();
+        scr_mode_info = calloc(1, sizeof(Efl_Util_Wl_Surface_Scr_Mode_Info));
+        EINA_SAFETY_ON_NULL_RETURN_VAL(scr_mode_info, EFL_UTIL_ERROR_OUT_OF_MEMORY);
 
-        while (!_eflutil.wl.win_scr_mode.proto)
-          wl_display_dispatch(_eflutil.wl.dpy);
+        scr_mode_info->surface = surface;
+        scr_mode_info->mode = (unsigned int)mode;
+        scr_mode_info->wait_for_done = EINA_TRUE;
+        scr_mode_info->state = TIZEN_POLICY_ERROR_STATE_NONE;
 
-        surface = ecore_wl_window_surface_get(wlwin);
-        EINA_SAFETY_ON_NULL_RETURN_VAL(surface,
-                                       EFL_UTIL_ERROR_INVALID_PARAMETER);
+        eina_hash_add(_eflutil.wl.policy.hash_scr_mode,
+                      &surface,
+                      scr_mode_info);
+     }
+   else
+     {
+        scr_mode_info->mode = (unsigned int)mode;
+        scr_mode_info->wait_for_done = EINA_TRUE;
+        scr_mode_info->state = TIZEN_POLICY_ERROR_STATE_NONE;
+     }
 
-        scr_mode_info = eina_hash_find(_eflutil.wl.win_scr_mode.hash, &surface);
-        if (!scr_mode_info)
+   tizen_policy_set_window_screen_mode(_eflutil.wl.policy.proto,
+                                       surface, (unsigned int)mode);
+   if (scr_mode_info->wait_for_done)
+     {
+        int count = 0;
+        while (scr_mode_info->wait_for_done && (count < 3))
           {
-             scr_mode_info = calloc(1, sizeof(Efl_Util_Wl_Surface_Scr_Mode_Info));
-             EINA_SAFETY_ON_NULL_RETURN_VAL(scr_mode_info, EFL_UTIL_ERROR_OUT_OF_MEMORY);
-
-             scr_mode_info->surface = surface;
-             scr_mode_info->mode = (unsigned int)mode;
-             scr_mode_info->wait_for_done = EINA_TRUE;
+             ecore_wl_flush();
+             wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+             count++;
+          }
 
-             eina_hash_add(_eflutil.wl.win_scr_mode.hash,
-                           &surface,
-                           scr_mode_info);
+        if (scr_mode_info->wait_for_done)
+          {
+             return EFL_UTIL_ERROR_INVALID_PARAMETER;
           }
         else
           {
-             scr_mode_info->mode = (unsigned int)mode;
-             scr_mode_info->wait_for_done = EINA_TRUE;
+             if (scr_mode_info->state == TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED)
+               {
+                  return EFL_UTIL_ERROR_PERMISSION_DENIED;
+               }
           }
-
-        tizen_window_screen_set_mode(_eflutil.wl.win_scr_mode.proto,
-                                     surface,
-                                     (unsigned int)mode);
-
-        return EFL_UTIL_ERROR_NONE;
      }
-   else
-     return EFL_UTIL_ERROR_INVALID_PARAMETER;
-#endif /* end of WAYLAND */
+
+   return EFL_UTIL_ERROR_NONE;
 }
 
 API int
@@ -820,86 +1131,65 @@ 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;
+   Eina_Bool ret;
 
    wlwin = elm_win_wl_window_get(window);
-   if (wlwin)
-     {
-        _wl_init();
+   EINA_SAFETY_ON_NULL_RETURN_VAL(wlwin, EFL_UTIL_ERROR_INVALID_PARAMETER);
 
-        while (!_eflutil.wl.win_scr_mode.proto)
-          wl_display_dispatch(_eflutil.wl.dpy);
+   surface = ecore_wl_window_surface_get(wlwin);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(surface, EFL_UTIL_ERROR_INVALID_PARAMETER);
 
-        surface = ecore_wl_window_surface_get(wlwin);
-        EINA_SAFETY_ON_NULL_RETURN_VAL(surface,
-                                       EFL_UTIL_ERROR_INVALID_PARAMETER);
+   ret = _init_tizen_policy_proto();
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(ret, EFL_UTIL_ERROR_NOT_SUPPORTED);
 
-        scr_mode_info = eina_hash_find(_eflutil.wl.win_scr_mode.hash, &surface);
-        if (scr_mode_info)
+   scr_mode_info = eina_hash_find(_eflutil.wl.policy.hash_scr_mode, &surface);
+   if (scr_mode_info)
+     {
+        if (scr_mode_info->wait_for_done)
           {
-             if (scr_mode_info->wait_for_done)
+             while (scr_mode_info->wait_for_done)
                {
-                  while (scr_mode_info->wait_for_done)
-                    {
-                       ecore_wl_flush();
-                       wl_display_dispatch(_eflutil.wl.dpy);
-                    }
+                  ecore_wl_flush();
+                  wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
                }
-
-            switch (scr_mode_info->mode)
-              {
-                 case TIZEN_WINDOW_SCREEN_MODE_DEFAULT:   *mode = EFL_UTIL_SCREEN_MODE_DEFAULT;   break;
-                 case TIZEN_WINDOW_SCREEN_MODE_ALWAYS_ON: *mode = EFL_UTIL_SCREEN_MODE_ALWAYS_ON; break;
-                 default:                                 *mode = EFL_UTIL_SCREEN_MODE_DEFAULT;
-                   return EFL_UTIL_ERROR_INVALID_PARAMETER;
-              }
-            return EFL_UTIL_ERROR_NONE;
           }
-        else
+
+        switch (scr_mode_info->mode)
           {
-             *mode = EFL_UTIL_SCREEN_MODE_DEFAULT;
-             return EFL_UTIL_ERROR_INVALID_PARAMETER;
+           case TIZEN_POLICY_MODE_DEFAULT:
+              *mode = EFL_UTIL_SCREEN_MODE_DEFAULT;
+              break;
+
+           case TIZEN_POLICY_MODE_ALWAYS_ON:
+              *mode = EFL_UTIL_SCREEN_MODE_ALWAYS_ON;
+              break;
+
+           default:
+              *mode = EFL_UTIL_SCREEN_MODE_DEFAULT;
+              return EFL_UTIL_ERROR_INVALID_PARAMETER;
           }
+
+        return EFL_UTIL_ERROR_NONE;
      }
    else
-     return EFL_UTIL_ERROR_INVALID_PARAMETER;
-#endif /* end of WAYLAND */
+     {
+        *mode = EFL_UTIL_SCREEN_MODE_DEFAULT;
+        return EFL_UTIL_ERROR_INVALID_PARAMETER;
+     }
 }
 
+#ifndef TIZEN_WEARABLE
 API int
 efl_util_set_window_screen_mode_error_cb(Evas_Object *window,
                                          efl_util_window_screen_mode_error_cb callback,
                                          void *user_data)
 {
+   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);
@@ -911,17 +1201,15 @@ 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.atom.scr_mode)
-     _eflutil.atom.scr_mode = 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)
 {
+   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);
@@ -931,50 +1219,744 @@ efl_util_unset_window_screen_mode_error_cb(Evas_Object *window)
 
    return EFL_UTIL_ERROR_NONE;
 }
+#endif
+
+static Eina_Bool
+_init_tizen_display_policy_proto(void)
+{
+   int ret = 0;
+
+   if (!_eflutil.wl.display_policy.proto)
+     {
+        ret = _wl_init();
+        EINA_SAFETY_ON_FALSE_RETURN_VAL(ret, EINA_FALSE);
+
+        ret = 0;
+        while (!_eflutil.wl.display_policy.proto && ret != -1)
+          ret = wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+
+        EINA_SAFETY_ON_NULL_RETURN_VAL(_eflutil.wl.display_policy.proto, EINA_FALSE);
+     }
+
+   return EINA_TRUE;
+}
 
 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)
 {
+   Ecore_Wl_Window *wlwin;
+   struct wl_surface *surface;
+   Efl_Util_Wl_Surface_Brightness_Info *brightness_info;
+   Eina_Bool ret;
+
+   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);
+
+   wlwin = elm_win_wl_window_get(window);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(wlwin, EFL_UTIL_ERROR_INVALID_PARAMETER);
+
+   surface = ecore_wl_window_surface_get(wlwin);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(surface, EFL_UTIL_ERROR_INVALID_PARAMETER);
+
+   ret = _init_tizen_display_policy_proto();
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(ret, EFL_UTIL_ERROR_NOT_SUPPORTED);
+
+   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;
 }
 
-API void
-efl_util_input_deinitialize_generator(void)
+API int
+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 ret;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(window, EFL_UTIL_ERROR_INVALID_PARAMETER);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(brightness, EFL_UTIL_ERROR_INVALID_PARAMETER);
+
+   wlwin = elm_win_wl_window_get(window);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(wlwin, EFL_UTIL_ERROR_INVALID_PARAMETER);
+
+   surface = ecore_wl_window_surface_get(wlwin);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(surface, EFL_UTIL_ERROR_INVALID_PARAMETER);
+
+   ret = _init_tizen_display_policy_proto();
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(ret, EFL_UTIL_ERROR_NOT_SUPPORTED);
+
+   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;
+}
+
+
+struct _efl_util_inputgen_h
+{
+   unsigned int init_type;
+};
+
+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,
+               struct wl_seat *seat EINA_UNUSED)
+{
+   Eina_List *l;
+   struct tizen_input_device *ddata;
+
+   EINA_LIST_FOREACH(_eflutil.wl.devmgr.device_list, l, ddata)
+     {
+        if (device == ddata) return;
+     }
+   tizen_input_device_add_listener(device, &_wl_tz_dev_listener, NULL);
+   _eflutil.wl.devmgr.device_list = eina_list_append(_eflutil.wl.devmgr.device_list, device);
+}
+
+/* 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,
+               struct wl_seat *seat  EINA_UNUSED)
+{
+   Eina_List *l, *ll;
+   struct tizen_input_device *ddata;
+
+   EINA_LIST_FOREACH_SAFE(_eflutil.wl.devmgr.device_list, l, ll, ddata)
+     {
+        if (device == ddata)
+          {
+             _eflutil.wl.devmgr.device_list = eina_list_remove_list(_eflutil.wl.devmgr.device_list, l);
+             tizen_input_device_release(device);
+          }
+     }
+}
+/* LCOV_EXCL_STOP */
+
+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;
+}
+
+/* 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 */
+
+/* LCOV_EXCL_START */
+static void
+_cb_device_info(void *data EINA_UNUSED,
+                struct tizen_input_device *tizen_input_device EINA_UNUSED,
+                const char *name EINA_UNUSED, uint32_t clas EINA_UNUSED,
+                uint32_t subclas EINA_UNUSED, struct wl_array *axes EINA_UNUSED)
+{
+   ;
+}
+
+static void
+_cb_event_device(void *data EINA_UNUSED,
+                 struct tizen_input_device *tizen_input_device EINA_UNUSED,
+                 unsigned int serial EINA_UNUSED,
+                 const char *name EINA_UNUSED, uint32_t time EINA_UNUSED)
+{
+   ;
+}
+
+static void
+_cb_axis(void *data EINA_UNUSED,
+         struct tizen_input_device *tizen_input_device EINA_UNUSED,
+         uint32_t axis_type EINA_UNUSED, wl_fixed_t value EINA_UNUSED)
+{
+   ;
+}
+/* LCOV_EXCL_STOP */
+
+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;
+     }
+}
+
+API efl_util_inputgen_h
+efl_util_input_initialize_generator(unsigned int dev_type)
 {
-   return;
+   int ret = EFL_UTIL_ERROR_NONE;
+   efl_util_inputgen_h inputgen_h = NULL;
+
+   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;
+     }
+
+   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;
+     }
+
+   inputgen_h->init_type |= dev_type;
+
+   ret = _wl_init();
+   if (ret == (int)EINA_FALSE)
+     {
+        set_last_result(EFL_UTIL_ERROR_INVALID_PARAMETER);
+        goto out;
+     }
+
+   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);
+
+   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;
+
+   return inputgen_h;
+
+out:
+   if (inputgen_h)
+     {
+        free(inputgen_h);
+        inputgen_h = NULL;
+     }
+   return NULL;
 }
 
 API int
-efl_util_input_generate_key(const char *key_name,
-                            int pressed)
+efl_util_input_deinitialize_generator(efl_util_inputgen_h inputgen_h)
 {
-   return EFL_UTIL_ERROR_NONE;
+   int ret = EFL_UTIL_ERROR_NONE;
+   EINA_SAFETY_ON_NULL_RETURN_VAL(inputgen_h, EFL_UTIL_ERROR_INVALID_PARAMETER);
+
+   free(inputgen_h);
+   inputgen_h = NULL;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(_eflutil.wl.devmgr.devicemgr, EFL_UTIL_ERROR_INVALID_PARAMETER);
+
+   tizen_input_device_manager_deinit_generator(_eflutil.wl.devmgr.devicemgr);
+
+   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;
+
+   _wl_shutdown();
+
+   return ret;
 }
 
 API int
-efl_util_input_generate_touch(int idx,
-                              efl_util_input_touch_type_e touch_type,
-                              int x,
-                              int y)
+efl_util_input_generate_key(efl_util_inputgen_h inputgen_h, const char *key_name, int pressed)
 {
-   return EFL_UTIL_ERROR_NONE;
+   int ret = EFL_UTIL_ERROR_NONE;
+
+   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);
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(_eflutil.wl.devmgr.devicemgr, EFL_UTIL_ERROR_INVALID_PARAMETER);
+
+   tizen_input_device_manager_generate_key(_eflutil.wl.devmgr.devicemgr, key_name, pressed);
+
+   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;
+}
+
+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)
+{
+   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(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);
+
+   switch(touch_type)
+     {
+        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;
+     }
+
+   tizen_input_device_manager_generate_touch(_eflutil.wl.devmgr.devicemgr, type, x, y, idx);
+
+   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;
+}
+
+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);
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(_eflutil.wl.devmgr.devicemgr, EFL_UTIL_ERROR_INVALID_PARAMETER);
+
+   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;
+     }
+
+   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);
+
+   ret = _efl_util_input_convert_input_generator_error(_eflutil.wl.devmgr.request_notified);
+   _eflutil.wl.devmgr.request_notified = -1;
+
+   return ret;
+}
+
+
+struct _efl_util_screenshot_h
+{
+   int width;
+   int height;
+
+   Eina_Bool shot_done;
+
+   /* tbm bufmgr */
+   tbm_bufmgr bufmgr;
+
+   Eina_Bool auto_rotation;
+};
+
+/* scrrenshot handle */
+static efl_util_screenshot_h g_screenshot;
+static Eina_Bool shot_mutex_init;
+static pthread_mutex_t shot_lock;
+
+static Eina_Bool
+_screenshot_mutex_init(void)
+{
+   if (shot_mutex_init)
+     return EINA_TRUE;
+
+   if (pthread_mutex_init(&shot_lock, NULL))
+     {
+        fprintf(stderr, "[screenshot] fail: mutex init"); /*LCOV_EXCL_LINE*/
+        return EINA_FALSE; /*LCOV_EXCL_LINE*/
+     }
+
+   shot_mutex_init = EINA_TRUE;
+
+   return EINA_TRUE;
+}
+
+static Eina_Bool
+_screenshot_mutex_destory(void)
+{
+   if (!shot_mutex_init)
+     return EINA_TRUE;
+
+   if (pthread_mutex_destroy(&shot_lock))
+     {
+        fprintf(stderr, "[screenshot] fail: mutex destory"); /*LCOV_EXCL_LINE*/
+        return EINA_FALSE; /*LCOV_EXCL_LINE*/
+     }
+
+   shot_mutex_init = EINA_FALSE;
+
+   return EINA_TRUE;
+}
+
+void
+_screenshot_mutex_lock(void)
+{
+   if (!_screenshot_mutex_init())
+     return;
+
+   pthread_mutex_lock(&shot_lock);
+}
+
+void
+_screenshot_mutex_unlock(void)
+{
+   pthread_mutex_unlock(&shot_lock);
 }
 
 API efl_util_screenshot_h
-efl_util_screenshot_initialize(int width,
-                               int height)
+efl_util_screenshot_initialize(int width, int height)
 {
-   return 0;
+   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)
+     {
+        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_init);
+
+        _eflutil.wl.shot.queue = wl_display_create_queue(_eflutil.wl.dpy);
+        EINA_SAFETY_ON_NULL_GOTO(_eflutil.wl.shot.queue, fail_init);
+
+        reg = wl_display_get_registry(display_wrapper);
+        EINA_SAFETY_ON_NULL_GOTO(reg, fail_init);
+
+        wl_proxy_set_queue((struct wl_proxy*)reg, _eflutil.wl.shot.queue);
+
+        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);
+     }
+
+   if (_eflutil.wl.shot.noti == 0)
+     {
+        fprintf(stderr, "[screenshot] fail: privilege error\n"); /* LCOV_EXCL_LINE */
+        goto fail_init;
+     }
+
+   if (g_screenshot)
+     {
+        if (g_screenshot->width != width || g_screenshot->height != height)
+          {
+             g_screenshot->width = width;
+             g_screenshot->height = height;
+          }
+
+        _screenshot_mutex_unlock();
+
+        return g_screenshot;
+     }
+
+   screenshot = calloc(1, sizeof(struct _efl_util_screenshot_h));
+   EINA_SAFETY_ON_NULL_GOTO(screenshot, fail_memory);
+
+   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);
+
+   g_screenshot = screenshot;
+   set_last_result(EFL_UTIL_ERROR_NONE);
+
+   screenshooter_set_user_data(_eflutil.wl.shot.screenshooter, &screenshot->shot_done);
+
+   _screenshot_mutex_unlock();
+
+   return g_screenshot;
+
+fail_param:
+   set_last_result(EFL_UTIL_ERROR_INVALID_PARAMETER);
+   return NULL;
+fail_memory:
+/* LCOV_EXCL_START */
+   if (display_wrapper)
+     wl_proxy_wrapper_destroy(display_wrapper);
+   set_last_result(EFL_UTIL_ERROR_OUT_OF_MEMORY);
+   return NULL;
+/* LCOV_EXCL_STOP */
+fail_init:
+   if (screenshot)
+     efl_util_screenshot_deinitialize(screenshot);
+   _screenshot_mutex_unlock();
+   if (display_wrapper)
+     wl_proxy_wrapper_destroy(display_wrapper);
+   set_last_result(EFL_UTIL_ERROR_SCREENSHOT_INIT_FAIL);
+   return NULL;
 }
 
+API int
+efl_util_screenshot_deinitialize(efl_util_screenshot_h screenshot)
+{
+   _screenshot_mutex_lock();
+
+   if (!screenshot)
+     {
+        _screenshot_mutex_unlock();
+        _screenshot_mutex_destory();
+        return EFL_UTIL_ERROR_INVALID_PARAMETER;
+     }
+
+   free(screenshot);
+   g_screenshot = NULL;
+
+   if (_eflutil.wl.shot.queue)
+     {
+        wl_event_queue_destroy(_eflutil.wl.shot.queue);
+        _eflutil.wl.shot.queue = NULL;
+     }
+
+   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;
+     }
+
+   _screenshot_mutex_unlock();
+   _screenshot_mutex_destory();
+
+   _wl_shutdown();
+
+   return EFL_UTIL_ERROR_NONE;
+}
+
+
 API tbm_surface_h
 efl_util_screenshot_take_tbm_surface(efl_util_screenshot_h screenshot)
 {
-   return 0;
+   tbm_surface_h t_surface = NULL;
+   struct wl_buffer *buffer = NULL;
+   Efl_Util_Wl_Output_Info *output;
+   int ret = 0;
+
+   _screenshot_mutex_lock();
+
+   if (!screenshot || (screenshot != g_screenshot))
+     {
+        set_last_result(EFL_UTIL_ERROR_INVALID_PARAMETER);
+        _screenshot_mutex_unlock();
+        return 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;
 }
 
 API int
-efl_util_screenshot_deinitialize(efl_util_screenshot_h screenshot)
+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;
+}
+
+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;
+
+   *set = g_screenshot->auto_rotation;
+
    return EFL_UTIL_ERROR_NONE;
 }