summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore16
-rw-r--r--src/Makefile_Ecore_IMF.am10
-rw-r--r--src/modules/ecore_imf/wayland/text-client-protocol.h540
-rw-r--r--src/modules/ecore_imf/wayland/text-protocol.c94
-rw-r--r--src/modules/ecore_imf/wayland/wayland_imcontext.c132
-rw-r--r--src/modules/ecore_imf/wayland/wayland_imcontext.h4
-rw-r--r--src/modules/ecore_imf/wayland/wayland_module.c8
7 files changed, 83 insertions, 721 deletions
diff --git a/.gitignore b/.gitignore
index 4458482..ac86fdc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -78,16 +78,6 @@ Session.vim
78/src/scripts/eo/eo_debug 78/src/scripts/eo/eo_debug
79/src/bin/ecore_con/efl_net_proxy_helper 79/src/bin/ecore_con/efl_net_proxy_helper
80 80
81#Once all protocols are generated these will use wildcards 81#wayland generated protocol - some legacy headers will be ignored
82/src/lib/ecore_wl2/www-client-protocol.h 82*-protocol.h
83/src/lib/ecore_wl2/www-protocol.c 83*-protocol.c
84/src/lib/ecore_wl2/teamwork-client-protocol.h
85/src/lib/ecore_wl2/teamwork-protocol.c
86/src/lib/ecore_wl2/linux-dmabuf-unstable-v1-client-protocol.h
87/src/lib/ecore_wl2/linux-dmabuf-unstable-v1-protocol.c
88/src/lib/ecore_wl2/xdg-shell-unstable-v5-client-protocol.h
89/src/lib/ecore_wl2/xdg-shell-unstable-v5-protocol.c
90/src/lib/ecore_wl2/xdg-shell-unstable-v6-client-protocol.h
91/src/lib/ecore_wl2/xdg-shell-unstable-v6-protocol.c
92/src/lib/ecore_wl2/session-recovery-client-protocol.h
93/src/lib/ecore_wl2/session-recovery-protocol.c
diff --git a/src/Makefile_Ecore_IMF.am b/src/Makefile_Ecore_IMF.am
index 87d0f63..5a07d60 100644
--- a/src/Makefile_Ecore_IMF.am
+++ b/src/Makefile_Ecore_IMF.am
@@ -134,9 +134,15 @@ modules_ecore_imf_wayland_module_la_SOURCES = \
134modules/ecore_imf/wayland/wayland_module.c \ 134modules/ecore_imf/wayland/wayland_module.c \
135modules/ecore_imf/wayland/wayland_imcontext.c \ 135modules/ecore_imf/wayland/wayland_imcontext.c \
136modules/ecore_imf/wayland/wayland_imcontext.h \ 136modules/ecore_imf/wayland/wayland_imcontext.h \
137modules/ecore_imf/wayland/text-client-protocol.h \ 137modules/ecore_imf/wayland/text-input-unstable-v1-client-protocol.h \
138modules/ecore_imf/wayland/text-protocol.c 138modules/ecore_imf/wayland/text-input-unstable-v1-protocol.c
139
140BUILT_SOURCES += \
141modules/ecore_imf/wayland/text-input-unstable-v1-client-protocol.h \
142modules/ecore_imf/wayland/text-input-unstable-v1-protocol.c
143
139modules_ecore_imf_wayland_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \ 144modules_ecore_imf_wayland_module_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
145-I$(top_builddir)/src/modules/ecore_imf/wayland \
140@ECORE_IMF_CFLAGS@ \ 146@ECORE_IMF_CFLAGS@ \
141@ECORE_EVAS_CFLAGS@ \ 147@ECORE_EVAS_CFLAGS@ \
142@ECORE_WL2_CFLAGS@ 148@ECORE_WL2_CFLAGS@
diff --git a/src/modules/ecore_imf/wayland/text-client-protocol.h b/src/modules/ecore_imf/wayland/text-client-protocol.h
deleted file mode 100644
index bcad325..0000000
--- a/src/modules/ecore_imf/wayland/text-client-protocol.h
+++ /dev/null
@@ -1,540 +0,0 @@
1/*
2 * Copyright © 2012, 2013 Intel Corporation
3 *
4 * Permission to use, copy, modify, distribute, and sell this
5 * software and its documentation for any purpose is hereby granted
6 * without fee, provided that the above copyright notice appear in
7 * all copies and that both that copyright notice and this permission
8 * notice appear in supporting documentation, and that the name of
9 * the copyright holders not be used in advertising or publicity
10 * pertaining to distribution of the software without specific,
11 * written prior permission. The copyright holders make no
12 * representations about the suitability of this software for any
13 * purpose. It is provided "as is" without express or implied
14 * warranty.
15 *
16 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
17 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
18 * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
19 * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
20 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
21 * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
22 * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
23 * THIS SOFTWARE.
24 */
25
26#ifndef TEXT_CLIENT_PROTOCOL_H
27#define TEXT_CLIENT_PROTOCOL_H
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33#include <stdint.h>
34#include <stddef.h>
35#include "wayland-client.h"
36
37struct wl_client;
38struct wl_resource;
39
40struct wl_text_input;
41struct wl_text_input_manager;
42
43extern const struct wl_interface wl_text_input_interface;
44extern const struct wl_interface wl_text_input_manager_interface;
45
46#ifndef WL_TEXT_INPUT_CONTENT_HINT_ENUM
47#define WL_TEXT_INPUT_CONTENT_HINT_ENUM
48/**
49 * wl_text_input_content_hint - content hint
50 * @WL_TEXT_INPUT_CONTENT_HINT_NONE: no special behaviour
51 * @WL_TEXT_INPUT_CONTENT_HINT_DEFAULT: auto completion, correction and
52 * capitalization
53 * @WL_TEXT_INPUT_CONTENT_HINT_PASSWORD: hidden and sensitive text
54 * @WL_TEXT_INPUT_CONTENT_HINT_AUTO_COMPLETION: suggest word completions
55 * @WL_TEXT_INPUT_CONTENT_HINT_AUTO_CORRECTION: suggest word corrections
56 * @WL_TEXT_INPUT_CONTENT_HINT_AUTO_CAPITALIZATION: switch to uppercase
57 * letters at the start of a sentence
58 * @WL_TEXT_INPUT_CONTENT_HINT_LOWERCASE: prefer lowercase letters
59 * @WL_TEXT_INPUT_CONTENT_HINT_UPPERCASE: prefer uppercase letters
60 * @WL_TEXT_INPUT_CONTENT_HINT_TITLECASE: prefer casing for titles and
61 * headings (can be language dependent)
62 * @WL_TEXT_INPUT_CONTENT_HINT_HIDDEN_TEXT: characters should be hidden
63 * @WL_TEXT_INPUT_CONTENT_HINT_SENSITIVE_DATA: typed text should not be
64 * stored
65 * @WL_TEXT_INPUT_CONTENT_HINT_LATIN: just latin characters should be
66 * entered
67 * @WL_TEXT_INPUT_CONTENT_HINT_MULTILINE: the text input is multiline
68 *
69 * Content hint is a bitmask to allow to modify the behavior of the text
70 * input.
71 */
72enum wl_text_input_content_hint
73{
74 WL_TEXT_INPUT_CONTENT_HINT_NONE = 0x0,
75 WL_TEXT_INPUT_CONTENT_HINT_DEFAULT = 0x7,
76 WL_TEXT_INPUT_CONTENT_HINT_PASSWORD = 0xc0,
77 WL_TEXT_INPUT_CONTENT_HINT_AUTO_COMPLETION = 0x1,
78 WL_TEXT_INPUT_CONTENT_HINT_AUTO_CORRECTION = 0x2,
79 WL_TEXT_INPUT_CONTENT_HINT_AUTO_CAPITALIZATION = 0x4,
80 WL_TEXT_INPUT_CONTENT_HINT_LOWERCASE = 0x8,
81 WL_TEXT_INPUT_CONTENT_HINT_UPPERCASE = 0x10,
82 WL_TEXT_INPUT_CONTENT_HINT_TITLECASE = 0x20,
83 WL_TEXT_INPUT_CONTENT_HINT_HIDDEN_TEXT = 0x40,
84 WL_TEXT_INPUT_CONTENT_HINT_SENSITIVE_DATA = 0x80,
85 WL_TEXT_INPUT_CONTENT_HINT_LATIN = 0x100,
86 WL_TEXT_INPUT_CONTENT_HINT_MULTILINE = 0x200,
87};
88#endif /* WL_TEXT_INPUT_CONTENT_HINT_ENUM */
89
90#ifndef WL_TEXT_INPUT_CONTENT_PURPOSE_ENUM
91#define WL_TEXT_INPUT_CONTENT_PURPOSE_ENUM
92/**
93 * wl_text_input_content_purpose - content purpose
94 * @WL_TEXT_INPUT_CONTENT_PURPOSE_NORMAL: default input, allowing all
95 * characters
96 * @WL_TEXT_INPUT_CONTENT_PURPOSE_ALPHA: allow only alphabetic characters
97 * @WL_TEXT_INPUT_CONTENT_PURPOSE_DIGITS: allow only digits
98 * @WL_TEXT_INPUT_CONTENT_PURPOSE_NUMBER: input a number (including
99 * decimal separator and sign)
100 * @WL_TEXT_INPUT_CONTENT_PURPOSE_PHONE: input a phone number
101 * @WL_TEXT_INPUT_CONTENT_PURPOSE_URL: input an URL
102 * @WL_TEXT_INPUT_CONTENT_PURPOSE_EMAIL: input an email address
103 * @WL_TEXT_INPUT_CONTENT_PURPOSE_NAME: input a name of a person
104 * @WL_TEXT_INPUT_CONTENT_PURPOSE_PASSWORD: input a password (combine
105 * with password or sensitive_data hint)
106 * @WL_TEXT_INPUT_CONTENT_PURPOSE_DATE: input a date
107 * @WL_TEXT_INPUT_CONTENT_PURPOSE_TIME: input a time
108 * @WL_TEXT_INPUT_CONTENT_PURPOSE_DATETIME: input a date and time
109 * @WL_TEXT_INPUT_CONTENT_PURPOSE_TERMINAL: input for a terminal
110 *
111 * The content purpose allows to specify the primary purpose of a text
112 * input.
113 *
114 * This allows an input method to show special purpose input panels with
115 * extra characters or to disallow some characters.
116 */
117enum wl_text_input_content_purpose
118{
119 WL_TEXT_INPUT_CONTENT_PURPOSE_NORMAL = 0,
120 WL_TEXT_INPUT_CONTENT_PURPOSE_ALPHA = 1,
121 WL_TEXT_INPUT_CONTENT_PURPOSE_DIGITS = 2,
122 WL_TEXT_INPUT_CONTENT_PURPOSE_NUMBER = 3,
123 WL_TEXT_INPUT_CONTENT_PURPOSE_PHONE = 4,
124 WL_TEXT_INPUT_CONTENT_PURPOSE_URL = 5,
125 WL_TEXT_INPUT_CONTENT_PURPOSE_EMAIL = 6,
126 WL_TEXT_INPUT_CONTENT_PURPOSE_NAME = 7,
127 WL_TEXT_INPUT_CONTENT_PURPOSE_PASSWORD = 8,
128 WL_TEXT_INPUT_CONTENT_PURPOSE_DATE = 9,
129 WL_TEXT_INPUT_CONTENT_PURPOSE_TIME = 10,
130 WL_TEXT_INPUT_CONTENT_PURPOSE_DATETIME = 11,
131 WL_TEXT_INPUT_CONTENT_PURPOSE_TERMINAL = 12,
132};
133#endif /* WL_TEXT_INPUT_CONTENT_PURPOSE_ENUM */
134
135#ifndef WL_TEXT_INPUT_PREEDIT_STYLE_ENUM
136#define WL_TEXT_INPUT_PREEDIT_STYLE_ENUM
137enum wl_text_input_preedit_style
138{
139 WL_TEXT_INPUT_PREEDIT_STYLE_DEFAULT = 0,
140 WL_TEXT_INPUT_PREEDIT_STYLE_NONE = 1,
141 WL_TEXT_INPUT_PREEDIT_STYLE_ACTIVE = 2,
142 WL_TEXT_INPUT_PREEDIT_STYLE_INACTIVE = 3,
143 WL_TEXT_INPUT_PREEDIT_STYLE_HIGHLIGHT = 4,
144 WL_TEXT_INPUT_PREEDIT_STYLE_UNDERLINE = 5,
145 WL_TEXT_INPUT_PREEDIT_STYLE_SELECTION = 6,
146 WL_TEXT_INPUT_PREEDIT_STYLE_INCORRECT = 7,
147};
148#endif /* WL_TEXT_INPUT_PREEDIT_STYLE_ENUM */
149
150#ifndef WL_TEXT_INPUT_TEXT_DIRECTION_ENUM
151#define WL_TEXT_INPUT_TEXT_DIRECTION_ENUM
152enum wl_text_input_text_direction
153{
154 WL_TEXT_INPUT_TEXT_DIRECTION_AUTO = 0,
155 WL_TEXT_INPUT_TEXT_DIRECTION_LTR = 1,
156 WL_TEXT_INPUT_TEXT_DIRECTION_RTL = 2,
157};
158#endif /* WL_TEXT_INPUT_TEXT_DIRECTION_ENUM */
159
160/**
161 * wl_text_input - text input
162 * @enter: enter event
163 * @leave: leave event
164 * @modifiers_map: modifiers map
165 * @input_panel_state: state of the input panel
166 * @preedit_string: pre-edit
167 * @preedit_styling: pre-edit styling
168 * @preedit_cursor: pre-edit cursor
169 * @commit_string: commit
170 * @cursor_position: set cursor to new position
171 * @delete_surrounding_text: delete surrounding text
172 * @keysym: keysym
173 * @language: language
174 * @text_direction: text direction
175 *
176 * An object used for text input. Adds support for text input and input
177 * methods to applications. A text-input object is created from a
178 * wl_text_input_manager and corresponds typically to a text entry in an
179 * application. Requests are used to activate/deactivate the text-input
180 * object and set state information like surrounding and selected text or
181 * the content type. The information about entered text is sent to the
182 * text-input object via the pre-edit and commit events. Using this
183 * interface removes the need for applications to directly process hardware
184 * key events and compose text out of them.
185 *
186 * Text is generally UTF-8 encoded, indices and lengths are in Unicode
187 * characters.
188 *
189 * Serials are used to synchronize the state between the text input and an
190 * input method. New serials are sent by the text input in the commit_state
191 * request and are used by the input method to indicate the known text
192 * input state in events like preedit_string, commit_string, and keysym.
193 * The text input can then ignore events from the input method which are
194 * based on an outdated state (for example after a reset).
195 */
196struct wl_text_input_listener
197{
198 /**
199 * enter - enter event
200 * @surface: (none)
201 *
202 * Notify the text-input object when it received focus. Typically
203 * in response to an activate request.
204 */
205 void (*enter)(void *data, struct wl_text_input *wl_text_input, struct wl_surface *surface);
206
207 /**
208 * leave - leave event
209 *
210 * Notify the text-input object when it lost focus. Either in
211 * response to a deactivate request or when the assigned surface
212 * lost focus or was destroyed.
213 */
214 void (*leave)(void *data, struct wl_text_input *wl_text_input);
215
216 /**
217 * modifiers_map - modifiers map
218 * @map: (none)
219 *
220 * Transfer an array of 0-terminated modifiers names. The
221 * position in the array is the index of the modifier as used in
222 * the modifiers bitmask in the keysym event.
223 */
224 void (*modifiers_map)(void *data, struct wl_text_input *wl_text_input, struct wl_array *map);
225
226 /**
227 * input_panel_state - state of the input panel
228 * @state: (none)
229 *
230 * Notify when the visibility state of the input panel changed.
231 */
232 void (*input_panel_state)(void *data, struct wl_text_input *wl_text_input, uint32_t state);
233
234 /**
235 * preedit_string - pre-edit
236 * @serial: serial of the latest known text input state
237 * @text: (none)
238 * @commit: (none)
239 *
240 * Notify when a new composing text (pre-edit) should be set
241 * around the current cursor position. Any previously set composing
242 * text should be removed.
243 *
244 * The commit text can be used to replace the preedit text on reset
245 * (for example on unfocus).
246 *
247 * The text input should also handle all preedit_style and
248 * preedit_cursor events occuring directly before preedit_string.
249 */
250 void (*preedit_string)(void *data, struct wl_text_input *wl_text_input, uint32_t serial, const char *text, const char *commit);
251
252 /**
253 * preedit_styling - pre-edit styling
254 * @index: (none)
255 * @length: (none)
256 * @style: (none)
257 *
258 * Sets styling information on composing text. The style is
259 * applied for length Unicode characters from index relative to the
260 * beginning of the composing text (as Unicode character offset).
261 * Multiple styles can be applied to a composing text by sending
262 * multiple preedit_styling events.
263 *
264 * This event is handled as part of a following preedit_string
265 * event.
266 */
267 void (*preedit_styling)(void *data, struct wl_text_input *wl_text_input, uint32_t index, uint32_t length, uint32_t style);
268
269 /**
270 * preedit_cursor - pre-edit cursor
271 * @index: (none)
272 *
273 * Sets the cursor position inside the composing text (as Unicode
274 * character offset) relative to the start of the composing text.
275 * When index is a negative number no cursor is shown.
276 *
277 * This event is handled as part of a following preedit_string
278 * event.
279 */
280 void (*preedit_cursor)(void *data, struct wl_text_input *wl_text_input, int32_t index);
281
282 /**
283 * commit_string - commit
284 * @serial: serial of the latest known text input state
285 * @text: (none)
286 *
287 * Notify when text should be inserted into the editor widget.
288 * The text to commit could be either just a single character after
289 * a key press or the result of some composing (pre-edit). It could
290 * be also an empty text when some text should be removed (see
291 * delete_surrounding_text) or when the input cursor should be
292 * moved (see cursor_position).
293 *
294 * Any previously set composing text should be removed.
295 */
296 void (*commit_string)(void *data, struct wl_text_input *wl_text_input, uint32_t serial, const char *text);
297
298 /**
299 * cursor_position - set cursor to new position
300 * @index: (none)
301 * @anchor: (none)
302 *
303 * Notify when the cursor or anchor position should be modified.
304 *
305 * This event should be handled as part of a following
306 * commit_string event.
307 */
308 void (*cursor_position)(void *data, struct wl_text_input *wl_text_input, int32_t index, int32_t anchor);
309
310 /**
311 * delete_surrounding_text - delete surrounding text
312 * @index: (none)
313 * @length: (none)
314 *
315 * Notify when the text around the current cursor position should
316 * be deleted.
317 *
318 * Index is relative to the current cursor (in Unicode characters).
319 * Length is the length of deleted text (in Unicode characters).
320 *
321 * This event should be handled as part of a following
322 * commit_string event.
323 */
324 void (*delete_surrounding_text)(void *data, struct wl_text_input *wl_text_input, int32_t index, uint32_t length);
325
326 /**
327 * keysym - keysym
328 * @serial: serial of the latest known text input state
329 * @time: (none)
330 * @sym: (none)
331 * @state: (none)
332 * @modifiers: (none)
333 *
334 * Notify when a key event was sent. Key events should not be
335 * used for normal text input operations, which should be done with
336 * commit_string, delete_surrounding_text, etc. The key event
337 * follows the wl_keyboard key event convention. Sym is a XKB
338 * keysym, state a wl_keyboard key_state. Modifiers are a mask for
339 * effective modifiers (where the modifier indices are set by the
340 * modifiers_map event)
341 */
342 void (*keysym)(void *data, struct wl_text_input *wl_text_input, uint32_t serial, uint32_t time, uint32_t sym, uint32_t state, uint32_t modifiers);
343
344 /**
345 * language - language
346 * @serial: serial of the latest known text input state
347 * @language: (none)
348 *
349 * Sets the language of the input text. The "language" argument
350 * is a RFC-3066 format language tag.
351 */
352 void (*language)(void *data, struct wl_text_input *wl_text_input, uint32_t serial, const char *language);
353
354 /**
355 * text_direction - text direction
356 * @serial: serial of the latest known text input state
357 * @direction: (none)
358 *
359 * Sets the text direction of input text.
360 *
361 * It is mainly needed for showing input cursor on correct side of
362 * the editor when there is no input yet done and making sure
363 * neutral direction text is laid out properly.
364 */
365 void (*text_direction)(void *data, struct wl_text_input *wl_text_input, uint32_t serial, uint32_t direction);
366};
367
368static inline int
369wl_text_input_add_listener(struct wl_text_input *wl_text_input, const struct wl_text_input_listener *listener, void *data)
370{
371 return wl_proxy_add_listener((struct wl_proxy *) wl_text_input,
372 (void (**)(void)) listener, data);
373}
374
375#define WL_TEXT_INPUT_ACTIVATE 0
376#define WL_TEXT_INPUT_DEACTIVATE 1
377#define WL_TEXT_INPUT_SHOW_INPUT_PANEL 2
378#define WL_TEXT_INPUT_HIDE_INPUT_PANEL 3
379#define WL_TEXT_INPUT_RESET 4
380#define WL_TEXT_INPUT_SET_SURROUNDING_TEXT 5
381#define WL_TEXT_INPUT_SET_CONTENT_TYPE 6
382#define WL_TEXT_INPUT_SET_CURSOR_RECTANGLE 7
383#define WL_TEXT_INPUT_SET_PREFERRED_LANGUAGE 8
384#define WL_TEXT_INPUT_COMMIT_STATE 9
385#define WL_TEXT_INPUT_INVOKE_ACTION 10
386
387static inline void
388wl_text_input_set_user_data(struct wl_text_input *wl_text_input, void *user_data)
389{
390 if (!wl_text_input) return;
391 wl_proxy_set_user_data((struct wl_proxy *) wl_text_input, user_data);
392}
393
394static inline void *
395wl_text_input_get_user_data(struct wl_text_input *wl_text_input)
396{
397 if (!wl_text_input) return NULL;
398 return wl_proxy_get_user_data((struct wl_proxy *) wl_text_input);
399}
400
401static inline void
402wl_text_input_destroy(struct wl_text_input *wl_text_input)
403{
404 if (!wl_text_input) return;
405 wl_proxy_destroy((struct wl_proxy *) wl_text_input);
406}
407
408static inline void
409wl_text_input_activate(struct wl_text_input *wl_text_input, struct wl_seat *seat, struct wl_surface *surface)
410{
411 if (!wl_text_input) return;
412 wl_proxy_marshal((struct wl_proxy *) wl_text_input,
413 WL_TEXT_INPUT_ACTIVATE, seat, surface);
414}
415
416static inline void
417wl_text_input_deactivate(struct wl_text_input *wl_text_input, struct wl_seat *seat)
418{
419 if (!wl_text_input) return;
420 wl_proxy_marshal((struct wl_proxy *) wl_text_input,
421 WL_TEXT_INPUT_DEACTIVATE, seat);
422}
423
424static inline void
425wl_text_input_show_input_panel(struct wl_text_input *wl_text_input)
426{
427 if (!wl_text_input) return;
428 wl_proxy_marshal((struct wl_proxy *) wl_text_input,
429 WL_TEXT_INPUT_SHOW_INPUT_PANEL);
430}
431
432static inline void
433wl_text_input_hide_input_panel(struct wl_text_input *wl_text_input)
434{
435 if (!wl_text_input) return;
436 wl_proxy_marshal((struct wl_proxy *) wl_text_input,
437 WL_TEXT_INPUT_HIDE_INPUT_PANEL);
438}
439
440static inline void
441wl_text_input_reset(struct wl_text_input *wl_text_input)
442{
443 if (!wl_text_input) return;
444 wl_proxy_marshal((struct wl_proxy *) wl_text_input, WL_TEXT_INPUT_RESET);
445}
446
447static inline void
448wl_text_input_set_surrounding_text(struct wl_text_input *wl_text_input, const char *text, uint32_t cursor, uint32_t anchor)
449{
450 if (!wl_text_input) return;
451 wl_proxy_marshal((struct wl_proxy *) wl_text_input,
452 WL_TEXT_INPUT_SET_SURROUNDING_TEXT, text, cursor, anchor);
453}
454
455static inline void
456wl_text_input_set_content_type(struct wl_text_input *wl_text_input, uint32_t hint, uint32_t purpose)
457{
458 if (!wl_text_input) return;
459 wl_proxy_marshal((struct wl_proxy *) wl_text_input,
460 WL_TEXT_INPUT_SET_CONTENT_TYPE, hint, purpose);
461}
462
463static inline void
464wl_text_input_set_cursor_rectangle(struct wl_text_input *wl_text_input, int32_t x, int32_t y, int32_t width, int32_t height)
465{
466 if (!wl_text_input) return;
467 wl_proxy_marshal((struct wl_proxy *) wl_text_input,
468 WL_TEXT_INPUT_SET_CURSOR_RECTANGLE, x, y, width, height);
469}
470
471static inline void
472wl_text_input_set_preferred_language(struct wl_text_input *wl_text_input, const char *language)
473{
474 if (!wl_text_input) return;
475 wl_proxy_marshal((struct wl_proxy *) wl_text_input,
476 WL_TEXT_INPUT_SET_PREFERRED_LANGUAGE, language);
477}
478
479static inline void
480wl_text_input_commit_state(struct wl_text_input *wl_text_input, uint32_t serial)
481{
482 if (!wl_text_input) return;
483 wl_proxy_marshal((struct wl_proxy *) wl_text_input,
484 WL_TEXT_INPUT_COMMIT_STATE, serial);
485}
486
487static inline void
488wl_text_input_invoke_action(struct wl_text_input *wl_text_input, uint32_t button, uint32_t index)
489{
490 if (!wl_text_input) return;
491 wl_proxy_marshal((struct wl_proxy *) wl_text_input,
492 WL_TEXT_INPUT_INVOKE_ACTION, button, index);
493}
494
495#define WL_TEXT_INPUT_MANAGER_CREATE_TEXT_INPUT 0
496
497static inline void
498wl_text_input_manager_set_user_data(struct wl_text_input_manager *wl_text_input_manager, void *user_data)
499{
500 if (!wl_text_input_manager) return;
501 wl_proxy_set_user_data((struct wl_proxy *) wl_text_input_manager,
502 user_data);
503}
504
505static inline void *
506wl_text_input_manager_get_user_data(struct wl_text_input_manager *wl_text_input_manager)
507{
508 if (!wl_text_input_manager) return NULL;
509 return wl_proxy_get_user_data((struct wl_proxy *) wl_text_input_manager);
510}
511
512static inline void
513wl_text_input_manager_destroy(struct wl_text_input_manager *wl_text_input_manager)
514{
515 if (!wl_text_input_manager) return;
516 wl_proxy_destroy((struct wl_proxy *) wl_text_input_manager);
517}
518
519static inline struct wl_text_input *
520wl_text_input_manager_create_text_input(struct wl_text_input_manager *wl_text_input_manager)
521{
522 struct wl_proxy *id;
523
524 if (!wl_text_input_manager) return NULL;
525
526 id = wl_proxy_create((struct wl_proxy *) wl_text_input_manager,
527 &wl_text_input_interface);
528 if (!id) return NULL;
529
530 wl_proxy_marshal((struct wl_proxy *) wl_text_input_manager,
531 WL_TEXT_INPUT_MANAGER_CREATE_TEXT_INPUT, id);
532
533 return (struct wl_text_input *) id;
534}
535
536#ifdef __cplusplus
537}
538#endif
539
540#endif
diff --git a/src/modules/ecore_imf/wayland/text-protocol.c b/src/modules/ecore_imf/wayland/text-protocol.c
deleted file mode 100644
index af549d5..0000000
--- a/src/modules/ecore_imf/wayland/text-protocol.c
+++ /dev/null
@@ -1,94 +0,0 @@
1/*
2 * Copyright © 2012, 2013 Intel Corporation
3 *
4 * Permission to use, copy, modify, distribute, and sell this
5 * software and its documentation for any purpose is hereby granted
6 * without fee, provided that the above copyright notice appear in
7 * all copies and that both that copyright notice and this permission
8 * notice appear in supporting documentation, and that the name of
9 * the copyright holders not be used in advertising or publicity
10 * pertaining to distribution of the software without specific,
11 * written prior permission. The copyright holders make no
12 * representations about the suitability of this software for any
13 * purpose. It is provided "as is" without express or implied
14 * warranty.
15 *
16 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
17 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
18 * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
19 * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
20 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
21 * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
22 * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
23 * THIS SOFTWARE.
24 */
25
26#include <stdlib.h>
27#include <stdint.h>
28#include "wayland-util.h"
29
30extern const struct wl_interface wl_seat_interface;
31extern const struct wl_interface wl_surface_interface;
32extern const struct wl_interface wl_seat_interface;
33extern const struct wl_interface wl_surface_interface;
34extern const struct wl_interface wl_text_input_interface;
35
36static const struct wl_interface *types[] = {
37 NULL,
38 NULL,
39 NULL,
40 NULL,
41 NULL,
42 &wl_seat_interface,
43 &wl_surface_interface,
44 &wl_seat_interface,
45 &wl_surface_interface,
46 &wl_text_input_interface,
47};
48
49static const struct wl_message wl_text_input_requests[] = {
50 { "activate", "oo", types + 5 },
51 { "deactivate", "o", types + 7 },
52 { "show_input_panel", "", types + 0 },
53 { "hide_input_panel", "", types + 0 },
54 { "reset", "", types + 0 },
55 { "set_surrounding_text", "suu", types + 0 },
56 { "set_content_type", "uu", types + 0 },
57 { "set_cursor_rectangle", "iiii", types + 0 },
58 { "set_preferred_language", "s", types + 0 },
59 { "commit_state", "u", types + 0 },
60 { "invoke_action", "uu", types + 0 },
61};
62
63static const struct wl_message wl_text_input_events[] = {
64 { "enter", "o", types + 8 },
65 { "leave", "", types + 0 },
66 { "modifiers_map", "a", types + 0 },
67 { "input_panel_state", "u", types + 0 },
68 { "preedit_string", "uss", types + 0 },
69 { "preedit_styling", "uuu", types + 0 },
70 { "preedit_cursor", "i", types + 0 },
71 { "commit_string", "us", types + 0 },
72 { "cursor_position", "ii", types + 0 },
73 { "delete_surrounding_text", "iu", types + 0 },
74 { "keysym", "uuuuu", types + 0 },
75 { "language", "us", types + 0 },
76 { "text_direction", "uu", types + 0 },
77};
78
79WL_EXPORT const struct wl_interface wl_text_input_interface = {
80 "wl_text_input", 1,
81 11, wl_text_input_requests,
82 13, wl_text_input_events,
83};
84
85static const struct wl_message wl_text_input_manager_requests[] = {
86 { "create_text_input", "n", types + 9 },
87};
88
89WL_EXPORT const struct wl_interface wl_text_input_manager_interface = {
90 "wl_text_input_manager", 1,
91 1, wl_text_input_manager_requests,
92 0, NULL,
93};
94
diff --git a/src/modules/ecore_imf/wayland/wayland_imcontext.c b/src/modules/ecore_imf/wayland/wayland_imcontext.c
index cbe69a2..a70c24f 100644
--- a/src/modules/ecore_imf/wayland/wayland_imcontext.c
+++ b/src/modules/ecore_imf/wayland/wayland_imcontext.c
@@ -40,8 +40,8 @@ struct _WaylandIMContext
40{ 40{
41 Ecore_IMF_Context *ctx; 41 Ecore_IMF_Context *ctx;
42 42
43 struct wl_text_input_manager *text_input_manager; 43 struct zwp_text_input_manager_v1 *text_input_manager;
44 struct wl_text_input *text_input; 44 struct zwp_text_input_v1 *text_input;
45 45
46 Ecore_Wl2_Window *window; 46 Ecore_Wl2_Window *window;
47 Ecore_Wl2_Input *input; 47 Ecore_Wl2_Input *input;
@@ -115,7 +115,7 @@ update_state(WaylandIMContext *imcontext)
115 if (ecore_imf_context_surrounding_get(imcontext->ctx, &surrounding, &cursor_pos)) 115 if (ecore_imf_context_surrounding_get(imcontext->ctx, &surrounding, &cursor_pos))
116 { 116 {
117 if (imcontext->text_input) 117 if (imcontext->text_input)
118 wl_text_input_set_surrounding_text(imcontext->text_input, surrounding, 118 zwp_text_input_v1_set_surrounding_text(imcontext->text_input, surrounding,
119 cursor_pos, cursor_pos); 119 cursor_pos, cursor_pos);
120 120
121 if (surrounding) 121 if (surrounding)
@@ -134,13 +134,13 @@ update_state(WaylandIMContext *imcontext)
134 134
135 if (imcontext->text_input) 135 if (imcontext->text_input)
136 { 136 {
137 wl_text_input_set_cursor_rectangle(imcontext->text_input, 137 zwp_text_input_v1_set_cursor_rectangle(imcontext->text_input,
138 imcontext->cursor_location.x + canvas_x, 138 imcontext->cursor_location.x + canvas_x,
139 imcontext->cursor_location.y + canvas_y, 139 imcontext->cursor_location.y + canvas_y,
140 imcontext->cursor_location.width, 140 imcontext->cursor_location.width,
141 imcontext->cursor_location.height); 141 imcontext->cursor_location.height);
142 142
143 wl_text_input_commit_state(imcontext->text_input, ++imcontext->serial); 143 zwp_text_input_v1_commit_state(imcontext->text_input, ++imcontext->serial);
144 } 144 }
145 145
146 _clear_hide_timer(); 146 _clear_hide_timer();
@@ -162,7 +162,7 @@ static void _send_input_panel_hide_request(Ecore_IMF_Context *ctx)
162{ 162{
163 WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx); 163 WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx);
164 if (imcontext && imcontext->text_input) 164 if (imcontext && imcontext->text_input)
165 wl_text_input_hide_input_panel(imcontext->text_input); 165 zwp_text_input_v1_hide_input_panel(imcontext->text_input);
166} 166}
167 167
168static Eina_Bool _hide_timer_handler(void *data) 168static Eina_Bool _hide_timer_handler(void *data)
@@ -255,7 +255,7 @@ clear_preedit(WaylandIMContext *imcontext)
255 255
256static void 256static void
257text_input_commit_string(void *data, 257text_input_commit_string(void *data,
258 struct wl_text_input *text_input EINA_UNUSED, 258 struct zwp_text_input_v1 *text_input EINA_UNUSED,
259 uint32_t serial, 259 uint32_t serial,
260 const char *text) 260 const char *text)
261{ 261{
@@ -366,7 +366,7 @@ set_focus(Ecore_IMF_Context *ctx)
366 366
367 imcontext->input = input; 367 imcontext->input = input;
368 368
369 wl_text_input_activate(imcontext->text_input, seat, 369 zwp_text_input_v1_activate(imcontext->text_input, seat,
370 ecore_wl2_window_surface_get(imcontext->window)); 370 ecore_wl2_window_surface_get(imcontext->window));
371} 371}
372 372
@@ -385,14 +385,14 @@ show_input_panel(Ecore_IMF_Context *ctx)
385 385
386 _clear_hide_timer(); 386 _clear_hide_timer();
387 387
388 wl_text_input_set_content_type(imcontext->text_input, 388 zwp_text_input_v1_set_content_type(imcontext->text_input,
389 imcontext->content_hint, 389 imcontext->content_hint,
390 imcontext->content_purpose); 390 imcontext->content_purpose);
391 391
392 if (ecore_imf_context_surrounding_get(imcontext->ctx, &surrounding, &cursor_pos)) 392 if (ecore_imf_context_surrounding_get(imcontext->ctx, &surrounding, &cursor_pos))
393 { 393 {
394 if (imcontext->text_input) 394 if (imcontext->text_input)
395 wl_text_input_set_surrounding_text(imcontext->text_input, surrounding, 395 zwp_text_input_v1_set_surrounding_text(imcontext->text_input, surrounding,
396 cursor_pos, cursor_pos); 396 cursor_pos, cursor_pos);
397 397
398 if (surrounding) 398 if (surrounding)
@@ -402,14 +402,14 @@ show_input_panel(Ecore_IMF_Context *ctx)
402 } 402 }
403 } 403 }
404 404
405 wl_text_input_show_input_panel(imcontext->text_input); 405 zwp_text_input_v1_show_input_panel(imcontext->text_input);
406 406
407 return EINA_TRUE; 407 return EINA_TRUE;
408} 408}
409 409
410static void 410static void
411text_input_preedit_string(void *data, 411text_input_preedit_string(void *data,
412 struct wl_text_input *text_input EINA_UNUSED, 412 struct zwp_text_input_v1 *text_input EINA_UNUSED,
413 uint32_t serial, 413 uint32_t serial,
414 const char *text, 414 const char *text,
415 const char *commit) 415 const char *commit)
@@ -462,7 +462,7 @@ text_input_preedit_string(void *data,
462 462
463static void 463static void
464text_input_delete_surrounding_text(void *data, 464text_input_delete_surrounding_text(void *data,
465 struct wl_text_input *text_input EINA_UNUSED, 465 struct zwp_text_input_v1 *text_input EINA_UNUSED,
466 int32_t index, 466 int32_t index,
467 uint32_t length) 467 uint32_t length)
468{ 468{
@@ -481,7 +481,7 @@ text_input_delete_surrounding_text(void *data,
481 481
482static void 482static void
483text_input_cursor_position(void *data, 483text_input_cursor_position(void *data,
484 struct wl_text_input *text_input EINA_UNUSED, 484 struct zwp_text_input_v1 *text_input EINA_UNUSED,
485 int32_t index, 485 int32_t index,
486 int32_t anchor) 486 int32_t anchor)
487{ 487{
@@ -497,7 +497,7 @@ text_input_cursor_position(void *data,
497 497
498static void 498static void
499text_input_preedit_styling(void *data, 499text_input_preedit_styling(void *data,
500 struct wl_text_input *text_input EINA_UNUSED, 500 struct zwp_text_input_v1 *text_input EINA_UNUSED,
501 uint32_t index, 501 uint32_t index,
502 uint32_t length, 502 uint32_t length,
503 uint32_t style) 503 uint32_t style)
@@ -507,15 +507,15 @@ text_input_preedit_styling(void *data,
507 507
508 switch (style) 508 switch (style)
509 { 509 {
510 case WL_TEXT_INPUT_PREEDIT_STYLE_DEFAULT: 510 case ZWP_TEXT_INPUT_V1_PREEDIT_STYLE_DEFAULT:
511 case WL_TEXT_INPUT_PREEDIT_STYLE_UNDERLINE: 511 case ZWP_TEXT_INPUT_V1_PREEDIT_STYLE_UNDERLINE:
512 case WL_TEXT_INPUT_PREEDIT_STYLE_INCORRECT: 512 case ZWP_TEXT_INPUT_V1_PREEDIT_STYLE_INCORRECT:
513 case WL_TEXT_INPUT_PREEDIT_STYLE_HIGHLIGHT: 513 case ZWP_TEXT_INPUT_V1_PREEDIT_STYLE_HIGHLIGHT:
514 case WL_TEXT_INPUT_PREEDIT_STYLE_ACTIVE: 514 case ZWP_TEXT_INPUT_V1_PREEDIT_STYLE_ACTIVE:
515 case WL_TEXT_INPUT_PREEDIT_STYLE_INACTIVE: 515 case ZWP_TEXT_INPUT_V1_PREEDIT_STYLE_INACTIVE:
516 attr->preedit_type = ECORE_IMF_PREEDIT_TYPE_SUB1; 516 attr->preedit_type = ECORE_IMF_PREEDIT_TYPE_SUB1;
517 break; 517 break;
518 case WL_TEXT_INPUT_PREEDIT_STYLE_SELECTION: 518 case ZWP_TEXT_INPUT_V1_PREEDIT_STYLE_SELECTION:
519 attr->preedit_type = ECORE_IMF_PREEDIT_TYPE_SUB2; 519 attr->preedit_type = ECORE_IMF_PREEDIT_TYPE_SUB2;
520 break; 520 break;
521 default: 521 default:
@@ -532,7 +532,7 @@ text_input_preedit_styling(void *data,
532 532
533static void 533static void
534text_input_preedit_cursor(void *data, 534text_input_preedit_cursor(void *data,
535 struct wl_text_input *text_input EINA_UNUSED, 535 struct zwp_text_input_v1 *text_input EINA_UNUSED,
536 int32_t index) 536 int32_t index)
537{ 537{
538 WaylandIMContext *imcontext = (WaylandIMContext *)data; 538 WaylandIMContext *imcontext = (WaylandIMContext *)data;
@@ -571,7 +571,7 @@ modifiers_get_mask(struct wl_array *modifiers_map,
571} 571}
572static void 572static void
573text_input_modifiers_map(void *data, 573text_input_modifiers_map(void *data,
574 struct wl_text_input *text_input EINA_UNUSED, 574 struct zwp_text_input_v1 *text_input EINA_UNUSED,
575 struct wl_array *map) 575 struct wl_array *map)
576{ 576{
577 WaylandIMContext *imcontext = (WaylandIMContext *)data; 577 WaylandIMContext *imcontext = (WaylandIMContext *)data;
@@ -583,7 +583,7 @@ text_input_modifiers_map(void *data,
583 583
584static void 584static void
585text_input_keysym(void *data, 585text_input_keysym(void *data,
586 struct wl_text_input *text_input EINA_UNUSED, 586 struct zwp_text_input_v1 *text_input EINA_UNUSED,
587 uint32_t serial EINA_UNUSED, 587 uint32_t serial EINA_UNUSED,
588 uint32_t time, 588 uint32_t time,
589 uint32_t sym, 589 uint32_t sym,
@@ -644,7 +644,7 @@ text_input_keysym(void *data,
644 644
645static void 645static void
646text_input_enter(void *data, 646text_input_enter(void *data,
647 struct wl_text_input *text_input EINA_UNUSED, 647 struct zwp_text_input_v1 *text_input EINA_UNUSED,
648 struct wl_surface *surface EINA_UNUSED) 648 struct wl_surface *surface EINA_UNUSED)
649{ 649{
650 WaylandIMContext *imcontext = (WaylandIMContext *)data; 650 WaylandIMContext *imcontext = (WaylandIMContext *)data;
@@ -656,7 +656,7 @@ text_input_enter(void *data,
656 656
657static void 657static void
658text_input_leave(void *data, 658text_input_leave(void *data,
659 struct wl_text_input *text_input EINA_UNUSED) 659 struct zwp_text_input_v1 *text_input EINA_UNUSED)
660{ 660{
661 WaylandIMContext *imcontext = (WaylandIMContext *)data; 661 WaylandIMContext *imcontext = (WaylandIMContext *)data;
662 662
@@ -667,14 +667,14 @@ text_input_leave(void *data,
667 667
668static void 668static void
669text_input_input_panel_state(void *data EINA_UNUSED, 669text_input_input_panel_state(void *data EINA_UNUSED,
670 struct wl_text_input *text_input EINA_UNUSED, 670 struct zwp_text_input_v1 *text_input EINA_UNUSED,
671 uint32_t state EINA_UNUSED) 671 uint32_t state EINA_UNUSED)
672{ 672{
673} 673}
674 674
675static void 675static void
676text_input_language(void *data, 676text_input_language(void *data,
677 struct wl_text_input *text_input EINA_UNUSED, 677 struct zwp_text_input_v1 *text_input EINA_UNUSED,
678 uint32_t serial EINA_UNUSED, 678 uint32_t serial EINA_UNUSED,
679 const char *language) 679 const char *language)
680{ 680{
@@ -705,13 +705,13 @@ text_input_language(void *data,
705 705
706static void 706static void
707text_input_text_direction(void *data EINA_UNUSED, 707text_input_text_direction(void *data EINA_UNUSED,
708 struct wl_text_input *text_input EINA_UNUSED, 708 struct zwp_text_input_v1 *text_input EINA_UNUSED,
709 uint32_t serial EINA_UNUSED, 709 uint32_t serial EINA_UNUSED,
710 uint32_t direction EINA_UNUSED) 710 uint32_t direction EINA_UNUSED)
711{ 711{
712} 712}
713 713
714static const struct wl_text_input_listener text_input_listener = 714static const struct zwp_text_input_v1_listener text_input_listener =
715{ 715{
716 text_input_enter, 716 text_input_enter,
717 text_input_leave, 717 text_input_leave,
@@ -738,9 +738,9 @@ wayland_im_context_add(Ecore_IMF_Context *ctx)
738 imcontext->ctx = ctx; 738 imcontext->ctx = ctx;
739 739
740 imcontext->text_input = 740 imcontext->text_input =
741 wl_text_input_manager_create_text_input(imcontext->text_input_manager); 741 zwp_text_input_manager_v1_create_text_input(imcontext->text_input_manager);
742 if (imcontext->text_input) 742 if (imcontext->text_input)
743 wl_text_input_add_listener(imcontext->text_input, 743 zwp_text_input_v1_add_listener(imcontext->text_input,
744 &text_input_listener, imcontext); 744 &text_input_listener, imcontext);
745} 745}
746 746
@@ -758,7 +758,7 @@ wayland_im_context_del(Ecore_IMF_Context *ctx)
758 } 758 }
759 759
760 if (imcontext->text_input) 760 if (imcontext->text_input)
761 wl_text_input_destroy(imcontext->text_input); 761 zwp_text_input_v1_destroy(imcontext->text_input);
762 762
763 clear_preedit(imcontext); 763 clear_preedit(imcontext);
764} 764}
@@ -772,7 +772,7 @@ wayland_im_context_reset(Ecore_IMF_Context *ctx)
772 clear_preedit(imcontext); 772 clear_preedit(imcontext);
773 773
774 if (imcontext->text_input) 774 if (imcontext->text_input)
775 wl_text_input_reset(imcontext->text_input); 775 zwp_text_input_v1_reset(imcontext->text_input);
776 776
777 update_state(imcontext); 777 update_state(imcontext);
778 778
@@ -805,7 +805,7 @@ wayland_im_context_focus_out(Ecore_IMF_Context *ctx)
805 if (ecore_imf_context_input_panel_enabled_get(ctx)) 805 if (ecore_imf_context_input_panel_enabled_get(ctx))
806 _input_panel_hide(ctx, EINA_FALSE); 806 _input_panel_hide(ctx, EINA_FALSE);
807 807
808 wl_text_input_deactivate(imcontext->text_input, 808 zwp_text_input_v1_deactivate(imcontext->text_input,
809 ecore_wl2_input_seat_get(imcontext->input)); 809 ecore_wl2_input_seat_get(imcontext->input));
810 } 810 }
811 811
@@ -965,16 +965,16 @@ void wayland_im_context_autocapital_type_set(Ecore_IMF_Context *ctx,
965{ 965{
966 WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx); 966 WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx);
967 967
968 imcontext->content_hint &= ~(WL_TEXT_INPUT_CONTENT_HINT_AUTO_CAPITALIZATION | 968 imcontext->content_hint &= ~(ZWP_TEXT_INPUT_V1_CONTENT_HINT_AUTO_CAPITALIZATION |
969 WL_TEXT_INPUT_CONTENT_HINT_UPPERCASE | 969 ZWP_TEXT_INPUT_V1_CONTENT_HINT_UPPERCASE |
970 WL_TEXT_INPUT_CONTENT_HINT_LOWERCASE); 970 ZWP_TEXT_INPUT_V1_CONTENT_HINT_LOWERCASE);
971 971
972 if (autocapital_type == ECORE_IMF_AUTOCAPITAL_TYPE_SENTENCE) 972 if (autocapital_type == ECORE_IMF_AUTOCAPITAL_TYPE_SENTENCE)
973 imcontext->content_hint |= WL_TEXT_INPUT_CONTENT_HINT_AUTO_CAPITALIZATION; 973 imcontext->content_hint |= ZWP_TEXT_INPUT_V1_CONTENT_HINT_AUTO_CAPITALIZATION;
974 else if (autocapital_type == ECORE_IMF_AUTOCAPITAL_TYPE_ALLCHARACTER) 974 else if (autocapital_type == ECORE_IMF_AUTOCAPITAL_TYPE_ALLCHARACTER)
975 imcontext->content_hint |= WL_TEXT_INPUT_CONTENT_HINT_UPPERCASE; 975 imcontext->content_hint |= ZWP_TEXT_INPUT_V1_CONTENT_HINT_UPPERCASE;
976 else 976 else
977 imcontext->content_hint |= WL_TEXT_INPUT_CONTENT_HINT_LOWERCASE; 977 imcontext->content_hint |= ZWP_TEXT_INPUT_V1_CONTENT_HINT_LOWERCASE;
978} 978}
979 979
980void 980void
@@ -984,37 +984,37 @@ wayland_im_context_input_panel_layout_set(Ecore_IMF_Context *ctx, Ecore_IMF_Inpu
984 984
985 switch (layout) { 985 switch (layout) {
986 case ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBER: 986 case ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBER:
987 imcontext->content_purpose = WL_TEXT_INPUT_CONTENT_PURPOSE_NUMBER; 987 imcontext->content_purpose = ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_NUMBER;
988 break; 988 break;
989 case ECORE_IMF_INPUT_PANEL_LAYOUT_EMAIL: 989 case ECORE_IMF_INPUT_PANEL_LAYOUT_EMAIL:
990 imcontext->content_purpose = WL_TEXT_INPUT_CONTENT_PURPOSE_EMAIL; 990 imcontext->content_purpose = ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_EMAIL;
991 break; 991 break;
992 case ECORE_IMF_INPUT_PANEL_LAYOUT_URL: 992 case ECORE_IMF_INPUT_PANEL_LAYOUT_URL:
993 imcontext->content_purpose = WL_TEXT_INPUT_CONTENT_PURPOSE_URL; 993 imcontext->content_purpose = ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_URL;
994 break; 994 break;
995 case ECORE_IMF_INPUT_PANEL_LAYOUT_PHONENUMBER: 995 case ECORE_IMF_INPUT_PANEL_LAYOUT_PHONENUMBER:
996 imcontext->content_purpose = WL_TEXT_INPUT_CONTENT_PURPOSE_PHONE; 996 imcontext->content_purpose = ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_PHONE;
997 break; 997 break;
998 case ECORE_IMF_INPUT_PANEL_LAYOUT_IP: 998 case ECORE_IMF_INPUT_PANEL_LAYOUT_IP:
999 imcontext->content_purpose = WL_TEXT_INPUT_CONTENT_PURPOSE_NUMBER; 999 imcontext->content_purpose = ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_NUMBER;
1000 break; 1000 break;
1001 case ECORE_IMF_INPUT_PANEL_LAYOUT_MONTH: 1001 case ECORE_IMF_INPUT_PANEL_LAYOUT_MONTH:
1002 imcontext->content_purpose = WL_TEXT_INPUT_CONTENT_PURPOSE_DATE; 1002 imcontext->content_purpose = ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_DATE;
1003 break; 1003 break;
1004 case ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY: 1004 case ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY:
1005 imcontext->content_purpose = WL_TEXT_INPUT_CONTENT_PURPOSE_DIGITS; 1005 imcontext->content_purpose = ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_DIGITS;
1006 break; 1006 break;
1007 case ECORE_IMF_INPUT_PANEL_LAYOUT_TERMINAL: 1007 case ECORE_IMF_INPUT_PANEL_LAYOUT_TERMINAL:
1008 imcontext->content_purpose = WL_TEXT_INPUT_CONTENT_PURPOSE_TERMINAL; 1008 imcontext->content_purpose = ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_TERMINAL;
1009 break; 1009 break;
1010 case ECORE_IMF_INPUT_PANEL_LAYOUT_PASSWORD: 1010 case ECORE_IMF_INPUT_PANEL_LAYOUT_PASSWORD:
1011 imcontext->content_purpose = WL_TEXT_INPUT_CONTENT_PURPOSE_PASSWORD; 1011 imcontext->content_purpose = ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_PASSWORD;
1012 break; 1012 break;
1013 case ECORE_IMF_INPUT_PANEL_LAYOUT_DATETIME: 1013 case ECORE_IMF_INPUT_PANEL_LAYOUT_DATETIME:
1014 imcontext->content_purpose = WL_TEXT_INPUT_CONTENT_PURPOSE_DATETIME; 1014 imcontext->content_purpose = ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_DATETIME;
1015 break; 1015 break;
1016 default: 1016 default:
1017 imcontext->content_purpose = WL_TEXT_INPUT_CONTENT_PURPOSE_NORMAL; 1017 imcontext->content_purpose = ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_NORMAL;
1018 break; 1018 break;
1019 } 1019 }
1020} 1020}
@@ -1026,9 +1026,9 @@ wayland_im_context_input_mode_set(Ecore_IMF_Context *ctx,
1026 WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx); 1026 WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx);
1027 1027
1028 if (input_mode & ECORE_IMF_INPUT_MODE_INVISIBLE) 1028 if (input_mode & ECORE_IMF_INPUT_MODE_INVISIBLE)
1029 imcontext->content_hint |= WL_TEXT_INPUT_CONTENT_HINT_PASSWORD; 1029 imcontext->content_hint |= ZWP_TEXT_INPUT_V1_CONTENT_HINT_PASSWORD;
1030 else 1030 else
1031 imcontext->content_hint &= ~WL_TEXT_INPUT_CONTENT_HINT_PASSWORD; 1031 imcontext->content_hint &= ~ZWP_TEXT_INPUT_V1_CONTENT_HINT_PASSWORD;
1032} 1032}
1033 1033
1034void 1034void
@@ -1038,19 +1038,19 @@ wayland_im_context_input_hint_set(Ecore_IMF_Context *ctx,
1038 WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx); 1038 WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx);
1039 1039
1040 if (input_hints & ECORE_IMF_INPUT_HINT_AUTO_COMPLETE) 1040 if (input_hints & ECORE_IMF_INPUT_HINT_AUTO_COMPLETE)
1041 imcontext->content_hint |= WL_TEXT_INPUT_CONTENT_HINT_AUTO_COMPLETION; 1041 imcontext->content_hint |= ZWP_TEXT_INPUT_V1_CONTENT_HINT_AUTO_COMPLETION;
1042 else 1042 else
1043 imcontext->content_hint &= ~WL_TEXT_INPUT_CONTENT_HINT_AUTO_COMPLETION; 1043 imcontext->content_hint &= ~ZWP_TEXT_INPUT_V1_CONTENT_HINT_AUTO_COMPLETION;
1044 1044
1045 if (input_hints & ECORE_IMF_INPUT_HINT_SENSITIVE_DATA) 1045 if (input_hints & ECORE_IMF_INPUT_HINT_SENSITIVE_DATA)
1046 imcontext->content_hint |= WL_TEXT_INPUT_CONTENT_HINT_SENSITIVE_DATA; 1046 imcontext->content_hint |= ZWP_TEXT_INPUT_V1_CONTENT_HINT_SENSITIVE_DATA;
1047 else 1047 else
1048 imcontext->content_hint &= ~WL_TEXT_INPUT_CONTENT_HINT_SENSITIVE_DATA; 1048 imcontext->content_hint &= ~ZWP_TEXT_INPUT_V1_CONTENT_HINT_SENSITIVE_DATA;
1049 1049
1050 if (input_hints & ECORE_IMF_INPUT_HINT_MULTILINE) 1050 if (input_hints & ECORE_IMF_INPUT_HINT_MULTILINE)
1051 imcontext->content_hint |= WL_TEXT_INPUT_CONTENT_HINT_MULTILINE; 1051 imcontext->content_hint |= ZWP_TEXT_INPUT_V1_CONTENT_HINT_MULTILINE;
1052 else 1052 else
1053 imcontext->content_hint &= ~WL_TEXT_INPUT_CONTENT_HINT_MULTILINE; 1053 imcontext->content_hint &= ~ZWP_TEXT_INPUT_V1_CONTENT_HINT_MULTILINE;
1054} 1054}
1055 1055
1056void 1056void
@@ -1060,9 +1060,9 @@ wayland_im_context_input_panel_language_set(Ecore_IMF_Context *ctx,
1060 WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx); 1060 WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx);
1061 1061
1062 if (lang == ECORE_IMF_INPUT_PANEL_LANG_ALPHABET) 1062 if (lang == ECORE_IMF_INPUT_PANEL_LANG_ALPHABET)
1063 imcontext->content_hint |= WL_TEXT_INPUT_CONTENT_HINT_LATIN; 1063 imcontext->content_hint |= ZWP_TEXT_INPUT_V1_CONTENT_HINT_LATIN;
1064 else 1064 else
1065 imcontext->content_hint &= ~WL_TEXT_INPUT_CONTENT_HINT_LATIN; 1065 imcontext->content_hint &= ~ZWP_TEXT_INPUT_V1_CONTENT_HINT_LATIN;
1066} 1066}
1067 1067
1068void 1068void
@@ -1082,12 +1082,12 @@ wayland_im_context_prediction_allow_set(Ecore_IMF_Context *ctx,
1082 WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx); 1082 WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx);
1083 1083
1084 if (prediction) 1084 if (prediction)
1085 imcontext->content_hint |= WL_TEXT_INPUT_CONTENT_HINT_AUTO_COMPLETION; 1085 imcontext->content_hint |= ZWP_TEXT_INPUT_V1_CONTENT_HINT_AUTO_COMPLETION;
1086 else 1086 else
1087 imcontext->content_hint &= ~WL_TEXT_INPUT_CONTENT_HINT_AUTO_COMPLETION; 1087 imcontext->content_hint &= ~ZWP_TEXT_INPUT_V1_CONTENT_HINT_AUTO_COMPLETION;
1088} 1088}
1089 1089
1090WaylandIMContext *wayland_im_context_new (struct wl_text_input_manager *text_input_manager) 1090WaylandIMContext *wayland_im_context_new (struct zwp_text_input_manager_v1 *text_input_manager)
1091{ 1091{
1092 WaylandIMContext *context = calloc(1, sizeof(WaylandIMContext)); 1092 WaylandIMContext *context = calloc(1, sizeof(WaylandIMContext));
1093 1093
diff --git a/src/modules/ecore_imf/wayland/wayland_imcontext.h b/src/modules/ecore_imf/wayland/wayland_imcontext.h
index 45c2933..5504862 100644
--- a/src/modules/ecore_imf/wayland/wayland_imcontext.h
+++ b/src/modules/ecore_imf/wayland/wayland_imcontext.h
@@ -26,7 +26,7 @@
26#include <Ecore_IMF.h> 26#include <Ecore_IMF.h>
27#include <Ecore_Wl2.h> 27#include <Ecore_Wl2.h>
28 28
29#include "text-client-protocol.h" 29#include "text-input-unstable-v1-client-protocol.h"
30 30
31extern Ecore_Wl2_Display *ewd; 31extern Ecore_Wl2_Display *ewd;
32 32
@@ -87,7 +87,7 @@ void
87wayland_im_context_prediction_allow_set(Ecore_IMF_Context *ctx, 87wayland_im_context_prediction_allow_set(Ecore_IMF_Context *ctx,
88 Eina_Bool prediction); 88 Eina_Bool prediction);
89 89
90WaylandIMContext *wayland_im_context_new (struct wl_text_input_manager *text_input_manager); 90WaylandIMContext *wayland_im_context_new (struct zwp_text_input_manager_v1 *text_input_manager);
91 91
92extern int _ecore_imf_wayland_log_dom; 92extern int _ecore_imf_wayland_log_dom;
93 93
diff --git a/src/modules/ecore_imf/wayland/wayland_module.c b/src/modules/ecore_imf/wayland/wayland_module.c
index a47aaee..57b1117 100644
--- a/src/modules/ecore_imf/wayland/wayland_module.c
+++ b/src/modules/ecore_imf/wayland/wayland_module.c
@@ -30,7 +30,7 @@
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-input-unstable-v1-client-protocol.h"
34 34
35int _ecore_imf_wayland_log_dom = -1; 35int _ecore_imf_wayland_log_dom = -1;
36Ecore_Wl2_Display *ewd; 36Ecore_Wl2_Display *ewd;
@@ -85,7 +85,7 @@ static Ecore_IMF_Context_Class wayland_imf_class =
85 NULL /* bidi_direction_set */ 85 NULL /* bidi_direction_set */
86}; 86};
87 87
88static struct wl_text_input_manager *text_input_manager = NULL; 88static struct zwp_text_input_manager_v1 *text_input_manager = NULL;
89 89
90static Ecore_IMF_Context * 90static Ecore_IMF_Context *
91im_module_exit(void) 91im_module_exit(void)
@@ -112,11 +112,11 @@ im_module_create()
112 registry = ecore_wl2_display_registry_get(ewd); 112 registry = ecore_wl2_display_registry_get(ewd);
113 EINA_ITERATOR_FOREACH(itr, global) 113 EINA_ITERATOR_FOREACH(itr, global)
114 { 114 {
115 if (!strcmp(global->interface, "wl_text_input_manager")) 115 if (!strcmp(global->interface, "zwp_text_input_manager_v1"))
116 { 116 {
117 text_input_manager = 117 text_input_manager =
118 wl_registry_bind(registry, global->id, 118 wl_registry_bind(registry, global->id,
119 &wl_text_input_manager_interface, 1); 119 &zwp_text_input_manager_v1_interface, 1);
120 EINA_LOG_DOM_INFO(_ecore_imf_wayland_log_dom, 120 EINA_LOG_DOM_INFO(_ecore_imf_wayland_log_dom,
121 "bound wl_text_input_manager interface"); 121 "bound wl_text_input_manager interface");
122 break; 122 break;