Add possibility to get all the items in Gengrid
authorBruno Dilly <bdilly@profusion.mobi>
Tue, 6 Jul 2010 21:14:38 +0000 (21:14 +0000)
committerBruno Dilly <bdilly@profusion.mobi>
Tue, 6 Jul 2010 21:14:38 +0000 (21:14 +0000)
By Rafael Fonseca <rfonseca@profusion.mobi>

SVN revision: 50087

src/lib/Elementary.h.in
src/lib/elm_gengrid.c

index cb869c1..b3c8791 100644 (file)
@@ -618,6 +618,7 @@ extern "C" {
    EAPI Eina_Bool    elm_gengrid_item_selected_get(const Elm_Gengrid_Item *item);
    EAPI const Evas_Object *elm_gengrid_item_object_get(Elm_Gengrid_Item *item);
    EAPI const Eina_List *elm_gengrid_selected_items_get(const Evas_Object *obj);
+   EAPI const Eina_List *elm_gengrid_items_get(const Evas_Object *obj);
    EAPI Elm_Gengrid_Item *elm_gengrid_item_append(Evas_Object *obj, const Elm_Gengrid_Item_Class *gcc,  const void *data, Evas_Smart_Cb func, const void *func_data);
    /* smart callbacks called:
     *
index 00e987f..5a26bd5 100644 (file)
@@ -1578,3 +1578,23 @@ elm_gengrid_bounce_get(const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v
    if (!wd) return;
    elm_smart_scroller_bounce_allow_get(wd->scr, h_bounce, v_bounce);
 }
+
+/**
+ * Get all items in the Gengrid.
+ *
+ * This returns a list of the Gengrid items. The list contains
+ * Elm_Gengrid_Item pointers.
+ *
+ * @param obj The Gengrid object.
+ * @return The list of items, or NULL if none.
+ *
+ * @ingroup Gengrid
+ */
+EAPI const Eina_List *
+elm_gengrid_items_get(const Evas_Object *obj)
+{
+   ELM_CHECK_WIDTYPE(obj, widtype) NULL;
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (!wd) return NULL;
+   return wd->items;
+}