summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Juyung Seo <seojuyung2@gmail.com>2014-11-25 21:55:37 +0900
committerDaniel Juyung Seo <seojuyung2@gmail.com>2014-11-25 21:55:39 +0900
commit35d9f1f936c7e2a3346820776944c98a3bd0995e (patch)
tree3b53b9e8c098e721b1e3b79f1d31c44a4a03662d
parent220356400036ec0543bf9c1d735ae486e7a2916f (diff)
index, list, menu: Optimize eo item usage.
Remove unnecessary pointer reference.
-rw-r--r--src/lib/elm_index.c2
-rw-r--r--src/lib/elm_list.c11
-rw-r--r--src/lib/elm_menu.c2
3 files changed, 8 insertions, 7 deletions
diff --git a/src/lib/elm_index.c b/src/lib/elm_index.c
index 3c9bb24ac..139a90369 100644
--- a/src/lib/elm_index.c
+++ b/src/lib/elm_index.c
@@ -477,7 +477,7 @@ _item_find(Evas_Object *obj,
477 EINA_LIST_FOREACH(sd->items, l, eo_item) 477 EINA_LIST_FOREACH(sd->items, l, eo_item)
478 { 478 {
479 ELM_INDEX_ITEM_DATA_GET(eo_item, it); 479 ELM_INDEX_ITEM_DATA_GET(eo_item, it);
480 if (WIDGET_ITEM_DATA_GET(EO_OBJ(it)) == data) return it; 480 if (WIDGET_ITEM_DATA_GET(eo_item) == data) return it;
481 } 481 }
482 return NULL; 482 return NULL;
483} 483}
diff --git a/src/lib/elm_list.c b/src/lib/elm_list.c
index b196f808e..fbe49c289 100644
--- a/src/lib/elm_list.c
+++ b/src/lib/elm_list.c
@@ -604,7 +604,7 @@ static Eina_Bool _key_action_select(Evas_Object *obj, const char *params EINA_UN
604 if (eo_it) 604 if (eo_it)
605 { 605 {
606 ELM_LIST_ITEM_DATA_GET(eo_it, it); 606 ELM_LIST_ITEM_DATA_GET(eo_it, it);
607 evas_object_smart_callback_call(WIDGET(it), SIG_ACTIVATED, EO_OBJ(it)); 607 evas_object_smart_callback_call(WIDGET(it), SIG_ACTIVATED, eo_it);
608 } 608 }
609 609
610 return EINA_TRUE; 610 return EINA_TRUE;
@@ -1365,6 +1365,7 @@ _item_select(Elm_List_Item_Data *it)
1365 ELM_LIST_ITEM_CHECK_OR_RETURN(it); 1365 ELM_LIST_ITEM_CHECK_OR_RETURN(it);
1366 obj = WIDGET(it); 1366 obj = WIDGET(it);
1367 ELM_LIST_DATA_GET(obj, sd); 1367 ELM_LIST_DATA_GET(obj, sd);
1368 Elm_Object_Item *eo_it = EO_OBJ(it);
1368 1369
1369 if (it->base->disabled || _is_no_select(it)) 1370 if (it->base->disabled || _is_no_select(it))
1370 return; 1371 return;
@@ -1392,15 +1393,15 @@ _item_select(Elm_List_Item_Data *it)
1392 _elm_list_item_content_focus_set(it, ELM_FOCUS_PREVIOUS, sd->h_mode); 1393 _elm_list_item_content_focus_set(it, ELM_FOCUS_PREVIOUS, sd->h_mode);
1393 1394
1394 it->selected = EINA_TRUE; 1395 it->selected = EINA_TRUE;
1395 sd->selected = eina_list_append(sd->selected, EO_OBJ(it)); 1396 sd->selected = eina_list_append(sd->selected, eo_it);
1396 1397
1397call: 1398call:
1398 evas_object_ref(obj); 1399 evas_object_ref(obj);
1399 _elm_list_walk(sd); 1400 _elm_list_walk(sd);
1400 1401
1401 if (it->func) it->func((void *)WIDGET_ITEM_DATA_GET(EO_OBJ(it)), WIDGET(it), EO_OBJ(it)); 1402 if (it->func) it->func((void *)WIDGET_ITEM_DATA_GET(eo_it), WIDGET(it), eo_it);
1402 evas_object_smart_callback_call(obj, SIG_SELECTED, EO_OBJ(it)); 1403 evas_object_smart_callback_call(obj, SIG_SELECTED, eo_it);
1403 sd->last_selected_item = EO_OBJ(it); 1404 sd->last_selected_item = eo_it;
1404 1405
1405 _elm_list_unwalk(obj, sd); 1406 _elm_list_unwalk(obj, sd);
1406 evas_object_unref(obj); 1407 evas_object_unref(obj);
diff --git a/src/lib/elm_menu.c b/src/lib/elm_menu.c
index 7bcf352ac..b696ecebf 100644
--- a/src/lib/elm_menu.c
+++ b/src/lib/elm_menu.c
@@ -1005,7 +1005,7 @@ _elm_menu_item_add(Eo *obj, Elm_Menu_Data *sd, Elm_Object_Item *parent, const ch
1005 1005
1006 ELM_MENU_ITEM_DATA_GET(eo_item, it); 1006 ELM_MENU_ITEM_DATA_GET(eo_item, it);
1007 1007
1008 WIDGET_ITEM_DATA_SET(EO_OBJ(it), data); 1008 WIDGET_ITEM_DATA_SET(eo_item, data);
1009 it->func = func; 1009 it->func = func;
1010 it->parent = eo_data_scope_get(parent, ELM_MENU_ITEM_CLASS); 1010 it->parent = eo_data_scope_get(parent, ELM_MENU_ITEM_CLASS);
1011 it->content = icon_obj; 1011 it->content = icon_obj;