[Genlist] Add promote/demote functions (#65599 migration)
authorJung Chanwook <joey.jung@samsung.com>
Mon, 20 Feb 2012 00:53:55 +0000 (09:53 +0900)
committerJung Chanwook <joey.jung@samsung.com>
Mon, 20 Feb 2012 00:53:55 +0000 (09:53 +0900)
Change-Id: I9729c27ceaa884f2e9c980c10a55ea0454a4c73e

src/lib/elm_genlist.c
src/lib/elm_genlist.h

index 87a289d..6483793 100644 (file)
@@ -4944,6 +4944,26 @@ elm_genlist_item_show(Elm_Object_Item *it)
 }
 
 EAPI void
+elm_genlist_item_promote(Elm_Object_Item *it)
+{
+   ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
+   Elm_Genlist_Item *_it = (Elm_Genlist_Item *) it;
+   if (_it->delete_me) return;
+   _item_move_before(_it,
+                     (Elm_Genlist_Item *) elm_genlist_first_item_get(WIDGET(_it)));
+}
+
+EAPI void
+elm_genlist_item_demote(Elm_Object_Item *it)
+{
+   ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
+   Elm_Genlist_Item *_it = (Elm_Genlist_Item *) it;
+   if (_it->delete_me) return;
+   _item_move_after(_it,
+                    (Elm_Genlist_Item *) elm_genlist_last_item_get(WIDGET(_it)));
+}
+
+EAPI void
 elm_genlist_item_bring_in(Elm_Object_Item *it)
 {
    ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
index 7548101..eb2ae75 100644 (file)
@@ -1372,6 +1372,24 @@ EAPI const Evas_Object            *elm_genlist_item_object_get(const Elm_Object_
 EAPI void                          elm_genlist_item_update(Elm_Object_Item *it);
 
 /**
+ * Promote an item to the top of the list
+ *
+ * @param it The item
+ *
+ * @ingroup Genlist
+ */
+EAPI void                          elm_genlist_item_promote(Elm_Object_Item *it);
+
+/**
+ * Demote an item to the end of the list
+ *
+ * @param it The item
+ *
+ * @ingroup Genlist
+ */
+EAPI void                          elm_genlist_item_demote(Elm_Object_Item *it);
+
+/**
  * Update the part of an item
  *
  * @param it The item