summaryrefslogtreecommitdiff
path: root/src/lib/elementary/elc_naviframe.c
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-05-13 15:14:13 -0400
committerMike Blumenkrantz <zmike@samsung.com>2019-05-13 15:14:13 -0400
commit41e1dadbf10db016a539f483f42dc2281799491f (patch)
tree8f8e3e80bbd3fff74f6952f9a6bd61978452ae90 /src/lib/elementary/elc_naviframe.c
parentd29edceade9c4e37b8b45eeced4fc9280ea7c829 (diff)
elementary: do not emit new events in legacy
Summary: This commits prepares the tree in order to mess with the events in the Efl.Ui.Clickable event. Events which have been emitted in a none legacy widget, are now emitted either with evas, when the widget is legacy due to inheritance. Or via the normal event and normal event functions. In case the widget is a legacy only widget (not used at all in the new api), then the events are for now emitted with evas_object_smart_callback_call. Cases where event handlers have been added to legacy widgets, smart events are now used, and not the eo one anymore. ref T7844 Depends on D8813 Reviewers: cedric, zmike, segfaultxavi Reviewed By: zmike Subscribers: #reviewers, #committers Tags: #efl Maniphest Tasks: T7844 Differential Revision: https://phab.enlightenment.org/D8816
Diffstat (limited to 'src/lib/elementary/elc_naviframe.c')
-rw-r--r--src/lib/elementary/elc_naviframe.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/lib/elementary/elc_naviframe.c b/src/lib/elementary/elc_naviframe.c
index 7675b61..e2be2f5 100644
--- a/src/lib/elementary/elc_naviframe.c
+++ b/src/lib/elementary/elc_naviframe.c
@@ -49,7 +49,7 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
49 {NULL, NULL} 49 {NULL, NULL}
50}; 50};
51 51
52static void _on_item_back_btn_clicked(void *data, const Efl_Event *event); 52static void _on_item_back_btn_clicked(void *data, Evas_Object *obj, void *event_info EINA_UNUSED);
53 53
54static Eina_Bool _key_action_top_item_get(Evas_Object *obj, const char *params); 54static Eina_Bool _key_action_top_item_get(Evas_Object *obj, const char *params);
55static Eina_Bool _key_action_item_pop(Evas_Object *obj, const char *params); 55static Eina_Bool _key_action_item_pop(Evas_Object *obj, const char *params);
@@ -680,8 +680,7 @@ _item_title_prev_btn_unset(Elm_Naviframe_Item_Data *it)
680 680
681 evas_object_event_callback_del 681 evas_object_event_callback_del
682 (content, EVAS_CALLBACK_DEL, _item_title_prev_btn_del_cb); 682 (content, EVAS_CALLBACK_DEL, _item_title_prev_btn_del_cb);
683 Eo* parent = efl_parent_get(content); 683 evas_object_smart_callback_del(content, "clicked", _on_item_back_btn_clicked);
684 efl_event_callback_del(content, EFL_UI_EVENT_CLICKED, _on_item_back_btn_clicked, parent);
685 it->title_prev_btn = NULL; 684 it->title_prev_btn = NULL;
686 if (it->auto_pushed_btn) it->auto_pushed_btn = NULL; 685 if (it->auto_pushed_btn) it->auto_pushed_btn = NULL;
687 return content; 686 return content;
@@ -938,13 +937,13 @@ _elm_naviframe_elm_layout_sizing_eval(Eo *obj, Elm_Naviframe_Data *sd)
938} 937}
939 938
940static void 939static void
941_on_item_back_btn_clicked(void *data, const Efl_Event *event) 940_on_item_back_btn_clicked(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
942{ 941{
943 /* Since edje has the event queue, clicked event could be happened 942 /* Since edje has the event queue, clicked event could be happened
944 multiple times on some heavy environment. This callback del will 943 multiple times on some heavy environment. This callback del will
945 prevent those scenario and guarantee only one clicked for it's own 944 prevent those scenario and guarantee only one clicked for it's own
946 page. */ 945 page. */
947 efl_event_callback_del(event->object, EFL_UI_EVENT_CLICKED, _on_item_back_btn_clicked, data); 946 evas_object_smart_callback_del(obj, "clicked", _on_item_back_btn_clicked);
948 elm_naviframe_item_pop(data); 947 elm_naviframe_item_pop(data);
949} 948}
950 949
@@ -957,8 +956,7 @@ _back_btn_new(Evas_Object *obj, const char *title_label)
957 btn = elm_button_add(obj); 956 btn = elm_button_add(obj);
958 957
959 if (!btn) return NULL; 958 if (!btn) return NULL;
960 efl_event_callback_add 959 evas_object_smart_callback_add(btn, "clicked", _on_item_back_btn_clicked, obj);
961 (btn, EFL_UI_EVENT_CLICKED, _on_item_back_btn_clicked, obj);
962 snprintf 960 snprintf
963 (buf, sizeof(buf), "naviframe/back_btn/%s", elm_widget_style_get(obj)); 961 (buf, sizeof(buf), "naviframe/back_btn/%s", elm_widget_style_get(obj));
964 elm_object_style_set(btn, buf); 962 elm_object_style_set(btn, buf);
@@ -1744,8 +1742,7 @@ _elm_naviframe_item_pop(Eo *obj, Elm_Naviframe_Data *sd)
1744 Since the item is not popped or deleted here, the deleted 1742 Since the item is not popped or deleted here, the deleted
1745 callback of the auto pushed button should be restored. */ 1743 callback of the auto pushed button should be restored. */
1746 if (it->auto_pushed_btn) 1744 if (it->auto_pushed_btn)
1747 efl_event_callback_add 1745 evas_object_smart_callback_add(it->auto_pushed_btn, "clicked", _on_item_back_btn_clicked, obj);
1748 (it->auto_pushed_btn, EFL_UI_EVENT_CLICKED, _on_item_back_btn_clicked, obj);
1749 it->popping = EINA_FALSE; 1746 it->popping = EINA_FALSE;
1750 } 1747 }
1751 evas_object_unref(obj); 1748 evas_object_unref(obj);