see... thank you.


------------------------------------

-Regards, Hermet-

-----Original Message-----
From: "Carsten Haitzler"<ras...@rasterman.com> 
To: "Enlightenment developer 
list"<enlightenment-devel@lists.sourceforge.net>; 
Cc: "ChunEon Park"<her...@naver.com>; 
<enlightenment-...@lists.sourceforge.net>; 
Sent: 2012-11-16 (금) 10:28:39
Subject: Re: [E-devel] E SVN: seoz trunk/elementary/src/lib

On Fri, 16

so only left mouse button produces "clicked" signals? right mouse can produce
something else - eg for context popopups (as the clicked singal doesnt let u
know WHICH button caused it... so its not sane to figure it out inside the
clicked callback).

> hi, seoz.
> 
> 
> I don't understand why "ev->button != 1" is required in the mouse
> callbacks.
> 
> 
> 
> +             void *event_info)
>  {
> +   Evas_Event_Mouse_Up *ev = event_info;
> +
> +   if (ev->button != 1) return;            
> }
> 
> 
> What does it intended for?
> 
> 
> 
> ------------------------------------
> 
> -Regards, Hermet-
> 
> -----Original Message-----
> From: "Enlightenment SVN"<no-re...@enlightenment.org> 
> To: <enlightenment-...@lists.sourceforge.net>; 
> Cc: 
> Sent: 2012-11-14 (수) 19:49:54
> Subject: E SVN: seoz trunk/elementary/src/lib
> 
> Log:
> elm image, photo, plug, segment_control, thumb: Check button type and 
on_hold
> flag on mouse_down/up.
> 
> Author:       seoz
> Date:         2012-11-14 02:49:54 -0800 (Wed, 14 Nov 2012)
> New Revision: 79284
> Trac:         http://trac.enlightenment.org/e/changeset/79284
> 
> Modified:
>   trunk/elementary/src/lib/elm_image.c trunk/elementary/src/lib/elm_photo.c
> trunk/elementary/src/lib/elm_plug.c
> trunk/elementary/src/lib/elm_segment_control.c
> trunk/elementary/src/lib/elm_thumb.c 
> 
> Modified: trunk/elementary/src/lib/elm_image.c
> ===================================================================
> --- trunk/elementary/src/lib/elm_image.c   2012-11-14 10:49:51 UTC (rev
> 79283) +++ trunk/elementary/src/lib/elm_image.c    2012-11-14 10:49:54
> UTC (rev 79284) @@ -42,8 +42,13 @@
>  _on_mouse_up(void *data,
>               Evas *e __UNUSED__,
>               Evas_Object *obj __UNUSED__,
> -             void *event_info __UNUSED__)
> +             void *event_info)
>  {
> +   Evas_Event_Mouse_Up *ev = event_info;
> +
> +   if (ev->button != 1) return;
> +   if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
> +
>     evas_object_smart_callback_call(data, SIG_CLICKED, NULL);
>  }
>  
> 
> Modified: trunk/elementary/src/lib/elm_photo.c
> ===================================================================
> --- trunk/elementary/src/lib/elm_photo.c   2012-11-14 10:49:51 UTC (rev
> 79283) +++ trunk/elementary/src/lib/elm_photo.c    2012-11-14 10:49:54
> UTC (rev 79284) @@ -172,10 +172,13 @@
>              Evas_Object *icon,
>              void *event_info __UNUSED__)
>  {
> +   Evas_Event_Mouse_Down *ev = event_info;
> +
>     ELM_PHOTO_DATA_GET(data, sd);
>  
> +   if (ev->button != 1) return;
> +
>     if (sd->long_press_timer) ecore_timer_del(sd->long_press_timer);
> -
>     /* FIXME: Hard coded timeout */
>     sd->long_press_timer = ecore_timer_add(0.7, _long_press_cb, data);
>     evas_object_event_callback_add
> @@ -188,8 +191,12 @@
>            Evas_Object *obj __UNUSED__,
>            void *event_info __UNUSED__)
>  {
> +   Evas_Event_Mouse_Up *ev = event_info;
>     ELM_PHOTO_DATA_GET(data, sd);
>  
> +   if (ev->button != 1) return;
> +   if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
> +
>     if (sd->long_press_timer)
>       {
>          ecore_timer_del(sd->long_press_timer);
> 
> Modified: trunk/elementary/src/lib/elm_plug.c
> ===================================================================
> --- trunk/elementary/src/lib/elm_plug.c    2012-11-14 10:49:51 UTC (rev
> 79283) +++ trunk/elementary/src/lib/elm_plug.c     2012-11-14 10:49:54 UTC
> (rev 79284) @@ -54,8 +54,13 @@
>  _on_mouse_up(void *data,
>               Evas *e __UNUSED__,
>               Evas_Object *obj __UNUSED__,
> -             void *event_info __UNUSED__)
> +             void *event_info)
>  {
> +   Evas_Event_Mouse_Up *ev = event_info;
> +
> +   if (ev->button != 1) return;
> +   if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
> +
>     evas_object_smart_callback_call(data, SIG_CLICKED, NULL);
>  }
>  
> 
> Modified: trunk/elementary/src/lib/elm_segment_control.c
> ===================================================================
> --- trunk/elementary/src/lib/elm_segment_control.c 2012-11-14 10:49:51
> UTC (rev 79283) +++ trunk/elementary/src/lib/elm_segment_control.c
> 2012-11-14 10:49:54 UTC (rev 79284) @@ -311,15 +311,15 @@
>               Evas_Object *obj __UNUSED__,
>               void *event_info)
>  {
> -   Elm_Segment_Item *it;
> -   Evas_Event_Mouse_Up *ev;
> +   Elm_Segment_Item *it = data;
> +   Evas_Event_Mouse_Up *ev = event_info;
>     Evas_Coord x, y, w, h;
>  
> -   it = data;
>     ELM_SEGMENT_CONTROL_DATA_GET(WIDGET(it), sd);
>  
> +   if (ev->button != 1) return;
> +   if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
>     if (elm_widget_disabled_get(ELM_WIDGET_DATA(sd)->obj)) return;
> -
>     if (it == sd->selected_item) return;
>  
>     ev = event_info;
> @@ -338,13 +338,13 @@
>                 Evas_Object *obj __UNUSED__,
>                 void *event_info __UNUSED__)
>  {
> -   Elm_Segment_Item *it;
> +   Elm_Segment_Item *it = data;
> +   Evas_Event_Mouse_Down *ev = event_info;
>  
> -   it = data;
>     ELM_SEGMENT_CONTROL_DATA_GET(WIDGET(it), sd);
>  
> +   if (ev->button != 1) return;
>     if (elm_widget_disabled_get(ELM_WIDGET_DATA(sd)->obj)) return;
> -
>     if (it == sd->selected_item) return;
>  
>     edje_object_signal_emit(VIEW(it), "elm,state,segment,pressed", "elm");
> 
> Modified: trunk/elementary/src/lib/elm_thumb.c
> ===================================================================
> --- trunk/elementary/src/lib/elm_thumb.c   2012-11-14 10:49:51 UTC (rev
> 79283) +++ trunk/elementary/src/lib/elm_thumb.c    2012-11-14 10:49:54
> UTC (rev 79284) @@ -54,12 +54,10 @@
>     Elm_Thumb_Smart_Data *sd = data;
>     Evas_Event_Mouse_Down *ev = event_info;
>  
> -   if (ev->button != 1)
> -     return;
> -   if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
> -     sd->on_hold = EINA_TRUE;
> -   else
> -     sd->on_hold = EINA_FALSE;
> +   if (ev->button != 1) return;
> +   if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) sd->on_hold =
> EINA_TRUE;
> +   else sd->on_hold = EINA_FALSE;
> +
>     if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK)
>       evas_object_smart_callback_call(obj, SIG_CLICKED_DOUBLE, NULL);
>     else
> @@ -75,12 +73,10 @@
>     Elm_Thumb_Smart_Data *sd = data;
>     Evas_Event_Mouse_Up *ev = event_info;
>  
> -   if (ev->button != 1)
> -     return;
> -   if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
> -     sd->on_hold = EINA_TRUE;
> -   else
> -     sd->on_hold = EINA_FALSE;
> +   if (ev->button != 1) return;
> +   if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) sd->on_hold =
> EINA_TRUE;
> +   else sd->on_hold = EINA_FALSE;
> +
>     if (!sd->on_hold)
>       evas_object_smart_callback_call(obj, SIG_CLICKED, NULL);
>  
> 
> 
> 
------------------------------------------------------------------------------
> Monitor your physical, virtual and cloud infrastructure from a single
> web console. Get in-depth insight into apps, servers, databases, vmware,
> SAP, cloud infrastructure, etc. Download 30-day Free Trial.
> Pricing starts from $795 for 25 servers or applications!
> http://p.sf.net/sfu/zoho_dev2dev_nov
> _______________________________________________
> enlightenment-svn mailing list
> enlightenment-...@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-svn
> 
> 
> 
------------------------------------------------------------------------------
> Monitor your physical, virtual and cloud infrastructure from a single
> web console. Get in-depth insight into apps, servers, databases, vmware,
> SAP, cloud infrastructure, etc. Download 30-day Free Trial.
> Pricing starts from $795 for 25 servers or applications!
> http://p.sf.net/sfu/zoho_dev2dev_nov
> _______________________________________________
> enlightenment-devel mailing list
> enlightenment-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


-- 
------------- Codito, ergo sum - "I code, therefore I am" --------------
The Rasterman (Carsten Haitzler)    ras...@rasterman.com



------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to