diff options
author | Murray Cumming <murrayc@murrayc.com> | 2011-02-16 11:29:19 +0100 |
---|---|---|
committer | Murray Cumming <murrayc@murrayc.com> | 2011-02-16 11:29:19 +0100 |
commit | 4e118b927f83290bae27bcae707be8e1c83f47d5 (patch) | |
tree | ec7ec4fa6c8424e19a97dc935d6f4e61ece8d882 /gio/src/dbusconnection.hg | |
parent | ce84ddbd917364c61d50c3921c1f32fdde9f6698 (diff) | |
download | glibmm-4e118b927f83290bae27bcae707be8e1c83f47d5.tar.gz |
Move the DBus classes into a Gio::DBus namespace.
* gio/giomm.h:
* gio/src/dbus*.[hg|ccg]
* gio/src/error.hg: Rename all DBus* classes to remove the prefix, putting
them in a Gio::DBus namespace.
This required the use of the new _GMMPROC_EXTRA_NAMESPACE macro, to avoid
generating a confused wrap_init.cc.
Along the way, I removed unnecessary class predeclarations, instead including
the relevant header, because that is more convenient for users of the API.
* gio/src/dbuserror.[hg|ccg]: Renamed to dbuserrorutils.[hg|ccg] and
renamed the Error namespace to ErrorUtils, to avoid a clash with the
Gio::DBus::Error exception.
* gio/src/filelist.am:
* tools/m4/convert_gio.m4: Changed some conversions.
* examples/dbus/busserver.cc:
* examples/dbus/peer.cc:
* examples/dbus/userbus.cc: Adapted.
This is generally more organized. A prefix, instead of a namespace, looked
generally wrong to C++ coders.
Diffstat (limited to 'gio/src/dbusconnection.hg')
-rw-r--r-- | gio/src/dbusconnection.hg | 355 |
1 files changed, 181 insertions, 174 deletions
diff --git a/gio/src/dbusconnection.hg b/gio/src/dbusconnection.hg index e6d4f72a..9a84d32b 100644 --- a/gio/src/dbusconnection.hg +++ b/gio/src/dbusconnection.hg @@ -20,6 +20,9 @@ #include <glibmm/object.h> #include <giomm/initable.h> #include <giomm/asyncinitable.h> +#include <giomm/dbusauthobserver.h> +#include <giomm/dbusmethodinvocation.h> +#include <giomm/dbusintrospection.h> #include <giomm/iostream.h> #include <giomm/asyncresult.h> #include <giomm/credentials.h> @@ -33,145 +36,147 @@ _PINCLUDE(glibmm/private/object_p.h) namespace Gio { +namespace DBus +{ + _WRAP_ENUM(BusType, GBusType) -_WRAP_ENUM(DBusCallFlags, GDBusCallFlags, NO_GTYPE) -_WRAP_ENUM(DBusConnectionFlags, GDBusConnectionFlags, NO_GTYPE) -_WRAP_ENUM(DBusSendMessageFlags, GDBusSendMessageFlags, NO_GTYPE) -_WRAP_ENUM(DBusSignalFlags, GDBusSignalFlags, NO_GTYPE) -_WRAP_ENUM(DBusSubtreeFlags, GDBusSubtreeFlags, NO_GTYPE) - -class DBusAuthObserver; -class DBusInterfaceInfo; -class DBusInterfaceVTable; -class DBusMethodInvocation; -class DBusSubtreeVTable; +_WRAP_ENUM(CallFlags, GDBusCallFlags, s#^DBUS_##, NO_GTYPE) +_WRAP_ENUM(ConnectionFlags, GDBusConnectionFlags, s#^DBUS_##, NO_GTYPE) +_WRAP_ENUM(SendMessageFlags, GDBusSendMessageFlags, s#^DBUS_##, NO_GTYPE) +_WRAP_ENUM(SignalFlags, GDBusSignalFlags, s#^DBUS_##, NO_GTYPE) +_WRAP_ENUM(SubtreeFlags, GDBusSubtreeFlags, s#^DBUS_##, NO_GTYPE) + +class InterfaceVTable; +class SubtreeVTable; + +_GMMPROC_EXTRA_NAMESPACE(DBus) /// @defgroup DBus D-Bus API //TODO: Add example from C API in class docs. -/** DBusConnection - D-Bus Connections. - * The DBusConnection type is used for D-Bus connections to remote peers such +/** A D-Bus Connection. + * The Connection type is used for D-Bus connections to remote peers such * as a message buses. It is a low-level API that offers a lot of flexibility. * For instance, it lets you establish a connection over any transport that * can by represented as an IOStream. * * This class is rarely used directly in D-Bus clients. If you are writing an * D-Bus client, it is often easier to use the Gio::DBus::own_name(), - * Gio::DBus::watch_name() or DBusProxy::create_for_bus() APIs. + * Gio::DBus::watch_name() or Gio::DBus::Proxy::create_for_bus() APIs. * * @newin{2,28} * @ingroup DBus */ -class DBusConnection +class Connection : public Glib::Object, public Initable, public AsyncInitable { protected: - _CLASS_GOBJECT(DBusConnection, GDBusConnection, G_DBUS_CONNECTION, Glib::Object, GObject) + _CLASS_GOBJECT(Connection, GDBusConnection, G_DBUS_CONNECTION, Glib::Object, GObject) _IMPLEMENTS_INTERFACE(Initable) _IMPLEMENTS_INTERFACE(AsyncInitable) protected: - DBusConnection(const Glib::RefPtr<IOStream>& stream, + Connection(const Glib::RefPtr<IOStream>& stream, const std::string& guid, - const Glib::RefPtr<DBusAuthObserver>& observer, + const Glib::RefPtr<AuthObserver>& observer, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, - DBusConnectionFlags flags); + ConnectionFlags flags); - DBusConnection(const Glib::RefPtr<IOStream>& stream, + Connection(const Glib::RefPtr<IOStream>& stream, const std::string& guid, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, - DBusConnectionFlags flags); + ConnectionFlags flags); - DBusConnection(const Glib::RefPtr<IOStream>& stream, + Connection(const Glib::RefPtr<IOStream>& stream, const std::string& guid, - const Glib::RefPtr<DBusAuthObserver>& observer, + const Glib::RefPtr<AuthObserver>& observer, const SlotAsyncReady& slot, - DBusConnectionFlags flags); + ConnectionFlags flags); - DBusConnection(const Glib::RefPtr<IOStream>& stream, + Connection(const Glib::RefPtr<IOStream>& stream, const std::string& guid, const SlotAsyncReady& slot, - DBusConnectionFlags flags); + ConnectionFlags flags); - DBusConnection(const Glib::RefPtr<IOStream>& stream, + Connection(const Glib::RefPtr<IOStream>& stream, const std::string& guid, - const Glib::RefPtr<DBusAuthObserver>& observer, + const Glib::RefPtr<AuthObserver>& observer, const Glib::RefPtr<Cancellable>& cancellable, - DBusConnectionFlags flags); + ConnectionFlags flags); - DBusConnection(const Glib::RefPtr<IOStream>& stream, + Connection(const Glib::RefPtr<IOStream>& stream, const std::string& guid, const Glib::RefPtr<Cancellable>& cancellable, - DBusConnectionFlags flags); + ConnectionFlags flags); - DBusConnection(const Glib::RefPtr<IOStream>& stream, + Connection(const Glib::RefPtr<IOStream>& stream, const std::string& guid, - const Glib::RefPtr<DBusAuthObserver>& observer, - DBusConnectionFlags flags); + const Glib::RefPtr<AuthObserver>& observer, + ConnectionFlags flags); - DBusConnection(const Glib::RefPtr<IOStream>& stream, + Connection(const Glib::RefPtr<IOStream>& stream, const std::string& guid, - DBusConnectionFlags flags); + ConnectionFlags flags); - DBusConnection(const std::string& address, - const Glib::RefPtr<DBusAuthObserver>& observer, + Connection(const std::string& address, + const Glib::RefPtr<AuthObserver>& observer, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, - DBusConnectionFlags flags); + ConnectionFlags flags); - DBusConnection(const std::string& address, + Connection(const std::string& address, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, - DBusConnectionFlags flags); + ConnectionFlags flags); - DBusConnection(const std::string& address, - const Glib::RefPtr<DBusAuthObserver>& observer, + Connection(const std::string& address, + const Glib::RefPtr<AuthObserver>& observer, const SlotAsyncReady& slot, - DBusConnectionFlags flags); + ConnectionFlags flags); - DBusConnection(const std::string& address, + Connection(const std::string& address, const SlotAsyncReady& slot, - DBusConnectionFlags flags); + ConnectionFlags flags); - DBusConnection(const std::string& address, - const Glib::RefPtr<DBusAuthObserver>& observer, + Connection(const std::string& address, + const Glib::RefPtr<AuthObserver>& observer, const Glib::RefPtr<Cancellable>& cancellable, - DBusConnectionFlags flags); + ConnectionFlags flags); - DBusConnection(const std::string& address, + Connection(const std::string& address, const Glib::RefPtr<Cancellable>& cancellable, - DBusConnectionFlags flags); + ConnectionFlags flags); - DBusConnection(const std::string& address, - const Glib::RefPtr<DBusAuthObserver>& observer, - DBusConnectionFlags flags); + Connection(const std::string& address, + const Glib::RefPtr<AuthObserver>& observer, + ConnectionFlags flags); - DBusConnection(const std::string& address, - DBusConnectionFlags flags); + Connection(const std::string& address, + ConnectionFlags flags); public: /** Signature for slot used in signal_subscribe(). * For example, * @code - * void on_signal(const Glib::RefPtr<DBusConnection>& connection, const + * void on_signal(const Glib::RefPtr<Connection>& connection, const * Glib::ustring& sender_name, const Glib::ustring& object_path, const * Glib::ustring& object_path, const Glib::ustring& interface_name, const * Glib::ustring& signal_name, const Glib::VariantBase& parameters);. * @endcode */ - typedef sigc::slot<void, const Glib::RefPtr<DBusConnection>&, + typedef sigc::slot<void, const Glib::RefPtr<Connection>&, const Glib::ustring&, const Glib::ustring&, const Glib::ustring&, const Glib::ustring&, const Glib::VariantBase&> SlotSignal; /** Signature for slot used in add_filter(). * For example, * @code - * Glib::RefPtr<DBusMessage> on_message_filter(const - * Glib::RefPtr<DBusConnection> connection, const Glib::RefPtr<DBusMessage>& + * Glib::RefPtr<Message> on_message_filter(const + * Glib::RefPtr<Connection> connection, const Glib::RefPtr<Message>& * message, bool incoming);. * @endcode * @@ -181,9 +186,9 @@ public: * drop a message can simply return <tt>0</tt>. And filter function may * modify a message by copying it and return the copy. */ - typedef sigc::slot<Glib::RefPtr<DBusMessage>, - const Glib::RefPtr<DBusConnection>&, - const Glib::RefPtr<DBusMessage>&, bool> SlotMessageFilter; + typedef sigc::slot<Glib::RefPtr<Message>, + const Glib::RefPtr<Connection>&, + const Glib::RefPtr<Message>&, bool> SlotMessageFilter; /** Asynchronously connects to the message bus specified by @a bus_type. * @@ -209,128 +214,128 @@ public: _WRAP_METHOD_DOCS_ONLY( g_bus_get_finish, errthrow) /// @throw Glib::Error. - _WRAP_METHOD(static Glib::RefPtr<DBusConnection> get_finish(const Glib::RefPtr<AsyncResult>& res), g_bus_get_finish, errthrow) + _WRAP_METHOD(static Glib::RefPtr<Connection> get_finish(const Glib::RefPtr<AsyncResult>& res), g_bus_get_finish, errthrow) - _WRAP_METHOD(static Glib::RefPtr<DBusConnection> get_sync(BusType bus_type, const Glib::RefPtr<Cancellable>& cancellable), g_bus_get_sync, errthrow) + _WRAP_METHOD(static Glib::RefPtr<Connection> get_sync(BusType bus_type, const Glib::RefPtr<Cancellable>& cancellable), g_bus_get_sync, errthrow) /// A Non-cancellable version of get_sync(). - static Glib::RefPtr<DBusConnection> get_sync(BusType bus_type); + static Glib::RefPtr<Connection> get_sync(BusType bus_type); _WRAP_METHOD_DOCS_ONLY(g_dbus_connection_new) static void create(const Glib::RefPtr<IOStream>& stream, const std::string& guid, - const Glib::RefPtr<DBusAuthObserver>& observer, + const Glib::RefPtr<AuthObserver>& observer, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, - DBusConnectionFlags flags = Gio::DBUS_CONNECTION_FLAGS_NONE); + ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE); _WRAP_METHOD_DOCS_ONLY(g_dbus_connection_new) static void create(const Glib::RefPtr<IOStream>& stream, const std::string& guid, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, - DBusConnectionFlags flags = Gio::DBUS_CONNECTION_FLAGS_NONE); + ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE); /// Non-cancellable version of create(). static void create(const Glib::RefPtr<IOStream>& stream, const std::string& guid, - const Glib::RefPtr<DBusAuthObserver>& observer, + const Glib::RefPtr<AuthObserver>& observer, const SlotAsyncReady& slot, - DBusConnectionFlags flags = Gio::DBUS_CONNECTION_FLAGS_NONE); + ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE); /// Non-cancellable version of create(). static void create(const Glib::RefPtr<IOStream>& stream, const std::string& guid, const SlotAsyncReady& slot, - DBusConnectionFlags flags = Gio::DBUS_CONNECTION_FLAGS_NONE); + ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE); _WRAP_METHOD_DOCS_ONLY(g_dbus_connection_new_finish) /// @throw Glib::Error. - _WRAP_METHOD(static Glib::RefPtr<DBusConnection> create_finish(const Glib::RefPtr<AsyncResult>& res), g_dbus_connection_new_finish, errthrow) + _WRAP_METHOD(static Glib::RefPtr<Connection> create_finish(const Glib::RefPtr<AsyncResult>& res), g_dbus_connection_new_finish, errthrow) _WRAP_METHOD_DOCS_ONLY(g_dbus_connection_new_for_address) static void create_for_address(const std::string& address, - const Glib::RefPtr<DBusAuthObserver>& observer, + const Glib::RefPtr<AuthObserver>& observer, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, - DBusConnectionFlags flags = Gio::DBUS_CONNECTION_FLAGS_NONE); + ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE); _WRAP_METHOD_DOCS_ONLY(g_dbus_connection_new_for_address) static void create_for_address(const std::string& address, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable, - DBusConnectionFlags flags = Gio::DBUS_CONNECTION_FLAGS_NONE); + ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE); /// Non-cancellable version of create_for_address(). static void create_for_address(const std::string& address, - const Glib::RefPtr<DBusAuthObserver>& observer, + const Glib::RefPtr<AuthObserver>& observer, const SlotAsyncReady& slot, - DBusConnectionFlags flags = Gio::DBUS_CONNECTION_FLAGS_NONE); + ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE); /// Non-cancellable version of create_for_address(). static void create_for_address(const std::string& address, const SlotAsyncReady& slot, - DBusConnectionFlags flags = Gio::DBUS_CONNECTION_FLAGS_NONE); + ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE); _WRAP_METHOD_DOCS_ONLY(g_dbus_connection_new_for_address_finish) /// @throw Glib::Error. - _WRAP_METHOD(static Glib::RefPtr<DBusConnection> create_for_address_finish(const Glib::RefPtr<AsyncResult>& res), g_dbus_connection_new_for_address_finish, errthrow) + _WRAP_METHOD(static Glib::RefPtr<Connection> create_for_address_finish(const Glib::RefPtr<AsyncResult>& res), g_dbus_connection_new_for_address_finish, errthrow) _WRAP_METHOD_DOCS_ONLY(g_dbus_connection_new_sync) /// @throw Glib::Error. - static Glib::RefPtr<DBusConnection> create_sync( + static Glib::RefPtr<Connection> create_sync( const Glib::RefPtr<IOStream>& stream, const std::string& guid, - const Glib::RefPtr<DBusAuthObserver>& observer, + const Glib::RefPtr<AuthObserver>& observer, const Glib::RefPtr<Cancellable>& cancellable, - DBusConnectionFlags flags = Gio::DBUS_CONNECTION_FLAGS_NONE); + ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE); _WRAP_METHOD_DOCS_ONLY(g_dbus_connection_new_sync) /// @throw Glib::Error. - static Glib::RefPtr<DBusConnection> create_sync( + static Glib::RefPtr<Connection> create_sync( const Glib::RefPtr<IOStream>& stream, const std::string& guid, const Glib::RefPtr<Cancellable>& cancellable, - DBusConnectionFlags flags = Gio::DBUS_CONNECTION_FLAGS_NONE); + ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE); /// Non-cancellable version of create_sync(). - static Glib::RefPtr<DBusConnection> create_sync( + static Glib::RefPtr<Connection> create_sync( const Glib::RefPtr<IOStream>& stream, const std::string& guid, - const Glib::RefPtr<DBusAuthObserver>& observer, - DBusConnectionFlags flags = Gio::DBUS_CONNECTION_FLAGS_NONE); + const Glib::RefPtr<AuthObserver>& observer, + ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE); /// Non-cancellable version of create_sync(). - static Glib::RefPtr<DBusConnection> create_sync( + static Glib::RefPtr<Connection> create_sync( const Glib::RefPtr<IOStream>& stream, const std::string& guid, - DBusConnectionFlags flags = Gio::DBUS_CONNECTION_FLAGS_NONE); + ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE); _WRAP_METHOD_DOCS_ONLY(g_dbus_connection_new_for_address_sync) /// @throw Glib::Error. - static Glib::RefPtr<DBusConnection> create_for_address_sync( + static Glib::RefPtr<Connection> create_for_address_sync( const std::string& address, - const Glib::RefPtr<DBusAuthObserver>& observer, + const Glib::RefPtr<AuthObserver>& observer, const Glib::RefPtr<Cancellable>& cancellable, - DBusConnectionFlags flags = Gio::DBUS_CONNECTION_FLAGS_NONE); + ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE); _WRAP_METHOD_DOCS_ONLY(g_dbus_connection_new_for_address_sync) /// @throw Glib::Error. - static Glib::RefPtr<DBusConnection> create_for_address_sync( + static Glib::RefPtr<Connection> create_for_address_sync( const std::string& address, const Glib::RefPtr<Cancellable>& cancellable, - DBusConnectionFlags flags = Gio::DBUS_CONNECTION_FLAGS_NONE); + ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE); /// Non-cancellable version of create_for_address_sync(). - static Glib::RefPtr<DBusConnection> create_for_address_sync( + static Glib::RefPtr<Connection> create_for_address_sync( const std::string& address, - const Glib::RefPtr<DBusAuthObserver>& observer, - DBusConnectionFlags flags = Gio::DBUS_CONNECTION_FLAGS_NONE); + const Glib::RefPtr<AuthObserver>& observer, + ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE); /// Non-cancellable version of create_for_address_sync(). - static Glib::RefPtr<DBusConnection> create_for_address_sync( + static Glib::RefPtr<Connection> create_for_address_sync( const std::string& address, - DBusConnectionFlags flags = Gio::DBUS_CONNECTION_FLAGS_NONE); + ConnectionFlags flags = Gio::DBus::CONNECTION_FLAGS_NONE); /** Closes the connection. Note that this never causes the process to exit * (this might only happen if the other end of a shared message bus @@ -498,17 +503,17 @@ public: //TODO: In the C API, out_serial is volatile, but gmmproc can't parse that. #m4 _CONVERSION(`guint32&',`volatile guint32*',`&($3)') - _WRAP_METHOD(bool send_message(const Glib::RefPtr<DBusMessage>& message, DBusSendMessageFlags flags, guint32& out_serial), g_dbus_connection_send_message, errthrow) + _WRAP_METHOD(bool send_message(const Glib::RefPtr<Message>& message, SendMessageFlags flags, guint32& out_serial), g_dbus_connection_send_message, errthrow) /// A send_message() without an "out_serial" parameter. - bool send_message(const Glib::RefPtr<DBusMessage>& message, - DBusSendMessageFlags flags = Gio::DBUS_SEND_MESSAGE_FLAGS_NONE); + bool send_message(const Glib::RefPtr<Message>& message, + SendMessageFlags flags = Gio::DBus::SEND_MESSAGE_FLAGS_NONE); /** Asynchronously sends message to the peer represented by the connection. * - * Unless flags contain the Gio::DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL + * Unless flags contain the Gio::DBus::SEND_MESSAGE_FLAGS_PRESERVE_SERIAL * flag, the serial number will be assigned by the connection and set on - * message via Gio::DBusMessage::set_serial(). + * message via Gio::DBus::Message::set_serial(). * * If the connection is closed then the operation will fail with * Gio::IO_ERROR_CLOSED. If @a cancellable is canceled, the operation will @@ -522,7 +527,7 @@ public: * send_message_with_reply_sync() for the synchronous version. * * Note that message must be unlocked, unless flags contain the - * Gio::DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag. + * Gio::DBus::SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag. * * See the C API docs for examples. * @@ -534,7 +539,7 @@ public: * * @newin{2,28} */ - void send_message_with_reply(const Glib::RefPtr<DBusMessage>& message, + void send_message_with_reply(const Glib::RefPtr<Message>& message, int timeout_msec, const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable); @@ -542,22 +547,22 @@ public: /** Non-cancellable version of send_message_with_reply(). */ - void send_message_with_reply(const Glib::RefPtr<DBusMessage>& message, + void send_message_with_reply(const Glib::RefPtr<Message>& message, int timeout_msec, const SlotAsyncReady& slot); _WRAP_METHOD_DOCS_ONLY(g_dbus_connection_send_message_with_reply_finish) /// @throw Glib::Error. - _WRAP_METHOD(Glib::RefPtr<DBusMessage> send_message_with_reply_finish(const Glib::RefPtr<AsyncResult>& result), g_dbus_connection_send_message_with_reply_finish, errthrow) + _WRAP_METHOD(Glib::RefPtr<Message> send_message_with_reply_finish(const Glib::RefPtr<AsyncResult>& result), g_dbus_connection_send_message_with_reply_finish, errthrow) /** Synchronously sends @a message to the peer represented by the connection * and blocks the calling thread until a reply is received or the timeout is * reached. See send_message_with_reply() for the asynchronous version of * this method. * - * Unless flags contain the Gio::DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL + * Unless flags contain the Gio::DBus::SEND_MESSAGE_FLAGS_PRESERVE_SERIAL * flag, the serial number will be assigned by the connection and set on - * message via Gio::DBusMessage::set_serial(). + * message via Gio::DBus::Message::set_serial(). * * If the connection is closed then the operation will fail with * Gio::IO_ERROR_CLOSED. If @a cancellable is canceled, the operation will @@ -566,13 +571,13 @@ public: * * Note that a Glib::Error is thrown if a local in-process error occured. * That is to say that the returned DBusMessage object may be of type - * G_DBUS_MESSAGE_TYPE_ERROR. Use Gio::DBusMessage::to_exception() to + * G_DBUS_MESSAGE_TYPE_ERROR. Use Gio::DBus::Message::to_exception() to * transcode this to a Glib::Error. * * See the C API docs for examples. * * Note that message must be unlocked, unless flags contain the - * Gio::DBUS_SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag. + * Gio::DBus::SEND_MESSAGE_FLAGS_PRESERVE_SERIAL flag. * * @param message A DBusMessage. * @param cancellable A Cancellable. @@ -583,16 +588,16 @@ public: * @throw Glib::Error. * @newin{2,28} */ - Glib::RefPtr<DBusMessage> send_message_with_reply_sync( - const Glib::RefPtr<DBusMessage>& message, + Glib::RefPtr<Message> send_message_with_reply_sync( + const Glib::RefPtr<Message>& message, const Glib::RefPtr<Cancellable>& cancellable, gint timeout_msec ); _IGNORE(g_dbus_connection_send_message_with_reply_sync) /// A non-cancellable version of send_message_with_reply_sync(). - Glib::RefPtr<DBusMessage> send_message_with_reply_sync( - const Glib::RefPtr<DBusMessage>& message, + Glib::RefPtr<Message> send_message_with_reply_sync( + const Glib::RefPtr<Message>& message, gint timeout_msec ); @@ -605,7 +610,7 @@ public: _WRAP_METHOD(std::string get_guid() const, g_dbus_connection_get_guid) _WRAP_METHOD(Glib::ustring get_unique_name() const, g_dbus_connection_get_unique_name) - _WRAP_METHOD(DBusCapabilityFlags get_capabilities() const, g_dbus_connection_get_capabilities) + _WRAP_METHOD(CapabilityFlags get_capabilities() const, g_dbus_connection_get_capabilities) _WRAP_METHOD(Glib::RefPtr<Credentials> get_peer_credentials(), g_dbus_connection_get_peer_credentials, refreturn) _WRAP_METHOD(Glib::RefPtr<const Credentials> get_peer_credentials() const, g_dbus_connection_get_peer_credentials, refreturn, constversion) @@ -642,7 +647,7 @@ public: * connection is not a message bus connection. * @param timeout_msec The timeout in milliseconds, -1 to use the default * timeout or G_MAXINT for no timeout. - * @param flags Flags from the Gio::DBusCallFlags enumeration. + * @param flags Flags from the Gio::DBus::CallFlags enumeration. * @param reply_type The expected type of the reply, or <tt>0</tt>. * @newin{2,28} */ @@ -655,7 +660,7 @@ public: const Glib::RefPtr<Cancellable>& cancellable, const Glib::ustring& bus_name = Glib::ustring(), int timeout_msec = -1, - DBusCallFlags flags = Gio::DBUS_CALL_FLAGS_NONE, + CallFlags flags = Gio::DBus::CALL_FLAGS_NONE, const Glib::VariantType& reply_type = Glib::VariantType() ); _IGNORE(g_dbus_connection_call) @@ -669,7 +674,7 @@ public: const SlotAsyncReady& slot, const Glib::ustring& bus_name = Glib::ustring(), int timeout_msec = -1, - DBusCallFlags flags = Gio::DBUS_CALL_FLAGS_NONE, + CallFlags flags = Gio::DBus::CALL_FLAGS_NONE, const Glib::VariantType& reply_type = Glib::VariantType() ); @@ -715,7 +720,7 @@ public: * connection is not a message bus connection. * @param timeout_msec The timeout in milliseconds, -1 to use the default * timeout or G_MAXINT for no timeout. - * @param flags Flags from the Gio::DBusCallFlags enumeration. + * @param flags Flags from the Gio::DBus::CallFlags enumeration. * @param reply_type The expected type of the reply, or <tt>0</tt>. * @throw Glib::Error. * @newin{2,28} @@ -729,7 +734,7 @@ public: const Glib::RefPtr<Cancellable>& cancellable, const Glib::ustring& bus_name = Glib::ustring(), int timeout_msec = -1, - DBusCallFlags flags = Gio::DBUS_CALL_FLAGS_NONE, + CallFlags flags = Gio::DBus::CALL_FLAGS_NONE, const Glib::VariantType& reply_type = Glib::VariantType() ); _IGNORE(g_dbus_connection_call_sync) @@ -743,7 +748,7 @@ public: const Glib::VariantBase& parameters, const Glib::ustring& bus_name = Glib::ustring(), int timeout_msec = -1, - DBusCallFlags flags = Gio::DBUS_CALL_FLAGS_NONE, + CallFlags flags = Gio::DBus::CALL_FLAGS_NONE, const Glib::VariantType& reply_type = Glib::VariantType() ); @@ -809,7 +814,7 @@ public: const Glib::ustring& member = Glib::ustring(), const Glib::ustring& object_path = Glib::ustring(), const Glib::ustring& arg0 = Glib::ustring(), - DBusSignalFlags flags = Gio::DBUS_SIGNAL_FLAGS_NONE + SignalFlags flags = Gio::DBus::SIGNAL_FLAGS_NONE ); _IGNORE(g_dbus_connection_signal_subscribe) @@ -874,15 +879,15 @@ public: * * @param object_path The object path to register at. * @param interface_info Introspection data for the interface. - * @param vtable A GDBusInterfaceVTable to call into or NULL. + * @param vtable An InterfaceVTable to call into or NULL. * @return A registration id (never 0) that can be used with * unregister_object() if no Glib::Error is thrown. * @throw Glib::Error. * @newin{2,28} */ guint register_object(const Glib::ustring& object_path, - const Glib::RefPtr<DBusInterfaceInfo>& interface_info, - const DBusInterfaceVTable* vtable); + const Glib::RefPtr<InterfaceInfo>& interface_info, + const InterfaceVTable* vtable); _IGNORE(g_dbus_connection_register_object) _WRAP_METHOD(bool unregister_object(guint registration_id), g_dbus_connection_unregister_object) @@ -895,10 +900,10 @@ public: * * When handling remote calls into any node in the subtree, first the * enumerate slot is used to check if the node exists. If the node - * exists or the Gio::DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES flag + * exists or the Gio::DBus::SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES flag * is set the introspection slot is used to check if the node supports the * requested method. If so, the dispatch function is used to determine where - * to dispatch the call. The collected DBusInterfaceVTable will be used to + * to dispatch the call. The collected InterfaceVTable will be used to * call into the interface vtable for processing the request. * * All calls into user-provided code will be invoked in the thread-default @@ -915,7 +920,7 @@ public: * * * @param object_path The object path to register the subtree at. - * @param vtable A DBusSubtreeVTable to enumerate, introspect and dispatch + * @param vtable A SubtreeVTable to enumerate, introspect and dispatch * nodes in the subtree. * @param flags Flags used to fine tune the behavior of the subtree. * @return A subtree registration id (never 0) that can be used with @@ -924,18 +929,18 @@ public: * @newin{2,28} */ guint register_subtree(const Glib::ustring& object_path, - const DBusSubtreeVTable* vtable, - DBusSubtreeFlags flags = Gio::DBUS_SUBTREE_FLAGS_NONE); + const SubtreeVTable* vtable, + SubtreeFlags flags = Gio::DBus::SUBTREE_FLAGS_NONE); _IGNORE(g_dbus_connection_register_subtree) _WRAP_METHOD(bool unregister_subtree(guint registration_id), g_dbus_connection_unregister_subtree) //_WRAP_PROPERTY("address", std::string) // write-only construct-only //_WRAP_PROPERTY("authentication-observer", Glib::RefPtr<AuthObserver>) // write-only construct-only - _WRAP_PROPERTY("capabilities", DBusCapabilityFlags) + _WRAP_PROPERTY("capabilities", CapabilityFlags) _WRAP_PROPERTY("closed", bool) _WRAP_PROPERTY("exit-on-close", bool) - //_WRAP_PROPERTY("flags", DBusConnectionFlags) // write-only construct-only + //_WRAP_PROPERTY("flags", ConnectionFlags) // write-only construct-only _WRAP_PROPERTY("guid", std::string) _WRAP_PROPERTY("stream", Glib::RefPtr<IOStream>) _WRAP_PROPERTY("unique-name", Glib::ustring) @@ -944,12 +949,12 @@ public: _WRAP_SIGNAL(void closed(bool remote_peer_vanished, const Glib::Error& error), "closed", no_default_handler) }; -/** DBusInterfaceVTable - A class used to represent a virtual table for +/**This represents a virtual table for * handling properties and method calls for a D-Bus interface. * * If you want to handle getting/setting D-Bus properties asynchronously, * simply register an object with the org.freedesktop.DBus.Properties D-Bus - * interface using Gio::DBusConnection::register_object(). + * interface using Gio::DBus::Connection::register_object(). * * The only correct use of this class is to declare a global instance of it * (or an instance local to the main function) and pass pointers to the @@ -962,30 +967,30 @@ public: * @newin{2,28} * @ingroup DBus */ -class DBusInterfaceVTable +class InterfaceVTable { - _CLASS_GENERIC(DBusInterfaceVTable, GDBusInterfaceVTable) + _CLASS_GENERIC(InterfaceVTable, GDBusInterfaceVTable) public: /** The type for a slot which handles a method call for a D-Bus interface. * for example, * @code - * void on_interface_method_call(const Glib::RefPtr<Gio::DBusConnection>& + * void on_interface_method_call(const Glib::RefPtr<Gio::DBus::Connection>& * connection, const Glib::ustring& sender, const Glib::ustring& * object_path, const Glib::ustring& interface_name, const Glib::ustring& * method_name, const Glib::VariantBase& parameters, const - * Glib::RefPtr<Gio::DBusMethodInvocation>& invocation); + * Glib::RefPtr<Gio::DBus::MethodInvocation>& invocation); * @endcode */ typedef sigc::slot< void, - const Glib::RefPtr<DBusConnection>&, + const Glib::RefPtr<Connection>&, const Glib::ustring&, const Glib::ustring&, const Glib::ustring&, const Glib::ustring&, const Glib::VariantBase&, - const Glib::RefPtr<DBusMethodInvocation>& + const Glib::RefPtr<MethodInvocation>& > SlotInterfaceMethodCall; /** The type for a slot which handles getting a property for a D-Bus @@ -993,7 +998,7 @@ public: * for example, * @code * void on_interface_get_property(Glib::VariantBase& property, const - * Glib::RefPtr<Gio::DBusConnection>& connection, const Glib::ustring& + * Glib::RefPtr<Gio::DBus::Connection>& connection, const Glib::ustring& * sender, const Glib::ustring& object_path, const Glib::ustring& * interface_name, const Glib::ustring& property_name); * @endcode @@ -1002,7 +1007,7 @@ public: typedef sigc::slot< void, Glib::VariantBase&, - const Glib::RefPtr<DBusConnection>&, + const Glib::RefPtr<Connection>&, const Glib::ustring&, const Glib::ustring&, const Glib::ustring&, @@ -1013,7 +1018,7 @@ public: * interface. * for example, * @code - * bool on_interface_set_property(const Glib::RefPtr<Gio::DBusConnection>& + * bool on_interface_set_property(const Glib::RefPtr<Gio::DBus::Connection>& * connection, const Glib::ustring& sender, const Glib::ustring& * object_path, const Glib::ustring& interface_name, const Glib::ustring& * property_name, const Glib::VariantBase& value); @@ -1022,7 +1027,7 @@ public: */ typedef sigc::slot< bool, - const Glib::RefPtr<DBusConnection>&, + const Glib::RefPtr<Connection>&, const Glib::ustring&, const Glib::ustring&, const Glib::ustring&, @@ -1030,19 +1035,19 @@ public: const Glib::VariantBase& > SlotInterfaceSetProperty; - /** Constructs a new DBusInterfaceVTable using the specified slots. + /** Constructs a new InterfaceVTable using the specified slots. * @param slot_method_call The slot for handling incoming method calls. * @param slot_get_property The slot for getting a property. * @param slot_set_property The slot for setting a property. */ - explicit DBusInterfaceVTable( + explicit InterfaceVTable( const SlotInterfaceMethodCall& slot_method_call, const SlotInterfaceGetProperty& slot_get_property = SlotInterfaceGetProperty(), const SlotInterfaceSetProperty& slot_set_property = SlotInterfaceSetProperty() ); /// Destructor. - virtual ~DBusInterfaceVTable(); + virtual ~InterfaceVTable(); /// Provides access to the underlying C object. GDBusInterfaceVTable* gobj() @@ -1055,13 +1060,13 @@ public: private: // Non-copyable. - DBusInterfaceVTable(const DBusInterfaceVTable& other); - DBusInterfaceVTable& operator=(const DBusInterfaceVTable& other); + InterfaceVTable(const InterfaceVTable& other); + InterfaceVTable& operator=(const InterfaceVTable& other); public: #ifndef DOXYGEN_SHOULD_SKIP_THIS // These are so the C callbacks and the - // Gio::DBusConnection::register_object() method can have access to the + // Gio::DBus::Connection::register_object() method can have access to the // copies of the slots used for creation when registering. SlotInterfaceMethodCall* get_slot_method_call() const; SlotInterfaceGetProperty* get_slot_get_property() const; @@ -1078,8 +1083,8 @@ protected: SlotInterfaceSetProperty* slot_set_property_; }; -/** DBusSubtreeVTable - A class used to represent a virtual table for - * subtrees registered with Gio::DBusConnection::register_subtree(). +/** This represents a virtual table for + * subtrees registered with Gio::DBus::Connection::register_subtree(). * * The only correct use of this class is to declare a global instance of it * (or an instance local to the main function) and pass pointers to the @@ -1092,16 +1097,16 @@ protected: * @newin{2,28} * @ingroup DBus */ -class DBusSubtreeVTable +class SubtreeVTable { - _CLASS_GENERIC(DBusSubtreeVTable, GDBusSubtreeVTable) + _CLASS_GENERIC(SubtreeVTable, GDBusSubtreeVTable) public: /** The type for a slot which handles enumerating child nodes. * * This slot is called when generating introspection data and also when * preparing to dispatch incoming messages in the event that the - * Gio::DBUS_SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES flag is not + * Gio::DBus::SUBTREE_FLAGS_DISPATCH_TO_UNENUMERATED_NODES flag is not * specified (ie: to verify that the object path is valid). * * Hierarchies are not supported; the items that you return should not @@ -1110,13 +1115,13 @@ public: * For example, * @code * std::vector<Glib::ustring> on_subtree_enumerate(const - * Glib::RefPtr<Gio::DBusConnection>& connection, const Glib::ustring& + * Glib::RefPtr<Gio::DBus::Connection>& connection, const Glib::ustring& * sender, const Glib::ustring& object_path); * @endcode */ typedef sigc::slot< std::vector<Glib::ustring>, - const Glib::RefPtr<DBusConnection>&, + const Glib::RefPtr<Connection>&, const Glib::ustring&, const Glib::ustring& > SlotSubtreeEnumerate; @@ -1135,15 +1140,15 @@ public: * * for example, * @code - * std::vector< Glib::RefPtr<Gio::DBusInterFaceInfo> > - * on_subtree_introspect(const Glib::RefPtr<Gio::DBusConnection>& + * std::vector< Glib::RefPtr<Gio::DBus::InterFaceInfo> > + * on_subtree_introspect(const Glib::RefPtr<Gio::DBus::Connection>& * connection, const Glib::ustring& sender, const Glib::ustring& * object_path, const Glib::ustring& node); * @endcode */ typedef sigc::slot< - std::vector< Glib::RefPtr<Gio::DBusInterfaceInfo> >, - const Glib::RefPtr<DBusConnection>&, + std::vector< Glib::RefPtr<Gio::DBus::InterfaceInfo> >, + const Glib::RefPtr<Connection>&, const Glib::ustring&, const Glib::ustring&, const Glib::ustring& @@ -1157,34 +1162,34 @@ public: * * for example, * @code - * const Gio::DBusInterfaceVTable* on_subtree_dispatch(const - * Glib::RefPtr<Gio::DBusConnection>& connection, const Glib::ustring& + * const Gio::DBus::InterfaceVTable* on_subtree_dispatch(const + * Glib::RefPtr<Gio::DBus::Connection>& connection, const Glib::ustring& * sender, const Glib::ustring& object_path, const Glib::ustring& * interface_name, const Glib::ustring& node); * @endcode */ typedef sigc::slot< - const DBusInterfaceVTable*, - const Glib::RefPtr<DBusConnection>&, + const InterfaceVTable*, + const Glib::RefPtr<Connection>&, const Glib::ustring&, const Glib::ustring&, const Glib::ustring&, const Glib::ustring& > SlotSubtreeDispatch; - /** Constructs a new DBusSubtreeVTable using specified slots. + /** Constructs a new SubtreeVTable using specified slots. * @param slot_enumerate The slot for handling incoming method calls. * @param slot_introspect The slot for getting a property. * @param slot_dispatch The slot for setting a property. */ - explicit DBusSubtreeVTable( + explicit SubtreeVTable( const SlotSubtreeEnumerate& slot_enumerate, const SlotSubtreeIntrospect& slot_introspect = SlotSubtreeIntrospect(), const SlotSubtreeDispatch& slot_dispatch = SlotSubtreeDispatch() ); /// Destructor. - virtual ~DBusSubtreeVTable(); + virtual ~SubtreeVTable(); /// Provides access to the underlying C object. GDBusSubtreeVTable* gobj() @@ -1197,13 +1202,13 @@ public: private: // Non-copyable. - DBusSubtreeVTable(const DBusSubtreeVTable& other); - DBusSubtreeVTable& operator=(const DBusSubtreeVTable& other); + SubtreeVTable(const SubtreeVTable& other); + SubtreeVTable& operator=(const SubtreeVTable& other); public: #ifndef DOXYGEN_SHOULD_SKIP_THIS // These are so the C callbacks and the - // Gio::DBusConnection::register_subtreee() method can have access to the + // Gio::DBus::Connection::register_subtreee() method can have access to the // copies of the slots used for creation when registering. SlotSubtreeEnumerate* get_slot_enumerate() const; SlotSubtreeIntrospect* get_slot_introspect() const; @@ -1220,4 +1225,6 @@ protected: SlotSubtreeDispatch* slot_dispatch_; }; +} //namespace DBus + } // namespace Gio |