summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJee-Yong Um <jc9.um@samsung.com>2016-03-18 13:30:55 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-03-18 13:30:55 +0900
commit4a63c917aa6a2da459a6a5da494227f18dfc46c7 (patch)
treee59ab8fce600e3baf56c6bcc9374450fcdbcdb8d /src
parentb8f682b842675d8ac952ddbc067befc22ec486ce (diff)
edje_cc: fix inheriting script from other group
Summary: If a group inherits from the other, group script block is copied only when there are program script blocks in parent group. This patch makes edje_cc always copies group script block, but allows to override group script block in child group. The content of reverted D3799 is included. That reveals this inconsistency. Reviewers: cedric Subscribers: Jaehyun_Cho, woohyun, jpeg Differential Revision: https://phab.enlightenment.org/D3802
Diffstat (limited to 'src')
-rw-r--r--src/bin/edje/edje_cc_handlers.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c
index 8fb43cf15f..edc3542475 100644
--- a/src/bin/edje/edje_cc_handlers.c
+++ b/src/bin/edje/edje_cc_handlers.c
@@ -163,6 +163,7 @@ static Edje_Part_Description_Common *parent_desc = NULL;
163static Edje_Program *current_program = NULL; 163static Edje_Program *current_program = NULL;
164static Eina_List *current_program_lookups = NULL; 164static Eina_List *current_program_lookups = NULL;
165Eina_Bool current_group_inherit = EINA_FALSE; 165Eina_Bool current_group_inherit = EINA_FALSE;
166Eina_Bool script_override = EINA_TRUE;
166static Edje_Program *sequencing = NULL; 167static Edje_Program *sequencing = NULL;
167static Eina_List *sequencing_lookups = NULL; 168static Eina_List *sequencing_lookups = NULL;
168 169
@@ -3874,8 +3875,8 @@ ob_collections_group(void)
3874 current_part = NULL; 3875 current_part = NULL;
3875 current_desc = NULL; 3876 current_desc = NULL;
3876 3877
3877
3878 current_group_inherit = EINA_FALSE; 3878 current_group_inherit = EINA_FALSE;
3879 script_override = EINA_FALSE;
3879 3880
3880 current_de = mem_alloc(SZ(Edje_Part_Collection_Directory_Entry)); 3881 current_de = mem_alloc(SZ(Edje_Part_Collection_Directory_Entry));
3881 current_de->id = eina_list_count(edje_collections); 3882 current_de->id = eina_list_count(edje_collections);
@@ -4438,6 +4439,11 @@ st_collections_group_inherit(void)
4438 cd2 = eina_list_nth(codes, de->id); 4439 cd2 = eina_list_nth(codes, de->id);
4439 cd = eina_list_data_get(eina_list_last(codes)); 4440 cd = eina_list_data_get(eina_list_last(codes));
4440 4441
4442 cd->is_lua = cd2->is_lua;
4443 cd->shared = STRDUP(cd2->shared);
4444 cd->original = STRDUP(cd2->original);
4445 script_override = EINA_TRUE;
4446
4441 EINA_LIST_FOREACH(cd2->programs, l, cp2) 4447 EINA_LIST_FOREACH(cd2->programs, l, cp2)
4442 { 4448 {
4443 cp = mem_alloc(SZ(Code_Program)); 4449 cp = mem_alloc(SZ(Code_Program));
@@ -4446,9 +4452,6 @@ st_collections_group_inherit(void)
4446 cp->l2 = cp2->l2; 4452 cp->l2 = cp2->l2;
4447 cp->script = STRDUP(cp2->script); 4453 cp->script = STRDUP(cp2->script);
4448 cp->original = STRDUP(cp2->original); 4454 cp->original = STRDUP(cp2->original);
4449 cd->is_lua = cd2->is_lua;
4450 cd->shared = STRDUP(cd2->shared);
4451 cd->original = STRDUP(cd2->original);
4452 cd->programs = eina_list_append(cd->programs, cp); 4455 cd->programs = eina_list_append(cd->programs, cp);
4453 data_queue_copied_anonymous_lookup(pc, &(cp2->id), &(cp->id)); 4456 data_queue_copied_anonymous_lookup(pc, &(cp2->id), &(cp->id));
4454 } 4457 }
@@ -4785,9 +4788,18 @@ ob_collections_group_script(void)
4785 cd->l2 = get_verbatim_line2(); 4788 cd->l2 = get_verbatim_line2();
4786 if (cd->shared) 4789 if (cd->shared)
4787 { 4790 {
4788 ERR("parse error %s:%i. There is already an existing script section for the group", 4791 if (script_override)
4789 file_in, line - 1); 4792 {
4790 exit(-1); 4793 free(cd->shared);
4794 free(cd->original);
4795 script_override = EINA_FALSE;
4796 }
4797 else
4798 {
4799 ERR("parse error %s:%i. There is already an existing script section for the group",
4800 file_in, line - 1);
4801 exit(-1);
4802 }
4791 } 4803 }
4792 cd->shared = s; 4804 cd->shared = s;
4793 cd->original = strdup(s); 4805 cd->original = strdup(s);