DBusObjectManagerClient

gio.dbus_object_manager_client.DBusObjectManagerClient is used to create, monitor and delete object proxies for remote objects exported by a gio.dbus_object_manager_server.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 gio.dbus_object_proxy.DBusObjectProxy objects returned by gio.dbus_object_manager.DBusObjectManager.getObjects.

If the name for a gio.dbus_object_manager_client.DBusObjectManagerClient 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 gio.types.DBusObjectManagerClientFlags.DoNotAutoStart 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, gio.dbus_object_manager_client.DBusObjectManagerClient object construction still succeeds but there will be no object proxies (e.g. gio.dbus_object_manager.DBusObjectManager.getObjects returns the empty list) and the gio.dbus_object_manager_client.DBusObjectManagerClient.utf8 property is NULL.

The owner of the requested name can come and go (for example consider a system service being restarted) – gio.dbus_object_manager_client.DBusObjectManagerClient handles this case too; simply connect to the gobject.object.ObjectG.notify signal to watch for changes on the gio.dbus_object_manager_client.DBusObjectManagerClient.utf8 property. When the name owner vanishes, the behavior is that gio.dbus_object_manager_client.DBusObjectManagerClient.utf8 is set to NULL (this includes emission of the gobject.object.ObjectG.notify signal) and then signal@Gio.DBusObjectManager::object-removed signals are synthesized for all currently existing object proxies. Since gio.dbus_object_manager_client.DBusObjectManagerClient.utf8 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 gio.dbus_object_manager.DBusObjectManager. Similarly, when a new name owner appears, signal@Gio.DBusObjectManager::object-added signals are synthesized while gio.dbus_object_manager_client.DBusObjectManagerClient.utf8 is still NULL. Only when all object proxies have been added, the gio.dbus_object_manager_client.DBusObjectManagerClient.utf8 is set to the new name owner (this includes emission of the gobject.object.ObjectG.notify signal). Furthermore, you are guaranteed that gio.dbus_object_manager_client.DBusObjectManagerClient.utf8 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, gio.dbus_object_manager_client.DBusObjectManagerClient is used to obtain gio.dbus_proxy.DBusProxy instances. All signals (including the org.freedesktop.DBus.Properties::PropertiesChanged signal) delivered to gio.dbus_proxy.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 gio.dbus_object_proxy.DBusObjectProxy and gio.dbus_proxy.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 gio.dbus_object_manager_client.DBusObjectManagerClient 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 glib.main_context.MainContext.pushThreadDefault) that the gio.dbus_object_manager_client.DBusObjectManagerClient object was constructed in. Additionally, the gio.dbus_object_proxy.DBusObjectProxy and gio.dbus_proxy.DBusProxy objects originating from the gio.dbus_object_manager_client.DBusObjectManagerClient object will be created in the same context and, consequently, will deliver signals in the same main loop.

class DBusObjectManagerClient : ObjectG , AsyncInitable , DBusObjectManager , Initable {}

Members

Functions

connectInterfaceProxyPropertiesChanged
ulong connectInterfaceProxyPropertiesChanged(T callback, Flag!"After" after)

Connect to InterfaceProxyPropertiesChanged signal.

connectInterfaceProxySignal
ulong connectInterfaceProxySignal(T callback, Flag!"After" after)

Connect to InterfaceProxySignal signal.

getConnection
gio.dbus_connection.DBusConnection getConnection()

Gets the #GDBusConnection used by manager.

getFlags
gio.types.DBusObjectManagerClientFlags getFlags()

Gets the flags that manager was constructed with.

getName
string getName()

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

getNameOwner
string getNameOwner()

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.

Static functions

newFinish
gio.dbus_object_manager_client.DBusObjectManagerClient newFinish(gio.async_result.AsyncResult res)

Finishes an operation started with gio.dbus_object_manager_client.DBusObjectManagerClient.new_.

newForBus
void newForBus(gio.types.BusType busType, gio.types.DBusObjectManagerClientFlags flags, string name, string objectPath, gio.types.DBusProxyTypeFunc getProxyTypeFunc, gio.cancellable.Cancellable cancellable, gio.types.AsyncReadyCallback callback)

Like gio.dbus_object_manager_client.DBusObjectManagerClient.new_ but takes a #GBusType instead of a #GDBusConnection.

newForBusFinish
gio.dbus_object_manager_client.DBusObjectManagerClient newForBusFinish(gio.async_result.AsyncResult res)

Finishes an operation started with gio.dbus_object_manager_client.DBusObjectManagerClient.newForBus.

newForBusSync
gio.dbus_object_manager_client.DBusObjectManagerClient newForBusSync(gio.types.BusType busType, gio.types.DBusObjectManagerClientFlags flags, string name, string objectPath, gio.types.DBusProxyTypeFunc getProxyTypeFunc, gio.cancellable.Cancellable cancellable)

