rimmed pushed a commit to branch master.

http://git.enlightenment.org/tools/eflete.git/commit/?id=104a16b55d5e8ea6004cc9b9d54bfe4698bc9004

commit 104a16b55d5e8ea6004cc9b9d54bfe4698bc9004
Author: Vyacheslav Reutskiy <v.reuts...@samsung.com>
Date:   Thu Dec 24 14:14:27 2015 +0200

    groupedit: move the editable object to separate canvas
    
    This changes are made for more precise zoom. Now now all
    parts are drawn on fake window, and for view get the proxy
    to image.
    
    Broken: highlight, need to change the interface between the
    groupedit and highlight.
    
    Change-Id: I47c0ea0fa6644dcbd350966627801b60fa162110
---
 src/bin/ui/workspace/groupedit.c         | 42 ++++++++++++++++++++++----------
 src/bin/ui/workspace/groupedit_calc.c    | 19 +++++++--------
 src/bin/ui/workspace/groupedit_private.h |  2 ++
 3 files changed, 40 insertions(+), 23 deletions(-)

diff --git a/src/bin/ui/workspace/groupedit.c b/src/bin/ui/workspace/groupedit.c
index c43d579..829d3d3 100644
--- a/src/bin/ui/workspace/groupedit.c
+++ b/src/bin/ui/workspace/groupedit.c
@@ -73,11 +73,9 @@ _groupedit_smart_del(Evas_Object *o)
    WS_GROUPEDIT_DATA_GET(o, sd)
 
    _parts_list_free(sd);
-   evas_object_smart_member_del(sd->group->edit_object);
-   evas_object_smart_member_del(sd->clipper);
-   evas_object_hide(sd->group->edit_object);
-
    gm_group_edit_object_unload(sd->group);
+
+   evas_object_del(sd->fake_win);
    _groupedit_parent_sc->del(o);
 }
 
@@ -89,6 +87,8 @@ _groupedit_smart_show(Evas_Object *o)
    WS_GROUPEDIT_DATA_GET(o, sd);
 
    evas_object_show(sd->event);
+   evas_object_show(sd->fake_win);
+   evas_object_show(sd->proxy);
 
    _groupedit_parent_sc->show(o);
 }
@@ -101,6 +101,8 @@ _groupedit_smart_hide(Evas_Object *o)
    WS_GROUPEDIT_DATA_GET(o, sd)
 
    evas_object_hide(sd->event);
+   evas_object_hide(sd->fake_win);
+   evas_object_hide(sd->proxy);
 
    _groupedit_parent_sc->hide(o);
 }
@@ -157,10 +159,14 @@ _groupedit_smart_calculate(Evas_Object *o)
         priv->geom.w = w;
         priv->geom.h = h;
 
-        evas_object_move(priv->group->edit_object,x ,y);
         evas_object_resize(priv->group->edit_object, w, h);
-        evas_object_move(priv->box, x, y);
         evas_object_resize(priv->box, w, h);
+        evas_object_resize(priv->fake_win, w, h);
+
+        /* change the view port geometry */
+        evas_object_move(priv->proxy, x, y);
+        evas_object_resize(priv->proxy, w, h);
+        elm_win_render(priv->fake_win);
      }
    else
      elm_box_recalculate(priv->box);
@@ -168,7 +174,7 @@ _groupedit_smart_calculate(Evas_Object *o)
    priv->manual_calc = false;
 
    DBG("Groupedit geometry: x[%i] y[%i] w[%i] h[%i]", x, y, w, h);
-   evas_object_smart_callback_call(o, SIG_CHANGED, &priv->geom);
+   evas_object_smart_callback_call(o, SIG_GEOMETRY_CHANGED, &priv->geom);
 }
 
 /* this need for macro EVAS_SMART_SUBCLASS_NEW */
