elm list: Added elm_list_first/last_item_get() APIs. I know we freezed API but they are so primitive and necessary for 1.0

Signed-off-by: Daniel Juyung Seo <juyung.seo@samsung.com>

SVN revision: 69505
This commit is contained in:
Daniel Juyung Seo 2012-03-19 07:27:53 +00:00 committed by Daniel Juyung Seo
parent 1fda3f02d2
commit 676cf93ec3
2 changed files with 43 additions and 0 deletions

View File

@ -1960,3 +1960,23 @@ elm_list_item_next(const Elm_Object_Item *it)
if (item->node->next) return item->node->next->data;
else return NULL;
}
EAPI Elm_Object_Item *
elm_list_first_item_get(const Evas_Object *obj)
{
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return NULL;
if (!wd->items) return NULL;
return eina_list_data_get(wd->items);
}
EAPI Elm_Object_Item *
elm_list_last_item_get(const Evas_Object *obj)
{
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return NULL;
if (!wd->items) return NULL;
return eina_list_data_get(eina_list_last(wd->items));
}

View File

@ -751,6 +751,29 @@ EAPI Elm_Object_Item *elm_list_item_prev(const Elm_Object_Item *it
*/
EAPI Elm_Object_Item *elm_list_item_next(const Elm_Object_Item *it);
/**
* Get the first item in the list
*
* This returns the first item in the list.
*
* @param obj The list object
* @return The first item, or NULL if none
*
* @ingroup List
*/
EAPI Elm_Object_Item *elm_list_first_item_get(const Evas_Object *obj);
/**
* Get the last item in the list
*
* This returns the last item in the list.
*
* @return The last item, or NULL if none
*
* @ingroup List
*/
EAPI Elm_Object_Item *elm_list_last_item_get(const Evas_Object *obj);
/**
* @}
*/