diff options
author | Rafael Antognolli <rafael.antognolli@intel.com> | 2013-10-31 19:09:30 -0200 |
---|---|---|
committer | Rafael Antognolli <rafael.antognolli@intel.com> | 2013-10-31 21:35:13 -0200 |
commit | e56428f4ad7b015c73b1959cf1d6aac154ca4ac0 (patch) | |
tree | 0ff0f8a4a979d64c3a95e26d14789a9190574b7e /src | |
parent | 35d2f195de262d846c5e3f6dc5634921afe46606 (diff) |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/ecore_wayland/Ecore_Wayland.h | 53 | ||||
-rw-r--r-- | src/lib/ecore_wayland/ecore_wl_input.c | 13 | ||||
-rw-r--r-- | src/lib/ecore_wayland/ecore_wl_private.h | 52 | ||||
-rw-r--r-- | 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 d7b6c6936b..d190e0f82a 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 | |||
109 | void *data; | 109 | void *data; |
110 | }; | 110 | }; |
111 | 111 | ||
112 | struct _Ecore_Wl_Input | ||
113 | { | ||
114 | Ecore_Wl_Display *display; | ||
115 | struct wl_seat *seat; | ||
116 | struct wl_pointer *pointer; | ||
117 | struct wl_keyboard *keyboard; | ||
118 | struct wl_touch *touch; | ||
119 | |||
120 | const char *cursor_name; | ||
121 | struct wl_cursor *cursor; | ||
122 | struct wl_surface *cursor_surface; | ||
123 | struct wl_callback *cursor_frame_cb; | ||
124 | Ecore_Timer *cursor_timer; | ||
125 | unsigned int cursor_current_index; | ||
126 | |||
127 | struct wl_data_device *data_device; | ||
128 | struct wl_data_source *data_source; | ||
129 | struct wl_array data_types; | ||
130 | |||
131 | Ecore_Wl_Window *pointer_focus; | ||
132 | Ecore_Wl_Window *keyboard_focus; | ||
133 | |||
134 | unsigned int button; | ||
135 | unsigned int timestamp; | ||
136 | unsigned int modifiers; | ||
137 | unsigned int pointer_enter_serial; | ||
138 | int sx, sy; | ||
139 | |||
140 | struct wl_list link; | ||
141 | |||
142 | Ecore_Wl_Window *grab; | ||
143 | unsigned int grab_button; | ||
144 | |||
145 | Ecore_Wl_Dnd_Source *drag_source; | ||
146 | Ecore_Wl_Dnd_Source *selection_source; | ||
147 | |||
148 | struct | ||
149 | { | ||
150 | struct xkb_keymap *keymap; | ||
151 | struct xkb_state *state; | ||
152 | xkb_mod_mask_t control_mask; | ||
153 | xkb_mod_mask_t alt_mask; | ||
154 | xkb_mod_mask_t shift_mask; | ||
155 | } xkb; | ||
156 | |||
157 | struct | ||
158 | { | ||
159 | Ecore_Timer *tmr; | ||
160 | unsigned int sym, key, time; | ||
161 | } repeat; | ||
162 | }; | ||
163 | |||
164 | struct _Ecore_Wl_Window | 112 | struct _Ecore_Wl_Window |
165 | { | 113 | { |
166 | Ecore_Wl_Display *display; | 114 | Ecore_Wl_Display *display; |
@@ -524,6 +472,7 @@ EAPI void ecore_wl_input_ungrab(Ecore_Wl_Input *input); | |||
524 | EAPI void ecore_wl_input_pointer_set(Ecore_Wl_Input *input, struct wl_surface *surface, int hot_x, int hot_y); | 472 | EAPI void ecore_wl_input_pointer_set(Ecore_Wl_Input *input, struct wl_surface *surface, int hot_x, int hot_y); |
525 | EAPI void ecore_wl_input_cursor_from_name_set(Ecore_Wl_Input *input, const char *cursor_name); | 473 | EAPI void ecore_wl_input_cursor_from_name_set(Ecore_Wl_Input *input, const char *cursor_name); |
526 | EAPI void ecore_wl_input_cursor_default_restore(Ecore_Wl_Input *input); | 474 | EAPI void ecore_wl_input_cursor_default_restore(Ecore_Wl_Input *input); |
475 | EAPI struct wl_seat *ecore_wl_input_seat_get(Ecore_Wl_Input *input); | ||
527 | 476 | ||
528 | EAPI struct wl_list *ecore_wl_outputs_get(void); | 477 | EAPI struct wl_list *ecore_wl_outputs_get(void); |
529 | 478 | ||
diff --git a/src/lib/ecore_wayland/ecore_wl_input.c b/src/lib/ecore_wayland/ecore_wl_input.c index 2cdc1ec773..bd1e01042d 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) | |||
287 | return _ecore_wl_disp->input; | 287 | return _ecore_wl_disp->input; |
288 | } | 288 | } |
289 | 289 | ||
290 | /** | ||
291 | * @since 1.8 | ||
292 | */ | ||
293 | EAPI struct wl_seat * | ||
294 | ecore_wl_input_seat_get(Ecore_Wl_Input *input) | ||
295 | { | ||
296 | LOGFN(__FILE__, __LINE__, __FUNCTION__); | ||
297 | |||
298 | if (!input) return NULL; | ||
299 | |||
300 | return input->seat; | ||
301 | } | ||
302 | |||
290 | /* local functions */ | 303 | /* local functions */ |
291 | void | 304 | void |
292 | _ecore_wl_input_add(Ecore_Wl_Display *ewd, unsigned int id) | 305 | _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 fdbd3c9bef..06be1a5b58 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 | |||
92 | void *data; | 92 | void *data; |
93 | }; | 93 | }; |
94 | 94 | ||
95 | struct _Ecore_Wl_Input | ||
96 | { | ||
97 | Ecore_Wl_Display *display; | ||
98 | struct wl_seat *seat; | ||
99 | struct wl_pointer *pointer; | ||
100 | struct wl_keyboard *keyboard; | ||
101 | struct wl_touch *touch; | ||
102 | |||
103 | const char *cursor_name; | ||
104 | struct wl_cursor *cursor; | ||
105 | struct wl_surface *cursor_surface; | ||
106 | struct wl_callback *cursor_frame_cb; | ||
107 | Ecore_Timer *cursor_timer; | ||
108 | unsigned int cursor_current_index; | ||
109 | |||
110 | struct wl_data_device *data_device; | ||
111 | struct wl_data_source *data_source; | ||
112 | struct wl_array data_types; | ||
113 | |||
114 | Ecore_Wl_Window *pointer_focus; | ||
115 | Ecore_Wl_Window *keyboard_focus; | ||
116 | |||
117 | unsigned int button; | ||
118 | unsigned int timestamp; | ||
119 | unsigned int modifiers; | ||
120 | unsigned int pointer_enter_serial; | ||
121 | int sx, sy; | ||
122 | |||
123 | struct wl_list link; | ||
124 | |||
125 | Ecore_Wl_Window *grab; | ||
126 | unsigned int grab_button; | ||
127 | |||
128 | Ecore_Wl_Dnd_Source *drag_source; | ||
129 | Ecore_Wl_Dnd_Source *selection_source; | ||
130 | |||
131 | struct | ||
132 | { | ||
133 | struct xkb_keymap *keymap; | ||
134 | struct xkb_state *state; | ||
135 | xkb_mod_mask_t control_mask; | ||
136 | xkb_mod_mask_t alt_mask; | ||
137 | xkb_mod_mask_t shift_mask; | ||
138 | } xkb; | ||
139 | |||
140 | struct | ||
141 | { | ||
142 | Ecore_Timer *tmr; | ||
143 | unsigned int sym, key, time; | ||
144 | } repeat; | ||
145 | }; | ||
146 | |||
95 | struct _Ecore_Wl_Dnd | 147 | struct _Ecore_Wl_Dnd |
96 | { | 148 | { |
97 | Ecore_Wl_Display *ewd; | 149 | 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 07072e4760..00a2dde9fa 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) | |||
619 | { | 619 | { |
620 | WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx); | 620 | WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx); |
621 | Ecore_Wl_Input *input; | 621 | Ecore_Wl_Input *input; |
622 | struct wl_seat *seat; | ||
622 | 623 | ||
623 | EINA_LOG_DOM_INFO(_ecore_imf_wayland_log_dom, "focus-in"); | 624 | EINA_LOG_DOM_INFO(_ecore_imf_wayland_log_dom, "focus-in"); |
624 | 625 | ||
625 | if (!imcontext->window) return; | 626 | if (!imcontext->window) return; |
626 | 627 | ||
627 | input = imcontext->window->keyboard_device; | 628 | input = imcontext->window->keyboard_device; |
628 | if (!input || !input->seat) | 629 | if (!input) |
630 | return; | ||
631 | |||
632 | seat = ecore_wl_input_seat_get(input); | ||
633 | if (!seat) | ||
629 | return; | 634 | return; |
630 | 635 | ||
631 | imcontext->input = input; | 636 | imcontext->input = input; |
@@ -633,8 +638,7 @@ wayland_im_context_focus_in(Ecore_IMF_Context *ctx) | |||
633 | if (imcontext->text_input) | 638 | if (imcontext->text_input) |
634 | { | 639 | { |
635 | wl_text_input_show_input_panel(imcontext->text_input); | 640 | wl_text_input_show_input_panel(imcontext->text_input); |
636 | wl_text_input_activate(imcontext->text_input, | 641 | wl_text_input_activate(imcontext->text_input, seat, |
637 | input->seat, | ||
638 | ecore_wl_window_surface_get(imcontext->window)); | 642 | ecore_wl_window_surface_get(imcontext->window)); |
639 | } | 643 | } |
640 | } | 644 | } |
@@ -650,7 +654,7 @@ wayland_im_context_focus_out(Ecore_IMF_Context *ctx) | |||
650 | 654 | ||
651 | if (imcontext->text_input) | 655 | if (imcontext->text_input) |
652 | wl_text_input_deactivate(imcontext->text_input, | 656 | wl_text_input_deactivate(imcontext->text_input, |
653 | imcontext->input->seat); | 657 | ecore_wl_input_seat_get(imcontext->input)); |
654 | 658 | ||
655 | imcontext->input = NULL; | 659 | imcontext->input = NULL; |
656 | } | 660 | } |