@@ -196,6 +202,7 @@ groupedit_add(Evas_Object *parent, Group *group)
 {
    Evas *e;
    Evas_Object *obj;
+   Elm_Theme *theme;
 
    assert(parent != NULL);
    assert(group != NULL);
@@ -205,24 +212,33 @@ groupedit_add(Evas_Object *parent, Group *group)
    WS_GROUPEDIT_DATA_GET(obj, sd);
    sd->parent = parent;
 
-   gm_group_edit_object_load(ap.project, group, evas_object_evas_get(ap.win));
+   sd->fake_win = elm_win_add(ap.win, "inlined", ELM_WIN_INLINED_IMAGE);
+   elm_win_alpha_set(sd->fake_win, true);
+   evas_object_show(sd->fake_win);
+   sd->proxy = elm_win_inlined_image_object_get(sd->fake_win);
+   evas_object_smart_member_add(sd->proxy, obj);
+
+   gm_group_edit_object_load(ap.project, group, 
evas_object_evas_get(sd->fake_win));
+
+   theme = elm_theme_new();
+   elm_theme_copy(ap.theme, theme);
+   elm_object_theme_set(sd->fake_win, theme);
+   elm_theme_free(theme);
+
    edje_object_animation_set(group->edit_object, false);
    TODO("set the state for all parts to default 0.0")
    sd->group = group;
-   evas_object_smart_member_add(sd->group->edit_object, obj);
 
-   sd->box = elm_box_add(parent);
+   sd->box = elm_box_add(sd->fake_win);
    elm_box_layout_set(sd->box, _parts_stack_layout, sd, NULL);
    evas_object_show(sd->box);
-   evas_object_smart_member_add(sd->box, obj);
    _parts_list_new(sd);
 
    /* hide the editing object by using clipper (clipper is small, it's size is 
0,0)
     * with such clipper object invisible and calculate geometry. */
    evas_object_show(sd->group->edit_object);
-   sd->clipper = evas_object_rectangle_add(evas_object_evas_get(sd->obj));
+   sd->clipper = evas_object_rectangle_add(evas_object_evas_get(sd->fake_win));
    evas_object_clip_set(sd->group->edit_object, sd->clipper);
-   evas_object_smart_member_add(sd->clipper, obj);
    evas_object_show(sd->clipper);
 
    return obj;
diff --git a/src/bin/ui/workspace/groupedit_calc.c 
b/src/bin/ui/workspace/groupedit_calc.c
index e5ce18f..e3a5461 100644
--- a/src/bin/ui/workspace/groupedit_calc.c
+++ b/src/bin/ui/workspace/groupedit_calc.c
@@ -227,7 +227,7 @@ _conteiner_cell_sizer_add(Ws_Groupedit_Smart_Data *sd, 
Groupedit_Part *gp, const
    Eina_Stringshare *item_source;
    int min_w, min_h, max_w, max_h, w, h;
 
-   cell_content = edje_object_add(evas_object_evas_get(sd->obj));
+   cell_content = edje_object_add(evas_object_evas_get(sd->fake_win));
    item_source = edje_edit_part_item_source_get(sd->group->edit_object, 
gp->part->name, item_name);
    edje_object_file_set(cell_content, ap.project->dev, item_source);
    eina_stringshare_del(item_source);
@@ -283,7 +283,7 @@ _part_table_items_add(Ws_Groupedit_Smart_Data *sd, 
Groupedit_Part *gp, Eina_List
              span_col = 1;
              span_row = 1;
 
-             cell = elm_layout_add(sd->parent);
+             cell = elm_layout_add(sd->fake_win);
              evas_object_size_hint_align_set(cell, EVAS_HINT_FILL, 
EVAS_HINT_FILL);
 
              elm_layout_theme_set(cell, "layout", "groupview", "default");
@@ -319,7 +319,7 @@ _part_table_add(Ws_Groupedit_Smart_Data *sd, Groupedit_Part 
*gp)
 
    assert(gp->container == NULL);
 
-   gp->container = evas_object_table_add(evas_object_evas_get(sd->obj));
+   gp->container = evas_object_table_add(evas_object_evas_get(sd->fake_win));
    elm_box_pack_before(gp->draw, gp->container, gp->proxy_part);
    evas_object_show(gp->container);
 
@@ -424,7 +424,7 @@ _part_box_add(Ws_Groupedit_Smart_Data *sd, Groupedit_Part 
*gp)
 
    assert(gp->container == NULL);
 
-   gp->container = evas_object_box_add(evas_object_evas_get(sd->obj));
+   gp->container = evas_object_box_add(evas_object_evas_get(sd->fake_win));
    elm_box_pack_before(gp->draw, gp->container, gp->proxy_part);
    evas_object_show(gp->container);
 
@@ -434,7 +434,7 @@ _part_box_add(Ws_Groupedit_Smart_Data *sd, Groupedit_Part 
*gp)
         spread_h = edje_edit_part_item_spread_h_get(sd->group->edit_object, 
gp->part->name, str);
         for (i = 0; i < (spread_w * spread_h); i++)
           {
-             cell = elm_layout_add(sd->parent);
+             cell = elm_layout_add(sd->fake_win);
              evas_object_size_hint_align_set(cell, EVAS_HINT_FILL, 
EVAS_HINT_FILL);
              elm_layout_theme_set(cell, "layout", "groupview", "default");
              evas_object_show(cell);
@@ -597,7 +597,6 @@ _part_update(Ws_Groupedit_Smart_Data *sd, Groupedit_Part 
*gp)
       default:
          break;
      }
-   //evas_object_smart_callback_call(sd->obj, SIG_GEOMETRY_CHANGED, (void 
*)sd->real_size);
 
    return true;
 }
