[glibmm] sigc3: SignalProxy: Use R(Args...) syntax.



commit b38fa51048ca6ac22140ac6193fea489a70b7032
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Mar 31 14:46:34 2016 +0200

    sigc3: SignalProxy: Use R(Args...) syntax.
    
    Including using this in gmmproc.

 gio/src/application.ccg   |    4 ++--
 gio/src/application.hg    |    2 +-
 glib/glibmm/signalproxy.h |   14 ++++++++++++--
 tools/m4/signal.m4        |   24 ++++++++++++------------
 4 files changed, 27 insertions(+), 17 deletions(-)
---
diff --git a/gio/src/application.ccg b/gio/src/application.ccg
index 75e876d..785d050 100644
--- a/gio/src/application.ccg
+++ b/gio/src/application.ccg
@@ -352,10 +352,10 @@ Application_Class::open_callback(GApplication* self, GFile** files, gint n_files
     (*base->open)(self, files, n_files, hint);
 }
 
-Glib::SignalProxy<void, const Application::type_vec_files&, const Glib::ustring&>
+Glib::SignalProxy<void(const Application::type_vec_files&, const Glib::ustring&)>
 Application::signal_open()
 {
-  return Glib::SignalProxy<void, const Application::type_vec_files&, const Glib::ustring&>(
+  return Glib::SignalProxy<void(const Application::type_vec_files&, const Glib::ustring&)>(
     this, &Application_signal_open_info);
 }
 
diff --git a/gio/src/application.hg b/gio/src/application.hg
index 626fa66..2d05118 100644
--- a/gio/src/application.hg
+++ b/gio/src/application.hg
@@ -380,7 +380,7 @@ public:
 
   //We wrap the open signal without _WRAP_SIGNAL(), because we need to change its parameters.
   //See bug https://bugzilla.gnome.org/show_bug.cgi?id=637457
-  Glib::SignalProxy< void,  const type_vec_files&, const Glib::ustring& > signal_open();
+  Glib::SignalProxy<void(const type_vec_files&, const Glib::ustring&)> signal_open();
   _IGNORE_SIGNAL(open)
 
 #m4 _CONVERSION(`GApplicationCommandLine*', `const Glib::RefPtr<ApplicationCommandLine>&',`Glib::wrap($3, 
true)')
diff --git a/glib/glibmm/signalproxy.h b/glib/glibmm/signalproxy.h
index 7916123..8aae39d 100644
--- a/glib/glibmm/signalproxy.h
+++ b/glib/glibmm/signalproxy.h
@@ -150,7 +150,14 @@ private:
  * to connect signal handlers to signals.
  */
 template <class R, class... T>
