gengrid : add item all contents unset function for tizen only 34/57834/2 accepted/tizen/mobile/20160127.002552 accepted/tizen/tv/20160127.002608 accepted/tizen/wearable/20160127.002627 submit/tizen/20160126.062515 submit/tizen_common/20160126.110240
authorSangHyeon Lee <sh10233.lee@samsung.com>
Mon, 25 Jan 2016 06:47:22 +0000 (15:47 +0900)
committerSangHyeon Lee <sh10233.lee@samsung.com>
Tue, 26 Jan 2016 06:17:07 +0000 (15:17 +0900)
Change-Id: I7bd78d4f84ab5166125adf9ed85ca3577b4b8e2e

src/lib/elm_gengrid.c
src/lib/elm_gengrid_item.eo

index 267aebe344c9f463f975836cc10f604fecdfc642..f153e238b45f29bde03528de7409b784e851da50 100644 (file)
@@ -1006,6 +1006,24 @@ _view_clear(Evas_Object *view, Eina_List **texts, Eina_List **contents)
      evas_object_del(c);
 }
 
+EOLIAN static void
+_elm_gengrid_item_all_contents_unset(Eo *eo_item EINA_UNUSED, Elm_Gen_Item *it, Eina_List **l)
+{
+   Evas_Object *content;
+
+   ELM_GENGRID_ITEM_CHECK_OR_RETURN(it);
+
+   EINA_LIST_FREE (it->contents, content)
+     {
+        evas_object_smart_member_del(content);
+        // edje can be reused by item caching,
+        // content should be un-swallowed from edje
+        edje_object_part_unswallow(VIEW(it), content);
+        evas_object_hide(content);
+        if (l) *l = eina_list_append(*l, content);
+     }
+}
+
 static void
 _elm_gengrid_item_unrealize(Elm_Gen_Item *it,
                             Eina_Bool calc)
index 95a079c79aefc851f6a78a1cbe5fd8a78756875e..22c9d8c6b854937cf7d715ffba70560c0419a9d9 100644 (file)
@@ -190,6 +190,18 @@ class Elm.Gengrid_Item(Elm.Widget_Item)
                      @in itc: const (Elm_Gengrid_Item_Class) *; [[The gengrid item class describing the function pointers and the item style.]]
                 }
            }
+           all_contents_unset{
+
+                 [[Unset all contents fetched by the item class
+
+                 This instructs gengrid to release references to contents in the item,
+                 meaning that they will no longer be managed by gengrid and are
+                 floating "orphans" that can be re-used elsewhere if the user wants
+                 to.]]
+                params {
+                     @out l: own(list<own(Evas.Object *)> *); [[The contents list to return.]]
+                }
+           }
       }
       implements {
            Eo.Base.constructor;