hermet pushed a commit to branch master.

http://git.enlightenment.org/tools/enventor.git/commit/?id=12fc464bd93059bd1dd48e6d4f3a1aa051438b57

commit 12fc464bd93059bd1dd48e6d4f3a1aa051438b57
Author: ChunEon Park <her...@hermet.pe.kr>
Date:   Tue Jun 30 16:46:34 2015 +0900

    template: update live edit generation code for new edc syntax.
---
 src/lib/template.c      | 17 ++++++++++-------
 src/lib/template_code.h | 18 ++++++------------
 2 files changed, 16 insertions(+), 19 deletions(-)

diff --git a/src/lib/template.c b/src/lib/template.c
index 36f65ac..365d085 100644
--- a/src/lib/template.c
+++ b/src/lib/template.c
@@ -140,33 +140,34 @@ template_part_insert(edit_data *ed, Edje_Part_Type 
part_type,
    int line_cnt = 0;
    char **t = NULL;
    char buf[64];
+   char type_name[20];
 
    switch(part_type)
      {
         case EDJE_PART_TYPE_RECTANGLE:
            line_cnt = TEMPLATE_PART_RECT_LINE_CNT;
            t = (char **) &TEMPLATE_PART_RECT;
-           strncpy(syntax, "Rect", n);
+           strncpy(type_name, "rect\0", 5);
            break;
         case EDJE_PART_TYPE_TEXT:
            line_cnt = TEMPLATE_PART_TEXT_LINE_CNT;
            t = (char **) &TEMPLATE_PART_TEXT;
-           strncpy(syntax, "Text", n);
+           strncpy(type_name, "text\0", 5);
            break;
         case EDJE_PART_TYPE_SWALLOW:
            line_cnt = TEMPLATE_PART_SWALLOW_LINE_CNT;
            t = (char **) &TEMPLATE_PART_SWALLOW;
-           strncpy(syntax, "Swallow", n);
+           strncpy(type_name, "swallow\0", 8);
            break;
         case EDJE_PART_TYPE_TEXTBLOCK:
            line_cnt = TEMPLATE_PART_TEXTBLOCK_LINE_CNT;
            t = (char **) &TEMPLATE_PART_TEXTBLOCK;
-           strncpy(syntax, "Textblock", n);
+           strncpy(type_name, "textblock\0", 10);
            break;
         case EDJE_PART_TYPE_SPACER:
            line_cnt = TEMPLATE_PART_SPACER_LINE_CNT;
            t = (char **) &TEMPLATE_PART_SPACER;
-           strncpy(syntax, "Spacer", n);
+           strncpy(type_name, "spacer\0", 7);
            break;
         case EDJE_PART_TYPE_IMAGE:
         case EDJE_PART_TYPE_NONE:
@@ -179,7 +180,7 @@ template_part_insert(edit_data *ed, Edje_Part_Type 
part_type,
         case EDJE_PART_TYPE_LAST:
            line_cnt = TEMPLATE_PART_IMAGE_LINE_CNT;
            t = (char **) &TEMPLATE_PART_IMAGE;
-           strncpy(syntax, "Image", n);
+           strncpy(type_name, "image\0", 6);
            break;
         //for avoiding compiler warning.
         case EDJE_PART_TYPE_MESH_NODE:
@@ -194,7 +195,7 @@ template_part_insert(edit_data *ed, Edje_Part_Type 
part_type,
    template_random_string_create(random_name, 9);
 
    elm_entry_entry_insert(edit_entry, p);
-   snprintf(first_line, 40, "part { name: \"%s\";<br/>", random_name);
+   snprintf(first_line, 40, "%s { \"%s\";<br/>", type_name, random_name);
    elm_entry_entry_insert(edit_entry, first_line);
 
    //Insert part body
@@ -255,6 +256,8 @@ template_part_insert(edit_data *ed, Edje_Part_Type 
part_type,
    edit_syntax_color_partial_apply(ed, 0);
    edit_changed_set(ed, EINA_TRUE);
 
+   strncpy(syntax, type_name, n);
+
    return EINA_TRUE;
 }
 
diff --git a/src/lib/template_code.h b/src/lib/template_code.h
index 39a546f..a7ada0d 100644
--- a/src/lib/template_code.h
+++ b/src/lib/template_code.h
@@ -38,11 +38,10 @@ const char *TEMPLATE_PART_TALE[TEMPLATE_PART_TALE_LINE_CNT] 
=
    "}"
 };
 
-#define TEMPLATE_PART_IMAGE_LINE_CNT 9
+#define TEMPLATE_PART_IMAGE_LINE_CNT 8
 
 const char *TEMPLATE_PART_IMAGE[TEMPLATE_PART_IMAGE_LINE_CNT] =
 {
-   "   type: IMAGE;<br/>",
    "   scale: 1;<br/>",
    "   desc { \"default\";<br/>",
    "      align: 0.5 0.5;<br/>",
@@ -53,11 +52,10 @@ const char 
*TEMPLATE_PART_IMAGE[TEMPLATE_PART_IMAGE_LINE_CNT] =
    "      //aspect: 1 1;<br/>"
 };
 
-#define TEMPLATE_PART_RECT_LINE_CNT 8
+#define TEMPLATE_PART_RECT_LINE_CNT 7
 
 const char *TEMPLATE_PART_RECT[TEMPLATE_PART_RECT_LINE_CNT] =
 {
-   "   type: RECT;<br/>",
    "   scale: 1;<br/>",
    "   desc { \"default\";<br/>",
    "      color: 0 136 170 255;<br/>",
@@ -67,11 +65,10 @@ const char *TEMPLATE_PART_RECT[TEMPLATE_PART_RECT_LINE_CNT] 
=
    "      visible: 1;<br/>"
 };
 
-#define TEMPLATE_PART_SWALLOW_LINE_CNT 7
+#define TEMPLATE_PART_SWALLOW_LINE_CNT 6
 
 const char *TEMPLATE_PART_SWALLOW[TEMPLATE_PART_SWALLOW_LINE_CNT] =
 {
-   "   type: SWALLOW;<br/>",
    "   scale: 1;<br/>",
    "   desc { \"default\";<br/>",
    "      align: 0.5 0.5;<br/>",
@@ -80,11 +77,10 @@ const char 
*TEMPLATE_PART_SWALLOW[TEMPLATE_PART_SWALLOW_LINE_CNT] =
    "      visible: 1;<br/>"
 };
 
-#define TEMPLATE_PART_SPACER_LINE_CNT 6
+#define TEMPLATE_PART_SPACER_LINE_CNT 5
 
 const char *TEMPLATE_PART_SPACER[TEMPLATE_PART_SPACER_LINE_CNT] =
 {
-   "   type: SPACER;<br/>",
    "   scale: 1;<br/>",
    "   desc { \"default\";<br/>",
    "      align: 0.5 0.5;<br/>",
@@ -92,11 +88,10 @@ const char 
*TEMPLATE_PART_SPACER[TEMPLATE_PART_SPACER_LINE_CNT] =
    "      min: 0 0;<br/>"
 };
 
-#define TEMPLATE_PART_TEXT_LINE_CNT 18
+#define TEMPLATE_PART_TEXT_LINE_CNT 17
 
 const char *TEMPLATE_PART_TEXT[TEMPLATE_PART_TEXT_LINE_CNT] =
 {
-   "   type: TEXT;<br/>",
    "   scale: 1;<br/>",
    "   effect: FAR_SOFT_SHADOW;<br/>",
    "   desc { \"default\";<br/>",
@@ -116,11 +111,10 @@ const char 
*TEMPLATE_PART_TEXT[TEMPLATE_PART_TEXT_LINE_CNT] =
    "      }<br/>"
 };
 
-#define TEMPLATE_PART_TEXTBLOCK_LINE_CNT 8
+#define TEMPLATE_PART_TEXTBLOCK_LINE_CNT 7
 
 const char *TEMPLATE_PART_TEXTBLOCK[TEMPLATE_PART_TEXTBLOCK_LINE_CNT] =
 {
-   "   type: TEXTBLOCK;<br/>",
    "   scale: 1;<br/>",
    "   desc { \"default\";<br/>",
    "      align: 0.5 0.5;<br/>",

-- 


Reply via email to