summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_object_table.c
diff options
context:
space:
mode:
authorCedric Bail <cedric.bail@samsung.com>2013-06-18 11:43:16 +0900
committerCedric Bail <cedric.bail@samsung.com>2013-06-18 11:44:29 +0900
commit16090555795a7d57c350f56c51df284a836300a8 (patch)
tree4a38378b92e3a14709a829e853126b4421228c89 /src/lib/evas/canvas/evas_object_table.c
parent91aea489c349b97e313ac82cac474fdd323c4b45 (diff)
evas: reduce memory footprint taken by Evas_Object_Table callbacks setup.
This reduce by 50K elemines memory use on 32bits system.
Diffstat (limited to 'src/lib/evas/canvas/evas_object_table.c')
-rw-r--r--src/lib/evas/canvas/evas_object_table.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/lib/evas/canvas/evas_object_table.c b/src/lib/evas/canvas/evas_object_table.c
index 1d582d8..57e7dc6 100644
--- a/src/lib/evas/canvas/evas_object_table.c
+++ b/src/lib/evas/canvas/evas_object_table.c
@@ -245,38 +245,42 @@ _evas_object_table_option_del(Evas_Object *o)
245 return evas_object_data_del(o, EVAS_OBJECT_TABLE_OPTION_KEY); 245 return evas_object_data_del(o, EVAS_OBJECT_TABLE_OPTION_KEY);
246} 246}
247 247
248static void 248static Eina_Bool
249_on_child_del(void *data, Evas *evas EINA_UNUSED, Evas_Object *child, void *einfo EINA_UNUSED) 249_on_child_del(void *data, Eo *child, const Eo_Event_Description *desc EINA_UNUSED, void *einfo EINA_UNUSED)
250{ 250{
251 Evas_Object *table = data; 251 Evas_Object *table = data;
252 evas_object_table_unpack(table, child); 252 evas_object_table_unpack(table, child);
253
254 return EO_CALLBACK_CONTINUE;
253} 255}
254 256
255static void 257static Eina_Bool
256_on_child_hints_changed(void *data, Evas *evas EINA_UNUSED, Evas_Object *child EINA_UNUSED, void *einfo EINA_UNUSED) 258_on_child_hints_changed(void *data, Eo *child EINA_UNUSED, const Eo_Event_Description *desc EINA_UNUSED, void *einfo EINA_UNUSED)
257{ 259{
258 Evas_Object *table = data; 260 Evas_Object *table = data;
259 EVAS_OBJECT_TABLE_DATA_GET_OR_RETURN(table, priv); 261 EVAS_OBJECT_TABLE_DATA_GET_OR_RETURN_VAL(table, priv, EO_CALLBACK_CONTINUE);
260 _evas_object_table_cache_invalidate(priv); 262 _evas_object_table_cache_invalidate(priv);
261 evas_object_smart_changed(table); 263 evas_object_smart_changed(table);
264
265 return EO_CALLBACK_CONTINUE;
262} 266}
263 267
268static const Eo_Callback_Array_Item evas_object_table_callbacks[] = {
269 { EVAS_OBJECT_EVENT_DEL, _on_child_del },
270 { EVAS_OBJECT_EVENT_CHANGED_SIZE_HINTS, _on_child_hints_changed },
271 { NULL, NULL }
272};
273
264static void 274static void
265_evas_object_table_child_connect(Evas_Object *o, Evas_Object *child) 275_evas_object_table_child_connect(Evas_Object *o, Evas_Object *child)
266{ 276{
267 evas_object_event_callback_add 277 eo_do(child, eo_event_callback_array_add(evas_object_table_callbacks, o));
268 (child, EVAS_CALLBACK_DEL, _on_child_del, o);
269 evas_object_event_callback_add
270 (child, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _on_child_hints_changed, o);
271} 278}
272 279
273static void 280static void
274_evas_object_table_child_disconnect(Evas_Object *o, Evas_Object *child) 281_evas_object_table_child_disconnect(Evas_Object *o, Evas_Object *child)
275{ 282{
276 evas_object_event_callback_del_full 283 eo_do(child, eo_event_callback_array_del(evas_object_table_callbacks, o));
277 (child, EVAS_CALLBACK_DEL, _on_child_del, o);
278 evas_object_event_callback_del_full
279 (child, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _on_child_hints_changed, o);
280} 284}
281 285
282static void 286static void