From cairo_matrix_t: Cairo: A Vector Graphics Library the Cairo Matrix seems to be a stack-allocated entity (in C-like languages at least), like GtkTextIter or cairo.RectangleInt. But I wonder why in the GIR file the Cairo matrix is an opaque object with no fields?
/usr/share/gir-1.0/cairo-1.0.gir
While for RectangleInt and plain Rectangle
<record name="Rectangle" c:type="cairo_rectangle_t"
glib:type-name="CairoRectangle"
glib:get-type="cairo_gobject_rectangle_get_type">
<field name="x" writable="1">
<type name="gdouble" c:type="gdouble"/>
</field>
<field name="y" writable="1">
<type name="gdouble" c:type="gdouble"/>
</field>
<field name="width" writable="1">
<type name="gdouble" c:type="gdouble"/>
</field>
<field name="height" writable="1">
<type name="gdouble" c:type="gdouble"/>
</field>
</record>
<record name="RectangleInt" c:type="cairo_rectangle_int_t"
glib:type-name="CairoRectangleInt"
glib:get-type="cairo_gobject_rectangle_int_get_type">
<field name="x" writable="1">
<type name="gint" c:type="gint"/>
</field>
<field name="y" writable="1">
<type name="gint" c:type="gint"/>
</field>
<field name="width" writable="1">
<type name="gint" c:type="gint"/>
</field>
<field name="height" writable="1">
<type name="gint" c:type="gint"/>
</field>
</record>
(For the Rectangle types, our bindings generator has worked fine.)
So we have to define the Matrix type fully manually. Because, there is no Allocator/Constructor provided, just an init() for the fields, we have to define the type properly, at least the correct size, even when we would have never to access the fields ourselves. Well, not that hard, I am just wondering.