Like gio.dbus_object_manager_client.DBusObjectManagerClient.newSync but takes a #GBusType instead of a #GDBusConnection.

newSync
gio.dbus_object_manager_client.DBusObjectManagerClient newSync(gio.dbus_connection.DBusConnection connection, gio.types.DBusObjectManagerClientFlags flags, string name, string objectPath, gio.types.DBusProxyTypeFunc getProxyTypeFunc, gio.cancellable.Cancellable cancellable)

Creates a new #GDBusObjectManagerClient object.

new_
void new_(gio.dbus_connection.DBusConnection connection, gio.types.DBusObjectManagerClientFlags flags, string name, string objectPath, gio.types.DBusProxyTypeFunc getProxyTypeFunc, gio.cancellable.Cancellable cancellable, gio.types.AsyncReadyCallback callback)

Asynchronously creates a new #GDBusObjectManagerClient object.

Mixed In Members

From mixin AsyncInitableT!()

initAsync
void initAsync(int ioPriority, gio.cancellable.Cancellable cancellable, gio.types.AsyncReadyCallback callback)

Starts asynchronous initialization of the object implementing the interface. This must be done before any real use of the object after initial construction. If the object also implements #GInitable you can optionally call gio.initable.Initable.init_ instead.

initFinish
bool initFinish(gio.async_result.AsyncResult res)

Finishes asynchronous initialization and returns the result. See gio.async_initable.AsyncInitable.initAsync.

newFinish
gobject.object.ObjectG newFinish(gio.async_result.AsyncResult res)

Finishes the async construction for the various g_async_initable_new calls, returning the created object or null on error.

From mixin DBusObjectManagerT!()

getInterface
gio.dbus_interface.DBusInterface getInterface(string objectPath, string interfaceName)

Gets the interface proxy for interface_name at object_path, if any.

getObject
gio.dbus_object.DBusObject getObject(string objectPath)

Gets the #GDBusObject at object_path, if any.

getObjectPath
string getObjectPath()

Gets the object path that manager is for.

getObjects
gio.dbus_object.DBusObject[] getObjects()

Gets all #GDBusObject objects known to manager.

connectInterfaceAdded
ulong connectInterfaceAdded(T callback, Flag!"After" after)

Connect to InterfaceAdded signal.

connectInterfaceRemoved
ulong connectInterfaceRemoved(T callback, Flag!"After" after)

Connect to InterfaceRemoved signal.

connectObjectAdded
ulong connectObjectAdded(T callback, Flag!"After" after)

Connect to ObjectAdded signal.

connectObjectRemoved
ulong connectObjectRemoved(T callback, Flag!"After" after)

Connect to ObjectRemoved signal.

From mixin InitableT!()

init_
bool init_(gio.cancellable.Cancellable cancellable)

Initializes the object implementing the interface.

Inherited Members

From ObjectG

setGObject
void setGObject(void* cObj, Flag!"Take" take)

Set the GObject of a D ObjectG wrapper.

cPtr
void* cPtr(Flag!"Dup" dup)

Get a pointer to the underlying C object.

ref_
void* ref_(void* gObj)

Calls g_object_ref() on a GObject.

unref
unref(void* gObj)

Calls g_object_unref() on a GObject.

getType
GType getType()

Get the GType of an object.

gType
GType gType [@property getter]

GObject GType property.

self
ObjectG self()

Convenience method to return this cast to a type. For use in D with statements.

getDObject
T getDObject(void* cptr, Flag!"Take" take)

Template to get the D object from a C GObject and cast it to the given D object type.

connectSignalClosure
ulong connectSignalClosure(string signalDetail, DClosure closure, Flag!"After" after)

Connect a D closure to an object signal.

setProperty
void setProperty(string propertyName, T val)

Template for setting a GObject property.

getProperty
T getProperty(string propertyName)

Template for getting a GObject property.

compatControl
size_t compatControl(size_t what, void* data)
bindProperty
gobject.binding.Binding bindProperty(string sourceProperty, gobject.object.ObjectG target, string targetProperty, gobject.types.BindingFlags flags)

Creates a binding between source_property on source and target_property on target.

bindPropertyFull
gobject.binding.Binding bindPropertyFull(string sourceProperty, gobject.object.ObjectG target, string targetProperty, gobject.types.BindingFlags flags, gobject.closure.Closure transformTo, gobject.closure.Closure transformFrom)

Creates a binding between source_property on source and target_property on target, allowing you to set the transformation functions to be used by the binding.

forceFloating
void forceFloating()

This function is intended for #GObject implementations to re-enforce a floating[floating-ref] object reference. Doing this is seldom required: all #GInitiallyUnowneds are created with a floating reference which usually just needs to be sunken by calling gobject.object.ObjectG.refSink.

freezeNotify
void freezeNotify()

Increases the freeze count on object. If the freeze count is non-zero, the emission of "notify" signals on object is stopped. The signals are queued until the freeze count is decreased to zero. Duplicate notifications are squashed so that at most one #GObject::notify signal is emitted for each property modified while the object is frozen.

