summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJee-Yong Um <jc9.um@samsung.com>2016-04-15 11:14:31 -0700
committerCedric Bail <cedric@osg.samsung.com>2016-04-15 11:20:07 -0700
commit974daa5f9813b1e2a43a45215859906b74ab4225 (patch)
tree4791415ea5b19e8be9fc4e43f2cfd6976419fbbe
parentfdaedf2bffa44024b5581265558b284a2186ff31 (diff)
edje_cc: delete anonymous lookup during program removal
Summary: program_remove attribute allows to remove program inherited from parent group, but if its action is EDJE_ACTION_TYPE_SCRIPT, anonymous lookup also should be deleted. @fix Reviewers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D3875 Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
-rw-r--r--src/bin/edje/edje_cc.h1
-rw-r--r--src/bin/edje/edje_cc_handlers.c11
-rw-r--r--src/bin/edje/edje_cc_out.c14
3 files changed, 26 insertions, 0 deletions
diff --git a/src/bin/edje/edje_cc.h b/src/bin/edje/edje_cc.h
index 65299b580e..1ee0362ba2 100644
--- a/src/bin/edje/edje_cc.h
+++ b/src/bin/edje/edje_cc.h
@@ -181,6 +181,7 @@ void *data_queue_program_lookup(Edje_Part_Collection *pc, const char *name, in
181void program_lookup_rename(void *p, const char *name); 181void program_lookup_rename(void *p, const char *name);
182void copied_program_lookup_delete(Edje_Part_Collection *pc, const char *name); 182void copied_program_lookup_delete(Edje_Part_Collection *pc, const char *name);
183void data_queue_copied_program_lookup(Edje_Part_Collection *pc, int *src, int *dest); 183void data_queue_copied_program_lookup(Edje_Part_Collection *pc, int *src, int *dest);
184void copied_program_anonymous_lookup_delete(Edje_Part_Collection *pc, int *dest);
184void data_queue_anonymous_lookup(Edje_Part_Collection *pc, Edje_Program *ep, int *dest); 185void data_queue_anonymous_lookup(Edje_Part_Collection *pc, Edje_Program *ep, int *dest);
185void data_queue_copied_anonymous_lookup(Edje_Part_Collection *pc, int *src, int *dest); 186void data_queue_copied_anonymous_lookup(Edje_Part_Collection *pc, int *src, int *dest);
186void data_queue_image_lookup(char *name, int *dest, Eina_Bool *set); 187void data_queue_image_lookup(char *name, int *dest, Eina_Bool *set);
diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c
index f6bc18bc5a..59b1c320f9 100644
--- a/src/bin/edje/edje_cc_handlers.c
+++ b/src/bin/edje/edje_cc_handlers.c
@@ -166,6 +166,7 @@ Eina_Bool current_group_inherit = EINA_FALSE;
166Eina_Bool script_override = EINA_FALSE; 166Eina_Bool script_override = EINA_FALSE;
167static Edje_Program *sequencing = NULL; 167static Edje_Program *sequencing = NULL;
168static Eina_List *sequencing_lookups = NULL; 168static Eina_List *sequencing_lookups = NULL;
169static int *anonymous_delete = NULL;
169 170
170Eina_List *po_files; 171Eina_List *po_files;
171 172
@@ -5745,6 +5746,11 @@ _program_remove(const char *name, Edje_Program **pgrms, unsigned int count)
5745 5746
5746 _edje_program_remove(pc, pr); 5747 _edje_program_remove(pc, pr);
5747 5748
5749 if (pr->action == EDJE_ACTION_TYPE_SCRIPT)
5750 {
5751 anonymous_delete = &pr->id;
5752 }
5753
5748 _program_free(pr); 5754 _program_free(pr);
5749 return EINA_TRUE; 5755 return EINA_TRUE;
5750 } 5756 }
@@ -5794,6 +5800,11 @@ st_collections_group_program_remove(void)
5794 success |= _program_remove(name, pc->programs.nocmp, pc->programs.nocmp_count); 5800 success |= _program_remove(name, pc->programs.nocmp, pc->programs.nocmp_count);
5795 5801
5796 copied_program_lookup_delete(pc, name); 5802 copied_program_lookup_delete(pc, name);
5803 if (anonymous_delete)
5804 {
5805 copied_program_anonymous_lookup_delete(pc, anonymous_delete);
5806 anonymous_delete = NULL;
5807 }
5797 if (!success) 5808 if (!success)
5798 { 5809 {
5799 ERR("Attempted removal of nonexistent program '%s' in group '%s'.", 5810 ERR("Attempted removal of nonexistent program '%s' in group '%s'.",
diff --git a/src/bin/edje/edje_cc_out.c b/src/bin/edje/edje_cc_out.c
index ee5fe147d3..03cf57e523 100644
--- a/src/bin/edje/edje_cc_out.c
+++ b/src/bin/edje/edje_cc_out.c
@@ -2943,6 +2943,20 @@ data_queue_anonymous_lookup(Edje_Part_Collection *pc, Edje_Program *ep, int *des
2943} 2943}
2944 2944
2945void 2945void
2946copied_program_anonymous_lookup_delete(Edje_Part_Collection *pc, int *dest)
2947{
2948 Program_Lookup *pl;
2949 Eina_List *l, *ll;
2950
2951 EINA_LIST_FOREACH_SAFE(program_lookups, l, ll, pl)
2952 {
2953 if ((!pl->anonymous) || (pl->pc != pc) || (dest != &pl->u.ep->id)) continue;
2954 program_lookups = eina_list_remove_list(program_lookups, l);
2955 free(pl);
2956 }
2957}
2958
2959void
2946data_queue_copied_anonymous_lookup(Edje_Part_Collection *pc, int *src, int *dest) 2960data_queue_copied_anonymous_lookup(Edje_Part_Collection *pc, int *src, int *dest)
2947{ 2961{
2948 Eina_List *l; 2962 Eina_List *l;