genlist - get realized items call! add!
authorCarsten Haitzler <raster@rasterman.com>
Mon, 25 Jan 2010 05:54:31 +0000 (05:54 +0000)
committerCarsten Haitzler <raster@rasterman.com>
Mon, 25 Jan 2010 05:54:31 +0000 (05:54 +0000)
SVN revision: 45543

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

index a84fd16..309f68c 100644 (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);
index e1e6ab8..0eddf0f 100644 (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
  */
@@ -1991,6 +1991,49 @@ elm_genlist_selected_items_get(const Evas_Object *obj)
 }
 
 /**
+ * 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
  *
  * This returns the item at the given coordinates (which are canvas relative