Hello,

I modified name and added doxyen. Please refer to below.

"multi,swipe,left" - This is called when the genlist is multi-touch swiped
left.
"multi,swipe,right" - This is called when the genlist is multi-touch swiped
right.
"multi,swipe,up" - This is called when the genlist is multi-touch swiped up.
"multi,swpie,down" - This is called when the genlist is multi-touch swiped
down.
"multi,pinch,out" - This is called when the genlist is multi-touch pinched
out.
"multi,pinch,in" - This is called when the genlist is multi-touch pinched
in.

If this patch have any issue, please let me know.

Thank you.

-----Original Message-----
From: Daniel Juyung Seo [mailto:seojuyu...@gmail.com] 
Sent: Monday, December 20, 2010 2:53 PM
To: Jeonghyun Yun
Cc: enlightenment-devel@lists.sourceforge.net
Subject: Re: [E-devel] [Patch] elm_genlist multi-touch smart callbacks added

Hello,

How about using below names for smart callbacks?

"multi,swipe,left" - Genlist has been multi-touch swept left.
"multi,swipe,right" - Genlist has been multi-touch swept right.
"multi,swipe,up" - Genlist has been multi-touch swept top.
"multi,swpie,down" - Genlist has been multi-touch swept bottom.
"multi,pinch,out" - Genlist has been multi-touch pinched out.
"multi,pinch,in" - Genlist has been multi-touch pinched in.

Because there is a "swipe" smart callbacks, I think we can use the
name "swipe" here too.

And Mr. Yun, can you add doxygen for those events as well?
Please add smart callback doxygen to elm_genlist.c.
You can see existing doxygens at the top of elm_genlist.c
So you may add "multi,**" doxygens around line number 78~80.

Thank you.
Daniel Juyung Seo (SeoZ)



On Fri, Dec 17, 2010 at 5:28 PM, Jeonghyun Yun <jh0506....@samsung.com>
wrote:
> Dear SeoZ,
>
> Yes. I agree about using up & down instead of top & bottom.
>
> And I'm also not sure but 'sweep' is not bad.
> Also 'move' is a good name. Then how about 'dragged'?
>
> I don't know well. Anybody please suggest a good name.
>
> Thanks.
>
> -----Original Message-----
> From: Daniel Juyung Seo [mailto:seojuyu...@gmail.com]
> Sent: Friday, December 17, 2010 4:40 PM
> To: Jeonghyun Yun
> Cc: enlightenment-devel@lists.sourceforge.net
> Subject: Re: [E-devel] [Patch] elm_genlist multi-touch smart callbacks
added
>
> Dear Yun,
>
> How about renaming some callbacks?
> "multi,sweep,top" => "multi,sweep,up"
> "multi,sweep,bottom" => "multi,sweep,down"
> Multi touch event cares only for the touch behavior not the callback's
> behavior.
>
> And I'm not sure it is ok to use the word 'sweep'.
> Anybody please suggest a good name for this. Maybe 'move'?
> I'm not sure about this.
>
> Anyway thanks for your effort.
> Daniel Juyung Seo. (SeoZ)
>
>
> On Fri, Dec 17, 2010 at 11:48 AM, Jeonghyun Yun <jh0506....@samsung.com>
> wrote:
>> Dear all,
>>
>> I added 6 multi-touch smart callbacks in elm_genlist, please refer to
> below.
>>
>> "multi,sweep,left" - Genlist has been multi-touch swept left.
>> "multi,sweep,right" - Genlist has been multi-touch swept right.
>> "multi,sweep,top" - Genlist has been multi-touch swept top.
>> "multi,sweep,bottom" - Genlist has been multi-touch swept bottom.
>> "multi,pinch,out" - Genlist has been multi-touch pinched out.
>> "multi,pinch,in" - Genlist has been multi-touch pinched in.
>>
>> I think these smart callbacks are very useful for elm_genlist multi-touch
>> effect.
>>
>> If this patch have any issue, please let me know.
>>
>> Thanks.
>>
>>
>
----------------------------------------------------------------------------
> --
>> Lotusphere 2011
>> Register now for Lotusphere 2011 and learn how
>> to connect the dots, take your collaborative environment
>> to the next level, and enter the era of Social Business.
>> http://p.sf.net/sfu/lotusphere-d2d
>> _______________________________________________
>> 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 55652)
+++ src/lib/elm_genlist.c       (working copy)
@@ -91,6 +91,24 @@
  * scroll,edge,right - This is called when the genlist is scrolled until the
  * right edge.
  *
+ * multi,swipe,left - This is called when the genlist is multi-touch swiped 
+ * left.
+ *
+ * multi,swipe,right - This is called when the genlist is multi-touch swiped 
+ * right.
+ *
+ * multi,swipe,up - This is called when the genlist is multi-touch swiped 
+ * up.
+ * 
+ * multi,swipe,down - This is called when the genlist is multi-touch swiped 
+ * down.
+ *
+ * multi,pinch,out - This is called when the genlist is multi-touch pinched 
+ * out.
+ *
+ * multi,pinch,in - This is called when the genlist is multi-touch pinched 
+ * in.
+ *
  * Genlist has a fairly large API, mostly because it's relatively complex,
  * trying to be both expansive, powerful and efficient. First we will begin
  * an overview o the theory behind genlist.
@@ -283,6 +301,9 @@ struct _Widget_Data
    Elm_Genlist_Item *anchor_item;
    Evas_Coord        anchor_y;
    Elm_List_Mode     mode;
+   Evas_Coord        prev_x, prev_y, prev_mx, prev_my;
+   Evas_Coord        cur_x, cur_y, cur_mx, cur_my;
+   Eina_Bool         multitouched : 1;
    Eina_Bool         on_hold : 1;
    Eina_Bool         multi : 1;
    Eina_Bool         always_select : 1;
@@ -970,6 +991,12 @@ _mouse_move(void        *data,
                _item_unselect(it);
           }
      }
+   if (it->wd->multitouched)
+     {
+        it->wd->cur_x = ev->cur.canvas.x;
+        it->wd->cur_y = ev->cur.canvas.y;
+        return;
+     }
    if ((it->dragging) && (it->down))
      {
         if (it->wd->movements == SWIPE_MOVES) it->wd->swipe = EINA_TRUE;
@@ -1119,6 +1146,9 @@ _mouse_down(void        *data,
    evas_object_geometry_get(obj, &x, &y, NULL, NULL);
    it->dx = ev->canvas.x - x;
    it->dy = ev->canvas.y - y;
+   it->wd->prev_x = ev->canvas.x;
+   it->wd->prev_y = ev->canvas.y;
+   it->wd->multitouched = EINA_FALSE;
    it->wd->longpressed = EINA_FALSE;
    if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) it->wd->on_hold = EINA_TRUE;
    else it->wd->on_hold = EINA_FALSE;
@@ -1230,6 +1260,91 @@ _mouse_up(void            *data,
 }
 
 static void
+_multi_move(void             *data, 
+            Evas *evas       __UNUSED__, 
+            Evas_Object *obj __UNUSED__, 
+            void             *event_info)
+{
+   Elm_Genlist_Item *it = data;
+   Evas_Event_Multi_Move *ev = event_info;
+
+   if( it->wd->prev_mx * it->wd->prev_my == 0 ) return;
+
+   it->wd->cur_mx = ev->cur.canvas.x;
+   it->wd->cur_my = ev->cur.canvas.y;
+}
+
+static void
+_multi_down(void             *data, 
+            Evas *evas       __UNUSED__, 
+            Evas_Object *obj __UNUSED__, 
+            void             *event_info)
+{
+   Elm_Genlist_Item *it = data;
+   Evas_Event_Multi_Down *ev = event_info;
+
+   it->wd->multitouched = EINA_TRUE;
+   it->wd->prev_mx = ev->canvas.x;
+   it->wd->prev_my = ev->canvas.y;
+}
+
+static void
+_multi_up(void             *data,
+          Evas *evas       __UNUSED__,
+          Evas_Object *obj __UNUSED__,
+          void             *event_info)
+{
+   Elm_Genlist_Item *it = data;
+   Evas_Event_Multi_Up *ev = event_info;
+   Evas_Coord minw = 0, minh = 0;
+   Evas_Coord off_x, off_y, off_mx, off_my;
+
+   elm_coords_finger_size_adjust(1, &minw, 1, &minh);
+   off_x = abs(it->wd->cur_x - it->wd->prev_x);
+   off_y = abs(it->wd->cur_y - it->wd->prev_y);
+   off_mx = abs(it->wd->cur_mx - it->wd->prev_mx);
+   off_my = abs(it->wd->cur_my - it->wd->prev_my);
+
+   if ((off_x > minw) || (off_mx > minw) || (off_y > minh) || (off_my > minh))
+     {
+        if ((off_x + off_mx) > (off_y + off_my))
+          {
+             if((it->wd->cur_x > it->wd->prev_x) && (it->wd->cur_mx > 
it->wd->prev_mx))
+               evas_object_smart_callback_call(it->base.widget,
+                                               "multi,swipe,right", it);
+             else if ((it->wd->cur_x < it->wd->prev_x) && (it->wd->cur_mx < 
it->wd->prev_mx))
+               evas_object_smart_callback_call(it->base.widget,
+                                               "multi,swipe,left", it);
+             else if (abs(it->wd->cur_x - it->wd->cur_mx) > abs(it->wd->prev_x 
- it->wd->prev_mx))
+               evas_object_smart_callback_call(it->base.widget,
+                                               "multi,pinch,out", it);
+             else
+               evas_object_smart_callback_call(it->base.widget,
+                                               "multi,pinch,in", it);
+          }
+        else
+          {
+             if((it->wd->cur_y > it->wd->prev_y) && (it->wd->cur_my > 
it->wd->prev_my))
+               evas_object_smart_callback_call(it->base.widget,
+                                               "multi,swipe,down", it);
+             else if ((it->wd->cur_y < it->wd->prev_y) && (it->wd->cur_my < 
it->wd->prev_my))
+               evas_object_smart_callback_call(it->base.widget,
+                                               "multi,swipe,up", it);
+             else if (abs(it->wd->cur_y - it->wd->cur_my) > abs(it->wd->prev_y 
- it->wd->prev_my))
+               evas_object_smart_callback_call(it->base.widget,
+                                               "multi,pinch,out", it);
+             else
+               evas_object_smart_callback_call(it->base.widget,
+                                               "multi,pinch,in", it);
+          }
+     }
+
+   it->wd->multitouched = EINA_FALSE;
+   it->wd->prev_mx = 0;
+   it->wd->prev_my = 0;
+}
+
+static void
 _signal_expand_toggle(void                *data,
                       Evas_Object *obj     __UNUSED__,
                       const char *emission __UNUSED__,
@@ -1350,6 +1465,12 @@ _item_cache_add(Elm_Genlist_Item *it)
                                        _mouse_up, it);
    evas_object_event_callback_del_full(itc->base_view, 
EVAS_CALLBACK_MOUSE_MOVE,
                                        _mouse_move, it);
+   evas_object_event_callback_del_full(itc->base_view, 
EVAS_CALLBACK_MULTI_DOWN,
+                                       _multi_down, it);
+   evas_object_event_callback_del_full(itc->base_view, EVAS_CALLBACK_MULTI_UP,
+                                       _multi_up, it);
+   evas_object_event_callback_del_full(itc->base_view, 
EVAS_CALLBACK_MULTI_MOVE,
+                                       _multi_move, it);
    _item_cache_clean(it->wd);
 }
 
@@ -1466,6 +1587,12 @@ _item_realize(Elm_Genlist_Item *it,
                                        _mouse_up, it);
         evas_object_event_callback_add(it->base.view, EVAS_CALLBACK_MOUSE_MOVE,
                                        _mouse_move, it);
+        evas_object_event_callback_add(it->base.view, EVAS_CALLBACK_MULTI_DOWN,
+                                       _multi_down, it);
+        evas_object_event_callback_add(it->base.view, EVAS_CALLBACK_MULTI_UP,
+                                       _multi_up, it);
+        evas_object_event_callback_add(it->base.view, EVAS_CALLBACK_MULTI_MOVE,
+                                       _multi_move, it);
         if (itc)
           {
              if (it->selected != itc->selected)
Index: AUTHORS
===================================================================
--- AUTHORS     (revision 55652)
+++ AUTHORS     (working copy)
@@ -28,3 +28,4 @@ Tiago Falcão <ti...@profusion.mobi>
 Otavio Pontes <ota...@profusion.mobi>
 Viktor Kojouharov <vkojouha...@gmail.com>
 Daniel Juyung Seo (SeoZ) <juyung....@samsung.com> <seojuyu...@gmail.com>
+Jeonghyun Yun (arosis) <jh0506....@samsung.com>
------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to