summaryrefslogtreecommitdiff
path: root/legacy/edje/src/lib/edje_text.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2010-07-29 12:02:36 +0000
committerCedric BAIL <cedric.bail@free.fr>2010-07-29 12:02:36 +0000
commite773bc9246dd6a2928601bc77733ea2c75ac3b5e (patch)
treea8c0df892b334343589a916798af478ca3008318 /legacy/edje/src/lib/edje_text.c
parent3515de0a22163615b18de5093ad97da5872f800a (diff)
* edje: change memory layout that will become the new file format.
NOTE: I tried this change with all the apps and theme I had, but maybe i missed some bug. Please report any strange behaviour. SVN revision: 50641
Diffstat (limited to 'legacy/edje/src/lib/edje_text.c')
-rw-r--r--legacy/edje/src/lib/edje_text.c50
1 files changed, 31 insertions, 19 deletions
diff --git a/legacy/edje/src/lib/edje_text.c b/legacy/edje/src/lib/edje_text.c
index e203435..471befb 100644
--- a/legacy/edje/src/lib/edje_text.c
+++ b/legacy/edje/src/lib/edje_text.c
@@ -40,34 +40,46 @@ _edje_text_init(void)
40void 40void
41_edje_text_part_on_add(Edje *ed, Edje_Real_Part *ep) 41_edje_text_part_on_add(Edje *ed, Edje_Real_Part *ep)
42{ 42{
43 Eina_List *tmp;
44 Edje_Part *pt = ep->part; 43 Edje_Part *pt = ep->part;
45 Edje_Part_Description *desc; 44 Edje_Part_Description_Text *desc;
45 unsigned int i;
46 46
47 if (ep->part->type != EDJE_PART_TYPE_TEXT) return; 47 if (ep->part->type != EDJE_PART_TYPE_TEXT) return;
48 48
49 /* if text class exists for this part, add the edje to the tc member list */ 49 /* if text class exists for this part, add the edje to the tc member list */
50 if ((pt->default_desc) && (pt->default_desc->text.text_class)) 50 desc = (Edje_Part_Description_Text *) pt->default_desc;
51 _edje_text_class_member_add(ed, pt->default_desc->text.text_class); 51 if ((pt->default_desc) && (desc->text.text_class))
52 _edje_text_class_member_add(ed, desc->text.text_class);
52 53
53 /* If any other classes exist add them */ 54 /* If any other classes exist add them */
54 EINA_LIST_FOREACH(pt->other_desc, tmp, desc) 55 for (i = 0; i < pt->other_count; ++i)
55 if ((desc) && (desc->text.text_class)) 56 {
56 _edje_text_class_member_add(ed, desc->text.text_class); 57 desc = (Edje_Part_Description_Text *) pt->other_desc[i];
58 if ((desc) && (desc->text.text_class))
59 _edje_text_class_member_add(ed, desc->text.text_class);
60 }
57} 61}
58 62
59void 63void
60_edje_text_part_on_del(Edje *ed, Edje_Part *pt) 64_edje_text_part_on_del(Edje *ed, Edje_Part *pt)
61{ 65{
62 Eina_List *tmp; 66 Edje_Part_Description_Text *desc;
63 Edje_Part_Description *desc; 67 unsigned int i;
68
69 if (pt->type != EDJE_PART_TYPE_TEXT
70 && pt->type != EDJE_PART_TYPE_TEXTBLOCK)
71 return ;
64 72
65 if ((pt->default_desc) && (pt->default_desc->text.text_class)) 73 desc = (Edje_Part_Description_Text *) pt->default_desc;
66 _edje_text_class_member_del(ed, pt->default_desc->text.text_class); 74 if ((pt->default_desc) && (desc->text.text_class))
75 _edje_text_class_member_del(ed, desc->text.text_class);
67 76
68 EINA_LIST_FOREACH(pt->other_desc, tmp, desc) 77 for (i = 0; i < pt->other_count; ++i)
69 if (desc->text.text_class) 78 {
70 _edje_text_class_member_del(ed, desc->text.text_class); 79 desc = (Edje_Part_Description_Text *) pt->other_desc[i];
80 if (desc->text.text_class)
81 _edje_text_class_member_del(ed, desc->text.text_class);
82 }
71} 83}
72 84
73static void 85static void
@@ -267,7 +279,7 @@ _edje_text_font_get(const char *base, const char *new, char **free_later)
267} 279}
268 280
269const char * 281const char *
270_edje_text_class_font_get(Edje *ed, Edje_Part_Description *chosen_desc, int *size, char **free_later) 282_edje_text_class_font_get(Edje *ed, Edje_Part_Description_Text *chosen_desc, int *size, char **free_later)
271{ 283{
272 Edje_Text_Class *tc; 284 Edje_Text_Class *tc;
273 const char *text_class_name, *font; 285 const char *text_class_name, *font;
@@ -292,7 +304,7 @@ _edje_text_class_font_get(Edje *ed, Edje_Part_Description *chosen_desc, int *siz
292void 304void
293_edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep, 305_edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
294 Edje_Calc_Params *params, 306 Edje_Calc_Params *params,
295 Edje_Part_Description *chosen_desc) 307 Edje_Part_Description_Text *chosen_desc)
296{ 308{
297 const char *text; 309 const char *text;
298 const char *font; 310 const char *font;
@@ -315,13 +327,13 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
315 327
316 if (ep->text.text_source) 328 if (ep->text.text_source)
317 { 329 {
318 text = ep->text.text_source->chosen_description->text.text; 330 text = ((Edje_Part_Description_Text *)ep->text.text_source->chosen_description)->text.text;
319 if (ep->text.text_source->text.text) text = ep->text.text_source->text.text; 331 if (ep->text.text_source->text.text) text = ep->text.text_source->text.text;
320 } 332 }
321 if (ep->text.source) 333 if (ep->text.source)
322 { 334 {
323 font = ep->text.source->chosen_description->text.font; 335 font = ((Edje_Part_Description_Text *)ep->text.source->chosen_description)->text.font;
324 size = ep->text.source->chosen_description->text.size; 336 size = ((Edje_Part_Description_Text *)ep->text.source->chosen_description)->text.size;
325 if (ep->text.source->text.font) font = ep->text.source->text.font; 337 if (ep->text.source->text.font) font = ep->text.source->text.font;
326 if (ep->text.source->text.size > 0) size = ep->text.source->text.size; 338 if (ep->text.source->text.size > 0) size = ep->text.source->text.size;
327 } 339 }