From dd18206d860fa9cd1cea4ce01657c21678318bca Mon Sep 17 00:00:00 2001 From: Rafael Antognolli Date: Thu, 31 Oct 2013 20:02:40 -0200 Subject: [PATCH] ecore/wayland: Do not use win->id directly. Use a getter for it instead, so we don't need to expose the Ecore_Wl_Window struct just because of it. --- src/lib/ecore_wayland/Ecore_Wayland.h | 2 ++ src/lib/ecore_wayland/ecore_wl_window.c | 11 +++++++++++ .../ecore_evas/engines/wayland/ecore_evas_wayland_egl.c | 2 +- .../ecore_evas/engines/wayland/ecore_evas_wayland_shm.c | 2 +- src/modules/ecore_imf/wayland/wayland_imcontext.c | 4 ++-- 5 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/lib/ecore_wayland/Ecore_Wayland.h b/src/lib/ecore_wayland/Ecore_Wayland.h index d190e0f..899f80e 100644 --- a/src/lib/ecore_wayland/Ecore_Wayland.h +++ b/src/lib/ecore_wayland/Ecore_Wayland.h @@ -626,6 +626,8 @@ EAPI void ecore_wl_window_cursor_from_name_set(Ecore_Wl_Window *win, const char EAPI void ecore_wl_window_cursor_default_restore(Ecore_Wl_Window *win); EAPI void ecore_wl_window_parent_set(Ecore_Wl_Window *win, Ecore_Wl_Window *parent); +EAPI int ecore_wl_window_id_get(Ecore_Wl_Window *win); + /** * Returns a wl_surface with no association to any wl_shell_surface. * diff --git a/src/lib/ecore_wayland/ecore_wl_window.c b/src/lib/ecore_wayland/ecore_wl_window.c index 0de39d9..8307f65 100644 --- a/src/lib/ecore_wayland/ecore_wl_window.c +++ b/src/lib/ecore_wayland/ecore_wl_window.c @@ -687,6 +687,17 @@ ecore_wl_window_rotation_get(Ecore_Wl_Window *win) return win->rotation; } +/* @since 1.8 */ +EAPI int +ecore_wl_window_id_get(Ecore_Wl_Window *win) +{ + LOGFN(__FILE__, __LINE__, __FUNCTION__); + + if (!win) return 0; + return win->id; +} + + /* local functions */ static void _ecore_wl_window_cb_ping(void *data EINA_UNUSED, struct wl_shell_surface *shell_surface, unsigned int serial) diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c index 369d7ca..6fd5627 100644 --- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c +++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c @@ -182,7 +182,7 @@ ecore_evas_wayland_egl_new_internal(const char *disp_name, unsigned int parent, wdata->win = ecore_wl_window_new(p, x, y, w + fw, h + fh, ECORE_WL_WINDOW_BUFFER_TYPE_EGL_WINDOW); - ee->prop.window = wdata->win->id; + ee->prop.window = ecore_wl_window_id_get(wdata->win); ee->evas = evas_new(); evas_data_attach_set(ee->evas, ee); diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c index 6cf845e..9e8fc4d 100644 --- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c +++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c @@ -179,7 +179,7 @@ ecore_evas_wayland_shm_new_internal(const char *disp_name, unsigned int parent, wdata->win = ecore_wl_window_new(p, x, y, w + fw, h + fh, ECORE_WL_WINDOW_BUFFER_TYPE_SHM); - ee->prop.window = wdata->win->id; + ee->prop.window = ecore_wl_window_id_get(wdata->win); ee->evas = evas_new(); evas_data_attach_set(ee->evas, ee); diff --git a/src/modules/ecore_imf/wayland/wayland_imcontext.c b/src/modules/ecore_imf/wayland/wayland_imcontext.c index 00a2dde..84d0a50 100644 --- a/src/modules/ecore_imf/wayland/wayland_imcontext.c +++ b/src/modules/ecore_imf/wayland/wayland_imcontext.c @@ -474,8 +474,8 @@ text_input_keysym(void *data, strcpy((char *)e->key, key); strcpy((char *)e->string, string); - e->window = imcontext->window->id; - e->event_window = imcontext->window->id; + e->window = ecore_wl_window_id_get(imcontext->window); + e->event_window = ecore_wl_window_id_get(imcontext->window); e->timestamp = time; e->modifiers = 0; -- 2.7.4