rimmed pushed a commit to branch master.

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

commit efd0b2ff611c65bcbed21c99b3477eb6fa041c13
Author: Vyacheslav Reutskiy <v.reuts...@samsung.com>
Date:   Thu Dec 24 16:23:25 2015 +0200

    workspace: separate workspace recalc func to two functions
    
    This functions provide soft and hard workspace update. After some
    part attribute change no need full workspace recalc
    
    Change-Id: I8241a5dd4cc7ad597033aace0b691259059a8a3d
---
 src/bin/ui/tabs.c                | 144 +++++++++++++++++++++++++++++++++++++--
 src/bin/ui/workspace/workspace.c |  17 +----
 src/bin/ui/workspace/workspace.h |  10 ++-
 3 files changed, 143 insertions(+), 28 deletions(-)

diff --git a/src/bin/ui/tabs.c b/src/bin/ui/tabs.c
index 34348d3..34b0bd9 100644
--- a/src/bin/ui/tabs.c
+++ b/src/bin/ui/tabs.c
@@ -22,6 +22,7 @@
 #include "tabs.h"
 #include "new_history.h"
 #include "signals.h"
+#include "editor.h"
 
 #include "style_editor.h"
 #include "image_editor.h"
@@ -112,7 +113,7 @@ _content_set(void *data,
           ui_menu_items_list_disable_set(ap.menu, MENU_ITEMS_LIST_STYLE_ONLY, 
false);
         if (item->need_recalc)
           {
-             workspace_edit_object_recalc(tabs.current_workspace);
+             workspace_groupview_hard_update(tabs.current_workspace);
              item->need_recalc = false;
           }
      }
