rimmed pushed a commit to branch master.

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

commit 3b777c24d4dfac13335d448724ee780c2dd228f0
Author: Vitalii Vorobiov <vi.vorob...@samsung.com>
Date:   Mon Sep 12 17:25:08 2016 +0300

    resource_manager2: RM_ATTRIBUTE_PROGRAM_FILTER_PART dependencies
---
 src/bin/editor/editor.h                           |  1 +
 src/bin/editor/editor_macro.h                     | 10 ++++++++--
 src/bin/resource_manager/resource_manager_react.c | 18 ++++++++++++++++--
 3 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/src/bin/editor/editor.h b/src/bin/editor/editor.h
index 4d1c164..1667dd5 100644
--- a/src/bin/editor/editor.h
+++ b/src/bin/editor/editor.h
@@ -235,6 +235,7 @@ typedef struct {
    Eina_Stringshare *part_name;
    Eina_Stringshare *item_name;
    Eina_Stringshare *state_name;
+   Eina_Stringshare *program_name;
    double state_value;
    Eina_Stringshare *value;
    Eina_Stringshare *old_value;
diff --git a/src/bin/editor/editor_macro.h b/src/bin/editor/editor_macro.h
index 3311ea8..c6cdfed 100644
--- a/src/bin/editor/editor_macro.h
+++ b/src/bin/editor/editor_macro.h
@@ -802,12 +802,15 @@ editor_program_## FUNC ##_set(Evas_Object *edit_object, 
Change *change, Eina_Boo
 { \
    Diff *diff; \
    Editor_Attribute_Change send; \
-   send.attribute = RM_ATTRIBUTE; \
    assert(edit_object != NULL); \
    assert(program != NULL); \
+   Eina_Stringshare *old_value = edje_edit_program_## FUNC ##_get(edit_object, 
program); \
+   send.attribute = RM_ATTRIBUTE; \
+   send.program_name = eina_stringshare_add(program); \
+   send.old_value = eina_stringshare_add(old_value); \
+   send.value = eina_stringshare_add(new_val); \
    if (change) \
      { \
-        Eina_Stringshare *old_value = edje_edit_program_## FUNC 
##_get(edit_object, program); \
         diff = mem_calloc(1, sizeof(Diff)); \
         diff->redo.type = FUNCTION_TYPE_STRING_STRING; \
         diff->redo.function = editor_program_## FUNC ##_set; \
@@ -829,5 +832,8 @@ editor_program_## FUNC ##_set(Evas_Object *edit_object, 
Change *change, Eina_Boo
        if (!_editor_signals_blocked) evas_object_smart_callback_call(ap.win, 
SIGNAL_EDITOR_RM_ATTRIBUTE_CHANGED, &send); \
        evas_object_smart_callback_call(ap.win, SIGNAL_EDITOR_PROGRAM_UPDATE, 
(void *)program); \
      } \
+   eina_stringshare_del(send.program_name); \
+   eina_stringshare_del(send.old_value); \
+   eina_stringshare_del(send.value); \
    return true; \
 }
diff --git a/src/bin/resource_manager/resource_manager_react.c 
b/src/bin/resource_manager/resource_manager_react.c
index ccb756f..e35e91d 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, *state, *source, *old_source, *item;
+   Resource2 *part, *state, *source, *old_source, *item, *program;
 
    Editor_Attribute_Change *change = (Editor_Attribute_Change *)event_info;
    Attribute editor_resource = (int)change->attribute;
@@ -216,6 +216,21 @@ _property_attribute_changed(void *data,
       case RM_ATTRIBUTE_PART_ITEM_PADDING_TOP:
       case RM_ATTRIBUTE_PART_ITEM_PADDING_BOTTOM:
          break;
+      case RM_ATTRIBUTE_PROGRAM_FILTER_PART:
+         program = resource_manager_find(group->programs, 
change->program_name);
+
+         if (change->old_value)
+           {
+              old_source = resource_manager_find(group->parts, 
change->old_value);
+              _resource_usage_resource_del(program, old_source);
+           }
+
+         if (change->value)
+           {
+              source = resource_manager_find(group->parts, change->value);
+              _resource_usage_resource_add(program, source);
+           }
+         break;
       case RM_ATTRIBUTE_STATE_PROXY_SOURCE:
       case RM_ATTRIBUTE_STATE_TEXT_SOURCE:
       case RM_ATTRIBUTE_STATE_TEXT_TEXT_SOURCE:
@@ -233,7 +248,6 @@ _property_attribute_changed(void *data,
               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);

-- 


Reply via email to