summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2018-06-28 11:06:13 -0400
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2018-07-05 22:59:18 +0200
commit786210db6f94f9b087e664bf2859e62020d62985 (patch)
treeaacdaac27d2c8dc2fc3ee9212eb59b80d0b3b7ff
parent1b2408d5f7aee1032a3fdda8bf0a2c5578eb6b2a (diff)
edje_cc: add 'skip_namespace_validation' keyword
this pairs with the newly-added -N option to denote groups in edc files which should not be checked for correct namespacing the option is useful for cases such as music_control.edc, where a group has been shipping for years with API signals like "btn,clicked" which cannot be changed since they are used in an external application and compatibility must be maintained the documentation for this option explicitly states that it must only be used inside an #ifdef SKIP_NAMESPACE_VALIDATION block, allowing this keyword to be easily removed at a later point ref T7072 @feature Differential Revision: https://phab.enlightenment.org/D6388
-rw-r--r--src/bin/edje/edje_cc.h1
-rw-r--r--src/bin/edje/edje_cc_handlers.c27
-rw-r--r--src/bin/edje/edje_cc_out.c32
-rw-r--r--src/bin/edje/edje_cc_parse.c8
4 files changed, 52 insertions, 16 deletions
diff --git a/src/bin/edje/edje_cc.h b/src/bin/edje/edje_cc.h
index aec77a4587..afb7a99c03 100644
--- a/src/bin/edje/edje_cc.h
+++ b/src/bin/edje/edje_cc.h
@@ -167,6 +167,7 @@ struct _Edje_Part_Collection_Parser
167 Eina_Bool default_mouse_events; 167 Eina_Bool default_mouse_events;
168 Eina_Bool inherit_only; 168 Eina_Bool inherit_only;
169 Eina_Bool inherit_script : 1; 169 Eina_Bool inherit_script : 1;
170 Eina_Bool skip_namespace_validation : 1;
170}; 171};
171 172
172typedef enum 173typedef enum
diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c
index 6d987edb8f..17b3ce3768 100644
--- a/src/bin/edje/edje_cc_handlers.c
+++ b/src/bin/edje/edje_cc_handlers.c
@@ -257,6 +257,7 @@ static void st_collections_base_scale(void);
257 257
258static void ob_collections_group(void); 258static void ob_collections_group(void);
259static void st_collections_group_name(void); 259static void st_collections_group_name(void);
260static void st_collections_group_skip_namespace_validation(void);
260static void st_collections_group_inherit_only(void); 261static void st_collections_group_inherit_only(void);
261static void st_collections_group_inherit(void); 262static void st_collections_group_inherit(void);
262static void st_collections_group_program_source(void); 263static void st_collections_group_program_source(void);
@@ -749,6 +750,7 @@ New_Statement_Handler statement_handlers[] =
749 }, /* dup */ 750 }, /* dup */
750 {"collections.group.vibrations.sample.source", st_collections_group_vibration_sample_source}, /* dup */ 751 {"collections.group.vibrations.sample.source", st_collections_group_vibration_sample_source}, /* dup */
751 {"collections.group.name", st_collections_group_name}, 752 {"collections.group.name", st_collections_group_name},
753 {"collections.group.skip_namespace_validation", st_collections_group_skip_namespace_validation},
752 {"collections.group.program_source", st_collections_group_program_source}, 754 {"collections.group.program_source", st_collections_group_program_source},
753 {"collections.group.inherit", st_collections_group_inherit}, 755 {"collections.group.inherit", st_collections_group_inherit},
754 {"collections.group.inherit_only", st_collections_group_inherit_only}, 756 {"collections.group.inherit_only", st_collections_group_inherit_only},
@@ -4521,6 +4523,30 @@ st_collections_group_name(void)
4521 _group_name(parse_str(0)); 4523 _group_name(parse_str(0));
4522} 4524}
4523 4525
4526/**
4527 @page edcref
4528 @property
4529 skip_namespace_validation
4530 @parameters
4531 [1 or 0]
4532 @effect
4533 This disables namespace validation for the current group if validation has
4534 been enabled with edje_cc's -N option.
4535 This property can be inherited.
4536 Defaults: 0
4537
4538 @warning Your edc file should always wrap this keyword with #ifdef HAVE_SKIP_NAMESPACE_VALIDATION
4539 @since 1.21
4540 @endproperty
4541 */
4542static void
4543st_collections_group_skip_namespace_validation(void)
4544{
4545 Edje_Part_Collection_Parser *pcp = eina_list_last_data_get(edje_collections);
4546 check_arg_count(1);
4547 pcp->skip_namespace_validation = parse_bool(0);
4548}
4549
4524typedef struct _Edje_List_Foreach_Data Edje_List_Foreach_Data; 4550typedef struct _Edje_List_Foreach_Data Edje_List_Foreach_Data;
4525struct _Edje_List_Foreach_Data 4551struct _Edje_List_Foreach_Data
4526{ 4552{
@@ -5170,6 +5196,7 @@ st_collections_group_inherit(void)
5170 pcp = (Edje_Part_Collection_Parser *)pc; 5196 pcp = (Edje_Part_Collection_Parser *)pc;
5171 pcp2 = (Edje_Part_Collection_Parser *)pc2; 5197 pcp2 = (Edje_Part_Collection_Parser *)pc2;
5172 pcp->default_mouse_events = pcp2->default_mouse_events; 5198 pcp->default_mouse_events = pcp2->default_mouse_events;
5199 pcp->skip_namespace_validation = pcp2->skip_namespace_validation;
5173 if (pcp2->inherit_script) 5200 if (pcp2->inherit_script)
5174 pcp->inherit_script = pcp2->inherit_script; 5201 pcp->inherit_script = pcp2->inherit_script;
5175 5202
diff --git a/src/bin/edje/edje_cc_out.c b/src/bin/edje/edje_cc_out.c
index 4d21668368..a28cc48505 100644
--- a/src/bin/edje/edje_cc_out.c
+++ b/src/bin/edje/edje_cc_out.c
@@ -631,6 +631,7 @@ _part_namespace_verify(Edje_Part_Collection *pc, Edje_Part *ep, Eet_File *ef EIN
631static void 631static void
632check_part(Edje_Part_Collection *pc, Edje_Part *ep, Eet_File *ef) 632check_part(Edje_Part_Collection *pc, Edje_Part *ep, Eet_File *ef)
633{ 633{
634 Edje_Part_Collection_Parser *pcp = (Edje_Part_Collection_Parser*)pc;
634 unsigned int i; 635 unsigned int i;
635 Eina_List *group_path = NULL; 636 Eina_List *group_path = NULL;
636 /* FIXME: check image set and sort them. */ 637 /* FIXME: check image set and sort them. */
@@ -662,19 +663,22 @@ check_part(Edje_Part_Collection *pc, Edje_Part *ep, Eet_File *ef)
662 check_text_part_desc(pc, ep, (Edje_Part_Description_Text *)ep->other.desc[i], ef); 663 check_text_part_desc(pc, ep, (Edje_Part_Description_Text *)ep->other.desc[i], ef);
663 } 664 }
664 665
665 switch (ep->type) 666 if (!pcp->skip_namespace_validation)
666 { 667 {
667 case EDJE_PART_TYPE_BOX: 668 switch (ep->type)
668 case EDJE_PART_TYPE_TABLE: 669 {
669 case EDJE_PART_TYPE_SWALLOW: 670 case EDJE_PART_TYPE_BOX:
670 _part_namespace_verify(pc, ep, ef, 1); 671 case EDJE_PART_TYPE_TABLE:
671 break; 672 case EDJE_PART_TYPE_SWALLOW:
672 case EDJE_PART_TYPE_TEXT: 673 _part_namespace_verify(pc, ep, ef, 1);
673 case EDJE_PART_TYPE_TEXTBLOCK: 674 break;
674 case EDJE_PART_TYPE_SPACER: 675 case EDJE_PART_TYPE_TEXT:
675 _part_namespace_verify(pc, ep, ef, 0); 676 case EDJE_PART_TYPE_TEXTBLOCK:
676 break; 677 case EDJE_PART_TYPE_SPACER:
677 default: break; 678 _part_namespace_verify(pc, ep, ef, 0);
679 break;
680 default: break;
681 }
678 } 682 }
679 683
680 /* FIXME: When smart masks are supported, remove this check */ 684 /* FIXME: When smart masks are supported, remove this check */
@@ -716,6 +720,7 @@ _program_signal_namespace_verify(Edje_Part_Collection *pc, Eet_File *ef EINA_UNU
716static void 720static void
717check_program(Edje_Part_Collection *pc, Edje_Program *ep, Eet_File *ef) 721check_program(Edje_Part_Collection *pc, Edje_Program *ep, Eet_File *ef)
718{ 722{
723 Edje_Part_Collection_Parser *pcp = (Edje_Part_Collection_Parser*)pc;
719 switch (ep->action) 724 switch (ep->action)
720 { 725 {
721 case EDJE_ACTION_TYPE_STATE_SET: 726 case EDJE_ACTION_TYPE_STATE_SET:
@@ -744,7 +749,8 @@ check_program(Edje_Part_Collection *pc, Edje_Program *ep, Eet_File *ef)
744 749
745 if ((!ep->targets) && (ep->action == EDJE_ACTION_TYPE_SIGNAL_EMIT)) 750 if ((!ep->targets) && (ep->action == EDJE_ACTION_TYPE_SIGNAL_EMIT))
746 { 751 {
747 _program_signal_namespace_verify(pc, ef, ep->state, ep->state2); 752 if (!pcp->skip_namespace_validation)
753 _program_signal_namespace_verify(pc, ef, ep->state, ep->state2);
748 } 754 }
749 755
750 EINA_LIST_FOREACH(ep->targets, l, et) 756 EINA_LIST_FOREACH(ep->targets, l, et)
diff --git a/src/bin/edje/edje_cc_parse.c b/src/bin/edje/edje_cc_parse.c
index 068bd74eee..7a3335c559 100644
--- a/src/bin/edje/edje_cc_parse.c
+++ b/src/bin/edje/edje_cc_parse.c
@@ -22,6 +22,8 @@
22# define EPP_EXT 22# define EPP_EXT
23#endif 23#endif
24 24
25#define SKIP_NAMESPACE_VALIDATION_SUPPORTED " -DSKIP_NAMESPACE_VALIDATION=1 "
26
25#define EDJE_1_18_SUPPORTED " -DEFL_VERSION_1_18=1 " 27#define EDJE_1_18_SUPPORTED " -DEFL_VERSION_1_18=1 "
26#define EDJE_1_19_SUPPORTED " -DEFL_VERSION_1_19=1 " 28#define EDJE_1_19_SUPPORTED " -DEFL_VERSION_1_19=1 "
27#define EDJE_1_20_SUPPORTED " -DEFL_VERSION_1_20=1 " 29#define EDJE_1_20_SUPPORTED " -DEFL_VERSION_1_20=1 "
@@ -1082,7 +1084,7 @@ compile(void)
1082 1084
1083 inc = ecore_file_dir_get(file_in); 1085 inc = ecore_file_dir_get(file_in);
1084 if (depfile) 1086 if (depfile)
1085 snprintf(buf, sizeof(buf), "\"%s\" -MMD \"%s\" -MT \"%s\" \"%s\"" 1087 snprintf(buf, sizeof(buf), "\"%s\" "SKIP_NAMESPACE_VALIDATION_SUPPORTED" -MMD \"%s\" -MT \"%s\" \"%s\""
1086 " -I\"%s\" %s -o \"%s\"" 1088 " -I\"%s\" %s -o \"%s\""
1087 " -DEFL_VERSION_MAJOR=%d -DEFL_VERSION_MINOR=%d" 1089 " -DEFL_VERSION_MAJOR=%d -DEFL_VERSION_MINOR=%d"
1088 EDJE_CC_EFL_VERSION_SUPPORTED, 1090 EDJE_CC_EFL_VERSION_SUPPORTED,
@@ -1090,7 +1092,7 @@ compile(void)
1090 inc ? inc : "./", def, clean_file, 1092 inc ? inc : "./", def, clean_file,
1091 EINA_VERSION_MAJOR, EINA_VERSION_MINOR); 1093 EINA_VERSION_MAJOR, EINA_VERSION_MINOR);
1092 else if (annotate) 1094 else if (annotate)
1093 snprintf(buf, sizeof(buf), "\"%s\" -annotate -a \"%s\" \"%s\"" 1095 snprintf(buf, sizeof(buf), "\"%s\" "SKIP_NAMESPACE_VALIDATION_SUPPORTED" -annotate -a \"%s\" \"%s\""
1094 " -I\"%s\" %s -o \"%s\"" 1096 " -I\"%s\" %s -o \"%s\""
1095 " -DEFL_VERSION_MAJOR=%d -DEFL_VERSION_MINOR=%d" 1097 " -DEFL_VERSION_MAJOR=%d -DEFL_VERSION_MINOR=%d"
1096 EDJE_CC_EFL_VERSION_SUPPORTED, 1098 EDJE_CC_EFL_VERSION_SUPPORTED,
@@ -1098,7 +1100,7 @@ compile(void)
1098 inc ? inc : "./", def, clean_file, 1100 inc ? inc : "./", def, clean_file,
1099 EINA_VERSION_MAJOR, EINA_VERSION_MINOR); 1101 EINA_VERSION_MAJOR, EINA_VERSION_MINOR);
1100 else 1102 else
1101 snprintf(buf, sizeof(buf), "\"%s\" -a \"%s\" \"%s\" -I\"%s\" %s" 1103 snprintf(buf, sizeof(buf), "\"%s\" "SKIP_NAMESPACE_VALIDATION_SUPPORTED" -a \"%s\" \"%s\" -I\"%s\" %s"
1102 " -o \"%s\"" 1104 " -o \"%s\""
1103 " -DEFL_VERSION_MAJOR=%d -DEFL_VERSION_MINOR=%d" 1105 " -DEFL_VERSION_MAJOR=%d -DEFL_VERSION_MINOR=%d"
1104 EDJE_CC_EFL_VERSION_SUPPORTED, 1106 EDJE_CC_EFL_VERSION_SUPPORTED,