summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvi Levin <avi.levin@samsung.com>2015-06-09 16:31:38 +0300
committerAvi Levin <avi.levin@samsung.com>2015-06-29 17:03:32 +0300
commit51d902d4aee0c52e8f54a79148eeae936eb203b1 (patch)
treeec0000a4db8830fbcfdcda89dc621c6f9c1a5768
parentde6b1373b0e7d5dade7b7d04306373f3440de51e (diff)
elm_frame: porting evas smart callbacks to eo
-rw-r--r--src/lib/elm_frame.c22
-rw-r--r--src/lib/elm_frame.eo1
2 files changed, 13 insertions, 10 deletions
diff --git a/src/lib/elm_frame.c b/src/lib/elm_frame.c
index 04f7402c1..b2e3e48bd 100644
--- a/src/lib/elm_frame.c
+++ b/src/lib/elm_frame.c
@@ -96,12 +96,13 @@ _elm_frame_elm_widget_focus_direction(Eo *obj EINA_UNUSED, Elm_Frame_Data *_pd E
96 } 96 }
97} 97}
98 98
99static void 99static Eina_Bool
100_recalc(void *data, 100_recalc(void *data,
101 Evas_Object *obj EINA_UNUSED, 101 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
102 void *event_info EINA_UNUSED)
103{ 102{
104 elm_layout_sizing_eval(data); 103 elm_layout_sizing_eval(data);
104
105 return EINA_TRUE;
105} 106}
106 107
107static void 108static void
@@ -113,8 +114,8 @@ _on_recalc_done(void *data,
113 ELM_FRAME_DATA_GET(data, sd); 114 ELM_FRAME_DATA_GET(data, sd);
114 ELM_WIDGET_DATA_GET_OR_RETURN(data, wd); 115 ELM_WIDGET_DATA_GET_OR_RETURN(data, wd);
115 116
116 evas_object_smart_callback_del 117 eo_do(wd->resize_obj, eo_event_callback_del
117 (wd->resize_obj, "recalc", _recalc); 118 (ELM_FRAME_EVENT_RECALC, _recalc, data));
118 sd->anim = EINA_FALSE; 119 sd->anim = EINA_FALSE;
119 120
120 elm_layout_sizing_eval(data); 121 elm_layout_sizing_eval(data);
@@ -133,13 +134,14 @@ _on_frame_clicked(void *data,
133 134
134 if (sd->collapsible) 135 if (sd->collapsible)
135 { 136 {
136 evas_object_smart_callback_add 137 eo_do(wd->resize_obj, eo_event_callback_add(
137 (wd->resize_obj, "recalc", _recalc, data); 138 ELM_FRAME_EVENT_RECALC, _recalc, data));
138 elm_layout_signal_emit(data, "elm,action,toggle", "elm"); 139 elm_layout_signal_emit(data, "elm,action,toggle", "elm");
139 sd->collapsed++; 140 sd->collapsed++;
140 sd->anim = EINA_TRUE; 141 sd->anim = EINA_TRUE;
141 } 142 }
142 evas_object_smart_callback_call(data, SIG_CLICKED, NULL); 143 eo_do(data, eo_event_callback_call
144 (ELM_FRAME_EVENT_CLICKED, NULL));
143} 145}
144 146
145/* using deferred sizing evaluation, just like the parent */ 147/* using deferred sizing evaluation, just like the parent */
@@ -249,8 +251,8 @@ _elm_frame_collapse_go(Eo *obj, Elm_Frame_Data *sd, Eina_Bool collapse)
249 if (sd->collapsed == collapse) return; 251 if (sd->collapsed == collapse) return;
250 252
251 elm_layout_signal_emit(obj, "elm,action,toggle", "elm"); 253 elm_layout_signal_emit(obj, "elm,action,toggle", "elm");
252 evas_object_smart_callback_add 254 eo_do(wd->resize_obj, eo_event_callback_call
253 (wd->resize_obj, "recalc", _recalc, obj); 255 (ELM_FRAME_EVENT_RECALC, obj));
254 sd->collapsed = collapse; 256 sd->collapsed = collapse;
255 sd->anim = EINA_TRUE; 257 sd->anim = EINA_TRUE;
256} 258}
diff --git a/src/lib/elm_frame.eo b/src/lib/elm_frame.eo
index e6945fa9e..9709bb2dc 100644
--- a/src/lib/elm_frame.eo
+++ b/src/lib/elm_frame.eo
@@ -76,6 +76,7 @@ class Elm.Frame (Elm.Layout, Evas.Clickable_Interface)
76 clicked; 76 clicked;
77 language,changed; 77 language,changed;
78 access,changed; 78 access,changed;
79 recalc;
79 } 80 }
80 81
81} 82}