DBusNames

Description Convenience API for owning bus names.

class DBusNames {}

Members

Static functions

ownName
uint ownName(GBusType busType, string name, GBusNameOwnerFlags flags, GBusAcquiredCallback busAcquiredHandler, GBusNameAcquiredCallback nameAcquiredHandler, GBusNameLostCallback nameLostHandler, void* userData, GDestroyNotify userDataFreeFunc)

Starts acquiring name on the bus specified by bus_type and calls name_acquired_handler and name_lost_handler when the name is acquired respectively lost. Callbacks will be invoked in the thread-default main loop of the thread you are calling this function from. You are guaranteed that one of the name_acquired_handler and name_lost_handler callbacks will be invoked after calling this function - there are three Since 2.26

ownNameOnConnection
uint ownNameOnConnection(DBusConnection connection, string name, GBusNameOwnerFlags flags, GBusNameAcquiredCallback nameAcquiredHandler, GBusNameLostCallback nameLostHandler, void* userData, GDestroyNotify userDataFreeFunc)

Like g_bus_own_name() but takes a GDBusConnection instead of a GBusType. Since 2.26

ownNameOnConnectionWithClosures
uint ownNameOnConnectionWithClosures(DBusConnection connection, string name, GBusNameOwnerFlags flags, Closure nameAcquiredClosure, Closure nameLostClosure)

Version of g_bus_own_name_on_connection() using closures instead of callbacks for easier binding in other languages. Since 2.26

ownNameWithClosures
uint ownNameWithClosures(GBusType busType, string name, GBusNameOwnerFlags flags, Closure busAcquiredClosure, Closure nameAcquiredClosure, Closure nameLostClosure)

Version of g_bus_own_name() using closures instead of callbacks for easier binding in other languages. Since 2.26

unownName
void unownName(uint ownerId)

Stops owning a name. Since 2.26

unwatchName
void unwatchName(uint watcherId)

Stops watching a name. Since 2.26

watchName
uint watchName(GBusType busType, string name, GBusNameWatcherFlags flags, GBusNameAppearedCallback nameAppearedHandler, GBusNameVanishedCallback nameVanishedHandler, void* userData, GDestroyNotify userDataFreeFunc)

Starts watching name on the bus specified by bus_type and calls name_appeared_handler and name_vanished_handler when the name is known to have a owner respectively known to lose its owner. Callbacks will be invoked in the thread-default main loop of the thread you are calling this function from. You are guaranteed that one of the handlers will be invoked after calling this function. When you are done watching the name, just call g_bus_unwatch_name() with the watcher id this function returns. If the name vanishes or appears (for example the application owning the name could restart), the handlers are also invoked. If the GDBusConnection that is used for watching the name disconnects, then name_vanished_handler is invoked since it is no longer possible to access the name. Another guarantee is that invocations of name_appeared_handler and name_vanished_handler are guaranteed to alternate; that is, if name_appeared_handler is invoked then you are guaranteed that the next time one of the handlers is invoked, it will be name_vanished_handler. The reverse is also true. This behavior makes it very simple to write applications that wants to take action when a certain name exists, see Example 9, “Simple application watching a name”. Basically, the application should create object proxies in name_appeared_handler and destroy them again (if any) in name_vanished_handler. Since 2.26

watchNameOnConnection
uint watchNameOnConnection(DBusConnection connection, string name, GBusNameWatcherFlags flags, GBusNameAppearedCallback nameAppearedHandler, GBusNameVanishedCallback nameVanishedHandler, void* userData, GDestroyNotify userDataFreeFunc)

Like g_bus_watch_name() but takes a GDBusConnection instead of a GBusType. Since 2.26

watchNameOnConnectionWithClosures
uint watchNameOnConnectionWithClosures(DBusConnection connection, string name, GBusNameWatcherFlags flags, Closure nameAppearedClosure, Closure nameVanishedClosure)

Version of g_bus_watch_name_on_connection() using closures instead of callbacks for easier binding in other languages. Since 2.26

watchNameWithClosures
uint watchNameWithClosures(GBusType busType, string name, GBusNameWatcherFlags flags, Closure nameAppearedClosure, Closure nameVanishedClosure)

Version of g_bus_watch_name() using closures instead of callbacks for easier binding in other languages. Since 2.26

Meta