Revert "Revert "ecore_wl: added Ecore_Wl_Event_Window_Pre_Visibility_Change event"" 20/126320/2
authorGwanglim Lee <gl77.lee@samsung.com>
Fri, 21 Apr 2017 01:52:35 +0000 (10:52 +0900)
committerJuyeon Lee <juyeonne.lee@samsung.com>
Fri, 21 Apr 2017 03:51:33 +0000 (20:51 -0700)
This reverts commit ddf7d134c3615e9cad1fdbb50ddadc83d8b80ef6.

Change-Id: I1243f9a1e3062024f471dbeca010035d1d805b4f

src/lib/ecore_wayland/Ecore_Wayland.h
src/lib/ecore_wayland/ecore_wl.c
src/lib/ecore_wayland/ecore_wl_window.c

index 723919c..b11c164 100644 (file)
@@ -61,6 +61,7 @@ typedef struct _Ecore_Wl_Event_Window_Configure Ecore_Wl_Event_Window_Configure;
 typedef struct _Ecore_Wl_Event_Window_Activate Ecore_Wl_Event_Window_Activate;
 typedef struct _Ecore_Wl_Event_Window_Deactivate Ecore_Wl_Event_Window_Deactivate;
 typedef struct _Ecore_Wl_Event_Window_Visibility_Change Ecore_Wl_Event_Window_Visibility_Change;
+typedef struct _Ecore_Wl_Event_Window_Pre_Visibility_Change Ecore_Wl_Event_Window_Pre_Visibility_Change;
 typedef struct _Ecore_Wl_Event_Window_Rotate Ecore_Wl_Event_Window_Rotate;
 typedef struct _Ecore_Wl_Event_Window_Show Ecore_Wl_Event_Window_Show;
 typedef struct _Ecore_Wl_Event_Window_Hide Ecore_Wl_Event_Window_Hide;
@@ -106,6 +107,15 @@ struct _Ecore_Wl_Event_Keymap_Update
    struct xkb_keymap *keymap;
 };
 
+enum _Ecore_Wl_Window_Visibility_Type
+{
+   ECORE_WL_WINDOW_VISIBILITY_TYPE_UNKNOWN = 0,
+   ECORE_WL_WINDOW_VISIBILITY_TYPE_UNOBSCURED = 1,
+   ECORE_WL_WINDOW_VISIBILITY_TYPE_PARTIALLY_OBSCURED = 2,
+   ECORE_WL_WINDOW_VISIBILITY_TYPE_FULLY_OBSCURED = 3,
+   ECORE_WL_WINDOW_VISIBILITY_TYPE_PRE_UNOBSCURED = 4,
+};
+
 enum _Ecore_Wl_Window_Type
 {
    ECORE_WL_WINDOW_TYPE_NONE,
@@ -209,6 +219,7 @@ typedef enum _Ecore_Wl_Clipboard_State Ecore_Wl_Clipboard_State;
 typedef enum _Ecore_Wl_Indicator_Opacity_Mode Ecore_Wl_Indicator_Opacity_Mode;
 typedef enum _Ecore_Wl_Indicator_Visible_Type Ecore_Wl_Indicator_Visible_Type;
 typedef enum _Ecore_Wl_Window_Stack_Mode Ecore_Wl_Window_Stack_Mode;
+typedef enum _Ecore_Wl_Window_Visibility_Type Ecore_Wl_Window_Visibility_Type;
 
 /** @since 1.7.6 */
 struct _Ecore_Wl_Global
@@ -289,6 +300,13 @@ struct _Ecore_Wl_Event_Window_Visibility_Change
    int          fully_obscured;
 };
 
