From: discomfitor Date: Fri, 21 Oct 2011 01:49:15 +0000 (+0000) Subject: remove gross genlistitemmoved function thingy and implement smart cb X-Git-Tag: REL_F_I9500_20120323_1~17^2~1562 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=28962c857a4cdf8c8f463a0485676e6b6d582d6e;p=framework%2Fuifw%2Felementary.git remove gross genlistitemmoved function thingy and implement smart cb also removed relevant item on TODO git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@64222 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/Elementary.h.in b/src/lib/Elementary.h.in index ed8ed44..c83ed57 100644 --- a/src/lib/Elementary.h.in +++ b/src/lib/Elementary.h.in @@ -18082,6 +18082,7 @@ extern "C" { * pinched out. "- @c multi,pinch,in" - This is called when the genlist is * multi-touch pinched in. * - @c "swipe" - This is called when the genlist is swiped. + * - @c "moved" - This is called when a genlist item is moved. * - @c "language,changed" - This is called when the program's language is * changed. * @@ -18123,7 +18124,6 @@ extern "C" { typedef Evas_Object *(*Elm_Genlist_Item_Icon_Get_Cb) (void *data, Evas_Object *obj, const char *part); /**< Icon fetching class function for genlist item classes. */ typedef Eina_Bool (*Elm_Genlist_Item_State_Get_Cb) (void *data, Evas_Object *obj, const char *part); /**< State fetching class function for genlist item classes. */ typedef void (*Elm_Genlist_Item_Del_Cb) (void *data, Evas_Object *obj); /**< Deletion class function for genlist item classes. */ - typedef void (*GenlistItemMovedFunc) (Evas_Object *obj, Elm_Genlist_Item *item, Elm_Genlist_Item *rel_item, Eina_Bool move_after); /** TODO: remove this by SeoZ **/ typedef char *(*GenlistItemLabelGetFunc) (void *data, Evas_Object *obj, const char *part) EINA_DEPRECATED; /** DEPRECATED. Use Elm_Genlist_Item_Label_Get_Cb instead. */ typedef Evas_Object *(*GenlistItemIconGetFunc) (void *data, Evas_Object *obj, const char *part) EINA_DEPRECATED; /** DEPRECATED. Use Elm_Genlist_Item_Icon_Get_Cb instead. */ @@ -18149,7 +18149,6 @@ extern "C" { Elm_Genlist_Item_Icon_Get_Cb icon_get; /**< Icon fetching class function for genlist item classes. */ Elm_Genlist_Item_State_Get_Cb state_get; /**< State fetching class function for genlist item classes. */ Elm_Genlist_Item_Del_Cb del; /**< Deletion class function for genlist item classes. */ - GenlistItemMovedFunc moved; // TODO: do not use this. change this to smart callback. } func; const char *mode_item_style; }; diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c index 9c6a367..16065f9 100644 --- a/src/lib/elm_genlist.c +++ b/src/lib/elm_genlist.c @@ -276,6 +276,7 @@ static const char SIG_MULTI_SWIPE_DOWN[] = "multi,swipe,down"; static const char SIG_MULTI_PINCH_OUT[] = "multi,pinch,out"; static const char SIG_MULTI_PINCH_IN[] = "multi,pinch,in"; static const char SIG_SWIPE[] = "swipe"; +static const char SIG_MOVED[] = "moved"; static const Evas_Smart_Cb_Description _signals[] = { {SIG_CLICKED_DOUBLE, ""}, @@ -314,6 +315,7 @@ static const Evas_Smart_Cb_Description _signals[] = { {SIG_MULTI_PINCH_OUT, ""}, {SIG_MULTI_PINCH_IN, ""}, {SIG_SWIPE, ""}, + {SIG_MOVED, ""}, {NULL, NULL} }; @@ -3474,9 +3476,7 @@ _item_move_after(Elm_Genlist_Item *it, Elm_Genlist_Item *after) if (after->group_item) it->group_item = after->group_item; _item_queue(it->wd, it); - // TODO: change this to smart callback - if (it->itc->func.moved) - it->itc->func.moved(WIDGET(it), it, after, EINA_TRUE); + evas_object_smart_callback_call(WIDGET(it), SIG_MOVED, it); } static void @@ -3494,9 +3494,7 @@ _item_move_before(Elm_Genlist_Item *it, Elm_Genlist_Item *before) if (before->group_item) it->group_item = before->group_item; _item_queue(it->wd, it); - // TODO: change this to smart callback - if (it->itc->func.moved) - it->itc->func.moved(WIDGET(it), it, before, EINA_FALSE); + evas_object_smart_callback_call(WIDGET(it), SIG_MOVED, it); } EAPI Elm_Genlist_Item *