@@ -613,12 +612,12 @@ _part_draw_add(Ws_Groupedit_Smart_Data *sd, Part_ *part)
    gp = mem_calloc(1, sizeof(Groupedit_Part));
    gp->part = part;
 
-   gp->draw = elm_box_add(sd->parent);
+   gp->draw = elm_box_add(sd->fake_win);
    elm_box_layout_set(gp->draw, evas_object_box_layout_stack, NULL, NULL);
    evas_object_show(gp->draw);
    elm_box_pack_end(sd->box, gp->draw);
 
-   gp->layout = elm_layout_add(sd->parent);
+   gp->layout = elm_layout_add(sd->fake_win);
    evas_object_size_hint_weight_set(gp->layout, EVAS_HINT_EXPAND, 
EVAS_HINT_EXPAND);
    evas_object_size_hint_align_set(gp->layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
    elm_layout_theme_set(gp->layout, "layout", "groupview", "default");
@@ -628,7 +627,7 @@ _part_draw_add(Ws_Groupedit_Smart_Data *sd, Part_ *part)
    gp->part->visible = true;
 
 #define PART_VIEW_PROXY_SET() \
-   gp->proxy_part = 
evas_object_image_filled_add(evas_object_evas_get(sd->obj)); \
+   gp->proxy_part = 
evas_object_image_filled_add(evas_object_evas_get(sd->fake_win)); \
    evas_object_size_hint_weight_set(gp->proxy_part, EVAS_HINT_EXPAND, 
EVAS_HINT_EXPAND); \
    evas_object_size_hint_align_set(gp->proxy_part, EVAS_HINT_FILL, 
EVAS_HINT_FILL); \
    elm_box_pack_end(gp->draw, gp->proxy_part); \
@@ -679,7 +678,7 @@ _part_draw_add(Ws_Groupedit_Smart_Data *sd, Part_ *part)
           * Here created transparent rectangle as draw evas primitives.
           */
          TODO("add support for all part types.")
-         gp->draw = evas_object_rectangle_add(evas_object_evas_get(sd->obj));
+         gp->draw = 
evas_object_rectangle_add(evas_object_evas_get(sd->fake_win));
          evas_object_color_set(gp->draw, 0, 0, 0, 0);
          break;
      }
diff --git a/src/bin/ui/workspace/groupedit_private.h 
b/src/bin/ui/workspace/groupedit_private.h
index cf13333..327290e 100644
--- a/src/bin/ui/workspace/groupedit_private.h
+++ b/src/bin/ui/workspace/groupedit_private.h
@@ -57,6 +57,8 @@ struct _Ws_Groupedit_Smart_Data
    Evas_Object_Smart_Clipped_Data base;
    Group *group;
    Evas_Object *obj;
+   Evas_Object *fake_win;
+   Evas_Object *proxy;
    Evas_Object *event;
    Evas_Object *parent;
    Evas_Object *box;

-- 


Reply via email to