1.20 <GDBusObjectManagerClient>

Class: <GDBusObjectManagerClient>

It derives from <GObject>.

<GDBusObjectManagerClient> is used to create, monitor and delete object proxies for remote objects exported by a <GDBusObjectManagerServer> (or any code implementing the org.freedesktop.DBus.ObjectManager interface).

Once an instance of this type has been created, you can connect to the dbus-object-manager:object-added and [signal@Gio.DBusObjectManager::object-removed signals] and inspect the <GDBusObjectProxy> objects returned by dbus-object-manager: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 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. dbus-object-manager:get-objects returns the empty list) and the dbus-object-manager-client: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 object:notify signal to watch for changes on the dbus-object-manager-client:name-owner property. When the name owner vanishes, the behavior is that dbus-object-manager-client:name-owner is set to NULL (this includes emission of the object:notify signal) and then dbus-object-manager:object-removed signals are synthesized for all currently existing object proxies. Since dbus-object-manager-client: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 <GDBusObjectManager>. Similarly, when a new name owner appears, dbus-object-manager:object-added signals are synthesized while dbus-object-manager-client:name-owner is still NULL. Only when all object proxies have been added, the dbus-object-manager-client:name-owner is set to the new name owner (this includes emission of the object:notify signal). Furthermore, you are guaranteed that dbus-object-manager-client: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 <GDBusProxy> instances. All signals (including the org.freedesktop.DBus.Properties::PropertiesChanged signal) delivered to <GDBusProxy> 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 <GDBusObjectProxy> and <GDBusProxy> objects, the dbus-object:interface-added, dbus-object:interface-removed, dbus-proxy:g-properties-changed and dbus-proxy:g-signal signals are also emitted on the <GDBusObjectManagerClient> instance managing these objects. The signals emitted are dbus-object-manager:interface-added, dbus-object-manager:interface-removed, dbus-object-manager-client:interface-proxy-properties-changed and dbus-object-manager-client:interface-proxy-signal.

Note that all callbacks and signals are emitted in the thread-default main context (see main-context:push-thread-default) that the <GDBusObjectManagerClient> object was constructed in. Additionally, the <GDBusObjectProxy> and <GDBusProxy> objects originating from the <GDBusObjectManagerClient> object will be created in the same context and, consequently, will deliver signals in the same main loop.

Properties

Property: dbus-object-manager-client:bus-type self

If this property is not none, then dbus-object-manager-client:connection must be #f and will be set to the <GDBusConnection> obtained by calling bus-get with the value of this property.

Its value is a <GBusType>, or one of its symbols.

It can only be set when the object is made, with #:bus-type. It cannot be read.

Property: dbus-object-manager-client:connection self

The <GDBusConnection> to use.

Its value is a <GDBusConnection>, or #f.

It can only be set when the object is made, with #:connection.

Property: dbus-object-manager-client:flags self

Flags from the <GDBusObjectManagerClientFlags> enumeration.

Its value is a <GDBusObjectManagerClientFlags> (or, to set it, a list of its symbols, or one of them).

It can only be set when the object is made, with #:flags.

Property: dbus-object-manager-client:get-proxy-type-destroy-notify self

A GDestroyNotify for the gpointer user_data in dbus-object-manager-client:get-proxy-type-user-data.

Its value is a foreign pointer (or, to set it, a bytevector).

It can only be set when the object is made, with #:get-proxy-type-destroy-notify.

Property: dbus-object-manager-client:get-proxy-type-func self

The GDBusProxyTypeFunc to use when determining what GType to use for interface proxies or #f.

Its value is a foreign pointer (or, to set it, a bytevector).

It can only be set when the object is made, with #:get-proxy-type-func.

Property: dbus-object-manager-client:get-proxy-type-user-data self

The gpointer user_data to pass to dbus-object-manager-client:get-proxy-type-func.

Its value is a foreign pointer (or, to set it, a bytevector).

It can only be set when the object is made, with #:get-proxy-type-user-data.

Property: dbus-object-manager-client:name self

The well-known name or unique name that the manager is for.

Its value is a string, or #f.

It can only be set when the object is made, with #:name.

Property: dbus-object-manager-client:name-owner self

