elm list: Added elm_list_first/last_item_get() APIs. I know we freezed API but they...
authorseoz <seoz@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 19 Mar 2012 07:27:53 +0000 (07:27 +0000)
committerseoz <seoz@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 19 Mar 2012 07:27:53 +0000 (07:27 +0000)
Signed-off-by: Daniel Juyung Seo <juyung.seo@samsung.com>
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@69505 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/elm_list.c
src/lib/elm_list.h

index 75d7e15..62de10d 100644 (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));
+}
index d0244a8..9038a91 100644 (file)
@@ -752,5 +752,28 @@ 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);
+
+/**
  * @}
  */