[glibmm] DBusProxy: Reorder the parameters so that "name" is second in methods.



commit 6c56522dddbb9a2c2d130ae94b9f951899a3a37c
Author: José Alburquerque <jaalburqu svn gnome org>
Date:   Mon Dec 13 23:08:40 2010 -0500

    	DBusProxy: Reorder the parameters so that "name" is second in methods.
    
    	* gio/src/dbusproxy.{ccg,hg}: Reorder the parameters so that the
    	"name" parameter comes before the "object_path" parameter as in the C
    	API which is probably more natural.  Add _IMPLEMENTS_INTERFACE() for
    	the Initable and AsyncInitable interfaces that it implements.
    	(class docs): Removed some sentences in the class docs that only
    	apply to the C API.  Made it clear that the docs is adapted from the C
    	API in case the paragraph about sub-classing does not apply.
    	(constructor properties): Corrected the "name" property to the correct
    	name "g_name" in constructors.
    
    	* gio/giomm.h: Added all the missing dbus includes.

 ChangeLog             |   16 ++++++++++++++++
 gio/giomm.h           |    5 +++++
 gio/src/dbusproxy.ccg |   48 ++++++++++++++++++++++++------------------------
 gio/src/dbusproxy.hg  |   27 +++++++++++++--------------
 4 files changed, 58 insertions(+), 38 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 37bb362..0485891 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,21 @@
 2010-12-13  José Alburquerque  <jaalburqu svn gnome org>
 
+	DBusProxy: Reorder the parameters so that "name" is second in methods.
+
+	* gio/src/dbusproxy.{ccg,hg}: Reorder the parameters so that the
+	"name" parameter comes before the "object_path" parameter as in the C
+	API which is probably more natural.  Add _IMPLEMENTS_INTERFACE() for
+	the Initable and AsyncInitable interfaces that it implements.
+	(class docs): Removed some sentences in the class docs that only
+	apply to the C API.  Made it clear that the docs is adapted from the C
+	API in case the paragraph about sub-classing does not apply.
+	(constructor properties): Corrected the "name" property to the correct
+	name "g_name" in constructors.
+
+	* gio/giomm.h: Added all the missing dbus includes.
+
+2010-12-13  José Alburquerque  <jaalburqu svn gnome org>
+
 	Add a DBus Doxygen group.
 
 	* gio/src/dbusconnection.hg: Add a DBus Doxygen group in which to
diff --git a/gio/giomm.h b/gio/giomm.h
index a8d3c47..bb49bf4 100644
--- a/gio/giomm.h
+++ b/gio/giomm.h
@@ -34,10 +34,15 @@
 #include <giomm/dbusaddress.h>
 #include <giomm/dbusauthobserver.h>
 #include <giomm/dbusconnection.h>
+#include <giomm/dbuserror.h>
+#include <giomm/dbusintrospection.h>
 #include <giomm/dbusmessage.h>
 #include <giomm/dbusmethodinvocation.h>
 #include <giomm/dbusownname.h>
+#include <giomm/dbusproxy.h>
 #include <giomm/dbusserver.h>
+#include <giomm/dbusutils.h>
+#include <giomm/dbuswatchname.h>
 #ifndef G_OS_WIN32
 # include <giomm/desktopappinfo.h>
 #endif
