summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-12-13 15:19:43 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-12-13 15:36:10 +0900
commite5d80f1ced865a70404156fbe08f2ab67f6eabf6 (patch)
tree29983b179d5334451f5b212d001826aab6c7d3d4
parent315c4f761e03de99bff943cd12408db14d39cd2c (diff)
text: Don't use legacy events
Efl.Ui.Text is an EO object, why use the legacy event API?
-rw-r--r--src/lib/elementary/efl_ui_internal_text_interactive.c8
-rw-r--r--src/lib/elementary/efl_ui_text.c65
2 files changed, 31 insertions, 42 deletions
diff --git a/src/lib/elementary/efl_ui_internal_text_interactive.c b/src/lib/elementary/efl_ui_internal_text_interactive.c
index 2f8c8f859a..f90eeb29d0 100644
--- a/src/lib/elementary/efl_ui_internal_text_interactive.c
+++ b/src/lib/elementary/efl_ui_internal_text_interactive.c
@@ -356,7 +356,7 @@ _entry_imf_event_delete_surrounding_cb(void *data, Ecore_IMF_Context *ctx EINA_U
356 356
357 char *tmp = efl_canvas_text_range_text_get(obj, en->sel_start, en->sel_end); 357 char *tmp = efl_canvas_text_range_text_get(obj, en->sel_start, en->sel_end);
358 358
359 efl_event_callback_legacy_call(obj, EFL_UI_TEXT_EVENT_CHANGED_USER, &info); 359 efl_event_callback_call(obj, EFL_UI_TEXT_EVENT_CHANGED_USER, &info);
360 360
361 free(tmp); 361 free(tmp);
362 362
@@ -508,7 +508,7 @@ _sel_cursor_changed(void *data, const Efl_Event *event EINA_UNUSED)
508{ 508{
509 Eo *obj = data; 509 Eo *obj = data;
510 510
511 efl_event_callback_legacy_call(obj, EFL_UI_TEXT_INTERACTIVE_EVENT_SELECTION_CHANGED, NULL); 511 efl_event_callback_call(obj, EFL_UI_TEXT_INTERACTIVE_EVENT_SELECTION_CHANGED, NULL);
512} 512}
513 513
514static void 514static void
@@ -599,7 +599,7 @@ _range_del_emit(Evas_Object *obj, Efl_Text_Cursor_Cursor *cur1, Efl_Text_Cursor_
599 tmp = efl_canvas_text_range_text_get(obj, cur1, cur2); 599 tmp = efl_canvas_text_range_text_get(obj, cur1, cur2);
600 info.content = tmp; 600 info.content = tmp;
601 601
602 efl_event_callback_legacy_call(obj, EFL_UI_TEXT_EVENT_CHANGED_USER, &info); 602 efl_event_callback_call(obj, EFL_UI_TEXT_EVENT_CHANGED_USER, &info);
603 603
604 if (tmp) free(tmp); 604 if (tmp) free(tmp);
605 605
@@ -630,7 +630,7 @@ _delete_emit(Eo *obj, Evas_Textblock_Cursor *c, Efl_Ui_Internal_Text_Interactive
630 info.length = 1; 630 info.length = 1;
631 info.content = tmp; 631 info.content = tmp;
632 632
633 efl_event_callback_legacy_call(obj, EFL_UI_TEXT_EVENT_CHANGED_USER, &info); 633 efl_event_callback_call(obj, EFL_UI_TEXT_EVENT_CHANGED_USER, &info);
634 if (tmp) free(tmp); 634 if (tmp) free(tmp);
635 635
636 evas_textblock_cursor_char_delete(c); 636 evas_textblock_cursor_char_delete(c);
diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c
index 2ee45814c3..4f3e45f7df 100644
--- a/src/lib/elementary/efl_ui_text.c
+++ b/src/lib/elementary/efl_ui_text.c
@@ -460,7 +460,7 @@ _validate(Evas_Object *obj)
460 if (sd->validators == 0) return; 460 if (sd->validators == 0) return;
461 461
462 vc.text = edje_object_part_text_get(sd->entry_edje, "elm.text"); 462 vc.text = edje_object_part_text_get(sd->entry_edje, "elm.text");
463 res = efl_event_callback_legacy_call(obj, EFL_UI_TEXT_EVENT_VALIDATE, (void *)&vc); 463 res = efl_event_callback_call(obj, EFL_UI_TEXT_EVENT_VALIDATE, (void *)&vc);
464 buf = eina_strbuf_new(); 464 buf = eina_strbuf_new();
465 eina_strbuf_append_printf(buf, "validation,%s,%s", vc.signal, res == EINA_FALSE ? "fail" : "pass"); 465 eina_strbuf_append_printf(buf, "validation,%s,%s", vc.signal, res == EINA_FALSE ? "fail" : "pass");
466 edje_object_signal_emit(sd->scr_edje, eina_strbuf_string_get(buf), "elm"); 466 edje_object_signal_emit(sd->scr_edje, eina_strbuf_string_get(buf), "elm");
@@ -955,7 +955,7 @@ _efl_ui_text_elm_widget_theme_apply(Eo *obj, Efl_Ui_Text_Data *sd)
955 _efl_ui_text_guide_update(obj, !sd->has_text); 955 _efl_ui_text_guide_update(obj, !sd->has_text);
956 efl_event_thaw(obj); 956 efl_event_thaw(obj);
957 957
958 efl_event_callback_legacy_call(obj, EFL_UI_LAYOUT_EVENT_THEME_CHANGED, NULL); 958 efl_event_callback_call(obj, EFL_UI_LAYOUT_EVENT_THEME_CHANGED, NULL);
959 959
960 evas_object_unref(obj); 960 evas_object_unref(obj);
961 961
@@ -1406,8 +1406,7 @@ _paste_cb(Eo *obj)
1406 1406
1407 EFL_UI_TEXT_DATA_GET(obj, sd); 1407 EFL_UI_TEXT_DATA_GET(obj, sd);
1408 1408
1409 efl_event_callback_legacy_call 1409 efl_event_callback_call(obj, EFL_UI_EVENT_SELECTION_PASTE, NULL);
1410 (obj, EFL_UI_EVENT_SELECTION_PASTE, NULL);
1411 1410
1412 sd->selection_asked = EINA_TRUE; 1411 sd->selection_asked = EINA_TRUE;
1413 1412
@@ -1471,8 +1470,7 @@ _cut_cb(Eo *obj)
1471 Efl_Text_Cursor_Cursor *start, *end; 1470 Efl_Text_Cursor_Cursor *start, *end;
1472 EFL_UI_TEXT_DATA_GET(obj, sd); 1471 EFL_UI_TEXT_DATA_GET(obj, sd);
1473 1472
1474 efl_event_callback_legacy_call 1473 efl_event_callback_call(obj, EFL_UI_EVENT_SELECTION_CUT, NULL);
1475 (obj, EFL_UI_EVENT_SELECTION_CUT, NULL);
1476 /* Store it */ 1474 /* Store it */
1477 sd->sel_mode = EINA_FALSE; 1475 sd->sel_mode = EINA_FALSE;
1478 if (!_elm_config->desktop_entry) 1476 if (!_elm_config->desktop_entry)
@@ -1501,8 +1499,7 @@ _copy_cb(Eo *obj)
1501{ 1499{
1502 EFL_UI_TEXT_DATA_GET(obj, sd); 1500 EFL_UI_TEXT_DATA_GET(obj, sd);
1503 1501
1504 efl_event_callback_legacy_call 1502 efl_event_callback_call(obj, EFL_UI_EVENT_SELECTION_COPY, NULL);
1505 (obj, EFL_UI_EVENT_SELECTION_COPY, NULL);
1506 sd->sel_mode = EINA_FALSE; 1503 sd->sel_mode = EINA_FALSE;
1507 if (!_elm_config->desktop_entry) 1504 if (!_elm_config->desktop_entry)
1508 { 1505 {
@@ -1561,7 +1558,7 @@ _menu_call(Evas_Object *obj)
1561 1558
1562 if (sd->anchor_hover.hover) return; 1559 if (sd->anchor_hover.hover) return;
1563 1560
1564 efl_event_callback_legacy_call(obj, EFL_UI_TEXT_EVENT_CONTEXT_OPEN, NULL); 1561 efl_event_callback_call(obj, EFL_UI_TEXT_EVENT_CONTEXT_OPEN, NULL);
1565 1562
1566 if ((sd->api) && (sd->api->obj_longpress)) 1563 if ((sd->api) && (sd->api->obj_longpress))
1567 { 1564 {
@@ -1842,8 +1839,7 @@ _long_press_cb(void *data)
1842 sd->long_pressed = EINA_TRUE; 1839 sd->long_pressed = EINA_TRUE;
1843 1840
1844 sd->longpress_timer = NULL; 1841 sd->longpress_timer = NULL;
1845 efl_event_callback_legacy_call 1842 efl_event_callback_call(data, EFL_UI_EVENT_LONGPRESSED, NULL);
1846 (data, EFL_UI_EVENT_LONGPRESSED, NULL);
1847 1843
1848 return ECORE_CALLBACK_CANCEL; 1844 return ECORE_CALLBACK_CANCEL;
1849} 1845}
@@ -2102,7 +2098,7 @@ _entry_changed_handle(void *data,
2102 /* callback - this could call callbacks that delete the 2098 /* callback - this could call callbacks that delete the
2103 * entry... thus... any access to sd after this could be 2099 * entry... thus... any access to sd after this could be
2104 * invalid */ 2100 * invalid */
2105 efl_event_callback_legacy_call(data, event, info); 2101 efl_event_callback_call(data, event, info);
2106} 2102}
2107 2103
2108static void 2104static void
@@ -2118,11 +2114,11 @@ _entry_changed_user_signal_cb(void *data,
2118 if (edje_info) 2114 if (edje_info)
2119 { 2115 {
2120 memcpy(&info, edje_info, sizeof(info)); 2116 memcpy(&info, edje_info, sizeof(info));
2121 efl_event_callback_legacy_call(data, EFL_UI_TEXT_EVENT_CHANGED_USER, &info); 2117 efl_event_callback_call(data, EFL_UI_TEXT_EVENT_CHANGED_USER, &info);
2122 } 2118 }
2123 else 2119 else
2124 { 2120 {
2125 efl_event_callback_legacy_call(data, EFL_UI_TEXT_EVENT_CHANGED_USER, NULL); 2121 efl_event_callback_call(data, EFL_UI_TEXT_EVENT_CHANGED_USER, NULL);
2126 } 2122 }
2127 if (_elm_config->atspi_mode) 2123 if (_elm_config->atspi_mode)
2128 { 2124 {
@@ -2159,7 +2155,7 @@ _entry_undo_request_signal_cb(void *data,
2159 const char *emission EINA_UNUSED, 2155 const char *emission EINA_UNUSED,
2160 const char *source EINA_UNUSED) 2156 const char *source EINA_UNUSED)
2161{ 2157{
2162 efl_event_callback_legacy_call(data, EFL_UI_TEXT_EVENT_UNDO_REQUEST, NULL); 2158 efl_event_callback_call(data, EFL_UI_TEXT_EVENT_UNDO_REQUEST, NULL);
2163} 2159}
2164 2160
2165static void 2161static void
@@ -2168,7 +2164,7 @@ _entry_redo_request_signal_cb(void *data,
2168 const char *emission EINA_UNUSED, 2164 const char *emission EINA_UNUSED,
2169 const char *source EINA_UNUSED) 2165 const char *source EINA_UNUSED)
2170{ 2166{
2171 efl_event_callback_legacy_call(data, EFL_UI_TEXT_EVENT_REDO_REQUEST, NULL); 2167 efl_event_callback_call(data, EFL_UI_TEXT_EVENT_REDO_REQUEST, NULL);
2172} 2168}
2173 2169
2174static void 2170static void
@@ -2203,8 +2199,7 @@ _entry_cursor_changed_manual_signal_cb(void *data,
2203 const char *emission EINA_UNUSED, 2199 const char *emission EINA_UNUSED,
2204 const char *source EINA_UNUSED) 2200 const char *source EINA_UNUSED)
2205{ 2201{
2206 efl_event_callback_legacy_call 2202 efl_event_callback_call(data, EFL_UI_TEXT_EVENT_CURSOR_CHANGED_MANUAL, NULL);
2207 (data, EFL_UI_TEXT_EVENT_CURSOR_CHANGED_MANUAL, NULL);
2208 if (_elm_config->atspi_mode) 2203 if (_elm_config->atspi_mode)
2209 efl_access_event_emit(EFL_ACCESS_MIXIN, data, EFL_ACCESS_TEXT_EVENT_ACCESS_TEXT_CARET_MOVED, NULL); 2204 efl_access_event_emit(EFL_ACCESS_MIXIN, data, EFL_ACCESS_TEXT_EVENT_ACCESS_TEXT_CARET_MOVED, NULL);
2210} 2205}
@@ -2262,7 +2257,7 @@ _entry_anchor_down_signal_cb(void *data,
2262 _signal_anchor_geoms_do_things_with_lol(sd, &ei); 2257 _signal_anchor_geoms_do_things_with_lol(sd, &ei);
2263 2258
2264 if (!sd->disabled) 2259 if (!sd->disabled)
2265 efl_event_callback_legacy_call(data, EFL_UI_TEXT_EVENT_ANCHOR_DOWN, &ei); 2260 efl_event_callback_call(data, EFL_UI_TEXT_EVENT_ANCHOR_DOWN, &ei);
2266} 2261}
2267 2262
2268static void 2263static void
@@ -2285,7 +2280,7 @@ _entry_anchor_up_signal_cb(void *data,
2285 _signal_anchor_geoms_do_things_with_lol(sd, &ei); 2280 _signal_anchor_geoms_do_things_with_lol(sd, &ei);
2286 2281
2287 if (!sd->disabled) 2282 if (!sd->disabled)
2288 efl_event_callback_legacy_call(data, EFL_UI_TEXT_EVENT_ANCHOR_UP, &ei); 2283 efl_event_callback_call(data, EFL_UI_TEXT_EVENT_ANCHOR_UP, &ei);
2289} 2284}
2290 2285
2291static void 2286static void
@@ -2366,7 +2361,7 @@ _entry_hover_anchor_clicked_do(Evas_Object *obj,
2366 ei.hover_right = tmp; 2361 ei.hover_right = tmp;
2367 } 2362 }
2368 2363
2369 efl_event_callback_legacy_call(obj, EFL_UI_TEXT_EVENT_ANCHOR_HOVER_OPENED, &ei); 2364 efl_event_callback_call(obj, EFL_UI_TEXT_EVENT_ANCHOR_HOVER_OPENED, &ei);
2370 efl_event_callback_add 2365 efl_event_callback_add
2371 (sd->anchor_hover.hover, EFL_UI_EVENT_CLICKED, _anchor_hover_clicked_cb, obj); 2366 (sd->anchor_hover.hover, EFL_UI_EVENT_CLICKED, _anchor_hover_clicked_cb, obj);
2372 2367
@@ -2410,7 +2405,7 @@ _entry_anchor_in_signal_cb(void *data,
2410 _signal_anchor_geoms_do_things_with_lol(sd, &ei); 2405 _signal_anchor_geoms_do_things_with_lol(sd, &ei);
2411 2406
2412 if (!sd->disabled) 2407 if (!sd->disabled)
2413 efl_event_callback_legacy_call(data, EFL_UI_TEXT_EVENT_ANCHOR_IN, &ei); 2408 efl_event_callback_call(data, EFL_UI_TEXT_EVENT_ANCHOR_IN, &ei);
2414} 2409}
2415 2410
2416static void 2411static void
@@ -2430,7 +2425,7 @@ _entry_anchor_out_signal_cb(void *data,
2430 _signal_anchor_geoms_do_things_with_lol(sd, &ei); 2425 _signal_anchor_geoms_do_things_with_lol(sd, &ei);
2431 2426
2432 if (!sd->disabled) 2427 if (!sd->disabled)
2433 efl_event_callback_legacy_call(data, EFL_UI_TEXT_EVENT_ANCHOR_OUT, &ei); 2428 efl_event_callback_call(data, EFL_UI_TEXT_EVENT_ANCHOR_OUT, &ei);
2434} 2429}
2435 2430
2436static void 2431static void
@@ -2439,7 +2434,7 @@ _entry_key_enter_signal_cb(void *data,
2439 const char *emission EINA_UNUSED, 2434 const char *emission EINA_UNUSED,
2440 const char *source EINA_UNUSED) 2435 const char *source EINA_UNUSED)
2441{ 2436{
2442 efl_event_callback_legacy_call(data, EFL_UI_TEXT_EVENT_ACTIVATED, NULL); 2437 efl_event_callback_call(data, EFL_UI_TEXT_EVENT_ACTIVATED, NULL);
2443} 2438}
2444 2439
2445static void 2440static void
@@ -2448,7 +2443,7 @@ _entry_key_escape_signal_cb(void *data,
2448 const char *emission EINA_UNUSED, 2443 const char *emission EINA_UNUSED,
2449 const char *source EINA_UNUSED) 2444 const char *source EINA_UNUSED)
2450{ 2445{
2451 efl_event_callback_legacy_call(data, EFL_UI_TEXT_EVENT_ABORTED, NULL); 2446 efl_event_callback_call(data, EFL_UI_TEXT_EVENT_ABORTED, NULL);
2452} 2447}
2453 2448
2454static void 2449static void
@@ -2457,7 +2452,7 @@ _entry_mouse_down_signal_cb(void *data,
2457 const char *emission EINA_UNUSED, 2452 const char *emission EINA_UNUSED,
2458 const char *source EINA_UNUSED) 2453 const char *source EINA_UNUSED)
2459{ 2454{
2460 efl_event_callback_legacy_call(data, EFL_UI_TEXT_EVENT_PRESS, NULL); 2455 efl_event_callback_call(data, EFL_UI_TEXT_EVENT_PRESS, NULL);
2461} 2456}
2462 2457
2463static void 2458static void
@@ -2466,8 +2461,7 @@ _entry_mouse_clicked_signal_cb(void *data,
2466 const char *emission EINA_UNUSED, 2461 const char *emission EINA_UNUSED,
2467 const char *source EINA_UNUSED) 2462 const char *source EINA_UNUSED)
2468{ 2463{
2469 efl_event_callback_legacy_call 2464 efl_event_callback_call(data, EFL_UI_EVENT_CLICKED, NULL);
2470 (data, EFL_UI_EVENT_CLICKED, NULL);
2471} 2465}
2472 2466
2473static void 2467static void
@@ -2476,8 +2470,7 @@ _entry_mouse_double_signal_cb(void *data,
2476 const char *emission EINA_UNUSED, 2470 const char *emission EINA_UNUSED,
2477 const char *source EINA_UNUSED) 2471 const char *source EINA_UNUSED)
2478{ 2472{
2479 efl_event_callback_legacy_call 2473 efl_event_callback_call(data, EFL_UI_EVENT_CLICKED_DOUBLE, NULL);
2480 (data, EFL_UI_EVENT_CLICKED_DOUBLE, NULL);
2481} 2474}
2482 2475
2483static void 2476static void
@@ -2486,8 +2479,7 @@ _entry_mouse_triple_signal_cb(void *data,
2486 const char *emission EINA_UNUSED, 2479 const char *emission EINA_UNUSED,
2487 const char *source EINA_UNUSED) 2480 const char *source EINA_UNUSED)
2488{ 2481{
2489 efl_event_callback_legacy_call 2482 efl_event_callback_call(data, EFL_UI_EVENT_CLICKED_TRIPLE, NULL);
2490 (data, EFL_UI_EVENT_CLICKED_TRIPLE, NULL);
2491} 2483}
2492 2484
2493static Evas_Object * 2485static Evas_Object *
@@ -3455,8 +3447,7 @@ _efl_ui_text_select_none(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd)
3455 edje_object_signal_emit(sd->entry_edje, "elm,state,select,off", "elm"); 3447 edje_object_signal_emit(sd->entry_edje, "elm,state,select,off", "elm");
3456 } 3448 }
3457 if (sd->have_selection) 3449 if (sd->have_selection)
3458 efl_event_callback_legacy_call 3450 efl_event_callback_call(obj, EFL_UI_EVENT_SELECTION_CLEARED, NULL);
3459 (obj, EFL_UI_EVENT_SELECTION_CLEARED, NULL);
3460 3451
3461 sd->have_selection = EINA_FALSE; 3452 sd->have_selection = EINA_FALSE;
3462 edje_object_part_text_select_none(sd->entry_edje, "elm.text"); 3453 edje_object_part_text_select_none(sd->entry_edje, "elm.text");
@@ -3658,8 +3649,7 @@ _scroll_cb(Evas_Object *obj, void *data EINA_UNUSED)
3658{ 3649{
3659 EFL_UI_TEXT_DATA_GET(obj, sd); 3650 EFL_UI_TEXT_DATA_GET(obj, sd);
3660 /* here we need to emit the signal that the elm_scroller would have done */ 3651 /* here we need to emit the signal that the elm_scroller would have done */
3661 efl_event_callback_legacy_call 3652 efl_event_callback_call(obj, EFL_UI_EVENT_SCROLL, NULL);
3662 (obj, EFL_UI_EVENT_SCROLL, NULL);
3663 3653
3664 if (sd->have_selection) 3654 if (sd->have_selection)
3665 _update_selection_handler(obj); 3655 _update_selection_handler(obj);
@@ -3987,8 +3977,7 @@ _efl_ui_text_elm_widget_on_access_activate(Eo *obj, Efl_Ui_Text_Data *_pd EINA_U
3987 if (!elm_widget_disabled_get(obj) && 3977 if (!elm_widget_disabled_get(obj) &&
3988 !evas_object_freeze_events_get(obj)) 3978 !evas_object_freeze_events_get(obj))
3989 { 3979 {
3990 efl_event_callback_legacy_call 3980 efl_event_callback_call(obj, EFL_UI_EVENT_CLICKED, NULL);
3991 (obj, EFL_UI_EVENT_CLICKED, NULL);
3992 if (sd->editable && sd->input_panel_enable) 3981 if (sd->editable && sd->input_panel_enable)
3993 edje_object_part_text_input_panel_show(sd->entry_edje, "elm.text"); 3982 edje_object_part_text_input_panel_show(sd->entry_edje, "elm.text");
3994 } 3983 }