2 * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
4 #include <Elementary.h>
6 #include "elm_module_priv.h"
8 * @defgroup Entry Entry
11 * An entry is a convenience widget which shows
12 * a box that the user can enter text into. Unlike a
13 * @ref Scrolled_Entry widget, entries DO NOT scroll with user
14 * input. Entry widgets are capable of expanding past the
15 * boundaries of the window, thus resizing the window to its
18 * You can also insert "items" in the entry with:
20 * \<item size=16x16 vsize=full href=emoticon/haha\>\</item\>
22 * for example. sizing can be set bu size=WxH, relsize=WxH or absize=WxH with
23 * vsize=ascent or vsize=full. the href=NAME sets the item name. Entry
24 * supports a list of emoticon names by default. These are:
27 * - emoticon/angry-shout
28 * - emoticon/crazy-laugh
29 * - emoticon/evil-laugh
31 * - emoticon/goggle-smile
33 * - emoticon/grumpy-smile
35 * - emoticon/guilty-smile
37 * - emoticon/half-smile
38 * - emoticon/happy-panting
40 * - emoticon/indifferent
42 * - emoticon/knowing-grin
44 * - emoticon/little-bit-sorry
45 * - emoticon/love-lots
47 * - emoticon/minimal-smile
48 * - emoticon/not-happy
49 * - emoticon/not-impressed
51 * - emoticon/opensmile
54 * - emoticon/squint-laugh
55 * - emoticon/surprised
56 * - emoticon/suspicious
57 * - emoticon/tongue-dangling
58 * - emoticon/tongue-poke
61 * - emoticon/very-sorry
67 * These are built-in currently, but you can add your own item provieer that
68 * can create inlined objects in the text and fill the space allocated to the
69 * item with a custom object of your own.
71 * See the entry test for some more examples of use of this.
73 * Signals that you can add callbacks for are:
74 * - "changed" - The text within the entry was changed
75 * - "activated" - The entry has received focus and the cursor
76 * - "press" - The entry has been clicked
77 * - "longpressed" - The entry has been clicked for a couple seconds
78 * - "clicked" - The entry has been clicked
79 * - "clicked,double" - The entry has been double clicked
80 * - "focused" - The entry has received focus
81 * - "unfocused" - The entry has lost focus
82 * - "selection,paste" - A paste action has occurred
83 * - "selection,copy" - A copy action has occurred
84 * - "selection,cut" - A cut action has occurred
85 * - "selection,start" - A selection has begun
86 * - "selection,changed" - The selection has changed
87 * - "selection,cleared" - The selection has been cleared
88 * - "cursor,changed" - The cursor has changed
89 * - "anchor,clicked" - The anchor has been clicked
92 typedef struct _Mod_Api Mod_Api;
94 typedef struct _Widget_Data Widget_Data;
95 typedef struct _Elm_Entry_Item_Provider Elm_Entry_Item_Provider;
100 Evas_Object *popup;/*copy paste UI - elm_popup*/
101 Evas_Object *ctxpopup;/*copy paste UI - elm_ctxpopup*/
103 Evas_Object *hoversel;
104 Ecore_Job *deferred_recalc_job;
105 Ecore_Event_Handler *sel_notify_handler;
106 Ecore_Event_Handler *sel_clear_handler;
107 Ecore_Timer *longpress_timer;
108 /* Only for clipboard */
112 int ellipsis_threshold;
114 Evas_Coord downx, downy;
115 Evas_Coord cx, cy, cw, ch;
117 Eina_List *item_providers;
118 Ecore_Job *hovdeljob;
119 Mod_Api *api; // module api if supplied
121 Eina_Bool changed : 1;
122 Eina_Bool linewrap : 1;
123 Eina_Bool char_linewrap : 1;
124 Eina_Bool single_line : 1;
125 Eina_Bool password : 1;
126 Eina_Bool show_last_character : 1;
127 Eina_Bool editable : 1;
128 Eina_Bool selection_asked : 1;
129 Eina_Bool have_selection : 1;
130 Eina_Bool selmode : 1;
131 Eina_Bool deferred_cur : 1;
132 Eina_Bool disabled : 1;
133 Eina_Bool double_clicked : 1;
134 Eina_Bool context_menu : 1;
135 Eina_Bool drag_selection_asked : 1;
136 Eina_Bool bgcolor : 1;
137 Eina_Bool ellipsis : 1;
138 Eina_Bool autoreturnkey : 1;
139 Eina_Bool input_panel_enable : 1;
140 Eina_Bool autocapitalize : 1;
141 Elm_Input_Panel_Layout input_panel_layout;
142 Eina_Bool autoperiod : 1;
145 struct _Elm_Entry_Item_Provider
147 Evas_Object *(*func) (void *data, Evas_Object *entry, const char *item);
151 static const char *widtype = NULL;
153 static Eina_Bool _drag_drop_cb(void *data, Evas_Object *obj, Elm_Drop_Data *);
154 static void _del_hook(Evas_Object *obj);
155 static void _theme_hook(Evas_Object *obj);
156 static void _disable_hook(Evas_Object *obj);
157 static void _sizing_eval(Evas_Object *obj);
158 static void _on_focus_hook(void *data, Evas_Object *obj);
159 static void _resize(void *data, Evas *e, Evas_Object *obj, void *event_info);
160 static const char *_getbase(Evas_Object *obj);
161 static void _signal_entry_changed(void *data, Evas_Object *obj, const char *emission, const char *source);
162 static void _signal_selection_start(void *data, Evas_Object *obj, const char *emission, const char *source);
163 static void _signal_selection_changed(void *data, Evas_Object *obj, const char *emission, const char *source);
164 static void _signal_selection_cleared(void *data, Evas_Object *obj, const char *emission, const char *source);
165 static void _signal_entry_paste_request(void *data, Evas_Object *obj, const char *emission, const char *source);
166 static void _signal_entry_copy_notify(void *data, Evas_Object *obj, const char *emission, const char *source);
167 static void _signal_entry_cut_notify(void *data, Evas_Object *obj, const char *emission, const char *source);
168 static void _signal_cursor_changed(void *data, Evas_Object *obj, const char *emission, const char *source);
169 static int _get_value_in_key_string(const char *oldstring, char *key, char **value);
170 static int _strbuf_key_value_replace(Eina_Strbuf *srcbuf, char *key, const char *value, int deleteflag);
171 static int _stringshare_key_value_replace(const char **srcstring, char *key, const char *value, int deleteflag);
172 static int _is_width_over(Evas_Object *obj);
173 static void _ellipsis_entry_to_width(Evas_Object *obj);
174 static void _reverse_ellipsis_entry(Evas_Object *obj);
175 static int _textinput_control_function(void *data,void *input_data);
176 static int _entry_length_get(Evas_Object *obj);
178 static const char SIG_CHANGED[] = "changed";
179 static const char SIG_ACTIVATED[] = "activated";
180 static const char SIG_PRESS[] = "press";
181 static const char SIG_LONGPRESSED[] = "longpressed";
182 static const char SIG_CLICKED[] = "clicked";
183 static const char SIG_CLICKED_DOUBLE[] = "clicked,double";
184 static const char SIG_FOCUSED[] = "focused";
185 static const char SIG_UNFOCUSED[] = "unfocused";
186 static const char SIG_SELECTION_PASTE[] = "selection,paste";
187 static const char SIG_SELECTION_COPY[] = "selection,copy";
188 static const char SIG_SELECTION_CUT[] = "selection,cut";
189 static const char SIG_SELECTION_START[] = "selection,start";
190 static const char SIG_SELECTION_CHANGED[] = "selection,changed";
191 static const char SIG_SELECTION_CLEARED[] = "selection,cleared";
192 static const char SIG_CURSOR_CHANGED[] = "cursor,changed";
193 static const char SIG_ANCHOR_CLICKED[] = "anchor,clicked";
194 #ifdef HAVE_CONFORMANT_AUTOSCROLL
195 static const char SIG_IMPREGION_CHANGED[] = "impregion,changed";
197 static const Evas_Smart_Cb_Description _signals[] = {
201 {SIG_LONGPRESSED, ""},
203 {SIG_CLICKED_DOUBLE, ""},
206 {SIG_SELECTION_PASTE, ""},
207 {SIG_SELECTION_COPY, ""},
208 {SIG_SELECTION_CUT, ""},
209 {SIG_SELECTION_START, ""},
210 {SIG_SELECTION_CHANGED, ""},
211 {SIG_SELECTION_CLEARED, ""},
212 {SIG_CURSOR_CHANGED, ""},
213 {SIG_ANCHOR_CLICKED, ""},
217 static Eina_List *entries = NULL;
221 void (*obj_hook) (Evas_Object *obj);
222 void (*obj_unhook) (Evas_Object *obj);
223 void (*obj_longpress) (Evas_Object *obj);
224 void (*obj_mouseup) (Evas_Object *obj);
228 _module(Evas_Object *obj __UNUSED__)
230 static Elm_Module *m = NULL;
231 if (m) goto ok; // already found - just use
232 if (!(m = _elm_module_find_as("entry/api"))) return NULL;
234 m->api = malloc(sizeof(Mod_Api));
235 if (!m->api) return NULL;
236 ((Mod_Api *)(m->api) )->obj_hook = // called on creation
237 _elm_module_symbol_get(m, "obj_hook");
238 ((Mod_Api *)(m->api) )->obj_unhook = // called on deletion
239 _elm_module_symbol_get(m, "obj_unhook");
240 ((Mod_Api *)(m->api) )->obj_longpress = // called on long press menu
241 _elm_module_symbol_get(m, "obj_longpress");
242 ((Mod_Api *)(m->api) )->obj_mouseup = // called on mouseup
243 _elm_module_symbol_get(m, "obj_mouseup");
244 ok: // ok - return api
249 _del_hook(Evas_Object *obj)
251 Widget_Data *wd = elm_widget_data_get(obj);
252 Elm_Entry_Context_Menu_Item *it;
253 Elm_Entry_Item_Provider *ip;
255 if (wd->hovdeljob) ecore_job_del(wd->hovdeljob);
256 if ((wd->api) && (wd->api->obj_unhook)) wd->api->obj_unhook(obj); // module - unhook
258 entries = eina_list_remove(entries, obj);
259 #ifdef HAVE_ELEMENTARY_X
260 ecore_event_handler_del(wd->sel_notify_handler);
261 ecore_event_handler_del(wd->sel_clear_handler);
263 if (wd->cut_sel) eina_stringshare_del(wd->cut_sel);
264 if (wd->text) eina_stringshare_del(wd->text);
265 if (wd->bg) evas_object_del(wd->bg);
266 if (wd->deferred_recalc_job) ecore_job_del(wd->deferred_recalc_job);
267 if (wd->longpress_timer) ecore_timer_del(wd->longpress_timer);
268 EINA_LIST_FREE(wd->items, it)
270 eina_stringshare_del(it->label);
271 eina_stringshare_del(it->icon_file);
272 eina_stringshare_del(it->icon_group);
275 EINA_LIST_FREE(wd->item_providers, ip)
283 _theme_hook(Evas_Object *obj)
285 Widget_Data *wd = elm_widget_data_get(obj);
287 Ecore_IMF_Context *ic;
289 t = eina_stringshare_add(elm_entry_entry_get(obj));
290 _elm_theme_object_set(obj, wd->ent, "entry", _getbase(obj), elm_widget_style_get(obj));
291 elm_entry_entry_set(obj, t);
292 eina_stringshare_del(t);
293 edje_object_scale_set(wd->ent, elm_widget_scale_get(obj) * _elm_config->scale);
294 edje_object_part_text_autocapitalization_set(wd->ent, "elm.text", wd->autocapitalize);
295 edje_object_part_text_autoperiod_set(wd->ent, "elm.text", wd->autoperiod);
296 edje_object_part_text_input_panel_enabled_set(wd->ent, "elm.text", wd->input_panel_enable);
298 ic = edje_object_part_text_imf_context_get(wd->ent, "elm.text");
301 ecore_imf_context_input_panel_layout_set(ic, (Ecore_IMF_Input_Panel_Layout)wd->input_panel_layout);
308 _disable_hook(Evas_Object *obj)
310 Widget_Data *wd = elm_widget_data_get(obj);
312 if (elm_widget_disabled_get(obj))
314 edje_object_signal_emit(wd->ent, "elm,state,disabled", "elm");
315 wd->disabled = EINA_TRUE;
319 edje_object_signal_emit(wd->ent, "elm,state,enabled", "elm");
320 wd->disabled = EINA_FALSE;
325 _elm_win_recalc_job(void *data)
327 Widget_Data *wd = elm_widget_data_get(data);
328 Evas_Coord minw = -1, minh = -1, maxh = -1;
329 Evas_Coord resw, resh, minminw;
331 wd->deferred_recalc_job = NULL;
332 evas_object_geometry_get(wd->ent, NULL, NULL, &resw, &resh);
335 edje_object_size_min_restricted_calc(wd->ent, &minw, &minh, 0, 0);
336 elm_coords_finger_size_adjust(1, &minw, 1, &minh);
338 edje_object_size_min_restricted_calc(wd->ent, &minw, &minh, resw, 0);
339 elm_coords_finger_size_adjust(1, &minw, 1, &minh);
340 evas_object_size_hint_min_set(data, minminw, minh);
341 if (wd->single_line) maxh = minh;
342 evas_object_size_hint_max_set(data, -1, maxh);
343 if (wd->deferred_cur)
344 elm_widget_show_region_set(data, wd->cx, wd->cy, wd->cw, wd->ch);
348 _sizing_eval(Evas_Object *obj)
350 Widget_Data *wd = elm_widget_data_get(obj);
351 Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
352 Evas_Coord resw, resh;
354 if (wd->linewrap || wd->char_linewrap)
356 evas_object_geometry_get(wd->ent, NULL, NULL, &resw, &resh);
357 if ((resw == wd->lastw) && (!wd->changed)) return;
358 wd->changed = EINA_FALSE;
360 if (wd->deferred_recalc_job) ecore_job_del(wd->deferred_recalc_job);
361 wd->deferred_recalc_job = ecore_job_add(_elm_win_recalc_job, obj);
365 evas_object_geometry_get(wd->ent, NULL, NULL, &resw, &resh);
366 edje_object_size_min_calc(wd->ent, &minw, &minh);
367 elm_coords_finger_size_adjust(1, &minw, 1, &minh);
368 evas_object_size_hint_min_set(obj, minw, minh);
369 if (wd->single_line) maxh = minh;
370 evas_object_size_hint_max_set(obj, maxw, maxh);
372 if (wd->ellipsis && wd->single_line)
374 if (_is_width_over(obj))
375 _ellipsis_entry_to_width(obj);
376 else if (wd->ellipsis_threshold > 1 && _entry_length_get(obj) < wd->ellipsis_threshold)
377 _reverse_ellipsis_entry(obj);
383 _check_enable_returnkey(Evas_Object *obj)
385 Widget_Data *wd = elm_widget_data_get(obj);
388 Ecore_IMF_Context *ic = elm_entry_imf_context_get(obj);
391 if (!wd->autoreturnkey) return;
393 if (_entry_length_get(obj) == 0)
395 ecore_imf_context_input_panel_key_disabled_set(ic, ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL, ECORE_IMF_INPUT_PANEL_KEY_ENTER, EINA_TRUE);
399 ecore_imf_context_input_panel_key_disabled_set(ic, ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL, ECORE_IMF_INPUT_PANEL_KEY_ENTER, EINA_FALSE);
403 #ifdef HAVE_CONFORMANT_AUTOSCROLL
405 _imp_region_get_hook(const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
407 Evas_Coord cx = 0, cy = 0, cw = 0, ch = 0;
408 Widget_Data *wd = elm_widget_data_get(obj);
409 if (!wd) return NULL;
410 edje_object_part_text_cursor_geometry_get(wd->ent, "elm.text",
421 _on_focus_hook(void *data __UNUSED__, Evas_Object *obj)
423 Widget_Data *wd = elm_widget_data_get(obj);
424 Evas_Object *top = elm_widget_top_get(obj);
426 if (!wd->editable) return;
427 if (elm_widget_focus_get(obj))
429 evas_object_focus_set(wd->ent, 1);
430 edje_object_signal_emit(wd->ent, "elm,action,focus", "elm");
432 if (top) elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_ON);
436 // ecore_x_selection_secondary_set(elm_win_xwindow_get(obj), "",1);
439 evas_object_smart_callback_call(obj, SIG_FOCUSED, NULL);
440 _check_enable_returnkey(obj);
444 edje_object_signal_emit(wd->ent, "elm,action,unfocus", "elm");
445 edje_object_part_text_set(wd->ent, "elm_entry_remain_byte_count", "");
446 evas_object_focus_set(wd->ent, 0);
447 if (top) elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_OFF);
448 evas_object_smart_callback_call(obj, SIG_UNFOCUSED, NULL);
453 _signal_emit_hook(Evas_Object *obj, const char *emission, const char *source)
455 Widget_Data *wd = elm_widget_data_get(obj);
457 edje_object_signal_emit(wd->ent, emission, source);
461 _signal_callback_add_hook(Evas_Object *obj, const char *emission, const char *source, void (*func_cb) (void *data, Evas_Object *o, const char *emission, const char *source), void *data)
463 Widget_Data *wd = elm_widget_data_get(obj);
465 edje_object_signal_callback_add(wd->ent, emission, source, func_cb, data);
469 _signal_callback_del_hook(Evas_Object *obj, const char *emission, const char *source, void (*func_cb) (void *data, Evas_Object *o, const char *emission, const char *source))
471 Widget_Data *wd = elm_widget_data_get(obj);
472 if (!wd) return NULL;
473 return edje_object_signal_callback_del(wd->ent, emission, source, func_cb);
477 _hoversel_position(Evas_Object *obj)
479 Widget_Data *wd = elm_widget_data_get(obj);
480 Evas_Coord cx, cy, cw, ch, x, y, mw, mh;
482 evas_object_geometry_get(wd->ent, &x, &y, NULL, NULL);
483 edje_object_part_text_cursor_geometry_get(wd->ent, "elm.text",
485 evas_object_size_hint_min_get(wd->hoversel, &mw, &mh);
496 evas_object_move(wd->hoversel, x + cx, y + cy);
497 evas_object_resize(wd->hoversel, cw, ch);
501 _move(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
503 Widget_Data *wd = elm_widget_data_get(data);
505 if (wd->hoversel) _hoversel_position(data);
509 _resize(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
511 Widget_Data *wd = elm_widget_data_get(data);
513 if (wd->linewrap || wd->char_linewrap)
517 if (wd->hoversel) _hoversel_position(data);
518 // Evas_Coord ww, hh;
519 // evas_object_geometry_get(wd->ent, NULL, NULL, &ww, &hh);
523 _hover_del(void *data)
525 Widget_Data *wd = elm_widget_data_get(data);
530 evas_object_del(wd->hoversel);
533 wd->hovdeljob = NULL;
537 _dismissed(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
539 Widget_Data *wd = elm_widget_data_get(data);
541 if (wd->hoversel) evas_object_hide(wd->hoversel);
545 edje_object_part_text_select_allow_set(wd->ent, "elm.text", 1);
547 elm_widget_scroll_freeze_pop(data);
548 if (wd->hovdeljob) ecore_job_del(wd->hovdeljob);
549 wd->hovdeljob = ecore_job_add(_hover_del, data);
553 _select(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
555 Widget_Data *wd = elm_widget_data_get(data);
557 wd->selmode = EINA_TRUE;
558 edje_object_part_text_select_none(wd->ent, "elm.text");
560 edje_object_part_text_select_allow_set(wd->ent, "elm.text", 1);
561 edje_object_signal_emit(wd->ent, "elm,state,select,on", "elm");
562 elm_widget_scroll_hold_push(data);
566 _paste(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
568 Widget_Data *wd = elm_widget_data_get(data);
570 evas_object_smart_callback_call(data, SIG_SELECTION_PASTE, NULL);
571 if (wd->sel_notify_handler)
573 #ifdef HAVE_ELEMENTARY_X
574 wd->selection_asked = EINA_TRUE;
575 elm_selection_get(ELM_SEL_CLIPBOARD, ELM_SEL_FORMAT_MARKUP, data);
581 _store_selection(Elm_Sel_Type seltype, Evas_Object *obj)
583 Widget_Data *wd = elm_widget_data_get(obj);
587 sel = edje_object_part_text_selection_get(wd->ent, "elm.text");
588 elm_selection_set(seltype, obj, ELM_SEL_FORMAT_MARKUP, sel);
589 if (seltype == ELM_SEL_CLIPBOARD)
590 eina_stringshare_replace(&wd->cut_sel, sel);
594 _cut(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
596 Widget_Data *wd = elm_widget_data_get(data);
599 wd->selmode = EINA_FALSE;
600 edje_object_part_text_select_allow_set(wd->ent, "elm.text", 0);
601 edje_object_signal_emit(wd->ent, "elm,state,select,off", "elm");
602 elm_widget_scroll_hold_pop(data);
603 _store_selection(ELM_SEL_CLIPBOARD, data);
604 edje_object_part_text_insert(wd->ent, "elm.text", "");
605 edje_object_part_text_select_none(wd->ent, "elm.text");
609 _copy(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
611 Widget_Data *wd = elm_widget_data_get(data);
613 wd->selmode = EINA_FALSE;
614 edje_object_part_text_select_allow_set(wd->ent, "elm.text", 0);
615 edje_object_signal_emit(wd->ent, "elm,state,select,off", "elm");
616 elm_widget_scroll_hold_pop(data);
617 _store_selection(ELM_SEL_CLIPBOARD, data);
618 // edje_object_part_text_select_none(wd->ent, "elm.text");
622 _cancel(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
624 Widget_Data *wd = elm_widget_data_get(data);
626 wd->selmode = EINA_FALSE;
627 edje_object_part_text_select_allow_set(wd->ent, "elm.text", 0);
628 edje_object_signal_emit(wd->ent, "elm,state,select,off", "elm");
629 elm_widget_scroll_hold_pop(data);
630 edje_object_part_text_select_none(wd->ent, "elm.text");
634 _clipboard_menu(void *data, Evas_Object *obj, void *event_info __UNUSED__)
636 Widget_Data *wd = elm_widget_data_get(data);
640 ecore_x_selection_secondary_set(elm_win_xwindow_get(obj), "",1);
641 elm_cbhm_helper_init(obj);
642 elm_cbhm_send_raw_data("show");
647 _item_clicked(void *data, Evas_Object *obj, void *event_info __UNUSED__)
649 Elm_Entry_Context_Menu_Item *it = data;
650 Evas_Object *obj2 = it->obj;
652 if (it->func) it->func(it->data, obj2, NULL);
656 _long_press(void *data)
658 Widget_Data *wd = elm_widget_data_get(data);
661 const Elm_Entry_Context_Menu_Item *it;
662 if (!wd) return ECORE_CALLBACK_CANCEL;
664 if (wd->longpress_timer)
666 ecore_timer_del(wd->longpress_timer);
667 wd->longpress_timer = NULL;
670 if ((wd->api) && (wd->api->obj_longpress))
672 wd->api->obj_longpress(data);
674 else if (wd->context_menu)
676 const char *context_menu_orientation;
678 if (wd->hoversel) evas_object_del(wd->hoversel);
679 else elm_widget_scroll_freeze_push(data);
680 wd->hoversel = elm_hoversel_add(data);
681 context_menu_orientation = edje_object_data_get
682 (wd->ent, "context_menu_orientation");
683 if ((context_menu_orientation) &&
684 (!strcmp(context_menu_orientation, "horizontal")))
685 elm_hoversel_horizontal_set(wd->hoversel, 1);
686 elm_object_style_set(wd->hoversel, "entry");
687 elm_widget_sub_object_add(data, wd->hoversel);
688 elm_hoversel_label_set(wd->hoversel, "Text");
689 top = elm_widget_top_get(data);
690 if (top) elm_hoversel_hover_parent_set(wd->hoversel, top);
691 evas_object_smart_callback_add(wd->hoversel, "dismissed", _dismissed, data);
695 elm_hoversel_item_add(wd->hoversel, "Select", NULL, ELM_ICON_NONE,
697 if (1) // need way to detect if someone has a selection
700 elm_hoversel_item_add(wd->hoversel, "Paste", NULL, ELM_ICON_NONE,
705 elm_hoversel_item_add(wd->hoversel, "More", NULL, ELM_ICON_NONE,
706 _clipboard_menu, data);
713 if (wd->have_selection)
715 elm_hoversel_item_add(wd->hoversel, "Copy", NULL, ELM_ICON_NONE,
718 elm_hoversel_item_add(wd->hoversel, "Cut", NULL, ELM_ICON_NONE,
721 elm_hoversel_item_add(wd->hoversel, "Cancel", NULL, ELM_ICON_NONE,
724 elm_hoversel_item_add(wd->hoversel, "More", NULL, ELM_ICON_NONE,
725 _clipboard_menu, data);
729 EINA_LIST_FOREACH(wd->items, l, it)
731 elm_hoversel_item_add(wd->hoversel, it->label, it->icon_file,
732 it->icon_type, _item_clicked, it);
736 _hoversel_position(data);
737 evas_object_show(wd->hoversel);
738 elm_hoversel_hover_begin(wd->hoversel);
740 edje_object_part_text_select_allow_set(wd->ent, "elm.text", 0);
741 edje_object_part_text_select_abort(wd->ent, "elm.text");
743 wd->longpress_timer = NULL;
744 evas_object_smart_callback_call(data, SIG_LONGPRESSED, NULL);
745 return ECORE_CALLBACK_CANCEL;
749 _mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
751 Widget_Data *wd = elm_widget_data_get(data);
752 Evas_Event_Mouse_Down *ev = event_info;
754 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
755 if (ev->button != 1) return;
756 // if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK)
757 if (wd->longpress_timer) ecore_timer_del(wd->longpress_timer);
758 wd->longpress_timer = ecore_timer_add(1.0, _long_press, data);
759 wd->downx = ev->canvas.x;
760 wd->downy = ev->canvas.y;
764 _mouse_up(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
766 Widget_Data *wd = elm_widget_data_get(data);
767 Evas_Event_Mouse_Up *ev = event_info;
769 if (ev->button != 1) return;
771 if (!wd->double_clicked)
773 if ((wd->api) && (wd->api->obj_mouseup))
775 wd->api->obj_mouseup(data);
778 if (wd->longpress_timer)
780 ecore_timer_del(wd->longpress_timer);
781 wd->longpress_timer = NULL;
786 _mouse_move(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
788 Widget_Data *wd = elm_widget_data_get(data);
789 Evas_Event_Mouse_Move *ev = event_info;
793 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
795 if (wd->longpress_timer)
797 ecore_timer_del(wd->longpress_timer);
798 wd->longpress_timer = NULL;
801 else if (wd->longpress_timer)
805 dx = wd->downx - ev->cur.canvas.x;
807 dy = wd->downy - ev->cur.canvas.y;
810 ((_elm_config->finger_size / 2) *
811 (_elm_config->finger_size / 2)))
813 ecore_timer_del(wd->longpress_timer);
814 wd->longpress_timer = NULL;
818 else if (wd->longpress_timer)
822 dx = wd->downx - ev->cur.canvas.x;
824 dy = wd->downy - ev->cur.canvas.y;
827 ((_elm_config->finger_size / 2) *
828 (_elm_config->finger_size / 2)))
830 ecore_timer_del(wd->longpress_timer);
831 wd->longpress_timer = NULL;
837 _getbase(Evas_Object *obj)
839 Widget_Data *wd = elm_widget_data_get(obj);
840 if (!wd) return "base";
843 if((wd->password)&&(wd->show_last_character)) return "custom-password";
844 else if(wd->password) return "base-password";
847 if (wd->single_line) return "base-single";
850 if (wd->linewrap) return "base";
851 else if (wd->char_linewrap) return "base-charwrap";
852 else return "base-nowrap";
858 if((wd->password)&&(wd->show_last_character)) return "custom-password";
859 else if(wd->password) return "base-password";
862 if (wd->single_line) return "base-single-noedit";
865 if (wd->linewrap) return "base-noedit";
866 else if (wd->char_linewrap) return "base-noedit-charwrap";
867 else return "base-nowrap-noedit";
875 _str_append(char *str, const char *txt, int *len, int *alloc)
877 int txt_len = strlen(txt);
879 if (txt_len <= 0) return str;
880 if ((*len + txt_len) >= *alloc)
885 alloc2 = *alloc + txt_len + 128;
886 str2 = realloc(str, alloc2);
887 if (!str2) return str;
891 strcpy(str + *len, txt);
896 /*FIXME: Sholud be implemented somewhere else, it really depends on the context
897 * because some markups can be implemented otherwise according to style.
898 * probably doing it in textblock and making it translate according to it's
899 * style is correct. */
901 _strncpy(char* dest, const char* src, size_t count)
905 ERR( "dest is NULL" );
910 ERR( "src is NULL" );
915 ERR( "count is smaller than 0" );
919 return strncpy( dest, src, count );
923 _mkup_to_text(const char *mkup)
926 int str_len = 0, str_alloc = 0;
928 char *tag_start, *tag_end, *esc_start, *esc_end, *ts;
930 if (!mkup) return NULL;
932 tag_start = tag_end = esc_start = esc_end = NULL;
937 if (((p!=NULL)&&(*p == 0)) ||
938 (tag_end) || (esc_end) ||
939 (tag_start) || (esc_start))
945 ttag = malloc(tag_end - tag_start);
948 _strncpy(ttag, tag_start + 1, tag_end - tag_start - 1);
949 ttag[tag_end - tag_start - 1] = 0;
950 if (!strcmp(ttag, "br"))
951 str = _str_append(str, "\n", &str_len, &str_alloc);
952 else if (!strcmp(ttag, "\n"))
953 str = _str_append(str, "\n", &str_len, &str_alloc);
954 else if (!strcmp(ttag, "\\n"))
955 str = _str_append(str, "\n", &str_len, &str_alloc);
956 else if (!strcmp(ttag, "\t"))
957 str = _str_append(str, "\t", &str_len, &str_alloc);
958 else if (!strcmp(ttag, "\\t"))
959 str = _str_append(str, "\t", &str_len, &str_alloc);
960 else if (!strcmp(ttag, "ps")) /* Unicode paragraph separator */
961 str = _str_append(str, "\xE2\x80\xA9", &str_len, &str_alloc);
964 tag_start = tag_end = NULL;
968 ts = malloc(esc_end - esc_start + 1);
972 _strncpy(ts, esc_start, esc_end - esc_start);
973 ts[esc_end - esc_start] = 0;
974 esc = evas_textblock_escape_string_get(ts);
976 str = _str_append(str, esc, &str_len, &str_alloc);
979 esc_start = esc_end = NULL;
981 else if ((p!=NULL)&&(*p == 0))
983 ts = malloc(p - s + 1);
986 _strncpy(ts, s, p - s);
988 str = _str_append(str, ts, &str_len, &str_alloc);
994 if ((p!=NULL)&&(*p == '<'))
1000 ts = malloc(p - s + 1);
1003 _strncpy(ts, s, p - s);
1005 str = _str_append(str, ts, &str_len, &str_alloc);
1011 else if ((p!=NULL)&&(*p == '>'))
1019 else if ((p!=NULL)&&(*p == '&'))
1025 ts = malloc(p - s + 1);
1028 _strncpy(ts, s, p - s);
1030 str = _str_append(str, ts, &str_len, &str_alloc);
1036 else if ((p!=NULL)&&(*p == ';'))
1050 _entry_length_get(Evas_Object *obj)
1053 const char *str = elm_entry_entry_get(obj);
1056 char *plain_str = _mkup_to_text(str);
1057 if (!plain_str) return 0;
1059 len = strlen(plain_str);
1066 _text_to_mkup(const char *text)
1069 int str_len = 0, str_alloc = 0;
1070 int ch, pos = 0, pos2 = 0;
1072 if (!text) return NULL;
1076 pos2 = evas_string_char_next_get((char *)(text), pos2, &ch);
1077 if ((ch <= 0) || (pos2 <= 0)) break;
1079 str = _str_append(str, "<br>", &str_len, &str_alloc);
1080 else if (ch == '\t')
1081 str = _str_append(str, "<\t>", &str_len, &str_alloc);
1083 str = _str_append(str, "<", &str_len, &str_alloc);
1085 str = _str_append(str, ">", &str_len, &str_alloc);
1087 str = _str_append(str, "&", &str_len, &str_alloc);
1092 _strncpy(tstr, text + pos, pos2 - pos);
1093 tstr[pos2 - pos] = 0;
1094 str = _str_append(str, tstr, &str_len, &str_alloc);
1101 _signal_entry_changed(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
1103 Widget_Data *wd = elm_widget_data_get(data);
1105 wd->changed = EINA_TRUE;
1107 if (wd->text) eina_stringshare_del(wd->text);
1109 _check_enable_returnkey(data);
1110 evas_object_smart_callback_call(data, SIG_CHANGED, NULL);
1114 _signal_selection_start(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
1116 Widget_Data *wd = elm_widget_data_get(data);
1120 EINA_LIST_FOREACH(entries, l, entry)
1122 if (entry != data) elm_entry_select_none(entry);
1124 wd->have_selection = EINA_TRUE;
1125 wd->selmode = EINA_TRUE;
1126 evas_object_smart_callback_call(data, SIG_SELECTION_START, NULL);
1127 #ifdef HAVE_ELEMENTARY_X
1128 if (wd->sel_notify_handler)
1130 const char *txt = elm_entry_selection_get(data);
1133 top = elm_widget_top_get(data);
1134 if ((top) && (elm_win_xwindow_get(top)))
1135 elm_selection_set(ELM_SEL_PRIMARY, data, ELM_SEL_FORMAT_MARKUP, txt);
1141 _signal_selection_changed(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
1143 Widget_Data *wd = elm_widget_data_get(data);
1145 wd->have_selection = EINA_TRUE;
1146 wd->selmode = EINA_TRUE;
1147 evas_object_smart_callback_call(data, SIG_SELECTION_CHANGED, NULL);
1148 elm_selection_set(ELM_SEL_PRIMARY, obj, ELM_SEL_FORMAT_MARKUP,
1149 elm_entry_selection_get(data));
1153 _signal_selection_cleared(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
1155 Widget_Data *wd = elm_widget_data_get(data);
1157 if (!wd->have_selection) return;
1158 wd->have_selection = EINA_FALSE;
1159 wd->selmode = EINA_FALSE;
1160 evas_object_smart_callback_call(data, SIG_SELECTION_CLEARED, NULL);
1161 if (wd->sel_notify_handler)
1165 #ifdef HAVE_ELEMENTARY_X
1168 top = elm_widget_top_get(data);
1169 if ((top) && (elm_win_xwindow_get(top)))
1170 elm_selection_set(ELM_SEL_PRIMARY, data, ELM_SEL_FORMAT_MARKUP,
1173 eina_stringshare_del(wd->cut_sel);
1178 #ifdef HAVE_ELEMENTARY_X
1181 top = elm_widget_top_get(data);
1182 if ((top) && (elm_win_xwindow_get(top)))
1183 elm_selection_clear(ELM_SEL_PRIMARY, data);
1190 _signal_entry_paste_request(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
1192 Widget_Data *wd = elm_widget_data_get(data);
1194 evas_object_smart_callback_call(data, SIG_SELECTION_PASTE, NULL);
1195 if (wd->sel_notify_handler)
1197 #ifdef HAVE_ELEMENTARY_X
1200 top = elm_widget_top_get(data);
1201 if ((top) && (elm_win_xwindow_get(top)))
1203 wd->selection_asked = EINA_TRUE;
1204 elm_selection_get(ELM_SEL_CLIPBOARD, ELM_SEL_FORMAT_MARKUP, data);
1211 _signal_entry_copy_notify(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
1213 Widget_Data *wd = elm_widget_data_get(data);
1215 evas_object_smart_callback_call(data, SIG_SELECTION_COPY, NULL);
1216 elm_selection_set(ELM_SEL_CLIPBOARD, obj, ELM_SEL_FORMAT_MARKUP,
1217 elm_entry_selection_get(data));
1221 _signal_entry_cut_notify(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
1223 Widget_Data *wd = elm_widget_data_get(data);
1225 evas_object_smart_callback_call(data, SIG_SELECTION_CUT, NULL);
1226 elm_selection_set(ELM_SEL_CLIPBOARD, obj, ELM_SEL_FORMAT_MARKUP,
1227 elm_entry_selection_get(data));
1228 edje_object_part_text_insert(wd->ent, "elm.text", "");
1229 wd->changed = EINA_TRUE;
1234 _signal_cursor_changed(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
1236 Widget_Data *wd = elm_widget_data_get(data);
1237 Evas_Coord cx, cy, cw, ch;
1239 evas_object_smart_callback_call(data, SIG_CURSOR_CHANGED, NULL);
1240 edje_object_part_text_cursor_geometry_get(wd->ent, "elm.text",
1241 &cx, &cy, &cw, &ch);
1242 if (!wd->deferred_recalc_job)
1243 elm_widget_show_region_set(data, cx, cy, cw, ch);
1246 wd->deferred_cur = EINA_TRUE;
1252 #ifdef HAVE_CONFORMANT_AUTOSCROLL
1253 evas_object_smart_callback_call(data, SIG_IMPREGION_CHANGED, NULL);
1258 _signal_anchor_down(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
1260 Widget_Data *wd = elm_widget_data_get(data);
1265 _signal_anchor_up(void *data, Evas_Object *obj __UNUSED__, const char *emission, const char *source __UNUSED__)
1267 Widget_Data *wd = elm_widget_data_get(data);
1268 Elm_Entry_Anchor_Info ei;
1269 char *buf2, *p, *p2, *n;
1271 p = strrchr(emission, ',');
1274 const Eina_List *geoms;
1278 while (p2 >= emission)
1280 if (*p2 == ',') break;
1284 buf2 = alloca(5 + p - p2);
1285 strncpy(buf2, p2, p - p2);
1288 ei.button = atoi(buf2);
1289 ei.x = ei.y = ei.w = ei.h = 0;
1291 edje_object_part_text_anchor_geometry_get(wd->ent, "elm.text", ei.name);
1294 Evas_Textblock_Rectangle *r;
1296 Evas_Coord px, py, x, y;
1298 evas_object_geometry_get(wd->ent, &x, &y, NULL, NULL);
1299 evas_pointer_output_xy_get(evas_object_evas_get(wd->ent), &px, &py);
1300 EINA_LIST_FOREACH(geoms, l, r)
1302 if (((r->x + x) <= px) && ((r->y + y) <= py) &&
1303 ((r->x + x + r->w) > px) && ((r->y + y + r->h) > py))
1314 evas_object_smart_callback_call(data, SIG_ANCHOR_CLICKED, &ei);
1319 _signal_anchor_move(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
1321 Widget_Data *wd = elm_widget_data_get(data);
1326 _signal_anchor_in(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
1328 Widget_Data *wd = elm_widget_data_get(data);
1333 _signal_anchor_out(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
1335 Widget_Data *wd = elm_widget_data_get(data);
1340 _signal_key_enter(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
1342 Widget_Data *wd = elm_widget_data_get(data);
1344 evas_object_smart_callback_call(data, SIG_ACTIVATED, NULL);
1348 _signal_mouse_down(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
1350 Widget_Data *wd = elm_widget_data_get(data);
1352 wd->double_clicked = EINA_FALSE;
1353 evas_object_smart_callback_call(data, SIG_PRESS, NULL);
1357 _signal_mouse_up(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
1359 Widget_Data *wd = elm_widget_data_get(data);
1361 evas_object_smart_callback_call(data, SIG_CLICKED, NULL);
1365 _signal_mouse_double(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
1367 Widget_Data *wd = elm_widget_data_get(data);
1369 wd->double_clicked = EINA_TRUE;
1370 evas_object_smart_callback_call(data, SIG_CLICKED_DOUBLE, NULL);
1373 #ifdef HAVE_ELEMENTARY_X
1375 _event_selection_notify(void *data, int type __UNUSED__, void *event)
1377 Widget_Data *wd = elm_widget_data_get(data);
1378 Ecore_X_Event_Selection_Notify *ev = event;
1379 if (!wd) return ECORE_CALLBACK_PASS_ON;
1380 if (!wd->selection_asked && !wd->drag_selection_asked)
1381 return ECORE_CALLBACK_PASS_ON;
1383 if ((ev->selection == ECORE_X_SELECTION_CLIPBOARD) ||
1384 (ev->selection == ECORE_X_SELECTION_PRIMARY))
1386 Ecore_X_Selection_Data_Text *text_data;
1388 text_data = ev->data;
1389 if (text_data->data.content == ECORE_X_SELECTION_CONTENT_TEXT)
1391 if (text_data->text)
1393 char *txt = _text_to_mkup(text_data->text);
1397 elm_entry_entry_insert(data, txt);
1402 wd->selection_asked = EINA_FALSE;
1404 else if (ev->selection == ECORE_X_SELECTION_XDND)
1406 Ecore_X_Selection_Data_Text *text_data;
1408 text_data = ev->data;
1409 if (text_data->data.content == ECORE_X_SELECTION_CONTENT_TEXT)
1411 if (text_data->text)
1413 char *txt = _text_to_mkup(text_data->text);
1417 /* Massive FIXME: this should be at the drag point */
1418 elm_entry_entry_insert(data, txt);
1423 wd->drag_selection_asked = EINA_FALSE;
1425 ecore_x_dnd_send_finished();
1428 return ECORE_CALLBACK_PASS_ON;
1432 _event_selection_clear(void *data, int type __UNUSED__, void *event)
1435 Widget_Data *wd = elm_widget_data_get(data);
1436 Ecore_X_Event_Selection_Clear *ev = event;
1438 if (!wd->have_selection) return 1;
1439 if ((ev->selection == ECORE_X_SELECTION_CLIPBOARD) ||
1440 (ev->selection == ECORE_X_SELECTION_PRIMARY))
1442 elm_entry_select_none(data);
1447 Evas_Object *top = elm_widget_top_get(data);
1448 Ecore_X_Event_Selection_Clear *ev = event;
1451 return ECORE_CALLBACK_PASS_ON;
1453 if (ev->selection != ECORE_X_SELECTION_SECONDARY)
1455 return ECORE_CALLBACK_PASS_ON;
1458 elm_selection_get(ELM_SEL_SECONDARY,ELM_SEL_FORMAT_MARKUP,data);
1460 return ECORE_CALLBACK_PASS_ON;
1465 _drag_drop_cb(void *data __UNUSED__, Evas_Object *obj, Elm_Drop_Data *drop)
1470 wd = elm_widget_data_get(obj);
1472 if (!wd) return EINA_FALSE;
1473 //printf("Inserting at (%d,%d) %s\n",drop->x,drop->y,(char*)drop->data);
1475 edje_object_part_text_cursor_copy(wd->ent, "elm.text",
1476 EDJE_CURSOR_MAIN,/*->*/EDJE_CURSOR_USER);
1477 rv = edje_object_part_text_cursor_coord_set(wd->ent,"elm.text",
1478 EDJE_CURSOR_MAIN,drop->x,drop->y);
1479 // if (!rv) printf("Warning: Failed to position cursor: paste anyway\n");
1480 elm_entry_entry_insert(obj, drop->data);
1481 edje_object_part_text_cursor_copy(wd->ent, "elm.text",
1482 EDJE_CURSOR_USER,/*->*/EDJE_CURSOR_MAIN);
1488 static Evas_Object *
1489 _get_item(void *data, Evas_Object *edje __UNUSED__, const char *part __UNUSED__, const char *item)
1491 Widget_Data *wd = elm_widget_data_get(data);
1494 Elm_Entry_Item_Provider *ip;
1497 EINA_LIST_FOREACH(wd->item_providers, l, ip)
1499 o = ip->func(ip->data, data, item);
1502 o = edje_object_add(evas_object_evas_get(data));
1503 if (!strncmp(item, "emoticon/", 9))
1504 ok = _elm_theme_object_set(data, o, "entry", item, elm_widget_style_get(data));
1506 _elm_theme_object_set(data, o, "entry/emoticon", "wtf", elm_widget_style_get(data));
1511 _get_value_in_key_string(const char *oldstring, char *key, char **value)
1513 char *curlocater, *starttag, *endtag;
1514 int firstindex = 0, foundflag = -1;
1516 curlocater = strstr(oldstring, key);
1519 starttag = curlocater;
1520 endtag = curlocater + strlen(key);
1521 if (endtag == NULL || *endtag != '=')
1527 firstindex = abs(oldstring - curlocater);
1528 firstindex += strlen(key)+1; // strlen("key") + strlen("=")
1529 *value = (char*)oldstring + firstindex;
1531 while (oldstring != starttag)
1533 if (*starttag == '>')
1538 if (*starttag == '<')
1542 if (starttag == NULL) break;
1545 while (NULL != endtag)
1556 if (endtag == NULL) break;
1559 if (foundflag != 0 && *starttag == '<' && *endtag == '>')
1569 if (foundflag == 1) return 0;
1575 _strbuf_key_value_replace(Eina_Strbuf *srcbuf, char *key, const char *value, int deleteflag)
1577 const char *srcstring = NULL;
1578 Eina_Strbuf *repbuf = NULL, *diffbuf = NULL;
1579 char *curlocater, *replocater;
1580 char *starttag, *endtag;
1581 int tagtxtlen = 0, insertflag = 0;
1583 srcstring = eina_strbuf_string_get(srcbuf);
1584 curlocater = strstr(srcstring, key);
1586 if (curlocater == NULL)
1594 starttag = strchr(srcstring, '<');
1595 endtag = strchr(srcstring, '>');
1596 tagtxtlen = endtag - starttag;
1597 if (tagtxtlen <= 0) tagtxtlen = 0;
1598 if (starttag < curlocater && curlocater < endtag) break;
1599 if (endtag != NULL && endtag+1 != NULL)
1600 srcstring = endtag+1;
1603 } while (strlen(srcstring) > 1);
1605 if (starttag && endtag && tagtxtlen > strlen(key))
1607 repbuf = eina_strbuf_new();
1608 diffbuf = eina_strbuf_new();
1609 eina_strbuf_append_n(repbuf, starttag, tagtxtlen);
1610 srcstring = eina_strbuf_string_get(repbuf);
1611 curlocater = strstr(srcstring, key);
1613 if (curlocater != NULL)
1615 replocater = curlocater + strlen(key) + 1;
1617 while (*replocater == ' ' || *replocater == '=')
1622 while (*replocater != NULL && *replocater != ' ' && *replocater != '>')
1625 if (replocater-curlocater > strlen(key)+1)
1628 eina_strbuf_append_n(diffbuf, curlocater, replocater-curlocater+1);
1637 eina_strbuf_reset(repbuf);
1645 if (repbuf == NULL) repbuf = eina_strbuf_new();
1646 if (diffbuf == NULL) diffbuf = eina_strbuf_new();
1650 eina_strbuf_append_printf(repbuf, "<%s=%s>", key, value);
1651 eina_strbuf_prepend(srcbuf, eina_strbuf_string_get(repbuf));
1657 eina_strbuf_prepend(diffbuf, "<");
1658 eina_strbuf_append(diffbuf, ">");
1659 eina_strbuf_replace_first(srcbuf, eina_strbuf_string_get(diffbuf), "");
1663 eina_strbuf_append_printf(repbuf, "%s=%s", key, value);
1664 eina_strbuf_replace_first(srcbuf, eina_strbuf_string_get(diffbuf), eina_strbuf_string_get(repbuf));
1668 if (repbuf) eina_strbuf_free(repbuf);
1669 if (diffbuf) eina_strbuf_free(diffbuf);
1675 _stringshare_key_value_replace(const char **srcstring, char *key, const char *value, int deleteflag)
1677 Eina_Strbuf *sharebuf = NULL;
1679 sharebuf = eina_strbuf_new();
1680 eina_strbuf_append(sharebuf, *srcstring);
1681 _strbuf_key_value_replace(sharebuf, key, value, deleteflag);
1682 eina_stringshare_del(*srcstring);
1683 *srcstring = eina_stringshare_add(eina_strbuf_string_get(sharebuf));
1684 eina_strbuf_free(sharebuf);
1690 _is_width_over(Evas_Object *obj)
1692 Evas_Coord x, y, w, h;
1693 Evas_Coord vx, vy, vw, vh;
1694 Widget_Data *wd = elm_widget_data_get(obj);
1698 edje_object_part_geometry_get(wd->ent,"elm.text",&x,&y,&w,&h);
1700 evas_object_geometry_get (obj, &vx,&vy,&vw,&vh);
1702 if (x >= 0 && y >= 0)
1705 if (4 < wd->wrap_w && w > wd->wrap_w)
1712 _reverse_ellipsis_entry(Evas_Object *obj)
1714 Widget_Data *wd = elm_widget_data_get(obj);
1715 int cur_fontsize = 0;
1716 Eina_Strbuf *fontbuf = NULL, *txtbuf = NULL;
1717 char **kvalue = NULL;
1718 const char *minfont, *deffont, *maxfont;
1719 const char *ellipsis_string = "...";
1720 int minfontsize, maxfontsize, minshowcount;
1722 minshowcount = strlen(ellipsis_string) + 1;
1723 minfont = edje_object_data_get(wd->ent, "min_font_size");
1724 if (minfont) minfontsize = atoi(minfont);
1725 else minfontsize = 1;
1726 maxfont = edje_object_data_get(wd->ent, "max_font_size");
1727 if (maxfont) maxfontsize = atoi(maxfont);
1728 else maxfontsize = 1;
1729 deffont = edje_object_data_get(wd->ent, "default_font_size");
1730 if (deffont) cur_fontsize = atoi(deffont);
1731 else cur_fontsize = 1;
1732 if (minfontsize == maxfontsize || cur_fontsize == 1) return; // theme is not ready for ellipsis
1733 if (strlen(edje_object_part_text_get(wd->ent, "elm.text")) <= 0) return;
1735 if (_get_value_in_key_string(edje_object_part_text_get(wd->ent, "elm.text"), "font_size", &kvalue) == 0)
1737 if (*kvalue != NULL) cur_fontsize = atoi((char*)kvalue);
1740 txtbuf = eina_strbuf_new();
1741 eina_strbuf_append(txtbuf, edje_object_part_text_get(wd->ent, "elm.text"));
1743 if (cur_fontsize >= atoi(deffont))
1745 if (txtbuf) eina_strbuf_free(txtbuf);
1749 if (_is_width_over(obj) != 1)
1751 int rev_fontsize = cur_fontsize;
1755 if (rev_fontsize > atoi(deffont))
1758 if (fontbuf != NULL)
1760 eina_strbuf_free(fontbuf);
1763 fontbuf = eina_strbuf_new();
1764 eina_strbuf_append_printf(fontbuf, "%d", rev_fontsize);
1765 _strbuf_key_value_replace(txtbuf, "font_size", eina_strbuf_string_get(fontbuf), 0);
1766 edje_object_part_text_set(wd->ent, "elm.text", eina_strbuf_string_get(txtbuf));
1768 eina_strbuf_free(fontbuf);
1770 } while (_is_width_over(obj) != 1);
1772 while (_is_width_over(obj))
1775 if (rev_fontsize < atoi(deffont))
1778 if (fontbuf != NULL)
1780 eina_strbuf_free(fontbuf);
1783 fontbuf = eina_strbuf_new();
1784 eina_strbuf_append_printf(fontbuf, "%d", rev_fontsize);
1785 _strbuf_key_value_replace(txtbuf, "font_size", eina_strbuf_string_get(fontbuf), 0);
1786 edje_object_part_text_set(wd->ent, "elm.text", eina_strbuf_string_get(txtbuf));
1787 eina_strbuf_free(fontbuf);
1792 if (txtbuf) eina_strbuf_free(txtbuf);
1798 _ellipsis_entry_to_width(Evas_Object *obj)
1800 Widget_Data *wd = elm_widget_data_get(obj);
1801 int cur_fontsize = 0, len, jumpcount;
1802 Eina_Strbuf *fontbuf = NULL, *txtbuf = NULL;
1803 char **kvalue = NULL;
1804 const char *minfont, *deffont, *maxfont;
1805 const char *ellipsis_string = "...";
1806 int minfontsize, maxfontsize, minshowcount;
1807 int i, tagend, cur_len;
1810 minshowcount = strlen(ellipsis_string) + 1;
1811 minfont = edje_object_data_get(wd->ent, "min_font_size");
1812 if (minfont) minfontsize = atoi(minfont);
1813 else minfontsize = 1;
1814 maxfont = edje_object_data_get(wd->ent, "max_font_size");
1815 if (maxfont) maxfontsize = atoi(maxfont);
1816 else maxfontsize = 1;
1817 deffont = edje_object_data_get(wd->ent, "default_font_size");
1818 if (deffont) cur_fontsize = atoi(deffont);
1819 else cur_fontsize = 1;
1820 if (minfontsize == maxfontsize || cur_fontsize == 1) return; // theme is not ready for ellipsis
1821 if (strlen(edje_object_part_text_get(wd->ent, "elm.text")) <= 0) return;
1823 if (_get_value_in_key_string(edje_object_part_text_get(wd->ent, "elm.text"), "font_size", &kvalue) == 0)
1825 if (*kvalue != NULL) cur_fontsize = atoi((char*)kvalue);
1828 txtbuf = eina_strbuf_new();
1829 eina_strbuf_append(txtbuf, edje_object_part_text_get(wd->ent, "elm.text"));
1831 while (_is_width_over(obj))
1833 if (wd->ellipsis_threshold == 0)
1834 wd->ellipsis_threshold = _entry_length_get(obj);
1835 if (cur_fontsize > minfontsize)
1838 if (fontbuf != NULL)
1840 eina_strbuf_free(fontbuf);
1843 fontbuf = eina_strbuf_new();
1844 eina_strbuf_append_printf(fontbuf, "%d", cur_fontsize);
1845 _strbuf_key_value_replace(txtbuf, "font_size", eina_strbuf_string_get(fontbuf), 0);
1846 edje_object_part_text_set(wd->ent, "elm.text", eina_strbuf_string_get(txtbuf));
1847 eina_strbuf_free(fontbuf);
1849 edje_object_part_text_cursor_end_set(wd->ent, "elm.text", EDJE_CURSOR_MAIN);
1853 len = _entry_length_get(obj);
1854 cur_str = edje_object_part_text_get(wd->ent, "elm.text");
1855 cur_len = strlen(cur_str);
1857 for (i = 0; i < len; i++)
1859 if(cur_str[i] == '>' && cur_str[i+1] != NULL &&
1860 cur_str[i+1] != '<')
1867 while (jumpcount < len-strlen(ellipsis_string))
1869 cur_str = edje_object_part_text_get(wd->ent, "elm.text");
1873 eina_strbuf_free(txtbuf);
1876 txtbuf = eina_strbuf_new();
1877 eina_strbuf_append_n(txtbuf, cur_str, tagend+1);
1878 eina_strbuf_append(txtbuf, ellipsis_string);
1879 eina_strbuf_append(txtbuf, cur_str+tagend+jumpcount+1);
1880 edje_object_part_text_set(wd->ent, "elm.text", eina_strbuf_string_get(txtbuf));
1881 edje_object_part_text_cursor_end_set(wd->ent, "elm.text", EDJE_CURSOR_MAIN);
1883 if (_is_width_over(obj))
1891 if (txtbuf) eina_strbuf_free(txtbuf);
1896 static int _textinput_control_function(void *data,void *input_data)
1898 /*calculate character count*/
1899 Evas_Object *entry = (Evas_Object *)data;
1900 Widget_Data *wd = elm_widget_data_get((Evas_Object *)data);
1903 size_t insert_text_len=0;
1904 char *text = edje_object_part_text_get(wd->ent, "elm.text");
1906 size_t remain_bytes;
1909 byte_len = strlen(text);/*no of bytes*/
1910 remain_bytes = wd->max_no_of_bytes-byte_len;
1911 sprintf(buf,"%d",remain_bytes);
1912 edje_object_part_text_set(wd->ent, "elm_entry_remain_byte_count", buf);
1915 insert_text = (char *)input_data;
1916 insert_text_len = strlen(insert_text);
1917 if(remain_bytes<insert_text_len)
1919 evas_object_smart_callback_call(entry, "maxlength,reached", NULL);
1922 if(byte_len>=wd->max_no_of_bytes)
1924 evas_object_smart_callback_call(entry, "maxlength,reached", NULL);
1933 * This adds an entry to @p parent object.
1935 * @param parent The parent object
1936 * @return The new object or NULL if it cannot be created
1941 elm_entry_add(Evas_Object *parent)
1943 Evas_Object *obj, *top;
1947 wd = ELM_NEW(Widget_Data);
1948 e = evas_object_evas_get(parent);
1949 wd->bgcolor = EINA_FALSE;
1950 wd->bg = evas_object_rectangle_add(e);
1951 evas_object_color_set(wd->bg, 0, 0, 0, 0);
1952 obj = elm_widget_add(e);
1953 ELM_SET_WIDTYPE(widtype, "entry");
1954 elm_widget_type_set(obj, "entry");
1955 elm_widget_sub_object_add(parent, obj);
1956 elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL);
1957 elm_widget_data_set(obj, wd);
1958 elm_widget_del_hook_set(obj, _del_hook);
1959 elm_widget_theme_hook_set(obj, _theme_hook);
1960 elm_widget_disable_hook_set(obj, _disable_hook);
1961 elm_widget_signal_emit_hook_set(obj, _signal_emit_hook);
1962 elm_widget_signal_callback_add_hook_set(obj, _signal_callback_add_hook);
1963 elm_widget_signal_callback_del_hook_set(obj, _signal_callback_del_hook);
1964 elm_widget_can_focus_set(obj, 1);
1965 #ifdef HAVE_CONFORMANT_AUTOSCROLL
1966 elm_widget_imp_region_get_hook_set(obj, _imp_region_get_hook, NULL);
1969 wd->linewrap = EINA_TRUE;
1970 wd->ellipsis = EINA_FALSE;
1971 wd->char_linewrap= EINA_FALSE;
1972 wd->editable = EINA_TRUE;
1973 wd->disabled = EINA_FALSE;
1974 wd->context_menu = EINA_TRUE;
1976 wd->ellipsis_threshold = 0;
1978 wd->ent = edje_object_add(e);
1979 edje_object_item_provider_set(wd->ent, _get_item, obj);
1980 evas_object_event_callback_add(wd->ent, EVAS_CALLBACK_MOVE, _move, obj);
1981 evas_object_event_callback_add(wd->ent, EVAS_CALLBACK_RESIZE, _resize, obj);
1982 evas_object_event_callback_add(wd->ent, EVAS_CALLBACK_MOUSE_DOWN,
1984 evas_object_event_callback_add(wd->ent, EVAS_CALLBACK_MOUSE_UP,
1986 evas_object_event_callback_add(wd->ent, EVAS_CALLBACK_MOUSE_MOVE,
1989 _elm_theme_object_set(obj, wd->ent, "entry", "base", "default");
1990 edje_object_signal_callback_add(wd->ent, "entry,changed", "elm.text",
1991 _signal_entry_changed, obj);
1992 edje_object_signal_callback_add(wd->ent, "selection,start", "elm.text",
1993 _signal_selection_start, obj);
1994 edje_object_signal_callback_add(wd->ent, "selection,changed", "elm.text",
1995 _signal_selection_changed, obj);
1996 edje_object_signal_callback_add(wd->ent, "selection,cleared", "elm.text",
1997 _signal_selection_cleared, obj);
1998 edje_object_signal_callback_add(wd->ent, "entry,paste,request", "elm.text",
1999 _signal_entry_paste_request, obj);
2000 edje_object_signal_callback_add(wd->ent, "entry,copy,notify", "elm.text",
2001 _signal_entry_copy_notify, obj);
2002 edje_object_signal_callback_add(wd->ent, "entry,cut,notify", "elm.text",
2003 _signal_entry_cut_notify, obj);
2004 edje_object_signal_callback_add(wd->ent, "cursor,changed", "elm.text",
2005 _signal_cursor_changed, obj);
2006 edje_object_signal_callback_add(wd->ent, "anchor,mouse,down,*", "elm.text",
2007 _signal_anchor_down, obj);
2008 edje_object_signal_callback_add(wd->ent, "anchor,mouse,up,*", "elm.text",
2009 _signal_anchor_up, obj);
2010 edje_object_signal_callback_add(wd->ent, "anchor,mouse,move,*", "elm.text",
2011 _signal_anchor_move, obj);
2012 edje_object_signal_callback_add(wd->ent, "anchor,mouse,in,*", "elm.text",
2013 _signal_anchor_in, obj);
2014 edje_object_signal_callback_add(wd->ent, "anchor,mouse,out,*", "elm.text",
2015 _signal_anchor_out, obj);
2016 edje_object_signal_callback_add(wd->ent, "entry,key,enter", "elm.text",
2017 _signal_key_enter, obj);
2018 edje_object_signal_callback_add(wd->ent, "mouse,down,1", "elm.text",
2019 _signal_mouse_down, obj);
2020 edje_object_signal_callback_add(wd->ent, "mouse,up,1", "elm.text",
2021 _signal_mouse_up, obj);
2022 edje_object_signal_callback_add(wd->ent, "mouse,down,1,double", "elm.text",
2023 _signal_mouse_double, obj);
2024 edje_object_part_text_set(wd->ent, "elm.text", "");
2025 elm_widget_resize_object_set(obj, wd->ent);
2028 wd->input_panel_enable = edje_object_part_text_input_panel_enabled_get(wd->ent, "elm.text");
2030 #ifdef HAVE_ELEMENTARY_X
2031 top = elm_widget_top_get(obj);
2032 if ((top) && (elm_win_xwindow_get(top)))
2034 wd->sel_notify_handler =
2035 ecore_event_handler_add(ECORE_X_EVENT_SELECTION_NOTIFY,
2036 _event_selection_notify, obj);
2037 wd->sel_clear_handler =
2038 ecore_event_handler_add(ECORE_X_EVENT_SELECTION_CLEAR,
2039 _event_selection_clear, obj);
2042 elm_drop_target_add(obj, ELM_SEL_FORMAT_MARKUP,_drag_drop_cb, NULL);
2045 entries = eina_list_prepend(entries, obj);
2047 // module - find module for entry
2048 wd->api = _module(obj);
2049 // if found - hook in
2050 if ((wd->api) && (wd->api->obj_hook)) wd->api->obj_hook(obj);
2052 // TODO: convert Elementary to subclassing of Evas_Smart_Class
2053 // TODO: and save some bytes, making descriptions per-class and not instance!
2054 evas_object_smart_callbacks_descriptions_set(obj, _signals);
2058 EAPI void elm_entry_extension_module_data_get(Evas_Object *obj,Elm_Entry_Extension_data *ext_mod)
2060 ELM_CHECK_WIDTYPE(obj, widtype);
2061 Widget_Data *wd = elm_widget_data_get(obj);
2063 ext_mod->cancel = _cancel;
2064 ext_mod->copy = _copy;
2065 ext_mod->cut = _cut;
2066 ext_mod->paste = _paste;
2067 ext_mod->select = _select;
2068 ext_mod->selectall = NULL; /* to be implemented*/
2069 ext_mod->ent = wd->ent;
2070 ext_mod->items = wd->items;
2071 ext_mod->longpress_timer = wd->longpress_timer;
2072 ext_mod->editable = wd->editable;
2073 ext_mod->have_selection = wd->have_selection;
2074 ext_mod->password = wd->password;
2075 ext_mod->selmode = wd->selmode;
2076 ext_mod->context_menu = wd->context_menu;
2080 * This sets the entry object not to line wrap. All input will
2081 * be on a single line, and the entry box will extend with user input.
2083 * @param obj The entry object
2084 * @param single_line If true, the text in the entry
2085 * will be on a single line.
2090 elm_entry_single_line_set(Evas_Object *obj, Eina_Bool single_line)
2092 ELM_CHECK_WIDTYPE(obj, widtype);
2093 Widget_Data *wd = elm_widget_data_get(obj);
2095 Ecore_IMF_Context *ic;
2097 if (wd->single_line == single_line) return;
2098 wd->single_line = single_line;
2099 wd->linewrap = EINA_FALSE;
2100 wd->char_linewrap = EINA_FALSE;
2101 t = eina_stringshare_add(elm_entry_entry_get(obj));
2102 _elm_theme_object_set(obj, wd->ent, "entry", _getbase(obj), elm_widget_style_get(obj));
2103 elm_entry_entry_set(obj, t);
2104 edje_object_part_text_autocapitalization_set(wd->ent, "elm.text", wd->autocapitalize);
2105 edje_object_part_text_autoperiod_set(wd->ent, "elm.text", wd->autoperiod);
2106 ic = elm_entry_imf_context_get(obj);
2109 ecore_imf_context_input_panel_layout_set(ic, wd->input_panel_layout);
2112 eina_stringshare_del(t);
2117 * This returns true if the entry has been set to single line mode.
2118 * See also elm_entry_single_line_set().
2120 * @param obj The entry object
2121 * @return single_line If true, the text in the entry is set to display
2127 elm_entry_single_line_get(const Evas_Object *obj)
2129 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2130 Widget_Data *wd = elm_widget_data_get(obj);
2131 if (!wd) return EINA_FALSE;
2132 return wd->single_line;
2136 * This set's the maximum bytes that can be added in entry.
2138 * @param obj The entry object
2139 * @param max_no_of_bytes Maximum number of bytes entry can have.
2144 elm_entry_maximum_bytes_set(Evas_Object *obj, int max_no_of_bytes)
2146 Widget_Data *wd = elm_widget_data_get(obj);
2148 wd->max_no_of_bytes = max_no_of_bytes;
2149 edje_object_signal_emit(wd->ent, "elm,state,remain,bytes,show", "elm");
2150 edje_object_part_textinput_callback_set(wd->ent, "elm.text", _textinput_control_function,obj);
2155 * This sets the entry object to password mode. All text entered
2156 * and/or displayed within the widget will be replaced with asterisks (*).
2158 * @param obj The entry object
2159 * @param password If true, password mode is enabled.
2164 elm_entry_password_set(Evas_Object *obj, Eina_Bool password)
2166 ELM_CHECK_WIDTYPE(obj, widtype);
2167 Widget_Data *wd = elm_widget_data_get(obj);
2168 Ecore_IMF_Context *ic;
2171 if (wd->password == password) return;
2172 wd->password = password;
2173 wd->show_last_character = EINA_FALSE;
2174 wd->single_line = EINA_TRUE;
2175 wd->linewrap = EINA_FALSE;
2176 wd->char_linewrap = EINA_FALSE;
2177 t = eina_stringshare_add(elm_entry_entry_get(obj));
2178 _elm_theme_object_set(obj, wd->ent, "entry", _getbase(obj), elm_widget_style_get(obj));
2179 elm_entry_entry_set(obj, t);
2181 ic = elm_entry_imf_context_get(obj);
2184 ecore_imf_context_input_panel_layout_set(ic, wd->input_panel_layout);
2187 eina_stringshare_del(t);
2192 * This set's the entry in password mode with out masking the last character entered by user,
2193 * and later masking the character after 2 seconds.
2195 * @param obj The entry object
2196 * @param show_last_character The show_last_character flag (1 for "password mode along with showing last character"
2202 elm_entry_password_show_last_character_set(Evas_Object *obj, Eina_Bool show_last_character)
2204 Widget_Data *wd = elm_widget_data_get(obj);
2207 if ((wd->password == show_last_character)&&(wd->show_last_character ==show_last_character)) return;
2208 wd->show_last_character = show_last_character;
2209 wd->password = show_last_character;
2210 wd->single_line = EINA_TRUE;
2211 wd->linewrap = EINA_FALSE;
2212 wd->char_linewrap = EINA_FALSE;
2213 t = eina_stringshare_add(elm_entry_entry_get(obj));
2214 _elm_theme_object_set(obj, wd->ent, "entry", _getbase(obj), elm_widget_style_get(obj));
2215 elm_entry_entry_set(obj, t);
2216 eina_stringshare_del(t);
2221 * This returns whether password mode is enabled.
2222 * See also elm_entry_password_set().
2224 * @param obj The entry object
2225 * @return If true, the entry is set to display all characters
2231 elm_entry_password_get(const Evas_Object *obj)
2233 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2234 Widget_Data *wd = elm_widget_data_get(obj);
2235 if (!wd) return EINA_FALSE;
2236 return wd->password;
2240 * This sets the text displayed within the entry to @p entry.
2242 * @param obj The entry object
2243 * @param entry The text to be displayed
2248 elm_entry_entry_set(Evas_Object *obj, const char *entry)
2250 ELM_CHECK_WIDTYPE(obj, widtype);
2251 Widget_Data *wd = elm_widget_data_get(obj);
2253 if (!entry) entry = "";
2254 if(wd->max_no_of_bytes)
2256 int len = strlen(entry);
2257 if(len > wd->max_no_of_bytes)
2259 ERR("[ERROR]the length of the text set is more than max no of bytes, text cannot be set");
2263 edje_object_part_text_set(wd->ent, "elm.text", entry);
2264 if (wd->text) eina_stringshare_del(wd->text);
2266 wd->changed = EINA_TRUE;
2271 * This returns the text currently shown in object @p entry.
2272 * See also elm_entry_entry_set().
2274 * @param obj The entry object
2275 * @return The currently displayed text or NULL on failure
2280 elm_entry_entry_get(const Evas_Object *obj)
2282 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
2283 Widget_Data *wd = elm_widget_data_get(obj);
2285 if (!wd) return NULL;
2286 if (wd->text) return wd->text;
2287 text = edje_object_part_text_get(wd->ent, "elm.text");
2290 ERR("text=NULL for edje %p, part 'elm.text'", wd->ent);
2293 eina_stringshare_replace(&wd->text, text);
2298 * This returns all selected text within the entry.
2300 * @param obj The entry object
2301 * @return The selected text within the entry or NULL on failure
2306 elm_entry_selection_get(const Evas_Object *obj)
2308 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
2309 Widget_Data *wd = elm_widget_data_get(obj);
2310 if (!wd) return NULL;
2311 return edje_object_part_text_selection_get(wd->ent, "elm.text");
2315 * This inserts text in @p entry at the beginning of the entry
2318 * @param obj The entry object
2319 * @param entry The text to insert
2324 elm_entry_entry_insert(Evas_Object *obj, const char *entry)
2326 ELM_CHECK_WIDTYPE(obj, widtype);
2327 Widget_Data *wd = elm_widget_data_get(obj);
2329 edje_object_part_text_insert(wd->ent, "elm.text", entry);
2330 wd->changed = EINA_TRUE;
2335 * This enables word line wrapping in the entry object. It is the opposite
2336 * of elm_entry_single_line_set(). Additionally, setting this disables
2337 * character line wrapping.
2338 * See also elm_entry_line_char_wrap_set().
2340 * @param obj The entry object
2341 * @param wrap If true, the entry will be wrapped once it reaches the end
2342 * of the object. Wrapping will occur at the end of the word before the end of the
2348 elm_entry_line_wrap_set(Evas_Object *obj, Eina_Bool wrap)
2350 ELM_CHECK_WIDTYPE(obj, widtype);
2351 Widget_Data *wd = elm_widget_data_get(obj);
2354 if (wd->linewrap == wrap) return;
2355 wd->linewrap = wrap;
2357 wd->char_linewrap = EINA_FALSE;
2358 t = eina_stringshare_add(elm_entry_entry_get(obj));
2359 _elm_theme_object_set(obj, wd->ent, "entry", _getbase(obj), elm_widget_style_get(obj));
2360 elm_entry_entry_set(obj, t);
2361 eina_stringshare_del(t);
2366 * Set wrap width of the entry
2368 * @param obj The entry object
2369 * @param w The wrap width in pixels at a minimum where words need to wrap
2373 elm_entry_wrap_width_set(Evas_Object *obj, Evas_Coord w)
2375 Widget_Data *wd = elm_widget_data_get(obj);
2376 if (wd->wrap_w == w) return;
2382 * get wrap width of the entry
2384 * @param obj The entry object
2385 * @return The wrap width in pixels at a minimum where words need to wrap
2389 elm_entry_wrap_width_get(const Evas_Object *obj)
2391 Widget_Data *wd = elm_widget_data_get(obj);
2396 * This enables character line wrapping in the entry object. It is the opposite
2397 * of elm_entry_single_line_set(). Additionally, setting this disables
2398 * word line wrapping.
2399 * See also elm_entry_line_wrap_set().
2401 * @param obj The entry object
2402 * @param wrap If true, the entry will be wrapped once it reaches the end
2403 * of the object. Wrapping will occur immediately upon reaching the end of the object.
2408 elm_entry_line_char_wrap_set(Evas_Object *obj, Eina_Bool wrap)
2410 ELM_CHECK_WIDTYPE(obj, widtype);
2411 Widget_Data *wd = elm_widget_data_get(obj);
2414 if (wd->char_linewrap == wrap) return;
2415 wd->char_linewrap = wrap;
2416 if(wd->char_linewrap)
2417 wd->linewrap = EINA_FALSE;
2418 t = eina_stringshare_add(elm_entry_entry_get(obj));
2419 _elm_theme_object_set(obj, wd->ent, "entry", _getbase(obj), elm_widget_style_get(obj));
2420 elm_entry_entry_set(obj, t);
2421 eina_stringshare_del(t);
2426 * This sets the editable attribute of the entry.
2428 * @param obj The entry object
2429 * @param editable If true, the entry will be editable by the user.
2430 * If false, it will be set to the disabled state.
2435 elm_entry_editable_set(Evas_Object *obj, Eina_Bool editable)
2437 ELM_CHECK_WIDTYPE(obj, widtype);
2438 Widget_Data *wd = elm_widget_data_get(obj);
2441 if (wd->editable == editable) return;
2442 wd->editable = editable;
2443 t = eina_stringshare_add(elm_entry_entry_get(obj));
2444 _elm_theme_object_set(obj, wd->ent, "entry", _getbase(obj), elm_widget_style_get(obj));
2445 elm_entry_entry_set(obj, t);
2446 eina_stringshare_del(t);
2449 #ifdef HAVE_ELEMENTARY_X
2451 elm_drop_target_add(obj, ELM_SEL_FORMAT_MARKUP, _drag_drop_cb, NULL);
2453 elm_drop_target_del(obj);
2458 * This gets the editable attribute of the entry.
2459 * See also elm_entry_editable_set().
2461 * @param obj The entry object
2462 * @return If true, the entry is editable by the user.
2463 * If false, it is not editable by the user
2468 elm_entry_editable_get(const Evas_Object *obj)
2470 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2471 Widget_Data *wd = elm_widget_data_get(obj);
2472 if (!wd) return EINA_FALSE;
2473 return wd->editable;
2477 * This drops any existing text selection within the entry.
2479 * @param obj The entry object
2484 elm_entry_select_none(Evas_Object *obj)
2486 ELM_CHECK_WIDTYPE(obj, widtype);
2487 Widget_Data *wd = elm_widget_data_get(obj);
2491 wd->selmode = EINA_FALSE;
2492 edje_object_part_text_select_allow_set(wd->ent, "elm.text", 0);
2493 edje_object_signal_emit(wd->ent, "elm,state,select,off", "elm");
2495 wd->have_selection = EINA_FALSE;
2496 edje_object_part_text_select_none(wd->ent, "elm.text");
2500 * This selects all text within the entry.
2502 * @param obj The entry object
2507 elm_entry_select_all(Evas_Object *obj)
2509 ELM_CHECK_WIDTYPE(obj, widtype);
2510 Widget_Data *wd = elm_widget_data_get(obj);
2514 wd->selmode = EINA_FALSE;
2515 edje_object_part_text_select_allow_set(wd->ent, "elm.text", 0);
2516 edje_object_signal_emit(wd->ent, "elm,state,select,off", "elm");
2518 wd->have_selection = EINA_TRUE;
2519 edje_object_part_text_select_all(wd->ent, "elm.text");
2523 * This moves the cursor one place to the right within the entry.
2525 * @param obj The entry object
2526 * @return EINA_TRUE upon success, EINA_FALSE upon failure
2531 elm_entry_cursor_next(Evas_Object *obj)
2533 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2534 Widget_Data *wd = elm_widget_data_get(obj);
2535 if (!wd) return EINA_FALSE;
2536 return edje_object_part_text_cursor_next(wd->ent, "elm.text", EDJE_CURSOR_MAIN);
2540 * This moves the cursor one place to the left within the entry.
2542 * @param obj The entry object
2543 * @return EINA_TRUE upon success, EINA_FALSE upon failure
2548 elm_entry_cursor_prev(Evas_Object *obj)
2550 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2551 Widget_Data *wd = elm_widget_data_get(obj);
2552 if (!wd) return EINA_FALSE;
2553 return edje_object_part_text_cursor_prev(wd->ent, "elm.text", EDJE_CURSOR_MAIN);
2557 * This moves the cursor one line up within the entry.
2559 * @param obj The entry object
2560 * @return EINA_TRUE upon success, EINA_FALSE upon failure
2565 elm_entry_cursor_up(Evas_Object *obj)
2567 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2568 Widget_Data *wd = elm_widget_data_get(obj);
2569 if (!wd) return EINA_FALSE;
2570 return edje_object_part_text_cursor_up(wd->ent, "elm.text", EDJE_CURSOR_MAIN);
2574 * This moves the cursor one line down within the entry.
2576 * @param obj The entry object
2577 * @return EINA_TRUE upon success, EINA_FALSE upon failure
2582 elm_entry_cursor_down(Evas_Object *obj)
2584 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2585 Widget_Data *wd = elm_widget_data_get(obj);
2586 if (!wd) return EINA_FALSE;
2587 return edje_object_part_text_cursor_down(wd->ent, "elm.text", EDJE_CURSOR_MAIN);
2591 * This moves the cursor to the beginning of the entry.
2593 * @param obj The entry object
2598 elm_entry_cursor_begin_set(Evas_Object *obj)
2600 ELM_CHECK_WIDTYPE(obj, widtype);
2601 Widget_Data *wd = elm_widget_data_get(obj);
2603 edje_object_part_text_cursor_begin_set(wd->ent, "elm.text", EDJE_CURSOR_MAIN);
2607 * This moves the cursor to the end of the entry.
2609 * @param obj The entry object
2614 elm_entry_cursor_end_set(Evas_Object *obj)
2616 ELM_CHECK_WIDTYPE(obj, widtype);
2617 Widget_Data *wd = elm_widget_data_get(obj);
2619 edje_object_part_text_cursor_end_set(wd->ent, "elm.text", EDJE_CURSOR_MAIN);
2623 * This moves the cursor to the beginning of the current line.
2625 * @param obj The entry object
2630 elm_entry_cursor_line_begin_set(Evas_Object *obj)
2632 ELM_CHECK_WIDTYPE(obj, widtype);
2633 Widget_Data *wd = elm_widget_data_get(obj);
2635 edje_object_part_text_cursor_line_begin_set(wd->ent, "elm.text", EDJE_CURSOR_MAIN);
2639 * This moves the cursor to the end of the current line.
2641 * @param obj The entry object
2646 elm_entry_cursor_line_end_set(Evas_Object *obj)
2648 ELM_CHECK_WIDTYPE(obj, widtype);
2649 Widget_Data *wd = elm_widget_data_get(obj);
2651 edje_object_part_text_cursor_line_end_set(wd->ent, "elm.text", EDJE_CURSOR_MAIN);
2655 * This begins a selection within the entry as though
2656 * the user were holding down the mouse button to make a selection.
2658 * @param obj The entry object
2663 elm_entry_cursor_selection_begin(Evas_Object *obj)
2665 ELM_CHECK_WIDTYPE(obj, widtype);
2666 Widget_Data *wd = elm_widget_data_get(obj);
2668 edje_object_part_text_select_begin(wd->ent, "elm.text");
2672 * This ends a selection within the entry as though
2673 * the user had just released the mouse button while making a selection.
2675 * @param obj The entry object
2680 elm_entry_cursor_selection_end(Evas_Object *obj)
2682 ELM_CHECK_WIDTYPE(obj, widtype);
2683 Widget_Data *wd = elm_widget_data_get(obj);
2685 edje_object_part_text_select_extend(wd->ent, "elm.text");
2689 * TODO: fill this in
2691 * @param obj The entry object
2692 * @return TODO: fill this in
2697 elm_entry_cursor_is_format_get(const Evas_Object *obj)
2699 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2700 Widget_Data *wd = elm_widget_data_get(obj);
2701 if (!wd) return EINA_FALSE;
2702 return edje_object_part_text_cursor_is_format_get(wd->ent, "elm.text", EDJE_CURSOR_MAIN);
2706 * This returns whether the cursor is visible.
2708 * @param obj The entry object
2709 * @return If true, the cursor is visible.
2714 elm_entry_cursor_is_visible_format_get(const Evas_Object *obj)
2716 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2717 Widget_Data *wd = elm_widget_data_get(obj);
2718 if (!wd) return EINA_FALSE;
2719 return edje_object_part_text_cursor_is_visible_format_get(wd->ent, "elm.text", EDJE_CURSOR_MAIN);
2723 * TODO: fill this in
2725 * @param obj The entry object
2726 * @return TODO: fill this in
2731 elm_entry_cursor_content_get(const Evas_Object *obj)
2733 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
2734 Widget_Data *wd = elm_widget_data_get(obj);
2735 if (!wd) return NULL;
2736 return edje_object_part_text_cursor_content_get(wd->ent, "elm.text", EDJE_CURSOR_MAIN);
2740 * This executes a "cut" action on the selected text in the entry.
2742 * @param obj The entry object
2747 elm_entry_selection_cut(Evas_Object *obj)
2749 ELM_CHECK_WIDTYPE(obj, widtype);
2750 Widget_Data *wd = elm_widget_data_get(obj);
2752 _cut(obj, NULL, NULL);
2756 * This executes a "copy" action on the selected text in the entry.
2758 * @param obj The entry object
2763 elm_entry_selection_copy(Evas_Object *obj)
2765 ELM_CHECK_WIDTYPE(obj, widtype);
2766 Widget_Data *wd = elm_widget_data_get(obj);
2768 _copy(obj, NULL, NULL);
2772 * This executes a "paste" action in the entry.
2774 * @param obj The entry object
2779 elm_entry_selection_paste(Evas_Object *obj)
2781 ELM_CHECK_WIDTYPE(obj, widtype);
2782 Widget_Data *wd = elm_widget_data_get(obj);
2784 _paste(obj, NULL, NULL);
2788 * This clears and frees the items in a entry's contextual (right click) menu.
2790 * @param obj The entry object
2795 elm_entry_context_menu_clear(Evas_Object *obj)
2797 ELM_CHECK_WIDTYPE(obj, widtype);
2798 Widget_Data *wd = elm_widget_data_get(obj);
2799 Elm_Entry_Context_Menu_Item *it;
2801 EINA_LIST_FREE(wd->items, it)
2803 eina_stringshare_del(it->label);
2804 eina_stringshare_del(it->icon_file);
2805 eina_stringshare_del(it->icon_group);
2811 * This adds an item to the entry's contextual menu.
2813 * @param obj The entry object
2814 * @param label The item's text label
2815 * @param icon_file The item's icon file
2816 * @param icon_type The item's icon type
2817 * @param func The callback to execute when the item is clicked
2818 * @param data The data to associate with the item for related functions
2823 elm_entry_context_menu_item_add(Evas_Object *obj, const char *label, const char *icon_file, Elm_Icon_Type icon_type, Evas_Smart_Cb func, const void *data)
2825 ELM_CHECK_WIDTYPE(obj, widtype);
2826 Widget_Data *wd = elm_widget_data_get(obj);
2827 Elm_Entry_Context_Menu_Item *it;
2829 it = calloc(1, sizeof(Elm_Entry_Context_Menu_Item));
2831 wd->items = eina_list_append(wd->items, it);
2833 it->label = eina_stringshare_add(label);
2834 it->icon_file = eina_stringshare_add(icon_file);
2835 it->icon_type = icon_type;
2837 it->data = (void *)data;
2841 * This disables the entry's contextual (right click) menu.
2843 * @param obj The entry object
2844 * @param disabled If true, the menu is disabled
2849 elm_entry_context_menu_disabled_set(Evas_Object *obj, Eina_Bool disabled)
2851 ELM_CHECK_WIDTYPE(obj, widtype);
2852 Widget_Data *wd = elm_widget_data_get(obj);
2854 if (wd->context_menu == !disabled) return;
2855 wd->context_menu = !disabled;
2859 * This returns whether the entry's contextual (right click) menu is disabled.
2861 * @param obj The entry object
2862 * @return If true, the menu is disabled
2867 elm_entry_context_menu_disabled_get(const Evas_Object *obj)
2869 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
2870 Widget_Data *wd = elm_widget_data_get(obj);
2871 if (!wd) return EINA_FALSE;
2872 return !wd->context_menu;
2876 * This appends a custom item provider to the list for that entry
2878 * This appends the given callback. The list is walked from beginning to end
2879 * with each function called given the item href string in the text. If the
2880 * function returns an object handle other than NULL (it should create an
2881 * and object to do this), then this object is used to replace that item. If
2882 * not the next provider is called until one provides an item object, or the
2883 * default provider in entry does.
2885 * @param obj The entry object
2886 * @param func The function called to provide the item object
2887 * @param data The data passed to @p func
2892 elm_entry_item_provider_append(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *entry, const char *item), void *data)
2894 ELM_CHECK_WIDTYPE(obj, widtype);
2895 Widget_Data *wd = elm_widget_data_get(obj);
2898 Elm_Entry_Item_Provider *ip = calloc(1, sizeof(Elm_Entry_Item_Provider));
2902 wd->item_providers = eina_list_append(wd->item_providers, ip);
2906 * This prepends a custom item provider to the list for that entry
2908 * This prepends the given callback. See elm_entry_item_provider_append() for
2911 * @param obj The entry object
2912 * @param func The function called to provide the item object
2913 * @param data The data passed to @p func
2918 elm_entry_item_provider_prepend(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *entry, const char *item), void *data)
2920 ELM_CHECK_WIDTYPE(obj, widtype);
2921 Widget_Data *wd = elm_widget_data_get(obj);
2924 Elm_Entry_Item_Provider *ip = calloc(1, sizeof(Elm_Entry_Item_Provider));
2928 wd->item_providers = eina_list_prepend(wd->item_providers, ip);
2932 * This removes a custom item provider to the list for that entry
2934 * This removes the given callback. See elm_entry_item_provider_append() for
2937 * @param obj The entry object
2938 * @param func The function called to provide the item object
2939 * @param data The data passed to @p func
2944 elm_entry_item_provider_remove(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *entry, const char *item), void *data)
2946 ELM_CHECK_WIDTYPE(obj, widtype);
2947 Widget_Data *wd = elm_widget_data_get(obj);
2949 Elm_Entry_Item_Provider *ip;
2952 EINA_LIST_FOREACH(wd->item_providers, l, ip)
2954 if ((ip->func == func) && (ip->data == data))
2956 wd->item_providers = eina_list_remove_list(wd->item_providers, l);
2964 * This converts a markup (HTML-like) string into UTF-8.
2966 * @param s The string (in markup) to be converted
2967 * @return The converted string (in UTF-8)
2972 elm_entry_markup_to_utf8(const char *s)
2974 char *ss = _mkup_to_text(s);
2975 if (!ss) ss = strdup("");
2980 * This converts a UTF-8 string into markup (HTML-like).
2982 * @param s The string (in UTF-8) to be converted
2983 * @return The converted string (in markup)
2988 elm_entry_utf8_to_markup(const char *s)
2990 char *ss = _text_to_mkup(s);
2991 if (!ss) ss = strdup("");
2996 * Get the input method context in the entry widget
2998 * @param obj The entry object
2999 * @return The input method context
3003 EAPI Ecore_IMF_Context *elm_entry_imf_context_get(Evas_Object *obj)
3005 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
3006 Widget_Data *wd = elm_widget_data_get(obj);
3007 if (!wd || !wd->ent) return NULL;
3009 return edje_object_part_text_imf_context_get(wd->ent, "elm.text");
3013 * Set whether entry should enable the return key on soft keyboard automatically
3015 * @param obj The entry object
3016 * @param on If true, entry enables the return key on soft keyboard automatically.
3021 elm_entry_autoenable_returnkey_set(Evas_Object *obj, Eina_Bool on)
3023 ELM_CHECK_WIDTYPE(obj, widtype);
3024 Widget_Data *wd = elm_widget_data_get(obj);
3027 wd->autoreturnkey = on;
3028 _check_enable_returnkey(obj);
3032 * Set whether entry should support auto capitalization
3034 * @param obj The entry object
3035 * @param on If true, entry suports auto capitalization.
3040 elm_entry_autocapitalization_set(Evas_Object *obj, Eina_Bool autocap)
3042 ELM_CHECK_WIDTYPE(obj, widtype);
3043 Widget_Data *wd = elm_widget_data_get(obj);
3047 wd->autocapitalize = EINA_FALSE;
3049 wd->autocapitalize = autocap;
3051 edje_object_part_text_autocapitalization_set(wd->ent, "elm.text", wd->autocapitalize);
3055 * Set whether entry should support auto period
3057 * @param obj The entry object
3058 * @param on If true, entry suports auto period.
3063 elm_entry_autoperiod_set(Evas_Object *obj, Eina_Bool autoperiod)
3065 ELM_CHECK_WIDTYPE(obj, widtype);
3066 Widget_Data *wd = elm_widget_data_get(obj);
3070 wd->autoperiod = EINA_FALSE;
3072 wd->autoperiod = autoperiod;
3074 edje_object_part_text_autoperiod_set(wd->ent, "elm.text", wd->autoperiod);
3078 * Set the font size on the entry object
3080 * @param obj The entry object
3081 * @param size font size
3086 elm_entry_fontsize_set(Evas_Object *obj, int fontsize)
3088 ELM_CHECK_WIDTYPE(obj, widtype);
3089 Widget_Data *wd = elm_widget_data_get(obj);
3090 Eina_Strbuf *fontbuf = NULL;
3095 t = eina_stringshare_add(elm_entry_entry_get(obj));
3096 fontbuf = eina_strbuf_new();
3097 eina_strbuf_append_printf(fontbuf, "%d", fontsize);
3099 if (fontsize == 0) removeflag = 1; // remove fontsize tag
3101 if (_stringshare_key_value_replace(&t, "font_size", eina_strbuf_string_get(fontbuf), removeflag) == 0)
3103 elm_entry_entry_set(obj, t);
3107 eina_strbuf_free(fontbuf);
3108 eina_stringshare_del(t);
3112 * Set the text align on the entry object
3114 * @param obj The entry object
3115 * @param align align mode
3120 elm_entry_text_align_set(Evas_Object *obj, const char *alignmode)
3122 ELM_CHECK_WIDTYPE(obj, widtype);
3123 Widget_Data *wd = elm_widget_data_get(obj);
3128 t = eina_stringshare_add(elm_entry_entry_get(obj));
3130 if (len <= 0) return;
3132 if (_stringshare_key_value_replace(&t, "align", alignmode, 0) == 0)
3133 elm_entry_entry_set(obj, t);
3137 eina_stringshare_del(t);
3141 * Set the text color on the entry object
3143 * @param obj The entry object
3144 * @param r Red property background color of The entry object
3145 * @param g Green property background color of The entry object
3146 * @param b Blue property background color of The entry object
3147 * @param a Alpha property background alpha of The entry object
3152 elm_entry_text_color_set(Evas_Object *obj, unsigned int r, unsigned int g, unsigned int b, unsigned int a)
3154 ELM_CHECK_WIDTYPE(obj, widtype);
3155 Widget_Data *wd = elm_widget_data_get(obj);
3156 Eina_Strbuf *colorbuf = NULL;
3161 t = eina_stringshare_add(elm_entry_entry_get(obj));
3163 if (len <= 0) return;
3164 colorbuf = eina_strbuf_new();
3165 eina_strbuf_append_printf(colorbuf, "#%02X%02X%02X%02X", r, g, b, a);
3167 if (_stringshare_key_value_replace(&t, "color", eina_strbuf_string_get(colorbuf), 0) == 0)
3169 elm_entry_entry_set(obj, t);
3173 eina_strbuf_free(colorbuf);
3174 eina_stringshare_del(t);
3179 * Set background color of the entry
3181 * @param obj The entry object
3182 * @param r Red property background color of The entry object
3183 * @param g Green property background color of The entry object
3184 * @param b Blue property background color of The entry object
3185 * @param a Alpha property background alpha of The entry object
3189 elm_entry_background_color_set(Evas_Object *obj, unsigned int r, unsigned int g, unsigned int b, unsigned int a)
3191 ELM_CHECK_WIDTYPE(obj, widtype);
3192 Widget_Data *wd = elm_widget_data_get(obj);
3193 evas_object_color_set(wd->bg, r, g, b, a);
3195 if (wd->bgcolor == EINA_FALSE)
3198 edje_object_part_swallow(wd->ent, "entry.swallow.background", wd->bg);
3203 * Set the ellipsis behavior of the entry
3205 * @param obj The entry object
3206 * @param ellipsis To ellipsis text or not
3210 elm_entry_ellipsis_set(Evas_Object *obj, Eina_Bool ellipsis)
3212 ELM_CHECK_WIDTYPE(obj, widtype);
3213 Widget_Data *wd = elm_widget_data_get(obj);
3214 if (wd->ellipsis == ellipsis) return;
3215 wd->ellipsis = ellipsis;
3221 * This sets the attribute to show the input panel automatically.
3223 * @param obj The entry object
3224 * @param enabled If true, the input panel is appeared when entry is clicked or has a focus
3229 elm_entry_input_panel_enabled_set(Evas_Object *obj, Eina_Bool enabled)
3231 ELM_CHECK_WIDTYPE(obj, widtype);
3232 Widget_Data *wd = elm_widget_data_get(obj);
3235 wd->input_panel_enable = enabled;
3236 edje_object_part_text_input_panel_enabled_set(wd->ent, "elm.text", enabled);
3240 * Set the input panel layout of the entry
3242 * @param obj The entry object
3243 * @param layout the layout to set
3248 elm_entry_input_panel_layout_set(Evas_Object *obj, Elm_Input_Panel_Layout layout)
3250 ELM_CHECK_WIDTYPE(obj, widtype);
3251 Widget_Data *wd = elm_widget_data_get(obj);
3254 Ecore_IMF_Context *ic = elm_entry_imf_context_get(obj);
3257 wd->input_panel_layout = layout;
3259 ecore_imf_context_input_panel_layout_set(ic, (Ecore_IMF_Input_Panel_Layout)layout);
3262 /* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/