EAPI Eina_Bool
edje_object_parts_extends_calc(Edje_Object *obj, int *x, int *y, int *w, int *h)
{
- return efl_canvas_layout_calc_parts_extends(obj, x, y, w, h);
+ Eina_Rectangle r = { 0, };
+ Edje *ed;
+
+ ed = _edje_fetch(obj);
+ if (ed) r = efl_canvas_layout_calc_parts_extends(obj);
+ if (x) *x = r.x;
+ if (y) *y = r.y;
+ if (w) *w = r.w;
+ if (h) *h = r.h;
+ return (ed != NULL);
}
EAPI int
edje_object_size_min_restricted_calc(obj, minw, minh, 0, 0);
}
-EOLIAN Eina_Bool
-_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)
+EOLIAN Eina_Rectangle
+_edje_object_efl_canvas_layout_calc_calc_parts_extends(Eo *obj EINA_UNUSED, Edje *ed)
{
Evas_Coord xx1 = INT_MAX, yy1 = INT_MAX;
Evas_Coord xx2 = 0, yy2 = 0;
unsigned short i;
- if (!ed)
- {
- if (x) *x = 0;
- if (y) *y = 0;
- if (w) *w = 0;
- if (h) *h = 0;
- return EINA_FALSE;
- }
-
ed->calc_only = EINA_TRUE;
/* Need to recalc before providing the object. */
ed->calc_only = EINA_FALSE;
- if (x) *x = xx1;
- if (y) *y = yy1;
- if (w) *w = xx2 - xx1;
- if (h) *h = yy2 - yy1;
-
- return EINA_TRUE;
+ return (Eina_Rectangle) { xx1, yy1, xx2 - xx1, yy2 - yy1 };
}
EOLIAN void
+import eina_types;
+
interface Efl.Canvas.Layout_Calc
{
[[This interface defines a common set of APIs used to trigger calculations
Note: On failure, this function will make all non-$null geometry
pointers' pointed variables be set to zero.
]]
- return: bool; [[$true on success, $false otherwise]]
- /* FIXME: Return a 2D size type (no @out values) */
- params {
- @out x: int; [[The parts region's X coordinate]]
- @out y: int; [[The parts region's Y coordinate]]
- @out w: int; [[The parts region's width]]
- @out h: int; [[The parts region's height]]
- }
+ return: Eina.Rectangle; [[The calculated region.]]
}
calc_freeze {
[[Freezes the layout object.
As an @Efl.Part implementation class, all objects of this class are meant
to be used for one and only one function call. In pseudo-code, the use
of object of this type looks like the following:
- layout.part("somepart").geometry_get(&x, &y, &w, &h);
+ rect = layout.part("somepart").geometry_get();
@since 1.20
]]