summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-12-13 15:05:15 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-12-13 15:36:10 +0900
commit71552564228d7163260e56d9549b6a19c7b47a72 (patch)
tree166dfd51ff816a0b08a27b245dbfbc3a10e3c525
parentd59003a6045d931f6590024cd15b2f3837a5857b (diff)
text: Fix event propagation (changed,user)
-rw-r--r--src/bin/elementary/test_gfx_filters.c4
-rw-r--r--src/lib/elementary/efl_ui_internal_text_interactive.c2
-rw-r--r--src/lib/elementary/efl_ui_text.c28
3 files changed, 19 insertions, 15 deletions
diff --git a/src/bin/elementary/test_gfx_filters.c b/src/bin/elementary/test_gfx_filters.c
index b8f0cb43cb..958688f308 100644
--- a/src/bin/elementary/test_gfx_filters.c
+++ b/src/bin/elementary/test_gfx_filters.c
@@ -522,10 +522,6 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
522 efl_gfx_filter_program_set(o, code_filter, "code"); 522 efl_gfx_filter_program_set(o, code_filter, "code");
523 efl_text_gfx_filter_set(o, "code"); 523 efl_text_gfx_filter_set(o, "code");
524 524
525 // FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME
526 // Efl.Ui.Text doesn't seem to trigger the proper events during edit
527 efl_event_callback_add(o, EFL_EVENT_KEY_DOWN, _code_changed_hack, win);
528
529 efl_content_set(efl_part(split, "second"), code); 525 efl_content_set(efl_part(split, "second"), code);
530 } 526 }
531 527
diff --git a/src/lib/elementary/efl_ui_internal_text_interactive.c b/src/lib/elementary/efl_ui_internal_text_interactive.c
index 002a4ddbd8..b9e97071a0 100644
--- a/src/lib/elementary/efl_ui_internal_text_interactive.c
+++ b/src/lib/elementary/efl_ui_internal_text_interactive.c
@@ -1057,7 +1057,7 @@ _key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void
1057end: 1057end:
1058 if (changed_user) 1058 if (changed_user)
1059 { 1059 {
1060 efl_event_callback_legacy_call(obj, 1060 efl_event_callback_call(obj,
1061 EFL_UI_TEXT_INTERACTIVE_EVENT_CHANGED_USER, &info); 1061 EFL_UI_TEXT_INTERACTIVE_EVENT_CHANGED_USER, &info);
1062 } 1062 }
1063 (void) 0; 1063 (void) 0;
diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c
index d3c05639e8..b3d2e5f155 100644
--- a/src/lib/elementary/efl_ui_text.c
+++ b/src/lib/elementary/efl_ui_text.c
@@ -268,19 +268,20 @@ static void _create_selection_handlers(Evas_Object *obj, Efl_Ui_Text_Data *sd);
268static void _magnifier_move(void *data); 268static void _magnifier_move(void *data);
269static void _update_decorations(Eo *obj); 269static void _update_decorations(Eo *obj);
270static void _create_text_cursors(Eo *obj, Efl_Ui_Text_Data *sd); 270static void _create_text_cursors(Eo *obj, Efl_Ui_Text_Data *sd);
271static void _efl_ui_text_changed_cb(void *data EINA_UNUSED, const Efl_Event *event); 271static void _efl_ui_text_changed_cb(void *data, const Efl_Event *event);
272static void _efl_ui_text_selection_changed_cb(void *data EINA_UNUSED, const Efl_Event *event); 272static void _efl_ui_text_changed_user_cb(void *data, const Efl_Event *event);
273static void _efl_ui_text_cursor_changed_cb(void *data EINA_UNUSED, const Efl_Event *event); 273static void _efl_ui_text_selection_changed_cb(void *data, const Efl_Event *event);
274static void _efl_ui_text_move_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED); 274static void _efl_ui_text_cursor_changed_cb(void *data, const Efl_Event *event);
275static void _efl_ui_text_select_none(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd); 275static void _efl_ui_text_move_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
276static void _efl_ui_text_anchor_hover_end(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd); 276static void _efl_ui_text_select_none(Eo *obj, Efl_Ui_Text_Data *sd);
277static void _efl_ui_text_anchor_hover_end(Eo *obj, Efl_Ui_Text_Data *sd);
277static void _efl_ui_text_anchor_hover_parent_set(Eo *obj, Efl_Ui_Text_Data *sd, Evas_Object *parent); 278static void _efl_ui_text_anchor_hover_parent_set(Eo *obj, Efl_Ui_Text_Data *sd, Evas_Object *parent);
278static const char* _efl_ui_text_selection_get(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd); 279static const char* _efl_ui_text_selection_get(Eo *obj, Efl_Ui_Text_Data *sd);
279static void _edje_signal_emit(Efl_Ui_Text_Data *obj, const char *sig, const char *src); 280static void _edje_signal_emit(Efl_Ui_Text_Data *obj, const char *sig, const char *src);
280static void _decoration_defer_all(Eo *obj); 281static void _decoration_defer_all(Eo *obj);
281static inline Eo * _decoration_create(Eo *obj, Efl_Ui_Text_Data *sd, const char *source, Eina_Bool above); 282static inline Eo * _decoration_create(Eo *obj, Efl_Ui_Text_Data *sd, const char *source, Eina_Bool above);
282static void _decoration_defer(Eo *obj); 283static void _decoration_defer(Eo *obj);
283static void _anchors_clear_all(Evas_Object *o EINA_UNUSED, Efl_Ui_Text_Data *sd); 284static void _anchors_clear_all(Evas_Object *o, Efl_Ui_Text_Data *sd);
284static void _unused_item_objs_free(Efl_Ui_Text_Data *sd); 285static void _unused_item_objs_free(Efl_Ui_Text_Data *sd);
285static void _clear_text_selection(Efl_Ui_Text_Data *sd); 286static void _clear_text_selection(Efl_Ui_Text_Data *sd);
286 287
@@ -3079,7 +3080,7 @@ _efl_ui_text_efl_object_constructor(Eo *obj, Efl_Ui_Text_Data *sd)
3079 evas_object_size_hint_align_set 3080 evas_object_size_hint_align_set
3080 (sd->entry_edje, EVAS_HINT_FILL, EVAS_HINT_FILL); 3081 (sd->entry_edje, EVAS_HINT_FILL, EVAS_HINT_FILL);
3081 efl_event_callback_add(text_obj, EFL_UI_TEXT_INTERACTIVE_EVENT_CHANGED_USER, 3082 efl_event_callback_add(text_obj, EFL_UI_TEXT_INTERACTIVE_EVENT_CHANGED_USER,
3082 _efl_ui_text_changed_cb, obj); 3083 _efl_ui_text_changed_user_cb, obj);
3083 efl_event_callback_add(text_obj, EFL_CANVAS_TEXT_EVENT_CHANGED, 3084 efl_event_callback_add(text_obj, EFL_CANVAS_TEXT_EVENT_CHANGED,
3084 _efl_ui_text_changed_cb, obj); 3085 _efl_ui_text_changed_cb, obj);
3085 efl_event_callback_add(text_obj, EFL_UI_TEXT_INTERACTIVE_EVENT_SELECTION_CHANGED, 3086 efl_event_callback_add(text_obj, EFL_UI_TEXT_INTERACTIVE_EVENT_SELECTION_CHANGED,
@@ -3302,7 +3303,7 @@ _efl_ui_text_efl_object_destructor(Eo *obj, Efl_Ui_Text_Data *sd)
3302 3303
3303 text_obj = edje_object_part_swallow_get(sd->entry_edje, "elm.text"); 3304 text_obj = edje_object_part_swallow_get(sd->entry_edje, "elm.text");
3304 efl_event_callback_del(text_obj, EFL_UI_TEXT_INTERACTIVE_EVENT_CHANGED_USER, 3305 efl_event_callback_del(text_obj, EFL_UI_TEXT_INTERACTIVE_EVENT_CHANGED_USER,
3305 _efl_ui_text_changed_cb, obj); 3306 _efl_ui_text_changed_user_cb, obj);
3306 efl_event_callback_del(text_obj, EFL_CANVAS_TEXT_EVENT_CHANGED, 3307 efl_event_callback_del(text_obj, EFL_CANVAS_TEXT_EVENT_CHANGED,
3307 _efl_ui_text_changed_cb, obj); 3308 _efl_ui_text_changed_cb, obj);
3308 efl_event_callback_del(text_obj, EFL_UI_TEXT_INTERACTIVE_EVENT_SELECTION_CHANGED, 3309 efl_event_callback_del(text_obj, EFL_UI_TEXT_INTERACTIVE_EVENT_SELECTION_CHANGED,
@@ -5241,6 +5242,13 @@ _efl_ui_text_changed_cb(void *data, const Efl_Event *event EINA_UNUSED)
5241} 5242}
5242 5243
5243static void 5244static void
5245_efl_ui_text_changed_user_cb(void *data, const Efl_Event *event EINA_UNUSED)
5246{
5247 _decoration_defer_all(data);
5248 _entry_changed_handle(data, EFL_UI_TEXT_EVENT_CHANGED_USER);
5249}
5250
5251static void
5244_efl_ui_text_cursor_changed_cb(void *data, const Efl_Event *event EINA_UNUSED) 5252_efl_ui_text_cursor_changed_cb(void *data, const Efl_Event *event EINA_UNUSED)
5245{ 5253{
5246 EFL_UI_TEXT_DATA_GET(data, sd); 5254 EFL_UI_TEXT_DATA_GET(data, sd);