antognolli pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=e56428f4ad7b015c73b1959cf1d6aac154ca4ac0

commit e56428f4ad7b015c73b1959cf1d6aac154ca4ac0
Author: Rafael Antognolli <rafael.antogno...@intel.com>
Date:   Thu Oct 31 19:09:30 2013 -0200

    ecore/wayland: Make Ecore_Wl_Input private.
    
    It's mostly only used inside ecore_wayland library anyway.
    
    The only bit needed outside of the library is the "seat" pointer, but a
    new function was added to retrieve such pointer from Ecore_Wl_Input.
---
 src/lib/ecore_wayland/Ecore_Wayland.h             | 53 +----------------------
 src/lib/ecore_wayland/ecore_wl_input.c            | 13 ++++++
 src/lib/ecore_wayland/ecore_wl_private.h          | 52 ++++++++++++++++++++++
 src/modules/ecore_imf/wayland/wayland_imcontext.c | 12 +++--
 4 files changed, 74 insertions(+), 56 deletions(-)

diff --git a/src/lib/ecore_wayland/Ecore_Wayland.h 
b/src/lib/ecore_wayland/Ecore_Wayland.h
index d7b6c69..d190e0f 100644
--- a/src/lib/ecore_wayland/Ecore_Wayland.h
+++ b/src/lib/ecore_wayland/Ecore_Wayland.h
@@ -109,58 +109,6 @@ struct _Ecore_Wl_Output
    void *data;
 };
 
-struct _Ecore_Wl_Input
-{
-   Ecore_Wl_Display *display;
-   struct wl_seat *seat;
-   struct wl_pointer *pointer;
-   struct wl_keyboard *keyboard;
-   struct wl_touch *touch;
-
-   const char *cursor_name;
-   struct wl_cursor *cursor;
-   struct wl_surface *cursor_surface;
-   struct wl_callback *cursor_frame_cb;
-   Ecore_Timer *cursor_timer;
-   unsigned int cursor_current_index;
-
-   struct wl_data_device *data_device;
-   struct wl_data_source *data_source;
-   struct wl_array data_types;
-
-   Ecore_Wl_Window *pointer_focus;
-   Ecore_Wl_Window *keyboard_focus;
-
-   unsigned int button;
-   unsigned int timestamp;
-   unsigned int modifiers;
-   unsigned int pointer_enter_serial;
-   int sx, sy;
-
-   struct wl_list link;
-
-   Ecore_Wl_Window *grab;
-   unsigned int grab_button;
-
-   Ecore_Wl_Dnd_Source *drag_source;
-   Ecore_Wl_Dnd_Source *selection_source;
-
-   struct
-     {
-        struct xkb_keymap *keymap;
-        struct xkb_state *state;
-        xkb_mod_mask_t control_mask;
-        xkb_mod_mask_t alt_mask;
-        xkb_mod_mask_t shift_mask;
-     } xkb;
-
-   struct 
-     {
-        Ecore_Timer *tmr;
-        unsigned int sym, key, time;
-     } repeat;
-};
-
 struct _Ecore_Wl_Window
 {
    Ecore_Wl_Display *display;
@@ -524,6 +472,7 @@ EAPI void ecore_wl_input_ungrab(Ecore_Wl_Input *input);
 EAPI void ecore_wl_input_pointer_set(Ecore_Wl_Input *input, struct wl_surface 
*surface, int hot_x, int hot_y);
 EAPI void ecore_wl_input_cursor_from_name_set(Ecore_Wl_Input *input, const 
char *cursor_name);
 EAPI void ecore_wl_input_cursor_default_restore(Ecore_Wl_Input *input);
+EAPI struct wl_seat *ecore_wl_input_seat_get(Ecore_Wl_Input *input);
 
 EAPI struct wl_list *ecore_wl_outputs_get(void);
 
diff --git a/src/lib/ecore_wayland/ecore_wl_input.c 
b/src/lib/ecore_wayland/ecore_wl_input.c
index 2cdc1ec..bd1e010 100644
--- a/src/lib/ecore_wayland/ecore_wl_input.c
+++ b/src/lib/ecore_wayland/ecore_wl_input.c
@@ -287,6 +287,19 @@ ecore_wl_input_get(void)
    return _ecore_wl_disp->input;
 }
 
