[glibmm] gmmproc: _WRAP_SIGNAL(): Mark deprecated signals in the _p.h and .cc files.



commit d38a3dbd7fafdda778cc2e83d2321d91ae870e80
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date:   Mon Mar 26 15:15:41 2012 +0200

    gmmproc: _WRAP_SIGNAL(): Mark deprecated signals in the _p.h and .cc files.
    
    * tools/pm/WrapParser.pm: output_wrap_signal(): Pass $deprecated to
    output_wrap_default_signal_handler_[h|cc]().
    * tools/pm/Output.pm: output_wrap_default_signal_handler_[h|cc]():
    Take a 'deprecated' bool parameter and pass it to _SIGNAL_P[H|CC]().
    * tools/m4/signal.m4: _SIGNAL_PROXY(): Add deprecation info to the .cc file.
    _SIGNAL_PH(), _SIGNAL_PCC(): Take a 'deprecated' bool parameter.

 ChangeLog              |   11 +++++++++++
 tools/m4/signal.m4     |   35 +++++++++++++++++++++++++++--------
 tools/pm/Output.pm     |   33 +++++++++++++++++++++------------
 tools/pm/WrapParser.pm |   19 ++++++++++++++-----
 4 files changed, 73 insertions(+), 25 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 7207b90..873006a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2012-03-26  Kjell Ahlstedt  <kjell ahlstedt bredband net>
 
+	gmmproc: _WRAP_SIGNAL(): Mark deprecated signals in the _p.h and .cc files.
+
+	* tools/pm/WrapParser.pm: output_wrap_signal(): Pass $deprecated to
+	output_wrap_default_signal_handler_[h|cc]().
+	* tools/pm/Output.pm: output_wrap_default_signal_handler_[h|cc]():
+	Take a 'deprecated' bool parameter and pass it to _SIGNAL_P[H|CC]().
+	* tools/m4/signal.m4: _SIGNAL_PROXY(): Add deprecation info to the .cc file.
+	_SIGNAL_PH(), _SIGNAL_PCC(): Take a 'deprecated' bool parameter.
+
+2012-03-26  Kjell Ahlstedt  <kjell ahlstedt bredband net>
+
 	gmmproc: _WRAP_PROPERTY(): Fix mixed-up deprecation and documentation.
 
 	* tools/pm/Output.pm: Add $deprecated in the first call to _PROPERTY_PROXY().
