summaryrefslogtreecommitdiff
path: root/legacy/edje/src/lib/edje_text.c
diff options
context:
space:
mode:
authordoursse <doursse>2007-09-08 18:31:56 +0000
committerdoursse <doursse@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>2007-09-08 18:31:56 +0000
commit974152be16e32c4e41d04a902378d82ec4db65b8 (patch)
tree169181e0cadc98643b3de2b08ec709a3e0dfc0d6 /legacy/edje/src/lib/edje_text.c
parentc63454baea00b181dbcc5af2fe09aae397881701 (diff)
remove trailingspaces
SVN revision: 31657
Diffstat (limited to 'legacy/edje/src/lib/edje_text.c')
-rw-r--r--legacy/edje/src/lib/edje_text.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/legacy/edje/src/lib/edje_text.c b/legacy/edje/src/lib/edje_text.c
index 82e5d2f..62a18a5 100644
--- a/legacy/edje/src/lib/edje_text.c
+++ b/legacy/edje/src/lib/edje_text.c
@@ -6,7 +6,7 @@
6#include "edje_private.h" 6#include "edje_private.h"
7 7
8#ifdef HAVE_STDINT_H 8#ifdef HAVE_STDINT_H
9#include <stdint.h> 9#include <stdint.h>
10#endif 10#endif
11#include <assert.h> 11#include <assert.h>
12 12
@@ -51,14 +51,14 @@ _edje_text_part_on_add(Edje *ed, Edje_Real_Part *ep)
51 /* if text class exists for this part, add the edje to the tc member list */ 51 /* if text class exists for this part, add the edje to the tc member list */
52 if ((pt->default_desc) && (pt->default_desc->text.text_class)) 52 if ((pt->default_desc) && (pt->default_desc->text.text_class))
53 _edje_text_class_member_add(ed, pt->default_desc->text.text_class); 53 _edje_text_class_member_add(ed, pt->default_desc->text.text_class);
54 54
55 /* If any other classes exist add them */ 55 /* If any other classes exist add them */
56 for (tmp = pt->other_desc; tmp; tmp = tmp->next) 56 for (tmp = pt->other_desc; tmp; tmp = tmp->next)
57 { 57 {
58 Edje_Part_Description *desc; 58 Edje_Part_Description *desc;
59 59
60 desc = tmp->data; 60 desc = tmp->data;
61 if ((desc) && (desc->text.text_class)) 61 if ((desc) && (desc->text.text_class))
62 _edje_text_class_member_add(ed, desc->text.text_class); 62 _edje_text_class_member_add(ed, desc->text.text_class);
63 } 63 }
64} 64}
@@ -67,11 +67,11 @@ void
67_edje_text_part_on_add_clippers(Edje *ed, Edje_Real_Part *ep) 67_edje_text_part_on_add_clippers(Edje *ed, Edje_Real_Part *ep)
68{ 68{
69 Evas_List *l; 69 Evas_List *l;
70 70
71 for (l = ep->extra_objects; l; l = l->next) 71 for (l = ep->extra_objects; l; l = l->next)
72 { 72 {
73 Evas_Object *o; 73 Evas_Object *o;
74 74
75 o = l->data; 75 o = l->data;
76 if (ep->part->clip_to_id >= 0) 76 if (ep->part->clip_to_id >= 0)
77 { 77 {
@@ -92,7 +92,7 @@ _edje_text_part_on_del(Edje *ed, Edje_Part *pt)
92 92
93 if ((pt->default_desc) && (pt->default_desc->text.text_class)) 93 if ((pt->default_desc) && (pt->default_desc->text.text_class))
94 _edje_text_class_member_del(ed, pt->default_desc->text.text_class); 94 _edje_text_class_member_del(ed, pt->default_desc->text.text_class);
95 95
96 for (tmp = pt->other_desc; tmp; tmp = tmp->next) 96 for (tmp = pt->other_desc; tmp; tmp = tmp->next)
97 { 97 {
98 Edje_Part_Description *desc; 98 Edje_Part_Description *desc;
@@ -109,7 +109,7 @@ _edje_text_real_part_on_del(Edje *ed, Edje_Real_Part *ep)
109 while (ep->extra_objects) 109 while (ep->extra_objects)
110 { 110 {
111 Evas_Object *o; 111 Evas_Object *o;
112 112
113 o = ep->extra_objects->data; 113 o = ep->extra_objects->data;
114 ep->extra_objects = evas_list_remove(ep->extra_objects, o); 114 ep->extra_objects = evas_list_remove(ep->extra_objects, o);
115 evas_object_del(o); 115 evas_object_del(o);
@@ -284,7 +284,7 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
284 Evas_Coord tw, th; 284 Evas_Coord tw, th;
285 Evas_Coord sw, sh; 285 Evas_Coord sw, sh;
286 int inlined_font = 0, free_text = 0; 286 int inlined_font = 0, free_text = 0;
287 287
288 288
289 text = chosen_desc->text.text; 289 text = chosen_desc->text.text;
290 font = chosen_desc->text.font; 290 font = chosen_desc->text.font;
@@ -293,7 +293,7 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
293 if ((chosen_desc->text.text_class) && (chosen_desc->text.text_class[0] != 0)) 293 if ((chosen_desc->text.text_class) && (chosen_desc->text.text_class[0] != 0))
294 { 294 {
295 Edje_Text_Class *tc; 295 Edje_Text_Class *tc;
296 296
297 tc = _edje_text_class_find(ed, chosen_desc->text.text_class); 297 tc = _edje_text_class_find(ed, chosen_desc->text.text_class);
298 if (tc) 298 if (tc)
299 { 299 {
@@ -301,14 +301,14 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
301 size = _edje_text_size_calc(size, tc); 301 size = _edje_text_size_calc(size, tc);
302 } 302 }
303 } 303 }
304 304
305 if (ep->text.text) text = (char *) ep->text.text; 305 if (ep->text.text) text = (char *) ep->text.text;
306 if (ep->text.font) font = ep->text.font; 306 if (ep->text.font) font = ep->text.font;
307 if (ep->text.size > 0) size = ep->text.size; 307 if (ep->text.size > 0) size = ep->text.size;
308 308
309 if (!text) text = ""; 309 if (!text) text = "";
310 if (!font) font = ""; 310 if (!font) font = "";
311 311
312 /* check if the font is embedded in the .eet */ 312 /* check if the font is embedded in the .eet */
313 if (ed->file->font_hash) 313 if (ed->file->font_hash)
314 { 314 {
@@ -334,7 +334,7 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
334 } 334 }
335 { 335 {
336 int l, r, t, b; 336 int l, r, t, b;
337 337
338 evas_object_text_style_pad_get(ep->object, &l, &r, &t, &b); 338 evas_object_text_style_pad_get(ep->object, &l, &r, &t, &b);
339 sw = params->w; 339 sw = params->w;
340 sh = params->h; 340 sh = params->h;
@@ -353,9 +353,9 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
353 { 353 {
354 text = (char *) ep->text.cache.out_str; 354 text = (char *) ep->text.cache.out_str;
355 size = ep->text.cache.out_size; 355 size = ep->text.cache.out_size;
356 356
357 if (!text) text = ""; 357 if (!text) text = "";
358 358
359 goto arrange_text; 359 goto arrange_text;
360 } 360 }
361 if (ep->text.cache.in_str) evas_stringshare_del(ep->text.cache.in_str); 361 if (ep->text.cache.in_str) evas_stringshare_del(ep->text.cache.in_str);
@@ -372,7 +372,7 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
372 if (tw > sw) 372 if (tw > sw)
373 { 373 {
374 int psize; 374 int psize;
375 375
376 psize = size; 376 psize = size;
377 while ((tw > sw) && (size > 0) && (tw != 0)) 377 while ((tw > sw) && (size > 0) && (tw != 0))
378 { 378 {
@@ -381,7 +381,7 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
381 if ((psize - size) <= 0) size = psize - 1; 381 if ((psize - size) <= 0) size = psize - 1;
382 if (inlined_font) evas_object_text_font_source_set(ep->object, ed->path); 382 if (inlined_font) evas_object_text_font_source_set(ep->object, ed->path);
383 else evas_object_text_font_source_set(ep->object, NULL); 383 else evas_object_text_font_source_set(ep->object, NULL);
384 384
385 evas_object_text_font_set(ep->object, font, size); 385 evas_object_text_font_set(ep->object, font, size);
386 part_get_geometry(ep, &tw, &th); 386 part_get_geometry(ep, &tw, &th);
387 if ((size > 0) && (tw == 0)) break; 387 if ((size > 0) && (tw == 0)) break;
@@ -390,7 +390,7 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
390 else if (tw < sw) 390 else if (tw < sw)
391 { 391 {
392 int psize; 392 int psize;
393 393
394 psize = size; 394 psize = size;
395 while ((tw < sw) && (size > 0) && (tw != 0)) 395 while ((tw < sw) && (size > 0) && (tw != 0))
396 { 396 {
@@ -399,7 +399,7 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
399 if ((psize - size) >= 0) size = psize + 1; 399 if ((psize - size) >= 0) size = psize + 1;
400 if (inlined_font) evas_object_text_font_source_set(ep->object, ed->path); 400 if (inlined_font) evas_object_text_font_source_set(ep->object, ed->path);
401 else evas_object_text_font_source_set(ep->object, NULL); 401 else evas_object_text_font_source_set(ep->object, NULL);
402 402
403 evas_object_text_font_set(ep->object, font, size); 403 evas_object_text_font_set(ep->object, font, size);
404 part_get_geometry(ep, &tw, &th); 404 part_get_geometry(ep, &tw, &th);
405 if ((size > 0) && (tw == 0)) break; 405 if ((size > 0) && (tw == 0)) break;
@@ -416,7 +416,7 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
416 416
417 if (inlined_font) evas_object_text_font_source_set(ep->object, ed->path); 417 if (inlined_font) evas_object_text_font_source_set(ep->object, ed->path);
418 else evas_object_text_font_source_set(ep->object, NULL); 418 else evas_object_text_font_source_set(ep->object, NULL);
419 419
420 evas_object_text_font_set(ep->object, font, size); 420 evas_object_text_font_set(ep->object, font, size);
421 evas_object_text_text_set(ep->object, text); 421 evas_object_text_text_set(ep->object, text);
422 part_get_geometry(ep, &tw, &th); 422 part_get_geometry(ep, &tw, &th);
@@ -427,7 +427,7 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
427 if (!chosen_desc->text.fit_x && th < sh) 427 if (!chosen_desc->text.fit_x && th < sh)
428 { 428 {
429 int dif; 429 int dif;
430 430
431 dif = (th - sh) / 4; 431 dif = (th - sh) / 4;
432 if (dif < 1) dif = 1; 432 if (dif < 1) dif = 1;
433 while ((th < sh) && (sw > 0)) 433 while ((th < sh) && (sw > 0))
@@ -436,7 +436,7 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
436 if (size <= 0) break; 436 if (size <= 0) break;
437 if (inlined_font) evas_object_text_font_source_set(ep->object, ed->path); 437 if (inlined_font) evas_object_text_font_source_set(ep->object, ed->path);
438 else evas_object_text_font_source_set(ep->object, NULL); 438 else evas_object_text_font_source_set(ep->object, NULL);
439 439
440 evas_object_text_font_set(ep->object, font, size); 440 evas_object_text_font_set(ep->object, font, size);
441 part_get_geometry(ep, &tw, &th); 441 part_get_geometry(ep, &tw, &th);
442 if ((size > 0) && (th == 0)) break; 442 if ((size > 0) && (th == 0)) break;
@@ -446,7 +446,7 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
446 else if (th > sh) 446 else if (th > sh)
447 { 447 {
448 int dif; 448 int dif;
449 449
450 dif = (th - sh) / 4; 450 dif = (th - sh) / 4;
451 if (dif < 1) dif = 1; 451 if (dif < 1) dif = 1;
452 while ((th > sh) && (sw >= 0)) 452 while ((th > sh) && (sw >= 0))
@@ -455,7 +455,7 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
455 if (size <= 0) break; 455 if (size <= 0) break;
456 if (inlined_font) evas_object_text_font_source_set(ep->object, ed->path); 456 if (inlined_font) evas_object_text_font_source_set(ep->object, ed->path);
457 else evas_object_text_font_source_set(ep->object, NULL); 457 else evas_object_text_font_source_set(ep->object, NULL);
458 458
459 evas_object_text_font_set(ep->object, font, size); 459 evas_object_text_font_set(ep->object, font, size);
460 part_get_geometry(ep, &tw, &th); 460 part_get_geometry(ep, &tw, &th);
461 if ((size > 0) && (th == 0)) break; 461 if ((size > 0) && (th == 0)) break;
@@ -483,16 +483,16 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
483 ep->text.cache.fit_x = chosen_desc->text.fit_x; 483 ep->text.cache.fit_x = chosen_desc->text.fit_x;
484 ep->text.cache.fit_y = chosen_desc->text.fit_y; 484 ep->text.cache.fit_y = chosen_desc->text.fit_y;
485 arrange_text: 485 arrange_text:
486 486
487 if (inlined_font) evas_object_text_font_source_set(ep->object, ed->path); 487 if (inlined_font) evas_object_text_font_source_set(ep->object, ed->path);
488 else evas_object_text_font_source_set(ep->object, NULL); 488 else evas_object_text_font_source_set(ep->object, NULL);
489 489
490 evas_object_text_font_set(ep->object, font, size); 490 evas_object_text_font_set(ep->object, font, size);
491 evas_object_text_text_set(ep->object, text); 491 evas_object_text_text_set(ep->object, text);
492 part_get_geometry(ep, &tw, &th); 492 part_get_geometry(ep, &tw, &th);
493 ep->offset.x = ((sw - tw) * params->text.align.x); 493 ep->offset.x = ((sw - tw) * params->text.align.x);
494 ep->offset.y = ((sh - th) * params->text.align.y); 494 ep->offset.y = ((sh - th) * params->text.align.y);
495 495
496 evas_object_move(ep->object, 496 evas_object_move(ep->object,
497 ed->x + params->x + ep->offset.x, 497 ed->x + params->x + ep->offset.x,
498 ed->y + params->y + ep->offset.y); 498 ed->y + params->y + ep->offset.y);
@@ -503,7 +503,7 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
503 Evas_Text_Style_Type style; 503 Evas_Text_Style_Type style;
504 504
505 style = EVAS_TEXT_STYLE_PLAIN; 505 style = EVAS_TEXT_STYLE_PLAIN;
506 506
507 evas_object_color_set(ep->object, 507 evas_object_color_set(ep->object,
508 (params->color.r * params->color.a) / 255, 508 (params->color.r * params->color.a) / 255,
509 (params->color.g * params->color.a) / 255, 509 (params->color.g * params->color.a) / 255,