Dear Gustavo, Tom

The image had a bug.
When the image is added a EVAS_CALLBACK_MOUSE_DOWN/UP and
the callback function of EVAS_CALLBACK_MOUSE_DOWN is called,
if the image change own edje image by using elm_image_file_set,
the EVAS_CALLBACK_MOUSE_UP callback is not called.
The reason is that the edje image is changed other object.
So the image has to have the rect which get the events,
for the evas callback to be called regardless of elm_image_file_set.

Dear Chuneon

I patched the code. svn revision 80002.


2012년 11월 29일 목요일에 ChunEon Park님이 작성:

> JaeHwan, please check elementary_test -> launcher.
>
>
> ------------------------------------
>
> -Regards, Hermet-
>
> -----Original Message-----
> From: "Gustavo Sverzut Barbieri"&lt;[email protected] <javascript:;>
> &gt;
> To: "[email protected] <javascript:;>"&
> lt;[email protected] <javascript:;>&gt;;
> Cc: "[email protected] <javascript:;>"&
> lt;[email protected] <javascript:;>&gt;;
> Sent: 2012-11-27 (화) 19:44:53
> Subject: Re: [E-devel] E SVN: jaehwan trunk/elementary/src/lib
>
> Why is that? I don't get why the rect must be added if it worked before.
> Just change the member add to set the properties you need
>
> On Tuesday, November 27, 2012, Enlightenment SVN wrote:
>
> &gt; Log:
> &gt; Add the hit_rect in elm_image. When the image is changed, the evas
> &gt; callback cannot be called.
> &gt;   So hit_rect gets the mouse events in a top of the widget.
> &gt;
> &gt;
> &gt; Author:       jaehwan
> &gt; Date:         2012-11-27 01:29:16 -0800 (Tue, 27 Nov 2012)
> &gt; New Revision: 79740
> &gt; Trac:         http://trac.enlightenment.org/e/changeset/79740
> &gt;
> &gt; Modified:
> &gt;   trunk/elementary/src/lib/elm_image.c
> &gt; trunk/elementary/src/lib/elm_widget_image.h
> &gt;
> &gt; Modified: trunk/elementary/src/lib/elm_image.c
> &gt; ===================================================================
> &gt; --- trunk/elementary/src/lib/elm_image.c        2012-11-27 09:07:42
> UTC
> &gt; (rev 79739)
> &gt; +++ trunk/elementary/src/lib/elm_image.c        2012-11-27 09:29:16
> UTC
> &gt; (rev 79740)
> &gt; @@ -172,6 +172,8 @@
> &gt;          evas_object_image_fill_set(sd-&gt;img, 0, 0, w, h);
> &gt;          evas_object_resize(sd-&gt;img, w, h);
> &gt;       }
> &gt; +   evas_object_move(sd-&gt;hit_rect, x, y);
> &gt; +   evas_object_resize(sd-&gt;hit_rect, w, h);
> &gt;  }
> &gt;
> &gt;  static void
> &gt; @@ -626,6 +628,17 @@
> &gt;
> &gt;     Elm_Image_Smart_Data *priv = _pd;
> &gt;
> &gt; +   priv-&gt;hit_rect =
> evas_object_rectangle_add(evas_object_evas_get(obj));
> &gt; +   evas_object_smart_member_add(priv-&gt;hit_rect, obj);
> &gt; +   elm_widget_sub_object_add(obj, priv-&gt;hit_rect);
> &gt; +
> &gt; +   evas_object_color_set(priv-&gt;hit_rect, 0, 0, 0, 0);
> &gt; +   evas_object_show(priv-&gt;hit_rect);
> &gt; +   evas_object_repeat_events_set(priv-&gt;hit_rect, EINA_TRUE);
> &gt; +
> &gt; +   evas_object_event_callback_add
> &gt; +     (priv-&gt;hit_rect, EVAS_CALLBACK_MOUSE_UP, _on_mouse_up, obj);
> &gt; +
> &gt;     /* starts as an Evas image. may switch to an Edje object */
> &gt;     priv-&gt;img = _img_new(obj);
> &gt;     priv-&gt;prev_img = NULL;
> &gt; @@ -728,6 +741,18 @@
> &gt;  }
> &gt;
> &gt;  static void
> &gt; +_elm_image_smart_member_add(Eo *obj, void *_pd, va_list *list
> EINA_UNUSED)
> &gt; +{
> &gt; +   Evas_Object *member = va_arg(*list, Evas_Object *);
> &gt; +   Elm_Image_Smart_Data *sd = _pd;
> &gt; +
> &gt; +   eo_do_super(obj, evas_obj_smart_member_add(member));
> &gt; +
> &gt; +   if (sd-&gt;hit_rect)
> &gt; +     evas_object_raise(sd-&gt;hit_rect);
> &gt; +}
> &gt; +
> &gt; +static void
> &gt;  _elm_image_smart_color_set(Eo *obj, void *_pd, va_list *list)
> &gt;  {
> &gt;     Elm_Image_Smart_Data *sd = _pd;
> &gt; @@ -1511,6 +1536,7 @@
> &gt;          EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_MOVE),
> &gt; _elm_image_smart_move),
> &gt;          EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_SHOW),
> &gt; _elm_image_smart_show),
> &gt;          EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_HIDE),
> &gt; _elm_image_smart_hide),
> &gt; +
>  EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_MEMBER_ADD),
> &gt; _elm_image_smart_member_add),
> &gt;
>  EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_COLOR_SET),
> &gt; _elm_image_smart_color_set),
> &gt;          EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_CLIP_SET),
> &gt; _elm_image_smart_clip_set),
> &gt;
>  EO_OP_FUNC(EVAS_OBJ_SMART_ID(EVAS_OBJ_SMART_SUB_ID_CLIP_UNSET),
> &gt; _elm_image_smart_clip_unset),
> &gt;
> &gt; Modified: trunk/elementary/src/lib/elm_widget_image.h
> &gt; ===================================================================
> &gt; --- trunk/elementary/src/lib/elm_widget_image.h 2012-11-27 09:07:42
> UTC
> &gt; (rev 79739)
> &gt; +++ trunk/elementary/src/lib/elm_widget_image.h 2012-11-27 09:29:16
> UTC
> &gt; (rev 79740)
> &gt; @@ -28,6 +28,7 @@
> &gt;  typedef struct _Elm_Image_Smart_Data Elm_Image_Smart_Data;
> &gt;  struct _Elm_Image_Smart_Data
> &gt;  {
> &gt; +   Evas_Object          *hit_rect;
> &gt;     Evas_Object          *img;
> &gt;     Evas_Object          *prev_img;
> &gt;
> &gt;
> &gt;
> &gt;
> &gt;
> ------------------------------------------------------------------------------
> &gt; Monitor your physical, virtual and cloud infrastructure from a single
> &gt; web console. Get in-depth insight into apps, servers, databases,
> vmware,
> &gt; SAP, cloud infrastructure, etc. Download 30-day Free Trial.
> &gt; Pricing starts from $795 for 25 servers or applications!
> &gt; http://p.sf.net/sfu/zoho_dev2dev_nov
> &gt; _______________________________________________
> &gt; enlightenment-svn mailing list
> &gt; [email protected] 
> <javascript:;>&lt;javascript:&gt;;&gt;
> &gt; https://lists.sourceforge.net/lists/listinfo/enlightenment-svn
> &gt;
>
>
> --
> Gustavo Sverzut Barbieri
> http://profusion.mobi embedded systems
> --------------------------------------
> MSN: [email protected] <javascript:;>
> Skype: gsbarbieri
> Mobile: +55 (19) 9225-2202
>
> ------------------------------------------------------------------------------
> 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
> [email protected] <javascript:;>
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
>
>
>
> ------------------------------------------------------------------------------
> Keep yourself connected to Go Parallel:
> VERIFY Test and improve your parallel project with help from experts
> and peers. http://goparallel.sourceforge.net
> _______________________________________________
> enlightenment-devel mailing list
> [email protected] <javascript:;>
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
>
------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
BUILD Helping you discover the best ways to construct your parallel projects.
http://goparallel.sourceforge.net
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to