diff options
author | Rafael Antognolli <rafael.antognolli@intel.com> | 2013-10-31 20:02:40 -0200 |
---|---|---|
committer | Rafael Antognolli <rafael.antognolli@intel.com> | 2013-10-31 21:35:13 -0200 |
commit | dd18206d860fa9cd1cea4ce01657c21678318bca (patch) | |
tree | b6ee327486fad1f66fe4a7c6e8f6da2a96e22996 | |
parent | e56428f4ad7b015c73b1959cf1d6aac154ca4ac0 (diff) |
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.
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 d190e0f82..899f80e0c 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 0de39d9e5..8307f654c 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 369d7ca56..6fd562726 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 6cf845e6c..9e8fc4d2c 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 00a2dde9f..84d0a5028 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; |