summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvi Levin <avi.levin@samsung.com>2015-04-29 17:23:54 +0300
committerAvi Levin <avi.levin@samsung.com>2015-06-29 17:03:30 +0300
commitd4b12b5eca77a66538faafa0b5bb872db979edea (patch)
treec59ee33911c232ef8c7aecc9dfa80b129f337022
parent78ed50afbcf1f43dcf73aea4f7a87040d67f426e (diff)
elc_naviframe: porting evas smart callbacks to eo
-rw-r--r--src/lib/elc_naviframe.c33
1 files changed, 20 insertions, 13 deletions
diff --git a/src/lib/elc_naviframe.c b/src/lib/elc_naviframe.c
index 2b1c1972d..1ef38a3e9 100644
--- a/src/lib/elc_naviframe.c
+++ b/src/lib/elc_naviframe.c
@@ -41,7 +41,8 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
41 41
42static const char SIG_CLICKED[] = "clicked"; 42static const char SIG_CLICKED[] = "clicked";
43 43
44static void _on_item_back_btn_clicked(void *data, Evas_Object *obj, void *event_info EINA_UNUSED); 44static Eina_Bool _on_item_back_btn_clicked(void *data,
45 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED);
45 46
46static Eina_Bool _key_action_top_item_get(Evas_Object *obj, const char *params); 47static Eina_Bool _key_action_top_item_get(Evas_Object *obj, const char *params);
47 48
@@ -341,7 +342,8 @@ _on_item_title_transition_finished(void *data,
341{ 342{
342 Elm_Naviframe_Item_Data *it = data; 343 Elm_Naviframe_Item_Data *it = data;
343 344
344 evas_object_smart_callback_call(WIDGET(it), SIG_TITLE_TRANSITION_FINISHED, EO_OBJ(it)); 345 eo_do(WIDGET(it), eo_event_callback_call
346 (ELM_NAVIFRAME_EVENT_TITLE_TRANSITION_FINISHED, EO_OBJ(it)));
345} 347}
346 348
347static void 349static void
@@ -675,8 +677,10 @@ _item_title_prev_btn_unset(Elm_Naviframe_Item_Data *it)
675 677
676 evas_object_event_callback_del 678 evas_object_event_callback_del
677 (content, EVAS_CALLBACK_DEL, _item_title_prev_btn_del_cb); 679 (content, EVAS_CALLBACK_DEL, _item_title_prev_btn_del_cb);
678 evas_object_smart_callback_del(content, SIG_CLICKED, 680 Eo* parent = eo_do_ret(content, parent, eo_parent_get());
679 _on_item_back_btn_clicked); 681 eo_do(content, eo_event_callback_del(
682 EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _on_item_back_btn_clicked,
683 parent));
680 it->title_prev_btn = NULL; 684 it->title_prev_btn = NULL;
681 return content; 685 return content;
682} 686}
@@ -932,17 +936,20 @@ _elm_naviframe_elm_layout_sizing_eval(Eo *obj, Elm_Naviframe_Data *sd)
932 evas_object_size_hint_max_set(obj, -1, -1); 936 evas_object_size_hint_max_set(obj, -1, -1);
933} 937}
934 938
935static void 939static Eina_Bool
936_on_item_back_btn_clicked(void *data, 940_on_item_back_btn_clicked(void *data,
937 Evas_Object *obj, 941 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
938 void *event_info EINA_UNUSED)
939{ 942{
940 /* Since edje has the event queue, clicked event could be happend 943 /* Since edje has the event queue, clicked event could be happend
941 multiple times on some heavy environment. This callback del will 944 multiple times on some heavy environment. This callback del will
942 prevent those scenario and guarantee only one clicked for it's own 945 prevent those scenario and guarantee only one clicked for it's own
943 page. */ 946 page. */
944 evas_object_smart_callback_del(obj, SIG_CLICKED, _on_item_back_btn_clicked); 947 Eo* parent = eo_do_ret(obj, parent, eo_parent_get());
948 eo_do(obj, eo_event_callback_del(
949 EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _on_item_back_btn_clicked, parent));
945 elm_naviframe_item_pop(data); 950 elm_naviframe_item_pop(data);
951
952 return EINA_TRUE;
946} 953}
947 954
948static Evas_Object * 955static Evas_Object *
@@ -954,8 +961,8 @@ _back_btn_new(Evas_Object *obj, const char *title_label)
954 btn = elm_button_add(obj); 961 btn = elm_button_add(obj);
955 962
956 if (!btn) return NULL; 963 if (!btn) return NULL;
957 evas_object_smart_callback_add 964 eo_do(btn, eo_event_callback_add
958 (btn, SIG_CLICKED, _on_item_back_btn_clicked, obj); 965 (EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _on_item_back_btn_clicked, obj));
959 snprintf 966 snprintf
960 (buf, sizeof(buf), "naviframe/back_btn/%s", elm_widget_style_get(obj)); 967 (buf, sizeof(buf), "naviframe/back_btn/%s", elm_widget_style_get(obj));
961 elm_object_style_set(btn, buf); 968 elm_object_style_set(btn, buf);
@@ -1066,7 +1073,7 @@ _on_item_title_clicked(void *data,
1066{ 1073{
1067 Elm_Naviframe_Item_Data *it = data; 1074 Elm_Naviframe_Item_Data *it = data;
1068 1075
1069 evas_object_smart_callback_call(WIDGET(it), SIG_TITLE_CLICKED, EO_OBJ(it)); 1076 eo_do(WIDGET(it), eo_event_callback_call(ELM_NAVIFRAME_EVENT_TITLE_CLICKED, EO_OBJ(it)));
1070} 1077}
1071 1078
1072/* "elm,state,cur,pushed" 1079/* "elm,state,cur,pushed"
@@ -1130,7 +1137,7 @@ _on_item_show_finished(void *data,
1130 if (sd->freeze_events) 1137 if (sd->freeze_events)
1131 evas_object_freeze_events_set(VIEW(it), EINA_FALSE); 1138 evas_object_freeze_events_set(VIEW(it), EINA_FALSE);
1132 1139
1133 evas_object_smart_callback_call(WIDGET(it), SIG_TRANSITION_FINISHED, EO_OBJ(it)); 1140 eo_do(WIDGET(it), eo_event_callback_call(ELM_NAVIFRAME_EVENT_TRANSITION_FINISHED, EO_OBJ(it)));
1134} 1141}
1135 1142
1136static void 1143static void
@@ -1464,7 +1471,7 @@ _key_action_top_item_get(Evas_Object *obj, const char *params EINA_UNUSED)
1464 ///Leave for compatibility. 1471 ///Leave for compatibility.
1465 ELM_NAVIFRAME_ITEM_DATA_GET(eo_item, it); 1472 ELM_NAVIFRAME_ITEM_DATA_GET(eo_item, it);
1466 if (it->title_prev_btn) 1473 if (it->title_prev_btn)
1467 evas_object_smart_callback_call(it->title_prev_btn, SIG_CLICKED, NULL); 1474 eo_do(it->title_prev_btn, eo_event_callback_call(EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, NULL));
1468 1475
1469 return EINA_TRUE; 1476 return EINA_TRUE;
1470} 1477}