summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSangHyeon Lee <sh10233.lee@samsung.com>2015-10-12 14:41:44 +0900
committerNicolas Aguirre <aguirre.nicolas@gmail.com>2015-11-12 10:15:03 +0100
commitd38e01cef77cbfd87497075c864ac805412194e8 (patch)
tree7d7fcafd02cbe12b701fb40a1b82f57ecab6383c
parentc32848907a118861307d9e2c0e4b2f98caf4eec0 (diff)
gengrid : add all_contents_unset API in gengrid for reusing contents.
Summary: Add elm_gengrid_item_all_contents_unset API for reusing contents in application side. User can unset all contents or re-use their contents for increase scrolling performance. genlist already support this API. @feature Test Plan: Need to add test in elementary_test. Reviewers: raster, singh.amitesh, cedric Subscribers: woohyun, Hermet, seoz Differential Revision: https://phab.enlightenment.org/D3066
-rw-r--r--src/lib/elm_gengrid.c16
-rw-r--r--src/lib/elm_gengrid_item.eo12
2 files changed, 28 insertions, 0 deletions
diff --git a/src/lib/elm_gengrid.c b/src/lib/elm_gengrid.c
index 01c72ccef..c3dead7c5 100644
--- a/src/lib/elm_gengrid.c
+++ b/src/lib/elm_gengrid.c
@@ -4585,6 +4585,22 @@ elm_gengrid_item_object_get(const Elm_Object_Item *eo_it)
4585} 4585}
4586 4586
4587EOLIAN static void 4587EOLIAN static void
4588_elm_gengrid_item_all_contents_unset(Eo *eo_item EINA_UNUSED, Elm_Gen_Item *it, Eina_List **l)
4589{
4590 Evas_Object *content;
4591
4592 ELM_GENGRID_ITEM_CHECK_OR_RETURN(it);
4593
4594 EINA_LIST_FREE(it->contents, content)
4595 {
4596 elm_widget_sub_object_del(WIDGET(it), content);
4597 edje_object_part_unswallow(VIEW(it), content);
4598 evas_object_hide(content);
4599 if (l) *l = eina_list_append(*l, content);
4600 }
4601}
4602
4603EOLIAN static void
4588_elm_gengrid_item_update(Eo *eo_item EINA_UNUSED, Elm_Gen_Item *it) 4604_elm_gengrid_item_update(Eo *eo_item EINA_UNUSED, Elm_Gen_Item *it)
4589{ 4605{
4590 ELM_GENGRID_ITEM_CHECK_OR_RETURN(it); 4606 ELM_GENGRID_ITEM_CHECK_OR_RETURN(it);
diff --git a/src/lib/elm_gengrid_item.eo b/src/lib/elm_gengrid_item.eo
index 95a079c79..7da7ff53d 100644
--- a/src/lib/elm_gengrid_item.eo
+++ b/src/lib/elm_gengrid_item.eo
@@ -154,6 +154,18 @@ class Elm.Gengrid_Item(Elm.Widget_Item)
154 @in type: Elm_Gengrid_Item_Scrollto_Type; [[Where to position the item in the viewport.]] 154 @in type: Elm_Gengrid_Item_Scrollto_Type; [[Where to position the item in the viewport.]]
155 } 155 }
156 } 156 }
157 all_contents_unset {
158 [[Unset all contents fetched by the item class.
159
160 This instructs gengrid to release references to contents
161 in the item, meaning that they will no longer be managed
162 by gengrid and are floating "orphans" that can be re-used
163 elsewhere if the user wants to.
164 ]]
165 params {
166 @out l: own(list<own(Evas.Object *)> *); [[The contents list to return.]]
167 }
168 }
157 update { 169 update {
158 [[Update the contents of a given gengrid item 170 [[Update the contents of a given gengrid item
159 171