diff --git a/tools/m4/signal.m4 b/tools/m4/signal.m4
index cab9382..4671948 100644
--- a/tools/m4/signal.m4
+++ b/tools/m4/signal.m4
@@ -17,7 +17,6 @@ dnl               $11 = ifdef)
 
 define(`_SIGNAL_PROXY',`
 $10
-
 ifelse(`$11',,,`#ifdef $11'
 )dnl
 ifelse(`$9',,,`_DEPRECATE_IFDEF_START
@@ -32,6 +31,8 @@ _PUSH(SECTION_ANONYMOUS_NAMESPACE)
 
 ifelse(`$11',,,`#ifdef $11'
 )dnl
+ifelse(`$9',,,`_DEPRECATE_IFDEF_START
+')dnl
 dnl
 ifelse($2`'_NUM($3)`'$5`'_NUM($6),`void0void0',`dnl
 dnl
@@ -117,6 +118,8 @@ static const Glib::SignalProxyInfo __CPPNAME__`'_signal_$4_info =
 };
 ')dnl endif
 
+ifelse(`$9',,,`_DEPRECATE_IFDEF_END
+')dnl
 ifelse(`$11',,,`#endif // $11
 ')dnl
 
@@ -124,46 +127,60 @@ _SECTION(SECTION_CC_SIGNALPROXIES)
 
 ifelse(`$11',,,`#ifdef $11'
 )dnl
+ifelse(`$9',,,`_DEPRECATE_IFDEF_START
+')dnl
 Glib::SignalProxy`'_NUM($6)< $5`'_COMMA_PREFIX($6) > __CPPNAME__::signal_$4`'()
 {
   return Glib::SignalProxy`'_NUM($6)< $5`'_COMMA_PREFIX($6) >(this, &__CPPNAME__`'_signal_$4_info);
 }
+ifelse(`$9',,,`_DEPRECATE_IFDEF_END
+')dnl
 ifelse(`$11',,,`#endif // $11
 ')dnl
 
 _POP()')
 
 
-dnl
-dnl _SIGNAL_PH(gname, crettype, cargs and names)
+dnl              $1      $2            $3          $4       $5
+dnl _SIGNAL_PH(gname, crettype, cargs and names, ifdef, deprecated)
 dnl Create a callback and set it in our derived G*Class.
 dnl
 define(`_SIGNAL_PH',`dnl
 _PUSH(SECTION_PCC_CLASS_INIT_DEFAULT_SIGNAL_HANDLERS)
 ifelse(`$4',,,`#ifdef $4'
 )dnl
+ifelse(`$5',,,`_DEPRECATE_IFDEF_START
+')dnl
   klass->$1 = `&'$1_callback;
+ifelse(`$5',,,`_DEPRECATE_IFDEF_END
+')dnl
 ifelse(`$4',,,`#endif // $4
 ')dnl
 _SECTION(SECTION_PH_DEFAULT_SIGNAL_HANDLERS)
 ifelse(`$4',,,`#ifdef $4'
 )dnl
+ifelse(`$5',,,`_DEPRECATE_IFDEF_START
+')dnl
   static $2 $1_callback`'($3);
+ifelse(`$5',,,`_DEPRECATE_IFDEF_END
+')dnl
 ifelse(`$4',,,`#endif // $4
 ')dnl
 _POP()')
 
 
 
-dnl                $1      $2       $3        $4
-dnl _SIGNAL_PCC(cppname,gname,cpprettype,crettype,
-dnl                        $5                $6          $7            $8			$9
-dnl                  `<cargs and names>',`<cnames>',`<cpparg names>', firstarg, <ifndef>)
+dnl                $1      $2       $3        $4         $5               $6
+dnl _SIGNAL_PCC(cppname,gname,cpprettype,crettype,`<cargs and names>',`<cnames>',
+dnl                  $7            $8      $9       $10
+dnl            `<cpparg names>',firstarg,<ifdef>,deprecated)
 dnl
 define(`_SIGNAL_PCC',`dnl
 _PUSH(SECTION_PCC_DEFAULT_SIGNAL_HANDLERS)
 ifelse(`$9',,,`#ifdef $9'
 )dnl
+ifelse(`$10',,,`_DEPRECATE_IFDEF_START
+')dnl
 $4 __CPPNAME__`'_Class::$2_callback`'($5)
 {
 dnl  First, do a simple cast to ObjectBase. We will have to do a dynamic_cast
@@ -223,12 +240,14 @@ ifelse($4,void,,`dnl
   return RType`'();
 ')dnl
 }
+ifelse(`$10',,,`_DEPRECATE_IFDEF_END
+')dnl
 ifelse(`$9',,,`#endif // $9
 ')dnl
 _POP()')
 
 
-dnl               $1      $2       $3 		$4
+dnl               $1      $2       $3          $4
 dnl _SIGNAL_H(signame, rettype, `<cppargs>', <ifdef>)
 dnl
 define(`_SIGNAL_H',`dnl
diff --git a/tools/pm/Output.pm b/tools/pm/Output.pm
index 889b716..33bbe45 100644
--- a/tools/pm/Output.pm
+++ b/tools/pm/Output.pm
@@ -194,13 +194,16 @@ sub output_wrap_vfunc_cc($$$$$$$)
 }
 
 ### Convert _WRAP to a signal
-# _SIGNAL_H(signame,rettype, ifdef, `<cppargs>')
-# _SIGNAL_PH(gtkname,crettype, ifdef, cargs and names)
-# void output_wrap_default_signal_handler_h($filename, $line_num, $objCppfunc, $objCDefsFunc, $ifdef. @args)
+# _SIGNAL_H(signame,rettype, `<cppargs>', ifdef)
+# _SIGNAL_PH(gtkname,crettype, cargs and names, ifdef, deprecated)
+# void output_wrap_default_signal_handler_h($filename, $line_num, $objCppfunc,
+#      $objCDefsFunc, $ifdef, $deprecated)
 sub output_wrap_default_signal_handler_h($$$$$$$)
 {
-  my ($self, $filename, $line_num, $objCppfunc, $objCDefsFunc, $ifdef) = @_;
+  my ($self, $filename, $line_num, $objCppfunc, $objCDefsFunc, $ifdef, $deprecated) = @_;
 
+  # The default signal handler is a virtual function.
+  # It's not hidden by deprecation, since that would break ABI.
   my $str = sprintf("_SIGNAL_H(%s,%s,\`%s\',%s)dnl\n",
     $$objCppfunc{name},
     $$objCppfunc{rettype},
@@ -210,22 +213,24 @@ sub output_wrap_default_signal_handler_h($$$$$$$)
   $self->append($str);
 
 
-  #The default callback, which will call *_impl, which will then call the base default callback.
+  #The default callback, which will call on_* or the base default callback.
   #Declares the callback in the private *Class class and sets it in the class_init function.
-
-  $str = sprintf("_SIGNAL_PH(%s,%s,\`%s\',%s)dnl\n",
+  #This is hidden by deprecation.
+  $str = sprintf("_SIGNAL_PH(%s,%s,\`%s\',%s,%s)dnl\n",
     $$objCDefsFunc{name},
     $$objCDefsFunc{rettype},
     $objCDefsFunc->args_types_and_names(),
-    $ifdef
+    $ifdef,
+    $deprecated
    );
   $self->append($str);
 }
 
-# _SIGNAL_CC(signame, gtkname, rettype, crettype,`<cppargs>',`<cargs>')
+# _SIGNAL_CC(signame, gtkname, rettype, crettype,`<cppargs>',`<cargs>', const, refreturn, ifdef)
 sub output_wrap_default_signal_handler_cc($$$$$$$$$)
 {
-  my ($self, $filename, $line_num, $objCppfunc, $objDefsSignal, $bImplement, $bCustomCCallback, $bRefreturn, $ifdef) = @_;
+  my ($self, $filename, $line_num, $objCppfunc, $objDefsSignal, $bImplement,
+      $bCustomCCallback, $bRefreturn, $ifdef, $deprecated) = @_;
   my $cname = $$objDefsSignal{name};
   # $cname = $1 if ($args[3] =~ /"(.*)"/); #TODO: What's this about?
 
@@ -235,6 +240,8 @@ sub output_wrap_default_signal_handler_cc($$$$$$$$$)
     my $refreturn = "";
     $refreturn = "refreturn" if($bRefreturn eq 1);
 
+    # The default signal handler is a virtual function.
+    # It's not hidden by deprecation, since that would break ABI.
     my $str = sprintf("_SIGNAL_CC(%s,%s,%s,%s,\`%s\',\`%s\',%s,%s,%s)dnl\n",
       $$objCppfunc{name},
       $cname,
@@ -262,7 +269,8 @@ sub output_wrap_default_signal_handler_cc($$$$$$$$$)
 
   if($bCustomCCallback ne 1)
   {
-    my $str = sprintf("_SIGNAL_PCC(%s,%s,%s,%s,\`%s\',\`%s\',\`%s\',\`%s\',%s)dnl\n",
+    #This is hidden by deprecation.
+    my $str = sprintf("_SIGNAL_PCC(%s,%s,%s,%s,\`%s\',\`%s\',\`%s\',\`%s\',%s,%s)dnl\n",
       $$objCppfunc{name},
       $cname,
       $$objCppfunc{rettype},
@@ -271,7 +279,8 @@ sub output_wrap_default_signal_handler_cc($$$$$$$$$)
       $objDefsSignal->args_names_only(),
       convert_args_c_to_cpp($objDefsSignal, $objCppfunc, $line_num),
       ${$objDefsSignal->get_param_names()}[0],
-      $ifdef);
+      $ifdef,
+      $deprecated);
     $self->append($str);
   }
 }
diff --git a/tools/pm/WrapParser.pm b/tools/pm/WrapParser.pm
index c18c1b0..33a2431 100644
--- a/tools/pm/WrapParser.pm
+++ b/tools/pm/WrapParser.pm
@@ -1343,10 +1343,14 @@ sub output_wrap_check($$$$$$)
   return '';
 }
 
-# void output_wrap($CppDecl, $signal_name, $filename, $line_num, $bCustomDefaultHandler, $bNoDefaultHandler, $bCustomCCallback, $bRefreturn, $ifdef, $merge_doxycomment_with_previous, $deprecated, $deprecation_docs)
+# void output_wrap($CppDecl, $signal_name, $filename, $line_num, $bCustomDefaultHandler,
+#                  $bNoDefaultHandler, $bCustomCCallback, $bRefreturn, $ifdef,
+#                  $merge_doxycomment_with_previous, $deprecated, $deprecation_docs)
 sub output_wrap_signal($$$$$$$$$$$)
 {
-  my ($self, $CppDecl, $signal_name, $filename, $line_num, $bCustomDefaultHandler, $bNoDefaultHandler, $bCustomCCallback, $bRefreturn, $ifdef, $merge_doxycomment_with_previous, $deprecated, $deprecation_docs) = @_;
+  my ($self, $CppDecl, $signal_name, $filename, $line_num, $bCustomDefaultHandler,
+      $bNoDefaultHandler, $bCustomCCallback, $bRefreturn, $ifdef,
+      $merge_doxycomment_with_previous, $deprecated, $deprecation_docs) = @_;
 
   #Some checks:
   return if ($self->output_wrap_check($CppDecl, $signal_name,
@@ -1378,15 +1382,20 @@ sub output_wrap_signal($$$$$$$$$$$)
     }
   }
 
-  $objOutputter->output_wrap_sig_decl($filename, $line_num, $objCSignal, $objCppSignal, $signal_name, $bCustomCCallback, $ifdef, $merge_doxycomment_with_previous, $deprecated, $deprecation_docs);
+  $objOutputter->output_wrap_sig_decl($filename, $line_num, $objCSignal, $objCppSignal,
+    $signal_name, $bCustomCCallback, $ifdef, $merge_doxycomment_with_previous,
+    $deprecated, $deprecation_docs);
 
   if($bNoDefaultHandler eq 0)
   {
-    $objOutputter->output_wrap_default_signal_handler_h($filename, $line_num, $objCppSignal, $objCSignal, $ifdef);
+    $objOutputter->output_wrap_default_signal_handler_h($filename, $line_num,
+      $objCppSignal, $objCSignal, $ifdef, $deprecated);
 
     my $bImplement = 1;
     if($bCustomDefaultHandler) { $bImplement = 0; }
-    $objOutputter->output_wrap_default_signal_handler_cc($filename, $line_num, $objCppSignal, $objCSignal, $bImplement, $bCustomCCallback, $bRefreturn, $ifdef);
+    $objOutputter->output_wrap_default_signal_handler_cc($filename, $line_num,
+      $objCppSignal, $objCSignal, $bImplement, $bCustomCCallback, $bRefreturn,
+      $ifdef, $deprecated);
   }
 }
 



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