+genlist_item_subitems_count()

group apis are currently pretty lacking. there should probably be functions for iterating over subitems in addition to this one
This commit is contained in:
zmike 2014-02-08 01:14:36 -05:00
parent db23689614
commit a3ff700982
2 changed files with 21 additions and 0 deletions

View File

@ -6127,6 +6127,15 @@ elm_genlist_item_parent_get(const Elm_Object_Item *it)
return (Elm_Object_Item *)((Elm_Gen_Item *)it)->parent;
}
EAPI unsigned int
elm_genlist_item_subitems_count(const Elm_Object_Item *it)
{
Elm_Gen_Item *item = (Elm_Gen_Item *)it;
ELM_GENLIST_ITEM_CHECK_OR_RETURN(it, 0);
return eina_list_count(item->item->items);
}
EAPI void
elm_genlist_item_subitems_clear(Elm_Object_Item *item)
{

View File

@ -558,6 +558,18 @@ EAPI Eina_Bool elm_genlist_item_cursor_engine_only_get(const
*/
EAPI Elm_Object_Item *elm_genlist_item_parent_get(const Elm_Object_Item *it);
/**
* Get the number of subitems of a given item
*
* @param it The item
* @return The number of subitems, 0 on error
*
* This returns the number of subitems that an item possesses.
*
* @since 1.9
* @ingroup Genlist
*/
EAPI unsigned int elm_genlist_item_subitems_count(const Elm_Object_Item *it);
/**
* Remove all sub-items (children) of the given item
*