@new


Description:

[ CCode ( cname = "g_dbus_proxy_new" , finish_name = "g_dbus_proxy_new_finish" ) ]
[ Version ( deprecated_since = "vala-0.36" , replacement = "DBusProxy" ) ]
public static async DBusProxy @new (DBusConnection connection, DBusProxyFlags flags, DBusInterfaceInfo? info, string? name, string object_path, string interface_name, Cancellable? cancellable = null) throws IOError

Warning: @new is deprecated since vala-0.36. Use DBusProxy.

Creates a proxy for accessing interface_name on the remote object at object_path owned by name at connection and asynchronously loads D-Bus properties unless the g_dbus_proxy_flags_do_not_load_properties flag is used.

Connect to the g_properties_changed signal to get notified about property changes.

If the g_dbus_proxy_flags_do_not_connect_signals flag is not set, also sets up match rules for signals. Connect to the g_signal signal to handle signals from the remote object.

If both g_dbus_proxy_flags_do_not_load_properties and g_dbus_proxy_flags_do_not_connect_signals are set, this constructor is guaranteed to complete immediately without blocking.

If name is a well-known name and the g_dbus_proxy_flags_do_not_auto_start and g_dbus_proxy_flags_do_not_auto_start_at_construction flags aren't set and no name owner currently exists, the message bus will be requested to launch a name owner for the name.

This is a failable asynchronous constructor - when the proxy is ready, callback will be invoked and you can use @new.end to get the result.

See DBusProxy.sync and for a synchronous version of this constructor.

DBusProxy is used in this example.

Parameters:

connection

A DBusConnection.

flags

Flags used when constructing the proxy.

info

A DBusInterfaceInfo specifying the minimal interface that proxy conforms to or null.

name

A bus name (well-known or unique) or null if connection is not a message bus connection.

object_path

An object path.

interface_name

A D-Bus interface name.

cancellable

A Cancellable or null.

callback

Callback function to invoke when the proxy is ready.

user_data

User data to pass to callback.