summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-11-29 17:59:34 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-11-30 10:48:24 +0900
commit8803040484721c15e5a7f48f4373b38d41d9d42e (patch)
tree3dad6f6b9a0a0a33564231360bcc50e4160e5cef /src
parent73e3a82bc2046f26de3c76e38c525fd1218df088 (diff)
evas: Implement scale API in proper EO fashion
This removes the internal function pointer for scale_update. This makes all relevant classes implement the scale API in EO. This removes the duplicate function in Efl.Canvas.Object and only uses the one from Efl.Ui.Base interface. This *seems* to be working as expected. Fingers crossed! PS: I don't like the name Efl.Ui.Base. It's an interface for a few common API's between Gfx, Canvas and UI levels... Maybe scale simply doesn't belong there.
Diffstat (limited to '')
-rw-r--r--src/bin/elementary/test_gfx_filters.c4
-rw-r--r--src/lib/edje/edje_text.c14
-rw-r--r--src/lib/edje/edje_textblock.c10
-rw-r--r--src/lib/evas/Evas_Legacy.h30
-rw-r--r--src/lib/evas/canvas/efl_canvas_object.eo24
-rw-r--r--src/lib/evas/canvas/efl_canvas_text.eo6
-rw-r--r--src/lib/evas/canvas/efl_canvas_vg.c1
-rw-r--r--src/lib/evas/canvas/evas_object_image.c1
-rw-r--r--src/lib/evas/canvas/evas_object_line.c1
-rw-r--r--src/lib/evas/canvas/evas_object_main.c20
-rw-r--r--src/lib/evas/canvas/evas_object_polygon.c1
-rw-r--r--src/lib/evas/canvas/evas_object_rectangle.c1
-rw-r--r--src/lib/evas/canvas/evas_object_smart.c1
-rw-r--r--src/lib/evas/canvas/evas_object_text.c15
-rw-r--r--src/lib/evas/canvas/evas_object_textblock.c16
-rw-r--r--src/lib/evas/canvas/evas_object_textgrid.c16
-rw-r--r--src/lib/evas/canvas/evas_text.eo4
-rw-r--r--src/lib/evas/canvas/evas_textgrid.eo4
-rw-r--r--src/lib/evas/include/evas_private.h2
19 files changed, 90 insertions, 81 deletions
diff --git a/src/bin/elementary/test_gfx_filters.c b/src/bin/elementary/test_gfx_filters.c
index ae7ee106b0..f87e38ed7f 100644
--- a/src/bin/elementary/test_gfx_filters.c
+++ b/src/bin/elementary/test_gfx_filters.c
@@ -453,7 +453,7 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
453 o = text = evas_object_text_add(evas_object_evas_get(win)); 453 o = text = evas_object_text_add(evas_object_evas_get(win));
454 efl_event_callback_add(o, EFL_GFX_EVENT_RESIZE, _text_resize, NULL); 454 efl_event_callback_add(o, EFL_GFX_EVENT_RESIZE, _text_resize, NULL);
455 efl_text_properties_font_set(o, "Sans:style=Bold", default_font_size); 455 efl_text_properties_font_set(o, "Sans:style=Bold", default_font_size);
456 efl_canvas_object_scale_set(text, elm_config_scale_get()); 456 efl_ui_scale_set(text, elm_config_scale_get());
457 efl_text_set(o, "EFL"); 457 efl_text_set(o, "EFL");
458 efl_gfx_visible_set(o, 1); 458 efl_gfx_visible_set(o, 1);
459 efl_pack(box2, o); 459 efl_pack(box2, o);
@@ -492,7 +492,7 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
492 efl_gfx_filter_data_set(o, prg_data[k].name, prg_data[k].value, prg_data[k].exec); 492 efl_gfx_filter_data_set(o, prg_data[k].name, prg_data[k].value, prg_data[k].exec);
493 evas_object_textblock_style_set(o, st); 493 evas_object_textblock_style_set(o, st);
494 evas_object_textblock_text_markup_set(o, tbtxt); 494 evas_object_textblock_text_markup_set(o, tbtxt);
495 efl_canvas_object_scale_set(o, elm_config_scale_get()); 495 efl_ui_scale_set(o, elm_config_scale_get());
496 efl_pack(box2, o); 496 efl_pack(box2, o);
497 evas_object_resize(o, 1, 1); 497 evas_object_resize(o, 1, 1);
498 } 498 }
diff --git a/src/lib/edje/edje_text.c b/src/lib/edje/edje_text.c
index 3144a9e264..4cf2d83933 100644
--- a/src/lib/edje/edje_text.c
+++ b/src/lib/edje/edje_text.c
@@ -336,7 +336,7 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
336 if (inlined_font) efl_text_properties_font_source_set(ep->object, ed->path); 336 if (inlined_font) efl_text_properties_font_source_set(ep->object, ed->path);
337 else efl_text_properties_font_source_set(ep->object, NULL); 337 else efl_text_properties_font_source_set(ep->object, NULL);
338 338
339 if (ep->part->scale) efl_canvas_object_scale_set(ep->object, TO_DOUBLE(sc)); 339 if (ep->part->scale) efl_ui_scale_set(ep->object, TO_DOUBLE(sc));
340 340
341 efl_text_set(ep->object, text); 341 efl_text_set(ep->object, text);
342 /* the fit shoult not depend on font size, because it give the differet 342 /* the fit shoult not depend on font size, because it give the differet
@@ -366,7 +366,7 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
366 if (inlined_font) efl_text_properties_font_source_set(ep->object, ed->path); 366 if (inlined_font) efl_text_properties_font_source_set(ep->object, ed->path);
367 else efl_text_properties_font_source_set(ep->object, NULL); 367 else efl_text_properties_font_source_set(ep->object, NULL);
368 368
369 if (ep->part->scale) efl_canvas_object_scale_set(ep->object, TO_DOUBLE(sc)); 369 if (ep->part->scale) efl_ui_scale_set(ep->object, TO_DOUBLE(sc));
370 370
371 efl_text_properties_font_set(ep->object, font, size); 371 efl_text_properties_font_set(ep->object, font, size);
372 efl_text_set(ep->object, text); 372 efl_text_set(ep->object, text);
@@ -389,7 +389,7 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
389 if (inlined_font) efl_text_properties_font_source_set(ep->object, ed->path); 389 if (inlined_font) efl_text_properties_font_source_set(ep->object, ed->path);
390 else efl_text_properties_font_source_set(ep->object, NULL); 390 else efl_text_properties_font_source_set(ep->object, NULL);
391 391
392 if (ep->part->scale) efl_canvas_object_scale_set(ep->object, TO_DOUBLE(sc)); 392 if (ep->part->scale) efl_ui_scale_set(ep->object, TO_DOUBLE(sc));
393 efl_text_properties_font_set(ep->object, font, size); 393 efl_text_properties_font_set(ep->object, font, size);
394 394
395 part_get_geometry(ep, &tw, &th); 395 part_get_geometry(ep, &tw, &th);
@@ -401,7 +401,7 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
401 { 401 {
402 int current; 402 int current;
403 403
404 if (ep->part->scale) efl_canvas_object_scale_set(ep->object, TO_DOUBLE(sc)); 404 if (ep->part->scale) efl_ui_scale_set(ep->object, TO_DOUBLE(sc));
405 efl_text_properties_font_set(ep->object, font, 10); 405 efl_text_properties_font_set(ep->object, font, 10);
406 406
407 part_get_geometry(ep, &tw, &th); 407 part_get_geometry(ep, &tw, &th);
@@ -423,7 +423,7 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
423 { 423 {
424 current = (top + bottom) / 2; 424 current = (top + bottom) / 2;
425 425
426 if (ep->part->scale) efl_canvas_object_scale_set(ep->object, TO_DOUBLE(sc)); 426 if (ep->part->scale) efl_ui_scale_set(ep->object, TO_DOUBLE(sc));
427 efl_text_properties_font_set(ep->object, font, current); 427 efl_text_properties_font_set(ep->object, font, current);
428 428
429 part_get_geometry(ep, &tw, &th); 429 part_get_geometry(ep, &tw, &th);
@@ -439,7 +439,7 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
439 { 439 {
440 current++; 440 current++;
441 441
442 if (ep->part->scale) efl_canvas_object_scale_set(ep->object, TO_DOUBLE(sc)); 442 if (ep->part->scale) efl_ui_scale_set(ep->object, TO_DOUBLE(sc));
443 efl_text_properties_font_set(ep->object, font, current); 443 efl_text_properties_font_set(ep->object, font, current);
444 444
445 part_get_geometry(ep, &tw, &th); 445 part_get_geometry(ep, &tw, &th);
@@ -488,7 +488,7 @@ arrange_text:
488 if (inlined_font) efl_text_properties_font_source_set(ep->object, ed->path); 488 if (inlined_font) efl_text_properties_font_source_set(ep->object, ed->path);
489 else efl_text_properties_font_source_set(ep->object, NULL); 489 else efl_text_properties_font_source_set(ep->object, NULL);
490 490
491 if (ep->part->scale) efl_canvas_object_scale_set(ep->object, TO_DOUBLE(sc)); 491 if (ep->part->scale) efl_ui_scale_set(ep->object, TO_DOUBLE(sc));
492 492
493 efl_text_properties_font_set(ep->object, font, size); 493 efl_text_properties_font_set(ep->object, font, size);
494 efl_text_set(ep->object, text); 494 efl_text_set(ep->object, text);
diff --git a/src/lib/edje/edje_textblock.c b/src/lib/edje/edje_textblock.c
index 0451099fa4..08d9092e5f 100644
--- a/src/lib/edje/edje_textblock.c
+++ b/src/lib/edje/edje_textblock.c
@@ -458,7 +458,7 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
458 double s = base_s; 458 double s = base_s;
459 459
460 if (ep->part->scale) base_s = TO_DOUBLE(sc); 460 if (ep->part->scale) base_s = TO_DOUBLE(sc);
461 efl_canvas_object_scale_set(ep->object, base_s); 461 efl_ui_scale_set(ep->object, base_s);
462 efl_canvas_text_size_native_get(ep->object, &tw, &th); 462 efl_canvas_text_size_native_get(ep->object, &tw, &th);
463 463
464 orig_s = base_s; 464 orig_s = base_s;
@@ -467,7 +467,7 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
467 { 467 {
468 orig_s = _edje_part_recalc_single_textblock_scale_range_adjust(chosen_desc, base_s, 468 orig_s = _edje_part_recalc_single_textblock_scale_range_adjust(chosen_desc, base_s,
469 orig_s * TO_INT(params->eval.w) / tw); 469 orig_s * TO_INT(params->eval.w) / tw);
470 efl_canvas_object_scale_set(ep->object, orig_s); 470 efl_ui_scale_set(ep->object, orig_s);
471 efl_canvas_text_size_native_get(ep->object, &tw, &th); 471 efl_canvas_text_size_native_get(ep->object, &tw, &th);
472 } 472 }
473 if (chosen_desc->text.fit_x) 473 if (chosen_desc->text.fit_x)
@@ -476,7 +476,7 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
476 { 476 {
477 s = _edje_part_recalc_single_textblock_scale_range_adjust(chosen_desc, base_s, 477 s = _edje_part_recalc_single_textblock_scale_range_adjust(chosen_desc, base_s,
478 orig_s * TO_INT(params->eval.w) / tw); 478 orig_s * TO_INT(params->eval.w) / tw);
479 efl_canvas_object_scale_set(ep->object, s); 479 efl_ui_scale_set(ep->object, s);
480 efl_canvas_text_size_native_get(ep->object, NULL, NULL); 480 efl_canvas_text_size_native_get(ep->object, NULL, NULL);
481 } 481 }
482 } 482 }
@@ -493,7 +493,7 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
493 s = tmp_s; 493 s = tmp_s;
494 } 494 }
495 495
496 efl_canvas_object_scale_set(ep->object, s); 496 efl_ui_scale_set(ep->object, s);
497 efl_canvas_text_size_native_get(ep->object, NULL, NULL); 497 efl_canvas_text_size_native_get(ep->object, NULL, NULL);
498 } 498 }
499 } 499 }
@@ -518,7 +518,7 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
518 break; 518 break;
519 s = tmp_s; 519 s = tmp_s;
520 520
521 efl_canvas_object_scale_set(ep->object, s); 521 efl_ui_scale_set(ep->object, s);
522 efl_canvas_text_size_native_get(ep->object, &fw, &fh); 522 efl_canvas_text_size_native_get(ep->object, &fw, &fh);
523 i--; 523 i--;
524 } 524 }
diff --git a/src/lib/evas/Evas_Legacy.h b/src/lib/evas/Evas_Legacy.h
index e900090b88..de7bf35d45 100644
--- a/src/lib/evas/Evas_Legacy.h
+++ b/src/lib/evas/Evas_Legacy.h
@@ -2181,6 +2181,36 @@ EAPI Evas_Render_Op evas_object_render_op_get(const Evas_Object *obj);
2181 */ 2181 */
2182EAPI Eina_Bool evas_object_static_clip_get(const Evas_Object *obj); 2182EAPI Eina_Bool evas_object_static_clip_get(const Evas_Object *obj);
2183 2183
2184/**
2185 * @brief Sets the scaling factor for an Evas object. Does not affect all
2186 * objects.
2187 *
2188 * This will multiply the object's dimension by the given factor, thus altering
2189 * its geometry (width and height). Useful when you want scalable UI elements,
2190 * possibly at run time.
2191 *
2192 * @note Only text and textblock objects have scaling change handlers. Other
2193 * objects won't change visually on this call.
2194 *
2195 * @param[in] obj The object.
2196 * @param[in] scale The scaling factor. 1.0 means no scaling, default size.
2197 *
2198 * @ingroup Evas_Object
2199 */
2200EAPI void evas_object_scale_set(Evas_Object *obj, double scale);
2201
2202/**
2203 * @brief Retrieves the scaling factor for the given Evas object.
2204 *
2205 * @param[in] obj The object.
2206 *
2207 * @return The scaling factor. 1.0 means no scaling, default size.
2208 *
2209 * @ingroup Evas_Object
2210 */
2211EAPI double evas_object_scale_get(const Evas_Object *obj);
2212
2213
2184#include "canvas/efl_canvas_object.eo.legacy.h" 2214#include "canvas/efl_canvas_object.eo.legacy.h"
2185 2215
2186/** 2216/**
diff --git a/src/lib/evas/canvas/efl_canvas_object.eo b/src/lib/evas/canvas/efl_canvas_object.eo
index efb1981387..29d7357852 100644
--- a/src/lib/evas/canvas/efl_canvas_object.eo
+++ b/src/lib/evas/canvas/efl_canvas_object.eo
@@ -3,7 +3,7 @@ import efl_animation_types;
3 3
4abstract Efl.Canvas.Object (Efl.Object, Efl.Gfx, Efl.Gfx.Stack, Efl.Animator, 4abstract Efl.Canvas.Object (Efl.Object, Efl.Gfx, Efl.Gfx.Stack, Efl.Animator,
5 Efl.Input.Interface, Efl.Gfx.Size.Hint, 5 Efl.Input.Interface, Efl.Gfx.Size.Hint,
6 Efl.Gfx.Map, Efl.Loop_User) 6 Efl.Gfx.Map, Efl.Loop_User, Efl.Ui.Base)
7{ 7{
8 [[Efl canvas object abstract class]] 8 [[Efl canvas object abstract class]]
9 legacy_prefix: evas_object; 9 legacy_prefix: evas_object;
@@ -229,27 +229,6 @@ abstract Efl.Canvas.Object (Efl.Object, Efl.Gfx, Efl.Gfx.Stack, Efl.Animator,
229 not ($false).]] 229 not ($false).]]
230 } 230 }
231 } 231 }
232 @property scale {
233 set {
234 [[Sets the scaling factor for an Evas object. Does not affect
235 all objects.
236
237 This will multiply the object's dimension by the given factor,
238 thus altering its geometry (width and height). Useful when
239 you want scalable UI elements, possibly at run time.
240
241 Note: Only text and textblock objects have scaling change
242 handlers. Other objects won't change visually on this call.
243 ]]
244 }
245 get {
246 [[Retrieves the scaling factor for the given Evas object.]]
247 }
248 values {
249 scale: double; [[The scaling factor. 1.0 means no scaling,
250 default size.]]
251 }
252 }
253 @property key_focus { 232 @property key_focus {
254 [[Indicates that this object is the keyboard event receiver on 233 [[Indicates that this object is the keyboard event receiver on
255 its canvas. 234 its canvas.
@@ -703,6 +682,7 @@ abstract Efl.Canvas.Object (Efl.Object, Efl.Gfx, Efl.Gfx.Stack, Efl.Animator,
703 Efl.Gfx.Size.Hint.hint_max { get; set; } 682 Efl.Gfx.Size.Hint.hint_max { get; set; }
704 Efl.Gfx.Size.Hint.hint_margin { get; set; } 683 Efl.Gfx.Size.Hint.hint_margin { get; set; }
705 Efl.Gfx.Size.Hint.hint_weight { get; set; } 684 Efl.Gfx.Size.Hint.hint_weight { get; set; }
685 Efl.Ui.Base.scale { get; set; }
706 Efl.Input.Interface.seat_event_filter { get; set; } 686 Efl.Input.Interface.seat_event_filter { get; set; }
707 Efl.Loop_User.loop { get; } 687 Efl.Loop_User.loop { get; }
708 } 688 }
diff --git a/src/lib/evas/canvas/efl_canvas_text.eo b/src/lib/evas/canvas/efl_canvas_text.eo
index e401577d18..7d04742ba2 100644
--- a/src/lib/evas/canvas/efl_canvas_text.eo
+++ b/src/lib/evas/canvas/efl_canvas_text.eo
@@ -3,8 +3,9 @@ import efl_text_types;
3struct Efl.Canvas.Text.Style; [[EFL text style data structure]] 3struct Efl.Canvas.Text.Style; [[EFL text style data structure]]
4 4
5class Efl.Canvas.Text (Efl.Canvas.Object, Efl.Text, Efl.Text.Properties, 5class Efl.Canvas.Text (Efl.Canvas.Object, Efl.Text, Efl.Text.Properties,
6Efl.Canvas.Filter.Internal, Efl.Text.Font, Efl.Text.Style, Efl.Text.Format, 6 Efl.Canvas.Filter.Internal, Efl.Text.Font,
7Efl.Text.Cursor, Efl.Text.Annotate, Efl.Text.Markup) 7 Efl.Text.Style, Efl.Text.Format, Efl.Text.Cursor,
8 Efl.Text.Annotate, Efl.Text.Markup, Efl.Ui.Base)
8{ 9{
9 [[Efl canvas text class]] 10 [[Efl canvas text class]]
10 legacy_prefix: evas_object_textblock; 11 legacy_prefix: evas_object_textblock;
@@ -350,6 +351,7 @@ Efl.Text.Cursor, Efl.Text.Annotate, Efl.Text.Markup)
350 Efl.Text.Annotate.cursor_object_item_insert; 351 Efl.Text.Annotate.cursor_object_item_insert;
351 Efl.Text.Markup.markup { set; get; } 352 Efl.Text.Markup.markup { set; get; }
352 Efl.Text.Markup.cursor_markup_insert; 353 Efl.Text.Markup.cursor_markup_insert;
354 Efl.Ui.Base.scale { set; }
353 } 355 }
354 events { 356 events {
355 cursor,changed; [[Called when cursor changed]] 357 cursor,changed; [[Called when cursor changed]]
diff --git a/src/lib/evas/canvas/efl_canvas_vg.c b/src/lib/evas/canvas/efl_canvas_vg.c
index 4d204edd41..c8a83acbb1 100644
--- a/src/lib/evas/canvas/efl_canvas_vg.c
+++ b/src/lib/evas/canvas/efl_canvas_vg.c
@@ -57,7 +57,6 @@ static const Evas_Object_Func object_func =
57 NULL, 57 NULL,
58 NULL, 58 NULL,
59 NULL, 59 NULL,
60 NULL,
61 NULL, // render_prepare 60 NULL, // render_prepare
62 NULL 61 NULL
63}; 62};
diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c
index 9c464ac881..e565baf9b0 100644
--- a/src/lib/evas/canvas/evas_object_image.c
+++ b/src/lib/evas/canvas/evas_object_image.c
@@ -75,7 +75,6 @@ static const Evas_Object_Func object_func =
75 evas_object_image_is_inside, 75 evas_object_image_is_inside,
76 NULL, 76 NULL,
77 NULL, 77 NULL,
78 NULL,
79 evas_object_image_has_opaque_rect, 78 evas_object_image_has_opaque_rect,
80 evas_object_image_get_opaque_rect, 79 evas_object_image_get_opaque_rect,
81 evas_object_image_can_map, 80 evas_object_image_can_map,
diff --git a/src/lib/evas/canvas/evas_object_line.c b/src/lib/evas/canvas/evas_object_line.c
index 1790fbf8b1..f6f9d573a8 100644
--- a/src/lib/evas/canvas/evas_object_line.c
+++ b/src/lib/evas/canvas/evas_object_line.c
@@ -84,7 +84,6 @@ static const Evas_Object_Func object_func =
84 NULL, 84 NULL,
85 NULL, 85 NULL,
86 NULL, 86 NULL,
87 NULL,
88 NULL, // render_prepare 87 NULL, // render_prepare
89 NULL 88 NULL
90}; 89};
diff --git a/src/lib/evas/canvas/evas_object_main.c b/src/lib/evas/canvas/evas_object_main.c
index bb6eee1014..01fb1e4c04 100644
--- a/src/lib/evas/canvas/evas_object_main.c
+++ b/src/lib/evas/canvas/evas_object_main.c
@@ -2218,7 +2218,7 @@ _efl_canvas_object_anti_alias_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_
2218} 2218}
2219 2219
2220EOLIAN static void 2220EOLIAN static void
2221_efl_canvas_object_scale_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, double scale) 2221_efl_canvas_object_efl_ui_base_scale_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, double scale)
2222{ 2222{
2223 if (obj->delete_me) return; 2223 if (obj->delete_me) return;
2224 if (EINA_DBL_EQ(obj->cur->scale, scale)) return; 2224 if (EINA_DBL_EQ(obj->cur->scale, scale)) return;
@@ -2229,13 +2229,11 @@ _efl_canvas_object_scale_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, double
2229 state_write->scale = scale; 2229 state_write->scale = scale;
2230 } 2230 }
2231 EINA_COW_STATE_WRITE_END(obj, state_write, cur); 2231 EINA_COW_STATE_WRITE_END(obj, state_write, cur);
2232
2233 evas_object_change(eo_obj, obj); 2232 evas_object_change(eo_obj, obj);
2234 if (obj->func->scale_update) obj->func->scale_update(eo_obj, obj, obj->private_data);
2235} 2233}
2236 2234
2237EOLIAN static double 2235EOLIAN static double
2238_efl_canvas_object_scale_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj) 2236_efl_canvas_object_efl_ui_base_scale_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
2239{ 2237{
2240 if (obj->delete_me) return 1.0; 2238 if (obj->delete_me) return 1.0;
2241 return obj->cur->scale; 2239 return obj->cur->scale;
@@ -2309,7 +2307,7 @@ _efl_canvas_object_efl_object_dbg_info_get(Eo *eo_obj, Evas_Object_Protected_Dat
2309 layer = efl_gfx_stack_layer_get(eo_obj); 2307 layer = efl_gfx_stack_layer_get(eo_obj);
2310 name = efl_name_get(eo_obj); // evas_object_name_get(eo_obj); 2308 name = efl_name_get(eo_obj); // evas_object_name_get(eo_obj);
2311 geom = efl_gfx_geometry_get(eo_obj); 2309 geom = efl_gfx_geometry_get(eo_obj);
2312 scale = efl_canvas_object_scale_get(eo_obj); 2310 scale = efl_ui_scale_get(eo_obj);
2313 min = efl_gfx_size_hint_restricted_min_get(eo_obj); 2311 min = efl_gfx_size_hint_restricted_min_get(eo_obj);
2314 max = efl_gfx_size_hint_max_get(eo_obj); 2312 max = efl_gfx_size_hint_max_get(eo_obj);
2315 //efl_gfx_size_hint_request_get(eo_obj, &requestw, &requesth); 2313 //efl_gfx_size_hint_request_get(eo_obj, &requestw, &requesth);
@@ -2970,6 +2968,18 @@ evas_object_evas_get(const Eo *eo_obj)
2970 return efl_provider_find((Eo *) eo_obj, EVAS_CANVAS_CLASS); 2968 return efl_provider_find((Eo *) eo_obj, EVAS_CANVAS_CLASS);
2971} 2969}
2972 2970
2971EAPI void
2972evas_object_scale_set(Evas_Object *obj, double scale)
2973{
2974 efl_ui_scale_set(obj, scale);
2975}
2976
2977EAPI double
2978evas_object_scale_get(const Evas_Object *obj)
2979{
2980 return efl_ui_scale_get(obj);
2981}
2982
2973/* Internal EO APIs and hidden overrides */ 2983/* Internal EO APIs and hidden overrides */
2974 2984
2975EOAPI EFL_VOID_FUNC_BODY(efl_canvas_object_legacy_ctor) 2985EOAPI EFL_VOID_FUNC_BODY(efl_canvas_object_legacy_ctor)
diff --git a/src/lib/evas/canvas/evas_object_polygon.c b/src/lib/evas/canvas/evas_object_polygon.c
index bc135d90e4..b1649de152 100644
--- a/src/lib/evas/canvas/evas_object_polygon.c
+++ b/src/lib/evas/canvas/evas_object_polygon.c
@@ -74,7 +74,6 @@ static const Evas_Object_Func object_func =
74 NULL, 74 NULL,
75 NULL, 75 NULL,
76 NULL, 76 NULL,
77 NULL,
78 NULL, // render_prepare 77 NULL, // render_prepare
79 NULL 78 NULL
80}; 79};
diff --git a/src/lib/evas/canvas/evas_object_rectangle.c b/src/lib/evas/canvas/evas_object_rectangle.c
index 365b0f5015..d9e0d28b64 100644
--- a/src/lib/evas/canvas/evas_object_rectangle.c
+++ b/src/lib/evas/canvas/evas_object_rectangle.c
@@ -82,7 +82,6 @@ static const Evas_Object_Func object_func =
82 NULL, 82 NULL,
83 NULL, 83 NULL,
84 NULL, 84 NULL,
85 NULL,
86 NULL, // render_prepare 85 NULL, // render_prepare
87 evas_object_rectangle_render2_walk 86 evas_object_rectangle_render2_walk
88}; 87};
diff --git a/src/lib/evas/canvas/evas_object_smart.c b/src/lib/evas/canvas/evas_object_smart.c
index 3ab72277e7..3f4dab57a9 100644
--- a/src/lib/evas/canvas/evas_object_smart.c
+++ b/src/lib/evas/canvas/evas_object_smart.c
@@ -120,7 +120,6 @@ static const Evas_Object_Func object_func =
120 NULL, 120 NULL,
121 NULL, 121 NULL,
122 NULL, 122 NULL,
123 NULL,
124 NULL, // render_prepare 123 NULL, // render_prepare
125 NULL 124 NULL
126}; 125};
diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c
index 47f37ff81c..f0bf953e54 100644
--- a/src/lib/evas/canvas/evas_object_text.c
+++ b/src/lib/evas/canvas/evas_object_text.c
@@ -114,9 +114,6 @@ static int evas_object_text_was_opaque(Evas_Object *eo_obj,
114 Evas_Object_Protected_Data *obj, 114 Evas_Object_Protected_Data *obj,
115 void *type_private_data); 115 void *type_private_data);
116 116
117static void evas_object_text_scale_update(Evas_Object *eo_obj,
118 Evas_Object_Protected_Data *obj,
119 void *type_private_data);
120static void _evas_object_text_recalc(Evas_Object *eo_obj, Eina_Unicode *text); 117static void _evas_object_text_recalc(Evas_Object *eo_obj, Eina_Unicode *text);
121 118
122static const Evas_Object_Func object_func = 119static const Evas_Object_Func object_func =
@@ -139,7 +136,6 @@ static const Evas_Object_Func object_func =
139 NULL, 136 NULL,
140 NULL, 137 NULL,
141 NULL, 138 NULL,
142 evas_object_text_scale_update,
143 NULL, 139 NULL,
144 NULL, 140 NULL,
145 NULL, 141 NULL,
@@ -2217,15 +2213,16 @@ evas_object_text_was_opaque(Evas_Object *eo_obj EINA_UNUSED,
2217 return 0; 2213 return 0;
2218} 2214}
2219 2215
2220static void 2216EOLIAN static void
2221evas_object_text_scale_update(Evas_Object *eo_obj, 2217_evas_text_efl_ui_base_scale_set(Evas_Object *eo_obj, Evas_Text_Data *o,
2222 Evas_Object_Protected_Data *pd EINA_UNUSED, 2218 double scale)
2223 void *type_private_data)
2224{ 2219{
2225 Evas_Text_Data *o = type_private_data;
2226 int size; 2220 int size;
2227 const char *font; 2221 const char *font;
2228 2222
2223 if (EINA_DBL_EQ(efl_ui_scale_get(eo_obj), scale)) return;
2224 efl_ui_scale_set(efl_super(eo_obj, MY_CLASS), scale);
2225
2229 font = eina_stringshare_add(o->cur.font); 2226 font = eina_stringshare_add(o->cur.font);
2230 size = o->cur.size; 2227 size = o->cur.size;
2231 if (o->cur.font) eina_stringshare_del(o->cur.font); 2228 if (o->cur.font) eina_stringshare_del(o->cur.font);
diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c
index 041701334c..37cbd34f55 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -708,9 +708,6 @@ static int evas_object_textblock_was_opaque(Evas_Object *eo_obj,
708static void evas_object_textblock_coords_recalc(Evas_Object *eo_obj, 708static void evas_object_textblock_coords_recalc(Evas_Object *eo_obj,
709 Evas_Object_Protected_Data *obj, 709 Evas_Object_Protected_Data *obj,
710 void *type_private_data); 710 void *type_private_data);
711static void evas_object_textblock_scale_update(Evas_Object *eo_obj,
712 Evas_Object_Protected_Data *obj,
713 void *type_private_data);
714 711
715static const Evas_Object_Func object_func = 712static const Evas_Object_Func object_func =
716{ 713{
@@ -732,7 +729,6 @@ static const Evas_Object_Func object_func =
732 NULL, 729 NULL,
733 NULL, 730 NULL,
734 NULL, /*evas_object_textblock_coords_recalc, <- disable - not useful. */ 731 NULL, /*evas_object_textblock_coords_recalc, <- disable - not useful. */
735 evas_object_textblock_scale_update,
736 NULL, 732 NULL,
737 NULL, 733 NULL,
738 NULL, 734 NULL,
@@ -14603,12 +14599,14 @@ evas_object_textblock_was_opaque(Evas_Object *eo_obj EINA_UNUSED,
14603 return 0; 14599 return 0;
14604} 14600}
14605 14601
14606static void 14602EOLIAN static void
14607evas_object_textblock_scale_update(Evas_Object *eo_obj EINA_UNUSED, 14603_efl_canvas_text_efl_ui_base_scale_set(Evas_Object *eo_obj,
14608 Evas_Object_Protected_Data *obj EINA_UNUSED, 14604 Efl_Canvas_Text_Data *o,
14609 void *type_private_data) 14605 double scale)
14610{ 14606{
14611 Efl_Canvas_Text_Data *o = type_private_data; 14607 if (EINA_DBL_EQ(efl_ui_scale_get(eo_obj), scale)) return;
14608 efl_ui_scale_set(efl_super(eo_obj, MY_CLASS), scale);
14609
14612 _evas_textblock_invalidate_all(o); 14610 _evas_textblock_invalidate_all(o);
14613 _evas_textblock_changed(o, eo_obj); 14611 _evas_textblock_changed(o, eo_obj);
14614 o->last_w = -1; 14612 o->last_w = -1;
diff --git a/src/lib/evas/canvas/evas_object_textgrid.c b/src/lib/evas/canvas/evas_object_textgrid.c
index e0404a67af..df880c3e5f 100644
--- a/src/lib/evas/canvas/evas_object_textgrid.c
+++ b/src/lib/evas/canvas/evas_object_textgrid.c
@@ -113,10 +113,6 @@ static int evas_object_textgrid_was_opaque(Evas_Object *eo_obj,
113 Evas_Object_Protected_Data *obj, 113 Evas_Object_Protected_Data *obj,
114 void *type_private_data); 114 void *type_private_data);
115 115
116static void evas_object_textgrid_scale_update(Evas_Object *eo_obj,
117 Evas_Object_Protected_Data *pd,
118 void *type_private_data);
119
120static const Evas_Object_Func object_func = 116static const Evas_Object_Func object_func =
121{ 117{
122 /* methods (compulsory) */ 118 /* methods (compulsory) */
@@ -137,7 +133,6 @@ static const Evas_Object_Func object_func =
137 NULL, 133 NULL,
138 NULL, 134 NULL,
139 NULL, 135 NULL,
140 evas_object_textgrid_scale_update,
141 NULL, 136 NULL,
142 NULL, 137 NULL,
143 NULL, 138 NULL,
@@ -876,15 +871,16 @@ evas_object_textgrid_was_opaque(Evas_Object *eo_obj EINA_UNUSED,
876 return 0; 871 return 0;
877} 872}
878 873
879static void 874EOLIAN static void
880evas_object_textgrid_scale_update(Evas_Object *eo_obj, 875_evas_textgrid_efl_ui_base_scale_set(Evas_Object *eo_obj, Evas_Textgrid_Data *o,
881 Evas_Object_Protected_Data *pd EINA_UNUSED, 876 double scale)
882 void *type_private_data)
883{ 877{
884 int font_size; 878 int font_size;
885 const char *font_name; 879 const char *font_name;
886 880
887 Evas_Textgrid_Data *o = type_private_data; 881 if (EINA_DBL_EQ(efl_ui_scale_get(eo_obj), scale)) return;
882 efl_ui_scale_set(efl_super(eo_obj, MY_CLASS), scale);
883
888 font_name = eina_stringshare_add(o->cur.font_name); 884 font_name = eina_stringshare_add(o->cur.font_name);
889 font_size = o->cur.font_size; 885 font_size = o->cur.font_size;
890 if (o->cur.font_name) eina_stringshare_del(o->cur.font_name); 886 if (o->cur.font_name) eina_stringshare_del(o->cur.font_name);
diff --git a/src/lib/evas/canvas/evas_text.eo b/src/lib/evas/canvas/evas_text.eo
index 68623a672e..b36218d969 100644
--- a/src/lib/evas/canvas/evas_text.eo
+++ b/src/lib/evas/canvas/evas_text.eo
@@ -1,6 +1,7 @@
1type @extern Evas.Text_Style_Type : __undefined_type; [[External text style type]] 1type @extern Evas.Text_Style_Type : __undefined_type; [[External text style type]]
2 2
3class Evas.Text (Efl.Canvas.Object, Efl.Text, Efl.Text.Properties, Efl.Text.Font, Efl.Canvas.Filter.Internal) 3class Evas.Text (Efl.Canvas.Object, Efl.Text, Efl.Text.Properties,
4 Efl.Text.Font, Efl.Canvas.Filter.Internal, Efl.Ui.Base)
4{ 5{
5 [[Evas text class]] 6 [[Evas text class]]
6 legacy_prefix: evas_object_text; 7 legacy_prefix: evas_object_text;
@@ -281,5 +282,6 @@ class Evas.Text (Efl.Canvas.Object, Efl.Text, Efl.Text.Properties, Efl.Text.Font
281 Efl.Canvas.Filter.Internal.filter_input_render; 282 Efl.Canvas.Filter.Internal.filter_input_render;
282 Efl.Canvas.Filter.Internal.filter_state_prepare; 283 Efl.Canvas.Filter.Internal.filter_state_prepare;
283 Efl.Canvas.Object.paragraph_direction { set; get; } 284 Efl.Canvas.Object.paragraph_direction { set; get; }
285 Efl.Ui.Base.scale { set; }
284 } 286 }
285} 287}
diff --git a/src/lib/evas/canvas/evas_textgrid.eo b/src/lib/evas/canvas/evas_textgrid.eo
index 1bf9afa330..dcc2a8274b 100644
--- a/src/lib/evas/canvas/evas_textgrid.eo
+++ b/src/lib/evas/canvas/evas_textgrid.eo
@@ -20,7 +20,8 @@ enum Evas.Textgrid.Font_Style {
20/* XXX: Actual definition is in C. */ 20/* XXX: Actual definition is in C. */
21struct Evas.Textgrid.Cell; [[Evas textgrid cell data structure]] 21struct Evas.Textgrid.Cell; [[Evas textgrid cell data structure]]
22 22
23class Evas.Textgrid (Efl.Canvas.Object, Efl.Text.Properties, Efl.Text.Font) 23class Evas.Textgrid (Efl.Canvas.Object, Efl.Text.Properties, Efl.Text.Font,
24 Efl.Ui.Base)
24{ 25{
25 [[Evas textgrid class]] 26 [[Evas textgrid class]]
26 legacy_prefix: evas_object_textgrid; 27 legacy_prefix: evas_object_textgrid;
@@ -201,5 +202,6 @@ class Evas.Textgrid (Efl.Canvas.Object, Efl.Text.Properties, Efl.Text.Font)
201 Efl.Text.Properties.font { get; set; } 202 Efl.Text.Properties.font { get; set; }
202 Efl.Text.Properties.font_source { get; set; } 203 Efl.Text.Properties.font_source { get; set; }
203 Efl.Text.Font.font_bitmap_scalable { get; set; } 204 Efl.Text.Font.font_bitmap_scalable { get; set; }
205 Efl.Ui.Base.scale { set; }
204 } 206 }
205} 207}
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h
index 43d378511b..6753931f34 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -1265,8 +1265,6 @@ struct _Evas_Object_Func
1265 1265
1266 void (*coords_recalc) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data); 1266 void (*coords_recalc) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data);
1267 1267
1268 void (*scale_update) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data);
1269
1270 int (*has_opaque_rect) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data); 1268 int (*has_opaque_rect) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data);
1271 int (*get_opaque_rect) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data, 1269 int (*get_opaque_rect) (Evas_Object *obj, Evas_Object_Protected_Data *pd, void *type_private_data,
1272 Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h); 1270 Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);