From b77ac9b57ef6367adaa2812be874575559b54d72 Mon Sep 17 00:00:00 2001 From: Rafael Antognolli Date: Fri, 1 Nov 2013 15:51:38 -0200 Subject: [PATCH] ecore/wayland: Add ecore_wl_window_keyboard_get(). 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 | 2 ++ src/lib/ecore_wayland/ecore_wl_window.c | 11 +++++++++++ src/modules/ecore_imf/wayland/wayland_imcontext.c | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/lib/ecore_wayland/Ecore_Wayland.h b/src/lib/ecore_wayland/Ecore_Wayland.h index d42bae7..fe37630 100644 --- a/src/lib/ecore_wayland/Ecore_Wayland.h +++ b/src/lib/ecore_wayland/Ecore_Wayland.h @@ -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. * diff --git a/src/lib/ecore_wayland/ecore_wl_window.c b/src/lib/ecore_wayland/ecore_wl_window.c index 99463da..9b732d1 100644 --- a/src/lib/ecore_wayland/ecore_wl_window.c +++ b/src/lib/ecore_wayland/ecore_wl_window.c @@ -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 diff --git a/src/modules/ecore_imf/wayland/wayland_imcontext.c b/src/modules/ecore_imf/wayland/wayland_imcontext.c index 84d0a50..7a418f3 100644 --- a/src/modules/ecore_imf/wayland/wayland_imcontext.c +++ b/src/modules/ecore_imf/wayland/wayland_imcontext.c @@ -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; -- 2.7.4