The unique name that owns dbus-object-manager-client:name or #f if no-one is currently owning the name. Connect to the object:notify signal to track changes to this property.

Its value is a string, or #f.

It is read only.

Property: dbus-object-manager-client:object-path self

The object path the manager is for.

Its value is a string, or #f.

It can only be set when the object is made, with #:object-path.

Procedures

Method: dbus-object-manager-client:get-connection self ⇒ %return
Method: get-connection self ⇒ %return

Gets the <GDBusConnection> used by self.

self

Passed: a <GDBusObjectManagerClient>.

A <GDBusObjectManagerClient>

%return

Returned: a <GDBusConnection>.

A <GDBusConnection> object. Do not free, the object belongs to self.

Method: dbus-object-manager-client:get-flags self ⇒ %return
Method: get-flags self ⇒ %return

Gets the flags that self was constructed with.

self

Passed: a <GDBusObjectManagerClient>.

A <GDBusObjectManagerClient>

%return

Returned: a <GDBusObjectManagerClientFlags>.

Zero of more flags from the <GDBusObjectManagerClientFlags> enumeration.

Method: dbus-object-manager-client:get-name self ⇒ %return
Method: get-name self ⇒ %return

Gets the name that self is for, or #f if not a message bus connection.

self

Passed: a <GDBusObjectManagerClient>.

A <GDBusObjectManagerClient>

%return

Returned: a string.

A unique or well-known name. Do not free, the string belongs to self.

Method: dbus-object-manager-client:get-name-owner self ⇒ %return
Method: get-name-owner self ⇒ %return

The unique name that owns the name that self is for or #f if no-one currently owns that name. You can connect to the object:notify signal to track changes to the dbus-object-manager-client:name-owner property.

self

Passed: a <GDBusObjectManagerClient>.

A <GDBusObjectManagerClient>.

%return

Returned: a string, or #f.

The name owner or #f if no name owner exists. Free with byte-array:free.

Procedure: dbus-object-manager-client:new connection flags name object-path [get-proxy-type-func] [cancellable] [callback]

Asynchronously creates a new <GDBusObjectManagerClient> object.

This is an asynchronous failable constructor. When the result is ready, callback will be invoked in the thread-default main context (see main-context:push-thread-default) of the thread you are calling this method from. You can then call dbus-object-manager-client:new-finish to get the result. See dbus-object-manager-client:new-sync for the synchronous version.

connection

Passed: a <GDBusConnection>.

A <GDBusConnection>.

flags

Passed: a <GDBusObjectManagerClientFlags>, or a list of its symbols, or one of them.

Zero or more flags from the <GDBusObjectManagerClientFlags> enumeration.

name

Passed: a string.

The owner of the control object (unique or well-known name).

object-path

Passed: a string.

The object path of the control object.

get-proxy-type-func

Passed, or left out: a procedure, or #f.

A GDBusProxyTypeFunc function or #f to always construct <GDBusProxy> proxies.

See GDBusProxyTypeFunc for how it is called.

cancellable

Passed, or left out: a <GCancellable>, or #f.

A <GCancellable> or #f

callback

Passed, or left out: a procedure, or #f.

A GAsyncReadyCallback to call when the request is satisfied.

See GAsyncReadyCallback for how it is called.

get-proxy-type-user-data

Not passed: guile-gi supplies it.

User data to pass to get-proxy-type-func.

get-proxy-type-destroy-notify

Not passed: guile-gi supplies it.

Free function for get-proxy-type-user-data or #f.

See GDestroyNotify for how it is called.

user-data

Not passed: guile-gi supplies it.

The data to pass to callback.

Procedure: dbus-object-manager-client:new-finish res ⇒ %return

Finishes an operation started with dbus-object-manager-client:new.

res

Passed: a <GAsyncResult>.

A <GAsyncResult> obtained from the GAsyncReadyCallback passed to dbus-object-manager-client:new.

%return

Returned: a <GDBusObjectManagerClient>.

A <GDBusObjectManagerClient> object or #f if error is set. Free with object:unref.

Procedure: dbus-object-manager-client:new-for-bus bus-type flags name object-path [get-proxy-type-func] [cancellable] [callback]

