rimmed pushed a commit to branch master.

http://git.enlightenment.org/tools/eflete.git/commit/?id=c6f0365ae58e76babfeb68d7ff7be0eb104a2e57

commit c6f0365ae58e76babfeb68d7ff7be0eb104a2e57
Author: Mykola Solyanko <m.solya...@samsung.com>
Date:   Tue Nov 24 17:44:33 2015 +0200

    style_editor: transfer functionality to the property_style module
---
 data/themes/default/widgets/layouts/property.edc   |   59 +
 .../default/widgets/layouts/style_editor.edc       |    1 +
 src/bin/common/signals.h                           |    7 +
 src/bin/ui/editors/style_editor.c                  | 1312 +-------------------
 src/bin/ui/editors/style_editor.h                  |   10 +
 src/bin/ui/property_style.c                        | 1224 ++++++++++++++++--
 6 files changed, 1221 insertions(+), 1392 deletions(-)

diff --git a/data/themes/default/widgets/layouts/property.edc 
b/data/themes/default/widgets/layouts/property.edc
index 78bfe67..1c756b8 100644
--- a/data/themes/default/widgets/layouts/property.edc
+++ b/data/themes/default/widgets/layouts/property.edc
@@ -118,6 +118,65 @@ group { name: "elm/layout/property/1swallow_subtext";
    }
 }
 
