Moved the text_class into the description's text section.
authorrbdpngn <rbdpngn>
Fri, 31 Oct 2003 05:07:39 +0000 (05:07 +0000)
committerrbdpngn <rbdpngn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 31 Oct 2003 05:07:39 +0000 (05:07 +0000)
SVN revision: 7773

legacy/edje/src/bin/edje_cc_handlers.c
legacy/edje/src/lib/edje_calc.c
legacy/edje/src/lib/edje_data.c
legacy/edje/src/lib/edje_load.c
legacy/edje/src/lib/edje_private.h
legacy/edje/src/lib/edje_text.c

index f4405306ea76a35727d60fa1cec4618c582b5611..ae490316cd2c26130213ad1b2f306698a2b59e90 100644 (file)
@@ -22,7 +22,6 @@ static void st_collections_group_parts_part_effect(void);
 static void st_collections_group_parts_part_mouse_events(void);
 static void st_collections_group_parts_part_repeat_events(void);
 static void st_collections_group_parts_part_clip_to_id(void);
-static void st_collections_group_parts_part_text_class(void);
 static void st_collections_group_parts_part_dragable_x(void);
 static void st_collections_group_parts_part_dragable_y(void);
 static void st_collections_group_parts_part_dragable_confine(void);
@@ -58,6 +57,7 @@ static void st_collections_group_parts_part_description_color(void);
 static void st_collections_group_parts_part_description_color2(void);
 static void st_collections_group_parts_part_description_color3(void);
 static void st_collections_group_parts_part_description_text_text(void);
+static void st_collections_group_parts_part_description_text_text_class(void);
 static void st_collections_group_parts_part_description_text_font(void);
 static void st_collections_group_parts_part_description_text_size(void);
 static void st_collections_group_parts_part_description_text_fit(void);
@@ -92,7 +92,6 @@ New_Statement_Handler statement_handlers[] =
      {"collections.group.parts.part.mouse_events", st_collections_group_parts_part_mouse_events},
      {"collections.group.parts.part.repeat_events", st_collections_group_parts_part_repeat_events},
      {"collections.group.parts.part.clip_to", st_collections_group_parts_part_clip_to_id},
-     {"collections.group.parts.part.text_class", st_collections_group_parts_part_text_class},
      {"collections.group.parts.part.dragable.x", st_collections_group_parts_part_dragable_x},
      {"collections.group.parts.part.dragable.y", st_collections_group_parts_part_dragable_y},
      {"collections.group.parts.part.dragable.confine", st_collections_group_parts_part_dragable_confine},
@@ -126,6 +125,7 @@ New_Statement_Handler statement_handlers[] =
      {"collections.group.parts.part.description.color2", st_collections_group_parts_part_description_color2},
      {"collections.group.parts.part.description.color3", st_collections_group_parts_part_description_color3},
      {"collections.group.parts.part.description.text.text", st_collections_group_parts_part_description_text_text},
+     {"collections.group.parts.part.description.text.text_class", st_collections_group_parts_part_description_text_text_class},
      {"collections.group.parts.part.description.text.font", st_collections_group_parts_part_description_text_font},
      {"collections.group.parts.part.description.text.size", st_collections_group_parts_part_description_text_size},
      {"collections.group.parts.part.description.text.fit", st_collections_group_parts_part_description_text_fit},
@@ -162,7 +162,6 @@ New_Object_Handler object_handlers[] =
      {"collections.group.parts.part.mouse_events", NULL},
      {"collections.group.parts.part.repeat_events", NULL},
      {"collections.group.parts.part.clip_to", NULL},
-     {"collections.group.parts.part.text_class", NULL},
      {"collections.group.parts.part.dragable", NULL},
      {"collections.group.parts.part.dragable.x", NULL},
      {"collections.group.parts.part.dragable.y", NULL},
@@ -205,6 +204,7 @@ New_Object_Handler object_handlers[] =
      {"collections.group.parts.part.description.color3", NULL},
      {"collections.group.parts.part.description.text", NULL},
      {"collections.group.parts.part.description.text.text", NULL},
+     {"collections.group.parts.part.description.text.text_class", NULL},
      {"collections.group.parts.part.description.text.font", NULL},
      {"collections.group.parts.part.description.text.size", NULL},
      {"collections.group.parts.part.description.text.fit", NULL},
@@ -451,17 +451,6 @@ st_collections_group_parts_part_clip_to_id(void)
      }
 }
 
-static void
-st_collections_group_parts_part_text_class(void)
-{
-   Edje_Part_Collection *pc;
-   Edje_Part *ep;
-   
-   pc = evas_list_data(evas_list_last(edje_collections));
-   ep = evas_list_data(evas_list_last(pc->parts));
-   ep->text_class = parse_str(0);
-}
-
 static void
 st_collections_group_parts_part_dragable_x(void)
 {
@@ -1064,6 +1053,20 @@ st_collections_group_parts_part_description_text_text(void)
    ed->text.text = parse_str(0);
 }
 
