add promote/demote functions for genlist
authordiscomfitor <discomfitor@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 25 Nov 2011 20:27:27 +0000 (20:27 +0000)
committerdiscomfitor <discomfitor@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 25 Nov 2011 20:27:27 +0000 (20:27 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@65599 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

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

index 55edaef..c06872c 100644 (file)
@@ -19590,6 +19590,22 @@ extern "C" {
     */
    EAPI void               elm_genlist_item_update(Elm_Genlist_Item *item) EINA_ARG_NONNULL(1);
    /**
+    * Promote an item to the top of the list
+    *
+    * @param it The item
+    *
+    * @ingroup Genlist
+    */
+   EAPI void               elm_genlist_item_promote(Elm_Gen_Item *it) EINA_ARG_NONNULL(1);
+   /**
+    * Demote an item to the end of the list
+    *
+    * @param it The item
+    *
+    * @ingroup Genlist
+    */
+   EAPI void               elm_genlist_item_demote(Elm_Gen_Item *it) EINA_ARG_NONNULL(1);
+   /**
     * Update the item class of an item
     *
     * @param it The item
index 9bdcaa4..bbed04b 100644 (file)
@@ -3963,6 +3963,22 @@ elm_genlist_item_show(Elm_Gen_Item *it)
 }
 
 EAPI void
+elm_genlist_item_promote(Elm_Gen_Item *it)
+{
+   ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
+   if (it->delete_me) return;
+   _item_move_before(it, elm_gen_first_item_get(WIDGET(it)));
+}
+
+EAPI void
+elm_genlist_item_demote(Elm_Gen_Item *it)
+{
+   ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);
+   if (it->delete_me) return;
+   _item_move_after(it, elm_gen_last_item_get(WIDGET(it)));
+}
+
+EAPI void
 elm_genlist_item_bring_in(Elm_Gen_Item *it)
 {
    ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it);