rimmed pushed a commit to branch master.

http://git.enlightenment.org/tools/eflete.git/commit/?id=4fa0e6eb5d976a7b8ce358736ee4678b9f4309b0

commit 4fa0e6eb5d976a7b8ce358736ee4678b9f4309b0
Author: Vyacheslav Reutskiy <v.reuts...@samsung.com>
Date:   Tue Nov 24 16:27:35 2015 +0200

    groupedit: do hard calculation only if it necessary
    
    Define a new flag to Groupedit smart data - manual_calc. This flag
    is active only ini case of part attribute change. So, groupedit on
    resize event reapplied only necessary for display object params,
    and do hard job when attribute changed.
    
    Change-Id: I5b27d13fa61b706d6e8f07d8f7611d3286a1d858
---
 src/bin/ui/workspace/groupedit.c         |  4 +++
 src/bin/ui/workspace/groupedit_calc.c    | 48 +++++++++++++++++++++-----------
 src/bin/ui/workspace/groupedit_private.h |  1 +
 3 files changed, 37 insertions(+), 16 deletions(-)

diff --git a/src/bin/ui/workspace/groupedit.c b/src/bin/ui/workspace/groupedit.c
index 3d2e134..d11c7c5 100644
--- a/src/bin/ui/workspace/groupedit.c
+++ b/src/bin/ui/workspace/groupedit.c
@@ -231,6 +231,7 @@ _groupedit_smart_calculate(Evas_Object *o)
                       priv->con_current_size->w,
                       priv->con_current_size->h);
 
+   priv->manual_calc = false;
    _parts_recalc(priv);
 
    evas_object_smart_callback_call(o, SIG_CHANGED, (void 
*)priv->con_current_size);
@@ -296,6 +297,7 @@ groupedit_edit_object_recalc_all(Evas_Object *obj)
 {
    WS_GROUPEDIT_DATA_GET(obj, sd);
 
+   sd->manual_calc = true;
    return _parts_recalc(sd);
 }
 
@@ -603,6 +605,7 @@ groupedit_part_visible_set(Evas_Object *obj, const char 
*part, Eina_Bool visible
 
    assert(gp != NULL);
 
+   sd->manual_calc = true;
    _parts_recalc(sd);
    return true;
 }
@@ -710,6 +713,7 @@ groupedit_edit_object_part_item_selected_set(Evas_Object 
*obj,
                   edje_object_file_set(ge_item->highlight, EFLETE_THEME, 
"elm/image/border/1px");
                   evas_object_color_set(ge_item->highlight, 49, 140, 141, 255);
                }
+             sd->manual_calc = true;
              _parts_recalc(sd);
              return true;
           }
diff --git a/src/bin/ui/workspace/groupedit_calc.c 
b/src/bin/ui/workspace/groupedit_calc.c
index daf2adb..c72ee6a 100644
--- a/src/bin/ui/workspace/groupedit_calc.c
+++ b/src/bin/ui/workspace/groupedit_calc.c
@@ -703,6 +703,7 @@ _part_box_add(Ws_Groupedit_Smart_Data *sd, Groupedit_Part 
*gp)
 
    assert(gp->container == NULL);
 
+   fprintf(stdout, "%s\n", gp->part->name);
    gp->container = evas_object_box_add(sd->e);
    elm_box_pack_end(gp->draw, gp->container);
    evas_object_show(gp->container);
@@ -773,6 +774,16 @@ _box_param_update(Ws_Groupedit_Smart_Data *sd, 
Groupedit_Part *gp)
    PART_STATE_FREE
 }
 
+static void
+_part_container_del(Groupedit_Part *gp)
+{
+   assert(gp->container != NULL);
+
+   elm_box_unpack(gp->draw, gp->container);
+   evas_object_del(gp->container);
+   gp->container = NULL;
+}
+
 #define GP_REAL_GEOMETRY_CALC(PART_X, PART_Y, ABS_X, ABS_Y) \
    w *= sd->zoom_factor; h *= sd->zoom_factor; \
    PART_X = x * sd->zoom_factor + xe + offset_x; \