diff --git a/gio/src/dbusproxy.ccg b/gio/src/dbusproxy.ccg
index eac89af..ad9a85a 100644
--- a/gio/src/dbusproxy.ccg
+++ b/gio/src/dbusproxy.ccg
@@ -27,18 +27,18 @@ namespace Gio
 {
 
 DBusProxy::DBusProxy(const Glib::RefPtr<DBusConnection>& connection,
+  const Glib::ustring& name,
   const Glib::ustring& object_path,
   const Glib::ustring& interface_name,
   const SlotAsyncReady& slot,
   const Glib::RefPtr<Cancellable>& cancellable,
-  const Glib::ustring& name,
   const Glib::RefPtr<DBusInterfaceInfo>& info,
   DBusProxyFlags flags)
 :
 _CONSTRUCT("g-connection", Glib::unwrap(connection),
   "g-flags", static_cast<GDBusProxyFlags>(flags),
   "g-interface-info", Glib::unwrap(info),
-  "name", (name.empty() ? 0 : name.c_str()),
+  "g-name", (name.empty() ? 0 : name.c_str()),
   "g-object-path", (object_path.empty() ? 0 : object_path.c_str()),
   "g-interface-name", (interface_name.empty() ? 0 : interface_name.c_str()))
 {
@@ -46,17 +46,17 @@ _CONSTRUCT("g-connection", Glib::unwrap(connection),
 }
 
 DBusProxy::DBusProxy(const Glib::RefPtr<DBusConnection>& connection,
+  const Glib::ustring& name,
   const Glib::ustring& object_path,
   const Glib::ustring& interface_name,
   const SlotAsyncReady& slot,
-  const Glib::ustring& name,
   const Glib::RefPtr<DBusInterfaceInfo>& info,
   DBusProxyFlags flags)
 :
 _CONSTRUCT("g-connection", Glib::unwrap(connection),
   "g-flags", static_cast<GDBusProxyFlags>(flags),
   "g-interface-info", Glib::unwrap(info),
-  "name", (name.empty() ? 0 : name.c_str()),
+  "g-name", (name.empty() ? 0 : name.c_str()),
   "g-object-path", (object_path.empty() ? 0 : object_path.c_str()),
   "g-interface-name", (interface_name.empty() ? 0 : interface_name.c_str()))
 {
@@ -64,17 +64,17 @@ _CONSTRUCT("g-connection", Glib::unwrap(connection),
 }
 
 DBusProxy::DBusProxy(const Glib::RefPtr<DBusConnection>& connection,
+  const Glib::ustring& name,
   const Glib::ustring& object_path,
   const Glib::ustring& interface_name,
   const Glib::RefPtr<Cancellable>& cancellable,
-  const Glib::ustring& name,
   const Glib::RefPtr<DBusInterfaceInfo>& info,
   DBusProxyFlags flags)
 :
 _CONSTRUCT("g-connection", Glib::unwrap(connection),
   "g-flags", static_cast<GDBusProxyFlags>(flags),
   "g-interface-info", Glib::unwrap(info),
-  "name", (name.empty() ? 0 : name.c_str()),
+  "g-name", (name.empty() ? 0 : name.c_str()),
   "g-object-path", (object_path.empty() ? 0 : object_path.c_str()),
   "g-interface-name", (interface_name.empty() ? 0 : interface_name.c_str()))
 {
@@ -82,16 +82,16 @@ _CONSTRUCT("g-connection", Glib::unwrap(connection),
 }
 
 DBusProxy::DBusProxy(const Glib::RefPtr<DBusConnection>& connection,
+  const Glib::ustring& name,
   const Glib::ustring& object_path,
   const Glib::ustring& interface_name,
-  const Glib::ustring& name,
   const Glib::RefPtr<DBusInterfaceInfo>& info,
   DBusProxyFlags flags)
 :
 _CONSTRUCT("g-connection", Glib::unwrap(connection),
   "g-flags", static_cast<GDBusProxyFlags>(flags),
   "g-interface-info", Glib::unwrap(info),
-  "name", (name.empty() ? 0 : name.c_str()),
+  "g-name", (name.empty() ? 0 : name.c_str()),
   "g-object-path", (object_path.empty() ? 0 : object_path.c_str()),
   "g-interface-name", (interface_name.empty() ? 0 : interface_name.c_str()))
 {
@@ -110,7 +110,7 @@ DBusProxy::DBusProxy(BusType bus_type,
 _CONSTRUCT("g-bus-type", static_cast<GBusType>(bus_type),
   "g-flags", static_cast<GDBusProxyFlags>(flags),
   "g-interface-info", Glib::unwrap(info),
-  "name", (name.empty() ? 0 : name.c_str()),
+  "g-name", (name.empty() ? 0 : name.c_str()),
   "g-object-path", (object_path.empty() ? 0 : object_path.c_str()),
   "g-interface-name", (interface_name.empty() ? 0 : interface_name.c_str()))
 {
@@ -128,7 +128,7 @@ DBusProxy::DBusProxy(BusType bus_type,
 _CONSTRUCT("g-bus-type", static_cast<GBusType>(bus_type),
   "g-flags", static_cast<GDBusProxyFlags>(flags),
   "g-interface-info", Glib::unwrap(info),
-  "name", (name.empty() ? 0 : name.c_str()),
+  "g-name", (name.empty() ? 0 : name.c_str()),
   "g-object-path", (object_path.empty() ? 0 : object_path.c_str()),
   "g-interface-name", (interface_name.empty() ? 0 : interface_name.c_str()))
 {
@@ -146,7 +146,7 @@ DBusProxy::DBusProxy(BusType bus_type,
 _CONSTRUCT("g-bus-type", static_cast<GBusType>(bus_type),
   "g-flags", static_cast<GDBusProxyFlags>(flags),
   "g-interface-info", Glib::unwrap(info),
-  "name", (name.empty() ? 0 : name.c_str()),
+  "g-name", (name.empty() ? 0 : name.c_str()),
   "g-object-path", (object_path.empty() ? 0 : object_path.c_str()),
   "g-interface-name", (interface_name.empty() ? 0 : interface_name.c_str()))
 {
@@ -163,7 +163,7 @@ DBusProxy::DBusProxy(BusType bus_type,
 _CONSTRUCT("g-bus-type", static_cast<GBusType>(bus_type),
   "g-flags", static_cast<GDBusProxyFlags>(flags),
   "g-interface-info", Glib::unwrap(info),
-  "name", (name.empty() ? 0 : name.c_str()),
+  "g-name", (name.empty() ? 0 : name.c_str()),
   "g-object-path", (object_path.empty() ? 0 : object_path.c_str()),
   "g-interface-name", (interface_name.empty() ? 0 : interface_name.c_str()))
 {
@@ -171,11 +171,11 @@ _CONSTRUCT("g-bus-type", static_cast<GBusType>(bus_type),
 }
 
 void DBusProxy::create(const Glib::RefPtr<DBusConnection>& connection,
+  const Glib::ustring& name,
   const Glib::ustring& object_path,
   const Glib::ustring& interface_name,
   const SlotAsyncReady& slot,
   const Glib::RefPtr<Cancellable>& cancellable,
-  const Glib::ustring& name,
   const Glib::RefPtr<DBusInterfaceInfo>& info,
   DBusProxyFlags flags)
 {
@@ -183,15 +183,15 @@ void DBusProxy::create(const Glib::RefPtr<DBusConnection>& connection,
   // extra reference is taken so the proxy is not destroyed when it goes out
   // of scope.  The finished proxy will be returned in the slot by calling
   // create_finish().
-  Glib::RefPtr<DBusProxy>(new DBusProxy(connection, object_path,
-    interface_name, slot, cancellable, name, info, flags))->reference();
+  Glib::RefPtr<DBusProxy>(new DBusProxy(connection, name, object_path,
+    interface_name, slot, cancellable, info, flags))->reference();
 }
 
 void DBusProxy::create(const Glib::RefPtr<DBusConnection>& connection,
+  const Glib::ustring& name,
   const Glib::ustring& object_path,
   const Glib::ustring& interface_name,
   const SlotAsyncReady& slot,
-  const Glib::ustring& name,
   const Glib::RefPtr<DBusInterfaceInfo>& info,
   DBusProxyFlags flags)
 {
@@ -199,33 +199,33 @@ void DBusProxy::create(const Glib::RefPtr<DBusConnection>& connection,
   // extra reference is taken so the proxy is not destroyed when it goes out
   // of scope.  The finished proxy will be returned in the slot by calling
   // create_finish().
-  Glib::RefPtr<DBusProxy>(new DBusProxy(connection, object_path,
-    interface_name, slot, name, info, flags))->reference();
+  Glib::RefPtr<DBusProxy>(new DBusProxy(connection, name, object_path,
+    interface_name, slot, info, flags))->reference();
 }
 
 Glib::RefPtr<DBusProxy>
 DBusProxy::create_sync(const Glib::RefPtr<DBusConnection>& connection,
+  const Glib::ustring& name,
   const Glib::ustring& object_path,
   const Glib::ustring& interface_name,
   const Glib::RefPtr<Cancellable>& cancellable,
-  const Glib::ustring& name,
   const Glib::RefPtr<DBusInterfaceInfo>& info,
   DBusProxyFlags flags)
 {
-  return Glib::RefPtr<DBusProxy>(new DBusProxy(connection,
-    object_path, interface_name, cancellable, name, info, flags));
+  return Glib::RefPtr<DBusProxy>(new DBusProxy(connection, name,
+    object_path, interface_name, cancellable, info, flags));
 }
 
 Glib::RefPtr<DBusProxy>
 DBusProxy::create_sync(const Glib::RefPtr<DBusConnection>& connection,
+  const Glib::ustring& name,
   const Glib::ustring& object_path,
   const Glib::ustring& interface_name,
-  const Glib::ustring& name,
   const Glib::RefPtr<DBusInterfaceInfo>& info,
   DBusProxyFlags flags)
 {
-  return Glib::RefPtr<DBusProxy>(new DBusProxy(connection,
-    object_path, interface_name, name, info, flags));
+  return Glib::RefPtr<DBusProxy>(new DBusProxy(connection, name,
+    object_path, interface_name, info, flags));
 }
 
 void DBusProxy::create_for_bus(BusType bus_type,
diff --git a/gio/src/dbusproxy.hg b/gio/src/dbusproxy.hg
index 74a2a2f..de4f6bc 100644
--- a/gio/src/dbusproxy.hg
+++ b/gio/src/dbusproxy.hg
@@ -47,18 +47,15 @@ class DBusInterfaceInfo;
  * appears.
  *
  * If a DBusProxy is used for a well-known name, the owner of the name is
- * tracked and can be read from property_g_name_owner(). Connect to the
- * signal_notify() signal to get notified of changes. Additionally, only
- * signals and property changes emitted from the current name owner are
- * considered. This avoids a number of race conditions when the name is lost
- * by one owner and claimed by another.
+ * tracked and can be read from property_g_name_owner().
  *
  * The generic signal_g_properties_changed() and signal_g_signal() signals are
  * not very convenient to work with. Therefore, the recommended way of working
  * with proxies is to subclass DBusProxy, and have more natural properties and
  * signals in your derived class.
  *
- * The C API docs has more information and an example.
+ * This documentation was adapted from the C API documentation.  The C API docs
+ * has more information and an example.
  *
  * @newin{2,28}
  * @ingroup DBus
@@ -69,38 +66,40 @@ class DBusProxy
   public AsyncInitable
 {
   _CLASS_GOBJECT(DBusProxy, GDBusProxy, G_DBUS_PROXY, Glib::Object, GObject)
+  _IMPLEMENTS_INTERFACE(Initable)
+  _IMPLEMENTS_INTERFACE(AsyncInitable)
 
 protected:
 
   DBusProxy(const Glib::RefPtr<DBusConnection>& connection,
+    const Glib::ustring& name,
     const Glib::ustring& object_path,
     const Glib::ustring& interface_name,
     const SlotAsyncReady& slot,
     const Glib::RefPtr<Cancellable>& cancellable,
-    const Glib::ustring& name = Glib::ustring(),
     const Glib::RefPtr<DBusInterfaceInfo>& info = Glib::RefPtr<DBusInterfaceInfo>(),
     DBusProxyFlags flags = DBUS_PROXY_FLAGS_NONE);
 
   DBusProxy(const Glib::RefPtr<DBusConnection>& connection,
+    const Glib::ustring& name,
     const Glib::ustring& object_path,
     const Glib::ustring& interface_name,
     const SlotAsyncReady& slot,
-    const Glib::ustring& name = Glib::ustring(),
     const Glib::RefPtr<DBusInterfaceInfo>& info = Glib::RefPtr<DBusInterfaceInfo>(),
     DBusProxyFlags flags = DBUS_PROXY_FLAGS_NONE);
 
   DBusProxy(const Glib::RefPtr<DBusConnection>& connection,
+    const Glib::ustring& name,
     const Glib::ustring& object_path,
     const Glib::ustring& interface_name,
     const Glib::RefPtr<Cancellable>& cancellable,
-    const Glib::ustring& name = Glib::ustring(),
     const Glib::RefPtr<DBusInterfaceInfo>& info = Glib::RefPtr<DBusInterfaceInfo>(),
     DBusProxyFlags flags = DBUS_PROXY_FLAGS_NONE);
 
   DBusProxy(const Glib::RefPtr<DBusConnection>& connection,
+    const Glib::ustring& name,
     const Glib::ustring& object_path,
     const Glib::ustring& interface_name,
-    const Glib::ustring& name = Glib::ustring(),
     const Glib::RefPtr<DBusInterfaceInfo>& info = Glib::RefPtr<DBusInterfaceInfo>(),
     DBusProxyFlags flags = DBUS_PROXY_FLAGS_NONE);
 
@@ -140,20 +139,20 @@ public:
 
   _WRAP_METHOD_DOCS_ONLY(g_dbus_proxy_new)
   static void create(const Glib::RefPtr<DBusConnection>& connection,
+    const Glib::ustring& name,
     const Glib::ustring& object_path,
     const Glib::ustring& interface_name,
     const SlotAsyncReady& slot,
     const Glib::RefPtr<Cancellable>& cancellable,
-    const Glib::ustring& name = Glib::ustring(),
     const Glib::RefPtr<DBusInterfaceInfo>& info = Glib::RefPtr<DBusInterfaceInfo>(),
     DBusProxyFlags flags = DBUS_PROXY_FLAGS_NONE);
 
   /// Non-cancellable version of create().
   static void create(const Glib::RefPtr<DBusConnection>& connection,
+    const Glib::ustring& name,
     const Glib::ustring& object_path,
     const Glib::ustring& interface_name,
     const SlotAsyncReady& slot,
-    const Glib::ustring& name = Glib::ustring(),
     const Glib::RefPtr<DBusInterfaceInfo>& info = Glib::RefPtr<DBusInterfaceInfo>(),
     DBusProxyFlags flags = DBUS_PROXY_FLAGS_NONE);
 
@@ -164,19 +163,19 @@ public:
   _WRAP_METHOD_DOCS_ONLY(g_dbus_proxy_new_sync)
   static Glib::RefPtr<DBusProxy>
   create_sync(const Glib::RefPtr<DBusConnection>& connection,
+    const Glib::ustring& name,
     const Glib::ustring& object_path,
     const Glib::ustring& interface_name,
     const Glib::RefPtr<Cancellable>& cancellable,
-    const Glib::ustring& name = Glib::ustring(),
     const Glib::RefPtr<DBusInterfaceInfo>& info = Glib::RefPtr<DBusInterfaceInfo>(),
     DBusProxyFlags flags = DBUS_PROXY_FLAGS_NONE);
 
   /// Non-cancellable version of create_sync().
   static Glib::RefPtr<DBusProxy>
   create_sync(const Glib::RefPtr<DBusConnection>& connection,
+    const Glib::ustring& name,
     const Glib::ustring& object_path,
     const Glib::ustring& interface_name,
-    const Glib::ustring& name = Glib::ustring(),
     const Glib::RefPtr<DBusInterfaceInfo>& info = Glib::RefPtr<DBusInterfaceInfo>(),
     DBusProxyFlags flags = DBUS_PROXY_FLAGS_NONE);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]