meta/boxes: typedef cairo_rectangle_int_t MetaRectangle

They are already effectively interchangeable so this should reduce
pointless casts.

Just like in GDK though, we need to keep the old definition for
instrospection to be able to include the struct's fields.
This commit is contained in:
Rui Matos
2016-06-12 18:38:35 +02:00
parent 0745734ba5
commit daf5a112fb
5 changed files with 16 additions and 22 deletions

View File

@ -34,7 +34,14 @@
* @width: Width of the rectangle
* @height: Height of the rectangle
*/
typedef struct _MetaRectangle MetaRectangle;
#ifdef __GI_SCANNER__
/* The introspection scanner is currently unable to lookup how
* cairo_rectangle_int_t is actually defined. This prevents
* introspection data for the GdkRectangle type to include fields
* descriptions. To workaround this issue, we define it with the same
* content as cairo_rectangle_int_t, but only under the introspection
* define.
*/
struct _MetaRectangle
{
int x;
@ -42,6 +49,10 @@ struct _MetaRectangle
int width;
int height;
};
typedef struct _MetaRectangle MetaRectangle;
#else
typedef cairo_rectangle_int_t MetaRectangle;
#endif
/**
* MetaStrut: