register_object_with_closures2


Description:

[ Version ( since = "2.84" ) ]
public uint register_object_with_closures2 (string object_path, DBusInterfaceInfo interface_info, Closure? method_call_closure, Closure? get_property_closure, Closure? set_property_closure) throws Error

Version of [method@Gio.

DBusConnection.register_object] using closures instead of a [type@Gio.DBusInterfaceVTable] for easier binding in other languages.

In contrast to [method@Gio.DBusConnection.register_object] and [method@Gio.DBusConnection.register_object_with_closures], the reference counting semantics of the function wrapped by method_call_closure are *not* the same as those of [ callback@Gio.DBusInterfaceMethodCallFunc]. Ownership of a reference to the [class@Gio.DBusMethodInvocation] is *not* transferred to the function. Bindings must ensure that they add a reference to the [class@Gio.DBusMethodInvocation] before calling any `g_dbus_method_invocation_return_*()` methods on it. This should be automatic as a result of the introspection annotations on those methods.

Parameters:

this

A [class@Gio.DBusConnection].

object_path

The object path to register at.

interface_info

Introspection data for the interface.

method_call_closure

[type@GObject.Closure] for handling incoming method calls.

get_property_closure

[type@GObject.Closure] for getting a property.

set_property_closure

[type@GObject.Closure] for setting a property.

Returns:

`0` if throws is set, otherwise a registration ID (never `0`) that can be used with [ method@Gio.DBusConnection.unregister_object].