@@ -983,38 +994,43 @@ _parts_recalc(Ws_Groupedit_Smart_Data *sd)
                 edje_object_part_text_set(sd->group->edit_object, 
gp->part->name, gp->part->name);
               eina_stringshare_del(str);
               _common_param_update(gp, sd->group->edit_object);
-              _part_recalc_apply(sd, gp, offset_x, offset_y);
               break;
            case EDJE_PART_TYPE_RECTANGLE:
            case EDJE_PART_TYPE_GROUP:
               _common_param_update(gp, sd->group->edit_object);
-              _part_recalc_apply(sd, gp, offset_x, offset_y);
               break;
            case EDJE_PART_TYPE_IMAGE:
-              _image_param_update(gp, sd->group->edit_object);
-              _part_recalc_apply(sd, gp, offset_x, offset_y);
+              if (sd->manual_calc) _image_param_update(gp, 
sd->group->edit_object);
               break;
            case EDJE_PART_TYPE_PROXY: // it part like image
-              _proxy_param_update(gp, sd->group->edit_object);
-              _part_recalc_apply(sd, gp, offset_x, offset_y);
+              if (sd->manual_calc) _proxy_param_update(gp, 
sd->group->edit_object);
               break;
            case EDJE_PART_TYPE_TABLE:
+              if (sd->manual_calc)
+                {
+                   _part_container_del(gp);
+                   _part_table_add(sd, gp);
+                   _part_table_items_add(sd, gp);
+                }
               _table_param_update(sd, gp);
               _common_param_update(gp, sd->group->edit_object);
-              _part_recalc_apply(sd, gp, offset_x, offset_y);
               break;
            case EDJE_PART_TYPE_BOX:
+              if (sd->manual_calc)
+                {
+                   _part_container_del(gp);
+                   _part_box_add(sd, gp);
+                }
               _box_param_update(sd, gp);
               _common_param_update(gp, sd->group->edit_object);
-              _part_recalc_apply(sd, gp, offset_x, offset_y);
               break;
            case EDJE_PART_TYPE_SPACER:
            case EDJE_PART_TYPE_SWALLOW:
            case EDJE_PART_TYPE_EXTERNAL:
-              _part_recalc_apply(sd, gp, offset_x, offset_y);
            default:
               break;
           }
+        _part_recalc_apply(sd, gp, offset_x, offset_y);
         if (gp->part->visible)
           {
              evas_object_show(gp->bg);
@@ -1026,13 +1042,13 @@ _parts_recalc(Ws_Groupedit_Smart_Data *sd)
              evas_object_hide(gp->draw);
           }
      }
-     if (!sd->separated) _part_object_area_calc(sd);
-     else
-       {
-          if (sd->to_select) _select_item_move_to_top(sd);
-          evas_object_hide(sd->obj_area.obj);
-          evas_object_smart_callback_call(sd->obj, SIG_OBJ_AREA_CHANGED, 
sd->obj_area.geom);
-       }
+   if (!sd->separated) _part_object_area_calc(sd);
+   else
+     {
+        if (sd->to_select) _select_item_move_to_top(sd);
+        evas_object_hide(sd->obj_area.obj);
+        evas_object_smart_callback_call(sd->obj, SIG_OBJ_AREA_CHANGED, 
sd->obj_area.geom);
+     }
 
    evas_object_smart_callback_call(sd->obj, SIG_GEOMETRY_CHANGED, (void 
*)sd->real_size);
 
diff --git a/src/bin/ui/workspace/groupedit_private.h 
b/src/bin/ui/workspace/groupedit_private.h
index a194329..c92b7ad 100644
--- a/src/bin/ui/workspace/groupedit_private.h
+++ b/src/bin/ui/workspace/groupedit_private.h
@@ -108,6 +108,7 @@ struct _Ws_Groupedit_Smart_Data
    double zoom_factor; /**< current zoom factor. */
    Evas_Coord downx;
    Evas_Coord downy;
+   Eina_Bool manual_calc : 1;
 };
 
 #define WS_GROUPEDIT_DATA_GET(o, ptr)  \

-- 


Reply via email to