I make a new patch.
I did not remove moved signal just add moved,after/before and change to ",".
Thanks
Joey
2012/3/20 Hyoyoung Chang <hyoyo...@gmail.com>
> It seems nice except signal separator is "."
> How about change to "," from "."? other genlist signals uses "," as a
> naming separator.
> Also I think it's better gengrid also changed like this patch in next time
> :D
>
> On Tue, Mar 20, 2012 at 2:46 PM, chanwook jung <jchanw...@gmail.com>
> wrote:
> > Dear all,
> >
> > Some applications want to know moved.after or before and relative item
> > because of updating their own list.
> > So I separated moved into moved.after and move.before.
> >
> > Thanks,
> > Joey
> >
> >
> ------------------------------------------------------------------------------
> > This SF email is sponsosred by:
> > Try Windows Azure free for 90 days Click Here
> > http://p.sf.net/sfu/sfd2d-msazure
> > _______________________________________________
> > enlightenment-devel mailing list
> > enlightenment-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
> >
>
>
> ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here
> http://p.sf.net/sfu/sfd2d-msazure
> _______________________________________________
> enlightenment-devel mailing list
> enlightenment-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
>
Index: src/lib/elm_genlist.c
===================================================================
--- src/lib/elm_genlist.c (revision 69518)
+++ src/lib/elm_genlist.c (working copy)
@@ -211,6 +211,8 @@ static const char SIG_MULTI_PINCH_OUT[] = "multi,p
static const char SIG_MULTI_PINCH_IN[] = "multi,pinch,in";
static const char SIG_SWIPE[] = "swipe";
static const char SIG_MOVED[] = "moved";
+static const char SIG_MOVED_AFTER[] = "moved,after";
+static const char SIG_MOVED_BEFORE[] = "moved,before";
static const char SIG_INDEX_UPDATE[] = "index,update";
static const char SIG_TREE_EFFECT_FINISHED [] = "tree,effect,finished";
@@ -248,6 +250,8 @@ static const Evas_Smart_Cb_Description _signals[]
{SIG_MULTI_PINCH_IN, ""},
{SIG_SWIPE, ""},
{SIG_MOVED, ""},
+ {SIG_MOVED_AFTER, ""},
+ {SIG_MOVED_BEFORE, ""},
{SIG_TREE_EFFECT_FINISHED, ""},
{NULL, NULL}
};
@@ -1383,6 +1387,7 @@ _mouse_up(void *data,
_item_move_before(it->wd->reorder_it, it->wd->reorder_rel);
else
_item_move_after(it->wd->reorder_it, it->wd->reorder_rel);
+ evas_object_smart_callback_call(WIDGET(it), SIG_MOVED, it);
}
else
{
@@ -4125,6 +4130,7 @@ _elm_genlist_item_list_compare(const void *data, c
return it->wd->item_compare_cb(it, item1);
}
+/*If application want to know the relative item, use elm_genlist_item_prev_get(it)*/
static void
_item_move_after(Elm_Gen_Item *it, Elm_Gen_Item *after)
{
@@ -4141,9 +4147,10 @@ _item_move_after(Elm_Gen_Item *it, Elm_Gen_Item *a
if (after->item->group_item) it->item->group_item = after->item->group_item;
_item_queue(it->wd, it, NULL);
- evas_object_smart_callback_call(WIDGET(it), SIG_MOVED, it);
+ evas_object_smart_callback_call(WIDGET(it), SIG_MOVED_AFTER, it);
}
+/*If application want to know the relative item, use elm_genlist_item_next_get(it)*/
static void
_item_move_before(Elm_Gen_Item *it, Elm_Gen_Item *before)
{
@@ -4159,7 +4166,7 @@ _item_move_before(Elm_Gen_Item *it, Elm_Gen_Item *
if (before->item->group_item) it->item->group_item = before->item->group_item;
_item_queue(it->wd, it, NULL);
- evas_object_smart_callback_call(WIDGET(it), SIG_MOVED, it);
+ evas_object_smart_callback_call(WIDGET(it), SIG_MOVED_BEFORE, it);
}
EAPI unsigned int
Index: src/lib/elm_genlist.h
===================================================================
--- src/lib/elm_genlist.h (revision 69518)
+++ src/lib/elm_genlist.h (working copy)
@@ -315,6 +315,8 @@
* 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 "moved.after" - This is called when a genlist item is moved after.
+ * - @c "moved.before" - This is called when a genlist item is moved before.
* - @c "language,changed" - This is called when the program's language is
* changed.
* - @c "tree,effect,finished" - This is called when a genlist tree effect is finished.
Index: src/bin/test_genlist.c
===================================================================
--- src/bin/test_genlist.c (revision 69518)
+++ src/bin/test_genlist.c (working copy)
@@ -1898,15 +1898,50 @@ _reorder_tg_changed_cb(void *data, Evas_Object *ob
* @param obj : the genlist object.
* @param item : the moved item.
*
- * If the move_after is true,
+ * the item(*item) had been moved
+ *
+ */
+static void gl_moved(Evas_Object *data __UNUSED__, Evas_Object *obj __UNUSED__, Elm_Object_Item *item __UNUSED__)
+{
+ // if needed, add application logic.
+}
+
+/**
+ * gl_moved_after is called after an item was reordered.
+ * This is only called when reorder mode is enabled.
+ *
+ * @param data : the genlist object passed as data.
+ * @param obj : the genlist object.
+ * @param item : the moved item.
+ *
* the item(*item) had been moved after the given relative item(*rel_item) in list.
- * If the move_after is false,
+ *
+ */
+static void gl_moved_after(Evas_Object *data __UNUSED__, Evas_Object *obj __UNUSED__, Elm_Object_Item *item __UNUSED__)
+{
+ // if needed, add application logic.
+ Elm_Object_Item *it;
+ it = elm_genlist_item_prev_get(item);
+ printf("it=%p, prev_it=%p\n",item,it);
+}
+
+/**
+ * gl_moved_before is called after an item was reordered.
+ * This is only called when reorder mode is enabled.
+ *
+ * @param data : the genlist object passed as data.
+ * @param obj : the genlist object.
+ * @param item : the moved item.
+ *
* the item(*item) had been moved before the given relative item(*rel_item) in list.
*
*/
-static void gl_moved(Evas_Object *data __UNUSED__, Evas_Object *obj __UNUSED__, Elm_Object_Item *item __UNUSED__)
+static void gl_moved_before(Evas_Object *data __UNUSED__, Evas_Object *obj __UNUSED__, Elm_Object_Item *item __UNUSED__)
{
// if needed, add application logic.
+ Elm_Object_Item *it;
+ it = elm_genlist_item_next_get(item);
+ printf("it=%p, next_it=%p\n",item,it);
}
void
@@ -1956,6 +1991,8 @@ test_genlist11(void *data __UNUSED__, Evas_Object
itc1->func.state_get = gl_state_get;
itc1->func.del = NULL;
evas_object_smart_callback_add(gl, "moved", (Evas_Smart_Cb)gl_moved, gl);
+ evas_object_smart_callback_add(gl, "moved,after", (Evas_Smart_Cb)gl_moved_after, gl);
+ evas_object_smart_callback_add(gl, "moved,before", (Evas_Smart_Cb)gl_moved_before, gl);
for (i = 0; i < 50; i++)
elm_genlist_item_append(gl,
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel