rimmed pushed a commit to branch master.

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

commit 87f59b939ce679bb01b5193b02f50fb7282386fc
Author: Vitalii Vorobiov <vi.vorob...@samsung.com>
Date:   Mon Sep 12 17:12:53 2016 +0300

    resource_manager2: add forgotten dependency relation with TEXT_SOURCE
---
 src/bin/editor/editor.h                           |  2 ++
 src/bin/editor/editor_macro.h                     | 13 ++++++++++--
 src/bin/resource_manager/resource_manager_build.c |  9 ++++++++
 src/bin/resource_manager/resource_manager_free.c  | 26 ++++++++++++++++-------
 src/bin/resource_manager/resource_manager_react.c | 25 ++++++++++++++++++----
 5 files changed, 61 insertions(+), 14 deletions(-)

diff --git a/src/bin/editor/editor.h b/src/bin/editor/editor.h
index 34f7cbc..4d1c164 100644
--- a/src/bin/editor/editor.h
+++ b/src/bin/editor/editor.h
@@ -234,6 +234,8 @@ typedef struct {
    Eina_Stringshare *group_name;
    Eina_Stringshare *part_name;
    Eina_Stringshare *item_name;
+   Eina_Stringshare *state_name;
+   double state_value;
    Eina_Stringshare *value;
    Eina_Stringshare *old_value;
 } Editor_Attribute_Change;
diff --git a/src/bin/editor/editor_macro.h b/src/bin/editor/editor_macro.h
index cd1e6a0..3311ea8 100644
--- a/src/bin/editor/editor_macro.h
+++ b/src/bin/editor/editor_macro.h
@@ -108,13 +108,18 @@ editor_state_## FUNC ##_set(Evas_Object *edit_object, 
Change *change, Eina_Bool
 { \
    Diff *diff; \
    Editor_Attribute_Change send; \
-   send.attribute = RM_ATTRIBUTE; \
    assert(edit_object != NULL); \
    assert(part_name != NULL); \
    assert(state_name != NULL); \
+   Eina_Stringshare *old_value = edje_edit_state_## FUNC ##_get(edit_object, 
part_name, state_name, state_val); \
+   send.attribute = RM_ATTRIBUTE; \
+   send.part_name = eina_stringshare_add(part_name); \
+   send.state_name = eina_stringshare_add(state_name); \
+   send.state_value = state_val; \
+   send.old_value = eina_stringshare_add(old_value); \
+   send.value = eina_stringshare_add(new_val); \
    if (change) \
      { \
-        Eina_Stringshare *old_value = edje_edit_state_## FUNC 
##_get(edit_object, part_name, state_name, state_val); \
         diff = mem_calloc(1, sizeof(Diff)); \
         diff->redo.type = FUNCTION_TYPE_STRING_STRING_DOUBLE_STRING; \
         diff->redo.function = editor_state_## FUNC ##_set; \
@@ -140,6 +145,10 @@ editor_state_## FUNC ##_set(Evas_Object *edit_object, 
Change *change, Eina_Bool
        _editor_project_changed(); \
        if (!_editor_signals_blocked) evas_object_smart_callback_call(ap.win, 
SIGNAL_EDITOR_RM_ATTRIBUTE_CHANGED, &send); \
      } \
+   eina_stringshare_del(send.part_name); \
+   eina_stringshare_del(send.state_name); \
+   eina_stringshare_del(send.old_value); \
+   eina_stringshare_del(send.value); \
    return true; \
 }
 
diff --git a/src/bin/resource_manager/resource_manager_build.c 
b/src/bin/resource_manager/resource_manager_build.c
index 5150956..0038c1a 100644
--- a/src/bin/resource_manager/resource_manager_build.c
+++ b/src/bin/resource_manager/resource_manager_build.c
@@ -157,6 +157,15 @@ _state_dependency_load(Project *pro, Group2 *group, Part2 
*part, State2 *state)
         if (res)
           _resource_usage_resource_add((Resource2 *)state, res);
         edje_edit_string_free(source);
+
+        source = edje_edit_state_text_source_get(group->edit_object,
+                                                 part->common.name,
+                                                 state->common.name,
+                                                 state->val);
+        res = resource_manager_find(group->parts, source);
+        if (res)
+          _resource_usage_resource_add((Resource2 *)state, res);
+        edje_edit_string_free(source);
      }
 
    if (part->type == EDJE_PART_TYPE_TEXTBLOCK)