+group { name: "elm/layout/property/1swallow_direction";
+   parts {
+      part { name: "area.base";
+         type: SPACER;
+         description { state: "default" 0.0;
+            min: 0 45;
+            max: -1 45;
+         }
+      }
+      part { name: "elm.text";
+         type: TEXT;
+         description { state: "default" 0.0;
+            color_class: "main";
+            align: 0.0 0.0;
+            rel1 {
+               to_y: "area.base";
+            }
+            rel2 {
+               relative: 0.4 1.0;
+               to_y: "area.base";
+            }
+            text {
+               font: "PT";
+               size: 12;
+               align: 0.0 0.5;
+            }
+         }
+      }
+      part { name: "spacer_direction";
+         type: SPACER;
+         description { state: "default" 0.0;
+            align: 0 0;
+            FIXED_SIZE(4, 45);
+            rel1 {
+               relative: 1.0 0.0;
+               to_x: "elm.text";
+               to_y: "elm.text";
+            }
+         }
+      }
+      part { name: "elm.swallow.content";
+         type: SWALLOW;
+         description { state: "default" 0.0;
+            align: 1.0 1.0;
+            rel1 {
+               relative: 1.0 0.0;
+               to_x: "spacer_direction";
+               to_y: "elm.text";
+            }
+            rel2 {
+               relative: 1.0 0.9;
+               to_x: "spacer_direction";
+               to_y: "area.base";
+            }
+         }
+      }
+   }
+}
+
 group { name: "elm/layout/property/2swallow";
    parts {
       part { name: "area.content";
diff --git a/data/themes/default/widgets/layouts/style_editor.edc 
b/data/themes/default/widgets/layouts/style_editor.edc
index b106ccb..93b559c 100644
--- a/data/themes/default/widgets/layouts/style_editor.edc
+++ b/data/themes/default/widgets/layouts/style_editor.edc
@@ -1613,6 +1613,7 @@ group { name: "elm/layout/style_editor/direction";
       part { name: "area.bg";
          type: SPACER;
          description { state: "default" 0.0;
+            align: 0.0 0.5;
             FIXED_SIZE(40, 40);
          }
       }
diff --git a/src/bin/common/signals.h b/src/bin/common/signals.h
index 2b73454..5d08ae7 100644
--- a/src/bin/common/signals.h
+++ b/src/bin/common/signals.h
@@ -288,5 +288,12 @@ typedef struct {
  */
 #define SIGNAL_STYLE_EDITOR_TAB_CLICKED "SIGNAL_STYLE_EDITOR_TAB_CLICKED"
 
+/**
+ * emited when style/styles in style editor is/are selected.
+ * eventinfo - NULL
+ *
+ * @ingroup Window
+ */
+#define SIGNAL_STYLE_SELECTED "SIGNAL_STYLE_SELECTED"
 
 #endif /* SIGNALS_H*/
diff --git a/src/bin/ui/editors/style_editor.c 
b/src/bin/ui/editors/style_editor.c
index 746efe6..c6b1001 100644
--- a/src/bin/ui/editors/style_editor.c
+++ b/src/bin/ui/editors/style_editor.c
@@ -37,14 +37,6 @@ typedef struct _Style_entries Style_Entries;
 typedef struct _Style_Editor Style_Editor;
 typedef struct _Search_Data Search_Data;
 
-typedef enum {
-   TAB_EDITOR_TEXT = 0,
-   TAB_EDITOR_FORMAT,
-   TAB_EDITOR_GLOW_SHADOW,
-   TAB_EDITOR_LINES,
-   TAB_LAST
-} Tabs_Style_Editor;
-
 struct _Search_Data
 {
    Evas_Object *search_entry;
@@ -53,22 +45,9 @@ struct _Search_Data
 
 struct _Style_Editor
 {
-   Evas_Object *mwin;
    Evas_Object *glist;
    Evas_Object *textblock_style;
    Evas_Object *entry_prev;
-   struct {
-      Evas_Object *layout;
-      Evas_Object *content;
-      Evas_Object *tabs;
-
-      Evas_Object *content_text;
-      Evas_Object *content_format;
-      Evas_Object *content_glow_shadow;
-      Evas_Object *content_lines;
-
-      Tabs_Style_Editor current_tab;
-   } prop;
    Search_Data style_search_data;
    struct {
       const char *st_name;
@@ -82,7 +61,6 @@ struct _Style_Editor
       Evas_Object *dialog;
    } popup;
    Elm_Object_Item *tag;
-   Evas_Object *direction[8];
 };
 
 struct _Style_Entries
@@ -103,139 +81,6 @@ struct _Style_Tag_Entries
 
 static Elm_Genlist_Item_Class *_itc_style = NULL;
 static Elm_Genlist_Item_Class *_itc_tags = NULL;
-static const char *font_styles[] = { N_("Normal"),
-                                     N_("Italic"),
-                                     N_("Oblique"),
-                                     NULL};
-
-static const char *font_width_list[] = { N_("Normal"),
-                                         N_("Ultracondensed"),
-                                         N_("Extracondensed"),
-                                         N_("Condensed"),
-                                         N_("Extracondensed"),
-                                         N_("Semicondensed"),
-                                         N_("Semiexpanded"),
-                                         N_("Expanded"),
-                                         N_("Ultraexpanded"),
-                                         NULL};
-
-static const char *font_weight_list[] = { N_("Normal"),
-                                          N_("Thin"),
-                                          N_("Ultralight"),
-                                          N_("Light"),
-                                          N_("Book"),
-                                          N_("Medium"),
-                                          N_("Semibold"),
-                                          N_("Bold"),
-                                          N_("Ultrabold"),
-                                          N_("Black"),
-                                          N_("Extrablack"),
-                                          NULL};
-
-static const char *style_table[][2] = {{"font", NULL},
-                                       {"font_fallback", NULL},
-                                       {"font_size", NULL},
-                                       {"font_source", NULL},
-                                       {"font_weight", NULL},
-                                       {"font_style", NULL},
-                                       {"font_width", NULL},
-                                       {"lang", NULL},
-                                       {"color", NULL},
-                                       {"underline_color", NULL},
-                                       {"underline2_color", NULL},
-                                       {"underline_dash_color", NULL},
-                                       {"outline_color", NULL},
-                                       {"shadow_color", NULL},
-                                       {"glow_color", NULL},
-                                       {"glow2_color", NULL},
-                                       {"backing_color", NULL},
-                                       {"strikethrough_color", NULL},
-                                       {"align", NULL},
-                                       {"valign", NULL},
-                                       {"wrap", NULL},
-                                       {"left_margin", NULL},
-                                       {"right_margin", NULL},
-                                       {"underline", NULL},
-                                       {"strikethrough", NULL},
-                                       {"backing", NULL},
-                                       {"style", NULL},
-                                       {"tabstops", NULL},
-                                       {"linesize", NULL},
-                                       {"linerelsize", NULL},
-                                       {"linegap", NULL},
-                                       {"linerelgap", NULL},
-                                       {"item", NULL},
-                                       {"linefill", NULL},
-                                       {"ellipsis", NULL},
-                                       {"password", NULL},
-                                       {"underline_dash_width", NULL},
-                                       {"underline_dash_gap", NULL},
-                                       {NULL, NULL},
-                                       {"direction", NULL}};
-/*
-TODO("<number>, <number>% for align")
-static const char *font_horizontal_align[] = { N_("auto"),
-                                               N_("center"),
-                                               N_("middle"),
-                                               N_("left"),
-                                               N_("right"),
-                                               NULL};
-
-TODO("<number>, <number>% for align")
-static const char *font_horizontal_valign[] = { N_("top"),
-                                                N_("bottom"),
-                                                N_("middle"),
-                                                N_("center"),
-                                                N_("baseline"),
-                                                N_("base"),
-                                                NULL};
-*/
-/*
-static const char *font_glow_list[] = { N_("none"),
-                                        N_("plain"),
-                                        N_("shadow"),
-                                        N_("outline"),
-                                        N_("soft_outline"),
-                                        N_("outline_shadow"),
-                                        N_("outline_soft_shadow"),
-                                        N_("glow"),
-                                        N_("shadow"),
-                                        N_("far_shadow"),
-                                        N_("soft_shadow"),
-                                        N_("far_soft_shadow"),
-                                        NULL};
-
-static const char *direction_list[] = { N_("bottom_left"),
-                                        N_("bottom"),
-                                        N_("bottom_right"),
-                                        N_("left"),
-                                        N_("right"),
-                                        N_("top_left"),
-                                        N_("top"),
-                                        N_("top_right"),
-                                        NULL};
-*/
-static const char *underl_styles[] = { N_("single"),
-                                       N_("double"),
-                                       NULL};
-static Eina_Tmpstr*
-_tag_value_get(const char* text_style, char* a_tag);
-
-
-static void
-_text_tab_update(Style_Editor *style_edit, Evas_Object *tabs, const char 
*value);
-
-/*
-static void
-_format_tab_update(Style_Editor *style_edit, Evas_Object *tabs, const char 
*value);
-*/
-
-/*
-static void
-_glow_tab_update(Style_Editor *style_edit, Evas_Object *tabs, const char 
*value);
-*/
-static void
-_lines_tab_update(Style_Editor *style_edit, Evas_Object *tabs, const char 
*value);
 
 static void
 _on_popup_bt_cancel(void *data,
@@ -254,40 +99,6 @@ _on_popup_bt_cancel(void *data,
 }
 
 static void
-_style_edit_update(Style_Editor *style_edit)
-{
-   Evas_Textblock_Style *ts = NULL;
-   Eina_Strbuf *style = eina_strbuf_new();
-
-   assert(style_edit != NULL);
-
-   eina_strbuf_append(style, FONT_DEFAULT);
-   eina_strbuf_append(style, CURRENT.stvalue);
-   eina_strbuf_append(style, "'");
-   ts = evas_textblock_style_new();
-   evas_textblock_style_set(ts, eina_strbuf_string_get(style));
-   evas_object_textblock_style_set(style_edit->textblock_style, ts);
-   evas_object_size_hint_max_set(style_edit->textblock_style, EVAS_HINT_FILL,
-                                 EVAS_HINT_FILL);
-   eina_strbuf_free(style);
-   evas_textblock_style_free(ts);
-}
-
-#define TAB_UPDATE(VALUE) \
-static void \
-_##VALUE##_update(Style_Editor *style_edit) \
-{ \
-   assert(style_edit != NULL); \
-   _##VALUE##_tab_update(style_edit, style_edit->prop.tabs, CURRENT.stvalue); \
-}
-/*
-TAB_UPDATE(glow)
-*/
-TAB_UPDATE(lines)
-
-#undef TAB_UPDATE
-
-static void
 _on_glit_selected(void *data,
                   Evas_Object *obj __UNUSED__,
                   void *event_info)
@@ -300,16 +111,19 @@ _on_glit_selected(void *data,
    const char *tag, *value = NULL;
    Evas_Textblock_Style *ts = NULL;
 
-   Eina_Strbuf *style = eina_strbuf_new();
-   eina_strbuf_append(style, FONT_DEFAULT);
-
    Style_Editor *style_edit = (Style_Editor *)data;
-
    assert(style_edit != NULL);
 
    Elm_Object_Item *glit = (Elm_Object_Item *)event_info;
+
+   Eina_Strbuf *style = eina_strbuf_new();
+   eina_strbuf_append(style, FONT_DEFAULT);
+
    Elm_Object_Item *glit_parent = elm_genlist_item_parent_get(glit);
 
+   Style_Data *current_style = (Style_Data *)mem_malloc(sizeof(Style_Data));
+   memset(current_style, 0x0, sizeof(Style_Data));
+
    edje_edit_obj = ap.project->global_object;
 
    if (!glit_parent)
@@ -332,26 +146,19 @@ _on_glit_selected(void *data,
         value = edje_edit_style_tag_value_get(edje_edit_obj, style_name, tag);
         eina_strbuf_append(style, value);
      }
-   CURRENT.st_name = style_name;
-   CURRENT.st_tag = tag;
-   CURRENT.stvalue = eina_stringshare_add(value);
 
-   evas_object_del(style_edit->prop.content_text);
-   evas_object_del(style_edit->prop.content_format);
-   evas_object_del(style_edit->prop.content_glow_shadow);
-   evas_object_del(style_edit->prop.content_lines);
-
-   if (!glit_parent)
+   current_style->st_name = style_name;
+   current_style->st_tag = tag;
+   current_style->stvalue = eina_stringshare_add(value);
+   current_style->style = style;
+   current_style->textblock_style = style_edit->textblock_style;
+   if (!elm_genlist_item_parent_get(glit))
      {
         elm_object_signal_emit(style_edit->entry_prev, "entry,hide", "eflete");
+        current_style->is_parent_item = EINA_TRUE;
      }
    else
      {
-        _text_tab_update(style_edit, NULL /*style_edit->prop.tabs*/, 
eina_strbuf_string_get(style));
-        //_format_tab_update(style_edit, NULL /*style_edit->prop.tabs*/, 
eina_strbuf_string_get(style));
-        //_glow_tab_update(style_edit, NULL /*style_edit->prop.tabs*/, 
eina_strbuf_string_get(style));
-        //_lines_tab_update(style_edit, NULL /*style_edit->prop.tabs*/, 
eina_strbuf_string_get(style));
-
         elm_object_signal_emit(style_edit->entry_prev, "entry,show", "eflete");
         eina_strbuf_append(style, "'");
         ts = evas_textblock_style_new();
@@ -361,7 +168,7 @@ _on_glit_selected(void *data,
                                       EVAS_HINT_FILL);
         evas_textblock_style_free(ts);
      }
-   eina_strbuf_free(style);
+   evas_object_smart_callback_call(ap.win, SIGNAL_STYLE_SELECTED, 
current_style);
 }
 
 static void
@@ -963,1033 +770,6 @@ _change_bg_cb(void *data,
    elm_object_part_content_set(style_edit->entry_prev, "background", bg);
 }
 
-static void
-_entry_repch_update(Style_Editor *style_edit, Eina_Bool password)
-{
-   assert(style_edit != NULL);
-
-   if (password)
-     evas_object_textblock_replace_char_set(style_edit->textblock_style, "*");
-   else
-     evas_object_textblock_replace_char_set(style_edit->textblock_style, NULL);
-}
-
-static void
-_tag_parse(Style_Editor *style_edit, const char *value, const char *text)
-{
-   Evas_Object *edje_edit_obj = NULL;
-   Eina_Strbuf *tag = eina_strbuf_new();
-   char *stolen_buf;
-   char *token;
-   int i = 0, k = 0, exist = 0, style_length = 0;
-
-   assert(style_edit != NULL);
-   assert(value != NULL);
-   assert(text != NULL);
-
-   eina_strbuf_append(tag, CURRENT.stvalue);
-   edje_edit_obj = ap.project->global_object;
-   stolen_buf = eina_strbuf_string_steal(tag);
-   token = strtok(stolen_buf, " =+");
-   while (token)
-     {
-        if ((i + 1) % 2 != 0)
-          {
-             for (k = 0; style_table[k][0] != NULL; k++)
-               {
-                  if (!strcmp(style_table[k][0], token)) exist = k;
-               }
-          }
-        else if (strstr(token, "shadow"))
-          {
-             style_table[DIRECTION_NUM][1] = 
eina_stringshare_add(strchr(token, ','));
-             style_length = (int)(strlen(token) - 
strlen(style_table[DIRECTION_NUM][1]));
-             style_table[exist][1] = eina_stringshare_add_length(token, 
style_length);
-          }
-        else
-          {
-             style_table[exist][1] = eina_stringshare_add(token);
-          }
-        token= strtok(NULL, " =+");
-        i++;
-     }
-   free(stolen_buf);
-   if (!strcmp(text, "password"))
-     _entry_repch_update(style_edit, !strcmp(value, "on"));
-
-   if (!strcmp(text, "direction"))
-     {
-        if (style_table[DIRECTION_NUM][1]) 
eina_stringshare_del(style_table[DIRECTION_NUM][1]);
-        style_table[DIRECTION_NUM][1] = eina_stringshare_printf(",%s", value);
-     }
-   else
-     {
-        for (k = 0; style_table[k][0] != NULL; k++)
-          {
-             if (!strcmp(style_table[k][0], text))
-               {
-                  eina_stringshare_del(style_table[k][1]);
-                  style_table[k][1] = eina_stringshare_add(value);
-               }
-          }
-     }
-   if ((!strcmp(text, "style")) && (!style_table[DIRECTION_NUM][1]))
-     style_table[DIRECTION_NUM][1] = eina_stringshare_add(",bottom_right");
-   eina_strbuf_append(tag, "+ ");
-   for (k = 0; style_table[k][0] != NULL; k++)
-      {
-         if ((style_table[k][1] != NULL) && (!strstr(style_table[k][1], 
"shadow")))
-           {
-              eina_strbuf_append(tag, style_table[k][0]);
-              eina_strbuf_append(tag, "=");
-              eina_strbuf_append(tag, style_table[k][1]);
-              eina_strbuf_append(tag, " ");
-              eina_stringshare_del(style_table[k][1]);
-              style_table[k][1] = NULL;
-           }
-         else if ((style_table[k][1] != NULL) && (strstr(style_table[k][1], 
"shadow")))
-           {
-              eina_strbuf_append(tag, style_table[k][0]);
-              eina_strbuf_append(tag, "=");
-              eina_strbuf_append(tag, style_table[k][1]);
-              eina_strbuf_append(tag, style_table[DIRECTION_NUM][1]);
-              eina_strbuf_append(tag, " ");
-              eina_stringshare_del(style_table[k][1]);
-              style_table[k][1] = NULL;
-           }
-      }
-   edje_edit_style_tag_value_set(edje_edit_obj, CURRENT.st_name,
-                                 CURRENT.st_tag, eina_strbuf_string_get(tag));
-   eina_stringshare_del(CURRENT.stvalue);
-   CURRENT.stvalue = eina_stringshare_add(eina_strbuf_string_get(tag));
-   eina_strbuf_free(tag);
-}
-
-static void
-_lines_colors_update(Style_Editor *style_edit, const char *param)
-{
-   Eina_Tmpstr *val;
-
-   assert(style_edit != NULL);
-   assert(param != NULL);
-
-   if (!strcmp(param, "underline"))
-     {
-        _lines_update(style_edit);
-        val = _tag_value_get(style_edit->current_style.stvalue, 
"underline_color");
-        if (!val) _tag_parse(style_edit, WHITE_COLOR, "underline_color");
-        else eina_tmpstr_del(val);
-
-        val = _tag_value_get(style_edit->current_style.stvalue, 
"underline2_color");
-        if (!val) _tag_parse(style_edit, WHITE_COLOR, "underline2_color");
-        else eina_tmpstr_del(val);
-     }
-   else if (!strcmp(param, "strikethrough"))
-     {
-        val = _tag_value_get(style_edit->current_style.stvalue, 
"strikethrough_color");
-        if (!val) _tag_parse(style_edit, WHITE_COLOR, "strikethrough_color");
-        else eina_tmpstr_del(val);
-     }
-}
-
-#define COMBOBOX_VALUE \
-Ewe_Combobox_Item *item = ei; \
-const char *value; \
-value = eina_stringshare_add(item->title);
-
-#define SEGMENT_VALUE \
-Elm_Object_Item *item = ei; \
-const char *value; \
-value = eina_stringshare_add(elm_object_item_part_text_get(item, "elm.text"));
-
-#define SPINNER_VALUE \
-const char *value = NULL; \
-if (!ei) \
-  { \
-     value = eina_stringshare_printf("%f", elm_spinner_value_get(obj)); \
-  }
-
-#define PERCENT_SPINNER_VALUE \
-const char *value = NULL; \
-if (!ei) \
-  { \
-     value = eina_stringshare_printf("%f", elm_spinner_value_get(obj)/100); \
-  }
-
-#define CHECK_VALUE \
-Evas_Object *check = obj; \
-const char *value = NULL; \
-if (elm_check_state_get(check)) value = eina_stringshare_add("on"); \
-else value = eina_stringshare_add("off");
-
-#define CHANGE_CALLBACK(VALUE, TEXT, WIDGET, FUNC) \
-static void \
-_on_##VALUE##_change(void *data, \
-                     Evas_Object *obj EINA_UNUSED, \
-                     void *ei EINA_UNUSED) \
-{ \
-   Style_Editor *style_edit = (Style_Editor *)data; \
-   assert(style_edit != NULL); \
-   WIDGET##_VALUE \
-   _tag_parse(style_edit, value, TEXT); \
-   FUNC; \
-   _lines_colors_update(style_edit, TEXT); \
-   _style_edit_update(style_edit); \
-   eina_stringshare_del(value); \
-   /*project_changed(false);*/ \
-}
-
-#define ITEM_COLOR_ADD(VALUE, TAG, TEXT) \
-static void \
-_on_##VALUE##_change(void *data, \
-                     Evas_Object *obj, \
-                     void *ei __UNUSED__) \
-{ \
-   int r, g, b, a; \
-   const char *value; \
-   Style_Editor *style_edit = (Style_Editor *)data; \
-   assert(style_edit != NULL); \
-   Evas_Object *color, *rect; \
-   color = evas_object_data_get(obj, "color"); \
-   colorselector_color_get(obj, &r, &g, &b, &a); \
-   value = eina_stringshare_printf("#%02x%02x%02x%02x", r, g, b, a); \
-   _tag_parse(style_edit, value, TAG); \
-   rect = elm_object_part_content_get(color, "elm.swallow.content"); \
-   evas_object_color_set(rect, r*a/255, g*a/255, b*a/255, a); \
-   _style_edit_update(style_edit); \
-   eina_stringshare_del(value); \
-} \
-static void \
-_on_##VALUE##_dismissed(void *data, \
-                        Evas_Object *obj, \
-                        void *event_info __UNUSED__) \
-{ \
-   Style_Editor *style_edit = (Style_Editor *)data; \
-   assert(style_edit != NULL); \
-   evas_object_smart_callback_del_full(obj, "color,changed", \
-                                      _on_##VALUE##_change, style_edit); \
-   evas_object_smart_callback_del_full(obj, "palette,item,selected", \
-                                       _on_##VALUE##_change, style_edit); \
-   evas_object_data_del(obj, "color"); \
-   evas_object_hide(obj); \
-} \
-static void \
-_on_##VALUE##_clicked(void *data, \
-                      Evas *e __UNUSED__, \
-                      Evas_Object *obj, \
-                      void *event_info __UNUSED__) \
-{ \
-   int x, y; \
-   int r, g, b, a; \
-   Style_Editor *style_edit = (Style_Editor *)data; \
-   assert(style_edit != NULL); \
-   Evas_Object *colorsel, *rect; \
-   colorsel = colorselector_get(); \
-   evas_object_data_set(colorsel, "color", obj); \
-   rect = elm_object_part_content_get(obj, "elm.swallow.content"); \
-   evas_object_color_get(rect, &r, &g, &b, &a); \
-   colorselector_color_set(colorsel, r, g, b, a); \
-   evas_object_smart_callback_add(colorsel, "color,changed", \
-                                  _on_##VALUE##_change, style_edit); \
-   evas_object_smart_callback_add(colorsel, "palette,item,selected", \
-                                  _on_##VALUE##_change, style_edit); \
-   evas_object_smart_callback_add(colorsel, "dismissed", \
-                                  _on_##VALUE##_dismissed, style_edit); \
-   evas_pointer_canvas_xy_get(evas_object_evas_get(obj), &x, &y); \
-   evas_object_move(colorsel, x, y); \
-   evas_object_show(colorsel); \
-} \
-static Evas_Object * \
-_style_item_##VALUE##_add(Evas_Object *layout, Style_Editor *style_edit) \
-{ \
-   Evas_Object *color, *rect; \
-   assert(layout != NULL); \
-   assert(style_edit != NULL); \
-   color = elm_layout_add(layout); \
-   elm_layout_file_set(color, EFLETE_EDJ, "eflete/style/color"); \
-   evas_object_size_hint_weight_set(color, EVAS_HINT_EXPAND, 
EVAS_HINT_EXPAND); \
-   evas_object_size_hint_align_set(color, EVAS_HINT_FILL, EVAS_HINT_FILL); \
-   rect = evas_object_rectangle_add(evas_object_evas_get(layout)); \
-   evas_object_event_callback_add(color, EVAS_CALLBACK_MOUSE_DOWN, \
-                                  _on_##VALUE##_clicked, style_edit); \
-   evas_object_color_set(rect, 0, 0, 0, 255); \
-   elm_object_part_content_set(color, "elm.swallow.content", rect); \
-   elm_object_part_content_set(layout, "swallow."TEXT, color); \
-   return rect; \
-}
-
-#define MIN_SP - 1.0
-#define MARGIN_MIN_SP 0.0
-#define MAX_SP 9999.0
-#define MAX_PERCENT 100.0
-#define STEP_SP 1.0
-
-#define COMBO_ADD(VALUE) \
-EWE_COMBOBOX_ADD(ap.win, widget); \
-evas_object_smart_callback_add(widget, "selected", _on_##VALUE##_change, 
style_edit);
-
-#define STYLE_ADD(VALUE) \
-int i = 0; \
-SEGMENT_CONTROL_ADD(layout, widget); \
-elm_object_style_set(layout, "style_editor"); \
-for (i = 0; font_styles[i] != NULL; i++) \
-elm_segment_control_item_add(widget, NULL, font_styles[i]); \
-evas_object_smart_callback_add(widget, "changed", _on_##VALUE##_change, 
style_edit); \
-evas_object_smart_callback_del(widget, "changed", _on_##VALUE##_change);
-
-#define UNDERLINE_ADD(VALUE) \
-int i = 0; \
-SEGMENT_CONTROL_ADD(layout, widget); \
-elm_object_style_set(layout, "style_editor"); \
-for (i = 0; underl_styles[i] != NULL; i++) \
-elm_segment_control_item_add(widget, NULL, underl_styles[i]); \
-evas_object_smart_callback_add(widget, "changed", _on_##VALUE##_change, 
style_edit); \
-evas_object_smart_callback_del(widget, "changed", _on_##VALUE##_change);
-
-#define SPIN_ADD(VALUE) \
-SPINNER_ADD(layout, widget, MIN_SP, MAX_SP, STEP_SP, true); \
-evas_object_smart_callback_add(widget, "changed", _on_##VALUE##_change, 
style_edit);
-
-#define MARGIN_SPIN_ADD(VALUE) \
-SPINNER_ADD(layout, widget, MARGIN_MIN_SP, MAX_SP, STEP_SP, true); \
-evas_object_smart_callback_add(widget, "changed", _on_##VALUE##_change, 
style_edit);
-
-#define CHK_ADD(VALUE) \
-CHECK_ADD(layout, widget); \
-evas_object_smart_callback_add(widget, "changed", _on_##VALUE##_change, 
style_edit);
-
-#define ELLIPSIS_ADD(VALUE) \
-SPINNER_ADD(layout, widget, MIN_SP, MAX_PERCENT, STEP_SP, true); \
-evas_object_smart_callback_add(widget, "changed", _on_##VALUE##_change, 
style_edit);
-
-#define ITEM_TEXT_ADD(SWALLOW, VALUE, WIDGET) \
-static Evas_Object * \
-_style_item_##VALUE##_add(Evas_Object *layout, Style_Editor *style_edit) \
-{ \
-   Evas_Object *widget; \
-\
-   assert(layout != NULL); \
-   assert(style_edit != NULL); \
-\
-   WIDGET##_ADD(VALUE) \
-\
-   elm_object_part_content_set(layout, "swallow."SWALLOW, widget); \
-   return widget; \
-}
-
-#define DIRECT_ADD(VALUE, TEXT, STYLE, VAL) \
-static void \
-_on_##VALUE##_select_direction(void *data, \
-                              Evas_Object *obj __UNUSED__, \
-                              void *event_info __UNUSED__) \
-{ \
-   Style_Editor *st = data; \
-   assert(st != NULL); \
-   style_table[DIRECTION_NUM][1] = eina_stringshare_add(TEXT); \
-   _tag_parse(st, TEXT, "direction"); \
-   _style_edit_update(st); \
-} \
-static Evas_Object * \
-_direction_item_##VALUE##_add(Evas_Object *item, Style_Editor *style_edit) \
-{ \
-   Evas_Object *widget; \
-\
-   assert(style_edit != NULL); \
-   RADIO_ADD(item, widget, VAL, ""); \
-   elm_object_style_set(widget, STYLE); \
-   elm_object_part_content_set(item, "swallow."TEXT, widget); \
-   evas_object_smart_callback_add(widget, "focused", 
_on_##VALUE##_select_direction, style_edit); \
-   return widget; \
-}
-
-/*
-DIRECT_ADD(bl,"bottom_left", "bl", 0)
-DIRECT_ADD(b, "bottom", "b", 1)
-DIRECT_ADD(br, "bottom_right", "br", 2)
-DIRECT_ADD(l, "left", "l", 3)
-DIRECT_ADD(r, "right", "r", 4)
-DIRECT_ADD(tl, "top_left", "tl", 5)
-DIRECT_ADD(t, "top", "t", 6)
-DIRECT_ADD(tr, "top_right", "tr", 7)
-*/
-static Eina_Tmpstr*
-_tag_value_get(const char* text_style, char* a_tag)
-{
-   assert(text_style != NULL);
-   assert(a_tag != NULL);
-
-   char *tag_list_copy = mem_malloc(strlen(text_style) + 1);
-   Eina_Tmpstr *result = NULL;
-   char *token;
-
-   strcpy(tag_list_copy, text_style);
-   token = strtok(tag_list_copy, " ");
-   while (token)
-     {
-        char* equals_sign = strchr(token, '=');
-        if (equals_sign)
-          {
-             *equals_sign = 0;
-             if (!strcmp(token, a_tag))
-               {
-                  equals_sign++;
-                  result = eina_tmpstr_add(equals_sign);
-                  if (!strstr(FONT_DEFAULT, a_tag)) break;
-               }
-          }
-        token = strtok(0, " ");
-     }
-   free(tag_list_copy);
-
-   return result;
-}
-
-static Eina_Bool
-_hex_to_rgb(const char *hex, int *r, int *g, int *b, int *a)
-{
-   assert(hex != NULL);
-   assert(r != NULL);
-   assert(g != NULL);
-   assert(b != NULL);
-   assert(a != NULL);
-
-   unsigned long val;
-   char *end;
-   int length = (int)strlen(hex);
-   switch (length)
-     {
-      case 7:
-        {
-           val = strtoul(hex + 1, &end, 16);
-           *r = (val & 0xff0000) >> 16;
-           *g = (val & 0xff00) >> 8;
-           *b = val & 0xff;
-           *a = 255;
-           break;
-        }
-      case 9:
-        {
-           val = strtoul(hex + 1, &end, 16);
-           *r = (val & 0xff000000) >> 24;
-           *g = (val & 0xff0000) >> 16;
-           *b = (val & 0xff00) >> 8;
-           *a = val & 0xff;
-           break;
-        }
-      case 5:
-        {
-           val = strtoul(hex + 1, &end, 16);
-           *r = (val & 0xf000) >> 12;
-           *g = (val & 0xf00) >> 8;
-           *b = (val & 0xf0) >> 4;
-           *a = val & 0xf;
-           *r = (*r << 4) | *r;
-           *g = (*g << 4) | *g;
-           *b = (*b << 4) | *b;
-           *a = (*a << 4) | *a;
-           break;
-        }
-      case 4:
-        {
-           val = strtoul(hex + 1, &end, 16);
-           *r = (val & 0xf00) >> 8;
-           *g = (val & 0xf0) >> 4;
-           *b = val & 0xf;
-           *a = 255;
-           *r = (*r << 4) | *r;
-           *g = (*g << 4) | *g;
-           *b = (*b << 4) | *b;
-           break;
-        }
-      default:
-        {
-           *r = 0;
-           *g = 0;
-           *b = 0;
-           *a = 255;
-        }
-     }
-   return true;
-}
-
-CHANGE_CALLBACK(fonts_list, "font", COMBOBOX, NULL)
-CHANGE_CALLBACK(font_size, "font_size", SPINNER, NULL)
-CHANGE_CALLBACK(font_style, "font_style", SEGMENT, NULL)
-CHANGE_CALLBACK(font_width, "font_width", COMBOBOX, NULL)
-CHANGE_CALLBACK(font_weight, "font_weight", COMBOBOX, NULL)
-/*
-CHANGE_CALLBACK(font_align, "align", COMBOBOX, NULL)
-CHANGE_CALLBACK(lmargin, "left_margin", SPINNER, NULL)
-CHANGE_CALLBACK(font_valign, "valign", COMBOBOX, NULL)
-CHANGE_CALLBACK(rmargin, "right_margin", SPINNER, NULL)
-CHANGE_CALLBACK(text_tabstops, "tabstops", SPINNER, NULL)
-CHANGE_CALLBACK(line_size, "linesize", SPINNER, NULL)
-CHANGE_CALLBACK(rel_size, "linerelsize", SPINNER, NULL)
-CHANGE_CALLBACK(font_password, "password", CHECK, NULL)
-CHANGE_CALLBACK(font_background, "backing", CHECK, NULL)
-CHANGE_CALLBACK(font_ellipsis, "ellipsis", PERCENT_SPINNER, NULL)
-CHANGE_CALLBACK(style, "style", COMBOBOX, _glow_update(style_edit))
-*/
-CHANGE_CALLBACK(strikethrough, "strikethrough", CHECK, NULL)
-CHANGE_CALLBACK(underline, "underline", CHECK, NULL)
-CHANGE_CALLBACK(underline_style, "underline", SEGMENT, NULL)
-
-ITEM_TEXT_ADD("font", fonts_list, COMBO)
-ITEM_TEXT_ADD("size", font_size, SPIN)
-ITEM_TEXT_ADD("width", font_width, COMBO)
-ITEM_TEXT_ADD("style", font_style, STYLE)
-ITEM_TEXT_ADD("weight", font_weight, COMBO)
-ITEM_COLOR_ADD(text_color, "color", "color")
-/*
-ITEM_TEXT_ADD("align", font_align, COMBO)
-ITEM_TEXT_ADD("lmargin", lmargin, MARGIN_SPIN)
-ITEM_TEXT_ADD("valign", font_valign, COMBO)
-ITEM_TEXT_ADD("rmargin", rmargin, MARGIN_SPIN)
-ITEM_TEXT_ADD("tabstops", text_tabstops, SPIN)
-ITEM_TEXT_ADD("line_size", line_size, SPIN)
-ITEM_TEXT_ADD("rel_size", rel_size, SPIN)
-ITEM_TEXT_ADD("password", font_password, CHK)
-ITEM_TEXT_ADD("background", font_background, CHK)
-*/
-/*
-ITEM_COLOR_ADD(font_backcolor, "backing_color", "backing_color")
-ITEM_TEXT_ADD("ellipsis", font_ellipsis, ELLIPSIS)
-ITEM_TEXT_ADD("style", style, COMBO)
-ITEM_COLOR_ADD(inner_glow, "glow_color", "glow_color")
-ITEM_COLOR_ADD(outer_glow, "glow2_color", "glow2_color")
-ITEM_COLOR_ADD(shadow_color, "shadow_color", "glow_color")
-*/
-ITEM_TEXT_ADD("strikethru", strikethrough, CHK)
-ITEM_TEXT_ADD("underl", underline, CHK)
-ITEM_TEXT_ADD("underline", underline_style, UNDERLINE)
-ITEM_COLOR_ADD(strikethrough_color, "strikethrough_color", "strikethrough")
-ITEM_COLOR_ADD(underline_color, "underline_color", "underline_color")
-ITEM_COLOR_ADD(underline2_color, "underline2_color", "underline2_color")
-
-static void
-_text_tab_update(Style_Editor *style_edit, Evas_Object *tabs __UNUSED__, const 
char *value)
-{
-   Evas_Object *layout;
-   Evas_Object *fonts_list, *font_size;
-   Evas_Object *font_weight;
-   Evas_Object *font_width, *font_style;
-   Evas_Object *text_color;
-   Elm_Object_Item *sc_item;
-   int r, g, b, a;
-   unsigned int i = 0;
-   Evas_Object *scr;
-   Eina_Bool flag = false;
-
-   assert(style_edit != NULL);
-   //assert(tabs != NULL);
-
-   SCROLLER_ADD(ap.win, scr);
-   elm_scroller_policy_set(scr, ELM_SCROLLER_POLICY_AUTO, 
ELM_SCROLLER_POLICY_AUTO);
-
-   layout = elm_layout_add(ap.win);
-   evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, 
EVAS_HINT_EXPAND);
-   elm_layout_theme_set(layout, "layout", "style_editor", "text");
-   evas_object_show(layout);
-   elm_object_content_set(scr, layout);
-
-   style_edit->prop.content_text = scr;
-
-   elm_object_part_text_set(layout, "label.font", _("Font name:"));
-   elm_object_part_text_set(layout, "label.style", _("Font style:"));
-   elm_object_part_text_set(layout, "label.color", _("Color:"));
-   elm_object_part_text_set(layout, "label.start", _("size"));
-   elm_object_part_text_set(layout, "label.end", _("px"));
-   fonts_list = _style_item_fonts_list_add(layout, style_edit);
-   font_size = _style_item_font_size_add(layout, style_edit);
-   font_style = _style_item_font_style_add(layout, style_edit);
-   font_weight = _style_item_font_weight_add(layout, style_edit);
-   font_width = _style_item_font_width_add(layout, style_edit);
-   text_color = _style_item_text_color_add(layout, style_edit);
-
-   if (value)
-     {
-        Eina_Tmpstr *font = _tag_value_get(value, "font");
-        if (!font) font = eina_tmpstr_add("");
-        Eina_Tmpstr *spin_val = _tag_value_get(value, "font_size");
-        if (!spin_val) spin_val = eina_tmpstr_add("");
-        Eina_Tmpstr *weight = _tag_value_get(value, "font_weight");
-        if (!weight) weight = eina_tmpstr_add("Normal");
-        Eina_Tmpstr *width = _tag_value_get(value, "font_width");
-        if (!width) width = eina_tmpstr_add("Normal");
-        Eina_Tmpstr *style = _tag_value_get(value, "font_style");
-        if (!style) style = eina_tmpstr_add("Normal");
-        Eina_Tmpstr *color = _tag_value_get(value, "color");
-
-        ewe_combobox_text_set(fonts_list, font);
-        elm_object_disabled_set(fonts_list, true);
-        elm_spinner_value_set(font_size, atof(spin_val));
-        ewe_combobox_text_set(font_width, width);
-        for (i = 0; font_width_list[i] != NULL; i++)
-          ewe_combobox_item_add(font_width, font_width_list[i]);
-        ewe_combobox_text_set(font_weight, weight);
-        for (i = 0; font_weight_list[i] != NULL; i++)
-          ewe_combobox_item_add(font_weight, font_weight_list[i]);
-        for (i = 0; font_styles[i] != NULL; i++)
-          {
-             if (!strcmp(elm_segment_control_item_label_get(font_style, i), 
style))
-               {
-                  sc_item = elm_segment_control_item_get(font_style, i);
-                  elm_segment_control_item_selected_set(sc_item, true);
-                  if (flag == true)
-                    evas_object_smart_callback_add(font_style, "changed", 
_on_font_style_change, style_edit);
-                  else flag = true;
-               }
-          }
-        if (!_hex_to_rgb(color, &r, &g, &b, &a))
-          {
-             ERR("Can't convert color value");
-             abort();
-          }
-        evas_object_color_set(text_color, r*a/255, g*a/255, b*a/255, a);
-
-        eina_tmpstr_del(font);
-        eina_tmpstr_del(spin_val);
-        eina_tmpstr_del(color);
-        eina_tmpstr_del(weight);
-        eina_tmpstr_del(width);
-        eina_tmpstr_del(style);
-     }
-
-   if (style_edit->prop.current_tab == TAB_EDITOR_TEXT)
-     elm_layout_content_set(style_edit->prop.content, NULL, scr);
-}
-
-/*
-static void
-_format_tab_update(Style_Editor *style_edit, Evas_Object *tabs, const char 
*value)
-{
-   Evas_Object *box_frames, *frame1, *frame2, *layout1, *layout2;
-   Evas_Object *font_align, *font_lmargin, *font_valign,  *font_rmargin;
-   Evas_Object *text_tabstops, *line_size, *rel_size;
-   Evas_Object *font_password, *font_background, *font_backcolor, 
*font_ellipsis;
-   Eina_Bool pass, bg;
-   int r, g, b, a;
-   unsigned int i = 0;
-
-   assert(style_edit != NULL);
-   //assert(tabs != NULL);
-
-   Evas_Object *scr;
-   SCROLLER_ADD(ap.win, scr);
-   elm_scroller_policy_set(scr, ELM_SCROLLER_POLICY_AUTO, 
ELM_SCROLLER_POLICY_AUTO);
-   BOX_ADD(scr, box_frames, EINA_FALSE, EINA_FALSE)
-   elm_box_align_set(box_frames, 0.5, 0.0);
-   elm_object_content_set(scr, box_frames);
-
-   style_edit->prop.content_format = scr;
-
-   FRAME_ADD(box_frames, frame1, false, _("Positioning option"))
-   evas_object_size_hint_weight_set(frame1, EVAS_HINT_EXPAND, 
EVAS_HINT_EXPAND);
-   evas_object_size_hint_align_set(frame1, EVAS_HINT_FILL, EVAS_HINT_FILL);
-   layout1 = elm_layout_add(frame1);
-   elm_layout_theme_set(layout1, "layout", "style_editor", "format1");
-   evas_object_size_hint_weight_set(layout1, EVAS_HINT_EXPAND, 
EVAS_HINT_EXPAND);
-   evas_object_size_hint_align_set(layout1, EVAS_HINT_FILL, EVAS_HINT_FILL);
-   evas_object_show(layout1);
-   elm_object_content_set(frame1, layout1);
-
-   elm_object_part_text_set(layout1, "label.align", _("Horizontal align:"));
-   elm_object_part_text_set(layout1, "label.valign", _("Vertical align:"));
-   elm_object_part_text_set(layout1, "label.after1", _("%"));
-   elm_object_part_text_set(layout1, "label.after2", _("%"));
-   elm_object_part_text_set(layout1, "label.start1", _("Margin:"));
-   elm_object_part_text_set(layout1, "label.left1", _("left"));
-   elm_object_part_text_set(layout1, "label.left2", _("right"));
-   elm_object_part_text_set(layout1, "label.end1", _("px"));
-   elm_object_part_text_set(layout1, "label.end2", _("px"));
-
-   font_align = _style_item_font_align_add(layout1, style_edit);
-   font_lmargin = _style_item_lmargin_add(layout1, style_edit);
-   font_valign = _style_item_font_valign_add(layout1, style_edit);
-   font_rmargin = _style_item_rmargin_add(layout1, style_edit);
-
-   if (value)
-     {
-        Eina_Tmpstr *align = _tag_value_get(value, "align");
-        if (!align) align = eina_tmpstr_add("auto");
-        Eina_Tmpstr *lmargin = _tag_value_get(value, "left_margin");
-        if (!lmargin) lmargin = eina_tmpstr_add("0");
-        Eina_Tmpstr *valign = _tag_value_get(value, "valign");
-        if (!valign) valign = eina_tmpstr_add("baseline");
-        Eina_Tmpstr *rmargin = _tag_value_get(value, "right_margin");
-        if (!rmargin) rmargin = eina_tmpstr_add("0");
-
-        ewe_combobox_text_set(font_align, align);
-        for (i = 0; font_horizontal_align[i] != NULL; i++)
-          ewe_combobox_item_add(font_align, font_horizontal_align[i]);
-        elm_spinner_value_set(font_lmargin, atof(lmargin));
-
-        ewe_combobox_text_set(font_valign, valign);
-        for (i = 0; font_horizontal_valign[i] != NULL; i++)
-          ewe_combobox_item_add(font_valign, font_horizontal_valign[i]);
-        elm_spinner_value_set(font_rmargin, atof(rmargin));
-        eina_tmpstr_del(align);
-        eina_tmpstr_del(lmargin);
-        eina_tmpstr_del(valign);
-        eina_tmpstr_del(rmargin);
-     }
-
-   //FRAME_ADD(tabs, frame2, false, _("Text format"))
-   layout2 = elm_layout_add(frame2);
-   evas_object_size_hint_weight_set(layout2, EVAS_HINT_EXPAND, 
EVAS_HINT_EXPAND);
-   evas_object_size_hint_weight_set(layout2, EVAS_HINT_EXPAND, 
EVAS_HINT_EXPAND);
-   elm_layout_theme_set(layout2, "layout","style_editor", "format2");
-   evas_object_show(layout2);
-   elm_object_content_set(frame2, layout2);
-
-   elm_object_part_text_set(layout2, "label.tabstops", _("Text tabstops:"));
-   elm_object_part_text_set(layout2, "label.line_size", _("Line size:"));
-   elm_object_part_text_set(layout2, "label.left1", _("Line relative size:"));
-   elm_object_part_text_set(layout2, "label.end1", _("px"));
-   elm_object_part_text_set(layout2, "label.right", _("px"));
-   elm_object_part_text_set(layout2, "label.end2", _("px"));
-   elm_object_part_text_set(layout2, "label.password", _("Password field"));
-   elm_object_part_text_set(layout2, "label.background", _("Background 
color"));
-   elm_object_part_text_set(layout2, "label.ellipsis", _("Replace overflow 
characters with ellipsis"));
-
-   text_tabstops = _style_item_text_tabstops_add(layout2, style_edit);
-   line_size = _style_item_line_size_add(layout2, style_edit);
-   rel_size = _style_item_rel_size_add(layout2, style_edit);
-   font_password = _style_item_font_password_add(layout2, style_edit);
-   font_ellipsis = _style_item_font_ellipsis_add(layout2, style_edit);
-   font_background = _style_item_font_background_add(layout2, style_edit);
-   font_backcolor = _style_item_font_backcolor_add(layout2, style_edit);
-
-   if (value)
-     {
-        Eina_Tmpstr *tabstops = _tag_value_get(value, "tabstops");
-        if (!tabstops) tabstops = eina_tmpstr_add("0");
-        Eina_Tmpstr *linesize = _tag_value_get(value, "linesize");
-        if (!linesize) linesize = eina_tmpstr_add("0");
-        Eina_Tmpstr *linerelsize = _tag_value_get(value, "linerelsize");
-        if (!linerelsize) linerelsize = eina_tmpstr_add("0");
-        Eina_Tmpstr *password = _tag_value_get(value, "password");
-        if ((!password) || (!strcmp(password, "off"))) pass = EINA_FALSE;
-        else pass = EINA_TRUE;
-        Eina_Tmpstr *ellipsis = _tag_value_get(value, "ellipsis");
-        if (!ellipsis) ellipsis = eina_tmpstr_add("0");
-        Eina_Tmpstr *bground = _tag_value_get(value, "backing");
-        if ((!bground) || (!strcmp(bground, "off"))) bg = EINA_FALSE;
-        else bg = EINA_TRUE;
-        Eina_Tmpstr *bcolor = _tag_value_get(value, "backing_color");
-        if (!bcolor)
-          {
-             bcolor = eina_tmpstr_add(WHITE_COLOR);
-             _tag_parse(style_edit, WHITE_COLOR, "backing_color");
-          }
-
-        elm_spinner_value_set(text_tabstops, atof(tabstops));
-        elm_spinner_value_set(line_size, atof(linesize));
-        elm_spinner_value_set(rel_size, atof(linerelsize));
-        elm_check_state_set(font_password, pass);
-        elm_check_state_set(font_background, bg);
-        _entry_repch_update(style_edit, pass);
-        if (!_hex_to_rgb(bcolor, &r, &g, &b, &a))
-          ERR("This error should not happen in style editor... Contact devs 
please!");
-        evas_object_color_set(font_backcolor, r*a/255, g*a/255, b*a/255, a);
-        elm_spinner_value_set(font_ellipsis, atof(ellipsis));
-        eina_tmpstr_del(tabstops);
-        eina_tmpstr_del(linesize);
-        eina_tmpstr_del(linerelsize);
-        eina_tmpstr_del(password);
-        eina_tmpstr_del(ellipsis);
-        eina_tmpstr_del(bground);
-        eina_tmpstr_del(bcolor);
-     }
-
-   elm_box_pack_end(box_frames, frame1);
-   elm_box_pack_end(box_frames, frame2);
-
-   if (style_edit->prop.current_tab == TAB_EDITOR_FORMAT)
-     elm_layout_content_set(style_edit->prop.content, NULL, scr);
-}
-*/
-
-/*
-static void
-_glow_tab_update(Style_Editor *style_edit, Evas_Object *tabs, const char 
*value)
-{
-   Evas_Object *layout, *item;
-   Evas_Object *font_style, *shadow_color, *inner_glow, *outer_glow;
-   int r, g, b, a;
-   unsigned int i = 0;
-   Evas_Object *scr;
-   char *style_copy = NULL;
-   char *token;
-   int count = 0, direction = DEFAULT_DIRECTION;
-
-   assert(style_edit != NULL);
-   //assert(tabs != NULL);
-
-   SCROLLER_ADD(ap.win, scr);
-
-   layout = elm_layout_add(ap.win);
-   evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, 
EVAS_HINT_EXPAND);
-   elm_layout_theme_set(layout, "layout", "style_editor", "glow");
-   evas_object_show(layout);
-   elm_object_content_set(scr, layout);
-
-   style_edit->prop.content_glow_shadow = scr;
-
-   elm_object_part_text_set(layout, "label.style", _("Style:"));
-   font_style = _style_item_style_add(layout, style_edit);
-
-   if (value)
-     {
-        Eina_Tmpstr *style = _tag_value_get(value, "style");
-        if (!style) style = eina_tmpstr_add("none");
-        Eina_Tmpstr *inner = _tag_value_get(value, "glow_color");
-        if (!inner)
-          {
-             inner = eina_tmpstr_add(WHITE_COLOR);
-             _tag_parse(style_edit, WHITE_COLOR, "glow_color");
-          }
-        Eina_Tmpstr *outer = _tag_value_get(value, "glow2_color");
-        if (!outer)
-          {
-              outer = eina_tmpstr_add(WHITE_COLOR);
-             _tag_parse(style_edit, WHITE_COLOR, "glow2_color");
-          }
-        Eina_Tmpstr *shadow = _tag_value_get(value, "shadow_color");
-        if (!shadow)
-          {
-             shadow = eina_tmpstr_add(WHITE_COLOR);
-             _tag_parse(style_edit, WHITE_COLOR, "shadow_color");
-          }
-
-        style_copy = mem_malloc(strlen(style) + 1);
-        strcpy(style_copy, style);
-        token = strtok(style_copy, ",");
-        TODO("replace with eina_str_split_full")
-        while (token)
-          {
-             if (count == 0)
-               {
-                  eina_tmpstr_del(style);
-                  style = eina_tmpstr_add(token);
-                  count++;
-               }
-             else
-               {
-                  for (i = 0; direction_list[i] != NULL; i++)
-                    {
-                       if (!strcmp(direction_list[i], token)) direction = i;
-                    }
-               }
-             token = strtok(0, " ");
-          }
-        free(style_copy);
-
-        if (strstr(style, "shadow"))
-          {
-             elm_object_part_text_set(layout, "label.glow_color", _("Color:"));
-             elm_object_signal_emit(layout, "center", "label.glow2_color");
-             elm_object_part_text_set(layout, "label.glow2_color", 
_("Direction:"));
-             item = elm_layout_add(layout);
-             elm_layout_theme_set(item, "layout", "style_editor", "direction");
-             evas_object_show(item);
-
-             if (elm_object_part_content_get(layout, "swallow.glow_color"))
-               elm_object_part_content_unset(layout, "swallow.glow_color");
-             shadow_color = _style_item_shadow_color_add(layout, style_edit);
-             if (!_hex_to_rgb(shadow, &r, &g, &b, &a))
-               ERR("This error should not happen in style editor... Contact 
devs please!");
-             evas_object_color_set(shadow_color, r*a/255, g*a/255, b*a/255, a);
-
-             style_edit->direction[0] = _direction_item_bl_add(item, 
style_edit);
-             style_edit->direction[1] = _direction_item_b_add(item, 
style_edit);
-             elm_radio_group_add(style_edit->direction[1], 
style_edit->direction[0]);
-             style_edit->direction[2] = _direction_item_br_add(item, 
style_edit);
-             elm_radio_group_add(style_edit->direction[2], 
style_edit->direction[0]);
-             style_edit->direction[3] = _direction_item_l_add(item, 
style_edit);
-             elm_radio_group_add(style_edit->direction[3], 
style_edit->direction[0]);
-             style_edit->direction[4] = _direction_item_r_add(item, 
style_edit);
-             elm_radio_group_add(style_edit->direction[4], 
style_edit->direction[0]);
-             style_edit->direction[5] = _direction_item_tl_add(item, 
style_edit);
-             elm_radio_group_add(style_edit->direction[5], 
style_edit->direction[0]);
-             style_edit->direction[6] = _direction_item_t_add(item, 
style_edit);
-             elm_radio_group_add(style_edit->direction[6], 
style_edit->direction[0]);
-             style_edit->direction[7] = _direction_item_tr_add(item, 
style_edit);
-             elm_radio_group_add(style_edit->direction[7], 
style_edit->direction[0]);
-
-             if (elm_object_part_content_get(layout, "swallow.glow2_color"))
-               elm_object_part_content_unset(layout, "swallow.glow2_color");
-             elm_object_part_content_set(layout, "swallow.glow2_color", item);
-             elm_object_signal_emit(style_edit->direction[direction], 
"mouse,up,1", "events");
-          }
-        else
-          {
-             elm_object_part_text_set(layout, "label.glow_color", _("Outer 
glow color:"));
-             elm_object_signal_emit(layout, "top", "label.glow2_color");
-             elm_object_part_text_set(layout, "label.glow2_color", _("Inner 
glow color:"));
-             if (elm_object_part_content_get(layout, "swallow.glow_color"))
-               elm_object_part_content_unset(layout, "swallow.glow_color");
-             inner_glow = _style_item_inner_glow_add(layout, style_edit);
-             if (elm_object_part_content_get(layout, "swallow.glow2_color"))
-               elm_object_part_content_unset(layout, "swallow.glow2_color");
-             outer_glow = _style_item_outer_glow_add(layout, style_edit);
-             if (!_hex_to_rgb(inner, &r, &g, &b, &a))
-               ERR("This error should not happen in style editor... Contact 
devs please!");
-             evas_object_color_set(inner_glow, r*a/255, g*a/255, b*a/255, a);
-             if (!_hex_to_rgb(outer, &r, &g, &b, &a))
-               ERR("This error should not happen in style editor... Contact 
devs please!");
-             evas_object_color_set(outer_glow, r*a/255, g*a/255, b*a/255, a);
-          }
-
-        ewe_combobox_text_set(font_style, style);
-        for (i = 0; font_glow_list[i] != NULL; i++)
-          ewe_combobox_item_add(font_style, font_glow_list[i]);
-
-        eina_tmpstr_del(style);
-        eina_tmpstr_del(inner);
-        eina_tmpstr_del(outer);
-        eina_tmpstr_del(shadow);
-     }
-
-   if (style_edit->prop.current_tab == TAB_EDITOR_GLOW_SHADOW)
-     elm_layout_content_set(style_edit->prop.content, NULL, scr);
-}*/
-
-static void
-_lines_tab_update(Style_Editor *style_edit, Evas_Object *tabs __UNUSED__, 
const char *value)
-{
-   Evas_Object *layout;
-   Evas_Object *font_strikethrough, *strikethrough_color;
-   Evas_Object *font_underline, *underline_style, *underline_color, 
*underline2_color;
-   Elm_Object_Item *sc_item;
-   Eina_Bool strikethr, underl;
-   int r, g, b, a;
-   unsigned int i = 0;
-
-   assert(style_edit != NULL);
-   //assert(tabs != NULL);
-
-   Evas_Object *scr;
-   SCROLLER_ADD(ap.win, scr);
-
-   layout = elm_layout_add(ap.win);
-   evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, 
EVAS_HINT_EXPAND);
-   elm_layout_theme_set(layout, "layout", "style_editor", "lines");
-   evas_object_show(layout);
-   elm_object_content_set(scr, layout);
-
-   style_edit->prop.content_lines = scr;
-
-   elm_object_part_text_set(layout, "label.strikethrough", _("Strikethrough 
color"));
-   elm_object_part_text_set(layout, "label.underline", _("Underline"));
-   elm_object_part_text_set(layout, "label.underline_color", _("Color"));
-
-   font_strikethrough = _style_item_strikethrough_add(layout, style_edit);
-   strikethrough_color = _style_item_strikethrough_color_add(layout, 
style_edit);
-   font_underline = _style_item_underline_add(layout, style_edit);
-   underline_style = _style_item_underline_style_add(layout, style_edit);
-   underline_color = _style_item_underline_color_add(layout, style_edit);
-   underline2_color = _style_item_underline2_color_add(layout, style_edit);
-
-   if (value)
-     {
-        Eina_Tmpstr *strikethrough = _tag_value_get(value, "strikethrough");
-        if ((!strikethrough) || (!strcmp(strikethrough, "off"))) strikethr = 
EINA_FALSE;
-        else strikethr = EINA_TRUE;
-        Eina_Tmpstr *strikethru_color = _tag_value_get(value, 
"strikethrough_color");
-        if (!strikethru_color) strikethru_color = eina_tmpstr_add(WHITE_COLOR);
-        Eina_Tmpstr *seg_item = NULL;
-        Eina_Tmpstr *underline = _tag_value_get(value, "underline");
-        if ((!underline) || (!strcmp(underline, "off"))) underl = EINA_FALSE;
-        else
-          {
-             underl = EINA_TRUE;
-             if (!strcmp(underline, "double")) seg_item = 
eina_tmpstr_add("double");
-             else seg_item = eina_tmpstr_add("single");
-             for (i = 0; underl_styles[i] != NULL; i++)
-               {
-                  if 
(!strcmp(elm_segment_control_item_label_get(underline_style, i), seg_item))
-                    {
-                       sc_item = elm_segment_control_item_get(underline_style, 
i);
-                       elm_segment_control_item_selected_set(sc_item, true);
-                    }
-               }
-          }
-        Eina_Tmpstr *underl_color = _tag_value_get(value, "underline_color");
-        if (!underl_color) underl_color = eina_tmpstr_add(WHITE_COLOR);
-        Eina_Tmpstr *underl2_color = _tag_value_get(value, "underline2_color");
-        if (!underl2_color) underl2_color = eina_tmpstr_add(WHITE_COLOR);
-
-        elm_check_state_set(font_strikethrough, strikethr);
-        elm_check_state_set(font_underline, underl);
-        if (!_hex_to_rgb(strikethru_color, &r, &g, &b, &a))
-          ERR("This error should not happen in style editor... Contact devs 
please!");
-        evas_object_color_set(strikethrough_color, r*a/255, g*a/255, b*a/255, 
a);
-        if (!_hex_to_rgb(underl_color, &r, &g, &b, &a))
-          ERR("This error should not happen in style editor... Contact devs 
please!");
-        evas_object_color_set(underline_color, r*a/255, g*a/255, b*a/255, a);
-        if (!_hex_to_rgb(underl2_color, &r, &g, &b, &a))
-          ERR("This error should not happen in style editor... Contact devs 
please!");
-        evas_object_color_set(underline2_color, r*a/255, g*a/255, b*a/255, a);
-
-        evas_object_smart_callback_add(underline_style, "changed", 
_on_underline_style_change, style_edit);
-
-        eina_tmpstr_del(seg_item);
-        eina_tmpstr_del(strikethrough);
-        eina_tmpstr_del(strikethru_color);
-        eina_tmpstr_del(underline);
-        eina_tmpstr_del(underl_color);
-        eina_tmpstr_del(underl2_color);
-     }
-
-   if (style_edit->prop.current_tab == TAB_EDITOR_LINES)
-     elm_layout_content_set(style_edit->prop.content, NULL, scr);
-}
-
-#undef COMBOBOX_VALUE
-#undef SEGMENT_VALUE
-#undef SPINNER_VALUE
-#undef PERCENT_SPINNER_VALUE
-#undef CHECK_VALUE
-#undef CHANGE_CALLBACK
-#undef ITEM_COLOR_ADD
-#undef COMBO_ADD
-#undef STYLE_ADD
-#undef ITEM1_TEXT_ADD
-#undef SPIN_ADD
-#undef MARGIN_SPIN_ADD
-#undef ELLIPSIS_ADD
-#undef CHK_ADD
-#undef ITEM_TEXT_ADD
-#undef MARGIN_MIN_SP
-#undef MIN_SP
-#undef MAX_SP
-#undef MAX_PERCENT
-#undef STEP_SP
-#undef DIRECT_ADD
-#undef WHITE_COLOR
-
-#define _TAB_CHANGE_CALLBACK(PROPERTY, TAB_MARK) \
-static void \
-_##PROPERTY##_tab_change(void *data, \
-                        Evas_Object *obj __UNUSED__, \
-                        void *event_info __UNUSED__) \
-{ \
-   Style_Editor *style_edit = (Style_Editor *)data; \
-   evas_object_hide(elm_layout_content_unset(style_edit->prop.content, NULL)); 
\
-   elm_layout_content_set(style_edit->prop.content, NULL, 
style_edit->prop.PROPERTY); \
-   style_edit->prop.current_tab = TAB_MARK; \
-}
-
-/*
-_TAB_CHANGE_CALLBACK(content_text, TAB_EDITOR_TEXT);
-_TAB_CHANGE_CALLBACK(content_format, TAB_EDITOR_FORMAT);
-_TAB_CHANGE_CALLBACK(content_glow_shadow, TAB_EDITOR_GLOW_SHADOW);
-_TAB_CHANGE_CALLBACK(content_lines, TAB_EDITOR_LINES);
-*/
-
-#undef _TAB_CHANGE_CALLBACK
-
 Evas_Object*
 _add_box_bg(Style_Editor *style_edit)
 {
@@ -2019,68 +799,6 @@ _add_box_bg(Style_Editor *style_edit)
    return box_bg;
 }
 
-/*
-Evas_Object*
-_form_right_side(Style_Editor *style_edit)
-{
-   Evas_Object *layout;
-   Evas_Object *box_bg = NULL;
-   Evas_Object *image_bg = NULL;
-   Evas_Object *radio_group = NULL;
-   Evas_Object *radio = NULL;
-
-   assert(style_edit != NULL);
-
-   layout = elm_layout_add(ap.win);
-   evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, 
EVAS_HINT_EXPAND);
-   elm_layout_theme_set(layout, "layout", "style_editor", "property");
-   evas_object_show(layout);
-
-   style_edit->prop.content = elm_layout_add(layout);
-   elm_layout_theme_set(style_edit->prop.content, "layout", "tab_home", 
"default");
-   elm_object_part_content_set(layout, "swallow/tabs_entry", 
style_edit->prop.content);
-   evas_object_show(style_edit->prop.content);
-
-   style_edit->prop.tabs = elm_toolbar_add(style_edit->prop.content);
-   elm_layout_content_set(style_edit->prop.content, "elm.swallow.toolbar", 
style_edit->prop.tabs);
-   elm_toolbar_horizontal_set(style_edit->prop.tabs, false);
-   elm_object_style_set(style_edit->prop.tabs,"tabs_vertical");
-   elm_toolbar_shrink_mode_set(style_edit->prop.tabs, 
ELM_TOOLBAR_SHRINK_SCROLL);
-   elm_toolbar_select_mode_set(style_edit->prop.tabs, 
ELM_OBJECT_SELECT_MODE_ALWAYS);
-   elm_toolbar_align_set(style_edit->prop.tabs, 0.0);
-   evas_object_show(style_edit->prop.tabs);
-
-   elm_toolbar_item_append(style_edit->prop.tabs, NULL, _("Text"), 
_content_text_tab_change, style_edit);
-   elm_toolbar_item_append(style_edit->prop.tabs, NULL, _("Format"), 
_content_format_tab_change, style_edit);
-   elm_toolbar_item_append(style_edit->prop.tabs, NULL, _("Glow & Shadow"), 
_content_glow_shadow_tab_change, style_edit);
-   elm_toolbar_item_append(style_edit->prop.tabs, NULL, _("Lines"), 
_content_lines_tab_change, style_edit);
-
-   style_edit->prop.current_tab = TAB_EDITOR_TEXT;
-
-   BOX_ADD(ap.win, box_bg, true, false);
-   elm_box_padding_set(box_bg, 10, 0);
-
-#define _RADIO_ADD(RADIO, VALUE, IMAGE) \
-   RADIO = elm_radio_add(ap.win); \
-   elm_object_style_set(RADIO, "style_editor"); \
-   elm_radio_state_value_set(RADIO, VALUE); \
-   evas_object_show(RADIO); \
-   IMAGE_ADD_NEW(box_bg, image_bg, "preview", IMAGE); \
-   elm_object_part_content_set(RADIO, "bg", image_bg); \
-   evas_object_smart_callback_add(RADIO, "changed", _change_bg_cb, 
style_edit); \
-   elm_box_pack_end(box_bg, RADIO);
-
-   _RADIO_ADD(radio_group, 0, "bg-tile");
-   _RADIO_ADD(radio, 1, "bg-black");
-   elm_radio_group_add(radio, radio_group);
-   _RADIO_ADD(radio, 2, "bg-white");
-   elm_radio_group_add(radio, radio_group);
-#undef _RADIO_ADD
-   elm_object_part_content_set(layout, "menu_container", box_bg);
-   return layout;
-}
-*/
-
 static void
 _on_style_editor_close(void *data,
                         Evas *e __UNUSED__,
diff --git a/src/bin/ui/editors/style_editor.h 
b/src/bin/ui/editors/style_editor.h
index c579163..895f634 100644
--- a/src/bin/ui/editors/style_editor.h
+++ b/src/bin/ui/editors/style_editor.h
@@ -34,6 +34,16 @@
 #include "widget_macro.h"
 #include "string_common.h"
 
+struct _Style_Data
+{
+   const char *st_name;
+   const char *st_tag;
+   Eina_Stringshare *stvalue;
+   Eina_Strbuf *style;
+   Evas_Object *textblock_style;
+   Eina_Bool is_parent_item;
+};
+typedef struct _Style_Data Style_Data;
 /**
  * Show the whole inwin window by using some data
  * about loaded project (edj file)
diff --git a/src/bin/ui/property_style.c b/src/bin/ui/property_style.c
index 267f846..51ca268 100644
--- a/src/bin/ui/property_style.c
+++ b/src/bin/ui/property_style.c
@@ -18,19 +18,27 @@
  */
 #include "property_private.h"
 #include "property_macros.h"
+#include "signals.h"
+#include "style_editor.h"
+#include "colorsel.h"
+
 
 struct _Style_Prop_Data
 {
-   Evas_Object *box;
+   //Text Frame Data
    Evas_Object *font_name;
    Evas_Object *font_style;
    Evas_Object *font_color;
    Evas_Object *font_weight;
    Evas_Object *font_size;
+   Evas_Object *box_frame_text;
+   // Positioning option frame data
    Evas_Object *hor_align;
    Evas_Object *vert_align;
    Evas_Object *left_margin;
    Evas_Object *right_margin;
+   Evas_Object *box_frame_position;
+   // Text format frame data
    Evas_Object *tab_stops;
    Evas_Object *line_size;
    Evas_Object *relative_size;
@@ -38,17 +46,160 @@ struct _Style_Prop_Data
    Evas_Object *check_psw;
    Evas_Object *check_color;
    Evas_Object *bg_color;
+   Evas_Object *box_format_frame;
+   // Glow/Shadow frame data
    Evas_Object *style;
    Evas_Object *outer_gl_color;
    Evas_Object *inner_gl_color;
+   Evas_Object *shadow_color;
+   Evas_Object *direction[8];
+   Evas_Object *box_glow_shadow;
+   //Lines frame data
    Evas_Object *check_s_color;
    Evas_Object *s_color;
    Evas_Object *check_unline;
+   Evas_Object *segment_ctrl;
    Evas_Object *outer_color_singl;
    Evas_Object *outer_color_double;
+   Evas_Object *box_lines_frame;
+
+   Style_Data current_style;
 };
 typedef struct _Style_Prop_Data Style_Prop_Data;
 
+#define MIN_SP - 1.0
+#define MARGIN_MIN_SP 0.0
+#define MAX_SP 9999.0
+#define MAX_PERCENT 100.0
+#define STEP_SP 1.0
+#define DIRECTION_NUM 39
+#define WHITE_COLOR "#FFF"
+
+#define DIRECTION_NUM 39
+#define DEFAULT_DIRECTION 2
+
+static const char *font_weight_list[] = { N_("Normal"),
+                                          N_("Thin"),
+                                          N_("Ultralight"),
+                                          N_("Light"),
+                                          N_("Book"),
+                                          N_("Medium"),
+                                          N_("Semibold"),
+                                          N_("Bold"),
+                                          N_("Ultrabold"),
+                                          N_("Black"),
+                                          N_("Extrablack"),
+                                          NULL};
+
+static const char *font_width_list[] = { N_("Normal"),
+                                         N_("Ultracondensed"),
+                                         N_("Extracondensed"),
+                                         N_("Condensed"),
+                                         N_("Extracondensed"),
+                                         N_("Semicondensed"),
+                                         N_("Semiexpanded"),
+                                         N_("Expanded"),
+                                         N_("Ultraexpanded"),
+                                         NULL};
+
+static const char *style_table[][2] = {{"font", NULL},
+                                       {"font_fallback", NULL},
+                                       {"font_size", NULL},
+                                       {"font_source", NULL},
+                                       {"font_weight", NULL},
+                                       {"font_style", NULL},
+                                       {"font_width", NULL},
+                                       {"lang", NULL},
+                                       {"color", NULL},
+                                       {"underline_color", NULL},
+                                       {"underline2_color", NULL},
+                                       {"underline_dash_color", NULL},
+                                       {"outline_color", NULL},
+                                       {"shadow_color", NULL},
+                                       {"glow_color", NULL},
+                                       {"glow2_color", NULL},
+                                       {"backing_color", NULL},
+                                       {"strikethrough_color", NULL},
+                                       {"align", NULL},
+                                       {"valign", NULL},
+                                       {"wrap", NULL},
+                                       {"left_margin", NULL},
+                                       {"right_margin", NULL},
+                                       {"underline", NULL},
+                                       {"strikethrough", NULL},
+                                       {"backing", NULL},
+                                       {"style", NULL},
+                                       {"tabstops", NULL},
+                                       {"linesize", NULL},
+                                       {"linerelsize", NULL},
+                                       {"linegap", NULL},
+                                       {"linerelgap", NULL},
+                                       {"item", NULL},
+                                       {"linefill", NULL},
+                                       {"ellipsis", NULL},
+                                       {"password", NULL},
+                                       {"underline_dash_width", NULL},
+                                       {"underline_dash_gap", NULL},
+                                       {NULL, NULL},
+                                       {"direction", NULL}};
+
+static const char *underl_styles[] = { N_("single"),
+                                       N_("double"),
+                                       NULL};
+
+static const char *font_horizontal_align[] = { N_("auto"),
+                                               N_("center"),
+                                               N_("middle"),
+                                               N_("left"),
+                                               N_("right"),
+                                               NULL};
+
+static const char *font_horizontal_valign[] = { N_("top"),
+                                                N_("bottom"),
+                                                N_("middle"),
+                                                N_("center"),
+                                                N_("baseline"),
+                                                N_("base"),
+                                                NULL};
+
+static const char *font_glow_list[] = { N_("none"),
+                                        N_("plain"),
+                                        N_("shadow"),
+                                        N_("outline"),
+                                        N_("soft_outline"),
+                                        N_("outline_shadow"),
+                                        N_("outline_soft_shadow"),
+                                        N_("glow"),
+                                        N_("shadow"),
+                                        N_("far_shadow"),
+                                        N_("soft_shadow"),
+                                        N_("far_soft_shadow"),
+                                        NULL};
+
+static const char *direction_list[] = { N_("bottom_left"),
+                                        N_("bottom"),
+                                        N_("bottom_right"),
+                                        N_("left"),
+                                        N_("right"),
+                                        N_("top_left"),
+                                        N_("top"),
+                                        N_("top_right"),
+                                        NULL};
+
+static void _glow_shadow_prop_update(Style_Prop_Data *, const char *);
+
+static void _lines_prop_update(Style_Prop_Data *, const char *);
+
+#define FONT_DEFAULT "DEFAULT='align=middle font=Sans font_size=24 
color=#000000 "
+#define STYLE_PROP_DATA "style_prop_data"
+
+#define CURRENT pd->current_style
+
+#define STYLE_PROP_DATA_GET() \
+   assert(property != NULL); \
+   Style_Prop_Data *pd = evas_object_data_get(property, STYLE_PROP_DATA); \
+   assert(pd != NULL);
+
 #define ADD_1SWALLOW_ITEM(TEXT, BOX, OBJECT, ITEM, TYPE_OBJECT) \
 { \
    PROPERTY_ITEM_ADD(BOX, TEXT, "1swallow"); \
@@ -66,32 +217,338 @@ typedef struct _Style_Prop_Data Style_Prop_Data;
    elm_layout_theme_set(LAYOUT, "image", "color", "color_set"); \
    elm_layout_content_set(OBJECT, NULL, LAYOUT);
 
+#define SPINNER_VALUE \
+const char *value = NULL; \
+if (!ei) \
+  { \
+     value = eina_stringshare_printf("%f", elm_spinner_value_get(obj)); \
+  }
+
+#define COMBOBOX_VALUE \
+Ewe_Combobox_Item *item = ei; \
+const char *value; \
+value = eina_stringshare_add(item->title);
+
+#define PERCENT_SPINNER_VALUE \
+const char *value = NULL; \
+if (!ei) \
+  { \
+     value = eina_stringshare_printf("%f", elm_spinner_value_get(obj)/100); \
+  }
+
+#define CHECK_VALUE \
+Evas_Object *check = obj; \
+const char *value = NULL; \
+if (elm_check_state_get(check)) value = eina_stringshare_add("on"); \
+else value = eina_stringshare_add("off");
+
+#define SEGMENT_VALUE \
+Elm_Object_Item *item = ei; \
+const char *value; \
+value = eina_stringshare_add(elm_object_item_part_text_get(item, "elm.text"));
+
+#define CHANGE_CALLBACK(VALUE, TEXT, WIDGET, FUNC) \
+static void \
+_on_##VALUE##_change(void *data, \
+                     Evas_Object *obj EINA_UNUSED, \
+                     void *ei EINA_UNUSED) \
+{ \
+   Style_Prop_Data *pd = (Style_Prop_Data *)data; \
+   assert(pd != NULL); \
+   WIDGET##_VALUE \
+   _tag_parse(pd, value, TEXT); \
+   FUNC; \
+   _lines_colors_update(pd, TEXT); \
+   _style_edit_update(pd); \
+   eina_stringshare_del(value); \
+}
+
+static void
+_entry_repch_update(Style_Prop_Data *pd, Eina_Bool password)
+{
+   if (password)
+     evas_object_textblock_replace_char_set(CURRENT.textblock_style, "*");
+   else
+     evas_object_textblock_replace_char_set(CURRENT.textblock_style, NULL);
+}
+
+static Eina_Bool
+_hex_to_rgb(const char *hex, int *r, int *g, int *b, int *a)
+{
+   assert(hex != NULL);
+   assert(r != NULL);
+   assert(g != NULL);
+   assert(b != NULL);
+   assert(a != NULL);
+
+   unsigned long val;
+   char *end;
+   int length = (int)strlen(hex);
+   switch (length)
+     {
+      case 7:
+        {
+           val = strtoul(hex + 1, &end, 16);
+           *r = (val & 0xff0000) >> 16;
+           *g = (val & 0xff00) >> 8;
+           *b = val & 0xff;
+           *a = 255;
+           break;
+        }
+      case 9:
+        {
+           val = strtoul(hex + 1, &end, 16);
+           *r = (val & 0xff000000) >> 24;
+           *g = (val & 0xff0000) >> 16;
+           *b = (val & 0xff00) >> 8;
+           *a = val & 0xff;
+           break;
+        }
+      case 5:
+        {
+           val = strtoul(hex + 1, &end, 16);
+           *r = (val & 0xf000) >> 12;
+           *g = (val & 0xf00) >> 8;
+           *b = (val & 0xf0) >> 4;
+           *a = val & 0xf;
+           *r = (*r << 4) | *r;
+           *g = (*g << 4) | *g;
+           *b = (*b << 4) | *b;
+           *a = (*a << 4) | *a;
+           break;
+        }
+      case 4:
+        {
+           val = strtoul(hex + 1, &end, 16);
+           *r = (val & 0xf00) >> 8;
+           *g = (val & 0xf0) >> 4;
+           *b = val & 0xf;
+           *a = 255;
+           *r = (*r << 4) | *r;
+           *g = (*g << 4) | *g;
+           *b = (*b << 4) | *b;
+           break;
+        }
+      default:
+        {
+           *r = 0;
+           *g = 0;
+           *b = 0;
+           *a = 255;
+        }
+     }
+   return true;
+}
+
 static void
-_prop_text_color_add(const char *text, Evas_Object *box, Evas_Object *object)
+_tag_parse(Style_Prop_Data *pd, const char *value, const char *text)
+{
+   Evas_Object *edje_edit_obj = NULL;
+   Eina_Strbuf *tag = eina_strbuf_new();
+   char *stolen_buf;
+   char *token;
+   int i = 0, k = 0, exist = 0, style_length = 0;
+
+   assert(pd != NULL);
+   assert(value != NULL);
+   assert(text != NULL);
+
+   eina_strbuf_append(tag, CURRENT.stvalue);
+   edje_edit_obj = ap.project->global_object;
+   stolen_buf = eina_strbuf_string_steal(tag);
+   token = strtok(stolen_buf, " =+");
+   while (token)
+     {
+        if ((i + 1) % 2 != 0)
+          {
+             for (k = 0; style_table[k][0] != NULL; k++)
+               {
+                  if (!strcmp(style_table[k][0], token)) exist = k;
+               }
+          }
+        else if (strstr(token, "shadow"))
+          {
+             style_table[DIRECTION_NUM][1] = 
eina_stringshare_add(strchr(token, ','));
+             style_length = (int)(strlen(token) - 
strlen(style_table[DIRECTION_NUM][1]));
+             style_table[exist][1] = eina_stringshare_add_length(token, 
style_length);
+          }
+        else
+          {
+             style_table[exist][1] = eina_stringshare_add(token);
+          }
+        token= strtok(NULL, " =+");
+        i++;
+     }
+   free(stolen_buf);
+   if (!strcmp(text, "password"))
+     _entry_repch_update(pd, !strcmp(value, "on"));
+
+   if (!strcmp(text, "direction"))
+     {
+        if (style_table[DIRECTION_NUM][1]) 
eina_stringshare_del(style_table[DIRECTION_NUM][1]);
+        style_table[DIRECTION_NUM][1] = eina_stringshare_printf(",%s", value);
+     }
+   else
+     {
+        for (k = 0; style_table[k][0] != NULL; k++)
+          {
+             if (!strcmp(style_table[k][0], text))
+               {
+                  eina_stringshare_del(style_table[k][1]);
+                  style_table[k][1] = eina_stringshare_add(value);
+               }
+          }
+     }
+   if ((!strcmp(text, "style")) && (!style_table[DIRECTION_NUM][1]))
+     style_table[DIRECTION_NUM][1] = eina_stringshare_add(",bottom_right");
+   eina_strbuf_append(tag, "+ ");
+   for (k = 0; style_table[k][0] != NULL; k++)
+      {
+         if ((style_table[k][1] != NULL) && (!strstr(style_table[k][1], 
"shadow")))
+           {
+              eina_strbuf_append(tag, style_table[k][0]);
+              eina_strbuf_append(tag, "=");
+              eina_strbuf_append(tag, style_table[k][1]);
+              eina_strbuf_append(tag, " ");
+              eina_stringshare_del(style_table[k][1]);
+              style_table[k][1] = NULL;
+           }
+         else if ((style_table[k][1] != NULL) && (strstr(style_table[k][1], 
"shadow")))
+           {
+              eina_strbuf_append(tag, style_table[k][0]);
+              eina_strbuf_append(tag, "=");
+              eina_strbuf_append(tag, style_table[k][1]);
+              eina_strbuf_append(tag, style_table[DIRECTION_NUM][1]);
+              eina_strbuf_append(tag, " ");
+              eina_stringshare_del(style_table[k][1]);
+              style_table[k][1] = NULL;
+           }
+      }
+   edje_edit_style_tag_value_set(edje_edit_obj, CURRENT.st_name,
+                                 CURRENT.st_tag, eina_strbuf_string_get(tag));
+   eina_stringshare_del(CURRENT.stvalue);
+   CURRENT.stvalue = eina_stringshare_add(eina_strbuf_string_get(tag));
+   eina_strbuf_free(tag);
+}
+
+static Eina_Tmpstr*
+_tag_value_get(const char* text_style, char* a_tag)
+{
+   assert(text_style != NULL);
+   assert(a_tag != NULL);
+
+   char *tag_list_copy = mem_malloc(strlen(text_style) + 1);
+   Eina_Tmpstr *result = NULL;
+   char *token;
+
+   strcpy(tag_list_copy, text_style);
+   token = strtok(tag_list_copy, " ");
+   while (token)
+     {
+        char* equals_sign = strchr(token, '=');
+        if (equals_sign)
+          {
+             *equals_sign = 0;
+             if (!strcmp(token, a_tag))
+               {
+                  equals_sign++;
+                  result = eina_tmpstr_add(equals_sign);
+                  if (!strstr(FONT_DEFAULT, a_tag)) break;
+               }
+          }
+        token = strtok(0, " ");
+     }
+   free(tag_list_copy);
+
+   return result;
+}
+
+#define TAB_UPDATE(VALUE) \
+static void \
+_##VALUE##_update(Style_Prop_Data *pd) \
+{ \
+   assert(pd != NULL); \
+   _##VALUE##_prop_update(pd, CURRENT.stvalue); \
+}
+
+TAB_UPDATE(lines)
+
+TAB_UPDATE(glow_shadow)
+
+static void
+_lines_colors_update(Style_Prop_Data *pd, const char *param)
+{
+   Eina_Tmpstr *val;
+
+   assert(pd != NULL);
+   assert(param != NULL);
+
+   if (!strcmp(param, "underline"))
+     {
+        printf("lines update\n");
+        _lines_update(pd);
+        val = _tag_value_get(CURRENT.stvalue, "underline_color");
+        if (!val) _tag_parse(pd, WHITE_COLOR, "underline_color");
+        else eina_tmpstr_del(val);
+
+        val = _tag_value_get(CURRENT.stvalue, "underline2_color");
+        if (!val) _tag_parse(pd, WHITE_COLOR, "underline2_color");
+        else eina_tmpstr_del(val);
+     }
+   else if (!strcmp(param, "strikethrough"))
+     {
+        val = _tag_value_get(CURRENT.stvalue, "strikethrough_color");
+        if (!val) _tag_parse(pd, WHITE_COLOR, "strikethrough_color");
+        else eina_tmpstr_del(val);
+     }
+}
+
+static void
+_style_edit_update(Style_Prop_Data *pd)
+{
+   Evas_Textblock_Style *ts = NULL;
+   Eina_Strbuf *style = eina_strbuf_new();
+
+   assert(pd != NULL);
+
+   eina_strbuf_append(style, FONT_DEFAULT);
+   eina_strbuf_append(style, CURRENT.stvalue);
+   eina_strbuf_append(style, "'");
+   ts = evas_textblock_style_new();
+   evas_textblock_style_set(ts, eina_strbuf_string_get(style));
+   evas_object_textblock_style_set(CURRENT.textblock_style, ts);
+   evas_object_size_hint_max_set(CURRENT.textblock_style, EVAS_HINT_FILL,
+                                 EVAS_HINT_FILL);
+   eina_strbuf_free(style);
+   evas_textblock_style_free(ts);
+}
+
+static void
+_prop_text_color_add(const char *text, Evas_Object *box, Evas_Object **object)
 {
    Evas_Object *layout;
    PROPERTY_ITEM_ADD(box, text, "1swallow_subtext")
-   ADD_COLOR_ELEMENT(object, item, layout)
-   elm_layout_content_set(item, NULL, object);
+   ADD_COLOR_ELEMENT(*object, item, layout)
+   elm_layout_content_set(item, NULL, *object);
    elm_box_pack_end(box, item);
 }
 
 static void
 _prop_text_2color_add(const char *text,
                       Evas_Object *box,
-                      Evas_Object *object_left,
-                      Evas_Object *object_right)
+                      Evas_Object **object_left,
+                      Evas_Object **object_right)
 {
    Evas_Object *layout;
    PROPERTY_ITEM_ADD(box, text, "2swallow")
 
-   ADD_COLOR_ELEMENT(object_left, item, layout)
-   elm_layout_content_set(item, NULL, object_left);
-   ADD_COLOR_ELEMENT(object_right, item, layout)
-   elm_layout_content_set(item, NULL, object_right);
+   ADD_COLOR_ELEMENT(*object_left, item, layout)
+   elm_layout_content_set(item, NULL, *object_left);
+   ADD_COLOR_ELEMENT(*object_right, item, layout)
+   elm_layout_content_set(item, NULL, *object_right);
 
-   elm_layout_content_set(item, "swallow.content1", object_left);
-   elm_layout_content_set(item, "swallow.content2", object_right);
+   elm_layout_content_set(item, "swallow.content1", *object_left);
+   elm_layout_content_set(item, "swallow.content2", *object_right);
 
    elm_box_pack_end(box, item);
 }
@@ -101,12 +558,15 @@ _prop_spin_add(const char *text,
                const char *LS,
                const char *RS,
                Evas_Object *box,
-               Evas_Object *object)
+               Evas_Object **object,
+               float min,
+               float max,
+               float step)
 {
    PROPERTY_ITEM_ADD(box, text, "2swallow")
-   SPINNER_ADD(item, object, 0, 0, 0, true)
+   SPINNER_ADD(item, *object, min, max, step, true)
 
-   elm_layout_content_set(item, "swallow.content1", object);
+   elm_layout_content_set(item, "swallow.content1", *object);
    elm_layout_text_set(item, "label.swallow1.start", LS);
    elm_layout_text_set(item, "label.swallow1.end", RS);
 
@@ -116,17 +576,17 @@ _prop_spin_add(const char *text,
 static void
 _add_1check_color_item(const char *text,
                        Evas_Object *box,
-                       Evas_Object *object_left,
-                       Evas_Object *object_right)
+                       Evas_Object **object_left,
+                       Evas_Object **object_right)
 {
    Evas_Object *layout;
    PROPERTY_ITEM_ADD(box, text, "2swallow")
-   CHECK_ADD(item, object_left)
+   CHECK_ADD(item, *object_left)
 
-   ADD_COLOR_ELEMENT(object_right, item, layout)
+   ADD_COLOR_ELEMENT(*object_right, item, layout)
 
-   elm_layout_content_set(item, "swallow.content1", object_left);
-   elm_layout_content_set(item, "swallow.content2", object_right);
+   elm_layout_content_set(item, "swallow.content1", *object_left);
+   elm_layout_content_set(item, "swallow.content2", *object_right);
 
    elm_box_pack_end(box, item);
 }
@@ -134,126 +594,682 @@ _add_1check_color_item(const char *text,
 static void
 _add_1check_2button_item(const char *text,
                          Evas_Object *box,
-                         Evas_Object *object_left)
+                         Evas_Object **object_left,
+                         Evas_Object **object_right)
 {
-   Evas_Object *segment_ctrl;
-
    PROPERTY_ITEM_ADD(box, text, "2swallow")
-   CHECK_ADD(item, object_left)
+   CHECK_ADD(item, *object_left)
 
-   SEGMENT_CONTROL_ADD(item, segment_ctrl)
-   elm_segment_control_item_add(segment_ctrl, NULL, "single");
-   elm_segment_control_item_add(segment_ctrl, NULL, "double");
+   SEGMENT_CONTROL_ADD(item, *object_right)
+   elm_segment_control_item_add(*object_right, NULL, "single");
+   elm_segment_control_item_add(*object_right, NULL, "double");
 
-   elm_layout_content_set(item, "swallow.content1", object_left);
-   elm_layout_content_set(item, "swallow.content2", segment_ctrl);
+   elm_layout_content_set(item, "swallow.content1", *object_left);
+   elm_layout_content_set(item, "swallow.content2", *object_right);
 
    elm_box_pack_end(box, item);
 }
 
-static Evas_Object *
-_add_text_frame(Style_Prop_Data *pd)
+
+#define CALLBACKS_COLOR_ADD(VALUE, TAG) \
+static void \
+_on_##VALUE##_change(void *data, \
+                     Evas_Object *obj, \
+                     void *ei __UNUSED__) \
+{ \
+   int r, g, b, a; \
+   const char *value; \
+   Style_Prop_Data *pd = (Style_Prop_Data *)data; \
+   assert(pd != NULL); \
+   Evas_Object *color; \
+   color = evas_object_data_get(obj, "color"); \
+   colorselector_color_get(obj, &r, &g, &b, &a); \
+   value = eina_stringshare_printf("#%02x%02x%02x%02x", r, g, b, a); \
+   _tag_parse(pd, value, TAG); \
+   evas_object_color_set(color, r*a/255, g*a/255, b*a/255, a); \
+   _style_edit_update(pd); \
+   eina_stringshare_del(value); \
+} \
+static void \
+_on_##VALUE##_dismissed(void *data, \
+                        Evas_Object *obj, \
+                        void *event_info __UNUSED__) \
+{ \
+   Style_Prop_Data *pd = (Style_Prop_Data *)data; \
+   assert(pd != NULL); \
+   evas_object_smart_callback_del_full(obj, "color,changed", \
+                                      _on_##VALUE##_change, pd); \
+   evas_object_smart_callback_del_full(obj, "palette,item,selected", \
+                                       _on_##VALUE##_change, pd); \
+   evas_object_data_del(obj, "color"); \
+   evas_object_hide(obj); \
+} \
+static void \
+_on_##VALUE##_clicked(void *data, \
+                      Evas *e __UNUSED__, \
+                      Evas_Object *obj, \
+                      void *event_info __UNUSED__) \
+{ \
+   int x, y; \
+   int r, g, b, a; \
+   Style_Prop_Data *pd = (Style_Prop_Data *)data; \
+   assert(pd != NULL); \
+   Evas_Object *colorsel; \
+   colorsel = colorselector_get(); \
+   evas_object_data_set(colorsel, "color", obj); \
+   evas_object_color_get(obj, &r, &g, &b, &a); \
+   colorselector_color_set(colorsel, r, g, b, a); \
+   evas_object_smart_callback_add(colorsel, "color,changed", \
+                                  _on_##VALUE##_change, pd); \
+   evas_object_smart_callback_add(colorsel, "palette,item,selected", \
+                                  _on_##VALUE##_change, pd); \
+   evas_object_smart_callback_add(colorsel, "dismissed", \
+                                  _on_##VALUE##_dismissed, pd); \
+   evas_pointer_canvas_xy_get(evas_object_evas_get(obj), &x, &y); \
+   evas_object_move(colorsel, x, y); \
+   evas_object_show(colorsel); \
+}
+
+CALLBACKS_COLOR_ADD(font_color, "color")
+CALLBACKS_COLOR_ADD(bg_color, "backing_color")
+CALLBACKS_COLOR_ADD(inner_gl_color, "glow_color")
+CALLBACKS_COLOR_ADD(outer_gl_color, "glow2_color")
+CALLBACKS_COLOR_ADD(shadow_color, "shadow_color")
+CALLBACKS_COLOR_ADD(s_color, "strikethrough_color")
+CALLBACKS_COLOR_ADD(outer_color_singl, "underline_color")
+CALLBACKS_COLOR_ADD(outer_color_double, "underline2_color")
+
+CHANGE_CALLBACK(font_size, "font_size", SPINNER, NULL)
+CHANGE_CALLBACK(font_style, "font_width", COMBOBOX, NULL)
+CHANGE_CALLBACK(font_weight, "font_weight", COMBOBOX, NULL)
+
+CHANGE_CALLBACK(tab_stops, "tabstops", SPINNER, NULL)
+CHANGE_CALLBACK(line_size, "linesize", SPINNER, NULL)
+CHANGE_CALLBACK(relative_size, "linerelsize", SPINNER, NULL)
+CHANGE_CALLBACK(check_psw, "password", CHECK, NULL)
+CHANGE_CALLBACK(check_color, "backing", CHECK, NULL)
+CHANGE_CALLBACK(replace_ellisis, "ellipsis", PERCENT_SPINNER, NULL)
+
+CHANGE_CALLBACK(hor_align, "align", COMBOBOX, NULL)
+CHANGE_CALLBACK(left_margin, "left_margin", SPINNER, NULL)
+CHANGE_CALLBACK(vert_align, "valign", COMBOBOX, NULL)
+CHANGE_CALLBACK(right_margin, "right_margin", SPINNER, NULL)
+CHANGE_CALLBACK(style, "style", COMBOBOX, _glow_shadow_update(pd))
+
+CHANGE_CALLBACK(check_s_color, "strikethrough", CHECK, NULL)
+CHANGE_CALLBACK(check_unline, "underline", CHECK, NULL)
+CHANGE_CALLBACK(segment_ctrl, "underline", SEGMENT, NULL)
+
+static void
+_add_text_part(Style_Prop_Data *pd)
 {
-   Evas_Object *frame_text, *box_frame;
+   ADD_1SWALLOW_ITEM(_("Font name:"), pd->box_frame_text, pd->font_name, item, 
EWE_COMBOBOX);
+   ADD_1SWALLOW_ITEM(_("Font style:"), pd->box_frame_text, pd->font_style, 
item, EWE_COMBOBOX);
+   evas_object_smart_callback_add(pd->font_style, "selected", 
_on_font_style_change, pd);
+   ADD_1SWALLOW_ITEM(_(""), pd->box_frame_text, pd->font_weight, item, 
EWE_COMBOBOX);
+   evas_object_smart_callback_add(pd->font_weight, "selected", 
_on_font_weight_change, pd);
+
+   _prop_text_color_add(_("Color:"), pd->box_frame_text, &pd->font_color);
+   evas_object_event_callback_add(pd->font_color, EVAS_CALLBACK_MOUSE_DOWN,
+                                  _on_font_color_clicked, pd);
 
-   FRAME_ADD(pd->box, frame_text, true, _("Text"))
+   _prop_spin_add(_("Size:"), _(""), _("px"),
+                  pd->box_frame_text, &pd->font_size, MIN_SP, MAX_SP, STEP_SP);
 
-   BOX_ADD(frame_text, box_frame, EINA_FALSE, EINA_FALSE);
-   elm_box_padding_set(box_frame, 6, 0);
-   elm_object_content_set(frame_text, box_frame);
+   evas_object_smart_callback_add(pd->font_size, "changed", 
_on_font_size_change, pd);
+}
 
-   ADD_1SWALLOW_ITEM(_("Font name:"), box_frame, pd->font_name, item, 
EWE_COMBOBOX);
-   ADD_1SWALLOW_ITEM(_("Font style:"), box_frame, pd->font_style, item, 
EWE_COMBOBOX);
-   ADD_1SWALLOW_ITEM(_(""), box_frame, pd->font_weight, item, EWE_COMBOBOX);
+static Evas_Object *
+_add_text_frame(Style_Prop_Data *pd, Evas_Object *parent)
+{
+   Evas_Object *frame_text;
 
-   _prop_text_color_add(_("Color:"), box_frame, pd->font_color);
-   _prop_spin_add(_("Size:"), _(""), _("px"), box_frame, pd->font_size);
+   FRAME_ADD(parent, frame_text, true, _("Text"))
+
+   BOX_ADD(frame_text, pd->box_frame_text, EINA_FALSE, EINA_FALSE);
+   elm_box_padding_set(pd->box_frame_text, 6, 0);
+   elm_object_content_set(frame_text, pd->box_frame_text);
 
    return frame_text;
 }
 
-static Evas_Object *
-_add_position_frame(Style_Prop_Data *pd)
+static void
+_add_position_part(Style_Prop_Data *pd)
 {
-   Evas_Object *frame_position, *box_frame;
+   ADD_1SWALLOW_ITEM(_("Horizontal align:"), pd->box_frame_position, 
pd->hor_align, item, EWE_COMBOBOX);
+   evas_object_smart_callback_add(pd->hor_align, "selected", 
_on_hor_align_change, pd);
 
-   FRAME_ADD(pd->box, frame_position, true, _("Positioning option"))
+   ADD_1SWALLOW_ITEM(_("Vertical align:"), pd->box_frame_position, 
pd->vert_align, item, EWE_COMBOBOX);
+   evas_object_smart_callback_add(pd->vert_align, "selected", 
_on_vert_align_change, pd);
 
-   BOX_ADD(frame_position, box_frame, EINA_FALSE, EINA_FALSE);
-   elm_box_padding_set(box_frame, 6, 0);
-   elm_object_content_set(frame_position, box_frame);
+   _prop_spin_add(_("Margin:"), _("left"), _("px"), pd->box_frame_position, 
&pd->left_margin, MARGIN_MIN_SP, MAX_SP, STEP_SP);
+   evas_object_smart_callback_add(pd->left_margin, "changed", 
_on_left_margin_change, pd);
 
-   ADD_1SWALLOW_ITEM(_("Horizontal align:"), box_frame, pd->hor_align, item, 
EWE_COMBOBOX);
-   ADD_1SWALLOW_ITEM(_("Vertical align:"), box_frame, pd->vert_align, item, 
EWE_COMBOBOX);
-   _prop_spin_add(_("Margin:"), _("left"), _("px"), box_frame, 
pd->left_margin);
-   _prop_spin_add(_(""), _("Right"), _("px"), box_frame, pd->right_margin);
+   _prop_spin_add(_(""), _("right"), _("px"), pd->box_frame_position, 
&pd->right_margin, MARGIN_MIN_SP, MAX_SP, STEP_SP);
+   evas_object_smart_callback_add(pd->right_margin, "changed", 
_on_right_margin_change, pd);
+}
+
+static Evas_Object *
+_add_position_frame(Style_Prop_Data *pd, Evas_Object *parent)
+{
+   Evas_Object *frame_position;
+
+   FRAME_ADD(parent, frame_position, true, _("Positioning option"))
+
+   BOX_ADD(frame_position, pd->box_frame_position, EINA_FALSE, EINA_FALSE);
+   elm_box_padding_set(pd->box_frame_position, 6, 0);
+   elm_object_content_set(frame_position, pd->box_frame_position);
 
    return frame_position;
 }
 
-static Evas_Object *
-_add_text_format_frame(Style_Prop_Data *pd)
+static void
+_add_text_format_part(Style_Prop_Data *pd)
 {
-   Evas_Object *frame_text_format, *box_frame;
+   _prop_spin_add(_("Text tabstops:"), _(""), _("px"), pd->box_format_frame, 
&pd->tab_stops, MIN_SP, MAX_SP, STEP_SP);
+   evas_object_smart_callback_add(pd->tab_stops, "changed", 
_on_tab_stops_change, pd);
 
-   FRAME_ADD(pd->box, frame_text_format, true, _("Text format"))
+   _prop_spin_add(_("Line size:"), _(""), _("px"), pd->box_format_frame, 
&pd->line_size, MIN_SP, MAX_SP, STEP_SP);
+   evas_object_smart_callback_add(pd->line_size, "changed", 
_on_line_size_change, pd);
 
-   BOX_ADD(frame_text_format, box_frame, EINA_FALSE, EINA_FALSE);
-   elm_box_padding_set(box_frame, 6, 0);
-   elm_object_content_set(frame_text_format, box_frame);
+   _add_1check_color_item(_("Background color"), pd->box_format_frame, 
&pd->check_color, &pd->bg_color);
+   evas_object_smart_callback_add(pd->check_color, "changed", 
_on_check_color_change, pd);
+   evas_object_event_callback_add(pd->bg_color, EVAS_CALLBACK_MOUSE_DOWN,
+                                  _on_bg_color_clicked, pd);
 
-   _prop_spin_add(_("Text tabstops:"), _(""), _("px"), box_frame, 
pd->tab_stops);
-   _prop_spin_add(_("Line size:"), _(""), _("px"), box_frame, pd->line_size);
-   _add_1check_color_item(_("Background color"), box_frame, pd->check_color, 
pd->bg_color);
-   ADD_1SWALLOW_ITEM(_("Password field:"), box_frame, pd->check_psw, item, 
CHECK);
-   _prop_spin_add(_("Replace overflow characters with ellisis:"), _(""), 
_(""), box_frame, pd->replace_ellisis);
-   _prop_spin_add(_("Line relative size:"), _(""), _("px"), box_frame, 
pd->relative_size);
+   ADD_1SWALLOW_ITEM(_("Password field:"), pd->box_format_frame, 
pd->check_psw, item, CHECK);
+   evas_object_smart_callback_add(pd->check_psw, "changed", 
_on_check_psw_change, pd);
 
-   return frame_text_format;
+   _prop_spin_add(_("Replace overflow characters with ellisis:"), _(""), 
_(""), pd->box_format_frame, &pd->replace_ellisis, MIN_SP, MAX_PERCENT, 
STEP_SP);
+   evas_object_smart_callback_add(pd->replace_ellisis, "changed", 
_on_replace_ellisis_change, pd);
+
+   _prop_spin_add(_("Line relative size:"), _(""), _("px"), 
pd->box_format_frame, &pd->relative_size, MIN_SP, MAX_SP, STEP_SP);
+   evas_object_smart_callback_add(pd->relative_size, "changed", 
_on_relative_size_change, pd);
 }
 
 static Evas_Object *
-add_glow_shadow_frame(Style_Prop_Data *pd)
+_add_text_format_frame(Style_Prop_Data *pd, Evas_Object *parent)
 {
-   Evas_Object *frame_glow, *box_frame;
+   Evas_Object *frame_text_format;
+
+   FRAME_ADD(parent, frame_text_format, true, _("Text format"))
+
+   BOX_ADD(frame_text_format, pd->box_format_frame, EINA_FALSE, EINA_FALSE);
+   elm_box_padding_set(pd->box_format_frame, 6, 0);
+   elm_object_content_set(frame_text_format, pd->box_format_frame);
+
+   return frame_text_format;
+}
 
-   FRAME_ADD(pd->box, frame_glow, true, _("Glow & Shadow"))
+static Evas_Object *
+_add_glow_shadow_frame(Style_Prop_Data *pd, Evas_Object *parent)
+{
+   Evas_Object *frame_glow;
 
-   BOX_ADD(frame_glow, box_frame, EINA_FALSE, EINA_FALSE);
-   elm_object_content_set(frame_glow, box_frame);
+   FRAME_ADD(parent, frame_glow, true, _("Glow & Shadow"))
 
-   elm_box_padding_set(box_frame, 6, 0);
+   BOX_ADD(frame_glow, pd->box_glow_shadow, EINA_FALSE, EINA_FALSE);
+   elm_object_content_set(frame_glow, pd->box_glow_shadow);
 
-   ADD_1SWALLOW_ITEM(_("Style:"), box_frame, pd->style, item, EWE_COMBOBOX);
-   _prop_text_color_add(_("Outer glow color:"), box_frame, pd->outer_gl_color);
-   _prop_text_color_add(_("Inner glow color:"), box_frame, pd->inner_gl_color);
+   elm_box_padding_set(pd->box_glow_shadow, 6, 0);
 
    return frame_glow;
 }
 
+static void
+_add_inner_outer_part(Style_Prop_Data *pd)
+{
+   ADD_1SWALLOW_ITEM(_("Style:"), pd->box_glow_shadow, pd->style, item, 
EWE_COMBOBOX);
+   evas_object_smart_callback_add(pd->style, "selected", _on_style_change, pd);
+
+   _prop_text_color_add(_("Outer glow color:"), pd->box_glow_shadow, 
&pd->outer_gl_color);
+   evas_object_event_callback_add(pd->outer_gl_color, EVAS_CALLBACK_MOUSE_DOWN,
+                                  _on_outer_gl_color_clicked, pd);
+
+   _prop_text_color_add(_("Inner glow color:"), pd->box_glow_shadow, 
&pd->inner_gl_color);
+   evas_object_event_callback_add(pd->inner_gl_color, EVAS_CALLBACK_MOUSE_DOWN,
+                                  _on_inner_gl_color_clicked, pd);
+}
+
+static Evas_Object *
+_add_direction_item(Evas_Object *parent)
+{
+   Evas_Object *item_direction = elm_layout_add(parent);
+   elm_layout_theme_set(item_direction, "layout", "style_editor", "direction");
+   evas_object_show(item_direction);
+   PROPERTY_ITEM_ADD(parent, _("Direction:"), "1swallow_direction")
+   elm_layout_content_set(item, NULL, item_direction);
+   elm_box_pack_end(parent, item);
+
+   return item_direction;
+}
+
 static Evas_Object *
-add_lines_frame(Style_Prop_Data *pd)
+_add_shadow_part(Style_Prop_Data *pd)
+{
+   ADD_1SWALLOW_ITEM(_("Style:"), pd->box_glow_shadow, pd->style, item, 
EWE_COMBOBOX);
+   evas_object_smart_callback_add(pd->style, "selected", _on_style_change, pd);
+
+   _prop_text_color_add(_("–°olor:"), pd->box_glow_shadow, &pd->shadow_color);
+   evas_object_event_callback_add(pd->shadow_color, EVAS_CALLBACK_MOUSE_DOWN,
+                                  _on_shadow_color_clicked, pd);
+
+   return _add_direction_item(pd->box_glow_shadow);
+}
+
+static void
+_add_lines_part(Style_Prop_Data *pd)
 {
-   Evas_Object *frame_lines, *box_frame;
+   _add_1check_color_item(_("Strikethrough color"), pd->box_lines_frame, 
&pd->check_s_color, &pd->s_color);
+   evas_object_smart_callback_add(pd->check_s_color, "changed", 
_on_check_s_color_change, pd);
+   evas_object_event_callback_add(pd->s_color, EVAS_CALLBACK_MOUSE_DOWN,
+                                  _on_s_color_clicked, pd);
+
+   _add_1check_2button_item(_("Underline"), pd->box_lines_frame, 
&pd->check_unline, &pd->segment_ctrl);
+   evas_object_smart_callback_add(pd->check_unline, "changed", 
_on_check_unline_change, pd);
+   evas_object_smart_callback_add(pd->segment_ctrl, "changed", 
_on_segment_ctrl_change, pd);
 
-   FRAME_ADD(pd->box, frame_lines, true, _("Lines"))
+   _prop_text_2color_add(_("Underline color:"), pd->box_lines_frame, 
&pd->outer_color_singl, &pd->outer_color_double);
+   evas_object_event_callback_add(pd->outer_color_singl, 
EVAS_CALLBACK_MOUSE_DOWN,
+                                  _on_outer_color_singl_clicked, pd);
+   evas_object_event_callback_add(pd->outer_color_double, 
EVAS_CALLBACK_MOUSE_DOWN,
+                                  _on_outer_color_double_clicked, pd);
+}
+
+static Evas_Object *
+_add_lines_frame(Style_Prop_Data *pd, Evas_Object *parent)
+{
+   Evas_Object *frame_lines;
 
-   BOX_ADD(frame_lines, box_frame, EINA_FALSE, EINA_FALSE);
-   elm_object_content_set(frame_lines, box_frame);
+   FRAME_ADD(parent, frame_lines, true, _("Lines"))
 
-   _add_1check_color_item(_("Strikethrough color"), box_frame, 
pd->check_s_color, pd->s_color);
-   _add_1check_2button_item(_("Underline"), box_frame, pd->check_unline);
-   _prop_text_2color_add(_("Underline color:"), box_frame, 
pd->outer_color_singl, pd->outer_color_double);
-   elm_box_padding_set(box_frame, 6, 0);
+   BOX_ADD(frame_lines, pd->box_lines_frame, EINA_FALSE, EINA_FALSE);
+   elm_box_padding_set(pd->box_lines_frame, 6, 0);
+   elm_object_content_set(frame_lines, pd->box_lines_frame);
 
    return frame_lines;
 }
 
+static void
+_position_text_option_update(Style_Prop_Data *pd, const char *value)
+{
+   Eina_Bool pass, bg;
+   int r, g, b, a;
+   unsigned int i;
+   if (value)
+     {
+        Eina_Tmpstr *align = _tag_value_get(value, "align");
+        if (!align) align = eina_tmpstr_add("auto");
+        Eina_Tmpstr *lmargin = _tag_value_get(value, "left_margin");
+        if (!lmargin) lmargin = eina_tmpstr_add("0");
+        Eina_Tmpstr *valign = _tag_value_get(value, "valign");
+        if (!valign) valign = eina_tmpstr_add("baseline");
+        Eina_Tmpstr *rmargin = _tag_value_get(value, "right_margin");
+        if (!rmargin) rmargin = eina_tmpstr_add("0");
+
+        ewe_combobox_text_set(pd->hor_align, align);
+        for (i = 0; font_horizontal_align[i] != NULL; i++)
+          ewe_combobox_item_add(pd->hor_align, font_horizontal_align[i]);
+        elm_spinner_value_set(pd->left_margin, atof(lmargin));
+
+        ewe_combobox_text_set(pd->vert_align, valign);
+        for (i = 0; font_horizontal_valign[i] != NULL; i++)
+          ewe_combobox_item_add(pd->vert_align, font_horizontal_valign[i]);
+        elm_spinner_value_set(pd->right_margin, atof(rmargin));
+        eina_tmpstr_del(align);
+        eina_tmpstr_del(lmargin);
+        eina_tmpstr_del(valign);
+        eina_tmpstr_del(rmargin);
+     }
+
+   if (value)
+     {
+        Eina_Tmpstr *tabstops = _tag_value_get(value, "tabstops");
+        if (!tabstops) tabstops = eina_tmpstr_add("0");
+        Eina_Tmpstr *linesize = _tag_value_get(value, "linesize");
+        if (!linesize) linesize = eina_tmpstr_add("0");
+        Eina_Tmpstr *linerelsize = _tag_value_get(value, "linerelsize");
+        if (!linerelsize) linerelsize = eina_tmpstr_add("0");
+        Eina_Tmpstr *password = _tag_value_get(value, "password");
+        if ((!password) || (!strcmp(password, "off"))) pass = EINA_FALSE;
+        else pass = EINA_TRUE;
+        Eina_Tmpstr *ellipsis = _tag_value_get(value, "ellipsis");
+        if (!ellipsis) ellipsis = eina_tmpstr_add("0");
+        Eina_Tmpstr *bground = _tag_value_get(value, "backing");
+        if ((!bground) || (!strcmp(bground, "off"))) bg = EINA_FALSE;
+        else bg = EINA_TRUE;
+        Eina_Tmpstr *bcolor = _tag_value_get(value, "backing_color");
+        if (!bcolor)
+          {
+             bcolor = eina_tmpstr_add(WHITE_COLOR);
+             _tag_parse(pd, WHITE_COLOR, "backing_color");
+          }
+
+        elm_spinner_value_set(pd->tab_stops, atof(tabstops));
+        elm_spinner_value_set(pd->line_size, atof(linesize));
+        elm_spinner_value_set(pd->relative_size, atof(linerelsize));
+        elm_check_state_set(pd->check_psw, pass);
+        elm_check_state_set(pd->check_color, bg);
+        _entry_repch_update(pd, pass);
+        if (!_hex_to_rgb(bcolor, &r, &g, &b, &a))
+          ERR("This error should not happen in style editor... Contact devs 
please!");
+        evas_object_color_set(pd->bg_color, r*a/255, g*a/255, b*a/255, a);
+        elm_spinner_value_set(pd->replace_ellisis, atof(ellipsis));
+        eina_tmpstr_del(tabstops);
+        eina_tmpstr_del(linesize);
+        eina_tmpstr_del(linerelsize);
+        eina_tmpstr_del(password);
+        eina_tmpstr_del(ellipsis);
+        eina_tmpstr_del(bground);
+        eina_tmpstr_del(bcolor);
+     }
+}
+
+#define DIRECT_ADD(VALUE, TEXT, STYLE, VAL) \
+static void \
+_on_##VALUE##_select_direction(void *data, \
+                              Evas_Object *obj __UNUSED__, \
+                              void *event_info __UNUSED__) \
+{ \
+   Style_Prop_Data *pd = data; \
+   assert(pd != NULL); \
+   style_table[DIRECTION_NUM][1] = eina_stringshare_add(TEXT); \
+   _tag_parse(pd, TEXT, "direction"); \
+   _style_edit_update(pd); \
+} \
+static Evas_Object * \
+_direction_item_##VALUE##_add(Evas_Object *item, Style_Prop_Data *pd) \
+{ \
+   Evas_Object *widget; \
+\
+   assert(pd != NULL); \
+   RADIO_ADD(item, widget, VAL, ""); \
+   elm_object_style_set(widget, STYLE); \
+   elm_object_part_content_set(item, "swallow."TEXT, widget); \
+   evas_object_smart_callback_add(widget, "focused", 
_on_##VALUE##_select_direction, pd); \
+   return widget; \
+}
+
+
+DIRECT_ADD(bl,"bottom_left", "bl", 0)
+DIRECT_ADD(b, "bottom", "b", 1)
+DIRECT_ADD(br, "bottom_right", "br", 2)
+DIRECT_ADD(l, "left", "l", 3)
+DIRECT_ADD(r, "right", "r", 4)
+DIRECT_ADD(tl, "top_left", "tl", 5)
+DIRECT_ADD(t, "top", "t", 6)
+DIRECT_ADD(tr, "top_right", "tr", 7)
+
+static void
+_glow_shadow_prop_update(Style_Prop_Data *pd, const char *value)
+{
+   int r, g, b, a;
+   unsigned int i = 0;
+   char *style_copy = NULL;
+   char *token;
+   Evas_Object *item;
+   int count = 0, direction = DEFAULT_DIRECTION;
+
+   if (value)
+     {
+        elm_box_clear(pd->box_glow_shadow);
+        Eina_Tmpstr *style = _tag_value_get(value, "style");
+        if (!style) style = eina_tmpstr_add("none");
+        Eina_Tmpstr *inner = _tag_value_get(value, "glow_color");
+        if (!inner)
+          {
+             inner = eina_tmpstr_add(WHITE_COLOR);
+             _tag_parse(pd, WHITE_COLOR, "glow_color");
+          }
+        Eina_Tmpstr *outer = _tag_value_get(value, "glow2_color");
+        if (!outer)
+          {
+              outer = eina_tmpstr_add(WHITE_COLOR);
+             _tag_parse(pd, WHITE_COLOR, "glow2_color");
+          }
+        Eina_Tmpstr *shadow = _tag_value_get(value, "shadow_color");
+        if (!shadow)
+          {
+             shadow = eina_tmpstr_add(WHITE_COLOR);
+             _tag_parse(pd, WHITE_COLOR, "shadow_color");
+          }
+
+        style_copy = mem_malloc(strlen(style) + 1);
+        strcpy(style_copy, style);
+        token = strtok(style_copy, ",");
+        TODO("replace with eina_str_split_full")
+        while (token)
+          {
+             if (count == 0)
+               {
+                  eina_tmpstr_del(style);
+                  style = eina_tmpstr_add(token);
+                  count++;
+               }
+             else
+               {
+                  for (i = 0; direction_list[i] != NULL; i++)
+                    {
+                       if (!strcmp(direction_list[i], token)) direction = i;
+                    }
+               }
+             token = strtok(0, " ");
+          }
+        free(style_copy);
+
+        if (strstr(style, "shadow"))
+          {
+             item = _add_shadow_part(pd);
+             if (!_hex_to_rgb(shadow, &r, &g, &b, &a))
+               ERR("This error should not happen in style editor... Contact 
devs please!");
+             evas_object_color_set(pd->shadow_color, r*a/255, g*a/255, 
b*a/255, a);
+
+             pd->direction[0] = _direction_item_bl_add(item, pd);
+             pd->direction[1] = _direction_item_b_add(item, pd);
+             elm_radio_group_add(pd->direction[1], pd->direction[0]);
+             pd->direction[2] = _direction_item_br_add(item, pd);
+             elm_radio_group_add(pd->direction[2], pd->direction[0]);
+             pd->direction[3] = _direction_item_l_add(item, pd);
+             elm_radio_group_add(pd->direction[3], pd->direction[0]);
+             pd->direction[4] = _direction_item_r_add(item, pd);
+             elm_radio_group_add(pd->direction[4], pd->direction[0]);
+             pd->direction[5] = _direction_item_tl_add(item, pd);
+             elm_radio_group_add(pd->direction[5], pd->direction[0]);
+             pd->direction[6] = _direction_item_t_add(item, pd);
+             elm_radio_group_add(pd->direction[6], pd->direction[0]);
+             pd->direction[7] = _direction_item_tr_add(item, pd);
+             elm_radio_group_add(pd->direction[7], pd->direction[0]);
+
+             elm_object_signal_emit(pd->direction[direction], "mouse,up,1", 
"events");
+          }
+        else
+          {
+             _add_inner_outer_part(pd);
+             if (!_hex_to_rgb(inner, &r, &g, &b, &a))
+               ERR("This error should not happen in style editor... Contact 
devs please!");
+             evas_object_color_set(pd->inner_gl_color, r*a/255, g*a/255, 
b*a/255, a);
+             if (!_hex_to_rgb(outer, &r, &g, &b, &a))
+               ERR("This error should not happen in style editor... Contact 
devs please!");
+             evas_object_color_set(pd->outer_gl_color, r*a/255, g*a/255, 
b*a/255, a);
+          }
+
+        ewe_combobox_text_set(pd->style, style);
+        for (i = 0; font_glow_list[i] != NULL; i++)
+          ewe_combobox_item_add(pd->style, font_glow_list[i]);
+
+        eina_tmpstr_del(style);
+        eina_tmpstr_del(inner);
+        eina_tmpstr_del(outer);
+        eina_tmpstr_del(shadow);
+     }
+}
+
+static void
+_lines_prop_update(Style_Prop_Data *pd, const char *value)
+{
+   Elm_Object_Item *sc_item;
+   Eina_Bool strikethr, underl;
+   int r, g, b, a;
+   unsigned int i = 0;
+
+   assert(pd != NULL);
+   if (value)
+     {
+        Eina_Tmpstr *strikethrough = _tag_value_get(value, "strikethrough");
+        if ((!strikethrough) || (!strcmp(strikethrough, "off"))) strikethr = 
EINA_FALSE;
+        else strikethr = EINA_TRUE;
+        Eina_Tmpstr *strikethru_color = _tag_value_get(value, 
"strikethrough_color");
+        if (!strikethru_color) strikethru_color = eina_tmpstr_add(WHITE_COLOR);
+        Eina_Tmpstr *seg_item = NULL;
+        Eina_Tmpstr *underline = _tag_value_get(value, "underline");
+        if ((!underline) || (!strcmp(underline, "off"))) underl = EINA_FALSE;
+        else
+          {
+             underl = EINA_TRUE;
+             if (!strcmp(underline, "double")) seg_item = 
eina_tmpstr_add("double");
+             else seg_item = eina_tmpstr_add("single");
+             for (i = 0; underl_styles[i] != NULL; i++)
+               {
+                  if 
(!strcmp(elm_segment_control_item_label_get(pd->segment_ctrl, i), seg_item))
+                    {
+                       sc_item = 
elm_segment_control_item_get(pd->segment_ctrl, i);
+                       elm_segment_control_item_selected_set(sc_item, true);
+                    }
+               }
+          }
+        Eina_Tmpstr *underl_color = _tag_value_get(value, "underline_color");
+        if (!underl_color) underl_color = eina_tmpstr_add(WHITE_COLOR);
+        Eina_Tmpstr *underl2_color = _tag_value_get(value, "underline2_color");
+        if (!underl2_color) underl2_color = eina_tmpstr_add(WHITE_COLOR);
+
+        elm_check_state_set(pd->check_s_color, strikethr);
+        elm_check_state_set(pd->check_unline, underl);
+        if (!_hex_to_rgb(strikethru_color, &r, &g, &b, &a))
+          ERR("This error should not happen in style editor... Contact devs 
please!");
+        evas_object_color_set(pd->s_color, r*a/255, g*a/255, b*a/255, a);
+        if (!_hex_to_rgb(underl_color, &r, &g, &b, &a))
+          ERR("This error should not happen in style editor... Contact devs 
please!");
+        evas_object_color_set(pd->outer_color_singl, r*a/255, g*a/255, 
b*a/255, a);
+        if (!_hex_to_rgb(underl2_color, &r, &g, &b, &a))
+          ERR("This error should not happen in style editor... Contact devs 
please!");
+        evas_object_color_set(pd->outer_color_double, r*a/255, g*a/255, 
b*a/255, a);
+
+        eina_tmpstr_del(seg_item);
+        eina_tmpstr_del(strikethrough);
+        eina_tmpstr_del(strikethru_color);
+        eina_tmpstr_del(underline);
+        eina_tmpstr_del(underl_color);
+        eina_tmpstr_del(underl2_color);
+     }
+}
+
+static void
+_text_prop_update(Style_Prop_Data *pd, const char *value)
+{
+   int i;
+   int r, g, b, a;
+
+   if (value)
+     {
+        Eina_Tmpstr *font = _tag_value_get(value, "font");
+        if (!font) font = eina_tmpstr_add("");
+        Eina_Tmpstr *spin_val = _tag_value_get(value, "font_size");
+        if (!spin_val) spin_val = eina_tmpstr_add("");
+        Eina_Tmpstr *weight = _tag_value_get(value, "font_weight");
+        if (!weight) weight = eina_tmpstr_add("Normal");
+        Eina_Tmpstr *width = _tag_value_get(value, "font_width");
+        if (!width) width = eina_tmpstr_add("Normal");
+
+        Eina_Tmpstr *color = _tag_value_get(value, "color");
+
+        ewe_combobox_text_set(pd->font_name, font);
+        elm_object_disabled_set(pd->font_name, true);
+        elm_spinner_value_set(pd->font_size, atof(spin_val));
+
+        ewe_combobox_text_set(pd->font_style, width);
+        for (i = 0; font_width_list[i] != NULL; i++)
+          {
+             ewe_combobox_item_add(pd->font_style, font_width_list[i]);
+          }
+        ewe_combobox_text_set(pd->font_weight, weight);
+        for (i = 0; font_weight_list[i] != NULL; i++)
+          {
+             ewe_combobox_item_add(pd->font_weight, font_weight_list[i]);
+          }
+
+        if (!_hex_to_rgb(color, &r, &g, &b, &a))
+          {
+             ERR("Can't convert color value");
+             abort();
+          }
+        evas_object_color_set(pd->font_color, r*a/255, g*a/255, b*a/255, a);
+
+        eina_tmpstr_del(font);
+        eina_tmpstr_del(spin_val);
+        eina_tmpstr_del(color);
+        eina_tmpstr_del(weight);
+        eina_tmpstr_del(width);
+     }
+}
+
+static void
+_clear_prop_style(Style_Prop_Data *pd)
+{
+   elm_box_clear(pd->box_frame_text);
+   elm_box_clear(pd->box_frame_position);
+   elm_box_clear(pd->box_format_frame);
+   elm_box_clear(pd->box_glow_shadow);
+   elm_box_clear(pd->box_lines_frame);
+}
+
+static void
+_on_style_selected(void *data ,
+                   Evas_Object *obj __UNUSED__,
+                   void *event_info)
+{
+   Style_Data *current_style = (Style_Data *)event_info;
+   Evas_Object *property = (Evas_Object *)data;
+   STYLE_PROP_DATA_GET()
+
+   CURRENT = *current_style;
+   _clear_prop_style(pd);
+   if (!CURRENT.is_parent_item)
+     {
+        _add_text_part(pd);
+        _text_prop_update(pd, eina_strbuf_string_get(CURRENT.style));
+
+        _add_lines_part(pd);
+        _lines_prop_update(pd, eina_strbuf_string_get(CURRENT.style));
+
+        _add_position_part(pd);
+        _add_text_format_part(pd);
+        _position_text_option_update(pd, 
eina_strbuf_string_get(CURRENT.style));
+
+        _glow_shadow_prop_update(pd, eina_strbuf_string_get(CURRENT.style));
+     }
+
+   free(current_style);
+   eina_strbuf_free(CURRENT.style);
+}
+
+static void
+_on_property_style_del(void * data,
+                       Evas *e __UNUSED__,
+                       Evas_Object *obj,
+                       void *event_info __UNUSED__)
+{
+   Style_Prop_Data *pd = (Style_Prop_Data *)data;
+
+   evas_object_data_del(obj, STYLE_PROP_DATA);
+   evas_object_event_callback_del(obj, EVAS_CALLBACK_DEL, 
_on_property_style_del);
+   free(pd);
+}
+
 Evas_Object *
 ui_property_style_add(Evas_Object *parent)
 {
    Style_Prop_Data *pd;
-   Evas_Object *scroller;
+   Evas_Object *scroller, *main_box;
 
    assert(parent != NULL);
 
@@ -261,17 +1277,35 @@ ui_property_style_add(Evas_Object *parent)
 
    SCROLLER_ADD(parent, scroller);
 
-   BOX_ADD(scroller, pd->box, EINA_FALSE, EINA_FALSE);
-   elm_box_align_set(pd->box, 0.5, 0.0);
-   elm_object_content_set(scroller, pd->box);
+   BOX_ADD(scroller, main_box, EINA_FALSE, EINA_FALSE);
+   elm_box_align_set(main_box, 0.5, 0.0);
+   elm_object_content_set(scroller, main_box);
 
    elm_scroller_policy_set(scroller, ELM_SCROLLER_POLICY_AUTO, 
ELM_SCROLLER_POLICY_AUTO);
 
-   elm_box_pack_end(pd->box, _add_text_frame(pd));
-   elm_box_pack_end(pd->box, _add_position_frame(pd));
-   elm_box_pack_end(pd->box, _add_text_format_frame(pd));
-   elm_box_pack_end(pd->box, add_glow_shadow_frame(pd));
-   elm_box_pack_end(pd->box, add_lines_frame(pd));
+   elm_box_pack_end(main_box, _add_text_frame(pd, main_box));
+   elm_box_pack_end(main_box, _add_position_frame(pd, main_box));
+   elm_box_pack_end(main_box, _add_text_format_frame(pd, main_box));
+   elm_box_pack_end(main_box, _add_glow_shadow_frame(pd, main_box));
+   elm_box_pack_end(main_box, _add_lines_frame(pd, main_box));
+
+   evas_object_data_set(main_box, STYLE_PROP_DATA, pd);
+
+   evas_object_smart_callback_add(ap.win, SIGNAL_STYLE_SELECTED, 
_on_style_selected, main_box);
+   evas_object_event_callback_add(main_box, EVAS_CALLBACK_DEL, 
_on_property_style_del, pd);
 
    return scroller;
-}
\ No newline at end of file
+}
+
+#undef FONT_DEFAULT
+#undef TAB_UPDATE
+#undef STYLE_PROP_DATA_GET
+#undef ADD_1SWALLOW_ITEM
+#undef ADD_COLOR_ELEMENT
+#undef SPINNER_VALUE
+#undef COMBOBOX_VALUE
+#undef PERCENT_SPINNER_VALUE
+#undef CHECK_VALUE
+#undef SEGMENT_VALUE
+#undef CALLBACKS_COLOR_ADD
+#undef DIRECT_ADD
\ No newline at end of file

-- 


Reply via email to