@@ -194,10 +195,141 @@ _home_tab_change(void *data,
 static void
 _property_attribute_changed(void *data __UNUSED__,
                             Evas_Object *obj __UNUSED__,
-                            void *ei __UNUSED__)
+                            void *event_info)
 {
+   Attribute *attr = event_info;
+
    assert(tabs.current_workspace != NULL);
-   workspace_edit_object_recalc(tabs.current_workspace);
+
+   switch ((int)*attr)
+     {
+      case ATTRIBUTE_GROUP_MIN_W:
+      case ATTRIBUTE_GROUP_MIN_H:
+      case ATTRIBUTE_GROUP_MAX_W:
+      case ATTRIBUTE_GROUP_MAX_H:
+      case ATTRIBUTE_STATE_MIN_W:
+      case ATTRIBUTE_STATE_MIN_H:
+      case ATTRIBUTE_STATE_MAX_W:
+      case ATTRIBUTE_STATE_MAX_H:
+      case ATTRIBUTE_STATE_ALIGN_X:
+      case ATTRIBUTE_STATE_ALIGN_Y:
+      case ATTRIBUTE_STATE_REL1_RELATIVE_X:
+      case ATTRIBUTE_STATE_REL1_RELATIVE_Y:
+      case ATTRIBUTE_STATE_REL2_RELATIVE_X:
+      case ATTRIBUTE_STATE_REL2_RELATIVE_Y:
+      case ATTRIBUTE_STATE_REL1_OFFSET_X:
+      case ATTRIBUTE_STATE_REL1_OFFSET_Y:
+      case ATTRIBUTE_STATE_REL2_OFFSET_X:
+      case ATTRIBUTE_STATE_REL2_OFFSET_Y:
+      case ATTRIBUTE_STATE_ASPECT_MIN:
+      case ATTRIBUTE_STATE_ASPECT_MAX:
+      case ATTRIBUTE_STATE_FILL_ORIGIN_RELATIVE_X:
+      case ATTRIBUTE_STATE_FILL_ORIGIN_RELATIVE_Y:
+      case ATTRIBUTE_STATE_FILL_ORIGIN_OFFSET_X:
+      case ATTRIBUTE_STATE_FILL_ORIGIN_OFFSET_Y:
+      case ATTRIBUTE_STATE_FILL_SIZE_RELATIVE_X:
+      case ATTRIBUTE_STATE_FILL_SIZE_RELATIVE_Y:
+      case ATTRIBUTE_STATE_FILL_SIZE_OFFSET_X:
+      case ATTRIBUTE_STATE_FILL_SIZE_OFFSET_Y:
+      case ATTRIBUTE_STATE_TEXT_ALIGN_X:
+      case ATTRIBUTE_STATE_TEXT_ALIGN_Y:
+      case ATTRIBUTE_STATE_TEXT_ELIPSIS:
+      case ATTRIBUTE_STATE_TEXT_SIZE:
+      case ATTRIBUTE_STATE_TEXT_FIT_X:
+      case ATTRIBUTE_STATE_TEXT_FIT_Y:
+      case ATTRIBUTE_STATE_TEXT_MAX_X:
+      case ATTRIBUTE_STATE_TEXT_MAX_Y:
+      case ATTRIBUTE_STATE_TEXT_MIN_X:
+      case ATTRIBUTE_STATE_TEXT_MIN_Y:
+      case ATTRIBUTE_STATE_FIXED_H:
+      case ATTRIBUTE_STATE_FIXED_W:
+      case ATTRIBUTE_STATE_IMAGE:
+      case ATTRIBUTE_STATE_IMAGE_TWEEN:
+      case ATTRIBUTE_STATE_REL1_TO_X:
+      case ATTRIBUTE_STATE_REL1_TO_Y:
+      case ATTRIBUTE_STATE_REL2_TO_X:
+      case ATTRIBUTE_STATE_REL2_TO_Y:
+      case ATTRIBUTE_STATE_TEXT_SOURCE:
+      case ATTRIBUTE_STATE_TEXT_TEXT_SOURCE:
+      case ATTRIBUTE_STATE_TEXT:
+      case ATTRIBUTE_STATE_FONT:
+      case ATTRIBUTE_STATE_TEXT_STYLE:
+      case ATTRIBUTE_STATE_ASPECT_PREF:
+      case ATTRIBUTE_PART_EFFECT:
+      case ATTRIBUTE_PART_CLIP_TO:
+      case ATTRIBUTE_PART_DRAG_CONFINE:
+      case ATTRIBUTE_PART_SOURCE:
+      case ATTRIBUTE_PART_SOURCE2:
+      case ATTRIBUTE_PART_SOURCE3:
+      case ATTRIBUTE_PART_SOURCE4:
+      case ATTRIBUTE_PART_SOURCE5:
+      case ATTRIBUTE_PART_SOURCE6:
+      case ATTRIBUTE_PART_ITEM_ASPECT_MODE:
+      case ATTRIBUTE_PART_ITEM_ALIGN_X:
+      case ATTRIBUTE_PART_ITEM_ALIGN_Y:
+      case ATTRIBUTE_PART_ITEM_WEIGHT_X:
+      case ATTRIBUTE_PART_ITEM_WEIGHT_Y:
+      case ATTRIBUTE_PART_ITEM_ASPECT_H:
+      case ATTRIBUTE_PART_ITEM_ASPECT_W:
+      case ATTRIBUTE_PART_ITEM_MAX_H:
+      case ATTRIBUTE_PART_ITEM_MAX_W:
+      case ATTRIBUTE_PART_ITEM_MIN_H:
+      case ATTRIBUTE_PART_ITEM_MIN_W:
+      case ATTRIBUTE_PART_ITEM_PREFER_H:
+      case ATTRIBUTE_PART_ITEM_PREFER_W:
+      case ATTRIBUTE_PART_ITEM_SPREAD_H:
+      case ATTRIBUTE_PART_ITEM_SPREAD_W:
+      case ATTRIBUTE_PART_ITEM_SPAN_COL:
+      case ATTRIBUTE_PART_ITEM_SPAN_ROW:
+      case ATTRIBUTE_PART_ITEM_POSITION_COL:
+      case ATTRIBUTE_PART_ITEM_POSITION_ROW:
+      case ATTRIBUTE_PART_ITEM_SOURCE:
+      case ATTRIBUTE_PART_ITEM_PADDING:
+      case ATTRIBUTE_STATE_CONTAINER_ALIGN_X:
+      case ATTRIBUTE_STATE_CONTAINER_ALIGN_Y:
+      case ATTRIBUTE_STATE_CONTAINER_MIN_H:
+      case ATTRIBUTE_STATE_CONTAINER_MIN_V:
+      case ATTRIBUTE_STATE_TABLE_HOMOGENEOUS:
+      case ATTRIBUTE_STATE_CONTAINER_PADING_X:
+      case ATTRIBUTE_STATE_CONTAINER_PADING_Y:
+      case ATTRIBUTE_STATE_MINMUL_H:
+      case ATTRIBUTE_STATE_MINMUL_W:
+      case ATTRIBUTE_PART_MULTILINE:
+      case ATTRIBUTE_PART_ENTRY_MODE:
+      case ATTRIBUTE_STATE_FILL_TYPE:
+         workspace_groupview_hard_update(tabs.current_workspace);
+         break;
+      case ATTRIBUTE_STATE_FILL_SMOOTH:
+      case ATTRIBUTE_STATE_VISIBLE:
+      case ATTRIBUTE_STATE_COLOR_CLASS:
+      case ATTRIBUTE_STATE_COLOR:
+      case ATTRIBUTE_STATE_COLOR2:
+      case ATTRIBUTE_STATE_COLOR3:
+      case ATTRIBUTE_STATE_IMAGE_BORDER:
+      case ATTRIBUTE_STATE_IMAGE_BORDER_FILL:
+         workspace_groupview_soft_update(tabs.current_workspace);
+         break;
+      case ATTRIBUTE_PART_IGNORE_FLAGS:
+      case ATTRIBUTE_PART_MOUSE_EVENTS:
+      case ATTRIBUTE_PART_REPEAT_EVENTS:
+      case ATTRIBUTE_PART_SCALE:
+      case ATTRIBUTE_PART_DRAG_COUNT_X:
+      case ATTRIBUTE_PART_DRAG_COUNT_Y:
+      case ATTRIBUTE_PART_DRAG_X:
+      case ATTRIBUTE_PART_DRAG_Y:
+      case ATTRIBUTE_PART_DRAG_STEP_X:
+      case ATTRIBUTE_PART_DRAG_STEP_Y:
+      case ATTRIBUTE_PART_DRAG_THRESHOLD:
+      case ATTRIBUTE_PART_DRAG_EVENT:
+      case ATTRIBUTE_PART_NAME:
+      case ATTRIBUTE_GROUP_NAME:
+      case ATTRIBUTE_STATE_PROXY_SOURCE:
+      case ATTRIBUTE_PART_SELECT_MODE:
+      case ATTRIBUTE_PART_POINTER_MODE:
+      case ATTRIBUTE_PART_CURSOR_MODE:
+      default:
+         break;
+     }
 }
 
 static void
