aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/ecore/src/lib/ecore_imf
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-01-04 18:41:13 +1000
committerDavid Walter Seikel2012-01-04 18:41:13 +1000
commitdd7595a3475407a7fa96a97393bae8c5220e8762 (patch)
treee341e911d7eb911a51684a7412ef7f7c7605d28e /libraries/ecore/src/lib/ecore_imf
parentAdd the skeleton. (diff)
downloadSledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.zip
SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.gz
SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.bz2
SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.xz
Add the base Enlightenment Foundation Libraries - eina, eet, evas, ecore, embryo, and edje.
Note that embryo wont be used, but I'm not sure yet if you can build edje without it.
Diffstat (limited to 'libraries/ecore/src/lib/ecore_imf')
-rw-r--r--libraries/ecore/src/lib/ecore_imf/Ecore_IMF.h418
-rw-r--r--libraries/ecore/src/lib/ecore_imf/Makefile.am28
-rw-r--r--libraries/ecore/src/lib/ecore_imf/Makefile.in822
-rw-r--r--libraries/ecore/src/lib/ecore_imf/ecore_imf.c73
-rw-r--r--libraries/ecore/src/lib/ecore_imf/ecore_imf_context.c1237
-rw-r--r--libraries/ecore/src/lib/ecore_imf/ecore_imf_module.c212
-rw-r--r--libraries/ecore/src/lib/ecore_imf/ecore_imf_private.h72
7 files changed, 2862 insertions, 0 deletions
diff --git a/libraries/ecore/src/lib/ecore_imf/Ecore_IMF.h b/libraries/ecore/src/lib/ecore_imf/Ecore_IMF.h
new file mode 100644
index 0000000..21df2a0
--- /dev/null
+++ b/libraries/ecore/src/lib/ecore_imf/Ecore_IMF.h
@@ -0,0 +1,418 @@
1#ifndef _ECORE_IMF_H
2#define _ECORE_IMF_H
3
4#include <Eina.h>
5
6#ifdef EAPI
7# undef EAPI
8#endif
9
10#ifdef _WIN32
11# ifdef EFL_ECORE_IMF_BUILD
12# ifdef DLL_EXPORT
13# define EAPI __declspec(dllexport)
14# else
15# define EAPI
16# endif /* ! DLL_EXPORT */
17# else
18# define EAPI __declspec(dllimport)
19# endif /* ! EFL_ECORE_IMF_BUILD */
20#else
21# ifdef __GNUC__
22# if __GNUC__ >= 4
23# define EAPI __attribute__ ((visibility("default")))
24# else
25# define EAPI
26# endif
27# else
28# define EAPI
29# endif
30#endif /* ! _WIN32 */
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
36/* Events sent by the Input Method */
37typedef struct _Ecore_IMF_Event_Preedit_Start Ecore_IMF_Event_Preedit_Start;
38typedef struct _Ecore_IMF_Event_Preedit_End Ecore_IMF_Event_Preedit_End;
39typedef struct _Ecore_IMF_Event_Preedit_Changed Ecore_IMF_Event_Preedit_Changed;
40typedef struct _Ecore_IMF_Event_Commit Ecore_IMF_Event_Commit;
41typedef struct _Ecore_IMF_Event_Delete_Surrounding Ecore_IMF_Event_Delete_Surrounding;
42
43/* Events to filter */
44typedef struct _Ecore_IMF_Event_Mouse_Down Ecore_IMF_Event_Mouse_Down;
45typedef struct _Ecore_IMF_Event_Mouse_Up Ecore_IMF_Event_Mouse_Up;
46typedef struct _Ecore_IMF_Event_Mouse_In Ecore_IMF_Event_Mouse_In;
47typedef struct _Ecore_IMF_Event_Mouse_Out Ecore_IMF_Event_Mouse_Out;
48typedef struct _Ecore_IMF_Event_Mouse_Move Ecore_IMF_Event_Mouse_Move;
49typedef struct _Ecore_IMF_Event_Mouse_Wheel Ecore_IMF_Event_Mouse_Wheel;
50typedef struct _Ecore_IMF_Event_Key_Down Ecore_IMF_Event_Key_Down;
51typedef struct _Ecore_IMF_Event_Key_Up Ecore_IMF_Event_Key_Up;
52typedef union _Ecore_IMF_Event Ecore_IMF_Event;
53
54typedef struct _Ecore_IMF_Context Ecore_IMF_Context; /**< An Input Method Context */
55typedef struct _Ecore_IMF_Context_Class Ecore_IMF_Context_Class; /**< An Input Method Context class */
56typedef struct _Ecore_IMF_Context_Info Ecore_IMF_Context_Info; /**< An Input Method Context info */
57
58/* Preedit attribute info */
59typedef struct _Ecore_IMF_Preedit_Attr Ecore_IMF_Preedit_Attr;
60
61EAPI extern int ECORE_IMF_EVENT_PREEDIT_START;
62EAPI extern int ECORE_IMF_EVENT_PREEDIT_END;
63EAPI extern int ECORE_IMF_EVENT_PREEDIT_CHANGED;
64EAPI extern int ECORE_IMF_EVENT_COMMIT;
65EAPI extern int ECORE_IMF_EVENT_DELETE_SURROUNDING;
66
67typedef enum
68{
69 ECORE_IMF_EVENT_MOUSE_DOWN,
70 ECORE_IMF_EVENT_MOUSE_UP,
71 ECORE_IMF_EVENT_MOUSE_IN,
72 ECORE_IMF_EVENT_MOUSE_OUT,
73 ECORE_IMF_EVENT_MOUSE_MOVE,
74 ECORE_IMF_EVENT_MOUSE_WHEEL,
75 ECORE_IMF_EVENT_KEY_DOWN,
76 ECORE_IMF_EVENT_KEY_UP
77} Ecore_IMF_Event_Type;
78
79typedef enum
80{
81 ECORE_IMF_KEYBOARD_MODIFIER_NONE = 0, /**< No active modifiers */
82 ECORE_IMF_KEYBOARD_MODIFIER_CTRL = 1 << 0, /**< "Control" is pressed */
83 ECORE_IMF_KEYBOARD_MODIFIER_ALT = 1 << 1, /**< "Alt" is pressed */
84 ECORE_IMF_KEYBOARD_MODIFIER_SHIFT = 1 << 2, /**< "Shift" is pressed */
85 ECORE_IMF_KEYBOARD_MODIFIER_WIN = 1 << 3 /**< "Win" (between "Ctrl" and "Alt") is pressed */
86} Ecore_IMF_Keyboard_Modifiers;
87
88typedef enum
89{
90 ECORE_IMF_KEYBOARD_LOCK_NONE = 0, /**< No locks are active */
91 ECORE_IMF_KEYBOARD_LOCK_NUM = 1 << 0, /**< "Num" lock is active */
92 ECORE_IMF_KEYBOARD_LOCK_CAPS = 1 << 1, /**< "Caps" lock is active */
93 ECORE_IMF_KEYBOARD_LOCK_SCROLL = 1 << 2 /**< "Scroll" lock is active */
94} Ecore_IMF_Keyboard_Locks;
95
96typedef enum
97{
98 ECORE_IMF_MOUSE_NONE = 0, /**< A single click */
99 ECORE_IMF_MOUSE_DOUBLE_CLICK = 1 << 0, /**< A double click */
100 ECORE_IMF_MOUSE_TRIPLE_CLICK = 1 << 1 /**< A triple click */
101} Ecore_IMF_Mouse_Flags;
102
103typedef enum
104{
105 ECORE_IMF_INPUT_MODE_ALPHA = 1 << 0,
106 ECORE_IMF_INPUT_MODE_NUMERIC = 1 << 1,
107 ECORE_IMF_INPUT_MODE_SPECIAL = 1 << 2,
108 ECORE_IMF_INPUT_MODE_HEXA = 1 << 3,
109 ECORE_IMF_INPUT_MODE_TELE = 1 << 4,
110 ECORE_IMF_INPUT_MODE_FULL = (ECORE_IMF_INPUT_MODE_ALPHA | ECORE_IMF_INPUT_MODE_NUMERIC | ECORE_IMF_INPUT_MODE_SPECIAL),
111 ECORE_IMF_INPUT_MODE_INVISIBLE = 1 << 29,
112 ECORE_IMF_INPUT_MODE_AUTOCAP = 1 << 30
113} Ecore_IMF_Input_Mode;
114
115typedef enum
116{
117 ECORE_IMF_PREEDIT_TYPE_NONE,
118 ECORE_IMF_PREEDIT_TYPE_SUB1,
119 ECORE_IMF_PREEDIT_TYPE_SUB2,
120 ECORE_IMF_PREEDIT_TYPE_SUB3
121} Ecore_IMF_Preedit_Type;
122
123typedef enum
124{
125 ECORE_IMF_AUTOCAPITAL_TYPE_NONE,
126 ECORE_IMF_AUTOCAPITAL_TYPE_WORD,
127 ECORE_IMF_AUTOCAPITAL_TYPE_SENTENCE,
128 ECORE_IMF_AUTOCAPITAL_TYPE_ALLCHARACTER
129} Ecore_IMF_Autocapital_Type;
130
131typedef enum
132{
133 ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL, /**< Default layout */
134 ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBER, /**< Number layout */
135 ECORE_IMF_INPUT_PANEL_LAYOUT_EMAIL, /**< Email layout */
136 ECORE_IMF_INPUT_PANEL_LAYOUT_URL, /**< URL layout */
137 ECORE_IMF_INPUT_PANEL_LAYOUT_PHONENUMBER, /**< Phone Number layout */
138 ECORE_IMF_INPUT_PANEL_LAYOUT_IP, /**< IP layout */
139 ECORE_IMF_INPUT_PANEL_LAYOUT_MONTH, /**< Month layout */
140 ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY, /**< Number Only layout */
141 ECORE_IMF_INPUT_PANEL_LAYOUT_INVALID
142} Ecore_IMF_Input_Panel_Layout;
143
144typedef enum
145{
146 ECORE_IMF_INPUT_PANEL_LANG_AUTOMATIC, /**< Automatic */
147 ECORE_IMF_INPUT_PANEL_LANG_ALPHABET /**< Alphabet */
148} Ecore_IMF_Input_Panel_Lang;
149
150struct _Ecore_IMF_Event_Preedit_Start
151{
152 Ecore_IMF_Context *ctx;
153};
154
155struct _Ecore_IMF_Event_Preedit_End
156{
157 Ecore_IMF_Context *ctx;
158};
159
160struct _Ecore_IMF_Event_Preedit_Changed
161{
162 Ecore_IMF_Context *ctx;
163};
164
165struct _Ecore_IMF_Event_Commit
166{
167 Ecore_IMF_Context *ctx;
168 char *str;
169};
170
171struct _Ecore_IMF_Event_Delete_Surrounding
172{
173 Ecore_IMF_Context *ctx;
174 int offset;
175 int n_chars;
176};
177
178struct _Ecore_IMF_Event_Mouse_Down
179{
180 int button; /**< The button which has been pressed */
181 struct {
182 int x, y;
183 } output;
184 struct {
185 int x, y;
186 } canvas;
187 Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
188 Ecore_IMF_Keyboard_Locks locks; /**< The keyboard locks active when the event has been emitted */
189 Ecore_IMF_Mouse_Flags flags; /**< The flags corresponding the mouse click (single, double or triple click) */
190 unsigned int timestamp; /**< The timestamp when the event occurred */
191};
192
193struct _Ecore_IMF_Event_Mouse_Up
194{
195 int button; /**< The button which has been pressed */
196 struct {
197 int x, y;
198 } output;
199 struct {
200 int x, y;
201 } canvas;
202 Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
203 Ecore_IMF_Keyboard_Locks locks; /**< The keyboard locks active when the event has been emitted */
204 Ecore_IMF_Mouse_Flags flags; /**< The flags corresponding the mouse click (single, double or triple click) */
205 unsigned int timestamp; /**< The timestamp when the event occurred */
206};
207
208struct _Ecore_IMF_Event_Mouse_In
209{
210 int buttons;
211 struct {
212 int x, y;
213 } output;
214 struct {
215 int x, y;
216 } canvas;
217 Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
218 Ecore_IMF_Keyboard_Locks locks; /**< The keyboard locks active when the event has been emitted */
219 unsigned int timestamp; /**< The timestamp when the event occurred */
220};
221
222struct _Ecore_IMF_Event_Mouse_Out
223{
224 int buttons;
225 struct {
226 int x, y;
227 } output;
228 struct {
229 int x, y;
230 } canvas;
231 Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
232 Ecore_IMF_Keyboard_Locks locks; /**< The keyboard locks active when the event has been emitted */
233 unsigned int timestamp; /**< The timestamp when the event occurred */
234};
235
236struct _Ecore_IMF_Event_Mouse_Move
237{
238 int buttons;
239 struct {
240 struct {
241 int x, y;
242 } output;
243 struct {
244 int x, y;
245 } canvas;
246 } cur, prev;
247 Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
248 Ecore_IMF_Keyboard_Locks locks; /**< The keyboard locks active when the event has been emitted */
249 unsigned int timestamp; /**< The timestamp when the event occurred */
250};
251
252struct _Ecore_IMF_Event_Mouse_Wheel
253{
254 int direction; /* 0 = default up/down wheel */
255 int z; /* ...,-2,-1 = down, 1,2,... = up */
256 struct {
257 int x, y;
258 } output;
259 struct {
260 int x, y;
261 } canvas;
262 Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
263 Ecore_IMF_Keyboard_Locks locks; /**< The keyboard locks active when the event has been emitted */
264 unsigned int timestamp; /**< The timestamp when the event occurred */
265};
266
267struct _Ecore_IMF_Event_Key_Down
268{
269 const char *keyname; /**< The string name of the key pressed */
270 Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
271 Ecore_IMF_Keyboard_Locks locks; /**< The keyboard locks active when the event has been emitted */
272 const char *key; /**< The logical key : (eg shift+1 == exclamation) */
273 const char *string; /**< A UTF8 string if this keystroke has produced a visible string to be ADDED */
274 const char *compose; /**< A UTF8 string if this keystroke has modified a string in the middle of being composed - this string replaces the previous one */
275 unsigned int timestamp; /**< The timestamp when the event occurred */
276};
277
278struct _Ecore_IMF_Event_Key_Up
279{
280 const char *keyname; /**< The string name of the key pressed */
281 Ecore_IMF_Keyboard_Modifiers modifiers; /**< The keyboard modifiers active when the event has been emitted */
282 Ecore_IMF_Keyboard_Locks locks; /**< The keyboard locks active when the event has been emitted */
283 const char *key; /**< The logical key : (eg shift+1 == exclamation) */
284 const char *string; /**< A UTF8 string if this keystroke has produced a visible string to be ADDED */
285 const char *compose; /**< A UTF8 string if this keystroke has modified a string in the middle of being composed - this string replaces the previous one */
286 unsigned int timestamp; /**< The timestamp when the event occurred */
287};
288
289union _Ecore_IMF_Event
290{
291 Ecore_IMF_Event_Mouse_Down mouse_down;
292 Ecore_IMF_Event_Mouse_Up mouse_up;
293 Ecore_IMF_Event_Mouse_In mouse_in;
294 Ecore_IMF_Event_Mouse_Out mouse_out;
295 Ecore_IMF_Event_Mouse_Move mouse_move;
296 Ecore_IMF_Event_Mouse_Wheel mouse_wheel;
297 Ecore_IMF_Event_Key_Down key_down;
298 Ecore_IMF_Event_Key_Up key_up;
299};
300
301struct _Ecore_IMF_Preedit_Attr
302{
303 Ecore_IMF_Preedit_Type preedit_type;
304 unsigned int start_index;
305 unsigned int end_index;
306};
307
308struct _Ecore_IMF_Context_Class
309{
310 void (*add) (Ecore_IMF_Context *ctx);
311 void (*del) (Ecore_IMF_Context *ctx);
312 void (*client_window_set) (Ecore_IMF_Context *ctx, void *window);
313 void (*client_canvas_set) (Ecore_IMF_Context *ctx, void *canvas);
314 void (*show) (Ecore_IMF_Context *ctx);
315 void (*hide) (Ecore_IMF_Context *ctx);
316 void (*preedit_string_get) (Ecore_IMF_Context *ctx, char **str, int *cursor_pos);
317 void (*focus_in) (Ecore_IMF_Context *ctx);
318 void (*focus_out) (Ecore_IMF_Context *ctx);
319 void (*reset) (Ecore_IMF_Context *ctx);
320 void (*cursor_position_set) (Ecore_IMF_Context *ctx, int cursor_pos);
321 void (*use_preedit_set) (Ecore_IMF_Context *ctx, Eina_Bool use_preedit);
322 void (*input_mode_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Mode input_mode);
323 Eina_Bool (*filter_event) (Ecore_IMF_Context *ctx, Ecore_IMF_Event_Type type, Ecore_IMF_Event *event);
324 void (*preedit_string_with_attributes_get) (Ecore_IMF_Context *ctx, char **str, Eina_List **attrs, int *cursor_pos);
325 void (*prediction_allow_set)(Ecore_IMF_Context *ctx, Eina_Bool prediction);
326 void (*autocapital_type_set)(Ecore_IMF_Context *ctx, Ecore_IMF_Autocapital_Type autocapital_type);
327 void (*control_panel_show) (Ecore_IMF_Context *ctx);
328 void (*control_panel_hide) (Ecore_IMF_Context *ctx);
329 void (*input_panel_layout_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Layout layout);
330 Ecore_IMF_Input_Panel_Layout (*input_panel_layout_get) (Ecore_IMF_Context *ctx);
331 void (*input_panel_language_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Lang lang);
332 Ecore_IMF_Input_Panel_Lang (*input_panel_language_get) (Ecore_IMF_Context *ctx);
333 void (*cursor_location_set) (Ecore_IMF_Context *ctx, int x, int y, int w, int h);
334};
335
336struct _Ecore_IMF_Context_Info
337{
338 const char *id; /* ID */
339 const char *description; /* Human readable description */
340 const char *default_locales; /* Languages for which this context is the default, separated by : */
341 const char *canvas_type; /* The canvas type used by the input method. Eg.: evas */
342 int canvas_required; /* Whether the canvas usage is required for this input method */
343};
344
345EAPI int ecore_imf_init(void);
346EAPI int ecore_imf_shutdown(void);
347
348EAPI void ecore_imf_module_register(const Ecore_IMF_Context_Info *info, Ecore_IMF_Context *(*imf_module_create)(void), Ecore_IMF_Context *(*imf_module_exit)(void));
349
350EAPI Eina_List *ecore_imf_context_available_ids_get(void);
351EAPI Eina_List *ecore_imf_context_available_ids_by_canvas_type_get(const char *canvas_type);
352EAPI const char *ecore_imf_context_default_id_get(void);
353EAPI const char *ecore_imf_context_default_id_by_canvas_type_get(const char *canvas_type);
354EAPI const Ecore_IMF_Context_Info *ecore_imf_context_info_by_id_get(const char *id);
355
356EAPI Ecore_IMF_Context *ecore_imf_context_add(const char *id);
357EAPI const Ecore_IMF_Context_Info *ecore_imf_context_info_get(Ecore_IMF_Context *ctx);
358EAPI void ecore_imf_context_del(Ecore_IMF_Context *ctx);
359EAPI void ecore_imf_context_client_window_set(Ecore_IMF_Context *ctx, void *window);
360EAPI void *ecore_imf_context_client_window_get(Ecore_IMF_Context *ctx);
361EAPI void ecore_imf_context_client_canvas_set(Ecore_IMF_Context *ctx, void *canvas);
362EAPI void *ecore_imf_context_client_canvas_get(Ecore_IMF_Context *ctx);
363EAPI void ecore_imf_context_show(Ecore_IMF_Context *ctx);
364EAPI void ecore_imf_context_hide(Ecore_IMF_Context *ctx);
365EAPI void ecore_imf_context_preedit_string_get(Ecore_IMF_Context *ctx, char **str, int *cursor_pos);
366EAPI void ecore_imf_context_preedit_string_with_attributes_get(Ecore_IMF_Context *ctx, char **str, Eina_List **attrs, int *cursor_pos);
367EAPI void ecore_imf_context_focus_in(Ecore_IMF_Context *ctx);
368EAPI void ecore_imf_context_focus_out(Ecore_IMF_Context *ctx);
369EAPI void ecore_imf_context_reset(Ecore_IMF_Context *ctx);
370EAPI void ecore_imf_context_cursor_position_set(Ecore_IMF_Context *ctx, int cursor_pos);
371EAPI void ecore_imf_context_cursor_location_set(Ecore_IMF_Context *ctx, int x, int y, int w, int h);
372EAPI void ecore_imf_context_use_preedit_set(Ecore_IMF_Context *ctx, Eina_Bool use_preedit);
373EAPI void ecore_imf_context_retrieve_surrounding_callback_set(Ecore_IMF_Context *ctx, Eina_Bool (*func)(void *data, Ecore_IMF_Context *ctx, char **text, int *cursor_pos), const void *data);
374EAPI void ecore_imf_context_input_mode_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Mode input_mode);
375EAPI Ecore_IMF_Input_Mode ecore_imf_context_input_mode_get(Ecore_IMF_Context *ctx);
376EAPI Eina_Bool ecore_imf_context_filter_event(Ecore_IMF_Context *ctx, Ecore_IMF_Event_Type type, Ecore_IMF_Event *event);
377
378/* plugin specific functions */
379EAPI Ecore_IMF_Context *ecore_imf_context_new(const Ecore_IMF_Context_Class *ctxc);
380EAPI void ecore_imf_context_data_set(Ecore_IMF_Context *ctx, void *data);
381EAPI void *ecore_imf_context_data_get(Ecore_IMF_Context *ctx);
382EAPI Eina_Bool ecore_imf_context_surrounding_get(Ecore_IMF_Context *ctx, char **text, int *cursor_pos);
383EAPI void ecore_imf_context_preedit_start_event_add(Ecore_IMF_Context *ctx);
384EAPI void ecore_imf_context_preedit_end_event_add(Ecore_IMF_Context *ctx);
385EAPI void ecore_imf_context_preedit_changed_event_add(Ecore_IMF_Context *ctx);
386EAPI void ecore_imf_context_commit_event_add(Ecore_IMF_Context *ctx, const char *str);
387EAPI void ecore_imf_context_delete_surrounding_event_add(Ecore_IMF_Context *ctx, int offset, int n_chars);
388EAPI void ecore_imf_context_prediction_allow_set(Ecore_IMF_Context *ctx, Eina_Bool prediction);
389EAPI Eina_Bool ecore_imf_context_prediction_allow_get(Ecore_IMF_Context *ctx);
390EAPI void ecore_imf_context_autocapital_type_set(Ecore_IMF_Context *ctx, Ecore_IMF_Autocapital_Type autocapital_type);
391EAPI Ecore_IMF_Autocapital_Type ecore_imf_context_autocapital_type_get(Ecore_IMF_Context *ctx);
392
393EAPI void ecore_imf_context_control_panel_show(Ecore_IMF_Context *ctx);
394EAPI void ecore_imf_context_control_panel_hide(Ecore_IMF_Context *ctx);
395
396EAPI void ecore_imf_context_input_panel_show(Ecore_IMF_Context *ctx);
397EAPI void ecore_imf_context_input_panel_hide(Ecore_IMF_Context *ctx);
398EAPI void ecore_imf_context_input_panel_layout_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Layout layout);
399EAPI Ecore_IMF_Input_Panel_Layout ecore_imf_context_input_panel_layout_get(Ecore_IMF_Context *ctx);
400EAPI void ecore_imf_context_input_panel_language_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Lang lang);
401EAPI Ecore_IMF_Input_Panel_Lang ecore_imf_context_input_panel_language_get(Ecore_IMF_Context *ctx);
402EAPI void ecore_imf_context_input_panel_enabled_set(Ecore_IMF_Context *ctx, Eina_Bool enable);
403EAPI Eina_Bool ecore_imf_context_input_panel_enabled_get(Ecore_IMF_Context *ctx);
404
405/* The following entry points must be exported by each input method module
406 */
407
408/*
409 * int imf_module_init (const Ecore_IMF_Context_Info **info);
410 * void imf_module_exit (void);
411 * Ecore_IMF_Context *imf_module_create (void);
412 */
413
414#ifdef __cplusplus
415}
416#endif
417
418#endif
diff --git a/libraries/ecore/src/lib/ecore_imf/Makefile.am b/libraries/ecore/src/lib/ecore_imf/Makefile.am
new file mode 100644
index 0000000..10f6c2f
--- /dev/null
+++ b/libraries/ecore/src/lib/ecore_imf/Makefile.am
@@ -0,0 +1,28 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3AM_CPPFLAGS = \
4-I$(top_srcdir)/src/lib/ecore \
5-DPACKAGE_LIB_DIR=\"$(libdir)\" \
6@EFL_ECORE_IMF_BUILD@ \
7@EVIL_CFLAGS@ \
8@EINA_CFLAGS@
9
10AM_CFLAGS = @WIN32_CFLAGS@
11
12lib_LTLIBRARIES = libecore_imf.la
13includes_HEADERS = Ecore_IMF.h
14includesdir = $(includedir)/ecore-@VMAJ@
15
16libecore_imf_la_SOURCES = \
17ecore_imf.c \
18ecore_imf_context.c \
19ecore_imf_module.c
20
21libecore_imf_la_LIBADD = \
22$(top_builddir)/src/lib/ecore/libecore.la \
23@EINA_LIBS@ \
24@EVIL_LIBS@
25
26libecore_imf_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info @version_info@ @release_info@
27
28EXTRA_DIST = ecore_imf_private.h
diff --git a/libraries/ecore/src/lib/ecore_imf/Makefile.in b/libraries/ecore/src/lib/ecore_imf/Makefile.in
new file mode 100644
index 0000000..adf8dea
--- /dev/null
+++ b/libraries/ecore/src/lib/ecore_imf/Makefile.in
@@ -0,0 +1,822 @@
1# Makefile.in generated by automake 1.11.1 from Makefile.am.
2# @configure_input@
3
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
6# Inc.
7# This Makefile.in is free software; the Free Software Foundation
8# gives unlimited permission to copy and/or distribute it,
9# with or without modifications, as long as this notice is preserved.
10
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
13# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14# PARTICULAR PURPOSE.
15
16@SET_MAKE@
17
18
19VPATH = @srcdir@
20pkgdatadir = $(datadir)/@PACKAGE@
21pkgincludedir = $(includedir)/@PACKAGE@
22pkglibdir = $(libdir)/@PACKAGE@
23pkglibexecdir = $(libexecdir)/@PACKAGE@
24am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
25install_sh_DATA = $(install_sh) -c -m 644
26install_sh_PROGRAM = $(install_sh) -c
27install_sh_SCRIPT = $(install_sh) -c
28INSTALL_HEADER = $(INSTALL_DATA)
29transform = $(program_transform_name)
30NORMAL_INSTALL = :
31PRE_INSTALL = :
32POST_INSTALL = :
33NORMAL_UNINSTALL = :
34PRE_UNINSTALL = :
35POST_UNINSTALL = :
36build_triplet = @build@
37host_triplet = @host@
38subdir = src/lib/ecore_imf
39DIST_COMMON = $(includes_HEADERS) $(srcdir)/Makefile.am \
40 $(srcdir)/Makefile.in
41ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
42am__aclocal_m4_deps = $(top_srcdir)/m4/ac_attribute.m4 \
43 $(top_srcdir)/m4/ac_path_generic.m4 \
44 $(top_srcdir)/m4/check_x_extension.m4 \
45 $(top_srcdir)/m4/ecore_check_module.m4 \
46 $(top_srcdir)/m4/ecore_check_options.m4 \
47 $(top_srcdir)/m4/efl_compiler_flag.m4 \
48 $(top_srcdir)/m4/efl_doxygen.m4 \
49 $(top_srcdir)/m4/efl_examples.m4 \
50 $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \
51 $(top_srcdir)/m4/efl_threads.m4 $(top_srcdir)/m4/gettext.m4 \
52 $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \
53 $(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/lib-ld.m4 \
54 $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
55 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
56 $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
57 $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \
58 $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
59 $(top_srcdir)/configure.ac
60am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
61 $(ACLOCAL_M4)
62mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
63CONFIG_HEADER = $(top_builddir)/config.h
64CONFIG_CLEAN_FILES =
65CONFIG_CLEAN_VPATH_FILES =
66am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
67am__vpath_adj = case $$p in \
68 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
69 *) f=$$p;; \
70 esac;
71am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
72am__install_max = 40
73am__nobase_strip_setup = \
74 srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
75am__nobase_strip = \
76 for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
77am__nobase_list = $(am__nobase_strip_setup); \
78 for p in $$list; do echo "$$p $$p"; done | \
79 sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
80 $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
81 if (++n[$$2] == $(am__install_max)) \
82 { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
83 END { for (dir in files) print dir, files[dir] }'
84am__base_list = \
85 sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
86 sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
87am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includesdir)"
88LTLIBRARIES = $(lib_LTLIBRARIES)
89libecore_imf_la_DEPENDENCIES = \
90 $(top_builddir)/src/lib/ecore/libecore.la
91am_libecore_imf_la_OBJECTS = ecore_imf.lo ecore_imf_context.lo \
92 ecore_imf_module.lo
93libecore_imf_la_OBJECTS = $(am_libecore_imf_la_OBJECTS)
94AM_V_lt = $(am__v_lt_$(V))
95am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
96am__v_lt_0 = --silent
97libecore_imf_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
98 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
99 $(AM_CFLAGS) $(CFLAGS) $(libecore_imf_la_LDFLAGS) $(LDFLAGS) \
100 -o $@
101DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
102depcomp = $(SHELL) $(top_srcdir)/depcomp
103am__depfiles_maybe = depfiles
104am__mv = mv -f
105COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
106 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
107LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
108 $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
109 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
110 $(AM_CFLAGS) $(CFLAGS)
111AM_V_CC = $(am__v_CC_$(V))
112am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
113am__v_CC_0 = @echo " CC " $@;
114AM_V_at = $(am__v_at_$(V))
115am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
116am__v_at_0 = @
117CCLD = $(CC)
118LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
119 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
120 $(AM_LDFLAGS) $(LDFLAGS) -o $@
121AM_V_CCLD = $(am__v_CCLD_$(V))
122am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
123am__v_CCLD_0 = @echo " CCLD " $@;
124AM_V_GEN = $(am__v_GEN_$(V))
125am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
126am__v_GEN_0 = @echo " GEN " $@;
127SOURCES = $(libecore_imf_la_SOURCES)
128DIST_SOURCES = $(libecore_imf_la_SOURCES)
129HEADERS = $(includes_HEADERS)
130ETAGS = etags
131CTAGS = ctags
132DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
133ACLOCAL = @ACLOCAL@
134ALLOCA = @ALLOCA@
135AMTAR = @AMTAR@
136AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
137AR = @AR@
138AS = @AS@
139AUTOCONF = @AUTOCONF@
140AUTOHEADER = @AUTOHEADER@
141AUTOMAKE = @AUTOMAKE@
142AWK = @AWK@
143CARES_CFLAGS = @CARES_CFLAGS@
144CARES_LIBS = @CARES_LIBS@
145CC = @CC@
146CCDEPMODE = @CCDEPMODE@
147CFLAGS = @CFLAGS@
148CHECK_CFLAGS = @CHECK_CFLAGS@
149CHECK_LIBS = @CHECK_LIBS@
150CPP = @CPP@
151CPPFLAGS = @CPPFLAGS@
152CURL_CFLAGS = @CURL_CFLAGS@
153CURL_LIBS = @CURL_LIBS@
154CXX = @CXX@
155CXXCPP = @CXXCPP@
156CXXDEPMODE = @CXXDEPMODE@
157CXXFLAGS = @CXXFLAGS@
158CYGPATH_W = @CYGPATH_W@
159DEFS = @DEFS@
160DEPDIR = @DEPDIR@
161DIRECTFB_CFLAGS = @DIRECTFB_CFLAGS@
162DIRECTFB_LIBS = @DIRECTFB_LIBS@
163DLLTOOL = @DLLTOOL@
164DSYMUTIL = @DSYMUTIL@
165DUMPBIN = @DUMPBIN@
166ECHO_C = @ECHO_C@
167ECHO_N = @ECHO_N@
168ECHO_T = @ECHO_T@
169ECORE_XCB_CFLAGS = @ECORE_XCB_CFLAGS@
170ECORE_XCB_LIBS = @ECORE_XCB_LIBS@
171EFL_ECORE_BUILD = @EFL_ECORE_BUILD@
172EFL_ECORE_CON_BUILD = @EFL_ECORE_CON_BUILD@
173EFL_ECORE_EVAS_BUILD = @EFL_ECORE_EVAS_BUILD@
174EFL_ECORE_FILE_BUILD = @EFL_ECORE_FILE_BUILD@
175EFL_ECORE_IMF_BUILD = @EFL_ECORE_IMF_BUILD@
176EFL_ECORE_IMF_EVAS_BUILD = @EFL_ECORE_IMF_EVAS_BUILD@
177EFL_ECORE_INPUT_BUILD = @EFL_ECORE_INPUT_BUILD@
178EFL_ECORE_INPUT_EVAS_BUILD = @EFL_ECORE_INPUT_EVAS_BUILD@
179EFL_ECORE_IPC_BUILD = @EFL_ECORE_IPC_BUILD@
180EFL_ECORE_PSL1GHT_BUILD = @EFL_ECORE_PSL1GHT_BUILD@
181EFL_ECORE_SDL_BUILD = @EFL_ECORE_SDL_BUILD@
182EFL_ECORE_WIN32_BUILD = @EFL_ECORE_WIN32_BUILD@
183EFL_ECORE_WINCE_BUILD = @EFL_ECORE_WINCE_BUILD@
184EFL_PTHREAD_CFLAGS = @EFL_PTHREAD_CFLAGS@
185EFL_PTHREAD_LIBS = @EFL_PTHREAD_LIBS@
186EGREP = @EGREP@
187EINA_CFLAGS = @EINA_CFLAGS@
188EINA_LIBS = @EINA_LIBS@
189ESCAPE_CFLAGS = @ESCAPE_CFLAGS@
190ESCAPE_LIBS = @ESCAPE_LIBS@
191EVAS_CFLAGS = @EVAS_CFLAGS@
192EVAS_LIBS = @EVAS_LIBS@
193EVIL_CFLAGS = @EVIL_CFLAGS@
194EVIL_LIBS = @EVIL_LIBS@
195EXEEXT = @EXEEXT@
196FGREP = @FGREP@
197GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
198GLIB_CFLAGS = @GLIB_CFLAGS@
199GLIB_LIBS = @GLIB_LIBS@
200GMSGFMT = @GMSGFMT@
201GMSGFMT_015 = @GMSGFMT_015@
202GREP = @GREP@
203INSTALL = @INSTALL@
204INSTALL_DATA = @INSTALL_DATA@
205INSTALL_PROGRAM = @INSTALL_PROGRAM@
206INSTALL_SCRIPT = @INSTALL_SCRIPT@
207INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
208INTLLIBS = @INTLLIBS@
209INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
210KEYSYMDEFS = @KEYSYMDEFS@
211LD = @LD@
212LDFLAGS = @LDFLAGS@
213LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@
214LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@
215LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@
216LIBICONV = @LIBICONV@
217LIBINTL = @LIBINTL@
218LIBOBJS = @LIBOBJS@
219LIBS = @LIBS@
220LIBTOOL = @LIBTOOL@
221LIPO = @LIPO@
222LN_S = @LN_S@
223LTLIBICONV = @LTLIBICONV@
224LTLIBINTL = @LTLIBINTL@
225LTLIBOBJS = @LTLIBOBJS@
226MAKEINFO = @MAKEINFO@
227MKDIR_P = @MKDIR_P@
228MSGFMT = @MSGFMT@
229MSGFMT_015 = @MSGFMT_015@
230MSGMERGE = @MSGMERGE@
231NM = @NM@
232NMEDIT = @NMEDIT@
233OBJC = @OBJC@
234OBJCDEPMODE = @OBJCDEPMODE@
235OBJCFLAGS = @OBJCFLAGS@
236OBJDUMP = @OBJDUMP@
237OBJEXT = @OBJEXT@
238OTOOL = @OTOOL@
239OTOOL64 = @OTOOL64@
240PACKAGE = @PACKAGE@
241PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
242PACKAGE_NAME = @PACKAGE_NAME@
243PACKAGE_STRING = @PACKAGE_STRING@
244PACKAGE_TARNAME = @PACKAGE_TARNAME@
245PACKAGE_URL = @PACKAGE_URL@
246PACKAGE_VERSION = @PACKAGE_VERSION@
247PATH_SEPARATOR = @PATH_SEPARATOR@
248PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
249PIXMAN_LIBS = @PIXMAN_LIBS@
250PKG_CONFIG = @PKG_CONFIG@
251PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
252PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
253POSUB = @POSUB@
254RANLIB = @RANLIB@
255SDL_CFLAGS = @SDL_CFLAGS@
256SDL_CONFIG = @SDL_CONFIG@
257SDL_LIBS = @SDL_LIBS@
258SED = @SED@
259SET_MAKE = @SET_MAKE@
260SHELL = @SHELL@
261SSL_CFLAGS = @SSL_CFLAGS@
262SSL_LIBS = @SSL_LIBS@
263STRIP = @STRIP@
264TLS2_CFLAGS = @TLS2_CFLAGS@
265TLS2_LIBS = @TLS2_LIBS@
266TLS_CFLAGS = @TLS_CFLAGS@
267TLS_LIBS = @TLS_LIBS@
268TSLIB_CFLAGS = @TSLIB_CFLAGS@
269TSLIB_LIBS = @TSLIB_LIBS@
270USE_NLS = @USE_NLS@
271VERSION = @VERSION@
272VMAJ = @VMAJ@
273WIN32_CFLAGS = @WIN32_CFLAGS@
274WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
275WIN32_LIBS = @WIN32_LIBS@
276XCB_COMPOSITE_CFLAGS = @XCB_COMPOSITE_CFLAGS@
277XCB_COMPOSITE_LIBS = @XCB_COMPOSITE_LIBS@
278XCB_CURSOR_CFLAGS = @XCB_CURSOR_CFLAGS@
279XCB_CURSOR_LIBS = @XCB_CURSOR_LIBS@
280XCB_DAMAGE_CFLAGS = @XCB_DAMAGE_CFLAGS@
281XCB_DAMAGE_LIBS = @XCB_DAMAGE_LIBS@
282XCB_DPMS_CFLAGS = @XCB_DPMS_CFLAGS@
283XCB_DPMS_LIBS = @XCB_DPMS_LIBS@
284XCB_RANDR_CFLAGS = @XCB_RANDR_CFLAGS@
285XCB_RANDR_LIBS = @XCB_RANDR_LIBS@
286XCB_RENDER_CFLAGS = @XCB_RENDER_CFLAGS@
287XCB_RENDER_LIBS = @XCB_RENDER_LIBS@
288XCB_SCREENSAVER_CFLAGS = @XCB_SCREENSAVER_CFLAGS@
289XCB_SCREENSAVER_LIBS = @XCB_SCREENSAVER_LIBS@
290XCB_SHAPE_CFLAGS = @XCB_SHAPE_CFLAGS@
291XCB_SHAPE_LIBS = @XCB_SHAPE_LIBS@
292XCB_SYNC_CFLAGS = @XCB_SYNC_CFLAGS@
293XCB_SYNC_LIBS = @XCB_SYNC_LIBS@
294XCB_X11_CFLAGS = @XCB_X11_CFLAGS@
295XCB_X11_LIBS = @XCB_X11_LIBS@
296XCB_XFIXES_CFLAGS = @XCB_XFIXES_CFLAGS@
297XCB_XFIXES_LIBS = @XCB_XFIXES_LIBS@
298XCB_XGESTURE_CFLAGS = @XCB_XGESTURE_CFLAGS@
299XCB_XGESTURE_LIBS = @XCB_XGESTURE_LIBS@
300XCB_XINERAMA_CFLAGS = @XCB_XINERAMA_CFLAGS@
301XCB_XINERAMA_LIBS = @XCB_XINERAMA_LIBS@
302XCB_XINPUT_CFLAGS = @XCB_XINPUT_CFLAGS@
303XCB_XINPUT_LIBS = @XCB_XINPUT_LIBS@
304XCB_XPRINT_CFLAGS = @XCB_XPRINT_CFLAGS@
305XCB_XPRINT_LIBS = @XCB_XPRINT_LIBS@
306XCB_XTEST_CFLAGS = @XCB_XTEST_CFLAGS@
307XCB_XTEST_LIBS = @XCB_XTEST_LIBS@
308XCOMPOSITE_CFLAGS = @XCOMPOSITE_CFLAGS@
309XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@
310XDAMAGE_CFLAGS = @XDAMAGE_CFLAGS@
311XDAMAGE_LIBS = @XDAMAGE_LIBS@
312XDPMS_CFLAGS = @XDPMS_CFLAGS@
313XDPMS_LIBS = @XDPMS_LIBS@
314XFIXES_CFLAGS = @XFIXES_CFLAGS@
315XFIXES_LIBS = @XFIXES_LIBS@
316XGESTURE_CFLAGS = @XGESTURE_CFLAGS@
317XGESTURE_LIBS = @XGESTURE_LIBS@
318XGETTEXT = @XGETTEXT@
319XGETTEXT_015 = @XGETTEXT_015@
320XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
321XI2_CFLAGS = @XI2_CFLAGS@
322XI2_LIBS = @XI2_LIBS@
323XINERAMA_CFLAGS = @XINERAMA_CFLAGS@
324XINERAMA_LIBS = @XINERAMA_LIBS@
325XKB_CFLAGS = @XKB_CFLAGS@
326XKB_LIBS = @XKB_LIBS@
327XMKMF = @XMKMF@
328XPRINT_CFLAGS = @XPRINT_CFLAGS@
329XPRINT_LIBS = @XPRINT_LIBS@
330XRANDR_CFLAGS = @XRANDR_CFLAGS@
331XRANDR_LIBS = @XRANDR_LIBS@
332XRENDER_CFLAGS = @XRENDER_CFLAGS@
333XRENDER_LIBS = @XRENDER_LIBS@
334XSS_CFLAGS = @XSS_CFLAGS@
335XSS_LIBS = @XSS_LIBS@
336XTEST_CFLAGS = @XTEST_CFLAGS@
337XTEST_LIBS = @XTEST_LIBS@
338X_CFLAGS = @X_CFLAGS@
339X_EXTRA_LIBS = @X_EXTRA_LIBS@
340X_LIBS = @X_LIBS@
341X_PRE_LIBS = @X_PRE_LIBS@
342Xcursor_cflags = @Xcursor_cflags@
343Xcursor_libs = @Xcursor_libs@
344abs_builddir = @abs_builddir@
345abs_srcdir = @abs_srcdir@
346abs_top_builddir = @abs_top_builddir@
347abs_top_srcdir = @abs_top_srcdir@
348ac_ct_CC = @ac_ct_CC@
349ac_ct_CXX = @ac_ct_CXX@
350ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
351ac_ct_OBJC = @ac_ct_OBJC@
352am__include = @am__include@
353am__leading_dot = @am__leading_dot@
354am__quote = @am__quote@
355am__tar = @am__tar@
356am__untar = @am__untar@
357bindir = @bindir@
358build = @build@
359build_alias = @build_alias@
360build_cpu = @build_cpu@
361build_os = @build_os@
362build_vendor = @build_vendor@
363builddir = @builddir@
364cocoa_ldflags = @cocoa_ldflags@
365datadir = @datadir@
366datarootdir = @datarootdir@
367dlopen_libs = @dlopen_libs@
368docdir = @docdir@
369dvidir = @dvidir@
370ecore_cocoa_cflags = @ecore_cocoa_cflags@
371ecore_cocoa_libs = @ecore_cocoa_libs@
372ecore_con_cflags = @ecore_con_cflags@
373ecore_con_libs = @ecore_con_libs@
374ecore_directfb_cflags = @ecore_directfb_cflags@
375ecore_directfb_libs = @ecore_directfb_libs@
376ecore_evas_cflags = @ecore_evas_cflags@
377ecore_evas_libs = @ecore_evas_libs@
378ecore_fb_cflags = @ecore_fb_cflags@
379ecore_fb_libs = @ecore_fb_libs@
380ecore_file_cflags = @ecore_file_cflags@
381ecore_file_libs = @ecore_file_libs@
382ecore_imf_cflags = @ecore_imf_cflags@
383ecore_imf_evas_cflags = @ecore_imf_evas_cflags@
384ecore_imf_evas_libs = @ecore_imf_evas_libs@
385ecore_imf_libs = @ecore_imf_libs@
386ecore_imf_xim_cflags = @ecore_imf_xim_cflags@
387ecore_imf_xim_libs = @ecore_imf_xim_libs@
388ecore_input_cflags = @ecore_input_cflags@
389ecore_input_evas_cflags = @ecore_input_evas_cflags@
390ecore_input_evas_libs = @ecore_input_evas_libs@
391ecore_input_libs = @ecore_input_libs@
392ecore_ipc_cflags = @ecore_ipc_cflags@
393ecore_ipc_libs = @ecore_ipc_libs@
394ecore_psl1ght_cflags = @ecore_psl1ght_cflags@
395ecore_psl1ght_libs = @ecore_psl1ght_libs@
396ecore_sdl_cflags = @ecore_sdl_cflags@
397ecore_sdl_libs = @ecore_sdl_libs@
398ecore_win32_cflags = @ecore_win32_cflags@
399ecore_win32_libs = @ecore_win32_libs@
400ecore_wince_cflags = @ecore_wince_cflags@
401ecore_wince_libs = @ecore_wince_libs@
402ecore_x_cflags = @ecore_x_cflags@
403ecore_x_libs = @ecore_x_libs@
404ecore_x_libs_private = @ecore_x_libs_private@
405efl_doxygen = @efl_doxygen@
406efl_have_doxygen = @efl_have_doxygen@
407exec_prefix = @exec_prefix@
408have_ecore_x_xcb_define = @have_ecore_x_xcb_define@
409host = @host@
410host_alias = @host_alias@
411host_cpu = @host_cpu@
412host_os = @host_os@
413host_vendor = @host_vendor@
414htmldir = @htmldir@
415includedir = @includedir@
416infodir = @infodir@
417install_sh = @install_sh@
418libdir = @libdir@
419libexecdir = @libexecdir@
420localedir = @localedir@
421localstatedir = @localstatedir@
422lt_ECHO = @lt_ECHO@
423lt_enable_auto_import = @lt_enable_auto_import@
424mandir = @mandir@
425mkdir_p = @mkdir_p@
426oldincludedir = @oldincludedir@
427pdfdir = @pdfdir@
428pkgconfig_requires_private = @pkgconfig_requires_private@
429prefix = @prefix@
430program_transform_name = @program_transform_name@
431psdir = @psdir@
432release_info = @release_info@
433requirements_ecore = @requirements_ecore@
434requirements_ecore_cocoa = @requirements_ecore_cocoa@
435requirements_ecore_con = @requirements_ecore_con@
436requirements_ecore_directfb = @requirements_ecore_directfb@
437requirements_ecore_evas = @requirements_ecore_evas@
438requirements_ecore_fb = @requirements_ecore_fb@
439requirements_ecore_file = @requirements_ecore_file@
440requirements_ecore_imf = @requirements_ecore_imf@
441requirements_ecore_imf_evas = @requirements_ecore_imf_evas@
442requirements_ecore_imf_xim = @requirements_ecore_imf_xim@
443requirements_ecore_input = @requirements_ecore_input@
444requirements_ecore_input_evas = @requirements_ecore_input_evas@
445requirements_ecore_ipc = @requirements_ecore_ipc@
446requirements_ecore_psl1ght = @requirements_ecore_psl1ght@
447requirements_ecore_sdl = @requirements_ecore_sdl@
448requirements_ecore_win32 = @requirements_ecore_win32@
449requirements_ecore_wince = @requirements_ecore_wince@
450requirements_ecore_x = @requirements_ecore_x@
451rt_libs = @rt_libs@
452sbindir = @sbindir@
453sharedstatedir = @sharedstatedir@
454srcdir = @srcdir@
455sysconfdir = @sysconfdir@
456target_alias = @target_alias@
457top_build_prefix = @top_build_prefix@
458top_builddir = @top_builddir@
459top_srcdir = @top_srcdir@
460version_info = @version_info@
461x_cflags = @x_cflags@
462x_includes = @x_includes@
463x_libs = @x_libs@
464MAINTAINERCLEANFILES = Makefile.in
465AM_CPPFLAGS = \
466-I$(top_srcdir)/src/lib/ecore \
467-DPACKAGE_LIB_DIR=\"$(libdir)\" \
468@EFL_ECORE_IMF_BUILD@ \
469@EVIL_CFLAGS@ \
470@EINA_CFLAGS@
471
472AM_CFLAGS = @WIN32_CFLAGS@
473lib_LTLIBRARIES = libecore_imf.la
474includes_HEADERS = Ecore_IMF.h
475includesdir = $(includedir)/ecore-@VMAJ@
476libecore_imf_la_SOURCES = \
477ecore_imf.c \
478ecore_imf_context.c \
479ecore_imf_module.c
480
481libecore_imf_la_LIBADD = \
482$(top_builddir)/src/lib/ecore/libecore.la \
483@EINA_LIBS@ \
484@EVIL_LIBS@
485
486libecore_imf_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info @version_info@ @release_info@
487EXTRA_DIST = ecore_imf_private.h
488all: all-am
489
490.SUFFIXES:
491.SUFFIXES: .c .lo .o .obj
492$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
493 @for dep in $?; do \
494 case '$(am__configure_deps)' in \
495 *$$dep*) \
496 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
497 && { if test -f $@; then exit 0; else break; fi; }; \
498 exit 1;; \
499 esac; \
500 done; \
501 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/ecore_imf/Makefile'; \
502 $(am__cd) $(top_srcdir) && \
503 $(AUTOMAKE) --gnu src/lib/ecore_imf/Makefile
504.PRECIOUS: Makefile
505Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
506 @case '$?' in \
507 *config.status*) \
508 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
509 *) \
510 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
511 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
512 esac;
513
514$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
515 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
516
517$(top_srcdir)/configure: $(am__configure_deps)
518 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
519$(ACLOCAL_M4): $(am__aclocal_m4_deps)
520 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
521$(am__aclocal_m4_deps):
522install-libLTLIBRARIES: $(lib_LTLIBRARIES)
523 @$(NORMAL_INSTALL)
524 test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)"
525 @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
526 list2=; for p in $$list; do \
527 if test -f $$p; then \
528 list2="$$list2 $$p"; \
529 else :; fi; \
530 done; \
531 test -z "$$list2" || { \
532 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
533 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
534 }
535
536uninstall-libLTLIBRARIES:
537 @$(NORMAL_UNINSTALL)
538 @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
539 for p in $$list; do \
540 $(am__strip_dir) \
541 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
542 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
543 done
544
545clean-libLTLIBRARIES:
546 -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
547 @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
548 dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
549 test "$$dir" != "$$p" || dir=.; \
550 echo "rm -f \"$${dir}/so_locations\""; \
551 rm -f "$${dir}/so_locations"; \
552 done
553libecore_imf.la: $(libecore_imf_la_OBJECTS) $(libecore_imf_la_DEPENDENCIES)
554 $(AM_V_CCLD)$(libecore_imf_la_LINK) -rpath $(libdir) $(libecore_imf_la_OBJECTS) $(libecore_imf_la_LIBADD) $(LIBS)
555
556mostlyclean-compile:
557 -rm -f *.$(OBJEXT)
558
559distclean-compile:
560 -rm -f *.tab.c
561
562@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_imf.Plo@am__quote@
563@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_imf_context.Plo@am__quote@
564@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_imf_module.Plo@am__quote@
565
566.c.o:
567@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
568@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
569@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
570@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
571@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
572@am__fastdepCC_FALSE@ $(COMPILE) -c $<
573
574.c.obj:
575@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
576@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
577@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
578@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
579@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
580@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
581
582.c.lo:
583@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
584@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
585@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
586@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
587@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
588@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
589
590mostlyclean-libtool:
591 -rm -f *.lo
592
593clean-libtool:
594 -rm -rf .libs _libs
595install-includesHEADERS: $(includes_HEADERS)
596 @$(NORMAL_INSTALL)
597 test -z "$(includesdir)" || $(MKDIR_P) "$(DESTDIR)$(includesdir)"
598 @list='$(includes_HEADERS)'; test -n "$(includesdir)" || list=; \
599 for p in $$list; do \
600 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
601 echo "$$d$$p"; \
602 done | $(am__base_list) | \
603 while read files; do \
604 echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includesdir)'"; \
605 $(INSTALL_HEADER) $$files "$(DESTDIR)$(includesdir)" || exit $$?; \
606 done
607
608uninstall-includesHEADERS:
609 @$(NORMAL_UNINSTALL)
610 @list='$(includes_HEADERS)'; test -n "$(includesdir)" || list=; \
611 files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
612 test -n "$$files" || exit 0; \
613 echo " ( cd '$(DESTDIR)$(includesdir)' && rm -f" $$files ")"; \
614 cd "$(DESTDIR)$(includesdir)" && rm -f $$files
615
616ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
617 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
618 unique=`for i in $$list; do \
619 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
620 done | \
621 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
622 END { if (nonempty) { for (i in files) print i; }; }'`; \
623 mkid -fID $$unique
624tags: TAGS
625
626TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
627 $(TAGS_FILES) $(LISP)
628 set x; \
629 here=`pwd`; \
630 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
631 unique=`for i in $$list; do \
632 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
633 done | \
634 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
635 END { if (nonempty) { for (i in files) print i; }; }'`; \
636 shift; \
637 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
638 test -n "$$unique" || unique=$$empty_fix; \
639 if test $$# -gt 0; then \
640 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
641 "$$@" $$unique; \
642 else \
643 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
644 $$unique; \
645 fi; \
646 fi
647ctags: CTAGS
648CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
649 $(TAGS_FILES) $(LISP)
650 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
651 unique=`for i in $$list; do \
652 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
653 done | \
654 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
655 END { if (nonempty) { for (i in files) print i; }; }'`; \
656 test -z "$(CTAGS_ARGS)$$unique" \
657 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
658 $$unique
659
660GTAGS:
661 here=`$(am__cd) $(top_builddir) && pwd` \
662 && $(am__cd) $(top_srcdir) \
663 && gtags -i $(GTAGS_ARGS) "$$here"
664
665distclean-tags:
666 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
667
668distdir: $(DISTFILES)
669 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
670 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
671 list='$(DISTFILES)'; \
672 dist_files=`for file in $$list; do echo $$file; done | \
673 sed -e "s|^$$srcdirstrip/||;t" \
674 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
675 case $$dist_files in \
676 */*) $(MKDIR_P) `echo "$$dist_files" | \
677 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
678 sort -u` ;; \
679 esac; \
680 for file in $$dist_files; do \
681 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
682 if test -d $$d/$$file; then \
683 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
684 if test -d "$(distdir)/$$file"; then \
685 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
686 fi; \
687 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
688 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
689 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
690 fi; \
691 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
692 else \
693 test -f "$(distdir)/$$file" \
694 || cp -p $$d/$$file "$(distdir)/$$file" \
695 || exit 1; \
696 fi; \
697 done
698check-am: all-am
699check: check-am
700all-am: Makefile $(LTLIBRARIES) $(HEADERS)
701installdirs:
702 for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includesdir)"; do \
703 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
704 done
705install: install-am
706install-exec: install-exec-am
707install-data: install-data-am
708uninstall: uninstall-am
709
710install-am: all-am
711 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
712
713installcheck: installcheck-am
714install-strip:
715 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
716 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
717 `test -z '$(STRIP)' || \
718 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
719mostlyclean-generic:
720
721clean-generic:
722
723distclean-generic:
724 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
725 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
726
727maintainer-clean-generic:
728 @echo "This command is intended for maintainers to use"
729 @echo "it deletes files that may require special tools to rebuild."
730 -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
731clean: clean-am
732
733clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
734 mostlyclean-am
735
736distclean: distclean-am
737 -rm -rf ./$(DEPDIR)
738 -rm -f Makefile
739distclean-am: clean-am distclean-compile distclean-generic \
740 distclean-tags
741
742dvi: dvi-am
743
744dvi-am:
745
746html: html-am
747
748html-am:
749
750info: info-am
751
752info-am:
753
754install-data-am: install-includesHEADERS
755
756install-dvi: install-dvi-am
757
758install-dvi-am:
759
760install-exec-am: install-libLTLIBRARIES
761
762install-html: install-html-am
763
764install-html-am:
765
766install-info: install-info-am
767
768install-info-am:
769
770install-man:
771
772install-pdf: install-pdf-am
773
774install-pdf-am:
775
776install-ps: install-ps-am
777
778install-ps-am:
779
780installcheck-am:
781
782maintainer-clean: maintainer-clean-am
783 -rm -rf ./$(DEPDIR)
784 -rm -f Makefile
785maintainer-clean-am: distclean-am maintainer-clean-generic
786
787mostlyclean: mostlyclean-am
788
789mostlyclean-am: mostlyclean-compile mostlyclean-generic \
790 mostlyclean-libtool
791
792pdf: pdf-am
793
794pdf-am:
795
796ps: ps-am
797
798ps-am:
799
800uninstall-am: uninstall-includesHEADERS uninstall-libLTLIBRARIES
801
802.MAKE: install-am install-strip
803
804.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
805 clean-libLTLIBRARIES clean-libtool ctags distclean \
806 distclean-compile distclean-generic distclean-libtool \
807 distclean-tags distdir dvi dvi-am html html-am info info-am \
808 install install-am install-data install-data-am install-dvi \
809 install-dvi-am install-exec install-exec-am install-html \
810 install-html-am install-includesHEADERS install-info \
811 install-info-am install-libLTLIBRARIES install-man install-pdf \
812 install-pdf-am install-ps install-ps-am install-strip \
813 installcheck installcheck-am installdirs maintainer-clean \
814 maintainer-clean-generic mostlyclean mostlyclean-compile \
815 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
816 tags uninstall uninstall-am uninstall-includesHEADERS \
817 uninstall-libLTLIBRARIES
818
819
820# Tell versions [3.59,3.63) of GNU make to not export all variables.
821# Otherwise a system limit (for SysV at least) may be exceeded.
822.NOEXPORT:
diff --git a/libraries/ecore/src/lib/ecore_imf/ecore_imf.c b/libraries/ecore/src/lib/ecore_imf/ecore_imf.c
new file mode 100644
index 0000000..7cf8a4a
--- /dev/null
+++ b/libraries/ecore/src/lib/ecore_imf/ecore_imf.c
@@ -0,0 +1,73 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include <Ecore.h>
6#include <ecore_private.h>
7
8#include "Ecore_IMF.h"
9#include "ecore_imf_private.h"
10
11EAPI int ECORE_IMF_EVENT_PREEDIT_START = 0;
12EAPI int ECORE_IMF_EVENT_PREEDIT_END = 0;
13EAPI int ECORE_IMF_EVENT_PREEDIT_CHANGED = 0;
14EAPI int ECORE_IMF_EVENT_COMMIT = 0;
15EAPI int ECORE_IMF_EVENT_DELETE_SURROUNDING = 0;
16
17int _ecore_imf_log_dom = -1;
18static int _ecore_imf_init_count = 0;
19
20/**
21 * @defgroup Ecore_IMF_Lib_Group Ecore Input Method Library Functions
22 *
23 * Utility functions that set up and shut down the Ecore Input Method
24 * library.
25 */
26
27/**
28 * Initialises the Ecore_IMF library.
29 * @return Number of times the library has been initialised without being
30 * shut down.
31 * @ingroup Ecore_IMF_Lib_Group
32 */
33EAPI int
34ecore_imf_init(void)
35{
36 if (++_ecore_imf_init_count != 1) return _ecore_imf_init_count;
37
38 if (!ecore_init()) return --_ecore_imf_init_count;
39 _ecore_imf_log_dom = eina_log_domain_register
40 ("ecore_imf", ECORE_IMF_DEFAULT_LOG_COLOR);
41 if (_ecore_imf_log_dom < 0)
42 {
43 EINA_LOG_ERR("Impossible to create a log domain for the Ecore IMF module.");
44 ecore_shutdown();
45 return --_ecore_imf_init_count;
46 }
47 ecore_imf_module_init();
48
49 ECORE_IMF_EVENT_PREEDIT_START = ecore_event_type_new();
50 ECORE_IMF_EVENT_PREEDIT_END = ecore_event_type_new();
51 ECORE_IMF_EVENT_PREEDIT_CHANGED = ecore_event_type_new();
52 ECORE_IMF_EVENT_COMMIT = ecore_event_type_new();
53 ECORE_IMF_EVENT_DELETE_SURROUNDING = ecore_event_type_new();
54
55 return _ecore_imf_init_count;
56}
57
58/**
59 * Shuts down the Ecore_IMF library.
60 * @return Number of times the library has been initialised without being
61 * shut down.
62 * @ingroup Ecore_IMF_Lib_Group
63 */
64EAPI int
65ecore_imf_shutdown(void)
66{
67 if (--_ecore_imf_init_count != 0) return _ecore_imf_init_count;
68 ecore_imf_module_shutdown();
69 eina_log_domain_unregister(_ecore_imf_log_dom);
70 _ecore_imf_log_dom = -1;
71 ecore_shutdown();
72 return _ecore_imf_init_count;
73}
diff --git a/libraries/ecore/src/lib/ecore_imf/ecore_imf_context.c b/libraries/ecore/src/lib/ecore_imf/ecore_imf_context.c
new file mode 100644
index 0000000..417fad3
--- /dev/null
+++ b/libraries/ecore/src/lib/ecore_imf/ecore_imf_context.c
@@ -0,0 +1,1237 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include <stdlib.h>
6#include <string.h>
7#include <locale.h>
8
9#include <Ecore.h>
10#include <ecore_private.h>
11
12#include "Ecore_IMF.h"
13#include "ecore_imf_private.h"
14
15/**
16 * @defgroup Ecore_IMF_Context_Group Ecore Input Method Context Functions
17 *
18 * Functions that operate on Ecore Input Method Context objects.
19 */
20
21/**
22 * Get the list of the available Input Method Context ids.
23 *
24 * Note that the caller is responsible for freeing the Eina_List
25 * when finished with it. There is no need to finish the list strings.
26 *
27 * @return Return an Eina_List of strings;
28 * on failure it returns NULL.
29 * @ingroup Ecore_IMF_Context_Group
30 */
31EAPI Eina_List *
32ecore_imf_context_available_ids_get(void)
33{
34 return ecore_imf_module_context_ids_get();
35}
36
37EAPI Eina_List *
38ecore_imf_context_available_ids_by_canvas_type_get(const char *canvas_type)
39{
40 return ecore_imf_module_context_ids_by_canvas_type_get(canvas_type);
41}
42
43/*
44 * Match @locale against @against.
45 *
46 * 'en_US' against 'en_US' => 4
47 * 'en_US' against 'en' => 3
48 * 'en', 'en_UK' against 'en_US' => 2
49 * all locales, against '*' => 1
50 */
51static int
52_ecore_imf_context_match_locale(const char *locale, const char *against, int against_len)
53{
54 if (strcmp(against, "*") == 0)
55 return 1;
56
57 if (strcasecmp(locale, against) == 0)
58 return 4;
59
60 if (strncasecmp(locale, against, 2) == 0)
61 return (against_len == 2) ? 3 : 2;
62
63 return 0;
64}
65
66/**
67 * Get the id of the default Input Method Context.
68 * The id may to used to create a new instance of an Input Method
69 * Context object.
70 *
71 * @return Return a string containing the id of the default Input
72 * Method Context; on failure it returns NULL.
73 * @ingroup Ecore_IMF_Context_Group
74 */
75EAPI const char *
76ecore_imf_context_default_id_get(void)
77{
78 return ecore_imf_context_default_id_by_canvas_type_get(NULL);
79}
80
81EAPI const char *
82ecore_imf_context_default_id_by_canvas_type_get(const char *canvas_type)
83{
84 const char *id;
85 Eina_List *modules;
86 Ecore_IMF_Module *module;
87 char *locale;
88 char *tmp;
89 int best_goodness = 0;
90
91 id = getenv("ECORE_IMF_MODULE");
92 if (id)
93 {
94 if (strcmp(id, "none") == 0) return NULL;
95 if (ecore_imf_module_get(id)) return id;
96 }
97
98 modules = ecore_imf_module_available_get();
99 if (!modules) return NULL;
100
101 locale = setlocale(LC_CTYPE, NULL);
102 if (!locale) return NULL;
103
104 locale = strdup(locale);
105
106 tmp = strchr(locale, '.');
107 if (tmp) *tmp = '\0';
108 tmp = strchr(locale, '@');
109 if (tmp) *tmp = '\0';
110
111 id = NULL;
112
113 EINA_LIST_FREE(modules, module)
114 {
115 if (canvas_type &&
116 strcmp(module->info->canvas_type, canvas_type) == 0)
117 continue;
118
119 const char *p = module->info->default_locales;
120 while (p)
121 {
122 const char *q = strchr(p, ':');
123 int goodness = _ecore_imf_context_match_locale(locale, p, q ? (size_t)(q - p) : strlen (p));
124
125 if (goodness > best_goodness)
126 {
127 id = module->info->id;
128 best_goodness = goodness;
129 }
130
131 p = q ? q + 1 : NULL;
132 }
133 }
134
135 free(locale);
136 return id;
137}
138
139/**
140 * Retrieve the info for the Input Method Context with @p id.
141 *
142 * @param id The Input Method Context id to query for.
143 * @return Return a #Ecore_IMF_Context_Info for the Input Method Context with @p id;
144 * on failure it returns NULL.
145 * @ingroup Ecore_IMF_Context_Group
146 */
147EAPI const Ecore_IMF_Context_Info *
148ecore_imf_context_info_by_id_get(const char *id)
149{
150 Ecore_IMF_Module *module;
151
152 if (!id) return NULL;
153 module = ecore_imf_module_get(id);
154 if (!module) return NULL;
155 return module->info;
156}
157
158/**
159 * Create a new Input Method Context defined by the given id.
160 *
161 * @param id The Input Method Context id.
162 * @return A newly allocated Input Method Context;
163 * on failure it returns NULL.
164 * @ingroup Ecore_IMF_Context_Group
165 */
166EAPI Ecore_IMF_Context *
167ecore_imf_context_add(const char *id)
168{
169 Ecore_IMF_Context *ctx;
170
171 if (!id) return NULL;
172 ctx = ecore_imf_module_context_create(id);
173 if (!ctx || !ctx->klass) return NULL;
174 if (ctx->klass->add) ctx->klass->add(ctx);
175 /* default use_preedit is EINA_TRUE, so let's make sure it's
176 * set on the immodule */
177 ecore_imf_context_use_preedit_set(ctx, EINA_TRUE);
178
179 /* default prediction is EINA_TRUE, so let's make sure it's
180 * set on the immodule */
181 ecore_imf_context_prediction_allow_set(ctx, EINA_TRUE);
182
183 /* default autocapital type is SENTENCE type, so let's make sure it's
184 * set on the immodule */
185 ecore_imf_context_autocapital_type_set(ctx, ECORE_IMF_AUTOCAPITAL_TYPE_SENTENCE);
186
187 /* default input panel enabled status is EINA_TRUE, so let's make sure it's
188 * set on the immodule */
189 ecore_imf_context_input_panel_enabled_set(ctx, EINA_TRUE);
190
191 /* default input_mode is ECORE_IMF_INPUT_MODE_FULL, so let's make sure it's
192 * set on the immodule */
193 ecore_imf_context_input_mode_set(ctx, ECORE_IMF_INPUT_MODE_FULL);
194 return ctx;
195}
196
197/**
198 * Retrieve the info for the given Input Method Context.
199 *
200 * @param ctx An #Ecore_IMF_Context.
201 * @return Return a #Ecore_IMF_Context_Info for the given Input Method Context;
202 * on failure it returns NULL.
203 * @ingroup Ecore_IMF_Context_Group
204 */
205EAPI const Ecore_IMF_Context_Info *
206ecore_imf_context_info_get(Ecore_IMF_Context *ctx)
207{
208 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
209 {
210 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
211 "ecore_imf_context_info_get");
212 return NULL;
213 }
214 return ctx->module->info;
215}
216
217/**
218 * Delete the given Input Method Context and free its memory.
219 *
220 * @param ctx An #Ecore_IMF_Context.
221 * @ingroup Ecore_IMF_Context_Group
222 */
223EAPI void
224ecore_imf_context_del(Ecore_IMF_Context *ctx)
225{
226 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
227 {
228 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
229 "ecore_imf_context_del");
230 return;
231 }
232 if (ctx->klass->del) ctx->klass->del(ctx);
233 ECORE_MAGIC_SET(ctx, ECORE_MAGIC_NONE);
234 free(ctx);
235}
236
237/**
238 * Set the client window for the Input Method Context; this is the
239 * Ecore_X_Window when using X11, Ecore_Win32_Window when using Win32, etc.
240 * This window is used in order to correctly position status windows, and may
241 * also be used for purposes internal to the Input Method Context.
242 *
243 * @param ctx An #Ecore_IMF_Context.
244 * @param window The client window. This may be NULL to indicate
245 * that the previous client window no longer exists.
246 * @ingroup Ecore_IMF_Context_Group
247 */
248EAPI void
249ecore_imf_context_client_window_set(Ecore_IMF_Context *ctx, void *window)
250{
251 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
252 {
253 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
254 "ecore_imf_context_client_window_set");
255 return;
256 }
257 if (ctx->klass->client_window_set) ctx->klass->client_window_set(ctx, window);
258 ctx->window = window;
259}
260
261/**
262 * Get the client window of the Input Method Context
263 *
264 * See @ref ecore_imf_context_client_window_set for more details.
265 *
266 * @param ctx An #Ecore_IMF_Context.
267 * @return Return the client window.
268 * @ingroup Ecore_IMF_Context_Group
269 * @since 1.1.0
270 */
271EAPI void *
272ecore_imf_context_client_window_get(Ecore_IMF_Context *ctx)
273{
274 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
275 {
276 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
277 "ecore_imf_context_client_window_get");
278 return NULL;
279 }
280 return ctx->window;
281}
282
283/**
284 * Set the client canvas for the Input Method Context; this is the
285 * canvas in which the input appears.
286 * The canvas type can be determined by using the context canvas type.
287 * Actually only canvas with type "evas" (Evas *) is supported.
288 * This canvas may be used in order to correctly position status windows, and may
289 * also be used for purposes internal to the Input Method Context.
290 *
291 * @param ctx An #Ecore_IMF_Context.
292 * @param canvas The client canvas. This may be NULL to indicate
293 * that the previous client canvas no longer exists.
294 * @ingroup Ecore_IMF_Context_Group
295 */
296EAPI void
297ecore_imf_context_client_canvas_set(Ecore_IMF_Context *ctx, void *canvas)
298{
299 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
300 {
301 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
302 "ecore_imf_context_client_canvas_set");
303 return;
304 }
305 if (ctx->klass->client_canvas_set) ctx->klass->client_canvas_set(ctx, canvas);
306 ctx->client_canvas = canvas;
307}
308
309/**
310 * Get the client canvas of the Input Method Context.
311 *
312 * See @ref ecore_imf_context_client_canvas_set for more details.
313 *
314 * @param ctx An #Ecore_IMF_Context.
315 * @return Return the client canvas.
316 * @ingroup Ecore_IMF_Context_Group
317 * @since 1.1.0
318 */
319EAPI void *
320ecore_imf_context_client_canvas_get(Ecore_IMF_Context *ctx)
321{
322 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
323 {
324 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
325 "ecore_imf_context_client_canvas_get");
326 return NULL;
327 }
328 return ctx->client_canvas;
329}
330
331/**
332 * Ask the Input Method Context to show itself.
333 *
334 * @param ctx An #Ecore_IMF_Context.
335 * @ingroup Ecore_IMF_Context_Group
336 */
337EAPI void
338ecore_imf_context_show(Ecore_IMF_Context *ctx)
339{
340 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
341 {
342 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
343 "ecore_imf_context_show");
344 return;
345 }
346 if (ctx->klass->show) ctx->klass->show(ctx);
347}
348
349/**
350 * Ask the Input Method Context to hide itself.
351 *
352 * @param ctx An #Ecore_IMF_Context.
353 * @ingroup Ecore_IMF_Context_Group
354 */
355EAPI void
356ecore_imf_context_hide(Ecore_IMF_Context *ctx)
357{
358 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
359 {
360 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
361 "ecore_imf_context_hide");
362 return;
363 }
364 if (ctx->klass->hide) ctx->klass->hide(ctx);
365}
366
367/**
368 * Retrieve the current preedit string and cursor position
369 * for the Input Method Context.
370 *
371 * @param ctx An #Ecore_IMF_Context.
372 * @param str Location to store the retrieved string. The
373 * string retrieved must be freed with free().
374 * @param cursor_pos Location to store position of cursor (in characters)
375 * within the preedit string.
376 * @ingroup Ecore_IMF_Context_Group
377 */
378EAPI void
379ecore_imf_context_preedit_string_get(Ecore_IMF_Context *ctx, char **str, int *cursor_pos)
380{
381 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
382 {
383 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
384 "ecore_imf_context_preedit_string_get");
385 return;
386 }
387 if (ctx->klass->preedit_string_get)
388 ctx->klass->preedit_string_get(ctx, str, cursor_pos);
389 else
390 {
391 if (str) *str = strdup("");
392 if (cursor_pos) *cursor_pos = 0;
393 }
394}
395
396/**
397 * Retrieve the current preedit string, atrributes and
398 * cursor position for the Input Method Context.
399 *
400 * @param ctx An #Ecore_IMF_Context.
401 * @param str Location to store the retrieved string. The
402 * string retrieved must be freed with free().
403 * @param attrs an Eina_List of attributes
404 * @param cursor_pos Location to store position of cursor (in characters)
405 * within the preedit string.
406 * @ingroup Ecore_IMF_Context_Group
407 * @since 1.1.0
408 */
409EAPI void
410ecore_imf_context_preedit_string_with_attributes_get(Ecore_IMF_Context *ctx, char **str, Eina_List **attrs, int *cursor_pos)
411{
412 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
413 {
414 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
415 "ecore_imf_context_preedit_string_with_attributes_get");
416 return;
417 }
418 if (ctx->klass->preedit_string_with_attributes_get)
419 ctx->klass->preedit_string_with_attributes_get(ctx, str, attrs, cursor_pos);
420 else
421 {
422 if (str) *str = strdup("");
423 if (attrs) *attrs = NULL;
424 if (cursor_pos) *cursor_pos = 0;
425 }
426}
427
428/**
429 * Notify the Input Method Context that the widget to which its
430 * correspond has gained focus.
431 *
432 * @param ctx An #Ecore_IMF_Context.
433 * @ingroup Ecore_IMF_Context_Group
434 */
435EAPI void
436ecore_imf_context_focus_in(Ecore_IMF_Context *ctx)
437{
438 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
439 {
440 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
441 "ecore_imf_context_focus_in");
442 return;
443 }
444 if (ctx->klass->focus_in) ctx->klass->focus_in(ctx);
445}
446
447/**
448 * Notify the Input Method Context that the widget to which its
449 * correspond has lost focus.
450 *
451 * @param ctx An #Ecore_IMF_Context.
452 * @ingroup Ecore_IMF_Context_Group
453 */
454EAPI void
455ecore_imf_context_focus_out(Ecore_IMF_Context *ctx)
456{
457 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
458 {
459 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
460 "ecore_imf_context_focus_out");
461 return;
462 }
463 if (ctx->klass->focus_out) ctx->klass->focus_out(ctx);
464}
465
466/**
467 * Notify the Input Method Context that a change such as a
468 * change in cursor position has been made. This will typically
469 * cause the Input Method Context to clear the preedit state.
470 *
471 * @param ctx An #Ecore_IMF_Context.
472 * @ingroup Ecore_IMF_Context_Group
473 */
474EAPI void
475ecore_imf_context_reset(Ecore_IMF_Context *ctx)
476{
477 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
478 {
479 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
480 "ecore_imf_context_reset");
481 return;
482 }
483 if (ctx->klass->reset) ctx->klass->reset(ctx);
484}
485
486/**
487 * Notify the Input Method Context that a change in the cursor
488 * position has been made.
489 *
490 * @param ctx An #Ecore_IMF_Context.
491 * @param cursor_pos New cursor position in characters.
492 * @ingroup Ecore_IMF_Context_Group
493 */
494EAPI void
495ecore_imf_context_cursor_position_set(Ecore_IMF_Context *ctx, int cursor_pos)
496{
497 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
498 {
499 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
500 "ecore_imf_context_cursor_position_set");
501 return;
502 }
503 if (ctx->klass->cursor_position_set) ctx->klass->cursor_position_set(ctx, cursor_pos);
504}
505
506/**
507 * Notify the Input Method Context that a change in the cursor
508 * location has been made. The location is relative to the canvas.
509 *
510 * @param ctx An #Ecore_IMF_Context.
511 * @param x cursor x position.
512 * @param x cursor y position.
513 * @param w cursor width.
514 * @param h cursor height.
515 * @ingroup Ecore_IMF_Context_Group
516 * @since 1.1.0
517 */
518EAPI void
519ecore_imf_context_cursor_location_set(Ecore_IMF_Context *ctx, int x, int y, int w, int h)
520{
521 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
522 {
523 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
524 "ecore_imf_context_cursor_location_set");
525 return;
526 }
527 if (ctx->klass->cursor_location_set) ctx->klass->cursor_location_set(ctx, x, y, w, h);
528}
529
530/**
531 * Set whether the IM context should use the preedit string
532 * to display feedback. If @use_preedit is EINA_FALSE (default
533 * is EINA_TRUE), then the IM context may use some other method to display
534 * feedback, such as displaying it in a child of the root window.
535 *
536 * @param ctx An #Ecore_IMF_Context.
537 * @param use_preedit Whether the IM context should use the preedit string.
538 * @ingroup Ecore_IMF_Context_Group
539 */
540EAPI void
541ecore_imf_context_use_preedit_set(Ecore_IMF_Context *ctx, Eina_Bool use_preedit)
542{
543 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
544 {
545 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
546 "ecore_imf_context_use_preedit_set");
547 return;
548 }
549 if (ctx->klass->use_preedit_set) ctx->klass->use_preedit_set(ctx, use_preedit);
550}
551
552/**
553 * Set whether the IM context should allow to use the text prediction.
554 * If @prediction is EINA_FALSE (default is EINA_TRUE), then the IM context will not display the text prediction window.
555 *
556 * @param ctx An #Ecore_IMF_Context.
557 * @param prediction Whether the IM context should allow to use the text prediction.
558 * @ingroup Ecore_IMF_Context_Group
559 * @since 1.1.0
560 */
561EAPI void
562ecore_imf_context_prediction_allow_set(Ecore_IMF_Context *ctx, Eina_Bool prediction)
563{
564 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
565 {
566 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
567 "ecore_imf_context_prediction_allow_set");
568 return;
569 }
570
571 ctx->allow_prediction = prediction;
572
573 if (ctx->klass->prediction_allow_set)
574 ctx->klass->prediction_allow_set(ctx, prediction);
575}
576
577/**
578 * Get whether the IM context should allow to use the text prediction.
579 *
580 * @param ctx An #Ecore_IMF_Context.
581 * @return EINA_TRUE if it allows to use the text prediction, otherwise EINA_FALSE.
582 * @ingroup Ecore_IMF_Context_Group
583 * @since 1.1.0
584 */
585EAPI Eina_Bool
586ecore_imf_context_prediction_allow_get(Ecore_IMF_Context *ctx)
587{
588 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
589 {
590 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
591 "ecore_imf_context_prediction_allow_get");
592 return EINA_FALSE;
593 }
594
595 return ctx->allow_prediction;
596}
597
598/**
599 * Set the autocapitalization type on the immodule.
600 *
601 * @param ctx An #Ecore_IMF_Context.
602 * @param autocapital_type the autocapitalization type.
603 * @ingroup Ecore_IMF_Context_Group
604 * @since 1.1.0
605 */
606EAPI void
607ecore_imf_context_autocapital_type_set(Ecore_IMF_Context *ctx, Ecore_IMF_Autocapital_Type autocapital_type)
608{
609 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
610 {
611 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
612 "ecore_imf_context_autocapital_type_set");
613 return;
614 }
615
616 ctx->autocapital_type = autocapital_type;
617
618 if (ctx->klass->autocapital_type_set) ctx->klass->autocapital_type_set(ctx, autocapital_type);
619}
620
621/**
622 * Get the autocapitalization type.
623 *
624 * @param ctx An #Ecore_IMF_Context.
625 * @return The autocapital type being used by @p ctx.
626 * @ingroup Ecore_IMF_Context_Group
627 * @since 1.1.0
628 */
629EAPI Ecore_IMF_Autocapital_Type
630ecore_imf_context_autocapital_type_get(Ecore_IMF_Context *ctx)
631{
632 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
633 {
634 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
635 "ecore_imf_context_autocapital_allow_get");
636 return ECORE_IMF_AUTOCAPITAL_TYPE_NONE;
637 }
638
639 return ctx->autocapital_type;
640}
641
642/**
643 * Set the callback to be used on get_surrounding request.
644 *
645 * This callback will be called when the Input Method Context
646 * module requests the surrounding context.
647 *
648 * @param ctx An #Ecore_IMF_Context.
649 * @param func The callback to be called.
650 * @param data The data pointer to be passed to @p func
651 * @ingroup Ecore_IMF_Context_Group
652 */
653EAPI void
654ecore_imf_context_retrieve_surrounding_callback_set(Ecore_IMF_Context *ctx, Eina_Bool (*func)(void *data, Ecore_IMF_Context *ctx, char **text, int *cursor_pos), const void *data)
655{
656 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
657 {
658 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
659 "ecore_imf_context_retrieve_surrounding_callback_set");
660 return;
661 }
662
663 ctx->retrieve_surrounding_func = func;
664 ctx->retrieve_surrounding_data = (void *) data;
665}
666
667/**
668 * Set the input mode used by the Ecore Input Context.
669 *
670 * The input mode can be one of the input modes defined in
671 * #Ecore_IMF_Input_Mode. The default input mode is
672 * ECORE_IMF_INPUT_MODE_FULL.
673 *
674 * @param ctx An #Ecore_IMF_Context.
675 * @param input_mode The input mode to be used by @p ctx.
676 * @ingroup Ecore_IMF_Context_Group
677 */
678EAPI void
679ecore_imf_context_input_mode_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Mode input_mode)
680{
681 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
682 {
683 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
684 "ecore_imf_context_input_mode_set");
685 return;
686 }
687 if (ctx->klass->input_mode_set) ctx->klass->input_mode_set(ctx, input_mode);
688 ctx->input_mode = input_mode;
689}
690
691/**
692 * Get the input mode being used by the Ecore Input Context.
693 *
694 * See @ref ecore_imf_context_input_mode_set for more details.
695 *
696 * @param ctx An #Ecore_IMF_Context.
697 * @return The input mode being used by @p ctx.
698 * @ingroup Ecore_IMF_Context_Group
699 */
700EAPI Ecore_IMF_Input_Mode
701ecore_imf_context_input_mode_get(Ecore_IMF_Context *ctx)
702{
703 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
704 {
705 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
706 "ecore_imf_context_input_mode_set");
707 return 0;
708 }
709 return ctx->input_mode;
710}
711
712/**
713 * Allow an Ecore Input Context to internally handle an event.
714 * If this function returns EINA_TRUE, then no further processing
715 * should be done for this event.
716 *
717 * Input methods must be able to accept all types of events (simply
718 * returning EINA_FALSE if the event was not handled), but there is no
719 * obligation of any events to be submitted to this function.
720 *
721 * @param ctx An #Ecore_IMF_Context.
722 * @param type The type of event defined by #Ecore_IMF_Event_Type.
723 * @param event The event itself.
724 * @return EINA_TRUE if the event was handled; otherwise EINA_FALSE.
725 * @ingroup Ecore_IMF_Context_Group
726 */
727EAPI Eina_Bool
728ecore_imf_context_filter_event(Ecore_IMF_Context *ctx, Ecore_IMF_Event_Type type, Ecore_IMF_Event *event)
729{
730 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
731 {
732 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
733 "ecore_imf_context_filter_event");
734 return EINA_FALSE;
735 }
736 if (ctx->klass->filter_event) return ctx->klass->filter_event(ctx, type, event);
737 return EINA_FALSE;
738}
739
740/**
741 * @defgroup Ecore_IMF_Context_Module_Group Ecore Input Method Context Module Functions
742 *
743 * Functions that should be used by Ecore Input Method Context modules.
744 */
745
746/**
747 * Creates a new Input Method Context with klass specified by @p ctxc.
748 *
749 * This method should be used by modules implementing the Input
750 * Method Context interface.
751 *
752 * @param ctxc An #Ecore_IMF_Context_Class.
753 * @return A new #Ecore_IMF_Context; on failure it returns NULL.
754 * @ingroup Ecore_IMF_Context_Module_Group
755 */
756EAPI Ecore_IMF_Context *
757ecore_imf_context_new(const Ecore_IMF_Context_Class *ctxc)
758{
759 Ecore_IMF_Context *ctx;
760
761 if (!ctxc) return NULL;
762 ctx = calloc(1, sizeof(Ecore_IMF_Context));
763 if (!ctx) return NULL;
764 ECORE_MAGIC_SET(ctx, ECORE_MAGIC_CONTEXT);
765 ctx->klass = ctxc;
766 ctx->data = NULL;
767 ctx->retrieve_surrounding_func = NULL;
768 ctx->retrieve_surrounding_data = NULL;
769 return ctx;
770}
771
772/**
773 * Set the Input Method Context specific data.
774 *
775 * Note that this method should be used by modules to set
776 * the Input Method Context specific data and it's not meant to
777 * be used by applications to store application specific data.
778 *
779 * @param ctx An #Ecore_IMF_Context.
780 * @param data The Input Method Context specific data.
781 * @return A new #Ecore_IMF_Context; on failure it returns NULL.
782 * @ingroup Ecore_IMF_Context_Module_Group
783 */
784EAPI void
785ecore_imf_context_data_set(Ecore_IMF_Context *ctx, void *data)
786{
787 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
788 {
789 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
790 "ecore_imf_context_data_set");
791 return;
792 }
793 ctx->data = data;
794}
795
796/**
797 * Get the Input Method Context specific data.
798 *
799 * See @ref ecore_imf_context_data_set for more details.
800 *
801 * @param ctx An #Ecore_IMF_Context.
802 * @return The Input Method Context specific data.
803 * @ingroup Ecore_IMF_Context_Module_Group
804 */
805EAPI void *ecore_imf_context_data_get(Ecore_IMF_Context *ctx)
806{
807 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
808 {
809 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
810 "ecore_imf_context_data_get");
811 return NULL;
812 }
813 return ctx->data;
814}
815
816/**
817 * Retrieve context around insertion point.
818 *
819 * This function is implemented by calling the
820 * Ecore_IMF_Context::retrieve_surrounding_func (
821 * set using #ecore_imf_context_retrieve_surrounding_callback_set).
822 *
823 * There is no obligation for a widget to respond to the
824 * ::retrieve_surrounding_func, so input methods must be prepared
825 * to function without context.
826 *
827 * @param ctx An #Ecore_IMF_Context.
828 * @param text Location to store a UTF-8 encoded string of text
829 * holding context around the insertion point.
830 * If the function returns EINA_TRUE, then you must free
831 * the result stored in this location with free().
832 * @param cursor_pos Location to store the position in characters of
833 * the insertion cursor within @text.
834 * @return EINA_TRUE if surrounding text was provided; otherwise EINA_FALSE.
835 * @ingroup Ecore_IMF_Context_Module_Group
836 */
837EAPI Eina_Bool
838ecore_imf_context_surrounding_get(Ecore_IMF_Context *ctx, char **text, int *cursor_pos)
839{
840 int result = EINA_FALSE;
841
842 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
843 {
844 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
845 "ecore_imf_context_surrounding_get");
846 return EINA_FALSE;
847 }
848
849 if (ctx->retrieve_surrounding_func)
850 {
851 result = ctx->retrieve_surrounding_func(ctx->retrieve_surrounding_data, ctx, text, cursor_pos);
852 if (!result)
853 {
854 if (text) *text = NULL;
855 if (cursor_pos) *cursor_pos = 0;
856 }
857 }
858 return result;
859}
860
861static void
862_ecore_imf_event_free_preedit(void *data __UNUSED__, void *event)
863{
864 free(event);
865}
866
867/**
868 * Adds ECORE_IMF_EVENT_PREEDIT_START to the event queue.
869 *
870 * ECORE_IMF_EVENT_PREEDIT_START should be added when a new preedit sequence starts.
871 *
872 * @param ctx An #Ecore_IMF_Context.
873 * @ingroup Ecore_IMF_Context_Module_Group
874 */
875EAPI void
876ecore_imf_context_preedit_start_event_add(Ecore_IMF_Context *ctx)
877{
878 Ecore_IMF_Event_Commit *ev;
879
880 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
881 {
882 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
883 "ecore_imf_context_preedit_start_event_add");
884 return;
885 }
886
887 ev = malloc(sizeof(Ecore_IMF_Event_Preedit_Start));
888 ev->ctx = ctx;
889 ecore_event_add(ECORE_IMF_EVENT_PREEDIT_START,
890 ev, _ecore_imf_event_free_preedit, NULL);
891}
892
893/**
894 * Adds ECORE_IMF_EVENT_PREEDIT_END to the event queue.
895 *
896 * ECORE_IMF_EVENT_PREEDIT_END should be added when a new preedit sequence has been completed or canceled.
897 *
898 * @param ctx An #Ecore_IMF_Context.
899 * @ingroup Ecore_IMF_Context_Module_Group
900 */
901EAPI void
902ecore_imf_context_preedit_end_event_add(Ecore_IMF_Context *ctx)
903{
904 Ecore_IMF_Event_Commit *ev;
905
906 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
907 {
908 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
909 "ecore_imf_context_preedit_end_event_add");
910 return;
911 }
912
913 ev = malloc(sizeof(Ecore_IMF_Event_Preedit_End));
914 ev->ctx = ctx;
915 ecore_event_add(ECORE_IMF_EVENT_PREEDIT_END,
916 ev, _ecore_imf_event_free_preedit, NULL);
917}
918
919/**
920 * Adds ECORE_IMF_EVENT_PREEDIT_CHANGED to the event queue.
921 *
922 * @param ctx An #Ecore_IMF_Context.
923 * @ingroup Ecore_IMF_Context_Module_Group
924 */
925EAPI void
926ecore_imf_context_preedit_changed_event_add(Ecore_IMF_Context *ctx)
927{
928 Ecore_IMF_Event_Commit *ev;
929
930 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
931 {
932 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
933 "ecore_imf_context_preedit_changed_event_add");
934 return;
935 }
936
937 ev = malloc(sizeof(Ecore_IMF_Event_Preedit_Changed));
938 ev->ctx = ctx;
939 ecore_event_add(ECORE_IMF_EVENT_PREEDIT_CHANGED,
940 ev, _ecore_imf_event_free_preedit, NULL);
941}
942
943static void
944_ecore_imf_event_free_commit(void *data __UNUSED__, void *event)
945{
946 Ecore_IMF_Event_Commit *ev;
947
948 ev = event;
949 if (ev->str) free(ev->str);
950 free(ev);
951}
952
953/**
954 * Adds ECORE_IMF_EVENT_COMMIT to the event queue.
955 *
956 * @param ctx An #Ecore_IMF_Context.
957 * @param str The committed string.
958 * @ingroup Ecore_IMF_Context_Module_Group
959 */
960EAPI void
961ecore_imf_context_commit_event_add(Ecore_IMF_Context *ctx, const char *str)
962{
963 Ecore_IMF_Event_Commit *ev;
964
965 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
966 {
967 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
968 "ecore_imf_context_commit_event_add");
969 return;
970 }
971
972 ev = malloc(sizeof(Ecore_IMF_Event_Commit));
973 ev->ctx = ctx;
974 ev->str = str ? strdup(str) : NULL;
975 ecore_event_add(ECORE_IMF_EVENT_COMMIT,
976 ev, _ecore_imf_event_free_commit, NULL);
977
978}
979
980static void
981_ecore_imf_event_free_delete_surrounding(void *data __UNUSED__, void *event)
982{
983 free(event);
984}
985
986/**
987 * Adds ECORE_IMF_EVENT_DELETE_SURROUNDING to the event queue.
988 *
989 * Asks the widget that the input context is attached to to delete characters around the cursor position
990 * by adding the ECORE_IMF_EVENT_DELETE_SURROUNDING to the event queue.
991 * Note that offset and n_chars are in characters not in bytes.
992 *
993 * @param ctx An #Ecore_IMF_Context.
994 * @param offset The start offset of surrounding to be deleted.
995 * @param n_chars The number of characters to be deleted.
996 * @ingroup Ecore_IMF_Context_Module_Group
997 */
998EAPI void
999ecore_imf_context_delete_surrounding_event_add(Ecore_IMF_Context *ctx, int offset, int n_chars)
1000{
1001 Ecore_IMF_Event_Delete_Surrounding *ev;
1002
1003 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
1004 {
1005 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
1006 "ecore_imf_context_delete_surrounding_event_add");
1007 return;
1008 }
1009
1010 ev = malloc(sizeof(Ecore_IMF_Event_Delete_Surrounding));
1011 ev->ctx = ctx;
1012 ev->offset = offset;
1013 ev->n_chars = n_chars;
1014 ecore_event_add(ECORE_IMF_EVENT_DELETE_SURROUNDING,
1015 ev, _ecore_imf_event_free_delete_surrounding, NULL);
1016}
1017
1018/**
1019 * Ask the Input Method Context to show the control panel of using Input Method.
1020 *
1021 * @param ctx An #Ecore_IMF_Context.
1022 * @ingroup Ecore_IMF_Context_IMControl_Group
1023 * @since 1.1.0
1024 */
1025EAPI void
1026ecore_imf_context_control_panel_show (Ecore_IMF_Context *ctx)
1027{
1028 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
1029 {
1030 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
1031 "ecore_imf_context_control_panel_show");
1032 return;
1033 }
1034
1035 if (ctx->klass->control_panel_show) ctx->klass->control_panel_show(ctx);
1036}
1037
1038/**
1039 * Ask the Input Method Context to hide the control panel of using Input Method.
1040 *
1041 * @param ctx An #Ecore_IMF_Context.
1042 * @ingroup Ecore_IMF_Context_IMControl_Group
1043 * @since 1.1.0
1044 */
1045EAPI void
1046ecore_imf_context_control_panel_hide (Ecore_IMF_Context *ctx)
1047{
1048 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
1049 {
1050 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
1051 "ecore_imf_context_control_panel_hide");
1052 return;
1053 }
1054
1055 if (ctx->klass->control_panel_hide) ctx->klass->control_panel_hide(ctx);
1056}
1057
1058/**
1059 * Ask the Input Method Context to show the input panel (virtual keyboard).
1060 *
1061 * @param ctx An #Ecore_IMF_Context.
1062 * @ingroup Ecore_IMF_Context_IMControl_Group
1063 * @since 1.1.0
1064 */
1065EAPI void
1066ecore_imf_context_input_panel_show(Ecore_IMF_Context *ctx)
1067{
1068 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
1069 {
1070 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
1071 "ecore_imf_context_input_panel_show");
1072 return;
1073 }
1074
1075 if (ctx->klass->show) ctx->klass->show(ctx);
1076}
1077
1078/**
1079 * Ask the Input Method Context to hide the input panel.
1080 *
1081 * @param ctx An #Ecore_IMF_Context.
1082 * @ingroup Ecore_IMF_Context_IMControl_Group
1083 * @since 1.1.0
1084 */
1085EAPI void
1086ecore_imf_context_input_panel_hide(Ecore_IMF_Context *ctx)
1087{
1088 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
1089 {
1090 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
1091 "ecore_imf_context_input_panel_hide");
1092 return;
1093 }
1094
1095 if (ctx->klass->hide) ctx->klass->hide(ctx);
1096}
1097
1098/**
1099 * Set the layout of the input panel.
1100 *
1101 * @param ctx An #Ecore_IMF_Context.
1102 * @param layout see #ECORE_IMF_INPUT_PANEL_LAYOUT
1103 * @ingroup Ecore_IMF_Context_IMControl_Group
1104 * @since 1.1.0
1105 */
1106EAPI void
1107ecore_imf_context_input_panel_layout_set (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Layout layout)
1108{
1109 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
1110 {
1111 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
1112 "ecore_imf_context_input_panel_layout_set");
1113 return;
1114 }
1115
1116 if (ctx->klass->input_panel_layout_set)
1117 ctx->klass->input_panel_layout_set(ctx, layout);
1118
1119 ctx->input_panel_layout = layout;
1120}
1121
1122/**
1123 * Get the layout of the current active input panel.
1124 *
1125 * @param ctx An #Ecore_IMF_Context.
1126 * @return layout see #Ecore_IMF_Input_Panel_Layout
1127 * @ingroup Ecore_IMF_Context_IMControl_Group
1128 * @since 1.1.0
1129 */
1130EAPI Ecore_IMF_Input_Panel_Layout
1131ecore_imf_context_input_panel_layout_get (Ecore_IMF_Context *ctx)
1132{
1133 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
1134 {
1135 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
1136 "ecore_imf_context_input_panel_layout_get");
1137 return ECORE_IMF_INPUT_PANEL_LAYOUT_INVALID;
1138 }
1139
1140 if (ctx->klass->input_panel_layout_get)
1141 {
1142 return ctx->input_panel_layout;
1143 }
1144 else
1145 return ECORE_IMF_INPUT_PANEL_LAYOUT_INVALID;
1146}
1147
1148/**
1149 * Set the language of the input panel.
1150 * This API can be used when you want to show the English keyboard.
1151 *
1152 * @param ctx An #Ecore_IMF_Context.
1153 * @param lang the language to be set to the input panel.
1154 * @ingroup Ecore_IMF_Context_IMControl_Group
1155 * @since 1.1.0
1156 */
1157EAPI void
1158ecore_imf_context_input_panel_language_set (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Lang lang)
1159{
1160 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
1161 {
1162 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
1163 "ecore_imf_context_input_panel_language_set");
1164 return;
1165 }
1166
1167 if (ctx->klass->input_panel_language_set) ctx->klass->input_panel_language_set(ctx, lang);
1168 ctx->input_panel_lang = lang;
1169}
1170
1171/**
1172 * Get the language of the input panel.
1173 *
1174 * See @ref ecore_imf_context_input_panel_language_set for more details.
1175 *
1176 * @param ctx An #Ecore_IMF_Context.
1177 * @return Ecore_IMF_Input_Panel_Lang
1178 * @ingroup Ecore_IMF_Context_IMControl_Group
1179 * @since 1.1.0
1180 */
1181EAPI Ecore_IMF_Input_Panel_Lang
1182ecore_imf_context_input_panel_language_get (Ecore_IMF_Context *ctx)
1183{
1184 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
1185 {
1186 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
1187 "ecore_imf_context_input_panel_language_get");
1188 return ECORE_IMF_INPUT_PANEL_LANG_AUTOMATIC;
1189 }
1190
1191 return ctx->input_panel_lang;
1192}
1193
1194/**
1195 * Set whether the Input Method Context should request to show the input panel automatically
1196 * when the widget has focus.
1197 *
1198 * @param ctx An #Ecore_IMF_Context.
1199 * @param enabled If true, the input panel will be shown when the widget is clicked or has focus.
1200 * @ingroup Ecore_IMF_Context_Group
1201 * @since 1.1.0
1202 */
1203EAPI void
1204ecore_imf_context_input_panel_enabled_set (Ecore_IMF_Context *ctx,
1205 Eina_Bool enabled)
1206{
1207 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
1208 {
1209 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
1210 "ecore_imf_context_input_panel_enabled_set");
1211 return;
1212 }
1213
1214 ctx->input_panel_enabled = enabled;
1215}
1216
1217/**
1218 * Get whether the Input Method Context requests to show the input panel automatically.
1219 *
1220 * @param ctx An #Ecore_IMF_Context.
1221 * @return Return the attribute to show the input panel automatically
1222 * @ingroup Ecore_IMF_Context_Group
1223 * @since 1.1.0
1224 */
1225EAPI Eina_Bool
1226ecore_imf_context_input_panel_enabled_get (Ecore_IMF_Context *ctx)
1227{
1228 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
1229 {
1230 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
1231 "ecore_imf_context_input_panel_enabled_get");
1232 return EINA_FALSE;
1233 }
1234
1235 return ctx->input_panel_enabled;
1236}
1237
diff --git a/libraries/ecore/src/lib/ecore_imf/ecore_imf_module.c b/libraries/ecore/src/lib/ecore_imf/ecore_imf_module.c
new file mode 100644
index 0000000..946f5bc
--- /dev/null
+++ b/libraries/ecore/src/lib/ecore_imf/ecore_imf_module.c
@@ -0,0 +1,212 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include <stdio.h>
6#include <stdlib.h>
7#include <string.h>
8#include <limits.h>
9
10#include <Ecore.h>
11#include <ecore_private.h>
12
13#include "Ecore_IMF.h"
14#include "ecore_imf_private.h"
15
16static void _ecore_imf_module_free(Ecore_IMF_Module *module);
17static int _ecore_imf_modules_exists(const char *ctx_id);
18
19typedef struct _Ecore_IMF_Selector
20{
21 const char *toselect;
22 void *selected;
23} Ecore_IMF_Selector;
24
25static Eina_Hash *modules = NULL;
26static Eina_Array *module_list = NULL;
27
28void
29ecore_imf_module_init(void)
30{
31 char *homedir;
32
33 module_list = eina_module_list_get(NULL, PACKAGE_LIB_DIR "/ecore/immodules", 0, NULL, NULL);
34 homedir = eina_module_environment_path_get("HOME", "/.ecore/immodules");
35 if (homedir)
36 {
37 module_list = eina_module_list_get(module_list, homedir, 0, NULL, NULL);
38 free(homedir);
39 }
40 eina_module_list_load(module_list);
41}
42
43void
44ecore_imf_module_shutdown(void)
45{
46 if (modules)
47 {
48 eina_hash_free(modules);
49 modules = NULL;
50 }
51 if (module_list)
52 {
53 eina_module_list_free(module_list);
54 eina_array_free(module_list);
55 module_list = NULL;
56 }
57}
58
59static Eina_Bool
60_hash_module_available_get(const Eina_Hash *hash __UNUSED__, int *data, void *list)
61{
62 *(Eina_List**)list = eina_list_append(*(Eina_List**)list, data);
63 return EINA_TRUE;
64}
65
66Eina_List *
67ecore_imf_module_available_get(void)
68{
69 Eina_List *values = NULL;
70 Eina_Iterator *it = NULL;
71
72 if (!modules) return NULL;
73
74 it = eina_hash_iterator_data_new(modules);
75 if (!it)
76 return NULL;
77
78 eina_iterator_foreach(it, EINA_EACH_CB(_hash_module_available_get), &values);
79 eina_iterator_free(it);
80
81 return values;
82}
83
84Ecore_IMF_Module *
85ecore_imf_module_get(const char *ctx_id)
86{
87 if (!modules) return NULL;
88 return eina_hash_find(modules, ctx_id);
89}
90
91Ecore_IMF_Context *
92ecore_imf_module_context_create(const char *ctx_id)
93{
94 Ecore_IMF_Module *module;
95 Ecore_IMF_Context *ctx = NULL;
96
97 if (!modules) return NULL;
98 module = eina_hash_find(modules, ctx_id);
99 if (module)
100 {
101 ctx = module->create();
102 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
103 {
104 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
105 "ecore_imf_module_context_create");
106 return NULL;
107 }
108 ctx->module = module;
109 }
110 return ctx;
111}
112
113static Eina_Bool
114_hash_ids_get(const Eina_Hash *hash __UNUSED__, const char *key, void *list)
115{
116 *(Eina_List**)list = eina_list_append(*(Eina_List**)list, key);
117 return EINA_TRUE;
118}
119
120Eina_List *
121ecore_imf_module_context_ids_get(void)
122{
123 Eina_List *l = NULL;
124 Eina_Iterator *it = NULL;
125
126 if (!modules) return NULL;
127
128 it = eina_hash_iterator_key_new(modules);
129 if (!it)
130 return NULL;
131
132 eina_iterator_foreach(it, EINA_EACH_CB(_hash_ids_get), &l);
133 eina_iterator_free(it);
134
135 return l;
136}
137
138static Eina_Bool
139_hash_ids_by_canvas_type_get(const Eina_Hash *hash __UNUSED__, void *data, void *fdata)
140{
141 Ecore_IMF_Module *module = data;
142 Ecore_IMF_Selector *selector = fdata;
143
144 if (!strcmp(module->info->canvas_type, selector->toselect))
145 selector->selected = eina_list_append(selector->selected, (void *)module->info->id);
146
147 return EINA_TRUE;
148}
149
150Eina_List *
151ecore_imf_module_context_ids_by_canvas_type_get(const char *canvas_type)
152{
153 Ecore_IMF_Selector selector;
154 Eina_List *values = NULL;
155 Eina_Iterator *it = NULL;
156
157 if (!modules) return NULL;
158
159 if (!canvas_type)
160 return ecore_imf_module_context_ids_get();
161
162 it = eina_hash_iterator_data_new(modules);
163 if (!it)
164 return NULL;
165
166 selector.toselect = canvas_type;
167 selector.selected = values;
168 eina_iterator_foreach(it, EINA_EACH_CB(_hash_ids_by_canvas_type_get), &selector);
169 eina_iterator_free(it);
170
171 return values;
172}
173
174EAPI void
175ecore_imf_module_register(const Ecore_IMF_Context_Info *info,
176 Ecore_IMF_Context *(*imf_module_create)(void),
177 Ecore_IMF_Context *(*imf_module_exit)(void))
178{
179 Ecore_IMF_Module *module;
180
181 if (_ecore_imf_modules_exists(info->id)) return;
182
183 if (!modules)
184 modules = eina_hash_string_superfast_new(EINA_FREE_CB(_ecore_imf_module_free));
185
186 module = malloc(sizeof(Ecore_IMF_Module));
187 module->info = info;
188 /* cache imf_module_create as it may be used several times */
189 module->create = imf_module_create;
190 module->exit = imf_module_exit;
191
192 eina_hash_add(modules, info->id, module);
193}
194
195static void
196_ecore_imf_module_free(Ecore_IMF_Module *module)
197{
198 if (module->exit) module->exit();
199 free(module);
200}
201
202static int
203_ecore_imf_modules_exists(const char *ctx_id)
204{
205 if (!modules) return 0;
206 if (!ctx_id) return 0;
207
208 if (eina_hash_find(modules, ctx_id))
209 return 1;
210
211 return 0;
212}
diff --git a/libraries/ecore/src/lib/ecore_imf/ecore_imf_private.h b/libraries/ecore/src/lib/ecore_imf/ecore_imf_private.h
new file mode 100644
index 0000000..07a5b09
--- /dev/null
+++ b/libraries/ecore/src/lib/ecore_imf/ecore_imf_private.h
@@ -0,0 +1,72 @@
1#ifndef _ECORE_IMF_PRIVATE_H
2#define _ECORE_IMF_PRIVATE_H
3
4#define ECORE_MAGIC_CONTEXT 0x56c1b39a
5
6#ifdef ECORE_IMF_DEFAULT_LOG_COLOR
7#undef ECORE_IMF_DEFAULT_LOG_COLOR
8#endif
9#define ECORE_IMF_DEFAULT_LOG_COLOR EINA_COLOR_BLUE
10
11extern int _ecore_imf_log_dom;
12#ifdef ERR
13# undef ERR
14#endif
15#define ERR(...) EINA_LOG_DOM_ERR(_ecore_imf_log_dom, __VA_ARGS__)
16
17#ifdef DBG
18# undef DBG
19#endif
20#define DBG(...) EINA_LOG_DOM_DBG(_ecore_imf_log_dom, __VA_ARGS__)
21
22#ifdef INF
23# undef INF
24#endif
25#define INF(...) EINA_LOG_DOM_INFO(_ecore_imf_log_dom, __VA_ARGS__)
26
27#ifdef WRN
28# undef WRN
29#endif
30#define WRN(...) EINA_LOG_DOM_WARN(_ecore_imf_log_dom, __VA_ARGS__)
31
32#ifdef CRIT
33# undef CRIT
34#endif
35#define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_imf_log_dom, __VA_ARGS__)
36
37typedef struct _Ecore_IMF_Module Ecore_IMF_Module;
38
39struct _Ecore_IMF_Context
40{
41 ECORE_MAGIC;
42 const Ecore_IMF_Module *module;
43 const Ecore_IMF_Context_Class *klass;
44 void *data;
45 int input_mode;
46 void *window;
47 void *client_canvas;
48 Eina_Bool (*retrieve_surrounding_func)(void *data, Ecore_IMF_Context *ctx, char **text, int *cursor_pos);
49 void *retrieve_surrounding_data;
50 Ecore_IMF_Autocapital_Type autocapital_type;
51 Ecore_IMF_Input_Panel_Layout input_panel_layout;
52 Ecore_IMF_Input_Panel_Lang input_panel_lang;
53 Eina_Bool allow_prediction : 1;
54 Eina_Bool input_panel_enabled : 1;
55};
56
57struct _Ecore_IMF_Module
58{
59 const Ecore_IMF_Context_Info *info;
60 Ecore_IMF_Context *(*create)(void);
61 Ecore_IMF_Context *(*exit)(void);
62};
63
64void ecore_imf_module_init(void);
65void ecore_imf_module_shutdown(void);
66Eina_List *ecore_imf_module_available_get(void);
67Ecore_IMF_Module *ecore_imf_module_get(const char *ctx_id);
68Ecore_IMF_Context *ecore_imf_module_context_create(const char *ctx_id);
69Eina_List *ecore_imf_module_context_ids_get(void);
70Eina_List *ecore_imf_module_context_ids_by_canvas_type_get(const char *canvas_type);
71
72#endif