Like dbus-object-manager-client:new but takes a <GBusType> instead of a <GDBusConnection>.

This is an asynchronous failable constructor. When the result is ready, callback will be invoked in the thread-default main context (see main-context:push-thread-default) of the thread you are calling this method from. You can then call dbus-object-manager-client:new-for-bus-finish to get the result. See dbus-object-manager-client:new-for-bus-sync for the synchronous version.

bus-type

Passed: a <GBusType>, or one of its symbols.

A <GBusType>.

flags

Passed: a <GDBusObjectManagerClientFlags>, or a list of its symbols, or one of them.

Zero or more flags from the <GDBusObjectManagerClientFlags> enumeration.

name

Passed: a string.

The owner of the control object (unique or well-known name).

object-path

Passed: a string.

The object path of the control object.

get-proxy-type-func

Passed, or left out: a procedure, or #f.

A GDBusProxyTypeFunc function or #f to always construct <GDBusProxy> proxies.

See GDBusProxyTypeFunc for how it is called.

cancellable

Passed, or left out: a <GCancellable>, or #f.

A <GCancellable> or #f

callback

Passed, or left out: a procedure, or #f.

A GAsyncReadyCallback to call when the request is satisfied.

See GAsyncReadyCallback for how it is called.

get-proxy-type-user-data

Not passed: guile-gi supplies it.

User data to pass to get-proxy-type-func.

get-proxy-type-destroy-notify

Not passed: guile-gi supplies it.

Free function for get-proxy-type-user-data or #f.

See GDestroyNotify for how it is called.

user-data

Not passed: guile-gi supplies it.

The data to pass to callback.

Procedure: dbus-object-manager-client:new-for-bus-finish res ⇒ %return

Finishes an operation started with dbus-object-manager-client:new-for-bus.

res

Passed: a <GAsyncResult>.

A <GAsyncResult> obtained from the GAsyncReadyCallback passed to dbus-object-manager-client:new-for-bus.

%return

Returned: a <GDBusObjectManagerClient>.

A <GDBusObjectManagerClient> object or #f if error is set. Free with object:unref.

Procedure: dbus-object-manager-client:new-for-bus-sync bus-type flags name object-path [get-proxy-type-func] [cancellable] ⇒ %return

Like 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 dbus-object-manager-client:new-for-bus for the asynchronous version.

bus-type

Passed: a <GBusType>, or one of its symbols.

A <GBusType>.

flags

Passed: a <GDBusObjectManagerClientFlags>, or a list of its symbols, or one of them.

Zero or more flags from the <GDBusObjectManagerClientFlags> enumeration.

name

Passed: a string.

The owner of the control object (unique or well-known name).

object-path

Passed: a string.

The object path of the control object.

get-proxy-type-func

Passed, or left out: a procedure, or #f.

A GDBusProxyTypeFunc function or #f to always construct <GDBusProxy> proxies.

See GDBusProxyTypeFunc for how it is called.

cancellable

Passed, or left out: a <GCancellable>, or #f.

A <GCancellable> or #f

%return

Returned: a <GDBusObjectManagerClient>.

A <GDBusObjectManagerClient> object or #f if error is set. Free with object:unref.

get-proxy-type-user-data

Not passed: guile-gi supplies it.

User data to pass to get-proxy-type-func.

get-proxy-type-destroy-notify

Not passed: guile-gi supplies it.

Free function for get-proxy-type-user-data or #f.

See GDestroyNotify for how it is called.

Procedure: dbus-object-manager-client:new-sync connection flags name object-path [get-proxy-type-func] [cancellable] ⇒ %return

Creates a new <GDBusObjectManagerClient> object.

This is a synchronous failable constructor - the calling thread is blocked until a reply is received. See dbus-object-manager-client:new for the asynchronous version.

connection

Passed: a <GDBusConnection>.

A <GDBusConnection>.

flags

Passed: a <GDBusObjectManagerClientFlags>, or a list of its symbols, or one of them.

Zero or more flags from the <GDBusObjectManagerClientFlags> enumeration.

name

Passed: a string, or #f.

The owner of the control object (unique or well-known name), or #f when not using a message bus connection.

