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.
This commit is contained in:
Rafael Antognolli 2013-10-31 20:02:40 -02:00
parent e56428f4ad
commit dd18206d86
5 changed files with 17 additions and 4 deletions

View File

@ -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.
*

View File

@ -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)

View File

@ -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);

View File

@ -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);

View File

@ -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;