+struct _Ecore_Wl_Event_Window_Pre_Visibility_Change
+{
+   unsigned int win;
+   Ecore_Wl_Window_Visibility_Type type;
+   unsigned int option;
+};
+
 struct _Ecore_Wl_Event_Window_Rotate
 {
    unsigned int win;
@@ -506,6 +524,7 @@ EAPI extern int ECORE_WL_EVENT_WINDOW_CONFIGURE;
 EAPI extern int ECORE_WL_EVENT_WINDOW_ACTIVATE;
 EAPI extern int ECORE_WL_EVENT_WINDOW_DEACTIVATE;
 EAPI extern int ECORE_WL_EVENT_WINDOW_VISIBILITY_CHANGE;
+EAPI extern int ECORE_WL_EVENT_WINDOW_PRE_VISIBILITY_CHANGE;
 EAPI extern int ECORE_WL_EVENT_WINDOW_SHOW;
 EAPI extern int ECORE_WL_EVENT_WINDOW_HIDE;
 EAPI extern int ECORE_WL_EVENT_WINDOW_LOWER;
index 5817ea5..df3d8a0 100644 (file)
@@ -184,6 +184,7 @@ EAPI int ECORE_WL_EVENT_WINDOW_CONFIGURE = 0;
 EAPI int ECORE_WL_EVENT_WINDOW_ACTIVATE = 0;
 EAPI int ECORE_WL_EVENT_WINDOW_DEACTIVATE = 0;
 EAPI int ECORE_WL_EVENT_WINDOW_VISIBILITY_CHANGE = 0;
+EAPI int ECORE_WL_EVENT_WINDOW_PRE_VISIBILITY_CHANGE = 0;
 EAPI int ECORE_WL_EVENT_WINDOW_SHOW = 0;
 EAPI int ECORE_WL_EVENT_WINDOW_HIDE = 0;
 EAPI int ECORE_WL_EVENT_WINDOW_LOWER = 0;
@@ -279,6 +280,7 @@ ecore_wl_init(const char *name)
         ECORE_WL_EVENT_WINDOW_ACTIVATE = ecore_event_type_new();
         ECORE_WL_EVENT_WINDOW_DEACTIVATE = ecore_event_type_new();
         ECORE_WL_EVENT_WINDOW_VISIBILITY_CHANGE = ecore_event_type_new();
+        ECORE_WL_EVENT_WINDOW_PRE_VISIBILITY_CHANGE = ecore_event_type_new();
         ECORE_WL_EVENT_WINDOW_SHOW = ecore_event_type_new();
         ECORE_WL_EVENT_WINDOW_HIDE = ecore_event_type_new();
         ECORE_WL_EVENT_WINDOW_LOWER = ecore_event_type_new();
@@ -998,8 +1000,8 @@ _ecore_wl_cb_handle_global(void *data, struct wl_registry *registry, unsigned in
      }
    else if (!strcmp(interface, "tizen_policy"))
      {
-        if (version >= 3)
-          client_version = 3;
+        if (version >= 5)
+          client_version = 5;
         else
           client_version = version;
 
index 6463273..2b48846 100644 (file)
@@ -21,6 +21,7 @@ static void _ecore_xdg_handle_surface_delete(void *data, struct xdg_surface *xdg
 static void _ecore_xdg_handle_popup_done(void *data, struct xdg_popup *xdg_popup);
 static void _ecore_session_recovery_uuid(void *data, struct session_recovery *session_recovery, const char *uuid);
 static void _ecore_wl_window_cb_visibility_change(void *data, struct tizen_visibility *tizen_visibility, uint32_t visibility);
+static void _ecore_wl_window_cb_visibility_change_v5(void *data, struct tizen_visibility *tizen_visibility, uint32_t type, uint32_t option);
 static void _ecore_wl_window_cb_position_change(void *data, struct tizen_position *tizen_position, int32_t x, int32_t y);
 static void _ecore_wl_window_cb_available_angles_done(void *data, struct tizen_rotation *tizen_rotation, uint32_t angles);
 static void _ecore_wl_window_cb_preferred_angle_done(void *data, struct tizen_rotation *tizen_rotation, uint32_t angle);
@@ -55,6 +56,7 @@ static const struct xdg_popup_listener _ecore_xdg_popup_listener =
 static const struct tizen_visibility_listener _ecore_tizen_visibility_listener =
 {
    _ecore_wl_window_cb_visibility_change,
+   _ecore_wl_window_cb_visibility_change_v5,
 };
 
 static const struct tizen_position_listener _ecore_tizen_position_listener =
@@ -1686,6 +1688,29 @@ _ecore_wl_window_cb_visibility_change(void *data, struct tizen_visibility *tizen
 }
 
 static void
+_ecore_wl_window_cb_visibility_change_v5(void *data, struct tizen_visibility *tizen_visibility EINA_UNUSED, uint32_t type, uint32_t option)
+{
+   Ecore_Wl_Window *win = (Ecore_Wl_Window *)data;
+   Ecore_Wl_Event_Window_Pre_Visibility_Change *ev;
+
+   LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+   EINA_SAFETY_ON_NULL_RETURN(win);
+
+   if (type == TIZEN_VISIBILITY_VISIBILITY_PRE_UNOBSCURED)
+     {
+        ev = calloc(1, sizeof(Ecore_Wl_Event_Window_Pre_Visibility_Change));
+        EINA_SAFETY_ON_NULL_RETURN(ev);
+
+        ev->win = win->id;
+        ev->type = ECORE_WL_WINDOW_VISIBILITY_TYPE_PRE_UNOBSCURED;
+        ev->option = option;
+
+        ecore_event_add(ECORE_WL_EVENT_WINDOW_PRE_VISIBILITY_CHANGE, ev, NULL, NULL);
+     }
+}
+
+static void
 _ecore_wl_window_cb_available_angles_done(void *data EINA_UNUSED, struct tizen_rotation *tizen_rotation EINA_UNUSED, uint32_t angles EINA_UNUSED)
 {
    return;