-class SignalProxy : public SignalProxyNormal
+class SignalProxy;
+
+/** Proxy for signals with any number of arguments.
+ * Use the connect() or connect_notify() method, with sigc::mem_fun() or sigc::ptr_fun()
+ * to connect signal handlers to signals.
+ */
+template <class R, class... T>
+class SignalProxy<R(T...)> : public SignalProxyNormal
 {
 public:
   using SlotType = sigc::slot<R(T...)>;
@@ -281,7 +288,10 @@ private:
  * to connect signal handlers to signals.
  */
 template <class R, class... T>
-class SignalProxyDetailedAnyType : public SignalProxyDetailed
+class SignalProxyDetailedAnyType;
+
+template <class R, class... T>
+class SignalProxyDetailedAnyType<R(T...)> : public SignalProxyDetailed
 {
 public:
   using SlotType = sigc::slot<R(T...)>;
diff --git a/tools/m4/signal.m4 b/tools/m4/signal.m4
index b1a53bc..d121b15 100644
--- a/tools/m4/signal.m4
+++ b/tools/m4/signal.m4
@@ -24,17 +24,17 @@ ifelse(`$9',,,`_DEPRECATE_IFDEF_START
 ')dnl
 ifelse($13,,`dnl no detail_name
 $10
-  Glib::SignalProxy< $5`'_COMMA_PREFIX($6) > signal_$4`'();
+  Glib::SignalProxy<$5`'($6)> signal_$4`'();
 ',dnl detail_name
 $14,0,`dnl
 $10
-  Glib::SignalProxyDetailedAnyType< $5`'_COMMA_PREFIX($6) > signal_$4`'(const Glib::ustring& $13 = 
Glib::ustring());
+  Glib::SignalProxyDetailedAnyType<$5`'($6)> signal_$4`'(const Glib::ustring& $13 = Glib::ustring());
 ',`dnl detail_name and two_signal_methods
 $10
-  Glib::SignalProxy< $5`'_COMMA_PREFIX($6) > signal_$4`'();
+  Glib::SignalProxy<$5`'($6)> signal_$4`'();
 
 $10
-  Glib::SignalProxyDetailedAnyType< $5`'_COMMA_PREFIX($6) > signal_$4`'(const Glib::ustring& $13);
+  Glib::SignalProxyDetailedAnyType<$5`'($6)> signal_$4`'(const Glib::ustring& $13);
 ')dnl end detail_name
 ifelse(`$9',,,`_DEPRECATE_IFDEF_END
 ')dnl
@@ -161,25 +161,25 @@ ifelse(`$11',,,`#ifdef $11'
 ifelse(`$9',,,`_DEPRECATE_IFDEF_START
 ')dnl
 ifelse($13,,`dnl no detail_name
-Glib::SignalProxy< $5`'_COMMA_PREFIX($6) > __CPPNAME__::signal_$4`'()
+Glib::SignalProxy<$5`'($6)> __CPPNAME__::signal_$4`'()
 {
-  return Glib::SignalProxy< $5`'_COMMA_PREFIX($6) >(this, &__CPPNAME__`'_signal_$4_info);
+  return Glib::SignalProxy<$5`'($6) >(this, &__CPPNAME__`'_signal_$4_info);
 }
 ',dnl detail_name
 $14,0,`dnl
-Glib::SignalProxyDetailedAnyType< $5`'_COMMA_PREFIX($6) > __CPPNAME__::signal_$4`'(const Glib::ustring& $13)
+Glib::SignalProxyDetailedAnyType<$5`'($6)> __CPPNAME__::signal_$4`'(const Glib::ustring& $13)
 {
-  return Glib::SignalProxyDetailedAnyType< $5`'_COMMA_PREFIX($6) >(this, &__CPPNAME__`'_signal_$4_info, $13);
+  return Glib::SignalProxyDetailedAnyType<$5`'($6)>(this, &__CPPNAME__`'_signal_$4_info, $13);
 }
 ',`dnl detail_name and two_signal_methods
-Glib::SignalProxy< $5`'_COMMA_PREFIX($6) > __CPPNAME__::signal_$4`'()
+Glib::SignalProxy<$5`'($6)> __CPPNAME__::signal_$4`'()
 {
-  return Glib::SignalProxy< $5`'_COMMA_PREFIX($6) >(this, &__CPPNAME__`'_signal_$4_info);
+  return Glib::SignalProxy<$5`'($6)>(this, &__CPPNAME__`'_signal_$4_info);
 }
 
-Glib::SignalProxyDetailedAnyType< $5`'_COMMA_PREFIX($6) > __CPPNAME__::signal_$4`'(const Glib::ustring& $13)
+Glib::SignalProxyDetailedAnyType<$5`'($6)> __CPPNAME__::signal_$4`'(const Glib::ustring& $13)
 {
-  return Glib::SignalProxyDetailedAnyType< $5`'_COMMA_PREFIX($6) >(this, &__CPPNAME__`'_signal_$4_info, $13);
+  return Glib::SignalProxyDetailedAnyType<$5`'($6)>(this, &__CPPNAME__`'_signal_$4_info, $13);
 }
 ')dnl end detail_name
 ifelse(`$9',,,`_DEPRECATE_IFDEF_END


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