getData
void* getData(string key)

Gets a named field from the objects table of associations (see gobject.object.ObjectG.setData).

getProperty
void getProperty(string propertyName, gobject.value.Value value)

Gets a property of an object.

getQdata
void* getQdata(glib.types.Quark quark)

This function gets back user data pointers stored via gobject.object.ObjectG.setQdata.

getv
void getv(string[] names, gobject.value.Value[] values)

Gets n_properties properties for an object. Obtained properties will be set to values. All properties must be valid. Warnings will be emitted and undefined behaviour may result if invalid properties are passed in.

isFloating
bool isFloating()

Checks whether object has a floating[floating-ref] reference.

notify
void notify(string propertyName)

Emits a "notify" signal for the property property_name on object.

notifyByPspec
void notifyByPspec(gobject.param_spec.ParamSpec pspec)

Emits a "notify" signal for the property specified by pspec on object.

refSink
gobject.object.ObjectG refSink()

Increase the reference count of object, and possibly remove the floating[floating-ref] reference, if object has a floating reference.

runDispose
void runDispose()

Releases all references to other objects. This can be used to break reference cycles.

setData
void setData(string key, void* data)

Each object carries around a table of associations from strings to pointers. This function lets you set an association.

setProperty
void setProperty(string propertyName, gobject.value.Value value)

Sets a property on an object.

stealData
void* stealData(string key)

Remove a specified datum from the object's data associations, without invoking the association's destroy handler.

stealQdata
void* stealQdata(glib.types.Quark quark)

This function gets back user data pointers stored via gobject.object.ObjectG.setQdata and removes the data from object without invoking its destroy() function (if any was set). Usually, calling this function is only required to update user data pointers with a destroy notifier, for example:

thawNotify
void thawNotify()

Reverts the effect of a previous call to gobject.object.ObjectG.freezeNotify. The freeze count is decreased on object and when it reaches zero, queued "notify" signals are emitted.

watchClosure
void watchClosure(gobject.closure.Closure closure)

This function essentially limits the life time of the closure to the life time of the object. That is, when the object is finalized, the closure is invalidated by calling gobject.closure.Closure.invalidate on it, in order to prevent invocations of the closure with a finalized (nonexisting) object. Also, gobject.object.ObjectG.ref_ and gobject.object.ObjectG.unref are added as marshal guards to the closure, to ensure that an extra reference count is held on object during invocation of the closure. Usually, this function will be called on closures that use this object as closure data.

connectNotify
ulong connectNotify(string detail, T callback, Flag!"After" after)

Connect to Notify signal.

From AsyncInitable

newvAsync
void newvAsync(gobject.types.GType objectType, uint nParameters, gobject.parameter.Parameter parameters, int ioPriority, gio.cancellable.Cancellable cancellable, gio.types.AsyncReadyCallback callback)

Helper function for constructing #GAsyncInitable object. This is similar to gobject.object.ObjectG.newv but also initializes the object asynchronously.

initAsync
void initAsync(int ioPriority, gio.cancellable.Cancellable cancellable, gio.types.AsyncReadyCallback callback)

Starts asynchronous initialization of the object implementing the interface. This must be done before any real use of the object after initial construction. If the object also implements #GInitable you can optionally call gio.initable.Initable.init_ instead.

initFinish
bool initFinish(gio.async_result.AsyncResult res)

Finishes asynchronous initialization and returns the result. See gio.async_initable.AsyncInitable.initAsync.

newFinish
gobject.object.ObjectG newFinish(gio.async_result.AsyncResult res)

Finishes the async construction for the various g_async_initable_new calls, returning the created object or null on error.

From DBusObjectManager

getInterface
gio.dbus_interface.DBusInterface getInterface(string objectPath, string interfaceName)

Gets the interface proxy for interface_name at object_path, if any.

getObject
gio.dbus_object.DBusObject getObject(string objectPath)

Gets the #GDBusObject at object_path, if any.

getObjectPath
string getObjectPath()

Gets the object path that manager is for.

getObjects
gio.dbus_object.DBusObject[] getObjects()

Gets all #GDBusObject objects known to manager.

connectInterfaceAdded
ulong connectInterfaceAdded(T callback, Flag!"After" after)

Connect to InterfaceAdded signal.

connectInterfaceRemoved
ulong connectInterfaceRemoved(T callback, Flag!"After" after)

Connect to InterfaceRemoved signal.

connectObjectAdded
ulong connectObjectAdded(T callback, Flag!"After" after)

Connect to ObjectAdded signal.

connectObjectRemoved
ulong connectObjectRemoved(T callback, Flag!"After" after)

Connect to ObjectRemoved signal.

From Initable

init_
bool init_(gio.cancellable.Cancellable cancellable)

Initializes the object implementing the interface.