@@ -250,9 +382,7 @@ _editor_saved(void *data __UNUSED__,
      {
         edje_object_mmap_set(item->group->edit_object, ap.project->mmap_file, 
item->group->name);
         if (item->content == tabs.current_workspace)
-          {
-             workspace_edit_object_recalc(tabs.current_workspace);
-          }
+          workspace_groupview_hard_update(tabs.current_workspace);
         else
           item->need_recalc = true;
      }
@@ -495,7 +625,6 @@ tabs_add(void)
    elm_object_item_disabled_set(tabs.menu.item_text, true);
    elm_object_item_disabled_set(tabs.menu.item_colorclass, true);
 
-   evas_object_smart_callback_add(ap.win, SIGNAL_PROPERTY_ATTRIBUTE_CHANGED, 
_property_attribute_changed, NULL);
    evas_object_smart_callback_add(ap.win, SIGNAL_PART_RENAMED, _part_renamed, 
NULL);
    evas_object_smart_callback_add(ap.win, SIGNAL_PART_UNSELECTED, 
_part_unselected, NULL);
    evas_object_smart_callback_add(ap.win, SIGNAL_PROJECT_CHANGED, 
_project_changed, NULL);
@@ -503,6 +632,7 @@ tabs_add(void)
    evas_object_smart_callback_add(ap.win, SIGNAL_PROJECT_OPENED, 
_project_opened, NULL);
    evas_object_smart_callback_add(ap.win, SIGNAL_PROJECT_CLOSED, 
_project_closed, NULL);
 
+   evas_object_smart_callback_add(ap.win, SIGNAL_EDITOR_ATTRIBUTE_CHANGED, 
_property_attribute_changed, NULL);
    evas_object_smart_callback_add(ap.win, SIGNAL_EDITOR_PART_ADDED, 
_editor_part_added_cb, NULL);
    evas_object_smart_callback_add(ap.win, SIGNAL_EDITOR_PART_DELETED, 
_editor_part_deleted_cb, NULL);
    evas_object_smart_callback_add(ap.win, SIGNAL_EDITOR_PART_ITEM_ADDED, 
_editor_part_item_added_cb, NULL);
diff --git a/src/bin/ui/workspace/workspace.c b/src/bin/ui/workspace/workspace.c
index 3d4a676..b0e80c1 100644
--- a/src/bin/ui/workspace/workspace.c
+++ b/src/bin/ui/workspace/workspace.c
@@ -660,9 +660,6 @@ workspace_zoom_factor_set(Evas_Object *obj, double factor)
         elm_object_disabled_set(sd->button_separate, false);
      }
 
