Closed baedert closed 4 years ago
Hey, I'm looking at binding GTK4 right now. GdkSurface has a signal called render that has a cairo_region_t* parameter, which is not a GObject.
GdkSurface
render
cairo_region_t*
GObject
When building the generated code, it fails with
generated/gtkd4/gobject/ObjectG.d(259): Error: constructor cairo.Region.Region.this(cairo_region_t* cairo_region) is not callable using argument types (cairo_region_t*, bool) generated/gtkd4/gobject/ObjectG.d(259): expected 1 argument(s), not 2 generated/gtkd4/gobject/DClosure.d-mixin-128(130): Error: template instance gobject.ObjectG.ObjectG.getDObject!(Region, Region, cairo_region_t*) error instantiating generated/gtkd4/gobject/DClosure.d(89): instantiated from here: d_closure_marshal!(bool delegate(Region, Surface)) generated/gtkd4/gobject/Signals.d(60): instantiated from here: __ctor!(bool delegate(Region, Surface)) generated/gtkd4/gdk/Surface.d(1559): instantiated from here: connect!(bool delegate(Region, Surface))
i.e. it's trying to call this line: https://github.com/gtkd-developers/GtkD/blob/master/generated/gtkd/gobject/ObjectG.d#L261 but the cairo.Region constructor does not take two arguments.
cairo.Region
I'm a bit at a loss here, what's the solution?
Oh, is it enough to change that line to
return new T(obj);
?
It would be better to support both objects that track their ownership and those that don't.
Hey, I'm looking at binding GTK4 right now.
GdkSurface
has a signal calledrender
that has acairo_region_t*
parameter, which is not aGObject
.When building the generated code, it fails with
i.e. it's trying to call this line: https://github.com/gtkd-developers/GtkD/blob/master/generated/gtkd/gobject/ObjectG.d#L261 but the
cairo.Region
constructor does not take two arguments.I'm a bit at a loss here, what's the solution?