object-path

Passed: a string.

The object path of the control object.

get-proxy-type-func

Passed, or left out: a procedure, or #f.

A GDBusProxyTypeFunc function or #f to always construct <GDBusProxy> proxies.

See GDBusProxyTypeFunc for how it is called.

cancellable

Passed, or left out: a <GCancellable>, or #f.

A <GCancellable> or #f

%return

Returned: a <GDBusObjectManagerClient>.

A <GDBusObjectManagerClient> object or #f if error is set. Free with object:unref.

get-proxy-type-user-data

Not passed: guile-gi supplies it.

User data to pass to get-proxy-type-func.

get-proxy-type-destroy-notify

Not passed: guile-gi supplies it.

Free function for get-proxy-type-user-data or #f.

See GDestroyNotify for how it is called.

Signals

Signal: dbus-object-manager-client:interface-proxy-properties-changed

Connect a handler with (connect object dbus-object-manager-client:interface-proxy-properties-changed handler). It is called as (handler self object-proxy interface-proxy changed-properties invalidated-properties).

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 #f (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 main-context:push-thread-default) that manager was constructed in.

self

Passed: a <GDBusObjectManagerClient>.

object-proxy

Passed: a <GDBusObjectProxy>.

The <GDBusObjectProxy> on which an interface has properties that are changing.

interface-proxy

Passed: a <GDBusProxy>.

The <GDBusProxy> that has properties that are changing.

changed-properties

Passed: a <GVariant>.

A <GVariant> containing the properties that changed (type: a{sv}).

invalidated-properties

Passed: a vector, each a string.

A #f terminated array of properties that were invalidated.

Signal: dbus-object-manager-client:interface-proxy-signal

Connect a handler with (connect object dbus-object-manager-client:interface-proxy-signal handler). It is called as (handler self object-proxy interface-proxy sender-name signal-name parameters).

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 main-context:push-thread-default) that manager was constructed in.

self

Passed: a <GDBusObjectManagerClient>.

object-proxy

Passed: a <GDBusObjectProxy>.

The <GDBusObjectProxy> on which an interface is emitting a D-Bus signal.

interface-proxy

Passed: a <GDBusProxy>.

The <GDBusProxy> that is emitting a D-Bus signal.

sender-name

Passed: a string.

The sender of the signal or NULL if the connection is not a bus connection.

signal-name

Passed: a string.

The signal name.

parameters

Passed: a <GVariant>.

A <GVariant> tuple with parameters for the signal.

Virtual methods

Virtual method: dbus-object-manager-client:do-interface-proxy-properties-changed implementor self object-proxy interface-proxy changed-properties invalidated-properties

Signal class handler for the dbus-object-manager-client:interface-proxy-properties-changed signal.

To override it in a new class, give register-type #:vfuncs `((interface-proxy-properties-changed . ,procedure)). The procedure is called as (procedure self object-proxy interface-proxy changed-properties invalidated-properties).

implementor

Passed: the class whose implementation to call: <GDBusObjectManagerClient>, or a class that derives from it, or its GType number.

self

Passed: a <GDBusObjectManagerClient>.

object-proxy

Passed: a <GDBusObjectProxy>.

interface-proxy

Passed: a <GDBusProxy>.

changed-properties

Passed: a <GVariant>.

invalidated-properties

Passed: a string.

Virtual method: dbus-object-manager-client:do-interface-proxy-signal implementor self object-proxy interface-proxy sender-name signal-name parameters

Signal class handler for the dbus-object-manager-client:interface-proxy-signal signal.

To override it in a new class, give register-type #:vfuncs `((interface-proxy-signal . ,procedure)). The procedure is called as (procedure self object-proxy interface-proxy sender-name signal-name parameters).

implementor

Passed: the class whose implementation to call: <GDBusObjectManagerClient>, or a class that derives from it, or its GType number.

self

Passed: a <GDBusObjectManagerClient>.

object-proxy

Passed: a <GDBusObjectProxy>.

interface-proxy

Passed: a <GDBusProxy>.

sender-name

Passed: a string.

signal-name

Passed: a string.

parameters

Passed: a <GVariant>.