summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Juyung Seo <seojuyung2@gmail.com>2014-11-25 21:54:52 +0900
committerDaniel Juyung Seo <seojuyung2@gmail.com>2014-11-25 21:54:54 +0900
commit68e3dc632782f2d7883aba25f10416a43d0d20ee (patch)
tree10ca6c5b7b88d78824f7fb80816c279069a17ac6
parentc32593cc89df2c79f5d6c030a36c34e951042b28 (diff)
diskselector, flipselector: Optimize eo item usage.
Remove unnecessary pointer reference.
-rw-r--r--src/lib/elm_diskselector.c12
-rw-r--r--src/lib/elm_flipselector.c4
2 files changed, 9 insertions, 7 deletions
diff --git a/src/lib/elm_diskselector.c b/src/lib/elm_diskselector.c
index 376884539..013458844 100644
--- a/src/lib/elm_diskselector.c
+++ b/src/lib/elm_diskselector.c
@@ -83,12 +83,13 @@ _item_select(Elm_Diskselector_Item_Data *it)
83 if (!it) return; 83 if (!it) return;
84 84
85 ELM_DISKSELECTOR_DATA_GET(WIDGET(it), sd); 85 ELM_DISKSELECTOR_DATA_GET(WIDGET(it), sd);
86 Elm_Object_Item *eo_it = EO_OBJ(it);
86 87
87 sd->selected_item = it; 88 sd->selected_item = it;
88 _selected_item_indicate(sd->selected_item); 89 _selected_item_indicate(sd->selected_item);
89 90
90 if (it->func) it->func((void *)WIDGET_ITEM_DATA_GET(EO_OBJ(it)), WIDGET(it), EO_OBJ(it)); 91 if (it->func) it->func((void *)WIDGET_ITEM_DATA_GET(eo_it), WIDGET(it), eo_it);
91 evas_object_smart_callback_call(WIDGET(it), SIG_SELECTED, EO_OBJ(it)); 92 evas_object_smart_callback_call(WIDGET(it), SIG_SELECTED, eo_it);
92} 93}
93 94
94static int 95static int
@@ -594,6 +595,7 @@ _item_click_cb(void *data,
594 595
595 if (!it) return; 596 if (!it) return;
596 ELM_DISKSELECTOR_DATA_GET(WIDGET(it), sd); 597 ELM_DISKSELECTOR_DATA_GET(WIDGET(it), sd);
598 Elm_Object_Item *eo_it = EO_OBJ(it);
597 599
598 if (sd->selected_item != it) 600 if (sd->selected_item != it)
599 { 601 {
@@ -601,8 +603,8 @@ _item_click_cb(void *data,
601 _selected_item_indicate(sd->selected_item); 603 _selected_item_indicate(sd->selected_item);
602 } 604 }
603 605
604 if (it->func) it->func((void *)WIDGET_ITEM_DATA_GET(EO_OBJ(it)), WIDGET(it), EO_OBJ(it)); 606 if (it->func) it->func((void *)WIDGET_ITEM_DATA_GET(eo_it), WIDGET(it), eo_it);
605 evas_object_smart_callback_call(WIDGET(it), SIG_CLICKED, EO_OBJ(it)); 607 evas_object_smart_callback_call(WIDGET(it), SIG_CLICKED, eo_it);
606} 608}
607 609
608static char * 610static char *
@@ -659,7 +661,7 @@ _item_new(Evas_Object *obj,
659 661
660 it->label = eina_stringshare_add(label); 662 it->label = eina_stringshare_add(label);
661 it->func = func; 663 it->func = func;
662 WIDGET_ITEM_DATA_SET(EO_OBJ(it), data); 664 WIDGET_ITEM_DATA_SET(eo_it, data);
663 VIEW(it) = edje_object_add(evas_object_evas_get(obj)); 665 VIEW(it) = edje_object_add(evas_object_evas_get(obj));
664 elm_widget_theme_object_set(obj, VIEW(it), "diskselector", "item", 666 elm_widget_theme_object_set(obj, VIEW(it), "diskselector", "item",
665 elm_widget_style_get(obj)); 667 elm_widget_style_get(obj));
diff --git a/src/lib/elm_flipselector.c b/src/lib/elm_flipselector.c
index bae9231f0..a9e874739 100644
--- a/src/lib/elm_flipselector.c
+++ b/src/lib/elm_flipselector.c
@@ -229,7 +229,7 @@ _on_item_changed(Elm_Flipselector_Data *sd)
229 if (sd->deleting) return; 229 if (sd->deleting) return;
230 230
231 if (item->func) 231 if (item->func)
232 item->func((void *)WIDGET_ITEM_DATA_GET(EO_OBJ(item)), WIDGET(item), eo_item); 232 item->func((void *)WIDGET_ITEM_DATA_GET(eo_item), WIDGET(item), eo_item);
233 evas_object_smart_callback_call 233 evas_object_smart_callback_call
234 (sd->obj, SIG_SELECTED, eo_item); 234 (sd->obj, SIG_SELECTED, eo_item);
235} 235}
@@ -321,7 +321,7 @@ _item_new(Evas_Object *obj,
321 321
322 it->label = eina_stringshare_add_length(label, len); 322 it->label = eina_stringshare_add_length(label, len);
323 it->func = func; 323 it->func = func;
324 WIDGET_ITEM_DATA_SET(EO_OBJ(it), data); 324 WIDGET_ITEM_DATA_SET(eo_item, data);
325 325
326 /* TODO: no view here, but if one desires general contents in the 326 /* TODO: no view here, but if one desires general contents in the
327 * future... */ 327 * future... */