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
This commit is contained in:
Jean-Philippe Andre 2017-09-14 11:59:44 +09:00
parent 3a742b9ad0
commit b0fc2825e5
2 changed files with 2 additions and 2 deletions

View File

@ -262,7 +262,7 @@ main(void)
/* Add an image object for 3D scene rendering. */
image = efl_add(EFL_CANVAS_SCENE3D_CLASS, evas);
efl_gfx_geometry_set(image, (Eina_Rectangle) { 0, 0, WIDTH, HEIGHT });
efl_gfx_geometry_set(image, EINA_RECT(0, 0, WIDTH, HEIGHT));
evas_object_show(image);
/* Set the image object as render target for 3D scene. */

View File

@ -70,7 +70,7 @@ _anim_cb(void *data)
{
App_Data *ad = data;
Evas_Object *o;
Eina_Rectangle rect;
Eina_Rect rect;
int r, g, b, a, f, h, w;
int win_w, win_h, mx, my;