+static void
+st_collections_group_parts_part_description_text_text_class(void)
+{
+   Edje_Part_Collection *pc;
+   Edje_Part *ep;
+   Edje_Part_Description *ed;
+   
+   pc = evas_list_data(evas_list_last(edje_collections));
+   ep = evas_list_data(evas_list_last(pc->parts));
+   ed = ep->default_desc;
+   if (ep->other_desc) ed = evas_list_data(evas_list_last(ep->other_desc));
+   ed->text.text_class = parse_str(0);
+}
+
 static void
 st_collections_group_parts_part_description_text_font(void)
 {
index 36b184aab2053030ffc722e95c52642a781884e5..e9ab4083a3e9f42429cede1f60f94e5179925609 100644 (file)
@@ -413,11 +413,11 @@ _edje_part_recalc_single(Edje *ed,
        font = chosen_desc->text.font;
        size = chosen_desc->text.size;
        
-       if ((ep->part->text_class) && (strlen(ep->part->text_class) > 0))
+       if ((chosen_desc->text.text_class) && (strlen(chosen_desc->text.text_class) > 0))
          {
             Edje_Text_Class *tc;
             
-            tc = _edje_text_class_find(ed, ep->part->text_class);
+            tc = _edje_text_class_find(ed, chosen_desc->text.text_class);
             if (tc->font) font = tc->font;
             if (tc->size > 0) size = tc->size;
          }
index 34df407af410f9ad9c6e1a13a1677435dbd171fd..fdeef98e2b2439c83dda1f2ef23c3c7d490518cf 100644 (file)
@@ -155,6 +155,7 @@ _edje_edd_setup(void)
    EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "color3.b", color3.b, EET_T_UCHAR);
    EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "color3.a", color3.a, EET_T_UCHAR);
    EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "text.text", text.text, EET_T_STRING);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "text.text_class", text.text_class, EET_T_STRING);
    EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "text.font", text.font, EET_T_STRING);
    EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "text.size", text.size, EET_T_INT);
    EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "text.fit_x", text.fit_x, EET_T_UCHAR);
@@ -173,7 +174,6 @@ _edje_edd_setup(void)
    EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "effect", effect, EET_T_CHAR);
    EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "mouse_events", mouse_events, EET_T_CHAR);
    EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "clip_to_id", clip_to_id, EET_T_INT);
-   EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "text_class", text_class, EET_T_STRING);
    EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_edje_part, Edje_Part, "default_desc", default_desc, _edje_edd_edje_part_description);
    EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_part, Edje_Part, "other_desc", other_desc, _edje_edd_edje_part_description);
    EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "dragable.x", dragable.x, EET_T_CHAR);
index cd318765fd5733134e86ffb1ca06f4e767b55c02..48ea221a1b83544d858309cde12905c8d6d920e3 100644 (file)
@@ -574,7 +574,6 @@ _edje_collection_free(Edje_Part_Collection *ec)
        ep = ec->parts->data;
        ec->parts = evas_list_remove(ec->parts, ep);
        if (ep->name) free(ep->name);
-       if (ep->text_class) free(ep->text_class);
        if (ep->default_desc) _edje_collection_free_part_description_free(ep->default_desc);
        while (ep->other_desc)
          {
@@ -610,6 +609,7 @@ _edje_collection_free_part_description_free(Edje_Part_Description *desc)
        free(pi);
      }
    if (desc->text.text) free(desc->text.text);
+   if (desc->text.text_class) free(desc->text.text_class);
    if (desc->text.font) free(desc->text.font);
    if (desc->color_class) free(desc->color_class);
    free(desc);
index 84360edc7c2bc5dc23792e1ab1d67f2cbeabb8ae..781854e256d6abbd105d5c9f0c15276ee1b0daaa 100644 (file)
@@ -235,7 +235,6 @@ struct _Edje_Part
    unsigned char          mouse_events; /* it will affect/respond to mouse events */
    unsigned char          repeat_events; /* it will repeat events to objects below */
    int                    clip_to_id; /* the part id to clip this one to */   
-   char                  *text_class; /* how to apply/modify the font */
    Edje_Part_Description *default_desc; /* the part descriptor for default */
    Evas_List             *other_desc; /* other possible descriptors */
    struct {
@@ -321,6 +320,7 @@ struct _Edje_Part_Description
 
    struct {
       char          *text; /* if "" or NULL, then leave text unchanged */
+      char          *text_class; /* how to apply/modify the font */
       char          *font; /* if a specific font is asked for */
       
       int            size; /* 0 = use user set size */
index d392eab30b8e17a0bcb51917cbab2829fdce942d..7f18a787e92750437c6d1473a3b9c8ab1c4bb60f 100644 (file)
@@ -245,11 +245,11 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
    font = chosen_desc->text.font;
    size = chosen_desc->text.size;
    
-   if ((ep->part->text_class) && (strlen(ep->part->text_class) > 0))
+   if ((chosen_desc->text.text_class) && (strlen(chosen_desc->text.text_class) > 0))
      {
        Edje_Text_Class *tc;
        
-       tc = _edje_text_class_find(ed, ep->part->text_class);
+       tc = _edje_text_class_find(ed, chosen_desc->text.text_class);
        if (tc->font) font = tc->font;
        if (tc->size > 0) size = tc->size;
      }