ecore/wayland: Add ecore_wl_window_keyboard_get().
authorRafael Antognolli <rafael.antognolli@intel.com>
Fri, 1 Nov 2013 17:51:38 +0000 (15:51 -0200)
committerRafael Antognolli <rafael.antognolli@intel.com>
Fri, 1 Nov 2013 17:51:38 +0000 (15:51 -0200)
Instead of use direct access to the Ecore_Wl_Window structure, just use
the getter, so we can hide the internals.

src/lib/ecore_wayland/Ecore_Wayland.h
src/lib/ecore_wayland/ecore_wl_window.c
src/modules/ecore_imf/wayland/wayland_imcontext.c

index d42bae7..fe37630 100644 (file)
@@ -633,6 +633,8 @@ EAPI int ecore_wl_window_id_get(Ecore_Wl_Window *win);
 EAPI void ecore_wl_window_title_set(Ecore_Wl_Window *win, const char *title);
 EAPI void ecore_wl_window_class_name_set(Ecore_Wl_Window *win, const char *class_name);
 
+EAPI Ecore_Wl_Input *ecore_wl_window_keyboard_get(Ecore_Wl_Window *win);
+
 /**
  * Returns a wl_surface with no association to any wl_shell_surface.
  *
index 99463da..9b732d1 100644 (file)
@@ -714,6 +714,17 @@ ecore_wl_window_class_name_set(Ecore_Wl_Window *win, const char *class_name)
      wl_shell_surface_set_class(win->shell_surface, win->class_name);
 }
 
+/* @since 1.8 */
+/* Maybe we need an ecore_wl_window_pointer_get() too */
+EAPI Ecore_Wl_Input *
+ecore_wl_window_keyboard_get(Ecore_Wl_Window *win)
+{
+   LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+   if (!win) return 0;
+   return win->keyboard_device;
+}
+
 
 /* local functions */
 static void 
index 84d0a50..7a418f3 100644 (file)
@@ -625,7 +625,7 @@ wayland_im_context_focus_in(Ecore_IMF_Context *ctx)
 
    if (!imcontext->window) return;
 
-   input = imcontext->window->keyboard_device;
+   input = ecore_wl_window_keyboard_get(imcontext->window);
    if (!input)
      return;