[glibmm] Gio::DBus: Move InterfaceVTable and SubtreeVTable to their own files.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm] Gio::DBus: Move InterfaceVTable and SubtreeVTable to their own files.
- Date: Wed, 23 Mar 2011 10:01:16 +0000 (UTC)
commit e806244b01d859834efa75732f1a2eadb9af18d0
Author: Murray Cumming <murrayc murrayc com>
Date: Wed Mar 23 11:01:08 2011 +0100
Gio::DBus: Move InterfaceVTable and SubtreeVTable to their own files.
* gio/src/dbusinterfacevtable.[hg|ccg]:
* gio/src/dbussubtreevtable.[hg|ccg]: Moved code here from
* gio/src/dbusconnection.[hg|ccg].
* gio/src/filelist.am: Mention the new files.
ChangeLog | 9 ++
gio/src/dbusconnection.ccg | 260 ---------------------------------
gio/src/dbusconnection.hg | 301 ++-------------------------------------
gio/src/dbusinterfacevtable.ccg | 170 ++++++++++++++++++++++
gio/src/dbusinterfacevtable.hg | 169 ++++++++++++++++++++++
gio/src/dbussubtreevtable.ccg | 183 ++++++++++++++++++++++++
gio/src/dbussubtreevtable.hg | 178 +++++++++++++++++++++++
gio/src/filelist.am | 2 +
8 files changed, 723 insertions(+), 549 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index e01de47..661ca44 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2011-03-23 Murray Cumming <murrayc murrayc com>
+
+ Gio::DBus: Move InterfaceVTable and SubtreeVTable to their own files.
+
+ * gio/src/dbusinterfacevtable.[hg|ccg]:
+ * gio/src/dbussubtreevtable.[hg|ccg]: Moved code here from
+ * gio/src/dbusconnection.[hg|ccg].
+ * gio/src/filelist.am: Mention the new files.
+
2011-03-21 Murray Cumming <murrayc murrayc com>
Correct some range checks to use >= instead of just >.
diff --git a/gio/src/dbusconnection.ccg b/gio/src/dbusconnection.ccg
index 412db5f..631eb55 100644
--- a/gio/src/dbusconnection.ccg
+++ b/gio/src/dbusconnection.ccg
@@ -82,188 +82,6 @@ static void DBusConnection_Message_Filter_giomm_callback_destroy(void* data)
delete static_cast<Gio::DBus::Connection::SlotMessageFilter*>(data);
}
-static void DBusInterfaceVTable_MethodCall_giomm_callback(
- GDBusConnection* connection, const char* sender, const char* object_path,
- const char* interface_name, const char* method_name, GVariant* parameters,
- GDBusMethodInvocation* invocation, void* user_data)
-{
- Gio::DBus::InterfaceVTable* vtable =
- static_cast<Gio::DBus::InterfaceVTable*>(user_data);
-
- Gio::DBus::InterfaceVTable::SlotInterfaceMethodCall* the_slot =
- vtable->get_slot_method_call();
-
- try
- {
- (*the_slot)(Glib::wrap(connection, true), (sender ? sender : ""),
- object_path, interface_name, method_name,
- Glib::VariantBase(parameters, true), Glib::wrap(invocation, true));
- }
- catch(...)
- {
- Glib::exception_handlers_invoke();
- }
-}
-
-static GVariant* DBusInterfaceVTable_GetProperty_giomm_callback(
- GDBusConnection* connection, const char* sender, const char* object_path,
- const char* interface_name, const char* property_name, GError** error,
- void* user_data)
-{
- Gio::DBus::InterfaceVTable* vtable =
- static_cast<Gio::DBus::InterfaceVTable*>(user_data);
-
- Gio::DBus::InterfaceVTable::SlotInterfaceGetProperty* the_slot =
- vtable->get_slot_get_property();
-
- try
- {
- Glib::VariantBase result;
-
- (*the_slot)(result, Glib::wrap(connection, true), sender, object_path,
- interface_name, property_name);
- return result.gobj_copy();
- }
- catch(const Glib::Error& ex)
- {
- if(error)
- *error = g_error_copy(ex.gobj());
- }
- catch(...)
- {
- Glib::exception_handlers_invoke();
- }
-
- return 0;
-}
-
-static gboolean DBusInterfaceVTable_SetProperty_giomm_callback(
- GDBusConnection* connection, const char* sender, const char* object_path,
- const char* interface_name, const char* property_name, GVariant* value,
- GError** error, void* user_data)
-{
- Gio::DBus::InterfaceVTable* vtable =
- static_cast<Gio::DBus::InterfaceVTable*>(user_data);
-
- Gio::DBus::InterfaceVTable::SlotInterfaceSetProperty* the_slot =
- vtable->get_slot_set_property();
-
- try
- {
- return static_cast<gboolean>((*the_slot)(Glib::wrap(connection, true),
- sender, object_path, interface_name, property_name,
- Glib::VariantBase(value, true)));
- }
- catch(const Glib::Error& ex)
- {
- if(error)
- *error = g_error_copy(ex.gobj());
- }
- catch(...)
- {
- Glib::exception_handlers_invoke();
- }
-
- return false;
-}
-
-static char** DBusSubtreeVTable_Enumerate_giomm_callback(
- GDBusConnection* connection, const char* sender, const char* object_path,
- void* user_data)
-{
- Gio::DBus::SubtreeVTable* vtable =
- static_cast<Gio::DBus::SubtreeVTable*>(user_data);
-
- Gio::DBus::SubtreeVTable::SlotSubtreeEnumerate* the_slot =
- vtable->get_slot_enumerate();
-
- try
- {
- std::vector<Glib::ustring> result =
- (*the_slot)(Glib::wrap(connection, true), sender, object_path);
-
- // This will be freed by the caller.
- char** ret = g_new(char*, result.size());
-
- for(std::vector<Glib::ustring>::size_type i = 0; i < result.size(); i++)
- {
- ret[i] = g_strdup(result[i].c_str());
- }
-
- return ret;
- }
- catch(...)
- {
- Glib::exception_handlers_invoke();
- }
-
- return 0;
-}
-
-static GDBusInterfaceInfo** DBusSubtreeVTable_Introspect_giomm_callback(
- GDBusConnection* connection, const char* sender, const char* object_path,
- const char* node, void* user_data)
-{
- Gio::DBus::SubtreeVTable* vtable =
- static_cast<Gio::DBus::SubtreeVTable*>(user_data);
-
- Gio::DBus::SubtreeVTable::SlotSubtreeIntrospect* the_slot =
- vtable->get_slot_introspect();
-
- try
- {
- std::vector< Glib::RefPtr<Gio::DBus::InterfaceInfo> > result =
- (*the_slot)(Glib::wrap(connection, true), sender, object_path, node);
-
- // This will be freed by the caller, along with unreferencing its members.
- GDBusInterfaceInfo** info = g_new(GDBusInterfaceInfo*, result.size());
-
- for(std::vector< Glib::RefPtr<Gio::DBus::InterfaceInfo> >::size_type i = 0;
- i < result.size(); i++)
- {
- info[i] = static_cast<GDBusInterfaceInfo*>(
- g_object_ref(result[i]->gobj()));
- }
-
- return info;
- }
- catch(...)
- {
- Glib::exception_handlers_invoke();
- }
-
- return 0;
-}
-
-static const GDBusInterfaceVTable* DBusSubtreeVTable_Dispatch_giomm_callback(
- GDBusConnection* connection, const char* sender, const char* object_path,
- const char* interface_name, const char* node, void** out_user_data,
- void* user_data)
-{
- Gio::DBus::SubtreeVTable* vtable =
- static_cast<Gio::DBus::SubtreeVTable*>(user_data);
-
- Gio::DBus::SubtreeVTable::SlotSubtreeDispatch* the_slot =
- vtable->get_slot_dispatch();
-
- try
- {
- const Gio::DBus::InterfaceVTable* vtable =
- (*the_slot)(Glib::wrap(connection, true), sender, object_path,
- interface_name, (node ? node : ""));
-
- *out_user_data = const_cast<Gio::DBus::InterfaceVTable*>(vtable);
-
- return vtable->gobj();
- }
- catch(...)
- {
- Glib::exception_handlers_invoke();
- }
-
- return 0;
-}
-
} // extern "C"
}
@@ -1026,84 +844,6 @@ guint Connection::register_subtree(const Glib::ustring& object_path,
return result;
}
-InterfaceVTable::InterfaceVTable(
- const SlotInterfaceMethodCall& slot_method_call,
- const SlotInterfaceGetProperty& slot_get_property,
- const SlotInterfaceSetProperty& slot_set_property
-)
-: slot_method_call_(new SlotInterfaceMethodCall(slot_method_call)),
- slot_get_property_(new SlotInterfaceGetProperty(slot_get_property)),
- slot_set_property_(new SlotInterfaceSetProperty(slot_set_property))
-{
- gobject_.method_call = &DBusInterfaceVTable_MethodCall_giomm_callback;
- gobject_.get_property = &DBusInterfaceVTable_GetProperty_giomm_callback;
- gobject_.set_property = &DBusInterfaceVTable_SetProperty_giomm_callback;
-}
-
-InterfaceVTable::~InterfaceVTable()
-{
- delete slot_method_call_;
- delete slot_get_property_;
- delete slot_set_property_;
-}
-
-InterfaceVTable::SlotInterfaceMethodCall*
- InterfaceVTable::get_slot_method_call() const
-{
- return slot_method_call_;
-}
-
-InterfaceVTable::SlotInterfaceGetProperty*
- InterfaceVTable::get_slot_get_property() const
-{
- return slot_get_property_;
-}
-
-InterfaceVTable::SlotInterfaceSetProperty*
- InterfaceVTable::get_slot_set_property() const
-{
- return slot_set_property_;
-}
-
-SubtreeVTable::SubtreeVTable(
- const SlotSubtreeEnumerate& slot_enumerate,
- const SlotSubtreeIntrospect& slot_introspect,
- const SlotSubtreeDispatch& slot_dispatch
-)
-: slot_enumerate_(new SlotSubtreeEnumerate(slot_enumerate)),
- slot_introspect_(new SlotSubtreeIntrospect(slot_introspect)),
- slot_dispatch_(new SlotSubtreeDispatch(slot_dispatch))
-{
- gobject_.enumerate = &DBusSubtreeVTable_Enumerate_giomm_callback;
- gobject_.introspect = &DBusSubtreeVTable_Introspect_giomm_callback;
- gobject_.dispatch = &DBusSubtreeVTable_Dispatch_giomm_callback;
-}
-
-SubtreeVTable::~SubtreeVTable()
-{
- delete slot_enumerate_;
- delete slot_introspect_;
- delete slot_dispatch_;
-}
-
-SubtreeVTable::SlotSubtreeEnumerate*
- SubtreeVTable::get_slot_enumerate() const
-{
- return slot_enumerate_;
-}
-
-SubtreeVTable::SlotSubtreeIntrospect*
- SubtreeVTable::get_slot_introspect() const
-{
- return slot_introspect_;
-}
-
-SubtreeVTable::SlotSubtreeDispatch*
- SubtreeVTable::get_slot_dispatch() const
-{
- return slot_dispatch_;
-}
-
} //namespace DBus
} // namespace Gio
diff --git a/gio/src/dbusconnection.hg b/gio/src/dbusconnection.hg
index 8c323d9..102624b 100644
--- a/gio/src/dbusconnection.hg
+++ b/gio/src/dbusconnection.hg
@@ -27,6 +27,7 @@
#include <giomm/asyncresult.h>
#include <giomm/credentials.h>
#include <giomm/dbusmessage.h>
+#include <giomm/dbussubtreevtable.h>
#include <gio/gio.h>
_DEFS(giomm,gio)
@@ -45,9 +46,6 @@ _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
@@ -557,7 +555,7 @@ public:
/** 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.
+ * this method.
*
* Unless flags contain the Gio::DBus::SEND_MESSAGE_FLAGS_PRESERVE_SERIAL
* flag, the serial number will be assigned by the connection and set on
@@ -795,13 +793,13 @@ public:
* @param interface_name D-Bus interface name to match on or <tt>0</tt> to
* match on all interfaces.
* @param member D-Bus signal name to match on or <tt>0</tt> to match on all
- * signals.
+ * signals.
* @param object_path Object path to match on or <tt>0</tt> to match on all
- * object paths.
+ * object paths.
* @param arg0 Contents of first string argument to match on or <tt>0</tt>
- * to match on all kinds of arguments.
+ * to match on all kinds of arguments.
* @param flags Flags describing how to subscribe to the signal (currently
- * unused).
+ * unused).
* @return A subscription identifier that can be used with
* signal_unsubscribe().
* @newin{2,28}
@@ -837,7 +835,7 @@ public:
* the message. Similary, if a filter consumes an outgoing message, the
* message will not be sent to the other peer.
*
- * @param slot A filter slot.
+ * @param slot A filter slot.
* @return A filter identifier that can be used with remove_filter().
* @newin{2,28}
*/
@@ -876,9 +874,9 @@ public:
* yourself, e.g. to handle getting and setting of properties
* asynchronously.
*
- * @param object_path The object path to register at.
- * @param interface_info Introspection data for the interface.
- * @param vtable An InterfaceVTable to call into or NULL.
+ * @param object_path The object path to register at.
+ * @param interface_info Introspection data for the interface.
+ * @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.
@@ -918,9 +916,9 @@ public:
* paths not registered via register_object().
*
*
- * @param object_path The object path to register the subtree at.
+ * @param object_path The object path to register the subtree at.
* @param vtable A SubtreeVTable to enumerate, introspect and dispatch
- * nodes in the subtree.
+ * 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
* unregister_subtree() if no Glib::Error is thrown.
@@ -948,281 +946,6 @@ public:
_WRAP_SIGNAL(void closed(bool remote_peer_vanished, const Glib::Error& error), "closed", no_default_handler)
};
-/**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::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
- * instance to the methods that require such a parameter. The instance can be
- * used for multiple registrations and the memory it uses will be freed at the
- * end of execution. Any other use (like creating an instance local to a
- * function and using that) may cause memory leaks or errors (if the instance
- * is destroyed too early).
- *
- * @newin{2,28}
- * @ingroup DBus
- */
-class InterfaceVTable
-{
- _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::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::DBus::MethodInvocation>& invocation);
- * @endcode
- */
- typedef sigc::slot<
- void,
- const Glib::RefPtr<Connection>&,
- const Glib::ustring&,
- const Glib::ustring&,
- const Glib::ustring&,
- const Glib::ustring&,
- const Glib::VariantBase&,
- const Glib::RefPtr<MethodInvocation>&
- > SlotInterfaceMethodCall;
-
- /** The type for a slot which handles getting a property for a D-Bus
- * interface.
- * for example,
- * @code
- * void on_interface_get_property(Glib::VariantBase& 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);
- * @endcode
- * @throw Glib::Error.
- */
- typedef sigc::slot<
- void,
- Glib::VariantBase&,
- const Glib::RefPtr<Connection>&,
- const Glib::ustring&,
- const Glib::ustring&,
- const Glib::ustring&,
- const Glib::ustring&
- > SlotInterfaceGetProperty;
-
- /** The type for a slot which handles setting a property for a D-Bus
- * interface.
- * for example,
- * @code
- * 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);
- * @endcode
- * @throw Glib::Error.
- */
- typedef sigc::slot<
- bool,
- const Glib::RefPtr<Connection>&,
- const Glib::ustring&,
- const Glib::ustring&,
- const Glib::ustring&,
- const Glib::ustring&,
- const Glib::VariantBase&
- > SlotInterfaceSetProperty;
-
- /** 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 InterfaceVTable(
- const SlotInterfaceMethodCall& slot_method_call,
- const SlotInterfaceGetProperty& slot_get_property = SlotInterfaceGetProperty(),
- const SlotInterfaceSetProperty& slot_set_property = SlotInterfaceSetProperty()
- );
-
- /// Destructor.
- virtual ~InterfaceVTable();
-
- /// Provides access to the underlying C object.
- GDBusInterfaceVTable* gobj()
- { return reinterpret_cast<GDBusInterfaceVTable*>(&gobject_); }
-
- /// Provides access to the underlying C object.
- const GDBusInterfaceVTable* gobj() const
- { return reinterpret_cast<const GDBusInterfaceVTable*>(&gobject_); }
-
-
-private:
- // Non-copyable.
- InterfaceVTable(const InterfaceVTable& other);
- InterfaceVTable& operator=(const InterfaceVTable& other);
-
-public:
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
- // These are so the C callbacks and 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;
- SlotInterfaceSetProperty* get_slot_set_property() const;
-#endif
-
-protected:
- // The underlying C instance.
- GDBusInterfaceVTable gobject_;
-
- // Pointers to copies of the slots used to create an instance.
- SlotInterfaceMethodCall* slot_method_call_;
- SlotInterfaceGetProperty* slot_get_property_;
- SlotInterfaceSetProperty* slot_set_property_;
-};
-
-/** 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
- * instance to the methods that require such a parameter. The instance can be
- * used for multiple registrations and the memory it uses will be freed at the
- * end of execution. Any other use (like creating an instance local to a
- * function and using that) may cause memory leaks or errors (if the instance
- * is destroyed too early).
- *
- * @newin{2,28}
- * @ingroup DBus
- */
-class SubtreeVTable
-{
- _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
- * specified (ie: to verify that the object path is valid).
- *
- * Hierarchies are not supported; the items that you return should not
- * contain the '/' character.
- *
- * For example,
- * @code
- * std::vector<Glib::ustring> on_subtree_enumerate(const
- * 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<Connection>&,
- const Glib::ustring&,
- const Glib::ustring&
- > SlotSubtreeEnumerate;
-
- /** The type for a slot which handles introspecting a child node.
- *
- * Subtrees are flat. @a node, if non-<tt>0</tt>, is always exactly one
- * segment of the object path (ie: it never contains a slash).
- *
- * This function should return an empty vector to indicate that there is no
- * object at this node.
- *
- * If this function returns a non-empty vector, the return value is expected
- * to be a list of DBusInterfaceInfo structures describing the interfaces
- * implemented by node.
- *
- * for example,
- * @code
- * 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::DBus::InterfaceInfo> >,
- const Glib::RefPtr<Connection>&,
- const Glib::ustring&,
- const Glib::ustring&,
- const Glib::ustring&
- > SlotSubtreeIntrospect;
-
- /** The type for a slot which handles dispatching a remote call on a child
- * node.
- *
- * Subtrees are flat. @a node, if non-<tt>0</tt>, is always exactly one
- * segment of the object path (ie: it never contains a slash).
- *
- * for example,
- * @code
- * 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 InterfaceVTable*,
- const Glib::RefPtr<Connection>&,
- const Glib::ustring&,
- const Glib::ustring&,
- const Glib::ustring&,
- const Glib::ustring&
- > SlotSubtreeDispatch;
-
- /** 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 SubtreeVTable(
- const SlotSubtreeEnumerate& slot_enumerate,
- const SlotSubtreeIntrospect& slot_introspect = SlotSubtreeIntrospect(),
- const SlotSubtreeDispatch& slot_dispatch = SlotSubtreeDispatch()
- );
-
- /// Destructor.
- virtual ~SubtreeVTable();
-
- /// Provides access to the underlying C object.
- GDBusSubtreeVTable* gobj()
- { return reinterpret_cast<GDBusSubtreeVTable*>(&gobject_); }
-
- /// Provides access to the underlying C object.
- const GDBusSubtreeVTable* gobj() const
- { return reinterpret_cast<const GDBusSubtreeVTable*>(&gobject_); }
-
-
-private:
- // Non-copyable.
- SubtreeVTable(const SubtreeVTable& other);
- SubtreeVTable& operator=(const SubtreeVTable& other);
-
-public:
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
- // These are so the C callbacks and 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;
- SlotSubtreeDispatch* get_slot_dispatch() const;
-#endif
-
-protected:
- // The underlying C instance.
- GDBusSubtreeVTable gobject_;
-
- // Pointers to copies of the slots used to create an instance.
- SlotSubtreeEnumerate* slot_enumerate_;
- SlotSubtreeIntrospect* slot_introspect_;
- SlotSubtreeDispatch* slot_dispatch_;
-};
} //namespace DBus
diff --git a/gio/src/dbusinterfacevtable.ccg b/gio/src/dbusinterfacevtable.ccg
new file mode 100644
index 0000000..bf47870
--- /dev/null
+++ b/gio/src/dbusinterfacevtable.ccg
@@ -0,0 +1,170 @@
+// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+
+/* Copyright (C) 2010 The giomm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <gio/gio.h>
+#include <giomm/dbusauthobserver.h>
+#include <giomm/dbusintrospection.h>
+#include <giomm/dbusmethodinvocation.h>
+#include <giomm/dbusconnection.h>
+#include <giomm/dbuserror.h>
+#include "slot_async.h"
+
+namespace
+{
+
+extern "C"
+{
+
+static void DBusInterfaceVTable_MethodCall_giomm_callback(
+ GDBusConnection* connection, const char* sender, const char* object_path,
+ const char* interface_name, const char* method_name, GVariant* parameters,
+ GDBusMethodInvocation* invocation, void* user_data)
+{
+ Gio::DBus::InterfaceVTable* vtable =
+ static_cast<Gio::DBus::InterfaceVTable*>(user_data);
+
+ Gio::DBus::InterfaceVTable::SlotInterfaceMethodCall* the_slot =
+ vtable->get_slot_method_call();
+
+ try
+ {
+ (*the_slot)(Glib::wrap(connection, true), (sender ? sender : ""),
+ object_path, interface_name, method_name,
+ Glib::VariantBase(parameters, true), Glib::wrap(invocation, true));
+ }
+ catch(...)
+ {
+ Glib::exception_handlers_invoke();
+ }
+}
+
+static GVariant* DBusInterfaceVTable_GetProperty_giomm_callback(
+ GDBusConnection* connection, const char* sender, const char* object_path,
+ const char* interface_name, const char* property_name, GError** error,
+ void* user_data)
+{
+ Gio::DBus::InterfaceVTable* vtable =
+ static_cast<Gio::DBus::InterfaceVTable*>(user_data);
+
+ Gio::DBus::InterfaceVTable::SlotInterfaceGetProperty* the_slot =
+ vtable->get_slot_get_property();
+
+ try
+ {
+ Glib::VariantBase result;
+
+ (*the_slot)(result, Glib::wrap(connection, true), sender, object_path,
+ interface_name, property_name);
+ return result.gobj_copy();
+ }
+ catch(const Glib::Error& ex)
+ {
+ if(error)
+ *error = g_error_copy(ex.gobj());
+ }
+ catch(...)
+ {
+ Glib::exception_handlers_invoke();
+ }
+
+ return 0;
+}
+
+static gboolean DBusInterfaceVTable_SetProperty_giomm_callback(
+ GDBusConnection* connection, const char* sender, const char* object_path,
+ const char* interface_name, const char* property_name, GVariant* value,
+ GError** error, void* user_data)
+{
+ Gio::DBus::InterfaceVTable* vtable =
+ static_cast<Gio::DBus::InterfaceVTable*>(user_data);
+
+ Gio::DBus::InterfaceVTable::SlotInterfaceSetProperty* the_slot =
+ vtable->get_slot_set_property();
+
+ try
+ {
+ return static_cast<gboolean>((*the_slot)(Glib::wrap(connection, true),
+ sender, object_path, interface_name, property_name,
+ Glib::VariantBase(value, true)));
+ }
+ catch(const Glib::Error& ex)
+ {
+ if(error)
+ *error = g_error_copy(ex.gobj());
+ }
+ catch(...)
+ {
+ Glib::exception_handlers_invoke();
+ }
+
+ return false;
+}
+
+} // extern "C"
+
+}
+
+namespace Gio
+{
+
+namespace DBus
+{
+
+InterfaceVTable::InterfaceVTable(
+ const SlotInterfaceMethodCall& slot_method_call,
+ const SlotInterfaceGetProperty& slot_get_property,
+ const SlotInterfaceSetProperty& slot_set_property
+)
+: slot_method_call_(new SlotInterfaceMethodCall(slot_method_call)),
+ slot_get_property_(new SlotInterfaceGetProperty(slot_get_property)),
+ slot_set_property_(new SlotInterfaceSetProperty(slot_set_property))
+{
+ gobject_.method_call = &DBusInterfaceVTable_MethodCall_giomm_callback;
+ gobject_.get_property = &DBusInterfaceVTable_GetProperty_giomm_callback;
+ gobject_.set_property = &DBusInterfaceVTable_SetProperty_giomm_callback;
+}
+
+InterfaceVTable::~InterfaceVTable()
+{
+ delete slot_method_call_;
+ delete slot_get_property_;
+ delete slot_set_property_;
+}
+
+InterfaceVTable::SlotInterfaceMethodCall*
+ InterfaceVTable::get_slot_method_call() const
+{
+ return slot_method_call_;
+}
+
+InterfaceVTable::SlotInterfaceGetProperty*
+ InterfaceVTable::get_slot_get_property() const
+{
+ return slot_get_property_;
+}
+
+InterfaceVTable::SlotInterfaceSetProperty*
+ InterfaceVTable::get_slot_set_property() const
+{
+ return slot_set_property_;
+}
+
+} //namespace DBus
+
+} // namespace Gio
diff --git a/gio/src/dbusinterfacevtable.hg b/gio/src/dbusinterfacevtable.hg
new file mode 100644
index 0000000..5a49b01
--- /dev/null
+++ b/gio/src/dbusinterfacevtable.hg
@@ -0,0 +1,169 @@
+// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+
+/* Copyright (C) 2010 The giomm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <giomm/dbusmethodinvocation.h>
+#include <gio/gio.h>
+
+_DEFS(giomm,gio)
+_PINCLUDE(glibmm/private/object_p.h)
+
+namespace Gio
+{
+
+namespace DBus
+{
+
+/**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::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
+ * instance to the methods that require such a parameter. The instance can be
+ * used for multiple registrations and the memory it uses will be freed at the
+ * end of execution. Any other use (like creating an instance local to a
+ * function and using that) may cause memory leaks or errors (if the instance
+ * is destroyed too early).
+ *
+ * @newin{2,28}
+ * @ingroup DBus
+ */
+class InterfaceVTable
+{
+ _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::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::DBus::MethodInvocation>& invocation);
+ * @endcode
+ */
+ typedef sigc::slot<
+ void,
+ const Glib::RefPtr<Connection>&,
+ const Glib::ustring&,
+ const Glib::ustring&,
+ const Glib::ustring&,
+ const Glib::ustring&,
+ const Glib::VariantBase&,
+ const Glib::RefPtr<MethodInvocation>&
+ > SlotInterfaceMethodCall;
+
+ /** The type for a slot which handles getting a property for a D-Bus
+ * interface.
+ * for example,
+ * @code
+ * void on_interface_get_property(Glib::VariantBase& 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);
+ * @endcode
+ * @throw Glib::Error.
+ */
+ typedef sigc::slot<
+ void,
+ Glib::VariantBase&,
+ const Glib::RefPtr<Connection>&,
+ const Glib::ustring&,
+ const Glib::ustring&,
+ const Glib::ustring&,
+ const Glib::ustring&
+ > SlotInterfaceGetProperty;
+
+ /** The type for a slot which handles setting a property for a D-Bus
+ * interface.
+ * for example,
+ * @code
+ * 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);
+ * @endcode
+ * @throw Glib::Error.
+ */
+ typedef sigc::slot<
+ bool,
+ const Glib::RefPtr<Connection>&,
+ const Glib::ustring&,
+ const Glib::ustring&,
+ const Glib::ustring&,
+ const Glib::ustring&,
+ const Glib::VariantBase&
+ > SlotInterfaceSetProperty;
+
+ /** 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 InterfaceVTable(
+ const SlotInterfaceMethodCall& slot_method_call,
+ const SlotInterfaceGetProperty& slot_get_property = SlotInterfaceGetProperty(),
+ const SlotInterfaceSetProperty& slot_set_property = SlotInterfaceSetProperty()
+ );
+
+ /// Destructor.
+ virtual ~InterfaceVTable();
+
+ /// Provides access to the underlying C object.
+ GDBusInterfaceVTable* gobj()
+ { return reinterpret_cast<GDBusInterfaceVTable*>(&gobject_); }
+
+ /// Provides access to the underlying C object.
+ const GDBusInterfaceVTable* gobj() const
+ { return reinterpret_cast<const GDBusInterfaceVTable*>(&gobject_); }
+
+
+private:
+ // Non-copyable.
+ InterfaceVTable(const InterfaceVTable& other);
+ InterfaceVTable& operator=(const InterfaceVTable& other);
+
+public:
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+ // These are so the C callbacks and 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;
+ SlotInterfaceSetProperty* get_slot_set_property() const;
+#endif
+
+protected:
+ // The underlying C instance.
+ GDBusInterfaceVTable gobject_;
+
+ // Pointers to copies of the slots used to create an instance.
+ SlotInterfaceMethodCall* slot_method_call_;
+ SlotInterfaceGetProperty* slot_get_property_;
+ SlotInterfaceSetProperty* slot_set_property_;
+};
+
+
+} //namespace DBus
+
+} // namespace Gio
diff --git a/gio/src/dbussubtreevtable.ccg b/gio/src/dbussubtreevtable.ccg
new file mode 100644
index 0000000..912c4ea
--- /dev/null
+++ b/gio/src/dbussubtreevtable.ccg
@@ -0,0 +1,183 @@
+// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+
+/* Copyright (C) 2010 The giomm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <gio/gio.h>
+#include <giomm/dbusauthobserver.h>
+#include <giomm/dbusintrospection.h>
+#include <giomm/dbusmethodinvocation.h>
+#include <giomm/dbusconnection.h>
+#include <giomm/dbuserror.h>
+#include "slot_async.h"
+
+namespace
+{
+
+extern "C"
+{
+
+static char** DBusSubtreeVTable_Enumerate_giomm_callback(
+ GDBusConnection* connection, const char* sender, const char* object_path,
+ void* user_data)
+{
+ Gio::DBus::SubtreeVTable* vtable =
+ static_cast<Gio::DBus::SubtreeVTable*>(user_data);
+
+ Gio::DBus::SubtreeVTable::SlotSubtreeEnumerate* the_slot =
+ vtable->get_slot_enumerate();
+
+ try
+ {
+ std::vector<Glib::ustring> result =
+ (*the_slot)(Glib::wrap(connection, true), sender, object_path);
+
+ // This will be freed by the caller.
+ char** ret = g_new(char*, result.size());
+
+ for(std::vector<Glib::ustring>::size_type i = 0; i < result.size(); i++)
+ {
+ ret[i] = g_strdup(result[i].c_str());
+ }
+
+ return ret;
+ }
+ catch(...)
+ {
+ Glib::exception_handlers_invoke();
+ }
+
+ return 0;
+}
+
+static GDBusInterfaceInfo** DBusSubtreeVTable_Introspect_giomm_callback(
+ GDBusConnection* connection, const char* sender, const char* object_path,
+ const char* node, void* user_data)
+{
+ Gio::DBus::SubtreeVTable* vtable =
+ static_cast<Gio::DBus::SubtreeVTable*>(user_data);
+
+ Gio::DBus::SubtreeVTable::SlotSubtreeIntrospect* the_slot =
+ vtable->get_slot_introspect();
+
+ try
+ {
+ std::vector< Glib::RefPtr<Gio::DBus::InterfaceInfo> > result =
+ (*the_slot)(Glib::wrap(connection, true), sender, object_path, node);
+
+ // This will be freed by the caller, along with unreferencing its members.
+ GDBusInterfaceInfo** info = g_new(GDBusInterfaceInfo*, result.size());
+
+ for(std::vector< Glib::RefPtr<Gio::DBus::InterfaceInfo> >::size_type i = 0;
+ i < result.size(); i++)
+ {
+ info[i] = static_cast<GDBusInterfaceInfo*>(
+ g_object_ref(result[i]->gobj()));
+ }
+
+ return info;
+ }
+ catch(...)
+ {
+ Glib::exception_handlers_invoke();
+ }
+
+ return 0;
+}
+
+static const GDBusInterfaceVTable* DBusSubtreeVTable_Dispatch_giomm_callback(
+ GDBusConnection* connection, const char* sender, const char* object_path,
+ const char* interface_name, const char* node, void** out_user_data,
+ void* user_data)
+{
+ Gio::DBus::SubtreeVTable* vtable =
+ static_cast<Gio::DBus::SubtreeVTable*>(user_data);
+
+ Gio::DBus::SubtreeVTable::SlotSubtreeDispatch* the_slot =
+ vtable->get_slot_dispatch();
+
+ try
+ {
+ const Gio::DBus::InterfaceVTable* vtable =
+ (*the_slot)(Glib::wrap(connection, true), sender, object_path,
+ interface_name, (node ? node : ""));
+
+ *out_user_data = const_cast<Gio::DBus::InterfaceVTable*>(vtable);
+
+ return vtable->gobj();
+ }
+ catch(...)
+ {
+ Glib::exception_handlers_invoke();
+ }
+
+ return 0;
+}
+
+} // extern "C"
+
+}
+
+namespace Gio
+{
+
+namespace DBus
+{
+
+
+SubtreeVTable::SubtreeVTable(
+ const SlotSubtreeEnumerate& slot_enumerate,
+ const SlotSubtreeIntrospect& slot_introspect,
+ const SlotSubtreeDispatch& slot_dispatch
+)
+: slot_enumerate_(new SlotSubtreeEnumerate(slot_enumerate)),
+ slot_introspect_(new SlotSubtreeIntrospect(slot_introspect)),
+ slot_dispatch_(new SlotSubtreeDispatch(slot_dispatch))
+{
+ gobject_.enumerate = &DBusSubtreeVTable_Enumerate_giomm_callback;
+ gobject_.introspect = &DBusSubtreeVTable_Introspect_giomm_callback;
+ gobject_.dispatch = &DBusSubtreeVTable_Dispatch_giomm_callback;
+}
+
+SubtreeVTable::~SubtreeVTable()
+{
+ delete slot_enumerate_;
+ delete slot_introspect_;
+ delete slot_dispatch_;
+}
+
+SubtreeVTable::SlotSubtreeEnumerate*
+ SubtreeVTable::get_slot_enumerate() const
+{
+ return slot_enumerate_;
+}
+
+SubtreeVTable::SlotSubtreeIntrospect*
+ SubtreeVTable::get_slot_introspect() const
+{
+ return slot_introspect_;
+}
+
+SubtreeVTable::SlotSubtreeDispatch*
+ SubtreeVTable::get_slot_dispatch() const
+{
+ return slot_dispatch_;
+}
+
+} //namespace DBus
+
+} // namespace Gio
diff --git a/gio/src/dbussubtreevtable.hg b/gio/src/dbussubtreevtable.hg
new file mode 100644
index 0000000..e3fde65
--- /dev/null
+++ b/gio/src/dbussubtreevtable.hg
@@ -0,0 +1,178 @@
+// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+
+/* Copyright (C) 2010 The giomm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <giomm/dbusmethodinvocation.h>
+#include <giomm/dbusinterfacevtable.h>
+#include <gio/gio.h>
+
+_DEFS(giomm,gio)
+_PINCLUDE(glibmm/private/object_p.h)
+
+namespace Gio
+{
+
+namespace DBus
+{
+
+/** 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
+ * instance to the methods that require such a parameter. The instance can be
+ * used for multiple registrations and the memory it uses will be freed at the
+ * end of execution. Any other use (like creating an instance local to a
+ * function and using that) may cause memory leaks or errors (if the instance
+ * is destroyed too early).
+ *
+ * @newin{2,28}
+ * @ingroup DBus
+ */
+class SubtreeVTable
+{
+ _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
+ * specified (ie: to verify that the object path is valid).
+ *
+ * Hierarchies are not supported; the items that you return should not
+ * contain the '/' character.
+ *
+ * For example,
+ * @code
+ * std::vector<Glib::ustring> on_subtree_enumerate(const
+ * 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<Connection>&,
+ const Glib::ustring&,
+ const Glib::ustring&
+ > SlotSubtreeEnumerate;
+
+ /** The type for a slot which handles introspecting a child node.
+ *
+ * Subtrees are flat. @a node, if non-<tt>0</tt>, is always exactly one
+ * segment of the object path (ie: it never contains a slash).
+ *
+ * This function should return an empty vector to indicate that there is no
+ * object at this node.
+ *
+ * If this function returns a non-empty vector, the return value is expected
+ * to be a list of DBusInterfaceInfo structures describing the interfaces
+ * implemented by node.
+ *
+ * for example,
+ * @code
+ * 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::DBus::InterfaceInfo> >,
+ const Glib::RefPtr<Connection>&,
+ const Glib::ustring&,
+ const Glib::ustring&,
+ const Glib::ustring&
+ > SlotSubtreeIntrospect;
+
+ /** The type for a slot which handles dispatching a remote call on a child
+ * node.
+ *
+ * Subtrees are flat. @a node, if non-<tt>0</tt>, is always exactly one
+ * segment of the object path (ie: it never contains a slash).
+ *
+ * for example,
+ * @code
+ * 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 InterfaceVTable*,
+ const Glib::RefPtr<Connection>&,
+ const Glib::ustring&,
+ const Glib::ustring&,
+ const Glib::ustring&,
+ const Glib::ustring&
+ > SlotSubtreeDispatch;
+
+ /** 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 SubtreeVTable(
+ const SlotSubtreeEnumerate& slot_enumerate,
+ const SlotSubtreeIntrospect& slot_introspect = SlotSubtreeIntrospect(),
+ const SlotSubtreeDispatch& slot_dispatch = SlotSubtreeDispatch()
+ );
+
+ /// Destructor.
+ virtual ~SubtreeVTable();
+
+ /// Provides access to the underlying C object.
+ GDBusSubtreeVTable* gobj()
+ { return reinterpret_cast<GDBusSubtreeVTable*>(&gobject_); }
+
+ /// Provides access to the underlying C object.
+ const GDBusSubtreeVTable* gobj() const
+ { return reinterpret_cast<const GDBusSubtreeVTable*>(&gobject_); }
+
+
+private:
+ // Non-copyable.
+ SubtreeVTable(const SubtreeVTable& other);
+ SubtreeVTable& operator=(const SubtreeVTable& other);
+
+public:
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+ // These are so the C callbacks and 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;
+ SlotSubtreeDispatch* get_slot_dispatch() const;
+#endif
+
+protected:
+ // The underlying C instance.
+ GDBusSubtreeVTable gobject_;
+
+ // Pointers to copies of the slots used to create an instance.
+ SlotSubtreeEnumerate* slot_enumerate_;
+ SlotSubtreeIntrospect* slot_introspect_;
+ SlotSubtreeDispatch* slot_dispatch_;
+};
+
+
+} //namespace DBus
+
+} // namespace Gio
diff --git a/gio/src/filelist.am b/gio/src/filelist.am
index 604ec48..bf65f86 100644
--- a/gio/src/filelist.am
+++ b/gio/src/filelist.am
@@ -30,12 +30,14 @@ giomm_files_any_hg = \
dbusconnection.hg \
dbuserror.hg \
dbuserrorutils.hg \
+ dbusinterfacevtable.hg \
dbusintrospection.hg \
dbusmessage.hg \
dbusmethodinvocation.hg \
dbusownname.hg \
dbusproxy.hg \
dbusserver.hg \
+ dbussubtreevtable.hg \
dbusutils.hg \
dbuswatchname.hg \
drive.hg \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]