Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: GDBusObjectManagerClientCtors

[328:14] static extends: object

Alternate constructors for GDBusObjectManagerClient. Usage: GDBusObjectManagerClientCtors.<name>(...). The primary constructor lives directly on GDBusObjectManagerClient.

Methods

  • newForBusFinish (object res)

    Finishes an operation started with g_dbus_object_manager_client_new_for_bus().

    • @p res is A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_object_manager_client_new_for_bus()..
    • @r A new GDBusObjectManagerClient.
  • newForBusSync (string bus_type, string flags, string name, string object_path, object get_proxy_type_func, object cancellable)

    Like g_dbus_object_manager_client_new_sync() but takes a #GBusType instead of a #GDBusConnection. This is a synchronous failable constructor - the calling thread is blocked until a reply is received. See g_dbus_object_manager_client_new_for_bus() for the asynchronous version.

    • @p bus_type is A #GBusType..
    • @p flags is Zero or more flags from the #GDBusObjectManagerClientFlags enumeration..
    • @p name is The owner of the control object (unique or well-known name)..
    • @p object_path is The object path of the control object..
    • @p get_proxy_type_func is A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies..
    • @p get_proxy_type_user_data is User data to pass to
    • @get_proxy_type_func.. ``
    • @p get_proxy_type_destroy_notify is Free function for
    • @get_proxy_type_user_data or %NULL..
    • @p cancellable is A #GCancellable or %NULL.
    • @r A new GDBusObjectManagerClient.
  • newSync (object connection, string flags, string name, string object_path, object get_proxy_type_func, object cancellable)

    Creates a new #GDBusObjectManagerClient object. This is a synchronous failable constructor - the calling thread is blocked until a reply is received. See g_dbus_object_manager_client_new() for the asynchronous version.

    • @p connection is A #GDBusConnection..
    • @p flags is Zero or more flags from the #GDBusObjectManagerClientFlags enumeration..
    • @p name is The owner of the control object (unique or well-known name), or %NULL when not using a message bus connection..
    • @p object_path is The object path of the control object..
    • @p get_proxy_type_func is A #GDBusProxyTypeFunc function or %NULL to always construct #GDBusProxy proxies..
    • @p get_proxy_type_user_data is User data to pass to
    • @get_proxy_type_func.. ``
    • @p get_proxy_type_destroy_notify is Free function for
    • @get_proxy_type_user_data or %NULL..
    • @p cancellable is A #GCancellable or %NULL.
    • @r A new GDBusObjectManagerClient.

class: GDBusObjectManagerClientMeta

[567:14] static extends: object

Generated metadata helpers for DBusObjectManagerClient class surfaces.

Methods

  • properties ()

    Returns property metadata for DBusObjectManagerClient.

    • @r A list.
  • signals ()

    Returns signal metadata for DBusObjectManagerClient.

    • @r A list.

class: GDBusObjectManagerClientInterfaceproxypropertieschangedCallback

[419:7] extends: object

Generated low-level callback wrapper for GIR callback interface-proxy-properties-changed.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • GDBusObjectManagerClientInterfaceproxypropertieschangedCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, object_proxy, interface_proxy, changed_properties, invalidated_properties, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: GDBusObjectManagerClientInterfaceproxysignalCallback

[494:7] extends: object

Generated low-level callback wrapper for GIR callback interface-proxy-signal.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • GDBusObjectManagerClientInterfaceproxysignalCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, object_proxy, interface_proxy, sender_name, signal_name, parameters, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: GDBusObjectManagerClient

[77:7] extends: object

