aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJee-Yong Um <jc9.um@samsung.com>2016-02-05 08:30:31 +0100
committerCedric BAIL <cedric@osg.samsung.com>2016-02-05 08:30:37 +0100
commitf04d509feb45cda11919c903c6a45e1d3a0a5a48 (patch)
tree1f775b5adcec71ed8ecf5870b6f337dbac6740b1
parentedje: add new part types to edje_cache (diff)
downloadefl-f04d509feb45cda11919c903c6a45e1d3a0a5a48.tar.gz
edje_cc: allow omitting "name" keyword in color_classes.color_class block
Summary: This allows developer to omit "name" keyword in color_classes.color_class block in EDC. Reviewers: cedric, jpeg Reviewed By: jpeg Differential Revision: https://phab.enlightenment.org/D3598 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
-rw-r--r--src/bin/edje/edje_cc_handlers.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c
index 09c2599aa7..3a8bbe727e 100644
--- a/src/bin/edje/edje_cc_handlers.c
+++ b/src/bin/edje/edje_cc_handlers.c
@@ -2738,6 +2738,25 @@ ob_color_class(void)
cc->a3 = 0;
}
+static void
+_color_class_name(char *name)
+{
+ Edje_Color_Class *cc, *tcc;
+ Eina_List *l;
+
+ cc = eina_list_data_get(eina_list_last(edje_file->color_classes));
+ cc->name = name;
+ EINA_LIST_FOREACH(edje_file->color_classes, l, tcc)
+ {
+ if ((cc != tcc) && (!strcmp(cc->name, tcc->name)))
+ {
+ ERR("parse error %s:%i. There is already a color class named \"%s\"",
+ file_in, line - 1, cc->name);
+ exit(-1);
+ }
+ }
+}
+
/**
@page edcref
@@ -14767,6 +14786,13 @@ edje_cc_handlers_wildcard(void)
stack_pop_quick(EINA_FALSE, EINA_FALSE);
return EINA_TRUE;
}
+ if (edje_file->color_classes && (!strcmp(last, "color_class")))
+ {
+ if (!had_quote) return EINA_FALSE;
+ _color_class_name(token);
+ stack_pop_quick(EINA_FALSE, EINA_FALSE);
+ return EINA_TRUE;
+ }
if (edje_file->text_classes && (!strcmp(last, "text_class")))
{
if (!had_quote) return EINA_FALSE;