diff options
Diffstat (limited to 'libraries/ecore/src/lib/ecore_imf')
-rw-r--r-- | libraries/ecore/src/lib/ecore_imf/Ecore_IMF.h | 418 | ||||
-rw-r--r-- | libraries/ecore/src/lib/ecore_imf/Makefile.am | 28 | ||||
-rw-r--r-- | libraries/ecore/src/lib/ecore_imf/Makefile.in | 822 | ||||
-rw-r--r-- | libraries/ecore/src/lib/ecore_imf/ecore_imf.c | 73 | ||||
-rw-r--r-- | libraries/ecore/src/lib/ecore_imf/ecore_imf_context.c | 1237 | ||||
-rw-r--r-- | libraries/ecore/src/lib/ecore_imf/ecore_imf_module.c | 212 | ||||
-rw-r--r-- | libraries/ecore/src/lib/ecore_imf/ecore_imf_private.h | 72 |
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 | ||
33 | extern "C" { | ||
34 | #endif | ||
35 | |||
36 | /* Events sent by the Input Method */ | ||
37 | typedef struct _Ecore_IMF_Event_Preedit_Start Ecore_IMF_Event_Preedit_Start; | ||
38 | typedef struct _Ecore_IMF_Event_Preedit_End Ecore_IMF_Event_Preedit_End; | ||
39 | typedef struct _Ecore_IMF_Event_Preedit_Changed Ecore_IMF_Event_Preedit_Changed; | ||
40 | typedef struct _Ecore_IMF_Event_Commit Ecore_IMF_Event_Commit; | ||
41 | typedef struct _Ecore_IMF_Event_Delete_Surrounding Ecore_IMF_Event_Delete_Surrounding; | ||
42 | |||
43 | /* Events to filter */ | ||
44 | typedef struct _Ecore_IMF_Event_Mouse_Down Ecore_IMF_Event_Mouse_Down; | ||
45 | typedef struct _Ecore_IMF_Event_Mouse_Up Ecore_IMF_Event_Mouse_Up; | ||
46 | typedef struct _Ecore_IMF_Event_Mouse_In Ecore_IMF_Event_Mouse_In; | ||
47 | typedef struct _Ecore_IMF_Event_Mouse_Out Ecore_IMF_Event_Mouse_Out; | ||
48 | typedef struct _Ecore_IMF_Event_Mouse_Move Ecore_IMF_Event_Mouse_Move; | ||
49 | typedef struct _Ecore_IMF_Event_Mouse_Wheel Ecore_IMF_Event_Mouse_Wheel; | ||
50 | typedef struct _Ecore_IMF_Event_Key_Down Ecore_IMF_Event_Key_Down; | ||
51 | typedef struct _Ecore_IMF_Event_Key_Up Ecore_IMF_Event_Key_Up; | ||
52 | typedef union _Ecore_IMF_Event Ecore_IMF_Event; | ||
53 | |||
54 | typedef struct _Ecore_IMF_Context Ecore_IMF_Context; /**< An Input Method Context */ | ||
55 | typedef struct _Ecore_IMF_Context_Class Ecore_IMF_Context_Class; /**< An Input Method Context class */ | ||
56 | typedef struct _Ecore_IMF_Context_Info Ecore_IMF_Context_Info; /**< An Input Method Context info */ | ||
57 | |||
58 | /* Preedit attribute info */ | ||
59 | typedef struct _Ecore_IMF_Preedit_Attr Ecore_IMF_Preedit_Attr; | ||
60 | |||
61 | EAPI extern int ECORE_IMF_EVENT_PREEDIT_START; | ||
62 | EAPI extern int ECORE_IMF_EVENT_PREEDIT_END; | ||
63 | EAPI extern int ECORE_IMF_EVENT_PREEDIT_CHANGED; | ||
64 | EAPI extern int ECORE_IMF_EVENT_COMMIT; | ||
65 | EAPI extern int ECORE_IMF_EVENT_DELETE_SURROUNDING; | ||
66 | |||
67 | typedef 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 | |||
79 | typedef 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 | |||
88 | typedef 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 | |||
96 | typedef 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 | |||
103 | typedef 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 | |||
115 | typedef 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 | |||
123 | typedef 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 | |||
131 | typedef 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 | |||
144 | typedef 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 | |||
150 | struct _Ecore_IMF_Event_Preedit_Start | ||
151 | { | ||
152 | Ecore_IMF_Context *ctx; | ||
153 | }; | ||
154 | |||
155 | struct _Ecore_IMF_Event_Preedit_End | ||
156 | { | ||
157 | Ecore_IMF_Context *ctx; | ||
158 | }; | ||
159 | |||
160 | struct _Ecore_IMF_Event_Preedit_Changed | ||
161 | { | ||
162 | Ecore_IMF_Context *ctx; | ||
163 | }; | ||
164 | |||
165 | struct _Ecore_IMF_Event_Commit | ||
166 | { | ||
167 | Ecore_IMF_Context *ctx; | ||
168 | char *str; | ||
169 | }; | ||
170 | |||
171 | struct _Ecore_IMF_Event_Delete_Surrounding | ||
172 | { | ||
173 | Ecore_IMF_Context *ctx; | ||
174 | int offset; | ||
175 | int n_chars; | ||
176 | }; | ||
177 | |||
178 | struct _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 | |||
193 | struct _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 | |||
208 | struct _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 | |||
222 | struct _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 | |||
236 | struct _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 | |||
252 | struct _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 | |||
267 | struct _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 | |||
278 | struct _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 | |||
289 | union _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 | |||
301 | struct _Ecore_IMF_Preedit_Attr | ||
302 | { | ||
303 | Ecore_IMF_Preedit_Type preedit_type; | ||
304 | unsigned int start_index; | ||
305 | unsigned int end_index; | ||
306 | }; | ||
307 | |||
308 | struct _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 | |||
336 | struct _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 | |||
345 | EAPI int ecore_imf_init(void); | ||
346 | EAPI int ecore_imf_shutdown(void); | ||
347 | |||
348 | EAPI 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 | |||
350 | EAPI Eina_List *ecore_imf_context_available_ids_get(void); | ||
351 | EAPI Eina_List *ecore_imf_context_available_ids_by_canvas_type_get(const char *canvas_type); | ||
352 | EAPI const char *ecore_imf_context_default_id_get(void); | ||
353 | EAPI const char *ecore_imf_context_default_id_by_canvas_type_get(const char *canvas_type); | ||
354 | EAPI const Ecore_IMF_Context_Info *ecore_imf_context_info_by_id_get(const char *id); | ||
355 | |||
356 | EAPI Ecore_IMF_Context *ecore_imf_context_add(const char *id); | ||
357 | EAPI const Ecore_IMF_Context_Info *ecore_imf_context_info_get(Ecore_IMF_Context *ctx); | ||
358 | EAPI void ecore_imf_context_del(Ecore_IMF_Context *ctx); | ||
359 | EAPI void ecore_imf_context_client_window_set(Ecore_IMF_Context *ctx, void *window); | ||
360 | EAPI void *ecore_imf_context_client_window_get(Ecore_IMF_Context *ctx); | ||
361 | EAPI void ecore_imf_context_client_canvas_set(Ecore_IMF_Context *ctx, void *canvas); | ||
362 | EAPI void *ecore_imf_context_client_canvas_get(Ecore_IMF_Context *ctx); | ||
363 | EAPI void ecore_imf_context_show(Ecore_IMF_Context *ctx); | ||
364 | EAPI void ecore_imf_context_hide(Ecore_IMF_Context *ctx); | ||
365 | EAPI void ecore_imf_context_preedit_string_get(Ecore_IMF_Context *ctx, char **str, int *cursor_pos); | ||
366 | EAPI void ecore_imf_context_preedit_string_with_attributes_get(Ecore_IMF_Context *ctx, char **str, Eina_List **attrs, int *cursor_pos); | ||
367 | EAPI void ecore_imf_context_focus_in(Ecore_IMF_Context *ctx); | ||
368 | EAPI void ecore_imf_context_focus_out(Ecore_IMF_Context *ctx); | ||
369 | EAPI void ecore_imf_context_reset(Ecore_IMF_Context *ctx); | ||
370 | EAPI void ecore_imf_context_cursor_position_set(Ecore_IMF_Context *ctx, int cursor_pos); | ||
371 | EAPI void ecore_imf_context_cursor_location_set(Ecore_IMF_Context *ctx, int x, int y, int w, int h); | ||
372 | EAPI void ecore_imf_context_use_preedit_set(Ecore_IMF_Context *ctx, Eina_Bool use_preedit); | ||
373 | EAPI 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); | ||
374 | EAPI void ecore_imf_context_input_mode_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Mode input_mode); | ||
375 | EAPI Ecore_IMF_Input_Mode ecore_imf_context_input_mode_get(Ecore_IMF_Context *ctx); | ||
376 | EAPI 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 */ | ||
379 | EAPI Ecore_IMF_Context *ecore_imf_context_new(const Ecore_IMF_Context_Class *ctxc); | ||
380 | EAPI void ecore_imf_context_data_set(Ecore_IMF_Context *ctx, void *data); | ||
381 | EAPI void *ecore_imf_context_data_get(Ecore_IMF_Context *ctx); | ||
382 | EAPI Eina_Bool ecore_imf_context_surrounding_get(Ecore_IMF_Context *ctx, char **text, int *cursor_pos); | ||
383 | EAPI void ecore_imf_context_preedit_start_event_add(Ecore_IMF_Context *ctx); | ||
384 | EAPI void ecore_imf_context_preedit_end_event_add(Ecore_IMF_Context *ctx); | ||
385 | EAPI void ecore_imf_context_preedit_changed_event_add(Ecore_IMF_Context *ctx); | ||
386 | EAPI void ecore_imf_context_commit_event_add(Ecore_IMF_Context *ctx, const char *str); | ||
387 | EAPI void ecore_imf_context_delete_surrounding_event_add(Ecore_IMF_Context *ctx, int offset, int n_chars); | ||
388 | EAPI void ecore_imf_context_prediction_allow_set(Ecore_IMF_Context *ctx, Eina_Bool prediction); | ||
389 | EAPI Eina_Bool ecore_imf_context_prediction_allow_get(Ecore_IMF_Context *ctx); | ||
390 | EAPI void ecore_imf_context_autocapital_type_set(Ecore_IMF_Context *ctx, Ecore_IMF_Autocapital_Type autocapital_type); | ||
391 | EAPI Ecore_IMF_Autocapital_Type ecore_imf_context_autocapital_type_get(Ecore_IMF_Context *ctx); | ||
392 | |||
393 | EAPI void ecore_imf_context_control_panel_show(Ecore_IMF_Context *ctx); | ||
394 | EAPI void ecore_imf_context_control_panel_hide(Ecore_IMF_Context *ctx); | ||
395 | |||
396 | EAPI void ecore_imf_context_input_panel_show(Ecore_IMF_Context *ctx); | ||
397 | EAPI void ecore_imf_context_input_panel_hide(Ecore_IMF_Context *ctx); | ||
398 | EAPI void ecore_imf_context_input_panel_layout_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Layout layout); | ||
399 | EAPI Ecore_IMF_Input_Panel_Layout ecore_imf_context_input_panel_layout_get(Ecore_IMF_Context *ctx); | ||
400 | EAPI void ecore_imf_context_input_panel_language_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Lang lang); | ||
401 | EAPI Ecore_IMF_Input_Panel_Lang ecore_imf_context_input_panel_language_get(Ecore_IMF_Context *ctx); | ||
402 | EAPI void ecore_imf_context_input_panel_enabled_set(Ecore_IMF_Context *ctx, Eina_Bool enable); | ||
403 | EAPI 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 @@ | |||
1 | MAINTAINERCLEANFILES = Makefile.in | ||
2 | |||
3 | AM_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 | |||
10 | AM_CFLAGS = @WIN32_CFLAGS@ | ||
11 | |||
12 | lib_LTLIBRARIES = libecore_imf.la | ||
13 | includes_HEADERS = Ecore_IMF.h | ||
14 | includesdir = $(includedir)/ecore-@VMAJ@ | ||
15 | |||
16 | libecore_imf_la_SOURCES = \ | ||
17 | ecore_imf.c \ | ||
18 | ecore_imf_context.c \ | ||
19 | ecore_imf_module.c | ||
20 | |||
21 | libecore_imf_la_LIBADD = \ | ||
22 | $(top_builddir)/src/lib/ecore/libecore.la \ | ||
23 | @EINA_LIBS@ \ | ||
24 | @EVIL_LIBS@ | ||
25 | |||
26 | libecore_imf_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info @version_info@ @release_info@ | ||
27 | |||
28 | EXTRA_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 | |||
19 | VPATH = @srcdir@ | ||
20 | pkgdatadir = $(datadir)/@PACKAGE@ | ||
21 | pkgincludedir = $(includedir)/@PACKAGE@ | ||
22 | pkglibdir = $(libdir)/@PACKAGE@ | ||
23 | pkglibexecdir = $(libexecdir)/@PACKAGE@ | ||
24 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd | ||
25 | install_sh_DATA = $(install_sh) -c -m 644 | ||
26 | install_sh_PROGRAM = $(install_sh) -c | ||
27 | install_sh_SCRIPT = $(install_sh) -c | ||
28 | INSTALL_HEADER = $(INSTALL_DATA) | ||
29 | transform = $(program_transform_name) | ||
30 | NORMAL_INSTALL = : | ||
31 | PRE_INSTALL = : | ||
32 | POST_INSTALL = : | ||
33 | NORMAL_UNINSTALL = : | ||
34 | PRE_UNINSTALL = : | ||
35 | POST_UNINSTALL = : | ||
36 | build_triplet = @build@ | ||
37 | host_triplet = @host@ | ||
38 | subdir = src/lib/ecore_imf | ||
39 | DIST_COMMON = $(includes_HEADERS) $(srcdir)/Makefile.am \ | ||
40 | $(srcdir)/Makefile.in | ||
41 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 | ||
42 | am__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 | ||
60 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ | ||
61 | $(ACLOCAL_M4) | ||
62 | mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs | ||
63 | CONFIG_HEADER = $(top_builddir)/config.h | ||
64 | CONFIG_CLEAN_FILES = | ||
65 | CONFIG_CLEAN_VPATH_FILES = | ||
66 | am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; | ||
67 | am__vpath_adj = case $$p in \ | ||
68 | $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ | ||
69 | *) f=$$p;; \ | ||
70 | esac; | ||
71 | am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; | ||
72 | am__install_max = 40 | ||
73 | am__nobase_strip_setup = \ | ||
74 | srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` | ||
75 | am__nobase_strip = \ | ||
76 | for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" | ||
77 | am__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] }' | ||
84 | am__base_list = \ | ||
85 | sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ | ||
86 | sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | ||
87 | am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includesdir)" | ||
88 | LTLIBRARIES = $(lib_LTLIBRARIES) | ||
89 | libecore_imf_la_DEPENDENCIES = \ | ||
90 | $(top_builddir)/src/lib/ecore/libecore.la | ||
91 | am_libecore_imf_la_OBJECTS = ecore_imf.lo ecore_imf_context.lo \ | ||
92 | ecore_imf_module.lo | ||
93 | libecore_imf_la_OBJECTS = $(am_libecore_imf_la_OBJECTS) | ||
94 | AM_V_lt = $(am__v_lt_$(V)) | ||
95 | am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) | ||
96 | am__v_lt_0 = --silent | ||
97 | libecore_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 $@ | ||
101 | DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) | ||
102 | depcomp = $(SHELL) $(top_srcdir)/depcomp | ||
103 | am__depfiles_maybe = depfiles | ||
104 | am__mv = mv -f | ||
105 | COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ | ||
106 | $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) | ||
107 | LTCOMPILE = $(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) | ||
111 | AM_V_CC = $(am__v_CC_$(V)) | ||
112 | am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) | ||
113 | am__v_CC_0 = @echo " CC " $@; | ||
114 | AM_V_at = $(am__v_at_$(V)) | ||
115 | am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) | ||
116 | am__v_at_0 = @ | ||
117 | CCLD = $(CC) | ||
118 | LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ | ||
119 | $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ | ||
120 | $(AM_LDFLAGS) $(LDFLAGS) -o $@ | ||
121 | AM_V_CCLD = $(am__v_CCLD_$(V)) | ||
122 | am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) | ||
123 | am__v_CCLD_0 = @echo " CCLD " $@; | ||
124 | AM_V_GEN = $(am__v_GEN_$(V)) | ||
125 | am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) | ||
126 | am__v_GEN_0 = @echo " GEN " $@; | ||
127 | SOURCES = $(libecore_imf_la_SOURCES) | ||
128 | DIST_SOURCES = $(libecore_imf_la_SOURCES) | ||
129 | HEADERS = $(includes_HEADERS) | ||
130 | ETAGS = etags | ||
131 | CTAGS = ctags | ||
132 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) | ||
133 | ACLOCAL = @ACLOCAL@ | ||
134 | ALLOCA = @ALLOCA@ | ||
135 | AMTAR = @AMTAR@ | ||
136 | AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ | ||
137 | AR = @AR@ | ||
138 | AS = @AS@ | ||
139 | AUTOCONF = @AUTOCONF@ | ||
140 | AUTOHEADER = @AUTOHEADER@ | ||
141 | AUTOMAKE = @AUTOMAKE@ | ||
142 | AWK = @AWK@ | ||
143 | CARES_CFLAGS = @CARES_CFLAGS@ | ||
144 | CARES_LIBS = @CARES_LIBS@ | ||
145 | CC = @CC@ | ||
146 | CCDEPMODE = @CCDEPMODE@ | ||
147 | CFLAGS = @CFLAGS@ | ||
148 | CHECK_CFLAGS = @CHECK_CFLAGS@ | ||
149 | CHECK_LIBS = @CHECK_LIBS@ | ||
150 | CPP = @CPP@ | ||
151 | CPPFLAGS = @CPPFLAGS@ | ||
152 | CURL_CFLAGS = @CURL_CFLAGS@ | ||
153 | CURL_LIBS = @CURL_LIBS@ | ||
154 | CXX = @CXX@ | ||
155 | CXXCPP = @CXXCPP@ | ||
156 | CXXDEPMODE = @CXXDEPMODE@ | ||
157 | CXXFLAGS = @CXXFLAGS@ | ||
158 | CYGPATH_W = @CYGPATH_W@ | ||
159 | DEFS = @DEFS@ | ||
160 | DEPDIR = @DEPDIR@ | ||
161 | DIRECTFB_CFLAGS = @DIRECTFB_CFLAGS@ | ||
162 | DIRECTFB_LIBS = @DIRECTFB_LIBS@ | ||
163 | DLLTOOL = @DLLTOOL@ | ||
164 | DSYMUTIL = @DSYMUTIL@ | ||
165 | DUMPBIN = @DUMPBIN@ | ||
166 | ECHO_C = @ECHO_C@ | ||
167 | ECHO_N = @ECHO_N@ | ||
168 | ECHO_T = @ECHO_T@ | ||
169 | ECORE_XCB_CFLAGS = @ECORE_XCB_CFLAGS@ | ||
170 | ECORE_XCB_LIBS = @ECORE_XCB_LIBS@ | ||
171 | EFL_ECORE_BUILD = @EFL_ECORE_BUILD@ | ||
172 | EFL_ECORE_CON_BUILD = @EFL_ECORE_CON_BUILD@ | ||
173 | EFL_ECORE_EVAS_BUILD = @EFL_ECORE_EVAS_BUILD@ | ||
174 | EFL_ECORE_FILE_BUILD = @EFL_ECORE_FILE_BUILD@ | ||
175 | EFL_ECORE_IMF_BUILD = @EFL_ECORE_IMF_BUILD@ | ||
176 | EFL_ECORE_IMF_EVAS_BUILD = @EFL_ECORE_IMF_EVAS_BUILD@ | ||
177 | EFL_ECORE_INPUT_BUILD = @EFL_ECORE_INPUT_BUILD@ | ||
178 | EFL_ECORE_INPUT_EVAS_BUILD = @EFL_ECORE_INPUT_EVAS_BUILD@ | ||
179 | EFL_ECORE_IPC_BUILD = @EFL_ECORE_IPC_BUILD@ | ||
180 | EFL_ECORE_PSL1GHT_BUILD = @EFL_ECORE_PSL1GHT_BUILD@ | ||
181 | EFL_ECORE_SDL_BUILD = @EFL_ECORE_SDL_BUILD@ | ||
182 | EFL_ECORE_WIN32_BUILD = @EFL_ECORE_WIN32_BUILD@ | ||
183 | EFL_ECORE_WINCE_BUILD = @EFL_ECORE_WINCE_BUILD@ | ||
184 | EFL_PTHREAD_CFLAGS = @EFL_PTHREAD_CFLAGS@ | ||
185 | EFL_PTHREAD_LIBS = @EFL_PTHREAD_LIBS@ | ||
186 | EGREP = @EGREP@ | ||
187 | EINA_CFLAGS = @EINA_CFLAGS@ | ||
188 | EINA_LIBS = @EINA_LIBS@ | ||
189 | ESCAPE_CFLAGS = @ESCAPE_CFLAGS@ | ||
190 | ESCAPE_LIBS = @ESCAPE_LIBS@ | ||
191 | EVAS_CFLAGS = @EVAS_CFLAGS@ | ||
192 | EVAS_LIBS = @EVAS_LIBS@ | ||
193 | EVIL_CFLAGS = @EVIL_CFLAGS@ | ||
194 | EVIL_LIBS = @EVIL_LIBS@ | ||
195 | EXEEXT = @EXEEXT@ | ||
196 | FGREP = @FGREP@ | ||
197 | GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ | ||
198 | GLIB_CFLAGS = @GLIB_CFLAGS@ | ||
199 | GLIB_LIBS = @GLIB_LIBS@ | ||
200 | GMSGFMT = @GMSGFMT@ | ||
201 | GMSGFMT_015 = @GMSGFMT_015@ | ||
202 | GREP = @GREP@ | ||
203 | INSTALL = @INSTALL@ | ||
204 | INSTALL_DATA = @INSTALL_DATA@ | ||
205 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | ||
206 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ | ||
207 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ | ||
208 | INTLLIBS = @INTLLIBS@ | ||
209 | INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ | ||
210 | KEYSYMDEFS = @KEYSYMDEFS@ | ||
211 | LD = @LD@ | ||
212 | LDFLAGS = @LDFLAGS@ | ||
213 | LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ | ||
214 | LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ | ||
215 | LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ | ||
216 | LIBICONV = @LIBICONV@ | ||
217 | LIBINTL = @LIBINTL@ | ||
218 | LIBOBJS = @LIBOBJS@ | ||
219 | LIBS = @LIBS@ | ||
220 | LIBTOOL = @LIBTOOL@ | ||
221 | LIPO = @LIPO@ | ||
222 | LN_S = @LN_S@ | ||
223 | LTLIBICONV = @LTLIBICONV@ | ||
224 | LTLIBINTL = @LTLIBINTL@ | ||
225 | LTLIBOBJS = @LTLIBOBJS@ | ||
226 | MAKEINFO = @MAKEINFO@ | ||
227 | MKDIR_P = @MKDIR_P@ | ||
228 | MSGFMT = @MSGFMT@ | ||
229 | MSGFMT_015 = @MSGFMT_015@ | ||
230 | MSGMERGE = @MSGMERGE@ | ||
231 | NM = @NM@ | ||
232 | NMEDIT = @NMEDIT@ | ||
233 | OBJC = @OBJC@ | ||
234 | OBJCDEPMODE = @OBJCDEPMODE@ | ||
235 | OBJCFLAGS = @OBJCFLAGS@ | ||
236 | OBJDUMP = @OBJDUMP@ | ||
237 | OBJEXT = @OBJEXT@ | ||
238 | OTOOL = @OTOOL@ | ||
239 | OTOOL64 = @OTOOL64@ | ||
240 | PACKAGE = @PACKAGE@ | ||
241 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ | ||
242 | PACKAGE_NAME = @PACKAGE_NAME@ | ||
243 | PACKAGE_STRING = @PACKAGE_STRING@ | ||
244 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ | ||
245 | PACKAGE_URL = @PACKAGE_URL@ | ||
246 | PACKAGE_VERSION = @PACKAGE_VERSION@ | ||
247 | PATH_SEPARATOR = @PATH_SEPARATOR@ | ||
248 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | ||
249 | PIXMAN_LIBS = @PIXMAN_LIBS@ | ||
250 | PKG_CONFIG = @PKG_CONFIG@ | ||
251 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
252 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
253 | POSUB = @POSUB@ | ||
254 | RANLIB = @RANLIB@ | ||
255 | SDL_CFLAGS = @SDL_CFLAGS@ | ||
256 | SDL_CONFIG = @SDL_CONFIG@ | ||
257 | SDL_LIBS = @SDL_LIBS@ | ||
258 | SED = @SED@ | ||
259 | SET_MAKE = @SET_MAKE@ | ||
260 | SHELL = @SHELL@ | ||
261 | SSL_CFLAGS = @SSL_CFLAGS@ | ||
262 | SSL_LIBS = @SSL_LIBS@ | ||
263 | STRIP = @STRIP@ | ||
264 | TLS2_CFLAGS = @TLS2_CFLAGS@ | ||
265 | TLS2_LIBS = @TLS2_LIBS@ | ||
266 | TLS_CFLAGS = @TLS_CFLAGS@ | ||
267 | TLS_LIBS = @TLS_LIBS@ | ||
268 | TSLIB_CFLAGS = @TSLIB_CFLAGS@ | ||
269 | TSLIB_LIBS = @TSLIB_LIBS@ | ||
270 | USE_NLS = @USE_NLS@ | ||
271 | VERSION = @VERSION@ | ||
272 | VMAJ = @VMAJ@ | ||
273 | WIN32_CFLAGS = @WIN32_CFLAGS@ | ||
274 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | ||
275 | WIN32_LIBS = @WIN32_LIBS@ | ||
276 | XCB_COMPOSITE_CFLAGS = @XCB_COMPOSITE_CFLAGS@ | ||
277 | XCB_COMPOSITE_LIBS = @XCB_COMPOSITE_LIBS@ | ||
278 | XCB_CURSOR_CFLAGS = @XCB_CURSOR_CFLAGS@ | ||
279 | XCB_CURSOR_LIBS = @XCB_CURSOR_LIBS@ | ||
280 | XCB_DAMAGE_CFLAGS = @XCB_DAMAGE_CFLAGS@ | ||
281 | XCB_DAMAGE_LIBS = @XCB_DAMAGE_LIBS@ | ||
282 | XCB_DPMS_CFLAGS = @XCB_DPMS_CFLAGS@ | ||
283 | XCB_DPMS_LIBS = @XCB_DPMS_LIBS@ | ||
284 | XCB_RANDR_CFLAGS = @XCB_RANDR_CFLAGS@ | ||
285 | XCB_RANDR_LIBS = @XCB_RANDR_LIBS@ | ||
286 | XCB_RENDER_CFLAGS = @XCB_RENDER_CFLAGS@ | ||
287 | XCB_RENDER_LIBS = @XCB_RENDER_LIBS@ | ||
288 | XCB_SCREENSAVER_CFLAGS = @XCB_SCREENSAVER_CFLAGS@ | ||
289 | XCB_SCREENSAVER_LIBS = @XCB_SCREENSAVER_LIBS@ | ||
290 | XCB_SHAPE_CFLAGS = @XCB_SHAPE_CFLAGS@ | ||
291 | XCB_SHAPE_LIBS = @XCB_SHAPE_LIBS@ | ||
292 | XCB_SYNC_CFLAGS = @XCB_SYNC_CFLAGS@ | ||
293 | XCB_SYNC_LIBS = @XCB_SYNC_LIBS@ | ||
294 | XCB_X11_CFLAGS = @XCB_X11_CFLAGS@ | ||
295 | XCB_X11_LIBS = @XCB_X11_LIBS@ | ||
296 | XCB_XFIXES_CFLAGS = @XCB_XFIXES_CFLAGS@ | ||
297 | XCB_XFIXES_LIBS = @XCB_XFIXES_LIBS@ | ||
298 | XCB_XGESTURE_CFLAGS = @XCB_XGESTURE_CFLAGS@ | ||
299 | XCB_XGESTURE_LIBS = @XCB_XGESTURE_LIBS@ | ||
300 | XCB_XINERAMA_CFLAGS = @XCB_XINERAMA_CFLAGS@ | ||
301 | XCB_XINERAMA_LIBS = @XCB_XINERAMA_LIBS@ | ||
302 | XCB_XINPUT_CFLAGS = @XCB_XINPUT_CFLAGS@ | ||
303 | XCB_XINPUT_LIBS = @XCB_XINPUT_LIBS@ | ||
304 | XCB_XPRINT_CFLAGS = @XCB_XPRINT_CFLAGS@ | ||
305 | XCB_XPRINT_LIBS = @XCB_XPRINT_LIBS@ | ||
306 | XCB_XTEST_CFLAGS = @XCB_XTEST_CFLAGS@ | ||
307 | XCB_XTEST_LIBS = @XCB_XTEST_LIBS@ | ||
308 | XCOMPOSITE_CFLAGS = @XCOMPOSITE_CFLAGS@ | ||
309 | XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@ | ||
310 | XDAMAGE_CFLAGS = @XDAMAGE_CFLAGS@ | ||
311 | XDAMAGE_LIBS = @XDAMAGE_LIBS@ | ||
312 | XDPMS_CFLAGS = @XDPMS_CFLAGS@ | ||
313 | XDPMS_LIBS = @XDPMS_LIBS@ | ||
314 | XFIXES_CFLAGS = @XFIXES_CFLAGS@ | ||
315 | XFIXES_LIBS = @XFIXES_LIBS@ | ||
316 | XGESTURE_CFLAGS = @XGESTURE_CFLAGS@ | ||
317 | XGESTURE_LIBS = @XGESTURE_LIBS@ | ||
318 | XGETTEXT = @XGETTEXT@ | ||
319 | XGETTEXT_015 = @XGETTEXT_015@ | ||
320 | XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ | ||
321 | XI2_CFLAGS = @XI2_CFLAGS@ | ||
322 | XI2_LIBS = @XI2_LIBS@ | ||
323 | XINERAMA_CFLAGS = @XINERAMA_CFLAGS@ | ||
324 | XINERAMA_LIBS = @XINERAMA_LIBS@ | ||
325 | XKB_CFLAGS = @XKB_CFLAGS@ | ||
326 | XKB_LIBS = @XKB_LIBS@ | ||
327 | XMKMF = @XMKMF@ | ||
328 | XPRINT_CFLAGS = @XPRINT_CFLAGS@ | ||
329 | XPRINT_LIBS = @XPRINT_LIBS@ | ||
330 | XRANDR_CFLAGS = @XRANDR_CFLAGS@ | ||
331 | XRANDR_LIBS = @XRANDR_LIBS@ | ||
332 | XRENDER_CFLAGS = @XRENDER_CFLAGS@ | ||
333 | XRENDER_LIBS = @XRENDER_LIBS@ | ||
334 | XSS_CFLAGS = @XSS_CFLAGS@ | ||
335 | XSS_LIBS = @XSS_LIBS@ | ||
336 | XTEST_CFLAGS = @XTEST_CFLAGS@ | ||
337 | XTEST_LIBS = @XTEST_LIBS@ | ||
338 | X_CFLAGS = @X_CFLAGS@ | ||
339 | X_EXTRA_LIBS = @X_EXTRA_LIBS@ | ||
340 | X_LIBS = @X_LIBS@ | ||
341 | X_PRE_LIBS = @X_PRE_LIBS@ | ||
342 | Xcursor_cflags = @Xcursor_cflags@ | ||
343 | Xcursor_libs = @Xcursor_libs@ | ||
344 | abs_builddir = @abs_builddir@ | ||
345 | abs_srcdir = @abs_srcdir@ | ||
346 | abs_top_builddir = @abs_top_builddir@ | ||
347 | abs_top_srcdir = @abs_top_srcdir@ | ||
348 | ac_ct_CC = @ac_ct_CC@ | ||
349 | ac_ct_CXX = @ac_ct_CXX@ | ||
350 | ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ | ||
351 | ac_ct_OBJC = @ac_ct_OBJC@ | ||
352 | am__include = @am__include@ | ||
353 | am__leading_dot = @am__leading_dot@ | ||
354 | am__quote = @am__quote@ | ||
355 | am__tar = @am__tar@ | ||
356 | am__untar = @am__untar@ | ||
357 | bindir = @bindir@ | ||
358 | build = @build@ | ||
359 | build_alias = @build_alias@ | ||
360 | build_cpu = @build_cpu@ | ||
361 | build_os = @build_os@ | ||
362 | build_vendor = @build_vendor@ | ||
363 | builddir = @builddir@ | ||
364 | cocoa_ldflags = @cocoa_ldflags@ | ||
365 | datadir = @datadir@ | ||
366 | datarootdir = @datarootdir@ | ||
367 | dlopen_libs = @dlopen_libs@ | ||
368 | docdir = @docdir@ | ||
369 | dvidir = @dvidir@ | ||
370 | ecore_cocoa_cflags = @ecore_cocoa_cflags@ | ||
371 | ecore_cocoa_libs = @ecore_cocoa_libs@ | ||
372 | ecore_con_cflags = @ecore_con_cflags@ | ||
373 | ecore_con_libs = @ecore_con_libs@ | ||
374 | ecore_directfb_cflags = @ecore_directfb_cflags@ | ||
375 | ecore_directfb_libs = @ecore_directfb_libs@ | ||
376 | ecore_evas_cflags = @ecore_evas_cflags@ | ||
377 | ecore_evas_libs = @ecore_evas_libs@ | ||
378 | ecore_fb_cflags = @ecore_fb_cflags@ | ||
379 | ecore_fb_libs = @ecore_fb_libs@ | ||
380 | ecore_file_cflags = @ecore_file_cflags@ | ||
381 | ecore_file_libs = @ecore_file_libs@ | ||
382 | ecore_imf_cflags = @ecore_imf_cflags@ | ||
383 | ecore_imf_evas_cflags = @ecore_imf_evas_cflags@ | ||
384 | ecore_imf_evas_libs = @ecore_imf_evas_libs@ | ||
385 | ecore_imf_libs = @ecore_imf_libs@ | ||
386 | ecore_imf_xim_cflags = @ecore_imf_xim_cflags@ | ||
387 | ecore_imf_xim_libs = @ecore_imf_xim_libs@ | ||
388 | ecore_input_cflags = @ecore_input_cflags@ | ||
389 | ecore_input_evas_cflags = @ecore_input_evas_cflags@ | ||
390 | ecore_input_evas_libs = @ecore_input_evas_libs@ | ||
391 | ecore_input_libs = @ecore_input_libs@ | ||
392 | ecore_ipc_cflags = @ecore_ipc_cflags@ | ||
393 | ecore_ipc_libs = @ecore_ipc_libs@ | ||
394 | ecore_psl1ght_cflags = @ecore_psl1ght_cflags@ | ||
395 | ecore_psl1ght_libs = @ecore_psl1ght_libs@ | ||
396 | ecore_sdl_cflags = @ecore_sdl_cflags@ | ||
397 | ecore_sdl_libs = @ecore_sdl_libs@ | ||
398 | ecore_win32_cflags = @ecore_win32_cflags@ | ||
399 | ecore_win32_libs = @ecore_win32_libs@ | ||
400 | ecore_wince_cflags = @ecore_wince_cflags@ | ||
401 | ecore_wince_libs = @ecore_wince_libs@ | ||
402 | ecore_x_cflags = @ecore_x_cflags@ | ||
403 | ecore_x_libs = @ecore_x_libs@ | ||
404 | ecore_x_libs_private = @ecore_x_libs_private@ | ||
405 | efl_doxygen = @efl_doxygen@ | ||
406 | efl_have_doxygen = @efl_have_doxygen@ | ||
407 | exec_prefix = @exec_prefix@ | ||
408 | have_ecore_x_xcb_define = @have_ecore_x_xcb_define@ | ||
409 | host = @host@ | ||
410 | host_alias = @host_alias@ | ||
411 | host_cpu = @host_cpu@ | ||
412 | host_os = @host_os@ | ||
413 | host_vendor = @host_vendor@ | ||
414 | htmldir = @htmldir@ | ||
415 | includedir = @includedir@ | ||
416 | infodir = @infodir@ | ||
417 | install_sh = @install_sh@ | ||
418 | libdir = @libdir@ | ||
419 | libexecdir = @libexecdir@ | ||
420 | localedir = @localedir@ | ||
421 | localstatedir = @localstatedir@ | ||
422 | lt_ECHO = @lt_ECHO@ | ||
423 | lt_enable_auto_import = @lt_enable_auto_import@ | ||
424 | mandir = @mandir@ | ||
425 | mkdir_p = @mkdir_p@ | ||
426 | oldincludedir = @oldincludedir@ | ||
427 | pdfdir = @pdfdir@ | ||
428 | pkgconfig_requires_private = @pkgconfig_requires_private@ | ||
429 | prefix = @prefix@ | ||
430 | program_transform_name = @program_transform_name@ | ||
431 | psdir = @psdir@ | ||
432 | release_info = @release_info@ | ||
433 | requirements_ecore = @requirements_ecore@ | ||
434 | requirements_ecore_cocoa = @requirements_ecore_cocoa@ | ||
435 | requirements_ecore_con = @requirements_ecore_con@ | ||
436 | requirements_ecore_directfb = @requirements_ecore_directfb@ | ||
437 | requirements_ecore_evas = @requirements_ecore_evas@ | ||
438 | requirements_ecore_fb = @requirements_ecore_fb@ | ||
439 | requirements_ecore_file = @requirements_ecore_file@ | ||
440 | requirements_ecore_imf = @requirements_ecore_imf@ | ||
441 | requirements_ecore_imf_evas = @requirements_ecore_imf_evas@ | ||
442 | requirements_ecore_imf_xim = @requirements_ecore_imf_xim@ | ||
443 | requirements_ecore_input = @requirements_ecore_input@ | ||
444 | requirements_ecore_input_evas = @requirements_ecore_input_evas@ | ||
445 | requirements_ecore_ipc = @requirements_ecore_ipc@ | ||
446 | requirements_ecore_psl1ght = @requirements_ecore_psl1ght@ | ||
447 | requirements_ecore_sdl = @requirements_ecore_sdl@ | ||
448 | requirements_ecore_win32 = @requirements_ecore_win32@ | ||
449 | requirements_ecore_wince = @requirements_ecore_wince@ | ||
450 | requirements_ecore_x = @requirements_ecore_x@ | ||
451 | rt_libs = @rt_libs@ | ||
452 | sbindir = @sbindir@ | ||
453 | sharedstatedir = @sharedstatedir@ | ||
454 | srcdir = @srcdir@ | ||
455 | sysconfdir = @sysconfdir@ | ||
456 | target_alias = @target_alias@ | ||
457 | top_build_prefix = @top_build_prefix@ | ||
458 | top_builddir = @top_builddir@ | ||
459 | top_srcdir = @top_srcdir@ | ||
460 | version_info = @version_info@ | ||
461 | x_cflags = @x_cflags@ | ||
462 | x_includes = @x_includes@ | ||
463 | x_libs = @x_libs@ | ||
464 | MAINTAINERCLEANFILES = Makefile.in | ||
465 | AM_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 | |||
472 | AM_CFLAGS = @WIN32_CFLAGS@ | ||
473 | lib_LTLIBRARIES = libecore_imf.la | ||
474 | includes_HEADERS = Ecore_IMF.h | ||
475 | includesdir = $(includedir)/ecore-@VMAJ@ | ||
476 | libecore_imf_la_SOURCES = \ | ||
477 | ecore_imf.c \ | ||
478 | ecore_imf_context.c \ | ||
479 | ecore_imf_module.c | ||
480 | |||
481 | libecore_imf_la_LIBADD = \ | ||
482 | $(top_builddir)/src/lib/ecore/libecore.la \ | ||
483 | @EINA_LIBS@ \ | ||
484 | @EVIL_LIBS@ | ||
485 | |||
486 | libecore_imf_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info @version_info@ @release_info@ | ||
487 | EXTRA_DIST = ecore_imf_private.h | ||
488 | all: 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 | ||
505 | Makefile: $(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): | ||
522 | install-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 | |||
536 | uninstall-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 | |||
545 | clean-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 | ||
553 | libecore_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 | |||
556 | mostlyclean-compile: | ||
557 | -rm -f *.$(OBJEXT) | ||
558 | |||
559 | distclean-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 | |||
590 | mostlyclean-libtool: | ||
591 | -rm -f *.lo | ||
592 | |||
593 | clean-libtool: | ||
594 | -rm -rf .libs _libs | ||
595 | install-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 | |||
608 | uninstall-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 | |||
616 | ID: $(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 | ||
624 | tags: TAGS | ||
625 | |||
626 | TAGS: $(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 | ||
647 | ctags: CTAGS | ||
648 | CTAGS: $(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 | |||
660 | GTAGS: | ||
661 | here=`$(am__cd) $(top_builddir) && pwd` \ | ||
662 | && $(am__cd) $(top_srcdir) \ | ||
663 | && gtags -i $(GTAGS_ARGS) "$$here" | ||
664 | |||
665 | distclean-tags: | ||
666 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags | ||
667 | |||
668 | distdir: $(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 | ||
698 | check-am: all-am | ||
699 | check: check-am | ||
700 | all-am: Makefile $(LTLIBRARIES) $(HEADERS) | ||
701 | installdirs: | ||
702 | for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includesdir)"; do \ | ||
703 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \ | ||
704 | done | ||
705 | install: install-am | ||
706 | install-exec: install-exec-am | ||
707 | install-data: install-data-am | ||
708 | uninstall: uninstall-am | ||
709 | |||
710 | install-am: all-am | ||
711 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am | ||
712 | |||
713 | installcheck: installcheck-am | ||
714 | install-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 | ||
719 | mostlyclean-generic: | ||
720 | |||
721 | clean-generic: | ||
722 | |||
723 | distclean-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 | |||
727 | maintainer-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) | ||
731 | clean: clean-am | ||
732 | |||
733 | clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ | ||
734 | mostlyclean-am | ||
735 | |||
736 | distclean: distclean-am | ||
737 | -rm -rf ./$(DEPDIR) | ||
738 | -rm -f Makefile | ||
739 | distclean-am: clean-am distclean-compile distclean-generic \ | ||
740 | distclean-tags | ||
741 | |||
742 | dvi: dvi-am | ||
743 | |||
744 | dvi-am: | ||
745 | |||
746 | html: html-am | ||
747 | |||
748 | html-am: | ||
749 | |||
750 | info: info-am | ||
751 | |||
752 | info-am: | ||
753 | |||
754 | install-data-am: install-includesHEADERS | ||
755 | |||
756 | install-dvi: install-dvi-am | ||
757 | |||
758 | install-dvi-am: | ||
759 | |||
760 | install-exec-am: install-libLTLIBRARIES | ||
761 | |||
762 | install-html: install-html-am | ||
763 | |||
764 | install-html-am: | ||
765 | |||
766 | install-info: install-info-am | ||
767 | |||
768 | install-info-am: | ||
769 | |||
770 | install-man: | ||
771 | |||
772 | install-pdf: install-pdf-am | ||
773 | |||
774 | install-pdf-am: | ||
775 | |||
776 | install-ps: install-ps-am | ||
777 | |||
778 | install-ps-am: | ||
779 | |||
780 | installcheck-am: | ||
781 | |||
782 | maintainer-clean: maintainer-clean-am | ||
783 | -rm -rf ./$(DEPDIR) | ||
784 | -rm -f Makefile | ||
785 | maintainer-clean-am: distclean-am maintainer-clean-generic | ||
786 | |||
787 | mostlyclean: mostlyclean-am | ||
788 | |||
789 | mostlyclean-am: mostlyclean-compile mostlyclean-generic \ | ||
790 | mostlyclean-libtool | ||
791 | |||
792 | pdf: pdf-am | ||
793 | |||
794 | pdf-am: | ||
795 | |||
796 | ps: ps-am | ||
797 | |||
798 | ps-am: | ||
799 | |||
800 | uninstall-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 | |||
11 | EAPI int ECORE_IMF_EVENT_PREEDIT_START = 0; | ||
12 | EAPI int ECORE_IMF_EVENT_PREEDIT_END = 0; | ||
13 | EAPI int ECORE_IMF_EVENT_PREEDIT_CHANGED = 0; | ||
14 | EAPI int ECORE_IMF_EVENT_COMMIT = 0; | ||
15 | EAPI int ECORE_IMF_EVENT_DELETE_SURROUNDING = 0; | ||
16 | |||
17 | int _ecore_imf_log_dom = -1; | ||
18 | static 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 | */ | ||
33 | EAPI int | ||
34 | ecore_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 | */ | ||
64 | EAPI int | ||
65 | ecore_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 | */ | ||
31 | EAPI Eina_List * | ||
32 | ecore_imf_context_available_ids_get(void) | ||
33 | { | ||
34 | return ecore_imf_module_context_ids_get(); | ||
35 | } | ||
36 | |||
37 | EAPI Eina_List * | ||
38 | ecore_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 | */ | ||
51 | static 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 | */ | ||
75 | EAPI const char * | ||
76 | ecore_imf_context_default_id_get(void) | ||
77 | { | ||
78 | return ecore_imf_context_default_id_by_canvas_type_get(NULL); | ||
79 | } | ||
80 | |||
81 | EAPI const char * | ||
82 | ecore_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 | */ | ||
147 | EAPI const Ecore_IMF_Context_Info * | ||
148 | ecore_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 | */ | ||
166 | EAPI Ecore_IMF_Context * | ||
167 | ecore_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 | */ | ||
205 | EAPI const Ecore_IMF_Context_Info * | ||
206 | ecore_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 | */ | ||
223 | EAPI void | ||
224 | ecore_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 | */ | ||
248 | EAPI void | ||
249 | ecore_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 | */ | ||
271 | EAPI void * | ||
272 | ecore_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 | */ | ||
296 | EAPI void | ||
297 | ecore_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 | */ | ||
319 | EAPI void * | ||
320 | ecore_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 | */ | ||
337 | EAPI void | ||
338 | ecore_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 | */ | ||
355 | EAPI void | ||
356 | ecore_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 | */ | ||
378 | EAPI void | ||
379 | ecore_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 | */ | ||
409 | EAPI void | ||
410 | ecore_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 | */ | ||
435 | EAPI void | ||
436 | ecore_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 | */ | ||
454 | EAPI void | ||
455 | ecore_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 | */ | ||
474 | EAPI void | ||
475 | ecore_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 | */ | ||
494 | EAPI void | ||
495 | ecore_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 | */ | ||
518 | EAPI void | ||
519 | ecore_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 | */ | ||
540 | EAPI void | ||
541 | ecore_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 | */ | ||
561 | EAPI void | ||
562 | ecore_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 | */ | ||
585 | EAPI Eina_Bool | ||
586 | ecore_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 | */ | ||
606 | EAPI void | ||
607 | ecore_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 | */ | ||
629 | EAPI Ecore_IMF_Autocapital_Type | ||
630 | ecore_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 | */ | ||
653 | EAPI void | ||
654 | 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) | ||
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 | */ | ||
678 | EAPI void | ||
679 | ecore_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 | */ | ||
700 | EAPI Ecore_IMF_Input_Mode | ||
701 | ecore_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 | */ | ||
727 | EAPI Eina_Bool | ||
728 | ecore_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 | */ | ||
756 | EAPI Ecore_IMF_Context * | ||
757 | ecore_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 | */ | ||
784 | EAPI void | ||
785 | ecore_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 | */ | ||
805 | EAPI 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 | */ | ||
837 | EAPI Eina_Bool | ||
838 | ecore_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 | |||
861 | static 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 | */ | ||
875 | EAPI void | ||
876 | ecore_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 | */ | ||
901 | EAPI void | ||
902 | ecore_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 | */ | ||
925 | EAPI void | ||
926 | ecore_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 | |||
943 | static 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 | */ | ||
960 | EAPI void | ||
961 | ecore_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 | |||
980 | static 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 | */ | ||
998 | EAPI void | ||
999 | ecore_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 | */ | ||
1025 | EAPI void | ||
1026 | ecore_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 | */ | ||
1045 | EAPI void | ||
1046 | ecore_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 | */ | ||
1065 | EAPI void | ||
1066 | ecore_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 | */ | ||
1085 | EAPI void | ||
1086 | ecore_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 | */ | ||
1106 | EAPI void | ||
1107 | ecore_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 | */ | ||
1130 | EAPI Ecore_IMF_Input_Panel_Layout | ||
1131 | ecore_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 | */ | ||
1157 | EAPI void | ||
1158 | ecore_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 | */ | ||
1181 | EAPI Ecore_IMF_Input_Panel_Lang | ||
1182 | ecore_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 | */ | ||
1203 | EAPI void | ||
1204 | ecore_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 | */ | ||
1225 | EAPI Eina_Bool | ||
1226 | ecore_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 | |||
16 | static void _ecore_imf_module_free(Ecore_IMF_Module *module); | ||
17 | static int _ecore_imf_modules_exists(const char *ctx_id); | ||
18 | |||
19 | typedef struct _Ecore_IMF_Selector | ||
20 | { | ||
21 | const char *toselect; | ||
22 | void *selected; | ||
23 | } Ecore_IMF_Selector; | ||
24 | |||
25 | static Eina_Hash *modules = NULL; | ||
26 | static Eina_Array *module_list = NULL; | ||
27 | |||
28 | void | ||
29 | ecore_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 | |||
43 | void | ||
44 | ecore_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 | |||
59 | static 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 | |||
66 | Eina_List * | ||
67 | ecore_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 | |||
84 | Ecore_IMF_Module * | ||
85 | ecore_imf_module_get(const char *ctx_id) | ||
86 | { | ||
87 | if (!modules) return NULL; | ||
88 | return eina_hash_find(modules, ctx_id); | ||
89 | } | ||
90 | |||
91 | Ecore_IMF_Context * | ||
92 | ecore_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 | |||
113 | static 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 | |||
120 | Eina_List * | ||
121 | ecore_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 | |||
138 | static 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 | |||
150 | Eina_List * | ||
151 | ecore_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 | |||
174 | EAPI void | ||
175 | ecore_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 | |||
195 | static void | ||
196 | _ecore_imf_module_free(Ecore_IMF_Module *module) | ||
197 | { | ||
198 | if (module->exit) module->exit(); | ||
199 | free(module); | ||
200 | } | ||
201 | |||
202 | static 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 | |||
11 | extern 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 | |||
37 | typedef struct _Ecore_IMF_Module Ecore_IMF_Module; | ||
38 | |||
39 | struct _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 | |||
57 | struct _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 | |||
64 | void ecore_imf_module_init(void); | ||
65 | void ecore_imf_module_shutdown(void); | ||
66 | Eina_List *ecore_imf_module_available_get(void); | ||
67 | Ecore_IMF_Module *ecore_imf_module_get(const char *ctx_id); | ||
68 | Ecore_IMF_Context *ecore_imf_module_context_create(const char *ctx_id); | ||
69 | Eina_List *ecore_imf_module_context_ids_get(void); | ||
70 | Eina_List *ecore_imf_module_context_ids_by_canvas_type_get(const char *canvas_type); | ||
71 | |||
72 | #endif | ||