jaehyun pushed a commit to branch master. http://git.enlightenment.org/tools/enventor.git/commit/?id=e984d2bb4e7780a429be47804fc10045266bf25c
commit e984d2bb4e7780a429be47804fc10045266bf25c Author: Jaehyun Cho <jae_hyun....@samsung.com> Date: Wed Jan 27 14:29:40 2016 +0900 template: Fix incorrect template insertion inside LazEDC block Since LazEDC block types were not recognized for template insertion, inserted template type inside LazEDC block was not correct. (e.g. inside desc { }) Now LazEDC block types are considered for template insertion by Ctrl+T. --- src/lib/edc_parser.c | 11 +++++++++-- src/lib/template.c | 10 +++++++++- src/lib/template_code.h | 14 ++++++++++++++ 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/src/lib/edc_parser.c b/src/lib/edc_parser.c index 23b517c..cc045d5 100644 --- a/src/lib/edc_parser.c +++ b/src/lib/edc_parser.c @@ -1544,7 +1544,7 @@ Eina_Stringshare * parser_paragh_name_get(parser_data *pd EINA_UNUSED, Evas_Object *entry) { //FIXME: list up groups -#define GROUP_CNT 13 +#define GROUP_CNT 20 typedef struct _group_info { char *str; @@ -1554,9 +1554,11 @@ parser_paragh_name_get(parser_data *pd EINA_UNUSED, Evas_Object *entry) group_info group_list[GROUP_CNT] = { { "collections", 11 }, + { "desc", 4 }, { "description", 11 }, { "fill", 4 }, { "group", 5 }, + { "image", 5 }, { "images", 6 }, { "map", 3 }, { "origin", 6 }, @@ -1564,8 +1566,13 @@ parser_paragh_name_get(parser_data *pd EINA_UNUSED, Evas_Object *entry) { "part", 4 }, { "programs", 8 }, { "program", 7 }, + { "rect", 4 }, { "rel1", 4 }, - { "rel2", 4 } + { "rel2", 4 }, + { "spacer", 6 }, + { "swallow", 7 }, + { "text", 4 }, + { "textblock", 9 } }; const char *text = elm_entry_entry_get(entry); diff --git a/src/lib/template.c b/src/lib/template.c index 995260f..5ea3e9c 100644 --- a/src/lib/template.c +++ b/src/lib/template.c @@ -318,12 +318,20 @@ template_insert(edit_data *ed, Enventor_Template_Insert_Type insert_type, int line_cnt; char **t = NULL; - if (!strcmp(paragh, "part")) + if (!strcmp(paragh, "part") || !strcmp(paragh, "image") || + !strcmp(paragh, "rect") || !strcmp(paragh, "swallow") || + !strcmp(paragh, "text") || !strcmp(paragh, "textblock")) { line_cnt = TEMPLATE_DESC_LINE_CNT; t = (char **) &TEMPLATE_DESC; strncpy(syntax, "Description", n); } + else if (!strcmp(paragh, "spacer")) + { + line_cnt = TEMPLATE_DESC_SPACER_LINE_CNT; + t = (char **) &TEMPLATE_DESC_SPACER; + strncpy(syntax, "Description", n); + } else if (!strcmp(paragh, "programs")) { line_cnt = TEMPLATE_PROG_LINE_CNT; diff --git a/src/lib/template_code.h b/src/lib/template_code.h index 68eca54..fbcc9d5 100644 --- a/src/lib/template_code.h +++ b/src/lib/template_code.h @@ -142,6 +142,20 @@ const char *TEMPLATE_DESC[TEMPLATE_DESC_LINE_CNT] = "}", }; +#define TEMPLATE_DESC_SPACER_LINE_CNT 8 + +const char *TEMPLATE_DESC_SPACER[TEMPLATE_DESC_SPACER_LINE_CNT] = +{ + "desc { \"XXX\";<br/>", + " //inherit: \"default\";<br/>", + " rel1 { relative: 0.0 0.0; offset: 0 0; /*to: \"XXX\";*/ }<br/>", + " rel2 { relative: 1.0 1.0; offset: -1 -1; /*to: \"XXX\";*/ }<br/>", + " align: 0.5 0.5;<br/>", + " fixed: 0 0;<br/>", + " min: 0 0;<br/>", + "}", +}; + #define TEMPLATE_PROG_LINE_CNT 7 const char *TEMPLATE_PROG[TEMPLATE_PROG_LINE_CNT] = --