summaryrefslogtreecommitdiff
path: root/src/lib/edje/edje_text.c
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2015-06-08 14:43:00 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2015-06-08 14:43:00 -0400
commit172a0ccf0cd609dac4a3c0b48965c96afd3e1b01 (patch)
treef04c61fc19fdb17727f31cddb9b4dae3cdbbb29b /src/lib/edje/edje_text.c
parent86e5a1a27c41b07a8eee74f6a7d90f534dab13c8 (diff)
edje: reformat all C files
this has been unreadable for years due to the french tabber.
Diffstat (limited to 'src/lib/edje/edje_text.c')
-rw-r--r--src/lib/edje/edje_text.c569
1 files changed, 294 insertions, 275 deletions
diff --git a/src/lib/edje/edje_text.c b/src/lib/edje/edje_text.c
index a39d52c..ec91e8e 100644
--- a/src/lib/edje/edje_text.c
+++ b/src/lib/edje/edje_text.c
@@ -34,7 +34,7 @@ _set_translated_string(Edje *ed, Edje_Real_Part *ep)
34 const char *text = NULL; 34 const char *text = NULL;
35 Edje_Part_Description_Text *chosen_desc; 35 Edje_Part_Description_Text *chosen_desc;
36 36
37 chosen_desc = (Edje_Part_Description_Text*)ep->chosen_description; 37 chosen_desc = (Edje_Part_Description_Text *)ep->chosen_description;
38 domain = chosen_desc->text.domain; 38 domain = chosen_desc->text.domain;
39 text = edje_string_get(&chosen_desc->text.text); 39 text = edje_string_get(&chosen_desc->text.text);
40 40
@@ -76,14 +76,14 @@ _edje_text_part_on_add(Edje *ed, Edje_Real_Part *ep)
76 if (ep->part->type != EDJE_PART_TYPE_TEXT) return; 76 if (ep->part->type != EDJE_PART_TYPE_TEXT) return;
77 77
78 /* if text class exists for this part, add the edje to the tc member list */ 78 /* if text class exists for this part, add the edje to the tc member list */
79 desc = (Edje_Part_Description_Text *) pt->default_desc; 79 desc = (Edje_Part_Description_Text *)pt->default_desc;
80 if ((pt->default_desc) && (desc->text.text_class)) 80 if ((pt->default_desc) && (desc->text.text_class))
81 _edje_text_class_member_add(ed, desc->text.text_class); 81 _edje_text_class_member_add(ed, desc->text.text_class);
82 82
83 /* If any other classes exist add them */ 83 /* If any other classes exist add them */
84 for (i = 0; i < pt->other.desc_count; ++i) 84 for (i = 0; i < pt->other.desc_count; ++i)
85 { 85 {
86 desc = (Edje_Part_Description_Text *) pt->other.desc[i]; 86 desc = (Edje_Part_Description_Text *)pt->other.desc[i];
87 if ((desc) && (desc->text.text_class)) 87 if ((desc) && (desc->text.text_class))
88 _edje_text_class_member_add(ed, desc->text.text_class); 88 _edje_text_class_member_add(ed, desc->text.text_class);
89 } 89 }
@@ -99,13 +99,13 @@ _edje_text_part_on_del(Edje *ed, Edje_Part *pt)
99 if (pt->type != EDJE_PART_TYPE_TEXT) 99 if (pt->type != EDJE_PART_TYPE_TEXT)
100 return; 100 return;
101 101
102 desc = (Edje_Part_Description_Text *) pt->default_desc; 102 desc = (Edje_Part_Description_Text *)pt->default_desc;
103 if ((pt->default_desc) && (desc->text.text_class)) 103 if ((pt->default_desc) && (desc->text.text_class))
104 _edje_text_class_member_del(ed, desc->text.text_class); 104 _edje_text_class_member_del(ed, desc->text.text_class);
105 105
106 for (i = 0; i < pt->other.desc_count; ++i) 106 for (i = 0; i < pt->other.desc_count; ++i)
107 { 107 {
108 desc = (Edje_Part_Description_Text *) pt->other.desc[i]; 108 desc = (Edje_Part_Description_Text *)pt->other.desc[i];
109 if (desc->text.text_class) 109 if (desc->text.text_class)
110 _edje_text_class_member_del(ed, desc->text.text_class); 110 _edje_text_class_member_del(ed, desc->text.text_class);
111 } 111 }
@@ -199,18 +199,18 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
199 Edje_Part_Description_Text *chosen_desc, 199 Edje_Part_Description_Text *chosen_desc,
200 Eina_Bool calc_only) 200 Eina_Bool calc_only)
201{ 201{
202 const char *text = NULL; 202 const char *text = NULL;
203 const char *font; 203 const char *font;
204 char *font2 = NULL; 204 char *font2 = NULL;
205 char *sfont = NULL; 205 char *sfont = NULL;
206 int size; 206 int size;
207 const char *filter, *source_name; 207 const char *filter, *source_name;
208 Eina_List *filter_sources = NULL, *prev_sources = NULL, *li; 208 Eina_List *filter_sources = NULL, *prev_sources = NULL, *li;
209 Evas_Coord tw, th; 209 Evas_Coord tw, th;
210 Evas_Coord sw, sh; 210 Evas_Coord sw, sh;
211 int inlined_font = 0, free_text = 0; 211 int inlined_font = 0, free_text = 0;
212 Eina_Bool same_text = EINA_FALSE; 212 Eina_Bool same_text = EINA_FALSE;
213 FLOAT_T sc; 213 FLOAT_T sc;
214 214
215 if ((ep->type != EDJE_RP_TYPE_TEXT) || 215 if ((ep->type != EDJE_RP_TYPE_TEXT) ||
216 (!ep->typedata.text)) return; 216 (!ep->typedata.text)) return;
@@ -426,8 +426,9 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
426 int bottom, top; 426 int bottom, top;
427 427
428 if (th < sh) bottom = 10; 428 if (th < sh) bottom = 10;
429 else if (th > sh) bottom = 1; 429 else if (th > sh)
430 else bottom = 0; /* XXX shut up GCC, th == sh is handled before! */ 430 bottom = 1;
431 else bottom = 0; /* XXX shut up GCC, th == sh is handled before! */
431 432
432 top = size; 433 top = size;
433 /* search one that fits (binary search) */ 434 /* search one that fits (binary search) */
@@ -441,8 +442,9 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
441 442
442 part_get_geometry(ep, &tw, &th); 443 part_get_geometry(ep, &tw, &th);
443 444
444 if (th < sh) bottom = current + 1; 445 if (th < sh) bottom = current + 1;
445 else if (th > sh) top = current - 1; 446 else if (th > sh)
447 top = current - 1;
446 } while ((bottom < top) && (th != sh)); 448 } while ((bottom < top) && (th != sh));
447 } 449 }
448 450
@@ -473,272 +475,289 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
473 /* Handle ellipsis */ 475 /* Handle ellipsis */
474 if (!chosen_desc->text.min_x) 476 if (!chosen_desc->text.min_x)
475 { 477 {
476 eo_do(ep->object, 478 eo_do (ep->object,
477 if (inlined_font) efl_text_properties_font_source_set(ed->path); 479 if (inlined_font) efl_text_properties_font_source_set(ed->path);
478 else efl_text_properties_font_source_set(NULL)); 480 else efl_text_properties_font_source_set(NULL));
479 481
480 text = _edje_text_fit_x(ed, ep, params, chosen_desc, 482 text = _edje_text_fit_x(ed, ep, params, chosen_desc,
481 text, font, size, 483 text, font, size,
482 sw, sh, &free_text); 484 sw, sh, &free_text);
483 } 485 }
484 /* when evas ellipsis support was added in efl 1.8 and used to replace 486 /* when evas ellipsis support was added in efl 1.8 and used to replace
485 * previous support, SOMEONE, who I shall call "cedric", borked ellipsis 487 * previous support, SOMEONE, who I shall call "cedric", borked ellipsis
486 * defaults. as a result, edje_cc continued using 0.0 (left-most) as its default value 488 * defaults. as a result, edje_cc continued using 0.0 (left-most) as its default value
487 * for ellipsis while evas used -1.0 (no ellipsizing). 489 * for ellipsis while evas used -1.0 (no ellipsizing).
488 * this was moderately okay for a time because nobody was using it or GROUP parts 490 * this was moderately okay for a time because nobody was using it or GROUP parts
489 * with text in them very frequently, and so nobody noticed that the mismatch was breaking 491 * with text in them very frequently, and so nobody noticed that the mismatch was breaking
490 * sizing in some cases when the edje ellipsis value failed to be applied, 492 * sizing in some cases when the edje ellipsis value failed to be applied,
491 * which occurred any time text.min_x was set; in this case, ellipsis would NEVER be 493 * which occurred any time text.min_x was set; in this case, ellipsis would NEVER be
492 * correctly applied, and instead the text object would only ever get the first 494 * correctly applied, and instead the text object would only ever get the first
493 * ellipsis_set(0), permanently breaking the part. 495 * ellipsis_set(0), permanently breaking the part.
494 * the only way to fix this while preserving previous behavior was to bump 496 * the only way to fix this while preserving previous behavior was to bump
495 * the edje file minor version and then check it here to ignore "unset" ellipsis 497 * the edje file minor version and then check it here to ignore "unset" ellipsis
496 * values from old file versions. 498 * values from old file versions.
497 * the downside is that this will break old files which have text.min_x set to 0...maybe. 499 * the downside is that this will break old files which have text.min_x set to 0...maybe.
498 * 500 *
499 * -zmike 501 * -zmike
500 * 22 April 2014 502 * 22 April 2014
501 */ 503 */
502 else if (((ed->file->version >= 3) && (ed->file->minor >= 6)) || 504 else if (((ed->file->version >= 3) && (ed->file->minor >= 6)) ||
503 params->type.text.ellipsis) 505 params->type.text.ellipsis)
504 evas_object_text_ellipsis_set(ep->object, 506 evas_object_text_ellipsis_set(ep->object,
505 chosen_desc->text.min_x ? -1 : params->type.text.ellipsis); 507 chosen_desc->text.min_x ? -1 : params->type.text.ellipsis);
506 508
507 eina_stringshare_replace(&ep->typedata.text->cache.out_str, text); 509 eina_stringshare_replace(&ep->typedata.text->cache.out_str, text);
508 ep->typedata.text->cache.in_w = sw; 510 ep->typedata.text->cache.in_w = sw;
509 ep->typedata.text->cache.in_h = sh; 511 ep->typedata.text->cache.in_h = sh;
510 ep->typedata.text->cache.in_font = font; 512 ep->typedata.text->cache.in_font = font;
511 ep->typedata.text->cache.out_size = size; 513 ep->typedata.text->cache.out_size = size;
512 ep->typedata.text->cache.align_x = params->type.text.align.x; 514 ep->typedata.text->cache.align_x = params->type.text.align.x;
513 ep->typedata.text->cache.align_y = params->type.text.align.y; 515 ep->typedata.text->cache.align_y = params->type.text.align.y;
514 ep->typedata.text->cache.ellipsis = params->type.text.ellipsis; 516 ep->typedata.text->cache.ellipsis = params->type.text.ellipsis;
515 ep->typedata.text->cache.fit_x = chosen_desc->text.fit_x; 517 ep->typedata.text->cache.fit_x = chosen_desc->text.fit_x;
516 ep->typedata.text->cache.fit_y = chosen_desc->text.fit_y; 518 ep->typedata.text->cache.fit_y = chosen_desc->text.fit_y;
517arrange_text: 519arrange_text:
518 520
519 eo_do(ep->object, 521 eo_do(ep->object,
520 if (inlined_font) efl_text_properties_font_source_set(ed->path); 522 if (inlined_font) efl_text_properties_font_source_set(ed->path);
521 else efl_text_properties_font_source_set(NULL); 523 else efl_text_properties_font_source_set(NULL);
522 524
523 if (ep->part->scale) evas_obj_scale_set(TO_DOUBLE(sc)); 525 if (ep->part->scale) evas_obj_scale_set(TO_DOUBLE(sc));
524 526
525 efl_text_properties_font_set(font, size), 527 efl_text_properties_font_set(font, size),
526 efl_text_set(text)); 528 efl_text_set(text));
527 part_get_geometry(ep, &tw, &th); 529 part_get_geometry(ep, &tw, &th);
528 530
529 /* filters */ 531 /* filters */
530 eo_do(ep->object, 532 eo_do(ep->object,
531 EINA_LIST_FOREACH(prev_sources, li, source_name) 533 EINA_LIST_FOREACH(prev_sources, li, source_name)
532 evas_obj_text_filter_source_set(source_name, NULL); 534 evas_obj_text_filter_source_set(source_name, NULL);
533 535
534 EINA_LIST_FOREACH(filter_sources, li, source_name) 536 EINA_LIST_FOREACH(filter_sources, li, source_name)
535 { 537 {
536 Edje_Real_Part *rp = _edje_real_part_get(ed, source_name); 538 Edje_Real_Part *rp = _edje_real_part_get(ed, source_name);
537 evas_obj_text_filter_source_set(source_name, rp ? rp->object : NULL); 539 evas_obj_text_filter_source_set(source_name, rp ? rp->object : NULL);
538 }; 540 }
539 evas_obj_text_filter_program_set(filter)); 541 evas_obj_text_filter_program_set(filter));
540 542
541 /* Handle alignment */ 543 /* Handle alignment */
542 {
543 FLOAT_T align_x;
544 if (params->type.text.align.x < FROM_INT(0))
545 {
546 if (evas_object_text_direction_get(ep->object) ==
547 EVAS_BIDI_DIRECTION_RTL)
548 {
549 align_x = FROM_INT(1);
550 }
551 else
552 { 544 {
553 align_x = FROM_INT(0); 545 FLOAT_T align_x;
546 if (params->type.text.align.x < FROM_INT(0))
547 {
548 if (evas_object_text_direction_get(ep->object) ==
549 EVAS_BIDI_DIRECTION_RTL)
550 {
551 align_x = FROM_INT(1);
552 }
553 else
554 {
555 align_x = FROM_INT(0);
556 }
557 }
558 else
559 {
560 align_x = params->type.text.align.x;
561 }
562 ep->typedata.text->offset.x = TO_INT(SCALE(align_x, (sw - tw)));
563 ep->typedata.text->offset.y = TO_INT(SCALE(params->type.text.align.y, (sh - th)));
554 } 564 }
555 }
556 else
557 {
558 align_x = params->type.text.align.x;
559 }
560 ep->typedata.text->offset.x = TO_INT(SCALE(align_x, (sw - tw)));
561 ep->typedata.text->offset.y = TO_INT(SCALE(params->type.text.align.y, (sh - th)));
562 }
563
564 if (!calc_only)
565 {
566 eo_do(ep->object,
567 efl_gfx_position_set(ed->x + TO_INT(params->eval.x) + ep->typedata.text->offset.x,
568 ed->y + TO_INT(params->eval.y) + ep->typedata.text->offset.y);
569
570 efl_gfx_visible_set(params->visible));
571 }
572
573 565
574 { 566 if (!calc_only)
575 Evas_Text_Style_Type style; 567 {
576 Edje_Text_Effect effect; 568 eo_do(ep->object,
577 569 efl_gfx_position_set(ed->x + TO_INT(params->eval.x) + ep->typedata.text->offset.x,
578 style = EVAS_TEXT_STYLE_PLAIN; 570 ed->y + TO_INT(params->eval.y) + ep->typedata.text->offset.y);
579
580 evas_object_color_set(ep->object,
581 (params->color.r * params->color.a) / 255,
582 (params->color.g * params->color.a) / 255,
583 (params->color.b * params->color.a) / 255,
584 params->color.a);
585 effect = ep->part->effect;
586 switch (effect & EDJE_TEXT_EFFECT_MASK_BASIC)
587 {
588 case EDJE_TEXT_EFFECT_NONE:
589 case EDJE_TEXT_EFFECT_PLAIN:
590 style = EVAS_TEXT_STYLE_PLAIN;
591 break;
592 case EDJE_TEXT_EFFECT_OUTLINE:
593 style = EVAS_TEXT_STYLE_OUTLINE;
594 evas_object_text_outline_color_set(ep->object,
595 (params->type.text.color2.r * params->type.text.color2.a) / 255,
596 (params->type.text.color2.g * params->type.text.color2.a) / 255,
597 (params->type.text.color2.b * params->type.text.color2.a) / 255,
598 params->type.text.color2.a);
599 break;
600 case EDJE_TEXT_EFFECT_SOFT_OUTLINE:
601 style = EVAS_TEXT_STYLE_SOFT_OUTLINE;
602 evas_object_text_outline_color_set(ep->object,
603 (params->type.text.color2.r * params->type.text.color2.a) / 255,
604 (params->type.text.color2.g * params->type.text.color2.a) / 255,
605 (params->type.text.color2.b * params->type.text.color2.a) / 255,
606 params->type.text.color2.a);
607 break;
608 case EDJE_TEXT_EFFECT_SHADOW:
609 style = EVAS_TEXT_STYLE_SHADOW;
610 evas_object_text_shadow_color_set(ep->object,
611 (params->type.text.color3.r * params->type.text.color3.a) / 255,
612 (params->type.text.color3.g * params->type.text.color3.a) / 255,
613 (params->type.text.color3.b * params->type.text.color3.a) / 255,
614 params->type.text.color3.a);
615 break;
616 case EDJE_TEXT_EFFECT_SOFT_SHADOW:
617 style = EVAS_TEXT_STYLE_SOFT_SHADOW;
618 evas_object_text_shadow_color_set(ep->object,
619 (params->type.text.color3.r * params->type.text.color3.a) / 255,
620 (params->type.text.color3.g * params->type.text.color3.a) / 255,
621 (params->type.text.color3.b * params->type.text.color3.a) / 255,
622 params->type.text.color3.a);
623 break;
624 case EDJE_TEXT_EFFECT_OUTLINE_SHADOW:
625 style = EVAS_TEXT_STYLE_OUTLINE_SHADOW;
626 eo_do(ep->object,
627 evas_obj_text_outline_color_set((params->type.text.color2.r * params->type.text.color2.a) / 255,
628 (params->type.text.color2.g * params->type.text.color2.a) / 255,
629 (params->type.text.color2.b * params->type.text.color2.a) / 255,
630 params->type.text.color2.a),
631 evas_obj_text_shadow_color_set((params->type.text.color3.r * params->type.text.color3.a) / 255,
632 (params->type.text.color3.g * params->type.text.color3.a) / 255,
633 (params->type.text.color3.b * params->type.text.color3.a) / 255,
634 params->type.text.color3.a));
635 break;
636 case EDJE_TEXT_EFFECT_OUTLINE_SOFT_SHADOW:
637 style = EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW;
638 eo_do(ep->object,
639 evas_obj_text_outline_color_set((params->type.text.color2.r * params->type.text.color2.a) / 255,
640 (params->type.text.color2.g * params->type.text.color2.a) / 255,
641 (params->type.text.color2.b * params->type.text.color2.a) / 255,
642 params->type.text.color2.a),
643 evas_obj_text_shadow_color_set((params->type.text.color3.r * params->type.text.color3.a) / 255,
644 (params->type.text.color3.g * params->type.text.color3.a) / 255,
645 (params->type.text.color3.b * params->type.text.color3.a) / 255,
646 params->type.text.color3.a));
647 break;
648 case EDJE_TEXT_EFFECT_FAR_SHADOW:
649 style = EVAS_TEXT_STYLE_FAR_SHADOW;
650 evas_object_text_shadow_color_set(ep->object,
651 (params->type.text.color3.r * params->type.text.color3.a) / 255,
652 (params->type.text.color3.g * params->type.text.color3.a) / 255,
653 (params->type.text.color3.b * params->type.text.color3.a) / 255,
654 params->type.text.color3.a);
655 break;
656 case EDJE_TEXT_EFFECT_FAR_SOFT_SHADOW:
657 style = EVAS_TEXT_STYLE_FAR_SOFT_SHADOW;
658 evas_object_text_shadow_color_set(ep->object,
659 (params->type.text.color3.r * params->type.text.color3.a) / 255,
660 (params->type.text.color3.g * params->type.text.color3.a) / 255,
661 (params->type.text.color3.b * params->type.text.color3.a) / 255,
662 params->type.text.color3.a);
663 break;
664 case EDJE_TEXT_EFFECT_GLOW:
665 style = EVAS_TEXT_STYLE_GLOW;
666 eo_do(ep->object,
667 evas_obj_text_glow_color_set((params->type.text.color2.r * params->type.text.color2.a) / 255,
668 (params->type.text.color2.g * params->type.text.color2.a) / 255,
669 (params->type.text.color2.b * params->type.text.color2.a) / 255,
670 params->type.text.color2.a),
671 evas_obj_text_glow2_color_set((params->type.text.color3.r * params->type.text.color3.a) / 255,
672 (params->type.text.color3.g * params->type.text.color3.a) / 255,
673 (params->type.text.color3.b * params->type.text.color3.a) / 255,
674 params->type.text.color3.a));
675 break;
676 default:
677 style = EVAS_TEXT_STYLE_PLAIN;
678 break;
679 }
680 571
681 switch (effect & EDJE_TEXT_EFFECT_MASK_SHADOW_DIRECTION) 572 efl_gfx_visible_set(params->visible));
682 { 573 }
683 case EDJE_TEXT_EFFECT_SHADOW_DIRECTION_BOTTOM_RIGHT:
684 EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET
685 (style, EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_RIGHT);
686 break;
687 case EDJE_TEXT_EFFECT_SHADOW_DIRECTION_BOTTOM:
688 EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET
689 (style, EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM);
690 break;
691 case EDJE_TEXT_EFFECT_SHADOW_DIRECTION_BOTTOM_LEFT:
692 EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET
693 (style, EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_LEFT);
694 break;
695 case EDJE_TEXT_EFFECT_SHADOW_DIRECTION_LEFT:
696 EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET
697 (style, EVAS_TEXT_STYLE_SHADOW_DIRECTION_LEFT);
698 break;
699 case EDJE_TEXT_EFFECT_SHADOW_DIRECTION_TOP_LEFT:
700 EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET
701 (style, EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_LEFT);
702 break;
703 case EDJE_TEXT_EFFECT_SHADOW_DIRECTION_TOP:
704 EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET
705 (style, EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP);
706 break;
707 case EDJE_TEXT_EFFECT_SHADOW_DIRECTION_TOP_RIGHT:
708 EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET
709 (style, EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_RIGHT);
710 break;
711 case EDJE_TEXT_EFFECT_SHADOW_DIRECTION_RIGHT:
712 EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET
713 (style, EVAS_TEXT_STYLE_SHADOW_DIRECTION_RIGHT);
714 break;
715 default:
716 break;
717 }
718 evas_object_text_style_set(ep->object, style);
719 }
720 574
721 if (free_text) free((char *)text); 575 {
722 if (font2) free(font2); 576 Evas_Text_Style_Type style;
723 if (sfont) free(sfont); 577 Edje_Text_Effect effect;
724} 578
579 style = EVAS_TEXT_STYLE_PLAIN;
580
581 evas_object_color_set(ep->object,
582 (params->color.r * params->color.a) / 255,
583 (params->color.g * params->color.a) / 255,
584 (params->color.b * params->color.a) / 255,
585 params->color.a);
586 effect = ep->part->effect;
587 switch (effect & EDJE_TEXT_EFFECT_MASK_BASIC)
588 {
589 case EDJE_TEXT_EFFECT_NONE:
590 case EDJE_TEXT_EFFECT_PLAIN:
591 style = EVAS_TEXT_STYLE_PLAIN;
592 break;
593
594 case EDJE_TEXT_EFFECT_OUTLINE:
595 style = EVAS_TEXT_STYLE_OUTLINE;
596 evas_object_text_outline_color_set(ep->object,
597 (params->type.text.color2.r * params->type.text.color2.a) / 255,
598 (params->type.text.color2.g * params->type.text.color2.a) / 255,
599 (params->type.text.color2.b * params->type.text.color2.a) / 255,
600 params->type.text.color2.a);
601 break;
602
603 case EDJE_TEXT_EFFECT_SOFT_OUTLINE:
604 style = EVAS_TEXT_STYLE_SOFT_OUTLINE;
605 evas_object_text_outline_color_set(ep->object,
606 (params->type.text.color2.r * params->type.text.color2.a) / 255,
607 (params->type.text.color2.g * params->type.text.color2.a) / 255,
608 (params->type.text.color2.b * params->type.text.color2.a) / 255,
609 params->type.text.color2.a);
610 break;
611
612 case EDJE_TEXT_EFFECT_SHADOW:
613 style = EVAS_TEXT_STYLE_SHADOW;
614 evas_object_text_shadow_color_set(ep->object,
615 (params->type.text.color3.r * params->type.text.color3.a) / 255,
616 (params->type.text.color3.g * params->type.text.color3.a) / 255,
617 (params->type.text.color3.b * params->type.text.color3.a) / 255,
618 params->type.text.color3.a);
619 break;
620
621 case EDJE_TEXT_EFFECT_SOFT_SHADOW:
622 style = EVAS_TEXT_STYLE_SOFT_SHADOW;
623 evas_object_text_shadow_color_set(ep->object,
624 (params->type.text.color3.r * params->type.text.color3.a) / 255,
625 (params->type.text.color3.g * params->type.text.color3.a) / 255,
626 (params->type.text.color3.b * params->type.text.color3.a) / 255,
627 params->type.text.color3.a);
628 break;
629
630 case EDJE_TEXT_EFFECT_OUTLINE_SHADOW:
631 style = EVAS_TEXT_STYLE_OUTLINE_SHADOW;
632 eo_do(ep->object,
633 evas_obj_text_outline_color_set((params->type.text.color2.r * params->type.text.color2.a) / 255,
634 (params->type.text.color2.g * params->type.text.color2.a) / 255,
635 (params->type.text.color2.b * params->type.text.color2.a) / 255,
636 params->type.text.color2.a),
637 evas_obj_text_shadow_color_set((params->type.text.color3.r * params->type.text.color3.a) / 255,
638 (params->type.text.color3.g * params->type.text.color3.a) / 255,
639 (params->type.text.color3.b * params->type.text.color3.a) / 255,
640 params->type.text.color3.a));
641 break;
642
643 case EDJE_TEXT_EFFECT_OUTLINE_SOFT_SHADOW:
644 style = EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW;
645 eo_do(ep->object,
646 evas_obj_text_outline_color_set((params->type.text.color2.r * params->type.text.color2.a) / 255,
647 (params->type.text.color2.g * params->type.text.color2.a) / 255,
648 (params->type.text.color2.b * params->type.text.color2.a) / 255,
649 params->type.text.color2.a),
650 evas_obj_text_shadow_color_set((params->type.text.color3.r * params->type.text.color3.a) / 255,
651 (params->type.text.color3.g * params->type.text.color3.a) / 255,
652 (params->type.text.color3.b * params->type.text.color3.a) / 255,
653 params->type.text.color3.a));
654 break;
655
656 case EDJE_TEXT_EFFECT_FAR_SHADOW:
657 style = EVAS_TEXT_STYLE_FAR_SHADOW;
658 evas_object_text_shadow_color_set(ep->object,
659 (params->type.text.color3.r * params->type.text.color3.a) / 255,
660 (params->type.text.color3.g * params->type.text.color3.a) / 255,
661 (params->type.text.color3.b * params->type.text.color3.a) / 255,
662 params->type.text.color3.a);
663 break;
664
665 case EDJE_TEXT_EFFECT_FAR_SOFT_SHADOW:
666 style = EVAS_TEXT_STYLE_FAR_SOFT_SHADOW;
667 evas_object_text_shadow_color_set(ep->object,
668 (params->type.text.color3.r * params->type.text.color3.a) / 255,
669 (params->type.text.color3.g * params->type.text.color3.a) / 255,
670 (params->type.text.color3.b * params->type.text.color3.a) / 255,
671 params->type.text.color3.a);
672 break;
673
674 case EDJE_TEXT_EFFECT_GLOW:
675 style = EVAS_TEXT_STYLE_GLOW;
676 eo_do(ep->object,
677 evas_obj_text_glow_color_set((params->type.text.color2.r * params->type.text.color2.a) / 255,
678 (params->type.text.color2.g * params->type.text.color2.a) / 255,
679 (params->type.text.color2.b * params->type.text.color2.a) / 255,
680 params->type.text.color2.a),
681 evas_obj_text_glow2_color_set((params->type.text.color3.r * params->type.text.color3.a) / 255,
682 (params->type.text.color3.g * params->type.text.color3.a) / 255,
683 (params->type.text.color3.b * params->type.text.color3.a) / 255,
684 params->type.text.color3.a));
685 break;
686
687 default:
688 style = EVAS_TEXT_STYLE_PLAIN;
689 break;
690 }
691
692 switch (effect & EDJE_TEXT_EFFECT_MASK_SHADOW_DIRECTION)
693 {
694 case EDJE_TEXT_EFFECT_SHADOW_DIRECTION_BOTTOM_RIGHT:
695 EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET
696 (style, EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_RIGHT);
697 break;
698
699 case EDJE_TEXT_EFFECT_SHADOW_DIRECTION_BOTTOM:
700 EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET
701 (style, EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM);
702 break;
703
704 case EDJE_TEXT_EFFECT_SHADOW_DIRECTION_BOTTOM_LEFT:
705 EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET
706 (style, EVAS_TEXT_STYLE_SHADOW_DIRECTION_BOTTOM_LEFT);
707 break;
708
709 case EDJE_TEXT_EFFECT_SHADOW_DIRECTION_LEFT:
710 EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET
711 (style, EVAS_TEXT_STYLE_SHADOW_DIRECTION_LEFT);
712 break;
713
714 case EDJE_TEXT_EFFECT_SHADOW_DIRECTION_TOP_LEFT:
715 EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET
716 (style, EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_LEFT);
717 break;
718
719 case EDJE_TEXT_EFFECT_SHADOW_DIRECTION_TOP:
720 EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET
721 (style, EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP);
722 break;
723
724 case EDJE_TEXT_EFFECT_SHADOW_DIRECTION_TOP_RIGHT:
725 EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET
726 (style, EVAS_TEXT_STYLE_SHADOW_DIRECTION_TOP_RIGHT);
727 break;
728
729 case EDJE_TEXT_EFFECT_SHADOW_DIRECTION_RIGHT:
730 EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET
731 (style, EVAS_TEXT_STYLE_SHADOW_DIRECTION_RIGHT);
732 break;
733
734 default:
735 break;
736 }
737 evas_object_text_style_set(ep->object, style);
738 }
725 739
726Evas_Font_Size 740 if (free_text) free((char *)text);
727_edje_text_size_calc(Evas_Font_Size size, Edje_Text_Class *tc) 741 if (font2) free(font2);
728{ 742 if (sfont) free(sfont);
729 int val; 743 }
730 744
731 if (tc->size == 0) 745 Evas_Font_Size
732 { 746 _edje_text_size_calc(Evas_Font_Size size, Edje_Text_Class * tc)
733 val = size; 747 {
734 } 748 int val;
735 else if (tc->size > 0.0) 749
736 { 750 if (tc->size == 0)
737 val = tc->size; 751 {
738 } 752 val = size;
739 else 753 }
740 { 754 else if (tc->size > 0.0)
741 val = (size * -tc->size) / 100; 755 {
742 } 756 val = tc->size;
743 return val; 757 }
744} 758 else
759 {
760 val = (size * -tc->size) / 100;
761 }
762 return val;
763 }