GDBusObjectManagerClient is used to create, monitor and delete object proxies for remote objects exported by a [class@Gio.DBusObjectManagerServer] (or any code implementing the org.freedesktop.DBus.ObjectManager interface). Once an instance of this type has been created, you can connect to the [signal@Gio.DBusObjectManager::object-added] and [signal@Gio.DBusObjectManager::object-removed signals] and inspect the [class@Gio.DBusObjectProxy] objects returned by [method@Gio.DBusObjectManager.get_objects]. If the name for a GDBusObjectManagerClient is not owned by anyone at object construction time, the default behavior is to request the message bus to launch an owner for the name. This behavior can be disabled using the G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_DO_NOT_AUTO_START flag. It’s also worth noting that this only works if the name of interest is activatable in the first place. E.g. in some cases it is not possible to launch an owner for the requested name. In this case, GDBusObjectManagerClient object construction still succeeds but there will be no object proxies (e.g. [method@Gio.DBusObjectManager.get_objects] returns the empty list) and the [property@Gio.DBusObjectManagerClient:name-owner] property is NULL. The owner of the requested name can come and go (for example consider a system service being restarted) – GDBusObjectManagerClient handles this case too; simply connect to the [signal@GObject.Object::notify] signal to watch for changes on the [property@Gio.DBusObjectManagerClient:name-owner] property. When the name owner vanishes, the behavior is that [property@Gio.DBusObjectManagerClient:name-owner] is set to NULL (this includes emission of the [signal@GObject.Object::notify] signal) and then [signal@Gio.DBusObjectManager::object-removed] signals are synthesized for all currently existing object proxies. Since [property@Gio.DBusObjectManagerClient:name-owner] is NULL when this happens, you can use this information to disambiguate a synthesized signal from a genuine signal caused by object removal on the remote [iface@Gio.DBusObjectManager]. Similarly, when a new name owner appears, [signal@Gio.DBusObjectManager::object-added] signals are synthesized while [property@Gio.DBusObjectManagerClient:name-owner] is still NULL. Only when all object proxies have been added, the [property@Gio.DBusObjectManagerClient:name-owner] is set to the new name owner (this includes emission of the [signal@GObject.Object::notify] signal). Furthermore, you are guaranteed that [property@Gio.DBusObjectManagerClient:name-owner] will alternate between a name owner (e.g. :1.42) and NULL even in the case where the name of interest is atomically replaced Ultimately, GDBusObjectManagerClient is used to obtain [class@Gio.DBusProxy] instances. All signals (including the org.freedesktop.DBus.Properties::PropertiesChanged signal) delivered to [class@Gio.DBusProxy] instances are guaranteed to originate from the name owner. This guarantee along with the behavior described above, means that certain race conditions including the “half the proxy is from the old owner and the other half is from the new owner” problem cannot happen. To avoid having the application connect to signals on the returned [class@Gio.DBusObjectProxy] and [class@Gio.DBusProxy] objects, the [signal@Gio.DBusObject::interface-added], [signal@Gio.DBusObject::interface-removed], [signal@Gio.DBusProxy::g-properties-changed] and [signal@Gio.DBusProxy::g-signal] signals are also emitted on the GDBusObjectManagerClient instance managing these objects. The signals emitted are [signal@Gio.DBusObjectManager::interface-added], [signal@Gio.DBusObjectManager::interface-removed], [signal@Gio.DBusObjectManagerClient::interface-proxy-properties-changed] and [signal@Gio.DBusObjectManagerClient::interface-proxy-signal]. Note that all callbacks and signals are emitted in the thread-default main context (see [method@GLib.MainContext.push_thread_default]) that the GDBusObjectManagerClient object was constructed in. Additionally, the [class@Gio.DBusObjectProxy] and [class@Gio.DBusProxy] objects originating from the GDBusObjectManagerClient object will be created in the same context and, consequently, will deliver signals in the same main loop.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • GDBusObjectManagerClient (res = null)

    Finishes an operation started with g_dbus_object_manager_client_new().

    • @p res is A #GAsyncResult obtained from the #GAsyncReadyCallback passed to g_dbus_object_manager_client_new()..
  • toNativeHandle (Source)

    Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from fn.call(...), another generated wrapper exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • asObject ()

    Wraps this handle as GObject.

    • @r A GObject object.
  • asAsyncInitable ()

    Wraps this handle as GAsyncInitable.

    • @r A GAsyncInitable object.
  • asDBusObjectManager ()

    Wraps this handle as GDBusObjectManager.

    • @r A GDBusObjectManager object.
  • asInitable ()

    Wraps this handle as GInitable.

    • @r A GInitable object.
  • connectSignal (string Name, CallbackObj)

    Connects one generated callback wrapper to a named signal.

    • @p Name is the signal name.
    • @p CallbackObj is the generated callback wrapper to connect.
    • @r The connected handler id.
  • disconnectSignalHandler (int HandlerId)

    Disconnects one retained signal handler id.

    • @p HandlerId is the signal handler id to disconnect.
    • @r None.
  • setOnInterfaceproxypropertieschanged (callback Fn, UserData = null)

    Emitted when one or more D-Bus properties on proxy changes. The local cache has already been updated when this signal fires. Note that both

    • @changed_properties and @invalidated_properties are guaranteed to never be %NULL (either may be empty though). This signal exists purely as a convenience to avoid having to connect signals to all interface proxies managed by @manager. This signal is emitted in the thread-default main context (see [method@GLib.MainContext.push_thread_default]) that @manager was constructed in.
    • @p Fn is the Aussom callback.
    • @p Fn is called with (GDBusObjectManagerClient Self, GDBusObjectProxy Object_proxy, GDBusProxy Interface_proxy, GVariant Changed_properties, list Invalidated_properties).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • setOnInterfaceproxysignal (callback Fn, UserData = null)

    Emitted when a D-Bus signal is received on @interface_proxy. This signal exists purely as a convenience to avoid having to connect signals to all interface proxies managed by @manager. This signal is emitted in the thread-default main context (see [method@GLib.MainContext.push_thread_default]) that @manager was constructed in.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (GDBusObjectManagerClient Self, GDBusObjectProxy Object_proxy, GDBusProxy Interface_proxy, string Sender_name, string Signal_name, GVariant Parameters).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • get_connection ()

    Gets the #GDBusConnection used by @manager.

    • @r A #GDBusConnection object. Do not free, the object belongs to
    • @manager.. ``
  • get_flags ()

    Gets the flags that @manager was constructed with.

    • @r Zero of more flags from the #GDBusObjectManagerClientFlags enumeration..
  • get_name ()

    Gets the name that @manager is for, or %NULL if not a message bus connection.

    • @r A unique or well-known name. Do not free, the string belongs to
    • @manager.. ``
  • get_name_owner ()

    The unique name that owns the name that @manager is for or %NULL if no-one currently owns that name. You can connect to the #GObject::notify signal to track changes to the #GDBusObjectManagerClient:name-owner property.

    • @r The name owner or %NULL if no name owner exists. Free with g_free()..