Elementary genlist: Fixed genlist reorder.
authorseoz <seoz@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 2 Jun 2011 04:41:04 +0000 (04:41 +0000)
committerseoz <seoz@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 2 Jun 2011 04:41:04 +0000 (04:41 +0000)
1. Added reorder APIs to Elementary.h.in header.
2. Fixed wrong declaration of moved callback.
3. Fixed warnings.

And I think 'moved' function needs to be changed to smartcallback.
This is not related to item class structure.

git-svn-id: https://svn.enlightenment.org/svn/e/trunk/elementary@59885 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/bin/test_genlist.c
src/lib/Elementary.h.in

index e736948..4df9442 100644 (file)
@@ -1828,7 +1828,7 @@ _reorder_tg_changed(void *data, Evas_Object *obj, void *event_info __UNUSED__)
  *  the item(*item) had been moved before the given relative item(*rel_item) in list.
  *
  */
-static void _gl_moved(Evas_Object *obj, Elm_Genlist_Item *item, Elm_Genlist_Item *rel_item, Eina_Bool move_after)
+static void gl_moved(Evas_Object *obj __UNUSED__, Elm_Genlist_Item *item __UNUSED__, Elm_Genlist_Item *rel_item __UNUSED__, Eina_Bool move_after __UNUSED__)
 {
    // if needed, add application logic.
 }
@@ -1878,15 +1878,16 @@ test_genlist11(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_i
    elm_box_pack_end(bx, tg);
    evas_object_show(tg);
 
-   itc10.item_style     = "default";
-   itc10.func.label_get = gl11_label_get;
-   itc10.func.icon_get  = gl11_icon_get;
-   itc10.func.state_get = gl_state_get;
-   itc10.func.del       = gl_del;
+   itc11.item_style     = "default";
+   itc11.func.label_get = gl11_label_get;
+   itc11.func.icon_get  = gl11_icon_get;
+   itc11.func.state_get = gl_state_get;
+   itc11.func.del       = gl_del;
+   itc11.func.moved     = gl_moved;
 
    for (i = 0; i < 50; i++)
      elm_genlist_item_append(gl,
-                             &itc10,
+                             &itc11,
                              (void *)(1 + i)/* item data */,
                              NULL/* parent */,
                              ELM_GENLIST_ITEM_NONE/* flags */,
index 1e9b685..d929e1a 100644 (file)
@@ -1859,7 +1859,7 @@ extern "C" {
    typedef Evas_Object *(*GenlistItemIconGetFunc)  (void *data, Evas_Object *obj, const char *part);
    typedef Eina_Bool    (*GenlistItemStateGetFunc) (void *data, Evas_Object *obj, const char *part);
    typedef void         (*GenlistItemDelFunc)      (void *data, Evas_Object *obj);
-   typedef void         (*GenlistItemMovedFunc)    (void *data, Elm_Genlist_Item *item, Elm_Genlist_Item *rel_item, Eina_Bool move_after);
+   typedef void         (*GenlistItemMovedFunc)    (Evas_Object *obj, Elm_Genlist_Item *item, Elm_Genlist_Item *rel_item, Eina_Bool move_after);
 
    struct _Elm_Genlist_Item_Class
      {
@@ -1962,6 +1962,8 @@ EAPI Elm_Genlist_Item *elm_genlist_item_sorted_insert(Evas_Object *obj, const El
    EAPI void               elm_genlist_item_mode_set(Elm_Genlist_Item *it, const char *mode_type, Eina_Bool mode_set) EINA_ARG_NONNULL(1, 2);
    EAPI const char        *elm_genlist_mode_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
    EAPI const Elm_Genlist_Item *elm_genlist_mode_item_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
+   EAPI void               elm_genlist_reorder_mode_set(Evas_Object *obj, Eina_Bool reorder_mode) EINA_ARG_NONNULL(1);
+   EAPI Eina_Bool          elm_genlist_reorder_mode_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
    /** Signals that you can add callbacks for are:
     * "clicked,double" - This is called when a user has double-clicked an item.
     *                    The event_info parameter is the genlist item that was