From: Carsten Haitzler Date: Mon, 25 Jan 2010 05:54:31 +0000 (+0000) Subject: genlist - get realized items call! add! X-Git-Tag: v1.0.0~4844 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3f8ec94db341c4bddf44af1ea02316af58245400;p=platform%2Fupstream%2Felementary.git genlist - get realized items call! add! SVN revision: 45543 --- diff --git a/src/lib/Elementary.h.in b/src/lib/Elementary.h.in index a84fd16..309f68c 100644 --- a/src/lib/Elementary.h.in +++ b/src/lib/Elementary.h.in @@ -863,6 +863,7 @@ extern "C" { EAPI void elm_genlist_multi_select_set(Evas_Object *obj, Eina_Bool multi); EAPI Elm_Genlist_Item *elm_genlist_selected_item_get(const Evas_Object *obj); EAPI const Eina_List *elm_genlist_selected_items_get(const Evas_Object *obj); + EAPI Eina_List *elm_genlist_realized_items_get(const Evas_Object *obj); EAPI Elm_Genlist_Item *elm_genlist_at_xy_item_get(const Evas_Object *obj, Evas_Coord x, Evas_Coord y, int *posret); EAPI Elm_Genlist_Item *elm_genlist_first_item_get(const Evas_Object *obj); EAPI Elm_Genlist_Item *elm_genlist_last_item_get(const Evas_Object *obj); diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c index e1e6ab8..0eddf0f 100644 --- a/src/lib/elm_genlist.c +++ b/src/lib/elm_genlist.c @@ -371,10 +371,10 @@ _theme_hook(Evas_Object *obj) edje_object_scale_set(wd->scr, elm_widget_scale_get(obj) * _elm_config->scale); EINA_INLIST_FOREACH(wd->blocks, itb) { - if (itb->realized) _item_block_unrealize(itb); - Eina_List *l; Elm_Genlist_Item *it; + + if (itb->realized) _item_block_unrealize(itb); EINA_LIST_FOREACH(itb->items, l, it) it->mincalcd = EINA_FALSE; @@ -1978,7 +1978,7 @@ elm_genlist_selected_item_get(const Evas_Object *obj) * by deletion). The list contains Elm_Genlist_Item pointers. * * @param obj The genlist object - * @return The list of selected items, nor NUL if none are selected. + * @return The list of selected items, nor NULL if none are selected. * * @ingroup Genlist */ @@ -1991,6 +1991,49 @@ elm_genlist_selected_items_get(const Evas_Object *obj) } /** + * Get a list of realized items in genlist + * + * This returns a list of the realized items in the genlist. The list + * contains Elm_Genlist_Item pointers. The list must be freed by the + * caller when done with eina_list_free(). The item pointers in the list + * are only vallid so long as those items are not deleted or the genlist is + * not deleted. + * + * @param obj The genlist object + * @return The list of realized items, nor NULL if none are realized. + * + * @ingroup Genlist + */ +EAPI Eina_List * +elm_genlist_realized_items_get(const Evas_Object *obj) +{ + Widget_Data *wd = elm_widget_data_get(obj); + Eina_List *list = NULL; + Item_Block *itb; + Eina_Bool done = 0; + + EINA_INLIST_FOREACH(wd->blocks, itb) + { + if (itb->realized) + { + Eina_List *l; + Elm_Genlist_Item *it; + + done = 1; + EINA_LIST_FOREACH(itb->items, l, it) + { + if (it->realized) list = eina_list_append(list, it); + } + } + else + { + if (done) break; + } + } + return list; +} + +/** * Get the item that is at the x, y canvas coords * * This returns the item at the given coordinates (which are canvas relative