genlist - get realized items call! add!

SVN revision: 45543
This commit is contained in:
Carsten Haitzler 2010-01-25 05:54:31 +00:00
parent dd7ed79b3c
commit cb8c22cde4
2 changed files with 47 additions and 3 deletions

View File

@ -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);

View File

@ -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
*/
@ -1990,6 +1990,49 @@ elm_genlist_selected_items_get(const Evas_Object *obj)
return wd->selected;
}
/**
* 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
*