summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzmike <michael.blumenkrantz@gmail.com>2014-02-08 01:14:36 -0500
committerzmike <michael.blumenkrantz@gmail.com>2014-02-08 01:16:06 -0500
commitc2707f4b8e3e3637f633558799d6884c5c7b2bf4 (patch)
treef3d27f313f1ce14bbccbace43d956e3373d480fa
parentdc16b2771df059e5e38348f902d60546f8a4c316 (diff)
+genlist_item_subitems_count()
group apis are currently pretty lacking. there should probably be functions for iterating over subitems in addition to this one
-rw-r--r--src/lib/elm_genlist.c9
-rw-r--r--src/lib/elm_genlist_common.h12
2 files changed, 21 insertions, 0 deletions
diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c
index ccb21cdbf..9683ec2a0 100644
--- a/src/lib/elm_genlist.c
+++ b/src/lib/elm_genlist.c
@@ -6127,6 +6127,15 @@ elm_genlist_item_parent_get(const Elm_Object_Item *it)
6127 return (Elm_Object_Item *)((Elm_Gen_Item *)it)->parent; 6127 return (Elm_Object_Item *)((Elm_Gen_Item *)it)->parent;
6128} 6128}
6129 6129
6130EAPI unsigned int
6131elm_genlist_item_subitems_count(const Elm_Object_Item *it)
6132{
6133 Elm_Gen_Item *item = (Elm_Gen_Item *)it;
6134 ELM_GENLIST_ITEM_CHECK_OR_RETURN(it, 0);
6135
6136 return eina_list_count(item->item->items);
6137}
6138
6130EAPI void 6139EAPI void
6131elm_genlist_item_subitems_clear(Elm_Object_Item *item) 6140elm_genlist_item_subitems_clear(Elm_Object_Item *item)
6132{ 6141{
diff --git a/src/lib/elm_genlist_common.h b/src/lib/elm_genlist_common.h
index 2d860ee18..8ce45933d 100644
--- a/src/lib/elm_genlist_common.h
+++ b/src/lib/elm_genlist_common.h
@@ -559,6 +559,18 @@ EAPI Eina_Bool elm_genlist_item_cursor_engine_only_get(const
559EAPI Elm_Object_Item *elm_genlist_item_parent_get(const Elm_Object_Item *it); 559EAPI Elm_Object_Item *elm_genlist_item_parent_get(const Elm_Object_Item *it);
560 560
561/** 561/**
562 * Get the number of subitems of a given item
563 *
564 * @param it The item
565 * @return The number of subitems, 0 on error
566 *
567 * This returns the number of subitems that an item possesses.
568 *
569 * @since 1.9
570 * @ingroup Genlist
571 */
572EAPI unsigned int elm_genlist_item_subitems_count(const Elm_Object_Item *it);
573/**
562 * Remove all sub-items (children) of the given item 574 * Remove all sub-items (children) of the given item
563 * 575 *
564 * @param it The item 576 * @param it The item