-   workspace_edit_object_recalc(obj);
-   evas_object_smart_changed(sd->groupedit);
-
    return true;
 }
 
@@ -1646,16 +1643,6 @@ workspace_group_navigator_update_part(Evas_Object *obj, 
Part_ *part)
 }
 #define PADDING_SIZE 40
 
-void
-workspace_groupview_soft_update(Evas_Object *obj)
-{
-   WS_DATA_GET(obj, sd);
-
-   assert(sd->groupedit != NULL);
-
-   groupedit_soft_update(sd->groupedit);
-}
-
 Eina_Bool
 workspace_edit_object_recalc(Evas_Object *obj)
 {
@@ -1682,7 +1669,7 @@ workspace_edit_object_recalc(Evas_Object *obj)
 }
 
 void
-workspace_edit_object_hard_update(Evas_Object *obj)
+workspace_groupview_hard_update(Evas_Object *obj)
 {
    WS_DATA_GET(obj, sd);
    assert(sd->groupedit != NULL);
@@ -1699,7 +1686,7 @@ workspace_edit_object_hard_update(Evas_Object *obj)
 }
 
 void
-workspace_edit_object_soft_update(Evas_Object *obj)
+workspace_groupview_soft_update(Evas_Object *obj)
 {
    WS_DATA_GET(obj, sd);
    assert(sd->groupedit != NULL);
diff --git a/src/bin/ui/workspace/workspace.h b/src/bin/ui/workspace/workspace.h
index 100d59a..e436a04 100644
--- a/src/bin/ui/workspace/workspace.h
+++ b/src/bin/ui/workspace/workspace.h
@@ -62,16 +62,14 @@ void
 workspace_group_navigator_update_part(Evas_Object *obj, Part_ *part);
 
 /**
- * Force recal for editable object from the workspace.
+ * Update the parts attributes, with recalculation.
  *
- * @param obj The workspace object.
- *
- * @return EINA_FALSE on failure, EINA_TRUE on success.
+ * @paramaram obj The workspace object.
  *
  * @ingroup Workspace
  */
-Eina_Bool
-workspace_edit_object_recalc(Evas_Object *obj);
+void
+workspace_groupview_hard_update(Evas_Object *obj);
 
 /**
  * Update the parts attributes, without recalculation.

-- 


Reply via email to