Hi Daniel,

The move intercept should not be required as elm_win is a smart object and
it implements the "move" method, which is a clear way to do it.

Could you provide a sample code that breaks? Likely your friend overwrote
move() but does not call parent's method (like "super")?

Regards,
-- Gustavo



On Fri, Nov 2, 2012 at 7:06 AM, Daniel Juyung Seo <seojuyu...@gmail.com>wrote:

> On Thu, Jul 19, 2012 at 1:35 PM, Enlightenment SVN <
> no-re...@enlightenment.org> wrote:
>
> > Log:
> > elm_win: support trapping ecore_evas calls (aka: e17 support)
> >
> >   Allows setting a trap in elm_win that intercepts calls to
> >   ecore_evas. If there is a trap and the trap returns EINA_FALSE, then
> >   the corresponding call is NOT issued. If it does not exist or returns
> >   EINA_TRUE, then the call is executed.
> >
> >   Enlightenment window manager will set these traps and will call
> >   e_border directly, allowing E17 to use Elementary! A major feature
> >   given e_widgets painful usage.
> >
> >   This should also help integrating into Wayland or even debug.
> >
> >
> >
> >
> >
> > Author:       barbieri
> > Date:         2012-07-18 21:35:50 -0700 (Wed, 18 Jul 2012)
> > New Revision: 74156
> > Trac:         http://trac.enlightenment.org/e/changeset/74156
> >
> > Modified:
> >   trunk/elementary/src/lib/elm_win.c trunk/elementary/src/lib/elm_win.h
> >
> > Modified: trunk/elementary/src/lib/elm_win.c
> > ===================================================================
> > --- trunk/elementary/src/lib/elm_win.c  2012-07-19 03:25:25 UTC (rev
> 74155)
> > +++ trunk/elementary/src/lib/elm_win.c  2012-07-19 04:35:50 UTC (rev
> 74156)
> > @@ -3,6 +3,18 @@
> >
> >  static const char WIN_SMART_NAME[] = "elm_win";
> >
> > +static const Elm_Win_Trap *trap = NULL;
> > +
> > +#define TRAP(sd, name, ...)
> \
> > +  do
>  \
> > +    {
> \
> > +       if ((!trap) || (!trap->name) ||
>  \
> > +           ((trap->name) &&
> \
> > +            (trap->name(sd->trap_data, sd->base.obj, ## __VA_ARGS__))))
> \
> > +         ecore_evas_##name(sd->ee, ##__VA_ARGS__);
>  \
> > +    }
> \
> > +  while (0)
> > +
> >  #define ELM_WIN_DATA_GET(o, sd) \
> >    Elm_Win_Smart_Data * sd = evas_object_smart_data_get(o)
> >
> > @@ -113,6 +125,8 @@
> >     const char  *icon_name;
> >     const char  *role;
> >
> > +   void *trap_data;
> > +
> >     double       aspect;
> >     int          size_base_w, size_base_h;
> >     int          size_step_w, size_step_h;
> > @@ -356,20 +370,80 @@
> >     sd->shot.timer = ecore_timer_add(_shot_delay_get(sd), _shot_delay,
> sd);
> >  }
> >
> > +/* elm-win specific associate, does the trap while
> > ecore_evas_object_associate()
> > + * does not.
> > + */
> > +static Elm_Win_Smart_Data *
> > +_elm_win_associate_get(const Ecore_Evas *ee)
> > +{
> > +   return ecore_evas_data_get(ee, "elm_win");
> > +}
> > +
> > +/* Interceptors Callbacks */
> >  static void
> > +_elm_win_obj_intercept_raise(void *data, Evas_Object *obj __UNUSED__)
> > +{
> > +   Elm_Win_Smart_Data *sd = data;
> > +   TRAP(sd, raise);
> > +}
> > +
> > +static void
> > +_elm_win_obj_intercept_lower(void *data, Evas_Object *obj __UNUSED__)
> > +{
> > +   Elm_Win_Smart_Data *sd = data;
> > +   TRAP(sd, lower);
> > +}
> > +
> > +static void
> > +_elm_win_obj_intercept_stack_above(void *data __UNUSED__, Evas_Object
> > *obj __UNUSED__, Evas_Object *above __UNUSED__)
> > +{
> > +   INF("TODO: %s", __FUNCTION__);
> > +}
> > +
> > +static void
> > +_elm_win_obj_intercept_stack_below(void *data __UNUSED__, Evas_Object
> > *obj __UNUSED__, Evas_Object *below __UNUSED__)
> > +{
> > +   INF("TODO: %s", __FUNCTION__);
> > +}
> > +
> > +static void
> > +_elm_win_obj_intercept_layer_set(void *data, Evas_Object *obj
> __UNUSED__,
> > int l)
> > +{
> > +   Elm_Win_Smart_Data *sd = data;
> > +   TRAP(sd, layer_set, l);
> > +}
> > +
> > +/* Event Callbacks */
> > +
> > +static void
> > +_elm_win_obj_callback_changed_size_hints(void *data, Evas *e __UNUSED__,
> > Evas_Object *obj, void *event_info __UNUSED__)
> > +{
> > +   Elm_Win_Smart_Data *sd = data;
> > +   Evas_Coord w, h;
> > +
> > +   evas_object_size_hint_min_get(obj, &w, &h);
> > +   TRAP(sd, size_min_set, w, h);
> > +
> > +   evas_object_size_hint_max_get(obj, &w, &h);
> > +   if (w < 1) w = -1;
> > +   if (h < 1) h = -1;
> > +   TRAP(sd, size_max_set, w, h);
> > +}
> > +/* end of elm-win specific associate */
> > +
> > +
> > +static void
> >  _elm_win_move(Ecore_Evas *ee)
> >  {
> > -   Evas_Object *obj = ecore_evas_object_associate_get(ee);
> > +   Elm_Win_Smart_Data *sd = _elm_win_associate_get(ee);
> >     int x, y;
> >
> > -   if (!obj) return;
> > +   EINA_SAFETY_ON_NULL_RETURN(sd);
> >
> > -   ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
> > -
> >     ecore_evas_geometry_get(ee, &x, &y, NULL, NULL);
> >     sd->screen.x = x;
> >     sd->screen.y = y;
> > -   evas_object_smart_callback_call(obj, SIG_MOVED, NULL);
> > +   evas_object_smart_callback_call(ELM_WIDGET_DATA(sd)->obj, SIG_MOVED,
> > NULL);
> >  }
> >
> >  static void
> > @@ -407,11 +481,9 @@
> >  static void
> >  _elm_win_resize(Ecore_Evas *ee)
> >  {
> > -   Evas_Object *obj = ecore_evas_object_associate_get(ee);
> > +   Elm_Win_Smart_Data *sd = _elm_win_associate_get(ee);
> > +   EINA_SAFETY_ON_NULL_RETURN(sd);
> >
> > -   if (!obj) return;
> > -   ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
> > -
> >     if (sd->deferred_resize_job) ecore_job_del(sd->deferred_resize_job);
> >     sd->deferred_resize_job = ecore_job_add(_elm_win_resize_job, sd);
> >  }
> > @@ -419,11 +491,9 @@
> >  static void
> >  _elm_win_mouse_in(Ecore_Evas *ee)
> >  {
> > -   Evas_Object *obj;
> > +   Elm_Win_Smart_Data *sd = _elm_win_associate_get(ee);
> > +   EINA_SAFETY_ON_NULL_RETURN(sd);
> >
> > -   if (!(obj = ecore_evas_object_associate_get(ee))) return;
> > -   ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
> > -
> >     if (sd->resizing) sd->resizing = EINA_FALSE;
> >  }
> >
> > @@ -594,11 +664,12 @@
> >  static void
> >  _elm_win_focus_in(Ecore_Evas *ee)
> >  {
> > -   Evas_Object *obj = ecore_evas_object_associate_get(ee);
> > +   Elm_Win_Smart_Data *sd = _elm_win_associate_get(ee);
> > +   Evas_Object *obj;
> >
> > -   if (!obj) return;
> > +   EINA_SAFETY_ON_NULL_RETURN(sd);
> >
> > -   ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
> > +   obj = ELM_WIDGET_DATA(sd)->obj;
> >
> >     _elm_widget_top_win_focused_set(obj, EINA_TRUE);
> >     if (!elm_widget_focus_order_get(obj))
> > @@ -624,11 +695,12 @@
> >  static void
> >  _elm_win_focus_out(Ecore_Evas *ee)
> >  {
> > -   Evas_Object *obj = ecore_evas_object_associate_get(ee);
> > +   Elm_Win_Smart_Data *sd = _elm_win_associate_get(ee);
> > +   Evas_Object *obj;
> >
> > -   if (!obj) return;
> > +   EINA_SAFETY_ON_NULL_RETURN(sd);
> >
> > -   ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
> > +   obj = ELM_WIDGET_DATA(sd)->obj;
> >
> >     elm_object_focus_set(obj, EINA_FALSE);
> >     _elm_widget_top_win_focused_set(obj, EINA_FALSE);
> > @@ -648,6 +720,7 @@
> >  static void
> >  _elm_win_state_change(Ecore_Evas *ee)
> >  {
> > +   Elm_Win_Smart_Data *sd = _elm_win_associate_get(ee);
> >     Evas_Object *obj;
> >     Eina_Bool ch_withdrawn = EINA_FALSE;
> >     Eina_Bool ch_sticky = EINA_FALSE;
> > @@ -655,9 +728,9 @@
> >     Eina_Bool ch_fullscreen = EINA_FALSE;
> >     Eina_Bool ch_maximized = EINA_FALSE;
> >
> > -   if (!(obj = ecore_evas_object_associate_get(ee))) return;
> > +   EINA_SAFETY_ON_NULL_RETURN(sd);
> >
> > -   ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
> > +   obj = ELM_WIDGET_DATA(sd)->obj;
> >
> >     if (sd->withdrawn != ecore_evas_withdrawn_get(sd->ee))
> >       {
> > @@ -872,6 +945,8 @@
> >
> >     _elm_win_parent_sc->base.show(obj);
> >
> > +   TRAP(sd, show);
> > +
> >     if (!sd->show_count) sd->show_count++;
> >     if (sd->shot.info) _shot_handle(sd);
> >  }
> > @@ -883,6 +958,8 @@
> >
> >     _elm_win_parent_sc->base.hide(obj);
> >
> > +   TRAP(sd, hide);
> > +
> >     if (sd->frame_obj)
> >       {
> >          evas_object_hide(sd->frame_obj);
> > @@ -1069,6 +1146,9 @@
> >
> >     /* NB: child deletion handled by parent's smart del */
> >
> > +   if ((trap) && (trap->del))
> > +     trap->del(sd->trap_data, obj);
> > +
> >     if (sd->parent)
> >       {
> >          evas_object_event_callback_del_full
> > @@ -1146,29 +1226,6 @@
> >  }
> >
> >  static void
> > -_elm_win_obj_intercept_move(void *data,
> > -                            Evas_Object *obj,
> > -                            Evas_Coord x,
> > -                            Evas_Coord y)
> > -{
> > -   Elm_Win_Smart_Data *sd = data;
> > -
> > -   if (sd->img_obj)
> > -     {
> > -        if ((x != sd->screen.x) || (y != sd->screen.y))
> > -          {
> > -             sd->screen.x = x;
> > -             sd->screen.y = y;
> > -             evas_object_smart_callback_call(obj, SIG_MOVED, NULL);
> > -          }
> > -     }
> > -   else
> > -     {
> > -        evas_object_move(obj, x, y);
> > -     }
> > -}
> > -
> > -static void
> >  _elm_win_obj_intercept_show(void *data,
> >                              Evas_Object *obj)
> >  {
> > @@ -1201,6 +1258,22 @@
> >  {
> >     ELM_WIN_DATA_GET(obj, sd);
> >
> > +   if (sd->img_obj)
> > +     {
> > +        if ((x != sd->screen.x) || (y != sd->screen.y))
> > +          {
> > +             sd->screen.x = x;
> > +             sd->screen.y = y;
> > +             evas_object_smart_callback_call(obj, SIG_MOVED, NULL);
> > +          }
> > +        return;
> > +     }
> > +   else
> > +     {
> > +        TRAP(sd, move, x, y);
> > +        if (!ecore_evas_override_get(sd->ee))  return;
> > +     }
> > +
> >     _elm_win_parent_sc->base.move(obj, x, y);
> >
> >     if (ecore_evas_override_get(sd->ee))
> > @@ -1228,6 +1301,7 @@
> >                        Evas_Coord h)
> >  {
> >     ELM_WIN_DATA_GET(obj, sd);
> > +   Evas_Coord ow, oh, fw, fh;
> >
> >     _elm_win_parent_sc->base.resize(obj, w, h);
> >
> > @@ -1246,16 +1320,23 @@
> >
> >          evas_object_image_size_set(sd->img_obj, w, h);
> >       }
> > +
> > +   evas_output_framespace_get(sd->evas, NULL, NULL, &fw, &fh);
> > +   ow = w + fw;
> > +   oh = h + fh;
> > +   TRAP(sd, resize, ow, oh);
> >  }
> >
> >  static void
> >  _elm_win_delete_request(Ecore_Evas *ee)
> >  {
> > -   Evas_Object *obj = ecore_evas_object_associate_get(ee);
> > +   Elm_Win_Smart_Data *sd = _elm_win_associate_get(ee);
> > +   Evas_Object *obj;
> >
> > -   ELM_WIN_CHECK(obj);
> > -   ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
> > +   EINA_SAFETY_ON_NULL_RETURN(sd);
> >
> > +   obj = ELM_WIDGET_DATA(sd)->obj;
> > +
> >     int autodel = sd->autodel;
> >     sd->autodel_clear = &autodel;
> >     evas_object_ref(obj);
> > @@ -1763,7 +1844,7 @@
> >
> >     if (!(sd = data)) return;
> >     sd->iconified = EINA_TRUE;
> > -   ecore_evas_iconified_set(sd->ee, EINA_TRUE);
> > +   TRAP(sd, iconified_set, EINA_TRUE);
> >  }
> >
> >  static void
> > @@ -1777,7 +1858,7 @@
> >     if (!(sd = data)) return;
> >     if (sd->maximized) sd->maximized = EINA_FALSE;
> >     else sd->maximized = EINA_TRUE;
> > -   ecore_evas_maximized_set(sd->ee, sd->maximized);
> > +   TRAP(sd, maximized_set, sd->maximized);
> >  }
> >
> >  static void
> > @@ -2216,6 +2297,9 @@
> >     SD_CPY(shot.info);
> >  #undef SD_CPY
> >
> > +   if ((trap) && (trap->add))
> > +     sd->trap_data = trap->add(obj);
> > +
> >     /* complementary actions, which depend on final smart data
> >      * pointer */
> >     if (type == ELM_WIN_INLINED_IMAGE)
> > @@ -2252,10 +2336,10 @@
> >  #endif
> >
> >     if ((_elm_config->bgpixmap) && (!_elm_config->compositing))
> > -     ecore_evas_avoid_damage_set(sd->ee,
> ECORE_EVAS_AVOID_DAMAGE_EXPOSE);
> > +     TRAP(sd, avoid_damage_set, ECORE_EVAS_AVOID_DAMAGE_EXPOSE);
> >     // bg pixmap done by x - has other issues like can be redrawn by x
> > before it
> >     // is filled/ready by app
> > -   //     ecore_evas_avoid_damage_set(sd->ee,
> > ECORE_EVAS_AVOID_DAMAGE_BUILT_IN);
> > +   //     TRAP(sd, avoid_damage_set, ECORE_EVAS_AVOID_DAMAGE_BUILT_IN);
> >
> >     sd->type = type;
> >     sd->parent = parent;
> > @@ -2281,18 +2365,27 @@
> >     if (type == ELM_WIN_INLINED_IMAGE)
> >       elm_widget_parent2_set(obj, parent);
> >
> > -   ecore_evas_object_associate
> > -     (sd->ee, obj, ECORE_EVAS_OBJECT_ASSOCIATE_BASE |
> > -     ECORE_EVAS_OBJECT_ASSOCIATE_STACK |
> > ECORE_EVAS_OBJECT_ASSOCIATE_LAYER);
> > +   /* use own version of ecore_evas_object_associate() that does TRAP()
> */
> > +   ecore_evas_data_set(sd->ee, "elm_win", sd);
> >
> >
> Dear Barbieri,
>
>
> > -   if (sd->img_obj)
> > -     evas_object_intercept_move_callback_add
> > -       (obj, _elm_win_obj_intercept_move, sd);
> >
>
> Why did you remove evas_object_intercept_move_callback_add()?
> Is that handled in another place?
> I got a report from one of my colleagues that after this commit, one
> application does not work well.
> I don't know the detail issue from that application, but I am curious why
> this was removed.
> Maybe we need some other workarounds/
>
> Thanks in advance.
>
> Daniel Juyung Seo (SeoZ)
>
>
> > +   evas_object_event_callback_add
> > +     (obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
> > +      _elm_win_obj_callback_changed_size_hints, sd);
> >
> > +   evas_object_intercept_raise_callback_add
> > +     (obj, _elm_win_obj_intercept_raise, sd);
> > +   evas_object_intercept_lower_callback_add
> > +     (obj, _elm_win_obj_intercept_lower, sd);
> > +   evas_object_intercept_stack_above_callback_add
> > +     (obj, _elm_win_obj_intercept_stack_above, sd);
> > +   evas_object_intercept_stack_below_callback_add
> > +     (obj, _elm_win_obj_intercept_stack_below, sd);
> > +   evas_object_intercept_layer_set_callback_add
> > +     (obj, _elm_win_obj_intercept_layer_set, sd);
> >     evas_object_intercept_show_callback_add
> >       (obj, _elm_win_obj_intercept_show, sd);
> >
> > -   ecore_evas_name_class_set(sd->ee, name, _elm_appname);
> > +   TRAP(sd, name_class_set, name, _elm_appname);
> >     ecore_evas_callback_delete_request_set(sd->ee,
> > _elm_win_delete_request);
> >     ecore_evas_callback_resize_set(sd->ee, _elm_win_resize);
> >     ecore_evas_callback_mouse_in_set(sd->ee, _elm_win_mouse_in);
> > @@ -2322,7 +2415,7 @@
> >
> >     if (ENGINE_COMPARE(ELM_SOFTWARE_FB))
> >       {
> > -        ecore_evas_fullscreen_set(sd->ee, 1);
> > +        TRAP(sd, fullscreen_set, 1);
> >       }
> >     else if (ENGINE_COMPARE(ELM_WAYLAND_SHM))
> >       _elm_win_frame_add(sd, "default");
> > @@ -2452,7 +2545,7 @@
> >
> >     if (!title) return;
> >     eina_stringshare_replace(&(sd->title), title);
> > -   ecore_evas_title_set(sd->ee, sd->title);
> > +   TRAP(sd, title_set, sd->title);
> >     if (sd->frame_obj)
> >       edje_object_part_text_escaped_set
> >         (sd->frame_obj, "elm.text.title", sd->title);
> > @@ -2565,7 +2658,7 @@
> >     ELM_WIN_CHECK(obj);
> >     ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
> >
> > -   ecore_evas_activate(sd->ee);
> > +   TRAP(sd, activate);
> >  }
> >
> >  EAPI void
> > @@ -2574,7 +2667,7 @@
> >     ELM_WIN_CHECK(obj);
> >     ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
> >
> > -   ecore_evas_lower(sd->ee);
> > +   TRAP(sd, lower);
> >  }
> >
> >  EAPI void
> > @@ -2583,7 +2676,7 @@
> >     ELM_WIN_CHECK(obj);
> >     ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
> >
> > -   ecore_evas_raise(sd->ee);
> > +   TRAP(sd, raise);
> >  }
> >
> >  EAPI void
> > @@ -2596,6 +2689,9 @@
> >     ELM_WIN_CHECK(obj);
> >     ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
> >
> > +   if ((trap) && (trap->center) && (!trap->center(sd->trap_data, obj)))
> > +     return;
> > +
> >     ecore_evas_screen_geometry_get(sd->ee, NULL, NULL, &screen_w,
> > &screen_h);
> >     if ((!screen_w) || (!screen_h)) return;
> >
> > @@ -2619,7 +2715,7 @@
> >     ELM_WIN_CHECK(obj);
> >     ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
> >
> > -   ecore_evas_borderless_set(sd->ee, borderless);
> > +   TRAP(sd, borderless_set, borderless);
> >  #ifdef HAVE_ELEMENTARY_X
> >     _elm_win_xwin_update(sd);
> >  #endif
> > @@ -2641,7 +2737,7 @@
> >     ELM_WIN_CHECK(obj);
> >     ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
> >
> > -   ecore_evas_shaped_set(sd->ee, shaped);
> > +   TRAP(sd, shaped_set, shaped);
> >  #ifdef HAVE_ELEMENTARY_X
> >     _elm_win_xwin_update(sd);
> >  #endif
> > @@ -2678,15 +2774,15 @@
> >                    if (!_elm_config->compositing)
> >                      elm_win_shaped_set(obj, alpha);
> >                    else
> > -                    ecore_evas_alpha_set(sd->ee, alpha);
> > +                    TRAP(sd, alpha_set, alpha);
> >                 }
> >               else
> > -               ecore_evas_alpha_set(sd->ee, alpha);
> > +               TRAP(sd, alpha_set, alpha);
> >               _elm_win_xwin_update(sd);
> >            }
> >          else
> >  #endif
> > -        ecore_evas_alpha_set(sd->ee, alpha);
> > +          TRAP(sd, alpha_set, alpha);
> >       }
> >  }
> >
> > @@ -2711,7 +2807,7 @@
> >     ELM_WIN_CHECK(obj);
> >     ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
> >
> > -   ecore_evas_override_set(sd->ee, override);
> > +   TRAP(sd, override_set, override);
> >  #ifdef HAVE_ELEMENTARY_X
> >     _elm_win_xwin_update(sd);
> >  #endif
> > @@ -2742,7 +2838,7 @@
> >     else
> >       {
> >          sd->fullscreen = fullscreen;
> > -        ecore_evas_fullscreen_set(sd->ee, fullscreen);
> > +        TRAP(sd, fullscreen_set, fullscreen);
> >  #ifdef HAVE_ELEMENTARY_X
> >          _elm_win_xwin_update(sd);
> >  #endif
> > @@ -2776,7 +2872,7 @@
> >
> >     sd->maximized = maximized;
> >     // YYY: handle if sd->img_obj
> > -   ecore_evas_maximized_set(sd->ee, maximized);
> > +   TRAP(sd, maximized_set, maximized);
> >  #ifdef HAVE_ELEMENTARY_X
> >     _elm_win_xwin_update(sd);
> >  #endif
> > @@ -2799,7 +2895,7 @@
> >     ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
> >
> >     sd->iconified = iconified;
> > -   ecore_evas_iconified_set(sd->ee, iconified);
> > +   TRAP(sd, iconified_set, iconified);
> >  #ifdef HAVE_ELEMENTARY_X
> >     _elm_win_xwin_update(sd);
> >  #endif
> > @@ -2822,7 +2918,7 @@
> >     ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
> >
> >     sd->withdrawn = withdrawn;
> > -   ecore_evas_withdrawn_set(sd->ee, withdrawn);
> > +   TRAP(sd, withdrawn_set, withdrawn);
> >  #ifdef HAVE_ELEMENTARY_X
> >     _elm_win_xwin_update(sd);
> >  #endif
> > @@ -2845,7 +2941,7 @@
> >     ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
> >
> >     sd->urgent = urgent;
> > -   ecore_evas_urgent_set(sd->ee, urgent);
> > +   TRAP(sd, urgent_set, urgent);
> >  #ifdef HAVE_ELEMENTARY_X
> >     _elm_win_xwin_update(sd);
> >  #endif
> > @@ -2868,7 +2964,7 @@
> >     ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
> >
> >     sd->demand_attention = demand_attention;
> > -   ecore_evas_demand_attention_set(sd->ee, demand_attention);
> > +   TRAP(sd, demand_attention_set, demand_attention);
> >  #ifdef HAVE_ELEMENTARY_X
> >     _elm_win_xwin_update(sd);
> >  #endif
> > @@ -2891,7 +2987,7 @@
> >     ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
> >
> >     sd->modal = modal;
> > -   ecore_evas_modal_set(sd->ee, modal);
> > +   TRAP(sd, modal_set, modal);
> >  #ifdef HAVE_ELEMENTARY_X
> >     _elm_win_xwin_update(sd);
> >  #endif
> > @@ -2914,7 +3010,7 @@
> >     ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
> >
> >     sd->aspect = aspect;
> > -   ecore_evas_aspect_set(sd->ee, aspect);
> > +   TRAP(sd, aspect_set, aspect);
> >  #ifdef HAVE_ELEMENTARY_X
> >     _elm_win_xwin_update(sd);
> >  #endif
> > @@ -2936,7 +3032,7 @@
> >     ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
> >     sd->size_base_w = w;
> >     sd->size_base_h = h;
> > -   ecore_evas_size_base_set(sd->ee, w, h);
> > +   TRAP(sd, size_base_set, w, h);
> >  #ifdef HAVE_ELEMENTARY_X
> >     _elm_win_xwin_update(sd);
> >  #endif
> > @@ -2958,7 +3054,7 @@
> >     ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
> >     sd->size_step_w = w;
> >     sd->size_step_h = h;
> > -   ecore_evas_size_step_set(sd->ee, w, h);
> > +   TRAP(sd, size_step_set, w, h);
> >  #ifdef HAVE_ELEMENTARY_X
> >     _elm_win_xwin_update(sd);
> >  #endif
> > @@ -2980,7 +3076,7 @@
> >     ELM_WIN_CHECK(obj);
> >     ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
> >
> > -   ecore_evas_layer_set(sd->ee, layer);
> > +   TRAP(sd, layer_set, layer);
> >  #ifdef HAVE_ELEMENTARY_X
> >     _elm_win_xwin_update(sd);
> >  #endif
> > @@ -3004,7 +3100,7 @@
> >
> >     if (sd->rot == rotation) return;
> >     sd->rot = rotation;
> > -   ecore_evas_rotation_set(sd->ee, rotation);
> > +   TRAP(sd, rotation_set, rotation);
> >     evas_object_size_hint_min_set(obj, -1, -1);
> >     evas_object_size_hint_max_set(obj, -1, -1);
> >     _elm_win_resize_objects_eval(obj);
> > @@ -3022,7 +3118,7 @@
> >
> >     if (sd->rot == rotation) return;
> >     sd->rot = rotation;
> > -   ecore_evas_rotation_with_resize_set(sd->ee, rotation);
> > +   TRAP(sd, rotation_with_resize_set, rotation);
> >     evas_object_size_hint_min_set(obj, -1, -1);
> >     evas_object_size_hint_max_set(obj, -1, -1);
> >     _elm_win_resize_objects_eval(obj);
> > @@ -3049,7 +3145,7 @@
> >     ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
> >
> >     sd->sticky = sticky;
> > -   ecore_evas_sticky_set(sd->ee, sticky);
> > +   TRAP(sd, sticky_set, sticky);
> >  #ifdef HAVE_ELEMENTARY_X
> >     _elm_win_xwin_update(sd);
> >  #endif
> > @@ -3423,7 +3519,7 @@
> >     ELM_WIN_DATA_GET_OR_RETURN(obj, sd);
> >
> >     sd->skip_focus = skip;
> > -   ecore_evas_focus_skip_set(sd->ee, skip);
> > +   TRAP(sd, focus_skip_set, skip);
> >  }
> >
> >  EAPI void
> > @@ -3582,3 +3678,19 @@
> >  #endif
> >     return NULL;
> >  }
> > +
> > +EAPI Eina_Bool
> > +elm_win_trap_set(const Elm_Win_Trap *t)
> > +{
> > +   DBG("old %p, new %p", trap, t);
> > +
> > +   if ((t) && (t->version != ELM_WIN_TRAP_VERSION))
> > +     {
> > +        CRITICAL("trying to set a trap version %lu while %lu was
> > expected!",
> > +                 t->version, ELM_WIN_TRAP_VERSION);
> > +        return EINA_FALSE;
> > +     }
> > +
> > +   trap = t;
> > +   return EINA_TRUE;
> > +}
> >
> > Modified: trunk/elementary/src/lib/elm_win.h
> > ===================================================================
> > --- trunk/elementary/src/lib/elm_win.h  2012-07-19 03:25:25 UTC (rev
> 74155)
> > +++ trunk/elementary/src/lib/elm_win.h  2012-07-19 04:35:50 UTC (rev
> 74156)
> > @@ -1339,5 +1339,68 @@
> >  EAPI Ecore_Wl_Window *elm_win_wl_window_get(const Evas_Object *obj);
> >
> >  /**
> > + * @typedef Elm_Win_Trap
> > + *
> > + * Trap can be set with elm_win_trap_set() and will intercept the
> > + * calls to internal ecore_evas with the same name and parameters. If
> > + * there is a trap and it returns @c EINA_TRUE then the call will be
> > + * allowed, otherwise it will be ignored.
> > + */
> > +typedef struct _Elm_Win_Trap Elm_Win_Trap;
> > +struct _Elm_Win_Trap
> > +{
> > +#define ELM_WIN_TRAP_VERSION (1UL)
> > +   unsigned long version;
> > +   void *(*add)(Evas_Object *o); /**< object was just added. The
> returned
> > pointer will be handled to every other trap call. */
> > +   void (*del)(void *data, Evas_Object *o); /**< object will be deleted.
> > */
> > +   Eina_Bool (*hide)(void *data, Evas_Object *o);
> > +   Eina_Bool (*show)(void *data, Evas_Object *o);
> > +   Eina_Bool (*move)(void *data, Evas_Object *o, int x, int y);
> > +   Eina_Bool (*resize)(void *data, Evas_Object *o, int w, int h);
> > +   Eina_Bool (*center)(void *data, Evas_Object *o); /* not in
> ecore_evas,
> > but nice to trap */
> > +   Eina_Bool (*lower)(void *data, Evas_Object *o);
> > +   Eina_Bool (*raise)(void *data, Evas_Object *o);
> > +   Eina_Bool (*activate)(void *data, Evas_Object *o);
> > +   Eina_Bool (*alpha_set)(void *data, Evas_Object *o, Eina_Bool alpha);
> > +   Eina_Bool (*aspect_set)(void *data, Evas_Object *o, double aspect);
> > +   Eina_Bool (*avoid_damage_set)(void *data, Evas_Object *o,
> > Ecore_Evas_Avoid_Damage_Type on);
> > +   Eina_Bool (*borderless_set)(void *data, Evas_Object *o, Eina_Bool
> on);
> > +   Eina_Bool (*demand_attention_set)(void *data, Evas_Object *o,
> > Eina_Bool on);
> > +   Eina_Bool (*focus_skip_set)(void *data, Evas_Object *o, Eina_Bool
> > skip);
> > +   Eina_Bool (*fullscreen_set)(void *data, Evas_Object *o, Eina_Bool
> on);
> > +   Eina_Bool (*iconified_set)(void *data, Evas_Object *o, Eina_Bool on);
> > +   Eina_Bool (*layer_set)(void *data, Evas_Object *o, int layer);
> > +   Eina_Bool (*manual_render_set)(void *data, Evas_Object *o, Eina_Bool
> > manual_render);
> > +   Eina_Bool (*maximized_set)(void *data, Evas_Object *o, Eina_Bool on);
> > +   Eina_Bool (*modal_set)(void *data, Evas_Object *o, Eina_Bool on);
> > +   Eina_Bool (*name_class_set)(void *data, Evas_Object *o, const char
> *n,
> > const char *c);
> > +   Eina_Bool (*object_cursor_set)(void *data, Evas_Object *o,
> Evas_Object
> > *obj, int layer, int hot_x, int hot_y);
> > +   Eina_Bool (*override_set)(void *data, Evas_Object *o, Eina_Bool on);
> > +   Eina_Bool (*rotation_set)(void *data, Evas_Object *o, int rot);
> > +   Eina_Bool (*rotation_with_resize_set)(void *data, Evas_Object *o, int
> > rot);
> > +   Eina_Bool (*shaped_set)(void *data, Evas_Object *o, Eina_Bool
> shaped);
> > +   Eina_Bool (*size_base_set)(void *data, Evas_Object *o, int w, int h);
> > +   Eina_Bool (*size_step_set)(void *data, Evas_Object *o, int w, int h);
> > +   Eina_Bool (*size_min_set)(void *data, Evas_Object *o, int w, int h);
> > +   Eina_Bool (*size_max_set)(void *data, Evas_Object *o, int w, int h);
> > +   Eina_Bool (*sticky_set)(void *data, Evas_Object *o, Eina_Bool
> sticky);
> > +   Eina_Bool (*title_set)(void *data, Evas_Object *o, const char *t);
> > +   Eina_Bool (*urgent_set)(void *data, Evas_Object *o, Eina_Bool
> urgent);
> > +   Eina_Bool (*withdrawn_set)(void *data, Evas_Object *o, Eina_Bool
> > withdrawn);
> > +};
> > +
> > +/**
> > + * Sets the trap to be used for internal @c Ecore_Evas management.
> > + *
> > + * @param trap the trap to be used or @c NULL to remove traps. Pointer
> > + *        is not modified or copied, keep it alive.
> > + * @return @c EINA_TRUE on success, @c EINA_FALSE if there was a
> > + *         problem, such as invalid version number.
> > + *
> > + * @warning this is an advanced feature that you should avoid using.
> > + */
> > +EAPI Eina_Bool elm_win_trap_set(const Elm_Win_Trap *trap);
> > +
> > +/**
> >   * @}
> >   */
> >
> >
> >
> >
> ------------------------------------------------------------------------------
> > Live Security Virtual Conference
> > Exclusive live event will cover all the ways today's security and
> > threat landscape has changed and how IT managers can respond. Discussions
> > will include endpoint security, mobile security and the latest in malware
> > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> > _______________________________________________
> > enlightenment-svn mailing list
> > enlightenment-...@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/enlightenment-svn
> >
>
> ------------------------------------------------------------------------------
> LogMeIn Central: Instant, anywhere, Remote PC access and management.
> Stay in control, update software, and manage PCs from one command center
> Diagnose problems and improve visibility into emerging IT issues
> Automate, monitor and manage. Do more in less time with Central
> http://p.sf.net/sfu/logmein12331_d2d
> _______________________________________________
> enlightenment-devel mailing list
> enlightenment-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
>



-- 
Gustavo Sverzut Barbieri
http://profusion.mobi embedded systems
--------------------------------------
MSN: barbi...@gmail.com
Skype: gsbarbieri
Mobile: +55 (19) 9225-2202
------------------------------------------------------------------------------
LogMeIn Central: Instant, anywhere, Remote PC access and management.
Stay in control, update software, and manage PCs from one command center
Diagnose problems and improve visibility into emerging IT issues
Automate, monitor and manage. Do more in less time with Central
http://p.sf.net/sfu/logmein12331_d2d
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to