ecore/wayland: Do not use win->id directly.
authorRafael Antognolli <rafael.antognolli@intel.com>
Thu, 31 Oct 2013 22:02:40 +0000 (20:02 -0200)
committerRafael Antognolli <rafael.antognolli@intel.com>
Thu, 31 Oct 2013 23:35:13 +0000 (21:35 -0200)
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
src/lib/ecore_wayland/ecore_wl_window.c
src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c
src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c
src/modules/ecore_imf/wayland/wayland_imcontext.c

index d190e0f..899f80e 100644 (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.
  *
index 0de39d9..8307f65 100644 (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)
index 369d7ca..6fd5627 100644 (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);
index 6cf845e..9e8fc4d 100644 (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);
index 00a2dde..84d0a50 100644 (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;