|
| using | Gio::DBus::SlotBusAcquired = sigc::slot<void(const Glib::RefPtr<Gio::DBus::Connection>&, Glib::ustring)> |
| | For example, void on_bus_acquired(const Glib::RefPtr<Gio::DBus::Connection>& connection,
const Glib::ustring& name);.
|
| |
| using | Gio::DBus::SlotNameAcquired = sigc::slot<void(const Glib::RefPtr<Gio::DBus::Connection>&, Glib::ustring)> |
| | For example, void on_name_acquired(const Glib::RefPtr<Gio::DBus::Connection>& connection,
const Glib::ustring& name);.
|
| |
| using | Gio::DBus::SlotNameLost = sigc::slot<void(const Glib::RefPtr<Gio::DBus::Connection>&, Glib::ustring)> |
| | For example, void on_name_lost(const Glib::RefPtr<Gio::DBus::Connection>& connection,
const Glib::ustring& name);.
|
| |
| using | Gio::DBus::SlotNameAppeared = sigc::slot<void(const Glib::RefPtr<Gio::DBus::Connection>&, Glib::ustring, const Glib::ustring&)> |
| | For example, void on_name_appeared(const Glib::RefPtr<Gio::DBus::Connection>& connection,
const Glib::ustring& name, const Glib::ustring& name_owner);.
|
| |
| using | Gio::DBus::SlotNameVanished = sigc::slot<void(const Glib::RefPtr<Gio::DBus::Connection>&, Glib::ustring)> |
| | For example, void on_name_vanished(const Glib::RefPtr<Gio::DBus::Connection>& connection,
const Glib::ustring& name);.
|
| |
|
| bool | Gio::DBus::Address::is_address (const std::string &string) |
| | Checks if string is a D-Bus address.
|
| |
| bool | Gio::DBus::Address::is_supported (const std::string & address) |
| | Like is_address() but also checks if the library supports the transports in address and that key/value pairs for each transport are valid.
|
| |
| void | Gio::DBus::Address::get_stream (const std::string & address, const SlotAsyncReady slot, const Glib::RefPtr< Cancellable > & cancellable) |
| | Asynchronously connects to an endpoint specified by address and sets up the connection so it is in a state to run the client-side of the D-Bus authentication conversation.
|
| |
| Glib::RefPtr< IOStream > | Gio::DBus::Address::get_stream_finish (const Glib::RefPtr< AsyncResult > & res, std::string & out_guid) |
| | Finishes an operation started with get_stream().
|
| |
| Glib::RefPtr< IOStream > | Gio::DBus::Address::get_stream_finish (const Glib::RefPtr< AsyncResult > & res) |
| | Finishes an operation started with get_stream().
|
| |
| Glib::RefPtr< IOStream > | Gio::DBus::Address::get_stream_sync (const std::string & address, const Glib::RefPtr< Cancellable > & cancellable, std::string & out_guid) |
| | Synchronously connects to an endpoint specified by address and sets up the connection so it is in a state to run the client-side of the D-Bus authentication conversation.
|
| |
| Glib::RefPtr< IOStream > | Gio::DBus::Address::get_stream_sync (const std::string & address, const Glib::RefPtr< Cancellable > & cancellable) |
| | Synchronously connects to an endpoint specified by address and sets up the connection so it is in a state to run the client-side of the D-Bus authentication conversation.
|
| |
| std::string | Gio::DBus::Address::get_for_bus_sync (BusType bus_type, const Glib::RefPtr< Cancellable > & cancellable) |
| | Synchronously looks up the D-Bus address for the well-known message bus instance specified by bus_type.
|
| |
| bool | Gio::DBus::ErrorUtils::is_remote_error (const Glib::Error & error) |
| | Checks if error represents an error received via D-Bus from a remote peer.
|
| |
| Glib::ustring | Gio::DBus::ErrorUtils::get_remote_error (const Glib::Error & error) |
| | Gets the D-Bus error name used for error, if any.
|
| |
| bool | Gio::DBus::ErrorUtils::strip_remote_error (Glib::Error & error) |
| | Looks for extra information in the error message used to recover the D-Bus error name and strips it if found.
|
| |
| guint | Gio::DBus::own_name (BusType bus_type, const Glib::ustring & name, const SlotBusAcquired & bus_acquired_slot={}, const SlotNameAcquired & name_acquired_slot={}, const SlotNameLost & name_lost_slot={}, BusNameOwnerFlags flags=Gio::DBus::BusNameOwnerFlags::NONE) |
| | Starts acquiring name on the bus specified by bus_type and calls name_acquired_slot and name_lost_slot when the name is acquired respectively lost.
|
| |
| std::string | Gio::DBus::generate_guid () |
| | Generate a D-Bus GUID that can be used with e.g.
|
| |
| bool | Gio::DBus::is_guid (const std::string &string) |
| | Checks if string is a D-Bus GUID.
|
| |
| bool | Gio::DBus::is_name (const Glib::ustring &string) |
| | Checks if string is a valid D-Bus bus name (either unique or well-known).
|
| |
| bool | Gio::DBus::is_unique_name (const Glib::ustring &string) |
| | Checks if string is a valid D-Bus unique bus name.
|
| |
| bool | Gio::DBus::is_member_name (const Glib::ustring &string) |
| | Checks if string is a valid D-Bus member (e.g.
|
| |
| bool | Gio::DBus::is_interface_name (const Glib::ustring &string) |
| | Checks if string is a valid D-Bus interface name.
|
| |
| guint | Gio::DBus::watch_name (BusType bus_type, const Glib::ustring & name, const SlotNameAppeared & name_appeared_slot={}, const SlotNameVanished & name_vanished_slot={}, BusNameWatcherFlags flags=Gio::DBus::BusNameWatcherFlags::NONE) |
| | Starts watching name on the bus specified by bus_type and calls name_appeared_slot and name_vanished_slot when the name is known to have a owner respectively known to lose its owner.
|
| |
| guint | Gio::DBus::watch_name (const Glib::RefPtr< Connection > & connection, const Glib::ustring & name, const SlotNameAppeared & name_appeared_slot={}, const SlotNameVanished & name_vanished_slot={}, BusNameWatcherFlags flags=Gio::DBus::BusNameWatcherFlags::NONE) |
| | A watch_name() function that takes a Connection instead of a BusType.
|
| |
| void | Gio::DBus::unwatch_name (guint watcher_id) |
| | Stops watching a name.
|
| |
API to use D-Bus services as a client or to implement a D-Bus service. To write client code, see Gio::DBus::Proxy. To export objects on the bus for other clients, see Gio::DBus::own_name(), for instance.
Starts acquiring name on the bus specified by bus_type and calls name_acquired_slot and name_lost_slot when the name is acquired respectively lost.
Slots 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_slot and name_lost_slot slots will be invoked after calling this function - there are three possible cases:
- name_lost_slot with a nullptr connection (if a connection to the bus can't be made).
- bus_acquired_slot then name_lost_slot (if the name can't be obtained)
- bus_acquired_slot then name_acquired_slot (if the name was obtained).
When you are done owning the name, just call unown_name() with the owner id this function returns.
If the name is acquired or lost (for example another application could acquire the name if you allow replacement or the application currently owning the name exits), the slots are also invoked. If the Connection that is used for attempting to own the name closes, then name_lost_slot is invoked since it is no longer possible for other processes to access the process.
You cannot use own_name() several times for the same name (unless interleaved with calls to unown_name()) - only the first call will work.
Another guarantee is that invocations of name_acquired_slot and name_lost_slot are guaranteed to alternate; that is, if name_acquired_slot is invoked then you are guaranteed that the next time one of the slots is invoked, it will be name_lost_slot. The reverse is also true.
If you plan on exporting objects (using e.g. Gio::DbusConnection::register_object()), note that it is generally too late to export the objects in name_acquired_slot. Instead, you can do this in bus_acquired_slot since you are guaranteed that this will run before name is requested from the bus.
This behavior makes it very simple to write applications that wants to own names and export objects.
- Parameters
-
| bus_type | The type of bus to own a name on. |
| name | The well-known name to own. |
| bus_acquired_slot | Slot to invoke when connected to the bus of type bus_type. |
| name_acquired_slot | Slot to invoke when name is acquired. |
| name_lost_slot | Slot to invoke when name is lost. |
| flags | A set of flags from the BusNameOwnerFlags enumeration. |
- Returns
- An identifier (never 0) that an be used with unown_name() to stop owning the name.
- Since glibmm 2.28
Starts watching name on the bus specified by bus_type and calls name_appeared_slot and name_vanished_slot 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 slot will be invoked after calling this function. When you are done watching the name, just call 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 slot are also invoked. If the Connection that is used for watching the name disconnects, then name_vanished_slot is invoked since it is no longer possible to access the name.
Another guarantee is that invocations of name_appeared_slot and name_vanished_slot are guaranteed to alternate; that is, if name_appeared_slot is invoked then you are guaranteed that the next time one of the slot is invoked, it will be name_vanished_slot. 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 the C API's Example 9, “Simple application watching a name” for more information. Basically, the application should create object proxies in name_appeared_slot and destroy them again (if any) in name_vanished_slot.
- Parameters
-
| bus_type | The type of bus to watch a name on. |
| name | The name (well-known or unique) to watch. |
| name_appeared_slot | Slot to invoke when name is known to exist. |
| name_vanished_slot | Slot to invoke when name is known to not exist. |
| flags | Flags from the BusNameWatcherFlags enumeration. |
- Returns
- An identifier (never 0) that can be used with unwatch_name() to stop watching the name.
- Since glibmm 2.28