summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-09-13 17:11:06 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-09-13 18:03:34 +0900
commit83ea35541ceea5583528b09daf397deecb354b97 (patch)
treec7810150ee2c844dc88421b865f3129f1b04a0af /src
parent21c72948dbc926db77e355c1fb18026e13d043c3 (diff)
edje: Use Eina_Rectangle for parts_extends_calc (EO)
Diffstat (limited to 'src')
-rw-r--r--src/lib/edje/edje_legacy.c11
-rw-r--r--src/lib/edje/edje_util.c20
-rw-r--r--src/lib/edje/efl_canvas_layout_calc.eo11
-rw-r--r--src/lib/edje/efl_canvas_layout_part.eo2
4 files changed, 17 insertions, 27 deletions
diff --git a/src/lib/edje/edje_legacy.c b/src/lib/edje/edje_legacy.c
index f35b499b76..520f9f0730 100644
--- a/src/lib/edje/edje_legacy.c
+++ b/src/lib/edje/edje_legacy.c
@@ -1101,7 +1101,16 @@ 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 return efl_canvas_layout_calc_parts_extends(obj, x, y, w, h); 1104 Eina_Rectangle r = { 0, };
1105 Edje *ed;
1106
1107 ed = _edje_fetch(obj);
1108 if (ed) r = efl_canvas_layout_calc_parts_extends(obj);
1109 if (x) *x = r.x;
1110 if (y) *y = r.y;
1111 if (w) *w = r.w;
1112 if (h) *h = r.h;
1113 return (ed != NULL);
1105} 1114}
1106 1115
1107EAPI int 1116EAPI int
diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c
index 6eb431ee59..9b3d622b2f 100644
--- a/src/lib/edje/edje_util.c
+++ b/src/lib/edje/edje_util.c
@@ -3171,22 +3171,13 @@ _edje_object_efl_canvas_layout_calc_calc_size_min(Eo *obj, Edje *_pd EINA_UNUSED
3171 edje_object_size_min_restricted_calc(obj, minw, minh, 0, 0); 3171 edje_object_size_min_restricted_calc(obj, minw, minh, 0, 0);
3172} 3172}
3173 3173
3174EOLIAN Eina_Bool 3174EOLIAN Eina_Rectangle
3175_edje_object_efl_canvas_layout_calc_calc_parts_extends(Eo *obj EINA_UNUSED, Edje *ed, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) 3175_edje_object_efl_canvas_layout_calc_calc_parts_extends(Eo *obj EINA_UNUSED, Edje *ed)
3176{ 3176{
3177 Evas_Coord xx1 = INT_MAX, yy1 = INT_MAX; 3177 Evas_Coord xx1 = INT_MAX, yy1 = INT_MAX;
3178 Evas_Coord xx2 = 0, yy2 = 0; 3178 Evas_Coord xx2 = 0, yy2 = 0;
3179 unsigned short i; 3179 unsigned short i;
3180 3180
3181 if (!ed)
3182 {
3183 if (x) *x = 0;
3184 if (y) *y = 0;
3185 if (w) *w = 0;
3186 if (h) *h = 0;
3187 return EINA_FALSE;
3188 }
3189
3190 ed->calc_only = EINA_TRUE; 3181 ed->calc_only = EINA_TRUE;
3191 3182
3192 /* Need to recalc before providing the object. */ 3183 /* Need to recalc before providing the object. */
@@ -3214,12 +3205,7 @@ _edje_object_efl_canvas_layout_calc_calc_parts_extends(Eo *obj EINA_UNUSED, Edje
3214 3205
3215 ed->calc_only = EINA_FALSE; 3206 ed->calc_only = EINA_FALSE;
3216 3207
3217 if (x) *x = xx1; 3208 return (Eina_Rectangle) { xx1, yy1, xx2 - xx1, yy2 - yy1 };
3218 if (y) *y = yy1;
3219 if (w) *w = xx2 - xx1;
3220 if (h) *h = yy2 - yy1;
3221
3222 return EINA_TRUE;
3223} 3209}
3224 3210
3225EOLIAN void 3211EOLIAN void
diff --git a/src/lib/edje/efl_canvas_layout_calc.eo b/src/lib/edje/efl_canvas_layout_calc.eo
index 17cb5c1060..6e89d9fbeb 100644
--- a/src/lib/edje/efl_canvas_layout_calc.eo
+++ b/src/lib/edje/efl_canvas_layout_calc.eo
@@ -1,3 +1,5 @@
1import eina_types;
2
1interface Efl.Canvas.Layout_Calc 3interface Efl.Canvas.Layout_Calc
2{ 4{
3 [[This interface defines a common set of APIs used to trigger calculations 5 [[This interface defines a common set of APIs used to trigger calculations
@@ -86,14 +88,7 @@ interface Efl.Canvas.Layout_Calc
86 Note: On failure, this function will make all non-$null geometry 88 Note: On failure, this function will make all non-$null geometry
87 pointers' pointed variables be set to zero. 89 pointers' pointed variables be set to zero.
88 ]] 90 ]]
89 return: bool; [[$true on success, $false otherwise]] 91 return: Eina.Rectangle; [[The calculated region.]]
90 /* FIXME: Return a 2D size type (no @out values) */
91 params {
92 @out x: int; [[The parts region's X coordinate]]
93 @out y: int; [[The parts region's Y coordinate]]
94 @out w: int; [[The parts region's width]]
95 @out h: int; [[The parts region's height]]
96 }
97 } 92 }
98 calc_freeze { 93 calc_freeze {
99 [[Freezes the layout object. 94 [[Freezes the layout object.
diff --git a/src/lib/edje/efl_canvas_layout_part.eo b/src/lib/edje/efl_canvas_layout_part.eo
index d6dc45d59b..6417b795e0 100644
--- a/src/lib/edje/efl_canvas_layout_part.eo
+++ b/src/lib/edje/efl_canvas_layout_part.eo
@@ -6,7 +6,7 @@ class Efl.Canvas.Layout.Part (Efl.Object, Efl.Gfx, Efl.Ui.Drag)
6 As an @Efl.Part implementation class, all objects of this class are meant 6 As an @Efl.Part implementation class, all objects of this class are meant
7 to be used for one and only one function call. In pseudo-code, the use 7 to be used for one and only one function call. In pseudo-code, the use
8 of object of this type looks like the following: 8 of object of this type looks like the following:
9 layout.part("somepart").geometry_get(&x, &y, &w, &h); 9 rect = layout.part("somepart").geometry_get();
10 10
11 @since 1.20 11 @since 1.20
12 ]] 12 ]]