2010/12/9 Enlightenment SVN <no-re...@enlightenment.org>:
> Log:
> Add rectangle event object
>
>  Needed to move the clock when used as gadget
>

I can safely confirm that this patch makes the clock disappear
from shelves. I didn't test it as a gadget.

> Author:       englebass
> Date:         2010-12-09 01:16:32 -0800 (Thu, 09 Dec 2010)
> New Revision: 55401
> Trac:         http://trac.enlightenment.org/e/changeset/55401
>
> Modified:
>  trunk/e/src/modules/clock/e_mod_main.c
>
> Modified: trunk/e/src/modules/clock/e_mod_main.c
> ===================================================================
> --- trunk/e/src/modules/clock/e_mod_main.c      2010-12-09 09:12:12 UTC (rev 
> 55400)
> +++ trunk/e/src/modules/clock/e_mod_main.c      2010-12-09 09:16:32 UTC (rev 
> 55401)
> @@ -9,6 +9,8 @@
>  static Evas_Object *_gc_icon(E_Gadcon_Client_Class *client_class, Evas 
> *evas);
>  static const char *_gc_id_new(E_Gadcon_Client_Class *client_class);
>
> +static void _clock_cb_obj_moveresize(void *data, Evas *e, Evas_Object *obj, 
> void *event_info);
> +
>  /* and actually define the gadcon class that this module provides (just 1) */
>  static const E_Gadcon_Client_Class _gadcon_class =
>  {
> @@ -27,6 +29,7 @@
>  {
>    E_Gadcon_Client *gcc;
>    Evas_Object     *o_clock;
> +   Evas_Object     *o_event;
>  };
>
>  static E_Module *clock_module = NULL;
> @@ -44,12 +47,20 @@
>    e_theme_edje_object_set(o, "base/theme/modules/clock",
>                           "e/modules/clock/main");
>    evas_object_show(o);
> +   inst->o_clock = o;
> +   o = evas_object_rectangle_add(gc->evas);
> +   evas_object_color_set(o, 0, 0, 0, 0);
> +   inst->o_event = o;
> +   evas_object_event_callback_add(o, EVAS_CALLBACK_MOVE,
> +                                 _clock_cb_obj_moveresize, inst);
> +   evas_object_event_callback_add(o, EVAS_CALLBACK_RESIZE,
> +                                 _clock_cb_obj_moveresize, inst);
> +   evas_object_show(o);
>
>    gcc = e_gadcon_client_new(gc, name, id, style, o);
>    gcc->data = inst;
>
>    inst->gcc = gcc;
> -   inst->o_clock = o;
>
>    e_gadcon_client_util_menu_attach(gcc);
>
> @@ -63,6 +74,7 @@
>
>    inst = gcc->data;
>    evas_object_del(inst->o_clock);
> +   evas_object_del(inst->o_event);
>    free(inst);
>  }
>
> @@ -136,3 +148,15 @@
>  {
>    return 1;
>  }
> +
> +static void
> +_clock_cb_obj_moveresize(void *data, Evas *e __UNUSED__, Evas_Object *obj 
> __UNUSED__, void *event_info __UNUSED__)
> +{
> +   Evas_Coord x, y, w, h;
> +   Instance *inst;
> +
> +   inst = data;
> +   evas_object_geometry_get(inst->o_event, &x, &y, &w, &h);
> +   evas_object_move(inst->o_clock, x, y);
> +   evas_object_resize(inst->o_clock, w, h);
> +}
>
>
> ------------------------------------------------------------------------------
> This SF Dev2Dev email is sponsored by:
>
> WikiLeaks The End of the Free Internet
> http://p.sf.net/sfu/therealnews-com
> _______________________________________________
> enlightenment-svn mailing list
> enlightenment-...@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-svn
>

------------------------------------------------------------------------------
This SF Dev2Dev email is sponsored by:

WikiLeaks The End of the Free Internet
http://p.sf.net/sfu/therealnews-com
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to