+/**
+ * @since 1.8
+ */
+EAPI struct wl_seat *
+ecore_wl_input_seat_get(Ecore_Wl_Input *input)
+{
+   LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+   if (!input) return NULL;
+
+   return input->seat;
+}
+
 /* local functions */
 void 
 _ecore_wl_input_add(Ecore_Wl_Display *ewd, unsigned int id)
diff --git a/src/lib/ecore_wayland/ecore_wl_private.h 
b/src/lib/ecore_wayland/ecore_wl_private.h
index fdbd3c9..06be1a5 100644
--- a/src/lib/ecore_wayland/ecore_wl_private.h
+++ b/src/lib/ecore_wayland/ecore_wl_private.h
@@ -92,6 +92,58 @@ struct _Ecore_Wl_Display
    void *data;
 };
 
+struct _Ecore_Wl_Input
+{
+   Ecore_Wl_Display *display;
+   struct wl_seat *seat;
+   struct wl_pointer *pointer;
+   struct wl_keyboard *keyboard;
+   struct wl_touch *touch;
+
+   const char *cursor_name;
+   struct wl_cursor *cursor;
+   struct wl_surface *cursor_surface;
+   struct wl_callback *cursor_frame_cb;
+   Ecore_Timer *cursor_timer;
+   unsigned int cursor_current_index;
+
+   struct wl_data_device *data_device;
+   struct wl_data_source *data_source;
+   struct wl_array data_types;
+
+   Ecore_Wl_Window *pointer_focus;
+   Ecore_Wl_Window *keyboard_focus;
+
+   unsigned int button;
+   unsigned int timestamp;
+   unsigned int modifiers;
+   unsigned int pointer_enter_serial;
+   int sx, sy;
+
+   struct wl_list link;
+
+   Ecore_Wl_Window *grab;
+   unsigned int grab_button;
+
+   Ecore_Wl_Dnd_Source *drag_source;
+   Ecore_Wl_Dnd_Source *selection_source;
+
+   struct
+     {
+        struct xkb_keymap *keymap;
+        struct xkb_state *state;
+        xkb_mod_mask_t control_mask;
+        xkb_mod_mask_t alt_mask;
+        xkb_mod_mask_t shift_mask;
+     } xkb;
+
+   struct
+     {
+        Ecore_Timer *tmr;
+        unsigned int sym, key, time;
+     } repeat;
+};
+
 struct _Ecore_Wl_Dnd
 {
    Ecore_Wl_Display *ewd;
diff --git a/src/modules/ecore_imf/wayland/wayland_imcontext.c 
b/src/modules/ecore_imf/wayland/wayland_imcontext.c
index 07072e4..00a2dde 100644
--- a/src/modules/ecore_imf/wayland/wayland_imcontext.c
+++ b/src/modules/ecore_imf/wayland/wayland_imcontext.c
@@ -619,13 +619,18 @@ wayland_im_context_focus_in(Ecore_IMF_Context *ctx)
 {
    WaylandIMContext *imcontext = (WaylandIMContext 
*)ecore_imf_context_data_get(ctx);
    Ecore_Wl_Input *input;
+   struct wl_seat *seat;
 
    EINA_LOG_DOM_INFO(_ecore_imf_wayland_log_dom, "focus-in");
 
    if (!imcontext->window) return;
 
    input = imcontext->window->keyboard_device;
-   if (!input || !input->seat)
+   if (!input)
+     return;
+
+   seat = ecore_wl_input_seat_get(input);
+   if (!seat)
      return;
 
    imcontext->input = input;
@@ -633,8 +638,7 @@ wayland_im_context_focus_in(Ecore_IMF_Context *ctx)
    if (imcontext->text_input)
      {
         wl_text_input_show_input_panel(imcontext->text_input);
-        wl_text_input_activate(imcontext->text_input,
-                               input->seat,
+        wl_text_input_activate(imcontext->text_input, seat,
                                ecore_wl_window_surface_get(imcontext->window));
      }
 }
@@ -650,7 +654,7 @@ wayland_im_context_focus_out(Ecore_IMF_Context *ctx)
 
    if (imcontext->text_input)
      wl_text_input_deactivate(imcontext->text_input,
-                              imcontext->input->seat);
+                              ecore_wl_input_seat_get(imcontext->input));
 
    imcontext->input = NULL;
 }

-- 


Reply via email to