summaryrefslogtreecommitdiff
path: root/src/lib/edje/edje_text.c
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2015-11-01 21:57:43 -0200
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2015-11-01 21:57:43 -0200
commitfa88a2337f4c1ed74dbe5f8e9b8ab9e80aa94215 (patch)
tree289d1f0e30abe7aeb9100ab9ed3e3a755d1c18b7 /src/lib/edje/edje_text.c
parentb9a6a8e7384fc79fced2132407208abfedf77fe1 (diff)
Eo: Partial implementation to remove eo_dodevs/felipealmeida/eo_optimisations
Diffstat (limited to 'src/lib/edje/edje_text.c')
-rw-r--r--src/lib/edje/edje_text.c88
1 files changed, 44 insertions, 44 deletions
diff --git a/src/lib/edje/edje_text.c b/src/lib/edje/edje_text.c
index a49b661..59b20a5 100644
--- a/src/lib/edje/edje_text.c
+++ b/src/lib/edje/edje_text.c
@@ -19,7 +19,7 @@ static inline void
19part_get_geometry(Edje_Real_Part *rp, Evas_Coord *w, Evas_Coord *h) 19part_get_geometry(Edje_Real_Part *rp, Evas_Coord *w, Evas_Coord *h)
20{ 20{
21 if (!rp->part->use_alternate_font_metrics) 21 if (!rp->part->use_alternate_font_metrics)
22 eo_do(rp->object, efl_gfx_size_get(w, h)); 22 eo_do(rp->object, efl_gfx_size_get(rp->object, w, h));
23 else 23 else
24 { 24 {
25 if (w) *w = evas_object_text_horiz_advance_get(rp->object); 25 if (w) *w = evas_object_text_horiz_advance_get(rp->object);
@@ -132,10 +132,10 @@ _edje_text_fit_x(Edje *ed, Edje_Real_Part *ep,
132 if (ep->part->scale) evas_object_scale_set(ep->object, TO_DOUBLE(sc)); 132 if (ep->part->scale) evas_object_scale_set(ep->object, TO_DOUBLE(sc));
133 133
134 eo_do(ep->object, 134 eo_do(ep->object,
135 evas_obj_text_ellipsis_set(chosen_desc->text.min_x ? -1 : params->type.text.ellipsis), 135 evas_obj_text_ellipsis_set(ep->object, chosen_desc->text.min_x ? -1 : params->type.text.ellipsis),
136 efl_text_properties_font_set(font, size), 136 efl_text_properties_font_set(ep->object, font, size),
137 efl_text_set(text), 137 efl_text_set(ep->object, text),
138 efl_gfx_size_set(sw, sh)); 138 efl_gfx_size_set(ep->object, sw, sh));
139 139
140 return text; 140 return text;
141} 141}
@@ -323,13 +323,13 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
323 { 323 {
324 eo_do(ep->object, 324 eo_do(ep->object,
325 325
326 if (inlined_font) efl_text_properties_font_source_set(ed->path); 326 if (inlined_font) efl_text_properties_font_source_set(ep->object, ed->path);
327 else efl_text_properties_font_source_set(NULL); 327 else efl_text_properties_font_source_set(ep->object, NULL);
328 328
329 if (ep->part->scale) evas_obj_scale_set(TO_DOUBLE(sc)); 329 if (ep->part->scale) evas_obj_scale_set(ep->object, TO_DOUBLE(sc));
330 330
331 efl_text_properties_font_set(font, size); 331 efl_text_properties_font_set(ep->object, font, size);
332 efl_text_set(text)); 332 efl_text_set(ep->object, text));
333 333
334 part_get_geometry(ep, &tw, &th); 334 part_get_geometry(ep, &tw, &th);
335 /* Find the wanted font size */ 335 /* Find the wanted font size */
@@ -339,12 +339,12 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
339 339
340 eo_do(ep->object, 340 eo_do(ep->object,
341 341
342 if (inlined_font) efl_text_properties_font_source_set(ed->path); 342 if (inlined_font) efl_text_properties_font_source_set(ep->object, ed->path);
343 else efl_text_properties_font_source_set(NULL); 343 else efl_text_properties_font_source_set(ep->object, NULL);
344 344
345 if (ep->part->scale) evas_obj_scale_set(TO_DOUBLE(sc)); 345 if (ep->part->scale) evas_obj_scale_set(ep->object, TO_DOUBLE(sc));
346 346
347 efl_text_properties_font_set(font, size)); 347 efl_text_properties_font_set(ep->object, font, size));
348 348
349 part_get_geometry(ep, &tw, &th); 349 part_get_geometry(ep, &tw, &th);
350 } 350 }
@@ -363,13 +363,13 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
363 363
364 eo_do(ep->object, 364 eo_do(ep->object,
365 365
366 if (inlined_font) efl_text_properties_font_source_set(ed->path); 366 if (inlined_font) efl_text_properties_font_source_set(ep->object, ed->path);
367 else efl_text_properties_font_source_set(NULL); 367 else efl_text_properties_font_source_set(ep->object, NULL);
368 368
369 if (ep->part->scale) evas_obj_scale_set(TO_DOUBLE(sc)); 369 if (ep->part->scale) evas_obj_scale_set(ep->object, TO_DOUBLE(sc));
370 370
371 efl_text_properties_font_set(font, size); 371 efl_text_properties_font_set(ep->object, font, size);
372 efl_text_set(text)); 372 efl_text_set(ep->object, text));
373 part_get_geometry(ep, &tw, &th); 373 part_get_geometry(ep, &tw, &th);
374 374
375 /* only grow the font size if we didn't already reach the max size 375 /* only grow the font size if we didn't already reach the max size
@@ -388,11 +388,11 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
388 388
389 eo_do(ep->object, 389 eo_do(ep->object,
390 390
391 if (inlined_font) efl_text_properties_font_source_set(ed->path); 391 if (inlined_font) efl_text_properties_font_source_set(ep->object, ed->path);
392 else efl_text_properties_font_source_set(NULL); 392 else efl_text_properties_font_source_set(ep->object, NULL);
393 393
394 if (ep->part->scale) evas_obj_scale_set(TO_DOUBLE(sc)); 394 if (ep->part->scale) evas_obj_scale_set(ep->object, TO_DOUBLE(sc));
395 efl_text_properties_font_set(font, size)); 395 efl_text_properties_font_set(ep->object, font, size));
396 396
397 part_get_geometry(ep, &tw, &th); 397 part_get_geometry(ep, &tw, &th);
398 if ((size > 0) && (th == 0)) break; 398 if ((size > 0) && (th == 0)) break;
@@ -404,8 +404,8 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
404 int current; 404 int current;
405 405
406 eo_do(ep->object, 406 eo_do(ep->object,
407 if (ep->part->scale) evas_obj_scale_set(TO_DOUBLE(sc)); 407 if (ep->part->scale) evas_obj_scale_set(ep->object, TO_DOUBLE(sc));
408 efl_text_properties_font_set(font, 10)); 408 efl_text_properties_font_set(ep->object, font, 10));
409 409
410 part_get_geometry(ep, &tw, &th); 410 part_get_geometry(ep, &tw, &th);
411 411
@@ -427,8 +427,8 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
427 current = (top + bottom) / 2; 427 current = (top + bottom) / 2;
428 428
429 eo_do(ep->object, 429 eo_do(ep->object,
430 if (ep->part->scale) evas_obj_scale_set(TO_DOUBLE(sc)); 430 if (ep->part->scale) evas_obj_scale_set(ep->object, TO_DOUBLE(sc));
431 efl_text_properties_font_set(font, current)); 431 efl_text_properties_font_set(ep->object, font, current));
432 432
433 part_get_geometry(ep, &tw, &th); 433 part_get_geometry(ep, &tw, &th);
434 434
@@ -444,8 +444,8 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
444 current++; 444 current++;
445 445
446 eo_do(ep->object, 446 eo_do(ep->object,
447 if (ep->part->scale) evas_obj_scale_set(TO_DOUBLE(sc)); 447 if (ep->part->scale) evas_obj_scale_set(ep->object, TO_DOUBLE(sc));
448 efl_text_properties_font_set(font, current)); 448 efl_text_properties_font_set(ep->object, font, current));
449 449
450 part_get_geometry(ep, &tw, &th); 450 part_get_geometry(ep, &tw, &th);
451 } while (th <= sh); 451 } while (th <= sh);
@@ -466,8 +466,8 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
466 if (!chosen_desc->text.min_x) 466 if (!chosen_desc->text.min_x)
467 { 467 {
468 eo_do (ep->object, 468 eo_do (ep->object,
469 if (inlined_font) efl_text_properties_font_source_set(ed->path); 469 if (inlined_font) efl_text_properties_font_source_set(ep->object, ed->path);
470 else efl_text_properties_font_source_set(NULL)); 470 else efl_text_properties_font_source_set(ep->object, NULL));
471 471
472 text = _edje_text_fit_x(ed, ep, params, chosen_desc, 472 text = _edje_text_fit_x(ed, ep, params, chosen_desc,
473 text, font, size, 473 text, font, size,
@@ -509,13 +509,13 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
509arrange_text: 509arrange_text:
510 510
511 eo_do(ep->object, 511 eo_do(ep->object,
512 if (inlined_font) efl_text_properties_font_source_set(ed->path); 512 if (inlined_font) efl_text_properties_font_source_set(ep->object, ed->path);
513 else efl_text_properties_font_source_set(NULL); 513 else efl_text_properties_font_source_set(ep->object, NULL);
514 514
515 if (ep->part->scale) evas_obj_scale_set(TO_DOUBLE(sc)); 515 if (ep->part->scale) evas_obj_scale_set(ep->object, TO_DOUBLE(sc));
516 516
517 efl_text_properties_font_set(font, size); 517 efl_text_properties_font_set(ep->object, font, size);
518 efl_text_set(text)); 518 efl_text_set(ep->object, text));
519 part_get_geometry(ep, &tw, &th); 519 part_get_geometry(ep, &tw, &th);
520 520
521 /* Handle alignment */ 521 /* Handle alignment */
@@ -544,10 +544,10 @@ arrange_text:
544 if (!calc_only) 544 if (!calc_only)
545 { 545 {
546 eo_do(ep->object, 546 eo_do(ep->object,
547 efl_gfx_position_set(ed->x + TO_INT(params->eval.x) + ep->typedata.text->offset.x, 547 efl_gfx_position_set(ep->object, ed->x + TO_INT(params->eval.x) + ep->typedata.text->offset.x,
548 ed->y + TO_INT(params->eval.y) + ep->typedata.text->offset.y); 548 ed->y + TO_INT(params->eval.y) + ep->typedata.text->offset.y);
549 549
550 efl_gfx_visible_set(params->visible)); 550 efl_gfx_visible_set(ep->object, params->visible));
551 } 551 }
552 552
553 { 553 {
@@ -608,11 +608,11 @@ arrange_text:
608 case EDJE_TEXT_EFFECT_OUTLINE_SHADOW: 608 case EDJE_TEXT_EFFECT_OUTLINE_SHADOW:
609 style = EVAS_TEXT_STYLE_OUTLINE_SHADOW; 609 style = EVAS_TEXT_STYLE_OUTLINE_SHADOW;
610 eo_do(ep->object, 610 eo_do(ep->object,
611 evas_obj_text_outline_color_set((params->type.text.color2.r * params->type.text.color2.a) / 255, 611 evas_obj_text_outline_color_set(ep->object, (params->type.text.color2.r * params->type.text.color2.a) / 255,
612 (params->type.text.color2.g * params->type.text.color2.a) / 255, 612 (params->type.text.color2.g * params->type.text.color2.a) / 255,
613 (params->type.text.color2.b * params->type.text.color2.a) / 255, 613 (params->type.text.color2.b * params->type.text.color2.a) / 255,
614 params->type.text.color2.a), 614 params->type.text.color2.a),
615 evas_obj_text_shadow_color_set((params->type.text.color3.r * params->type.text.color3.a) / 255, 615 evas_obj_text_shadow_color_set(ep->object, (params->type.text.color3.r * params->type.text.color3.a) / 255,
616 (params->type.text.color3.g * 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, 617 (params->type.text.color3.b * params->type.text.color3.a) / 255,
618 params->type.text.color3.a)); 618 params->type.text.color3.a));
@@ -621,11 +621,11 @@ arrange_text:
621 case EDJE_TEXT_EFFECT_OUTLINE_SOFT_SHADOW: 621 case EDJE_TEXT_EFFECT_OUTLINE_SOFT_SHADOW:
622 style = EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW; 622 style = EVAS_TEXT_STYLE_OUTLINE_SOFT_SHADOW;
623 eo_do(ep->object, 623 eo_do(ep->object,
624 evas_obj_text_outline_color_set((params->type.text.color2.r * params->type.text.color2.a) / 255, 624 evas_obj_text_outline_color_set(ep->object, (params->type.text.color2.r * params->type.text.color2.a) / 255,
625 (params->type.text.color2.g * params->type.text.color2.a) / 255, 625 (params->type.text.color2.g * params->type.text.color2.a) / 255,
626 (params->type.text.color2.b * params->type.text.color2.a) / 255, 626 (params->type.text.color2.b * params->type.text.color2.a) / 255,
627 params->type.text.color2.a), 627 params->type.text.color2.a),
628 evas_obj_text_shadow_color_set((params->type.text.color3.r * params->type.text.color3.a) / 255, 628 evas_obj_text_shadow_color_set(ep->object, (params->type.text.color3.r * params->type.text.color3.a) / 255,
629 (params->type.text.color3.g * params->type.text.color3.a) / 255, 629 (params->type.text.color3.g * params->type.text.color3.a) / 255,
630 (params->type.text.color3.b * params->type.text.color3.a) / 255, 630 (params->type.text.color3.b * params->type.text.color3.a) / 255,
631 params->type.text.color3.a)); 631 params->type.text.color3.a));
@@ -652,11 +652,11 @@ arrange_text:
652 case EDJE_TEXT_EFFECT_GLOW: 652 case EDJE_TEXT_EFFECT_GLOW:
653 style = EVAS_TEXT_STYLE_GLOW; 653 style = EVAS_TEXT_STYLE_GLOW;
654 eo_do(ep->object, 654 eo_do(ep->object,
655 evas_obj_text_glow_color_set((params->type.text.color2.r * params->type.text.color2.a) / 255, 655 evas_obj_text_glow_color_set(ep->object, (params->type.text.color2.r * params->type.text.color2.a) / 255,
656 (params->type.text.color2.g * params->type.text.color2.a) / 255, 656 (params->type.text.color2.g * params->type.text.color2.a) / 255,
657 (params->type.text.color2.b * params->type.text.color2.a) / 255, 657 (params->type.text.color2.b * params->type.text.color2.a) / 255,
658 params->type.text.color2.a), 658 params->type.text.color2.a),
659 evas_obj_text_glow2_color_set((params->type.text.color3.r * params->type.text.color3.a) / 255, 659 evas_obj_text_glow2_color_set(ep->object, (params->type.text.color3.r * params->type.text.color3.a) / 255,
660 (params->type.text.color3.g * 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, 661 (params->type.text.color3.b * params->type.text.color3.a) / 255,
662 params->type.text.color3.a)); 662 params->type.text.color3.a));