Elementary genlist: Fixed genlist reorder.

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.


SVN revision: 59885
This commit is contained in:
Daniel Juyung Seo 2011-06-02 04:41:04 +00:00
parent 665b5f07c6
commit 205abde67d
2 changed files with 11 additions and 8 deletions

View 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 */,

View 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