summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Makefile_Ecore_IMF.am6
-rw-r--r--src/modules/ecore_imf/wayland/wayland_imcontext.c24
-rw-r--r--src/modules/ecore_imf/wayland/wayland_imcontext.h4
-rw-r--r--src/modules/ecore_imf/wayland/wayland_module.c49
4 files changed, 48 insertions, 35 deletions
diff --git a/src/Makefile_Ecore_IMF.am b/src/Makefile_Ecore_IMF.am
index 8f227f4..87d0f63 100644
--- a/src/Makefile_Ecore_IMF.am
+++ b/src/Makefile_Ecore_IMF.am
@@ -139,15 +139,15 @@ modules/ecore_imf/wayland/text-protocol.c
139modules_ecore_imf_wayland_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ 139modules_ecore_imf_wayland_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
140@ECORE_IMF_CFLAGS@ \ 140@ECORE_IMF_CFLAGS@ \
141@ECORE_EVAS_CFLAGS@ \ 141@ECORE_EVAS_CFLAGS@ \
142@ECORE_WAYLAND_CFLAGS@ 142@ECORE_WL2_CFLAGS@
143modules_ecore_imf_wayland_module_la_LIBADD = \ 143modules_ecore_imf_wayland_module_la_LIBADD = \
144@USE_ECORE_IMF_LIBS@ \ 144@USE_ECORE_IMF_LIBS@ \
145@USE_ECORE_EVAS_LIBS@ \ 145@USE_ECORE_EVAS_LIBS@ \
146@USE_ECORE_WAYLAND_LIBS@ 146@USE_ECORE_WL2_LIBS@
147modules_ecore_imf_wayland_module_la_DEPENDENCIES = \ 147modules_ecore_imf_wayland_module_la_DEPENDENCIES = \
148@USE_ECORE_IMF_INTERNAL_LIBS@ \ 148@USE_ECORE_IMF_INTERNAL_LIBS@ \
149@USE_ECORE_EVAS_INTERNAL_LIBS@ \ 149@USE_ECORE_EVAS_INTERNAL_LIBS@ \
150@USE_ECORE_WAYLAND_INTERNAL_LIBS@ 150@USE_ECORE_WL2_INTERNAL_LIBS@
151modules_ecore_imf_wayland_module_la_LDFLAGS = -module @EFL_LTMODULE_FLAGS@ 151modules_ecore_imf_wayland_module_la_LDFLAGS = -module @EFL_LTMODULE_FLAGS@
152modules_ecore_imf_wayland_module_la_LIBTOOLFLAGS = --tag=disable-static 152modules_ecore_imf_wayland_module_la_LIBTOOLFLAGS = --tag=disable-static
153endif 153endif
diff --git a/src/modules/ecore_imf/wayland/wayland_imcontext.c b/src/modules/ecore_imf/wayland/wayland_imcontext.c
index fa0b739..2464278 100644
--- a/src/modules/ecore_imf/wayland/wayland_imcontext.c
+++ b/src/modules/ecore_imf/wayland/wayland_imcontext.c
@@ -27,7 +27,7 @@
27#include <Ecore.h> 27#include <Ecore.h>
28#include <Ecore_Evas.h> 28#include <Ecore_Evas.h>
29#include <Ecore_Input.h> 29#include <Ecore_Input.h>
30#include <Ecore_Wayland.h> 30#include <Ecore_Wl2.h>
31 31
32#include "wayland_imcontext.h" 32#include "wayland_imcontext.h"
33 33
@@ -38,9 +38,9 @@ struct _WaylandIMContext
38 struct wl_text_input_manager *text_input_manager; 38 struct wl_text_input_manager *text_input_manager;
39 struct wl_text_input *text_input; 39 struct wl_text_input *text_input;
40 40
41 Ecore_Wl_Window *window; 41 Ecore_Wl2_Window *window;
42 Ecore_Wl_Input *input; 42 Ecore_Wl2_Input *input;
43 Evas *canvas; 43 Evas *canvas;
44 44
45 char *preedit_text; 45 char *preedit_text;
46 char *preedit_commit; 46 char *preedit_commit;
@@ -292,17 +292,17 @@ static Eina_Bool
292show_input_panel(Ecore_IMF_Context *ctx) 292show_input_panel(Ecore_IMF_Context *ctx)
293{ 293{
294 WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx); 294 WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx);
295 Ecore_Wl_Input *input; 295 Ecore_Wl2_Input *input;
296 struct wl_seat *seat; 296 struct wl_seat *seat;
297 297
298 if ((!imcontext) || (!imcontext->window) || (!imcontext->text_input)) 298 if ((!imcontext) || (!imcontext->window) || (!imcontext->text_input))
299 return EINA_FALSE; 299 return EINA_FALSE;
300 300
301 input = ecore_wl_window_keyboard_get(imcontext->window); 301 input = ecore_wl2_window_input_get(imcontext->window);
302 if (!input) 302 if (!input)
303 return EINA_FALSE; 303 return EINA_FALSE;
304 304
305 seat = ecore_wl_input_seat_get(input); 305 seat = ecore_wl2_input_seat_get(input);
306 if (!seat) 306 if (!seat)
307 return EINA_FALSE; 307 return EINA_FALSE;
308 308
@@ -312,7 +312,7 @@ show_input_panel(Ecore_IMF_Context *ctx)
312 { 312 {
313 wl_text_input_show_input_panel(imcontext->text_input); 313 wl_text_input_show_input_panel(imcontext->text_input);
314 wl_text_input_activate(imcontext->text_input, seat, 314 wl_text_input_activate(imcontext->text_input, seat,
315 ecore_wl_window_surface_get(imcontext->window)); 315 ecore_wl2_window_surface_get(imcontext->window));
316 316
317 wl_text_input_set_content_type(imcontext->text_input, 317 wl_text_input_set_content_type(imcontext->text_input,
318 imcontext->content_hint, 318 imcontext->content_hint,
@@ -531,8 +531,8 @@ text_input_keysym(void *data,
531 strcpy((char *)e->key, key); 531 strcpy((char *)e->key, key);
532 strcpy((char *)e->string, string); 532 strcpy((char *)e->string, string);
533 533
534 e->window = ecore_wl_window_id_get(imcontext->window); 534 e->window = ecore_wl2_window_id_get(imcontext->window);
535 e->event_window = ecore_wl_window_id_get(imcontext->window); 535 e->event_window = ecore_wl2_window_id_get(imcontext->window);
536 e->timestamp = time; 536 e->timestamp = time;
537 537
538 e->modifiers = 0; 538 e->modifiers = 0;
@@ -692,7 +692,7 @@ wayland_im_context_focus_out(Ecore_IMF_Context *ctx)
692 wl_text_input_hide_input_panel(imcontext->text_input); 692 wl_text_input_hide_input_panel(imcontext->text_input);
693 693
694 wl_text_input_deactivate(imcontext->text_input, 694 wl_text_input_deactivate(imcontext->text_input,
695 ecore_wl_input_seat_get(imcontext->input)); 695 ecore_wl2_input_seat_get(imcontext->input));
696 } 696 }
697 697
698 imcontext->input = NULL; 698 imcontext->input = NULL;
@@ -776,7 +776,7 @@ wayland_im_context_client_window_set(Ecore_IMF_Context *ctx,
776 EINA_LOG_DOM_INFO(_ecore_imf_wayland_log_dom, "client window set (window: %p)", window); 776 EINA_LOG_DOM_INFO(_ecore_imf_wayland_log_dom, "client window set (window: %p)", window);
777 777
778 if (window != NULL) 778 if (window != NULL)
779 imcontext->window = ecore_wl_window_find((Ecore_Window)window); 779 imcontext->window = ecore_wl2_window_find(ewd, (Ecore_Window)window);
780} 780}
781 781
782EAPI void 782EAPI void
diff --git a/src/modules/ecore_imf/wayland/wayland_imcontext.h b/src/modules/ecore_imf/wayland/wayland_imcontext.h
index a105c78..a76203f 100644
--- a/src/modules/ecore_imf/wayland/wayland_imcontext.h
+++ b/src/modules/ecore_imf/wayland/wayland_imcontext.h
@@ -24,8 +24,12 @@
24#define __WAYLAND_IM_CONTEXT_H_ 24#define __WAYLAND_IM_CONTEXT_H_
25 25
26#include <Ecore_IMF.h> 26#include <Ecore_IMF.h>
27#include <Ecore_Wl2.h>
28
27#include "text-client-protocol.h" 29#include "text-client-protocol.h"
28 30
31extern Ecore_Wl2_Display *ewd;
32
29typedef struct _WaylandIMContext WaylandIMContext; 33typedef struct _WaylandIMContext WaylandIMContext;
30 34
31EAPI void wayland_im_context_add (Ecore_IMF_Context *ctx); 35EAPI void wayland_im_context_add (Ecore_IMF_Context *ctx);
diff --git a/src/modules/ecore_imf/wayland/wayland_module.c b/src/modules/ecore_imf/wayland/wayland_module.c
index f395faa..ab6a861 100644
--- a/src/modules/ecore_imf/wayland/wayland_module.c
+++ b/src/modules/ecore_imf/wayland/wayland_module.c
@@ -26,13 +26,14 @@
26 26
27#include <Ecore.h> 27#include <Ecore.h>
28#include <Ecore_IMF.h> 28#include <Ecore_IMF.h>
29#include <Ecore_Wayland.h> 29#include <Ecore_Wl2.h>
30#include <stdio.h> 30#include <stdio.h>
31 31
32#include "wayland_imcontext.h" 32#include "wayland_imcontext.h"
33#include "text-client-protocol.h" 33#include "text-client-protocol.h"
34 34
35int _ecore_imf_wayland_log_dom = -1; 35int _ecore_imf_wayland_log_dom = -1;
36Ecore_Wl2_Display *ewd;
36 37
37static const Ecore_IMF_Context_Info wayland_im_info = 38static const Ecore_IMF_Context_Info wayland_im_info =
38{ 39{
@@ -100,27 +101,28 @@ im_module_create()
100 101
101 if (!text_input_manager) 102 if (!text_input_manager)
102 { 103 {
103 Ecore_Wl_Global *global; 104 Eina_Iterator *itr;
104 struct wl_registry *registry;
105 Eina_Inlist *globals;
106 105
107 if (!(registry = ecore_wl_registry_get())) 106 itr = ecore_wl2_display_globals_get(ewd);
108 return NULL; 107 if (itr)
109
110 if (!(globals = ecore_wl_globals_get()))
111 return NULL;
112
113 EINA_INLIST_FOREACH(globals, global)
114 { 108 {
115 if (!strcmp(global->interface, "wl_text_input_manager")) 109 Ecore_Wl2_Global *global;
110 struct wl_registry *registry;
111
112 registry = ecore_wl2_display_registry_get(ewd);
113 EINA_ITERATOR_FOREACH(itr, global)
116 { 114 {
117 text_input_manager = 115 if (!strcmp(global->interface, "wl_text_input_manager"))
118 wl_registry_bind(registry, global->id, 116 {
119 &wl_text_input_manager_interface, 1); 117 text_input_manager =
120 EINA_LOG_DOM_INFO(_ecore_imf_wayland_log_dom, 118 wl_registry_bind(registry, global->id,
121 "bound wl_text_input_manager interface"); 119 &wl_text_input_manager_interface, 1);
122 break; 120 EINA_LOG_DOM_INFO(_ecore_imf_wayland_log_dom,
121 "bound wl_text_input_manager interface");
122 break;
123 }
123 } 124 }
125 eina_iterator_free(itr);
124 } 126 }
125 127
126 if (!text_input_manager) 128 if (!text_input_manager)
@@ -156,21 +158,28 @@ im_module_init(void)
156 if (strcmp(s, "wl")) return EINA_FALSE; 158 if (strcmp(s, "wl")) return EINA_FALSE;
157 } 159 }
158 160
159 if (!ecore_wl_init(NULL)) 161 if (!ecore_wl2_init())
160 return EINA_FALSE; 162 return EINA_FALSE;
161 163
164 ewd = ecore_wl2_display_connect(NULL);
165 if (!ewd) goto err;
166
162 ecore_imf_module_register(&wayland_im_info, im_module_create, 167 ecore_imf_module_register(&wayland_im_info, im_module_create,
163 im_module_exit); 168 im_module_exit);
164 EINA_LOG_DOM_INFO(_ecore_imf_wayland_log_dom, "im module initalized"); 169 EINA_LOG_DOM_INFO(_ecore_imf_wayland_log_dom, "im module initalized");
165 170
166 return EINA_TRUE; 171 return EINA_TRUE;
172
173err:
174 ecore_wl2_shutdown();
175 return EINA_FALSE;
167} 176}
168 177
169static void 178static void
170im_module_shutdown(void) 179im_module_shutdown(void)
171{ 180{
172 EINA_LOG_DOM_INFO(_ecore_imf_wayland_log_dom, "im module shutdown"); 181 EINA_LOG_DOM_INFO(_ecore_imf_wayland_log_dom, "im module shutdown");
173 ecore_wl_shutdown(); 182 ecore_wl2_shutdown();
174} 183}
175 184
176EINA_MODULE_INIT(im_module_init); 185EINA_MODULE_INIT(im_module_init);