diff --git a/src/bin/resource_manager/resource_manager_free.c 
b/src/bin/resource_manager/resource_manager_free.c
index 9ac6917..a1ae67b 100644
--- a/src/bin/resource_manager/resource_manager_free.c
+++ b/src/bin/resource_manager/resource_manager_free.c
@@ -383,14 +383,24 @@ _resource_part_del(Group2 *group, Part2 *part, Change 
*change)
                                                           state->val,
                                                           NULL));
              else if (state->part->type == EDJE_PART_TYPE_TEXT)
-               
CRIT_ON_FAIL(editor_state_text_text_source_set(state->part->group->edit_object,
-                                                              change,
-                                                              false,
-                                                              true,
-                                                              
part->common.name,
-                                                              
state->common.name,
-                                                              state->val,
-                                                              NULL));
+               {
+                  
CRIT_ON_FAIL(editor_state_text_text_source_set(state->part->group->edit_object,
+                                                                 change,
+                                                                 false,
+                                                                 true,
+                                                                 
part->common.name,
+                                                                 
state->common.name,
+                                                                 state->val,
+                                                                 NULL));
+                  
CRIT_ON_FAIL(editor_state_text_source_set(state->part->group->edit_object,
+                                                            change,
+                                                            false,
+                                                            true,
+                                                            part->common.name,
+                                                            state->common.name,
+                                                            state->val,
+                                                            NULL));
+               }
           }
         else if (res->common.type == RESOURCE2_TYPE_PROGRAM)
           {
diff --git a/src/bin/resource_manager/resource_manager_react.c 
b/src/bin/resource_manager/resource_manager_react.c
index 9eced00..ccb756f 100644
--- a/src/bin/resource_manager/resource_manager_react.c
+++ b/src/bin/resource_manager/resource_manager_react.c
@@ -89,7 +89,7 @@ _property_attribute_changed(void *data,
     ** > expand editor (top blocks like image, sound, etc) not supported **
     ***********************************************************************
     ***********************************************************************/
-   Resource2 *part, *source, *old_source, *item;
+   Resource2 *part, *state, *source, *old_source, *item;
 
    Editor_Attribute_Change *change = (Editor_Attribute_Change *)event_info;
    Attribute editor_resource = (int)change->attribute;
@@ -144,8 +144,6 @@ _property_attribute_changed(void *data,
       case RM_ATTRIBUTE_STATE_REL1_TO_Y:
       case RM_ATTRIBUTE_STATE_REL2_TO_X:
       case RM_ATTRIBUTE_STATE_REL2_TO_Y:
-      case RM_ATTRIBUTE_STATE_TEXT_SOURCE:
-      case RM_ATTRIBUTE_STATE_TEXT_TEXT_SOURCE:
       case RM_ATTRIBUTE_STATE_TEXT:
       case RM_ATTRIBUTE_STATE_FONT:
       case RM_ATTRIBUTE_STATE_TEXT_STYLE:
@@ -218,6 +216,25 @@ _property_attribute_changed(void *data,
       case RM_ATTRIBUTE_PART_ITEM_PADDING_TOP:
       case RM_ATTRIBUTE_PART_ITEM_PADDING_BOTTOM:
          break;
+      case RM_ATTRIBUTE_STATE_PROXY_SOURCE:
+      case RM_ATTRIBUTE_STATE_TEXT_SOURCE:
+      case RM_ATTRIBUTE_STATE_TEXT_TEXT_SOURCE:
+         part = resource_manager_find(group->parts, change->part_name);
+         state = resource_manager_v_find(((Part *)part)->states, 
change->state_name, change->state_value);
+
+         if (change->old_value)
+           {
+              old_source = resource_manager_find(group->parts, 
change->old_value);
+              _resource_usage_resource_del(state, old_source);
+           }
+
+         if (change->value)
+           {
+              source = resource_manager_find(group->parts, change->value);
+              _resource_usage_resource_add(state, source);
+           }
+
+         break;
       case RM_ATTRIBUTE_PART_ITEM_SOURCE:
          part = resource_manager_find(group->parts, change->part_name);
          item = resource_manager_find(((Part *)part)->items, 
change->item_name);
@@ -230,7 +247,7 @@ _property_attribute_changed(void *data,
            }
 
          /* if new value is not null and not internal group */
-         if (change->value && strcmp(change->old_value, 
EFLETE_INTERNAL_GROUP_NAME))
+         if (change->value && strcmp(change->value, 
EFLETE_INTERNAL_GROUP_NAME))
            {
               source = resource_manager_find(pro->RM.groups, change->value);
               _resource_usage_resource_add(item, source);

-- 


Reply via email to