summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvi Levin <avi.levin@samsung.com>2015-05-03 16:34:53 +0300
committerAvi Levin <avi.levin@samsung.com>2015-06-29 17:03:32 +0300
commit500ad949defa7f3768c84ef987787ff48ba679d7 (patch)
tree110da4292a4e13e68b11b6268f4e682fd8675cc4
parentfeff1312afb34411905b7056cc133e422d2d3dc5 (diff)
elc_hoversel, elm_interface_scrollable: porting evas smart callbacks to eo
-rw-r--r--src/lib/elc_hoversel.c76
-rw-r--r--src/lib/elm_interface_scrollable.c10
2 files changed, 50 insertions, 36 deletions
diff --git a/src/lib/elc_hoversel.c b/src/lib/elc_hoversel.c
index 379c4af03..f80c5bee2 100644
--- a/src/lib/elc_hoversel.c
+++ b/src/lib/elc_hoversel.c
@@ -89,46 +89,54 @@ _elm_hoversel_elm_widget_theme_apply(Eo *obj, Elm_Hoversel_Data *sd)
89 return EINA_TRUE; 89 return EINA_TRUE;
90} 90}
91 91
92static void 92static Eina_Bool
93_on_hover_clicked(void *data, 93_on_hover_clicked(void *data EINA_UNUSED,
94 Evas_Object *obj EINA_UNUSED, 94 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED,
95 void *event_info EINA_UNUSED) 95 void *event_info EINA_UNUSED)
96{ 96{
97 elm_hoversel_hover_end(data); 97 elm_hoversel_hover_end(data);
98
99 return EINA_TRUE;
98} 100}
99 101
100static void 102static Eina_Bool
101_on_item_clicked(void *data, 103_on_item_clicked(void *data EINA_UNUSED,
102 Evas_Object *obj EINA_UNUSED, 104 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED,
103 void *event_info EINA_UNUSED) 105 void *event_info EINA_UNUSED)
104{ 106{
105 Elm_Hoversel_Item_Data *item = data; 107 Elm_Hoversel_Item_Data *item = data;
106 Evas_Object *obj2 = WIDGET(item); 108 Evas_Object *obj2 = WIDGET(item);
107 Elm_Object_Item *eo_it = EO_OBJ(item); 109 Elm_Object_Item *eo_it = EO_OBJ(item);
108 110
109 if (item->func) item->func((void *)WIDGET_ITEM_DATA_GET(eo_it), obj2, eo_it); 111 if (item->func) item->func((void *)WIDGET_ITEM_DATA_GET(eo_it), obj2, eo_it);
110 evas_object_smart_callback_call(obj2, SIG_SELECTED, eo_it); 112 eo_do(obj2, eo_event_callback_call(ELM_HOVERSEL_EVENT_SELECTED, eo_it));
111 elm_hoversel_hover_end(obj2); 113 elm_hoversel_hover_end(obj2);
114
115 return EINA_TRUE;
112} 116}
113 117
114static void 118static Eina_Bool
115_item_focused_cb(void *data, 119_item_focused_cb(void *data EINA_UNUSED,
116 Evas_Object *obj EINA_UNUSED, 120 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED,
117 void *event_info EINA_UNUSED) 121 void *event_info EINA_UNUSED)
118{ 122{
119 Elm_Hoversel_Item_Data *it = data; 123 Elm_Hoversel_Item_Data *it = data;
120 124
121 evas_object_smart_callback_call(WIDGET(it), SIG_ITEM_FOCUSED, EO_OBJ(it)); 125 eo_do(WIDGET(it), eo_event_callback_call(ELM_HOVERSEL_EVENT_ITEM_FOCUSED, EO_OBJ(it)));
126
127 return EINA_TRUE;
122} 128}
123 129
124static void 130static Eina_Bool
125_item_unfocused_cb(void *data, 131_item_unfocused_cb(void *data EINA_UNUSED,
126 Evas_Object *obj EINA_UNUSED, 132 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED,
127 void *event_info EINA_UNUSED) 133 void *event_info EINA_UNUSED)
128{ 134{
129 Elm_Hoversel_Item_Data *it = data; 135 Elm_Hoversel_Item_Data *it = data;
130 136
131 evas_object_smart_callback_call(WIDGET(it), SIG_ITEM_UNFOCUSED, EO_OBJ(it)); 137 eo_do(WIDGET(it), eo_event_callback_call(ELM_HOVERSEL_EVENT_ITEM_UNFOCUSED, EO_OBJ(it)));
138
139 return EINA_TRUE;
132} 140}
133 141
134static void 142static void
@@ -162,8 +170,8 @@ _activate(Evas_Object *obj)
162 170
163 elm_object_style_set(sd->hover, buf); 171 elm_object_style_set(sd->hover, buf);
164 172
165 evas_object_smart_callback_add 173 eo_do(sd->hover, eo_event_callback_add
166 (sd->hover, "clicked", _on_hover_clicked, obj); 174 (ELM_HOVERSEL_EVENT_CLICKED, _on_hover_clicked, obj));
167 elm_hover_target_set(sd->hover, obj); 175 elm_hover_target_set(sd->hover, obj);
168 176
169 /* hover's content */ 177 /* hover's content */
@@ -200,10 +208,13 @@ _activate(Evas_Object *obj)
200 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0); 208 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
201 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL); 209 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
202 elm_box_pack_end(bx, bt); 210 elm_box_pack_end(bx, bt);
203 evas_object_smart_callback_add(bt, "clicked", _on_item_clicked, item); 211 eo_do(bt, eo_event_callback_add
212 (EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _on_item_clicked, item));
204 evas_object_show(bt); 213 evas_object_show(bt);
205 evas_object_smart_callback_add(bt, SIG_LAYOUT_FOCUSED, _item_focused_cb, item); 214 eo_do(bt, eo_event_callback_add
206 evas_object_smart_callback_add(bt, SIG_LAYOUT_UNFOCUSED, _item_unfocused_cb, item); 215 (ELM_LAYOUT_EVENT_FOCUSED, _item_focused_cb, item));
216 eo_do(bt, eo_event_callback_add
217 (ELM_LAYOUT_EVENT_UNFOCUSED, _item_unfocused_cb, item));
207 } 218 }
208 219
209 if (sd->horizontal) 220 if (sd->horizontal)
@@ -213,16 +224,18 @@ _activate(Evas_Object *obj)
213 elm_object_part_content_set(sd->hover, elm_hover_best_content_location_get 224 elm_object_part_content_set(sd->hover, elm_hover_best_content_location_get
214 (sd->hover, ELM_HOVER_AXIS_VERTICAL), bx); 225 (sd->hover, ELM_HOVER_AXIS_VERTICAL), bx);
215 226
216 evas_object_smart_callback_call(obj, SIG_EXPANDED, NULL); 227 eo_do(obj, eo_event_callback_call(ELM_HOVERSEL_EVENT_EXPANDED, NULL));
217 evas_object_show(sd->hover); 228 evas_object_show(sd->hover);
218} 229}
219 230
220static void 231static Eina_Bool
221_on_clicked(void *data, 232_on_clicked(void *data EINA_UNUSED,
222 Evas_Object *obj EINA_UNUSED, 233 Eo *obj EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED,
223 void *event_info EINA_UNUSED) 234 void *event_info EINA_UNUSED)
224{ 235{
225 _activate(data); 236 _activate(data);
237
238 return EINA_TRUE;
226} 239}
227 240
228static void 241static void
@@ -302,7 +315,8 @@ _elm_hoversel_evas_object_smart_add(Eo *obj, Elm_Hoversel_Data *_pd EINA_UNUSED)
302 eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); 315 eo_do_super(obj, MY_CLASS, evas_obj_smart_add());
303 elm_widget_sub_object_parent_add(obj); 316 elm_widget_sub_object_parent_add(obj);
304 317
305 evas_object_smart_callback_add(obj, "clicked", _on_clicked, obj); 318 eo_do(obj, eo_event_callback_add(
319 ELM_HOVERSEL_EVENT_CLICKED, _on_clicked, obj));
306 320
307 //What are you doing here? 321 //What are you doing here?
308 eo_do(obj, elm_obj_widget_theme_apply()); 322 eo_do(obj, elm_obj_widget_theme_apply());
@@ -433,7 +447,7 @@ _elm_hoversel_hover_end(Eo *obj, Elm_Hoversel_Data *sd)
433 } 447 }
434 ELM_SAFE_FREE(sd->hover, evas_object_del); 448 ELM_SAFE_FREE(sd->hover, evas_object_del);
435 449
436 evas_object_smart_callback_call(obj, SIG_DISMISSED, NULL); 450 eo_do(obj, eo_event_callback_call(ELM_HOVERSEL_EVENT_DISMISSED, NULL));
437} 451}
438 452
439EOLIAN static Eina_Bool 453EOLIAN static Eina_Bool
diff --git a/src/lib/elm_interface_scrollable.c b/src/lib/elm_interface_scrollable.c
index 4adebcd6c..0c07bdbd9 100644
--- a/src/lib/elm_interface_scrollable.c
+++ b/src/lib/elm_interface_scrollable.c
@@ -117,7 +117,7 @@ _elm_pan_evas_object_smart_resize(Eo *obj EINA_UNUSED, Elm_Pan_Smart_Data *psd,
117 psd->h = h; 117 psd->h = h;
118 118
119 _elm_pan_update(psd); 119 _elm_pan_update(psd);
120 evas_object_smart_callback_call(psd->self, SIG_CHANGED, NULL); 120 eo_do(psd->self, eo_event_callback_call(ELM_INTERFACE_SCROLLABLE_EVENT_CHANGED, NULL));
121} 121}
122 122
123EOLIAN static void 123EOLIAN static void
@@ -146,7 +146,7 @@ _elm_pan_pos_set(Eo *obj EINA_UNUSED, Elm_Pan_Smart_Data *psd, Evas_Coord x, Eva
146 psd->py = y; 146 psd->py = y;
147 147
148 _elm_pan_update(psd); 148 _elm_pan_update(psd);
149 evas_object_smart_callback_call(psd->self, SIG_CHANGED, NULL); 149 eo_do(psd->self, eo_event_callback_call(ELM_INTERFACE_SCROLLABLE_EVENT_CHANGED, NULL));
150} 150}
151 151
152EOLIAN static void 152EOLIAN static void
@@ -235,7 +235,7 @@ _elm_pan_content_del_cb(void *data,
235 psd->content = NULL; 235 psd->content = NULL;
236 psd->content_w = psd->content_h = psd->px = psd->py = 236 psd->content_w = psd->content_h = psd->px = psd->py =
237 psd->prev_cw = psd->prev_ch = psd->delta_posx = psd->delta_posy = 0; 237 psd->prev_cw = psd->prev_ch = psd->delta_posx = psd->delta_posy = 0;
238 evas_object_smart_callback_call(psd->self, SIG_CHANGED, NULL); 238 eo_do(psd->self, eo_event_callback_call(ELM_INTERFACE_SCROLLABLE_EVENT_CHANGED, NULL));
239} 239}
240 240
241static void 241static void
@@ -255,7 +255,7 @@ _elm_pan_content_resize_cb(void *data,
255 psd->content_h = h; 255 psd->content_h = h;
256 _elm_pan_update(psd); 256 _elm_pan_update(psd);
257 } 257 }
258 evas_object_smart_callback_call(psd->self, SIG_CHANGED, NULL); 258 eo_do(psd->self, eo_event_callback_call(ELM_INTERFACE_SCROLLABLE_EVENT_CHANGED, NULL));
259} 259}
260 260
261static void 261static void
@@ -297,7 +297,7 @@ _elm_pan_content_set(Evas_Object *obj,
297 _elm_pan_update(psd); 297 _elm_pan_update(psd);
298 298
299end: 299end:
300 evas_object_smart_callback_call(psd->self, SIG_CHANGED, NULL); 300 eo_do(psd->self, eo_event_callback_call(ELM_INTERFACE_SCROLLABLE_EVENT_CHANGED, NULL));
301} 301}
302 302
303EOLIAN static void 303EOLIAN static void