[glibmm] DBus::Proxy: Added signal properties_changed



commit 463849a5678c2c2919a16ce5de51ee7326beab60
Author: Yannick Guesnet <yannick guesnet univ-rouen fr>
Date:   Wed Mar 16 08:28:59 2011 +0100

    DBus::Proxy: Added signal properties_changed
    
    * gio/src/dbusproxy.hg: Add signal properties_changed.
    * gio/src/gio_signals.defs: Change the type of a parameter of
    signal g-properties-changed from "GStrv" to
    "const gchar * const *" to match the signal declaration.

 ChangeLog                |    9 +++++++++
 gio/src/dbusproxy.hg     |   14 ++++++++------
 gio/src/gio_signals.defs |    6 +++++-
 3 files changed, 22 insertions(+), 7 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index d44acbd..87b8f75 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2011-03-16  Yannick Guesnet  <Yannick Guesnet univ-rouen fr>
+
+	DBus::Proxy: Added signal properties_changed
+
+	* gio/src/dbusproxy.hg: Add signal properties_changed.
+	* gio/src/gio_signals.defs: Change the type of a parameter of
+	signal g-properties-changed from "GStrv" to
+	"const gchar * const *" to match the signal declaration.
+
 2011-03-16  Murray Cumming  <murrayc murrayc com>
 
 	Gio::Variant: Use _WRAP_METHOD() instead of hand-coding.
diff --git a/gio/src/dbusproxy.hg b/gio/src/dbusproxy.hg
index 673e354..01333aa 100644
--- a/gio/src/dbusproxy.hg
+++ b/gio/src/dbusproxy.hg
@@ -333,13 +333,15 @@ public:
  _WRAP_PROPERTY("g-name-owner", Glib::ustring)
  _WRAP_PROPERTY("g-object-path", Glib::ustring)
 
-#m4 _CONVERSION(`GVariant*', `const Glib::VariantBase&', `Glib::wrap($3, true)')
-
-  //TODO: It's difficult to figure out conversions from/to GStrv (gchar**)
-  //to/from std::vector<Glib::ustring>
-//#m4 _CONVERSION(`GStrv', `const std::vector<Glib::ustring>&', `std::vector<Glib::ustring>($3, $3 + g_strv_length($3))')
- //_WRAP_SIGNAL(void properties_changed(const Glib::VariantBase& changed_properties, const std::vector<Glib::ustring>& invalidated_properties), "g-properties-changed")
+typedef std::map<Glib::ustring,Glib::VariantBase> type_map_changed_properties;
+// The BDus API ensures that the variant changed_properties is of type "DICT<STRING,VARIANT>"
+#m4 _CONVERSION(`GVariant*', `const Gio::DBus::Proxy::type_map_changed_properties&', `Glib::Variant<Gio::DBus::Proxy::type_map_changed_properties>($3, true).get()')
+#m4 _CONVERSION(`const Gio::DBus::Proxy::type_map_changed_properties&', `GVariant*', `const_cast<GVariant*>(Glib::Variant<Gio::DBus::Proxy::type_map_changed_properties>::create($3).gobj())')
+#m4 _CONVERSION(`const std::vector<Glib::ustring>&', `const gchar*const*',`Glib::ArrayHandler<Glib::ustring>::vector_to_array($3).data()')
+#m4 _CONVERSION(`const gchar*const*', `const std::vector<Glib::ustring>&', `Glib::ArrayHandler<Glib::ustring>::array_to_vector($3, Glib::OWNERSHIP_NONE)')
+  _WRAP_SIGNAL(void properties_changed(const Gio::DBus::Proxy::type_map_changed_properties& changed_properties, const std::vector<Glib::ustring>& invalidated_properties), "g-properties-changed")
 
+#m4 _CONVERSION(`GVariant*', `const Glib::VariantBase&', `Glib::wrap($3, true)')
  _WRAP_SIGNAL(void signal(const Glib::ustring& sender_name, const Glib::ustring& signal_name, const Glib::VariantBase& parameters), "g-signal")
 };
 
diff --git a/gio/src/gio_signals.defs b/gio/src/gio_signals.defs
index 2bc8860..7b45139 100644
--- a/gio/src/gio_signals.defs
+++ b/gio/src/gio_signals.defs
@@ -1847,13 +1847,17 @@
 
 ;; From GDBusProxy
 
+;; p1 is actually a GStrv,
+;; but that is equivalent (by typedef) to gchar**,
+;; and the declaration in gdbusproxy.h add consts.
+;; yannickg
 (define-signal g-properties-changed
   (of-object "GDBusProxy")
   (return-type "void")
   (when "last")
   (parameters
     '("GVariant*" "p0")
-    '("GStrv" "p1")
+    '("const-gchar*const*" "p1")
   )
 )
 



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