tests/edje/data/test_swallows.edc \
tests/edje/data/test_box.edc \
tests/edje/data/test_table.edc \
+tests/edje/data/test_combine_keywords.edc \
tests/edje/data/filter.lua
tests/edje/data/test_color_class.edj \
tests/edje/data/test_box.edj \
tests/edje/data/test_table.edj \
+ tests/edje/data/test_combine_keywords.edj \
$(NULL)
CLEANFILES += $(EDJE_TEST_FILES)
void error_and_abort(Eet_File *ef, const char *fmt, ...);
void stack_push_quick(const char *str);
-void stack_pop_quick(Eina_Bool check_last, Eina_Bool do_free);
+char *stack_pop_quick(Eina_Bool check_last, Eina_Bool do_free);
+void stack_replace_quick(const char *token);
Eina_Bool edje_cc_handlers_wildcard(void);
void edje_cc_handlers_hierarchy_alloc(void);
void edje_cc_handlers_hierarchy_free(void);
"vector", EDJE_PART_TYPE_VECTOR,
NULL);
- stack_pop_quick(EINA_TRUE, EINA_TRUE);
- stack_push_quick("part");
+ stack_replace_quick("part");
_part_create();
_part_type_set(type);
}
static void
ob_collections_group_parts_part_desc(void)
{
- stack_pop_quick(EINA_TRUE, EINA_TRUE);
- stack_push_quick("description");
+ stack_replace_quick("description");
ob_collections_group_parts_part_description();
}
eina_strbuf_append(stack_buf, s);
}
-void
+char *
stack_pop_quick(Eina_Bool check_last, Eina_Bool do_free)
{
char *tmp, *str;
eina_strbuf_length_get(stack_buf) - strlen(tmp) - 1,
eina_strbuf_length_get(stack_buf)); /* remove: '.tmp' */
stack = eina_list_remove_list(stack, eina_list_last(stack));
- if (do_free) free(str);
+ if (do_free)
+ {
+ free(str);
+ str = NULL;
+ }
+ return str;
+}
+
+/* replace the top of stack with given token */
+void
+stack_replace_quick(const char *token)
+{
+ char *str;
+
+ str = stack_pop_quick(EINA_FALSE, EINA_FALSE);
+ if ((str) && strchr(str, '.'))
+ {
+ char *end, *tmp = str;
+ Eina_Strbuf *buf;
+
+ end = strchr(tmp, '.');
+ if (end)
+ tmp = end + 1;
+
+ buf = eina_strbuf_new();
+ eina_strbuf_append(buf, str);
+ eina_strbuf_remove(buf,
+ eina_strbuf_length_get(buf) - strlen(tmp),
+ eina_strbuf_length_get(buf));
+ eina_strbuf_append(buf, token);
+
+ stack_push_quick(eina_strbuf_string_get(buf));
+
+ eina_strbuf_free(buf);
+ free(str);
+ }
+ else
+ {
+ stack_push_quick(token);
+ }
}
static const char *
--- /dev/null
+collections {
+ group { "test_group";
+ parts.rect { "base";
+ }
+ }
+ group { "test_group2";
+ parts.rect { "base";
+ }
+ }
+}
}
END_TEST
+START_TEST(edje_test_combine_keywords)
+{
+ Evas *evas;
+ Evas_Object *obj;
+
+ evas = EDJE_TEST_INIT_EVAS();
+
+ obj = edje_object_add(evas);
+ fail_unless(edje_object_file_set(obj, test_layout_get("test_combine_keywords.edj"), "test_group"));
+
+ EDJE_TEST_FREE_EVAS();
+}
+END_TEST
+
void edje_test_edje(TCase *tc)
{
tcase_add_test(tc, edje_test_edje_init);
tcase_add_test(tc, edje_test_box_eoapi);
tcase_add_test(tc, edje_test_table);
tcase_add_test(tc, edje_test_table_eoapi);
+ tcase_add_test(tc, edje_test_combine_keywords);
}