Support GObject.Closure boxed types
When we create a signal closure with
connect_impl in C we associate the signal ID with the closure using marshalling data. In GTK4 we've moved closure creation into JS using BuilderScope. These closures lack the associated metadata and are thus unable to resolve any non-primitive types like
gpointer because the signal information can't be associated. This MR exposes
GObject.Closure to JS in order to create
GObject.Closure instances with the signal_id set to
0. This is then used as a flag to associate the signal invocation hint and thus the relevant type information.
GNOME/glib!2477 (reverted) changed the
invoke API to accept a return value, this MR mirrors the intent of the API by accepting a return type. A
null return type is equivalent to
const closure = new GObject.Closure(() => 'test'); const value = closure.invoke(String, ); // 'test'
- Exposes GObject.Closure as a boxed type for parameters
- Fixes signals metadata for Gtk 4
Addresses GClosure parts of #80