rsvg_handle_get_geometry_for_element() has Incorrect signature in Vala
VAPI contains this:
public bool get_geometry_for_element (string? id, Rsvg.Rectangle viewport, out Rsvg.Rectangle out_ink_rect, out Rsvg.Rectangle out_logical_rect) throws GLib.Error
Trying to use it like this:
double w = get_allocated_width ();
double h = get_allocated_height ();
Rsvg.Rectangle rect = {};
Rsvg.Rectangle viewport = {0, 0, w, h};
if (!handle.get_geometry_for_element (null, viewport, out rect, null))
results in this compile-time error:
../../../../../../../../../Projects/gnome-games/src/ui/gamepad-view.vala: In function ‘games_gamepad_view_calculate_image_dimensions’:
../../../../../../../../../Projects/gnome-games/src/ui/gamepad-view.vala:110:63: error: incompatible type for argument 3 of ‘rsvg_handle_get_geometry_for_element’
if (!handle.get_geometry_for_element (null, viewport, out rect, null))
^~~~~~~
In file included from src/25a6634@@gnome-games@exe/ui/gamepad-view.c:8:
/usr/include/librsvg-2.0/librsvg/rsvg.h:267:64: note: expected ‘RsvgRectangle’ {aka ‘struct _RsvgRectangle’} but argument is of type ‘RsvgRectangle *’ {aka ‘struct _RsvgRectangle *’}
RsvgRectangle viewport,
Edited by Alice Mikhaylenko