From 8de0036a7eb92812139640267f346a0f246cf5cd Mon Sep 17 00:00:00 2001 From: Boram Park Date: Thu, 30 Apr 2015 14:04:02 +0900 Subject: [PATCH] support ECORE_WL_EVENT_WINDOW_SHOW/HIDE event Change-Id: I0d87d60d00e15abd8521242e62a97bebbe02805c --- src/lib/ecore_wayland/Ecore_Wayland.h | 18 +++++++++ src/lib/ecore_wayland/ecore_wl.c | 4 ++ src/lib/ecore_wayland/ecore_wl_window.c | 40 +++++++++++++++++++ .../wayland/ecore_evas_wayland_private.h | 1 + 4 files changed, 63 insertions(+) diff --git a/src/lib/ecore_wayland/Ecore_Wayland.h b/src/lib/ecore_wayland/Ecore_Wayland.h index 6863cb7990..e33c0b7167 100644 --- a/src/lib/ecore_wayland/Ecore_Wayland.h +++ b/src/lib/ecore_wayland/Ecore_Wayland.h @@ -57,6 +57,8 @@ 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_Show Ecore_Wl_Event_Window_Show; +typedef struct _Ecore_Wl_Event_Window_Hide Ecore_Wl_Event_Window_Hide; typedef struct _Ecore_Wl_Event_Dnd_Enter Ecore_Wl_Event_Dnd_Enter; typedef struct _Ecore_Wl_Event_Dnd_Position Ecore_Wl_Event_Dnd_Position; typedef struct _Ecore_Wl_Event_Dnd_Leave Ecore_Wl_Event_Dnd_Leave; @@ -169,6 +171,20 @@ struct _Ecore_Wl_Event_Window_Visibility_Change int fully_obscured; }; +struct _Ecore_Wl_Event_Window_Show +{ + unsigned int win; + unsigned int parent_win; + unsigned int event_win; +}; + +struct _Ecore_Wl_Event_Window_Hide +{ + unsigned int win; + unsigned int parent_win; + unsigned int event_win; +}; + struct _Ecore_Wl_Event_Dnd_Enter { unsigned int win, source; @@ -277,6 +293,8 @@ 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_SHOW; +EAPI extern int ECORE_WL_EVENT_WINDOW_HIDE; EAPI extern int ECORE_WL_EVENT_DND_ENTER; EAPI extern int ECORE_WL_EVENT_DND_POSITION; EAPI extern int ECORE_WL_EVENT_DND_LEAVE; diff --git a/src/lib/ecore_wayland/ecore_wl.c b/src/lib/ecore_wayland/ecore_wl.c index 7caa7ed605..a19b45a7ff 100644 --- a/src/lib/ecore_wayland/ecore_wl.c +++ b/src/lib/ecore_wayland/ecore_wl.c @@ -87,6 +87,8 @@ 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_SHOW = 0; +EAPI int ECORE_WL_EVENT_WINDOW_HIDE = 0; EAPI int ECORE_WL_EVENT_DND_ENTER = 0; EAPI int ECORE_WL_EVENT_DND_POSITION = 0; EAPI int ECORE_WL_EVENT_DND_LEAVE = 0; @@ -155,6 +157,8 @@ 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_SHOW = ecore_event_type_new(); + ECORE_WL_EVENT_WINDOW_HIDE = ecore_event_type_new(); ECORE_WL_EVENT_DND_ENTER = ecore_event_type_new(); ECORE_WL_EVENT_DND_POSITION = ecore_event_type_new(); ECORE_WL_EVENT_DND_LEAVE = ecore_event_type_new(); diff --git a/src/lib/ecore_wayland/ecore_wl_window.c b/src/lib/ecore_wayland/ecore_wl_window.c index 9223cb3559..ec1ea6571e 100644 --- a/src/lib/ecore_wayland/ecore_wl_window.c +++ b/src/lib/ecore_wayland/ecore_wl_window.c @@ -13,6 +13,8 @@ static void _ecore_wl_window_cb_popup_done(void *data, struct wl_shell_surface * static void _ecore_wl_window_cb_surface_enter(void *data, struct wl_surface *surface, struct wl_output *output EINA_UNUSED); static void _ecore_wl_window_cb_surface_leave(void *data, struct wl_surface *surface, struct wl_output *output EINA_UNUSED); static void _ecore_wl_window_configure_send(Ecore_Wl_Window *win, int w, int h, int edges); +static void _ecore_wl_window_show_send(Ecore_Wl_Window *win); +static void _ecore_wl_window_hide_send(Ecore_Wl_Window *win); static char *_ecore_wl_window_id_str_get(unsigned int win_id); static void _ecore_xdg_handle_surface_configure(void *data, struct xdg_surface *xdg_surface, int32_t width, int32_t height,struct wl_array *states, uint32_t serial); static void _ecore_xdg_handle_surface_delete(void *data, struct xdg_surface *xdg_surface); @@ -449,6 +451,8 @@ ecore_wl_window_show(Ecore_Wl_Window *win) default: break; } + + _ecore_wl_window_show_send(win); } EAPI void @@ -458,6 +462,8 @@ ecore_wl_window_hide(Ecore_Wl_Window *win) if (!win) return; + _ecore_wl_window_hide_send(win); + if (win->xdg_surface) xdg_surface_destroy(win->xdg_surface); win->xdg_surface = NULL; @@ -1226,6 +1232,40 @@ _ecore_wl_window_configure_send(Ecore_Wl_Window *win, int w, int h, int edges) ecore_event_add(ECORE_WL_EVENT_WINDOW_CONFIGURE, ev, NULL, NULL); } +static void +_ecore_wl_window_show_send(Ecore_Wl_Window *win) +{ + Ecore_Wl_Event_Window_Show *ev; + + LOGFN(__FILE__, __LINE__, __FUNCTION__); + + if (!(ev = calloc(1, sizeof(Ecore_Wl_Event_Window_Show)))) return; + ev->win = win->id; + if (win->parent) + ev->parent_win = win->parent->id; + else + ev->parent_win = 0; + ev->event_win = win->id; + ecore_event_add(ECORE_WL_EVENT_WINDOW_SHOW, ev, NULL, NULL); +} + +static void +_ecore_wl_window_hide_send(Ecore_Wl_Window *win) +{ + Ecore_Wl_Event_Window_Hide *ev; + + LOGFN(__FILE__, __LINE__, __FUNCTION__); + + if (!(ev = calloc(1, sizeof(Ecore_Wl_Event_Window_Hide)))) return; + ev->win = win->id; + if (win->parent) + ev->parent_win = win->parent->id; + else + ev->parent_win = 0; + ev->event_win = win->id; + ecore_event_add(ECORE_WL_EVENT_WINDOW_HIDE, ev, NULL, NULL); +} + static char * _ecore_wl_window_id_str_get(unsigned int win_id) { diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h index 98e2624936..597c776feb 100644 --- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h +++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h @@ -55,6 +55,7 @@ void _ecore_evas_wl_common_callback_mouse_out_set(Ecore_Evas *ee, void (*func)(E void _ecore_evas_wl_common_move(Ecore_Evas *ee, int x, int y); void _ecore_evas_wl_common_resize(Ecore_Evas *ee, int w, int h); void _ecore_evas_wl_common_raise(Ecore_Evas *ee); +void _ecore_evas_wl_common_activate(Ecore_Evas *ee); void _ecore_evas_wl_common_title_set(Ecore_Evas *ee, const char *title); void _ecore_evas_wl_common_name_class_set(Ecore_Evas *ee, const char *n, const char *c); void _ecore_evas_wl_common_size_min_set(Ecore_Evas *ee, int w, int h);