elmentary: add elm_genlist_nth_item_get

SVN revision: 79295
This commit is contained in:
Michael BOUCHAUD 2012-11-14 15:46:14 +00:00
parent 45cce4ba03
commit a74c497ffb
4 changed files with 43 additions and 1 deletions

View File

@ -675,6 +675,10 @@
* Add elm_toolbar_item_show/bring_in.
It show or bring a specific item, when the toolbar can be scrolled.
2012-10-25 Michael Bouchaud (yoz)
2012-11-12 Michael Bouchaud (yoz)
* Add missing selected event in elm_index (elm_index_item_selected_set)
2012-11-14 Michael Bouchaud (yoz)
* Add elm_genlist_nth_item_get

View File

@ -14,6 +14,7 @@ Additions:
* Add elm_notify_align_set/get
* Add virtualkeypad, clipboard state change signals from conformant.
* Add elm_toolbar_item_show/bring_in.
* Add elm_genlist_nth_item_get
Improvements:

View File

@ -6761,3 +6761,23 @@ elm_genlist_tree_effect_enabled_get(const Evas_Object *obj)
return sd->tree_effect_enabled;
}
EAPI Elm_Object_Item *
elm_genlist_nth_item_get(const Evas_Object *obj, unsigned int nth)
{
Elm_Gen_Item *it = NULL;
Eina_Accessor *a;
void *data;
ELM_GENLIST_CHECK(obj) NULL;
ELM_GENLIST_DATA_GET(obj, sd);
if (!sd->items) return NULL;
a = eina_inlist_accessor_new(sd->items);
if (!a) return NULL;
if (eina_accessor_data_get(a, nth, &data))
it = ELM_GEN_ITEM_FROM_INLIST(data);
eina_accessor_free(a);
return (Elm_Object_Item *)it;
}

View File

@ -1913,6 +1913,23 @@ elm_genlist_item_select_mode_set(Elm_Object_Item *it,
EAPI Elm_Object_Select_Mode
elm_genlist_item_select_mode_get(const Elm_Object_Item *it);
/**
* Get the nth item, in a given genlist widget, placed at position @p nth, in
* its internal items list
*
* @param obj The genlist object
* @param nth The number of the item to grab (0 being the first)
*
* @return The item stored in @p obj at position @p nth or @c NULL, if there's
* no item with that index (and on errors)
*
* @ingroup Genilst
* @since 1.8
*/
EAPI Elm_Object_Item *
elm_genlist_nth_item_get(const Evas_Object *obj, unsigned int nth);
/**
* @}
*/