summaryrefslogtreecommitdiff
path: root/src/lib/edje
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-09-14 11:59:44 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-09-18 13:22:52 +0900
commitf3eff6eb3ee6e9b56c0be5cd7f8905f14b388e4f (patch)
tree473b3d1b3e56cc5875d4496bf40fe8279165e132 /src/lib/edje
parentcb3b4cc8d7794bea575a85325c8a58f25f0507b2 (diff)
efl: Introduce Eina.Rect and switch EO APIs to it
It's a complex struct but defined in EO as a simple struct. ABI-wise it's equivalent to Eina_Rectangle. Some macros that use Eina_Rectangle also work on Eina_Rect out of the box, most of the code dealing with x,y,w,h will require no modifications either. But Eina_Rect provides direct access to a size or position 2d component, as well as the usual x,y,w,h. The field "rect" is provided as a convenience for code dealing with both Eina_Rectangle and Eina_Rect. We may or may not require it. Note: Size2D could use unsigned values but I have spotted a few places in the code that actually use -1 to indicate invalid size (as opposed to 0x0). @feature
Diffstat (limited to 'src/lib/edje')
-rw-r--r--src/lib/edje/edje_calc.c4
-rw-r--r--src/lib/edje/edje_legacy.c2
-rw-r--r--src/lib/edje/edje_part.c6
-rw-r--r--src/lib/edje/efl_canvas_layout_calc.eo2
4 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c
index 9bdedcaa0b..54aca19613 100644
--- a/src/lib/edje/edje_calc.c
+++ b/src/lib/edje/edje_calc.c
@@ -3616,7 +3616,7 @@ _edje_proxy_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edj
3616 } 3616 }
3617 } 3617 }
3618 3618
3619 efl_gfx_fill_set(ep->object, p3->type.common->fill); 3619 efl_gfx_fill_set(ep->object, (Eina_Rect) p3->type.common->fill);
3620 efl_image_smooth_scale_set(ep->object, p3->smooth); 3620 efl_image_smooth_scale_set(ep->object, p3->smooth);
3621 evas_object_image_source_visible_set(ep->object, chosen_desc->proxy.source_visible); 3621 evas_object_image_source_visible_set(ep->object, chosen_desc->proxy.source_visible);
3622 evas_object_image_source_clip_set(ep->object, chosen_desc->proxy.source_clip); 3622 evas_object_image_source_clip_set(ep->object, chosen_desc->proxy.source_clip);
@@ -3656,7 +3656,7 @@ _edje_image_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edj
3656 set->entry->border.scale_by : p3->type.common->spec.image.border_scale_by; 3656 set->entry->border.scale_by : p3->type.common->spec.image.border_scale_by;
3657 } 3657 }
3658 3658
3659 efl_gfx_fill_set(ep->object, p3->type.common->fill); 3659 efl_gfx_fill_set(ep->object, (Eina_Rect) p3->type.common->fill);
3660 efl_image_smooth_scale_set(ep->object, p3->smooth); 3660 efl_image_smooth_scale_set(ep->object, p3->smooth);
3661 if (chosen_desc->image.border.scale) 3661 if (chosen_desc->image.border.scale)
3662 { 3662 {
diff --git a/src/lib/edje/edje_legacy.c b/src/lib/edje/edje_legacy.c
index 520f9f0730..0756122aa0 100644
--- a/src/lib/edje/edje_legacy.c
+++ b/src/lib/edje/edje_legacy.c
@@ -1101,7 +1101,7 @@ edje_object_size_min_restricted_calc(Edje_Object *obj, int *minw, int *minh, int
1101EAPI Eina_Bool 1101EAPI Eina_Bool
1102edje_object_parts_extends_calc(Edje_Object *obj, int *x, int *y, int *w, int *h) 1102edje_object_parts_extends_calc(Edje_Object *obj, int *x, int *y, int *w, int *h)
1103{ 1103{
1104 Eina_Rectangle r = { 0, }; 1104 Eina_Rect r = EINA_RECT_ZERO();
1105 Edje *ed; 1105 Edje *ed;
1106 1106
1107 ed = _edje_fetch(obj); 1107 ed = _edje_fetch(obj);
diff --git a/src/lib/edje/edje_part.c b/src/lib/edje/edje_part.c
index b9790d8e5d..f5a496d8ac 100644
--- a/src/lib/edje/edje_part.c
+++ b/src/lib/edje/edje_part.c
@@ -100,17 +100,17 @@ _efl_canvas_layout_part_efl_object_finalize(Eo *obj, Efl_Canvas_Layout_Part_Data
100 return efl_finalize(efl_super(obj, MY_CLASS)); 100 return efl_finalize(efl_super(obj, MY_CLASS));
101} 101}
102 102
103EOLIAN Eina_Rectangle 103EOLIAN Eina_Rect
104_efl_canvas_layout_part_efl_gfx_geometry_get(Eo *obj, Efl_Canvas_Layout_Part_Data *pd) 104_efl_canvas_layout_part_efl_gfx_geometry_get(Eo *obj, Efl_Canvas_Layout_Part_Data *pd)
105{ 105{
106 Edje_Real_Part *rp = pd->rp; 106 Edje_Real_Part *rp = pd->rp;
107 Eina_Rectangle r = { 0, }; 107 Eina_Rect r = EINA_RECT_ZERO();
108 108
109 PROXY_CALL_BEGIN(pd); 109 PROXY_CALL_BEGIN(pd);
110 _edje_recalc_do(pd->ed); 110 _edje_recalc_do(pd->ed);
111 if (!rp) RETURN_VAL(r); 111 if (!rp) RETURN_VAL(r);
112 112
113 RETURN_VAL(rp->rect); 113 RETURN_VAL((Eina_Rect) rp->rect);
114} 114}
115 115
116EOLIAN static void 116EOLIAN static void
diff --git a/src/lib/edje/efl_canvas_layout_calc.eo b/src/lib/edje/efl_canvas_layout_calc.eo
index 6e89d9fbeb..0874056b41 100644
--- a/src/lib/edje/efl_canvas_layout_calc.eo
+++ b/src/lib/edje/efl_canvas_layout_calc.eo
@@ -88,7 +88,7 @@ interface Efl.Canvas.Layout_Calc
88 Note: On failure, this function will make all non-$null geometry 88 Note: On failure, this function will make all non-$null geometry
89 pointers' pointed variables be set to zero. 89 pointers' pointed variables be set to zero.
90 ]] 90 ]]
91 return: Eina.Rectangle; [[The calculated region.]] 91 return: Eina.Rect; [[The calculated region.]]
92 } 92 }
93 calc_freeze { 93 calc_freeze {
94 [[Freezes the layout object. 94 [[Freezes the layout object.