Wow!
This is awesome!

Good to know that one need to "svn up" evas to test this.
And run
$ elementary_test "Window Inline".

Thanks.
Daniel Juyung Seo (SeoZ)

On Thu, Apr 14, 2011 at 7:48 PM, Enlightenment SVN <
no-re...@enlightenment.org> wrote:

> Log:
> mm.... new widget options/modes for win... u can put a window..
>  INLINED in another window. :) it's an image object. have fun!
>
>
>
> Author:       raster
> Date:         2011-04-14 03:48:43 -0700 (Thu, 14 Apr 2011)
> New Revision: 58657
> Trac:         http://trac.enlightenment.org/e/changeset/58657
>
> Added:
>  trunk/elementary/data/images/pt.png
> trunk/elementary/src/bin/test_win_inline.c
> Modified:
>  trunk/elementary/data/images/Makefile.am
> trunk/elementary/src/bin/Makefile.am trunk/elementary/src/bin/test.c
> trunk/elementary/src/lib/Elementary.h.intrunk/elementary/src/lib/elm_cnp_helper.c
> trunk/elementary/src/lib/elm_conform.c trunk/elementary/src/lib/elm_entry.c
> trunk/elementary/src/lib/elm_win.c
>
> Modified: trunk/elementary/data/images/Makefile.am
> ===================================================================
> --- trunk/elementary/data/images/Makefile.am    2011-04-14 10:47:40 UTC
> (rev 58656)
> +++ trunk/elementary/data/images/Makefile.am    2011-04-14 10:48:43 UTC
> (rev 58657)
> @@ -42,6 +42,7 @@
>  bubble.png \
>  bubble_sh.png \
>  mystrale.jpg \
> -mystrale_2.jpg
> +mystrale_2.jpg \
> +pt.png
>
>  EXTRA_DIST = $(files_DATA)
>
>
> Property changes on: trunk/elementary/data/images/pt.png
> ___________________________________________________________________
> Added: svn:mime-type
>   + application/octet-stream
>
> Modified: trunk/elementary/src/bin/Makefile.am
> ===================================================================
> --- trunk/elementary/src/bin/Makefile.am        2011-04-14 10:47:40 UTC
> (rev 58656)
> +++ trunk/elementary/src/bin/Makefile.am        2011-04-14 10:48:43 UTC
> (rev 58657)
> @@ -95,7 +95,8 @@
>  test_ctxpopup.c \
>  test_bubble.c \
>  test_segment_control.c \
> -test_store.c
> +test_store.c \
> +test_win_inline.c
>
>  elementary_test_LDADD = $(top_builddir)/src/lib/libelementary.la \
>        @ELEMENTARY_EWEATHER_LIBS@ \
>
> Modified: trunk/elementary/src/bin/test.c
> ===================================================================
> --- trunk/elementary/src/bin/test.c     2011-04-14 10:47:40 UTC (rev 58656)
> +++ trunk/elementary/src/bin/test.c     2011-04-14 10:48:43 UTC (rev 58657)
> @@ -122,6 +122,7 @@
>  void test_bubble(void *data, Evas_Object *obj, void *event_info);
>  void test_segment_control(void *data, Evas_Object *obj, void *event_info);
>  void test_store(void *data, Evas_Object *obj, void *event_info);
> +void test_win_inline(void *data, Evas_Object *obj, void *event_info);
>
>  struct elm_test
>  {
> @@ -376,6 +377,7 @@
>    ADD_TEST("Bubble", test_bubble);
>    ADD_TEST("Segment Control", test_segment_control);
>    ADD_TEST("Store", test_store);
> +   ADD_TEST("Window Inline", test_win_inline);
>  #undef ADD_TEST
>
>    if (autorun)
>
> Modified: trunk/elementary/src/lib/Elementary.h.in
> ===================================================================
> --- trunk/elementary/src/lib/Elementary.h.in    2011-04-14 10:47:40 UTC
> (rev 58656)
> +++ trunk/elementary/src/lib/Elementary.h.in    2011-04-14 10:48:43 UTC
> (rev 58657)
> @@ -468,7 +468,11 @@
>         ELM_WIN_TOOLTIP,
>         ELM_WIN_NOTIFICATION,
>         ELM_WIN_COMBO,
> -        ELM_WIN_DND
> +        ELM_WIN_DND,
> +
> +        ELM_WIN_INLINED, // YYY: not implemented yet
> +        ELM_WIN_INLINED_IMAGE,
> +        ELM_WIN_MEMORY // YYY: not implemented yet
>      } Elm_Win_Type;
>
>    typedef enum _Elm_Win_Keyboard_Mode
> @@ -544,6 +548,7 @@
>    EAPI int          elm_win_quickpanel_zone_get(const Evas_Object *obj)
> EINA_ARG_NONNULL(1);
>    EAPI void         elm_win_prop_focus_skip_set(Evas_Object *obj,
> Eina_Bool skip); EINA_ARG_NONNULL(1);
>    EAPI void         elm_win_illume_command_send(Evas_Object *obj,
> Elm_Illume_Command command, void *params); EINA_ARG_NONNULL(1);
> +   EAPI Evas_Object *elm_win_inlined_image_object_get(Evas_Object *obj);
>    EAPI void         elm_win_focus_highlight_enabled_set(Evas_Object *obj,
> Eina_Bool enabled) EINA_ARG_NONNULL(1);
>    EAPI Eina_Bool    elm_win_focus_highlight_enabled_get(const Evas_Object
> *obj) EINA_ARG_NONNULL(1);
>    EAPI void         elm_win_focus_highlight_style_set(Evas_Object *obj,
> const char *style) EINA_ARG_NONNULL(1);
>
> Modified: trunk/elementary/src/lib/elm_cnp_helper.c
> ===================================================================
> --- trunk/elementary/src/lib/elm_cnp_helper.c   2011-04-14 10:47:40 UTC
> (rev 58656)
> +++ trunk/elementary/src/lib/elm_cnp_helper.c   2011-04-14 10:48:43 UTC
> (rev 58657)
> @@ -410,8 +410,11 @@
>  elm_selection_set(Elm_Sel_Type selection, Evas_Object *widget,
> Elm_Sel_Format format, const char *selbuf)
>  {
>  #ifdef HAVE_ELEMENTARY_X
> +   Evas_Object *top = elm_widget_top_get(widget);
> +   Ecore_X_Window xwin = elm_win_xwindow_get(top);
>    Cnp_Selection *sel;
>
> +   if (!xwin) return EINA_FALSE;
>    if ((unsigned int)selection >= (unsigned int)ELM_SEL_MAX) return
> EINA_FALSE;
>    if (!_elm_cnp_init_count) _elm_cnp_init();
>    if ((!selbuf) && (format != ELM_SEL_FORMAT_IMAGE))
> @@ -422,7 +425,7 @@
>    sel->active = 1;
>    sel->widget = widget;
>
> -   sel->set(elm_win_xwindow_get(widget),&selection,sizeof(Elm_Sel_Type));
> +   sel->set(xwin, &selection, sizeof(Elm_Sel_Type));
>    sel->format = format;
>    sel->selbuf = selbuf ? strdup(selbuf) : NULL;
>
>
> Modified: trunk/elementary/src/lib/elm_conform.c
> ===================================================================
> --- trunk/elementary/src/lib/elm_conform.c      2011-04-14 10:47:40 UTC
> (rev 58656)
> +++ trunk/elementary/src/lib/elm_conform.c      2011-04-14 10:48:43 UTC
> (rev 58657)
> @@ -241,31 +241,35 @@
>    elm_widget_resize_object_set(obj, wd->base);
>
>  #ifdef HAVE_ELEMENTARY_X
> -   Ecore_X_Window zone, xwin;
> -   int sh = -1;
> -
> -   xwin = elm_win_xwindow_get(parent);
> -   zone = ecore_x_e_illume_zone_get(xwin);
> -
> -   ecore_x_e_illume_indicator_geometry_get(zone, NULL, NULL, NULL, &sh);
> -   if (sh < 0) sh = 0;
> -   wd->shelf = evas_object_rectangle_add(e);
> -   evas_object_color_set(wd->shelf, 0, 0, 0, 0);
> -   evas_object_size_hint_min_set(wd->shelf, -1, sh);
> -   evas_object_size_hint_max_set(wd->shelf, -1, sh);
> -   edje_object_part_swallow(wd->base, "elm.swallow.shelf", wd->shelf);
> -
> -   sh = -1;
> -   ecore_x_e_illume_softkey_geometry_get(zone, NULL, NULL, NULL, &sh);
> -   if (sh < 0) sh = 0;
> -   wd->panel = evas_object_rectangle_add(e);
> -   evas_object_color_set(wd->panel, 0, 0, 0, 0);
> -   evas_object_size_hint_min_set(wd->panel, -1, sh);
> -   evas_object_size_hint_max_set(wd->panel, -1, sh);
> -   edje_object_part_swallow(wd->base, "elm.swallow.panel", wd->panel);
> -
> -   wd->prop_hdl = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_PROPERTY,
> -                                          _prop_change, obj);
> +   Evas_Object *top = elm_widget_top_get(obj);
> +   Ecore_X_Window zone, xwin = elm_win_xwindow_get(top);
> +
> +   if ((xwin) && (!elm_win_inlined_image_object_get(top)))
> +     {
> +        int sh = -1;
> +
> +        zone = ecore_x_e_illume_zone_get(xwin);
> +
> +        ecore_x_e_illume_indicator_geometry_get(zone, NULL, NULL, NULL,
> &sh);
> +        if (sh < 0) sh = 0;
> +        wd->shelf = evas_object_rectangle_add(e);
> +        evas_object_color_set(wd->shelf, 0, 0, 0, 0);
> +        evas_object_size_hint_min_set(wd->shelf, -1, sh);
> +        evas_object_size_hint_max_set(wd->shelf, -1, sh);
> +        edje_object_part_swallow(wd->base, "elm.swallow.shelf",
> wd->shelf);
> +
> +        sh = -1;
> +        ecore_x_e_illume_softkey_geometry_get(zone, NULL, NULL, NULL,
> &sh);
> +        if (sh < 0) sh = 0;
> +        wd->panel = evas_object_rectangle_add(e);
> +        evas_object_color_set(wd->panel, 0, 0, 0, 0);
> +        evas_object_size_hint_min_set(wd->panel, -1, sh);
> +        evas_object_size_hint_max_set(wd->panel, -1, sh);
> +        edje_object_part_swallow(wd->base, "elm.swallow.panel",
> wd->panel);
> +
> +        wd->prop_hdl =
> ecore_event_handler_add(ECORE_X_EVENT_WINDOW_PROPERTY,
> +                                               _prop_change, obj);
> +     }
>    // FIXME: get kbd region prop
>  #endif
>
>
> Modified: trunk/elementary/src/lib/elm_entry.c
> ===================================================================
> --- trunk/elementary/src/lib/elm_entry.c        2011-04-14 10:47:40 UTC
> (rev 58656)
> +++ trunk/elementary/src/lib/elm_entry.c        2011-04-14 10:48:43 UTC
> (rev 58657)
> @@ -503,8 +503,10 @@
>
>    entries = eina_list_remove(entries, obj);
>  #ifdef HAVE_ELEMENTARY_X
> -   ecore_event_handler_del(wd->sel_notify_handler);
> -   ecore_event_handler_del(wd->sel_clear_handler);
> +   if (wd->sel_notify_handler)
> +      ecore_event_handler_del(wd->sel_notify_handler);
> +   if (wd->sel_clear_handler)
> +      ecore_event_handler_del(wd->sel_clear_handler);
>  #endif
>    if (wd->cut_sel) eina_stringshare_del(wd->cut_sel);
>    if (wd->text) eina_stringshare_del(wd->text);
>
> Modified: trunk/elementary/src/lib/elm_win.c
> ===================================================================
> --- trunk/elementary/src/lib/elm_win.c  2011-04-14 10:47:40 UTC (rev 58656)
> +++ trunk/elementary/src/lib/elm_win.c  2011-04-14 10:48:43 UTC (rev 58657)
> @@ -21,7 +21,7 @@
>  {
>    Ecore_Evas *ee;
>    Evas *evas;
> -   Evas_Object *parent, *win_obj;
> +   Evas_Object *parent, *win_obj, *img_obj, *frame_obj;
>    Eina_List *subobjs;
>  #ifdef HAVE_ELEMENTARY_X
>    Ecore_X_Window xwin;
> @@ -59,7 +59,9 @@
>
>  static const char *widtype = NULL;
>  static void _elm_win_obj_callback_del(void *data, Evas *e, Evas_Object
> *obj, void *event_info);
> +static void _elm_win_obj_callback_img_obj_del(void *data, Evas *e,
> Evas_Object *obj, void *event_info);
>  static void _elm_win_obj_callback_parent_del(void *data, Evas *e,
> Evas_Object *obj, void *event_info);
> +static void _elm_win_obj_intercept_move(void *data, Evas_Object *obj,
> Evas_Coord x, Evas_Coord y);
>  static void _elm_win_obj_intercept_show(void *data, Evas_Object *obj);
>  static void _elm_win_move(Ecore_Evas *ee);
>  static void _elm_win_resize(Ecore_Evas *ee);
> @@ -125,6 +127,13 @@
>    evas_object_smart_callback_call(win->win_obj, "focus,in", NULL);
>    win->focus_highlight.cur.visible = EINA_TRUE;
>    _elm_win_focus_highlight_reconfigure_job_start(win);
> +   if (win->frame_obj)
> +     {
> +     }
> +   else if (win->img_obj)
> +     {
> +        /* do nothing */
> +     }
>  }
>
>  static void
> @@ -140,6 +149,13 @@
>    evas_object_smart_callback_call(win->win_obj, "focus,out", NULL);
>    win->focus_highlight.cur.visible = EINA_FALSE;
>    _elm_win_focus_highlight_reconfigure_job_start(win);
> +   if (win->frame_obj)
> +     {
> +     }
> +   else if (win->img_obj)
> +     {
> +        /* do nothing */
> +     }
>  }
>
>  static Eina_Bool
> @@ -216,9 +232,23 @@
>  }
>
>  static void
> -_elm_win_obj_callback_del(void *data, Evas *e __UNUSED__, Evas_Object
> *obj, void *event_info __UNUSED__)
> +_elm_win_obj_callback_hide(void *data, Evas *e __UNUSED__, Evas_Object
> *obj __UNUSED__, void *event_info __UNUSED__)
>  {
>    Elm_Win *win = data;
> +
> +   if (win->frame_obj)
> +     {
> +     }
> +   else if (win->img_obj)
> +     {
> +        evas_object_hide(win->img_obj);
> +     }
> +}
> +
> +static void
> +_elm_win_obj_callback_del(void *data, Evas *e, Evas_Object *obj, void
> *event_info __UNUSED__)
> +{
> +   Elm_Win *win = data;
>    Evas_Object *child;
>
>    if (win->parent)
> @@ -230,8 +260,11 @@
>    if (win->autodel_clear) *(win->autodel_clear) = -1;
>    _elm_win_list = eina_list_remove(_elm_win_list, win->win_obj);
>    while (win->subobjs) elm_win_resize_object_del(obj, win->subobjs->data);
> -   ecore_evas_callback_delete_request_set(win->ee, NULL);
> -   ecore_evas_callback_resize_set(win->ee, NULL);
> +   if (win->ee)
> +     {
> +        ecore_evas_callback_delete_request_set(win->ee, NULL);
> +        ecore_evas_callback_resize_set(win->ee, NULL);
> +     }
>    if (win->deferred_resize_job) ecore_job_del(win->deferred_resize_job);
>    if (win->deferred_child_eval_job)
> ecore_job_del(win->deferred_child_eval_job);
>    while (((child = evas_object_bottom_get(win->evas))) &&
> @@ -256,9 +289,18 @@
>    // FIXME: we are in the del handler for the object and delete the canvas
>    // that lives under it from the handler... nasty. deferring doesn't help
> either
>
> -   ecore_job_add(_deferred_ecore_evas_free, win->ee);
> -   _elm_win_deferred_free++;
> -   //   ecore_evas_free(win->ee);
> +   if (win->img_obj)
> +     {
> +        win->img_obj = NULL;
> +     }
> +   else
> +     {
> +        if (win->ee)
> +          {
> +             ecore_job_add(_deferred_ecore_evas_free, win->ee);
> +             _elm_win_deferred_free++;
> +          }
> +     }
>
>    _elm_win_focus_highlight_shutdown(win);
>    eina_stringshare_del(win->focus_highlight.style);
> @@ -277,6 +319,16 @@
>  }
>
>  static void
> +_elm_win_obj_callback_img_obj_del(void *data, Evas *e __UNUSED__,
> Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
> +{
> +   Elm_Win *win = data;
> +   if (!win->img_obj) return;
> +   evas_object_event_callback_del_full
> +      (win->img_obj, EVAS_CALLBACK_DEL, _elm_win_obj_callback_img_obj_del,
> win);
> +   evas_object_del(win->img_obj);
> +}
> +
> +static void
>  _elm_win_obj_callback_parent_del(void *data, Evas *e __UNUSED__,
> Evas_Object *obj, void *event_info __UNUSED__)
>  {
>    Elm_Win *win = data;
> @@ -284,13 +336,37 @@
>  }
>
>  static void
> -_elm_win_obj_intercept_show(void *data __UNUSED__, Evas_Object *obj)
> +_elm_win_obj_intercept_move(void *data, Evas_Object *obj, Evas_Coord x,
> Evas_Coord y)
>  {
> +   Elm_Win *win = data;
> +
> +   if (win->img_obj)
> +     {
> +        win->screen.x = x;
> +        win->screen.y = y;
> +     }
> +   else
> +     {
> +        evas_object_move(obj, x, y);
> +     }
> +}
> +
> +static void
> +_elm_win_obj_intercept_show(void *data, Evas_Object *obj)
> +{
> +   Elm_Win *win = data;
>    // this is called to make sure all smart containers have calculated
> their
>    // sizes BEFORE we show the window to make sure it initially appears at
>    // our desired size (ie min size is known first)
>    evas_smart_objects_calculate(evas_object_evas_get(obj));
>    evas_object_show(obj);
> +   if (win->frame_obj)
> +     {
> +     }
> +   else if (win->img_obj)
> +     {
> +        evas_object_show(win->img_obj);
> +     }
>  }
>
>  static void
> @@ -307,9 +383,40 @@
>         win->screen.y = y;
>         evas_object_smart_callback_call(win->win_obj, "moved", NULL);
>      }
> +   if (win->frame_obj)
> +     {
> +     }
> +   else if (win->img_obj)
> +     {
> +        Evas_Coord x, y;
> +
> +        evas_object_geometry_get(obj, &x, &y, NULL, NULL);
> +        win->screen.x = x;
> +        win->screen.y = y;
> +//        evas_object_move(win->img_obj, x, y);
> +     }
>  }
>
>  static void
> +_elm_win_obj_callback_resize(void *data, Evas *e __UNUSED__, Evas_Object
> *obj, void *event_info __UNUSED__)
> +{
> +   Elm_Win *win = data;
> +
> +   if (win->frame_obj)
> +     {
> +     }
> +   else if (win->img_obj)
> +     {
> +        Evas_Coord w = 1, h = 1;
> +
> +        evas_object_geometry_get(obj, NULL, NULL, &w, &h);
> +        if (w < 1) w = 1;
> +        if (h < 1) h = 1;
> +        evas_object_image_size_set(win->img_obj, w, h);
> +     }
> +}
> +
> +static void
>  _elm_win_delete_request(Ecore_Evas *ee)
>  {
>    Evas_Object *obj = ecore_evas_object_associate_get(ee);
> @@ -338,6 +445,12 @@
>    win->deferred_resize_job = NULL;
>    ecore_evas_geometry_get(win->ee, NULL, NULL, &w, &h);
>    evas_object_resize(win->win_obj, w, h);
> +   if (win->frame_obj)
> +     {
> +     }
> +   else if (win->img_obj)
> +     {
> +     }
>    EINA_LIST_FOREACH(win->subobjs, l, obj)
>      {
>         evas_object_move(obj, 0, 0);
> @@ -971,89 +1084,137 @@
>         CRITICAL(engine " engine creation failed. Trying software X11."); \
>         win->ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1);      \
>    } while (0)
> +#define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
>
> -#define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
> -   if (ENGINE_COMPARE(ELM_SOFTWARE_X11))
> +   switch (type)
>      {
> -        win->ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1);
> +      case ELM_WIN_INLINED:
> +        // FIXME: implement. same as ELM_WIN_INLINED_IMAGE but with border
> +        // frame
> +        break;
> +      case ELM_WIN_INLINED_IMAGE:
> +          {
> +             if (parent)
> +               {
> +                  Evas *e = evas_object_evas_get(parent);
> +                  if (e)
> +                    {
> +                       Ecore_Evas *ee = ecore_evas_ecore_evas_get(e);
> +                       if (ee)
> +                         {
> +                            win->img_obj =
> ecore_evas_object_image_new(ee);
> +                            if (win->img_obj)
> +                              {
> +                                 win->ee =
> ecore_evas_object_ecore_evas_get(win->img_obj);
> +                                 if (win->ee)
> +                                   {
> +                                      evas_object_image_alpha_set
> +                                         (win->img_obj, EINA_FALSE);
> +                                      evas_object_image_filled_set
> +                                         (win->img_obj, EINA_TRUE);
> +                                      evas_object_event_callback_add
> +                                         (win->img_obj, EVAS_CALLBACK_DEL,
> +
> _elm_win_obj_callback_img_obj_del,
> +                                             win);
> +                                   }
> +                                 else
> +                                   {
> +                                      evas_object_del(win->img_obj);
> +                                      win->img_obj = NULL;
> +                                   }
> +                              }
> +                         }
> +                    }
> +               }
> +          }
> +        break;
> +      case ELM_WIN_MEMORY:
> +        // FIXME: implement
> +        break;
> +      default:
> +        if (ENGINE_COMPARE(ELM_SOFTWARE_X11))
> +          {
> +             win->ee = ecore_evas_software_x11_new(NULL, 0, 0, 0, 1, 1);
>  #ifdef HAVE_ELEMENTARY_X
> -        win->client_message_handler = ecore_event_handler_add
> -           (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win);
> +             win->client_message_handler = ecore_event_handler_add
> +                (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message,
> win);
>  #endif
> -     }
> -   else if (ENGINE_COMPARE(ELM_SOFTWARE_FB))
> -     {
> -        win->ee = ecore_evas_fb_new(NULL, 0, 1, 1);
> -        FALLBACK_TRY("Sofware FB");
> -     }
> -   else if (ENGINE_COMPARE(ELM_SOFTWARE_DIRECTFB))
> -     {
> -        win->ee = ecore_evas_directfb_new(NULL, 1, 0, 0, 1, 1);
> -        FALLBACK_TRY("Sofware DirectFB");
> -     }
> -   else if (ENGINE_COMPARE(ELM_SOFTWARE_16_X11))
> -     {
> -        win->ee = ecore_evas_software_x11_16_new(NULL, 0, 0, 0, 1, 1);
> -        FALLBACK_TRY("Sofware-16");
> +          }
> +        else if (ENGINE_COMPARE(ELM_SOFTWARE_FB))
> +          {
> +             win->ee = ecore_evas_fb_new(NULL, 0, 1, 1);
> +             FALLBACK_TRY("Sofware FB");
> +          }
> +        else if (ENGINE_COMPARE(ELM_SOFTWARE_DIRECTFB))
> +          {
> +             win->ee = ecore_evas_directfb_new(NULL, 1, 0, 0, 1, 1);
> +             FALLBACK_TRY("Sofware DirectFB");
> +          }
> +        else if (ENGINE_COMPARE(ELM_SOFTWARE_16_X11))
> +          {
> +             win->ee = ecore_evas_software_x11_16_new(NULL, 0, 0, 0, 1,
> 1);
> +             FALLBACK_TRY("Sofware-16");
>  #ifdef HAVE_ELEMENTARY_X
> -        win->client_message_handler = ecore_event_handler_add
> -           (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win);
> +             win->client_message_handler = ecore_event_handler_add
> +                (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message,
> win);
>  #endif
>      }
> -   else if (ENGINE_COMPARE(ELM_SOFTWARE_8_X11))
> -     {
> -        win->ee = ecore_evas_software_x11_8_new(NULL, 0, 0, 0, 1, 1);
> -        FALLBACK_TRY("Sofware-8");
> +        else if (ENGINE_COMPARE(ELM_SOFTWARE_8_X11))
> +          {
> +             win->ee = ecore_evas_software_x11_8_new(NULL, 0, 0, 0, 1, 1);
> +             FALLBACK_TRY("Sofware-8");
>  #ifdef HAVE_ELEMENTARY_X
> -        win->client_message_handler = ecore_event_handler_add
> -           (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win);
> +             win->client_message_handler = ecore_event_handler_add
> +                (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message,
> win);
>  #endif
> -     }
> -   else if (ENGINE_COMPARE(ELM_XRENDER_X11))
> -     {
> -        win->ee = ecore_evas_xrender_x11_new(NULL, 0, 0, 0, 1, 1);
> -        FALLBACK_TRY("XRender");
> +          }
> +        else if (ENGINE_COMPARE(ELM_XRENDER_X11))
> +          {
> +             win->ee = ecore_evas_xrender_x11_new(NULL, 0, 0, 0, 1, 1);
> +             FALLBACK_TRY("XRender");
>  #ifdef HAVE_ELEMENTARY_X
> -        win->client_message_handler = ecore_event_handler_add
> -           (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win);
> +             win->client_message_handler = ecore_event_handler_add
> +                (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message,
> win);
>  #endif
> -     }
> -   else if (ENGINE_COMPARE(ELM_OPENGL_X11))
> -     {
> -        win->ee = ecore_evas_gl_x11_new(NULL, 0, 0, 0, 1, 1);
> -        FALLBACK_TRY("OpenGL");
> +          }
> +        else if (ENGINE_COMPARE(ELM_OPENGL_X11))
> +          {
> +             win->ee = ecore_evas_gl_x11_new(NULL, 0, 0, 0, 1, 1);
> +             FALLBACK_TRY("OpenGL");
>  #ifdef HAVE_ELEMENTARY_X
> -        win->client_message_handler = ecore_event_handler_add
> -           (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message, win);
> +             win->client_message_handler = ecore_event_handler_add
> +                (ECORE_X_EVENT_CLIENT_MESSAGE, _elm_win_client_message,
> win);
>  #endif
> +          }
> +        else if (ENGINE_COMPARE(ELM_SOFTWARE_WIN32))
> +          {
> +             win->ee = ecore_evas_software_gdi_new(NULL, 0, 0, 1, 1);
> +             FALLBACK_TRY("Sofware Win32");
> +          }
> +        else if (ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE))
> +          {
> +             win->ee = ecore_evas_software_wince_gdi_new(NULL, 0, 0, 1,
> 1);
> +             FALLBACK_TRY("Sofware-16-WinCE");
> +          }
> +        else if (ENGINE_COMPARE(ELM_SOFTWARE_SDL))
> +          {
> +             win->ee = ecore_evas_sdl_new(NULL, 0, 0, 0, 0, 0, 1);
> +             FALLBACK_TRY("Sofware SDL");
> +          }
> +        else if (ENGINE_COMPARE(ELM_SOFTWARE_16_SDL))
> +          {
> +             win->ee = ecore_evas_sdl16_new(NULL, 0, 0, 0, 0, 0, 1);
> +             FALLBACK_TRY("Sofware-16-SDL");
> +          }
> +        else if (ENGINE_COMPARE(ELM_OPENGL_SDL))
> +          {
> +             win->ee = ecore_evas_gl_sdl_new(NULL, 1, 1, 0, 0);
> +             FALLBACK_TRY("OpenGL SDL");
> +          }
> +#undef FALLBACK_TRY
> +        break;
>      }
> -   else if (ENGINE_COMPARE(ELM_SOFTWARE_WIN32))
> -     {
> -        win->ee = ecore_evas_software_gdi_new(NULL, 0, 0, 1, 1);
> -        FALLBACK_TRY("Sofware Win32");
> -     }
> -   else if (ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE))
> -     {
> -        win->ee = ecore_evas_software_wince_gdi_new(NULL, 0, 0, 1, 1);
> -        FALLBACK_TRY("Sofware-16-WinCE");
> -     }
> -   else if (ENGINE_COMPARE(ELM_SOFTWARE_SDL))
> -     {
> -        win->ee = ecore_evas_sdl_new(NULL, 0, 0, 0, 0, 0, 1);
> -        FALLBACK_TRY("Sofware SDL");
> -     }
> -   else if (ENGINE_COMPARE(ELM_SOFTWARE_16_SDL))
> -     {
> -        win->ee = ecore_evas_sdl16_new(NULL, 0, 0, 0, 0, 0, 1);
> -        FALLBACK_TRY("Sofware-16-SDL");
> -     }
> -   else if (ENGINE_COMPARE(ELM_OPENGL_SDL))
> -     {
> -        win->ee = ecore_evas_gl_sdl_new(NULL, 1, 1, 0, 0);
> -        FALLBACK_TRY("OpenGL SDL");
> -     }
> -#undef FALLBACK_TRY
> -
> +
>    if (!win->ee)
>      {
>         ERR("Cannot create window.");
> @@ -1091,6 +1252,8 @@
>    evas_object_layer_set(win->win_obj, 50);
>    evas_object_pass_events_set(win->win_obj, EINA_TRUE);
>
> +   evas_object_intercept_move_callback_add(win->win_obj,
> +                                           _elm_win_obj_intercept_move,
> win);
>    evas_object_intercept_show_callback_add(win->win_obj,
>                                            _elm_win_obj_intercept_show,
> win);
>    ecore_evas_object_associate(win->ee, win->win_obj,
> @@ -1099,10 +1262,14 @@
>                                ECORE_EVAS_OBJECT_ASSOCIATE_LAYER);
>    evas_object_event_callback_add(win->win_obj, EVAS_CALLBACK_SHOW,
>                                   _elm_win_obj_callback_show, win);
> +   evas_object_event_callback_add(win->win_obj, EVAS_CALLBACK_HIDE,
> +                                  _elm_win_obj_callback_hide, win);
>    evas_object_event_callback_add(win->win_obj, EVAS_CALLBACK_DEL,
>                                   _elm_win_obj_callback_del, win);
>    evas_object_event_callback_add(win->win_obj, EVAS_CALLBACK_MOVE,
>                                   _elm_win_obj_callback_move, win);
> +   evas_object_event_callback_add(win->win_obj, EVAS_CALLBACK_RESIZE,
> +                                  _elm_win_obj_callback_resize, win);
>
>    ecore_evas_name_class_set(win->ee, name, _elm_appname);
>    ecore_evas_callback_delete_request_set(win->ee,
> _elm_win_delete_request);
> @@ -1140,7 +1307,9 @@
>    Evas_Modifier_Mask mask = evas_key_modifier_mask_get(win->evas,
> "Control");
>    evas_object_event_callback_add(win->win_obj, EVAS_CALLBACK_KEY_DOWN,
>                                   _debug_key_down, win);
> -   Eina_Bool ret = evas_object_key_grab(win->win_obj, "F12", mask, 0,
> EINA_TRUE);
> +
> +   Eina_Bool ret = evas_object_key_grab(win->win_obj, "F12", mask, 0,
> +                                        EINA_TRUE);
>    printf("Key F12 exclusive for dot tree generation. (%d)\n", ret);
>  #endif
>    return win->win_obj;
> @@ -1417,23 +1586,33 @@
>    ELM_CHECK_WIDTYPE(obj, widtype);
>    win = elm_widget_data_get(obj);
>    if (!win) return;
> +   if (win->frame_obj)
> +     {
> +     }
> +   else if (win->img_obj)
> +     {
> +        evas_object_image_alpha_set(win->img_obj, alpha);
> +     }
> +   else
> +     {
>  #ifdef HAVE_ELEMENTARY_X
> -   if (win->xwin)
> -     {
> -        if (alpha)
> +        if (win->xwin)
>           {
> -             if (!_elm_config->compositing)
> -               elm_win_shaped_set(obj, alpha);
> +             if (alpha)
> +               {
> +                  if (!_elm_config->compositing)
> +                     elm_win_shaped_set(obj, alpha);
> +                  else
> +                     ecore_evas_alpha_set(win->ee, alpha);
> +               }
>              else
> -               ecore_evas_alpha_set(win->ee, alpha);
> +                ecore_evas_alpha_set(win->ee, alpha);
> +             _elm_win_xwin_update(win);
>           }
>         else
> -          ecore_evas_alpha_set(win->ee, alpha);
> -        _elm_win_xwin_update(win);
> +#endif
> +           ecore_evas_alpha_set(win->ee, alpha);
>      }
> -   else
> -#endif
> -     ecore_evas_alpha_set(win->ee, alpha);
>  }
>
>  /**
> @@ -1470,15 +1649,25 @@
>    win = elm_widget_data_get(obj);
>    if (!win) return;
>
> -#ifdef HAVE_ELEMENTARY_X
> -   if (win->xwin)
> +   if (win->frame_obj)
>      {
> -        ecore_evas_transparent_set(win->ee, transparent);
> -        _elm_win_xwin_update(win);
>      }
> +   else if (win->img_obj)
> +     {
> +        evas_object_image_alpha_set(win->img_obj, transparent);
> +     }
>    else
> +     {
> +#ifdef HAVE_ELEMENTARY_X
> +        if (win->xwin)
> +          {
> +             ecore_evas_transparent_set(win->ee, transparent);
> +             _elm_win_xwin_update(win);
> +          }
> +        else
>  #endif
> -     ecore_evas_transparent_set(win->ee, transparent);
> +           ecore_evas_transparent_set(win->ee, transparent);
> +     }
>  }
>
>  /**
> @@ -1555,6 +1744,7 @@
>    win = elm_widget_data_get(obj);
>    if (!win) return;
>
> +   // YYY: handle if win->img_obj
>  #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
>    if (ENGINE_COMPARE(ELM_SOFTWARE_FB) ||
>        ENGINE_COMPARE(ELM_SOFTWARE_16_WINCE))
> @@ -1617,6 +1807,7 @@
>    ELM_CHECK_WIDTYPE(obj, widtype);
>    win = elm_widget_data_get(obj);
>    if (!win) return;
> +   // YYY: handle if win->img_obj
>    ecore_evas_maximized_set(win->ee, maximized);
>  #ifdef HAVE_ELEMENTARY_X
>    _elm_win_xwin_update(win);
> @@ -2301,6 +2492,30 @@
>  }
>
>  /**
> + * Get the inlined image object handle
> + *
> + * When you create a window with elm_win_add() of type
> ELM_WIN_INLINED_IMAGE,
> + * then the window is in fact an evas image object inlined in the parent
> + * canvas. You can get this object (be careful to not manipulate it as it
> + * is under control of elementary), and use it to do things like get pixel
> + * data, save the image to a file, etc.
> + *
> + * @param obj The window object to get the inlined image from
> + * @return The inlined image object, or NULL if none exists
> + *
> + * @ingroup Win
> + */
> +EAPI Evas_Object *
> +elm_win_inlined_image_object_get(Evas_Object *obj)
> +{
> +   Elm_Win *win;
> +   ELM_CHECK_WIDTYPE(obj, widtype) NULL;
> +   win = elm_widget_data_get(obj);
> +   if (!win) return NULL;
> +   return win->img_obj;
> +}
> +
> +/**
>  * Set the enabled status for the focus highlight in a window
>  *
>  * This function will enable or disable the focus highlight only for the
> @@ -2619,6 +2834,18 @@
>  }
>
>  /* windowing spcific calls - shall we do this differently? */
> +
> +static Ecore_X_Window
> +_elm_ee_win_get(const Evas_Object *obj)
> +{
> +   if (!obj) return 0;
> +#ifdef HAVE_ELEMENTARY_X
> +   Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
> +   if (ee) return (Ecore_X_Window)ecore_evas_window_get(ee);
> +#endif
> +   return 0;
> +}
> +
>  /**
>  * Get the Ecore_X_Window of an Evas_Object
>  *
> @@ -2632,13 +2859,18 @@
>  elm_win_xwindow_get(const Evas_Object *obj)
>  {
>    Ecore_X_Window xwin = 0;
> -   Ecore_Evas *ee = NULL;
> +   Elm_Win *win;
> +   const char *type;
> +
>    if (!obj) return 0;
> +   type = evas_object_type_get(obj);
> +   if (!type) return 0;
> +   if (type != widtype) return _elm_ee_win_get(obj);
>  #ifdef HAVE_ELEMENTARY_X
> -   ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
> -   if (ee) xwin = (Ecore_X_Window)ecore_evas_window_get(ee);
> +   win = elm_widget_data_get(obj);
> +   if (!win) return xwin;
> +   if (win->parent) return elm_win_xwindow_get(win->parent);
> +#endif
>    return xwin;
> -#else
> -   return 0;
> -#endif
> +   win = NULL;
>  }
>
>
>
> ------------------------------------------------------------------------------
> Benefiting from Server Virtualization: Beyond Initial Workload
> Consolidation -- Increasing the use of server virtualization is a top
> priority.Virtualization can reduce costs, simplify management, and improve
> application availability and disaster protection. Learn more about boosting
> the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
> _______________________________________________
> enlightenment-svn mailing list
> enlightenment-...@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-svn
>
------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to