summaryrefslogtreecommitdiff
path: root/legacy/edje/src/lib/edje_text.c
diff options
context:
space:
mode:
Diffstat (limited to 'legacy/edje/src/lib/edje_text.c')
-rw-r--r--legacy/edje/src/lib/edje_text.c34
1 files changed, 31 insertions, 3 deletions
diff --git a/legacy/edje/src/lib/edje_text.c b/legacy/edje/src/lib/edje_text.c
index 7f18a78..43acb54 100644
--- a/legacy/edje/src/lib/edje_text.c
+++ b/legacy/edje/src/lib/edje_text.c
@@ -1,6 +1,8 @@
1#include "Edje.h" 1#include "Edje.h"
2#include "edje_private.h" 2#include "edje_private.h"
3 3
4static Evas_Hash *_edje_text_class_hash = NULL;
5
4Edje_Text_Style _edje_text_styles[EDJE_TEXT_EFFECT_LAST]; 6Edje_Text_Style _edje_text_styles[EDJE_TEXT_EFFECT_LAST];
5 7
6void 8void
@@ -175,6 +177,8 @@ void
175_edje_text_part_on_add(Edje *ed, Edje_Real_Part *ep) 177_edje_text_part_on_add(Edje *ed, Edje_Real_Part *ep)
176{ 178{
177 int i; 179 int i;
180 Evas_List *tmp;
181 Edje_Part *pt = ep->part;
178 182
179 if (ep->part->type != EDJE_PART_TYPE_TEXT) return; 183 if (ep->part->type != EDJE_PART_TYPE_TEXT) return;
180 if (ep->part->effect >= EDJE_TEXT_EFFECT_LAST) return; 184 if (ep->part->effect >= EDJE_TEXT_EFFECT_LAST) return;
@@ -188,6 +192,16 @@ _edje_text_part_on_add(Edje *ed, Edje_Real_Part *ep)
188 evas_object_clip_set(o, ed->clipper); 192 evas_object_clip_set(o, ed->clipper);
189 evas_object_show(o); 193 evas_object_show(o);
190 ep->extra_objects = evas_list_append(ep->extra_objects, o); 194 ep->extra_objects = evas_list_append(ep->extra_objects, o);
195
196 }
197
198 if ((pt->default_desc) && (pt->default_desc->text.text_class)) _edje_text_class_member_add(ed, pt->default_desc->text.text_class);
199 for (tmp = pt->other_desc; tmp; tmp = tmp->next)
200 {
201 Edje_Part_Description *desc;
202
203 desc = tmp->data;
204 if ((desc) && (desc->text.text_class)) _edje_text_class_member_add(ed, desc->text.text_class);
191 } 205 }
192} 206}
193 207
@@ -217,6 +231,9 @@ _edje_text_part_on_add_clippers(Edje *ed, Edje_Real_Part *ep)
217void 231void
218_edje_text_part_on_del(Edje *ed, Edje_Real_Part *ep) 232_edje_text_part_on_del(Edje *ed, Edje_Real_Part *ep)
219{ 233{
234 Evas_List *tmp;
235 Edje_Part *pt = ep->part;
236
220 while (ep->extra_objects) 237 while (ep->extra_objects)
221 { 238 {
222 Evas_Object *o; 239 Evas_Object *o;
@@ -225,8 +242,16 @@ _edje_text_part_on_del(Edje *ed, Edje_Real_Part *ep)
225 ep->extra_objects = evas_list_remove(ep->extra_objects, o); 242 ep->extra_objects = evas_list_remove(ep->extra_objects, o);
226 evas_object_del(o); 243 evas_object_del(o);
227 } 244 }
245
246 if ((pt->default_desc) && (pt->default_desc->text.text_class)) _edje_text_class_member_del(ed, pt->default_desc->text.text_class);
247 for (tmp = pt->other_desc; tmp; tmp = tmp->next)
248 {
249 Edje_Part_Description *desc;
250
251 desc = tmp->data;
252 if (desc->text.text_class) _edje_text_class_member_del(ed, desc->text.text_class);
253 }
228 return; 254 return;
229 ed = NULL;
230} 255}
231 256
232void 257void
@@ -250,8 +275,11 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
250 Edje_Text_Class *tc; 275 Edje_Text_Class *tc;
251 276
252 tc = _edje_text_class_find(ed, chosen_desc->text.text_class); 277 tc = _edje_text_class_find(ed, chosen_desc->text.text_class);
253 if (tc->font) font = tc->font; 278 if (tc)
254 if (tc->size > 0) size = tc->size; 279 {
280 if (tc->font) font = tc->font;
281 if (tc->size > 0) size = tc->size;
282 }
255 } 283 }
256 284
257 if (ep->text.text) text = ep->text.text; 285 if (ep->text.text) text = ep->text.text;