diff --git a/legacy/elementary/src/lib/elm_list.c b/legacy/elementary/src/lib/elm_list.c index 75d7e15ccf..62de10dc69 100644 --- a/legacy/elementary/src/lib/elm_list.c +++ b/legacy/elementary/src/lib/elm_list.c @@ -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)); +} diff --git a/legacy/elementary/src/lib/elm_list.h b/legacy/elementary/src/lib/elm_list.h index d0244a82fc..9038a9186c 100644 --- a/legacy/elementary/src/lib/elm_list.h +++ b/legacy/elementary/src/lib/elm_list.h @@ -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); + /** * @} */