[gtk-doc] Don't pad out the signal examples



commit 9d1ef738565c74391a4528c6facaaf174e9a6740
Author: William Jon McCann <william jon mccann gmail com>
Date:   Wed Feb 12 13:52:40 2014 -0500

    Don't pad out the signal examples

 gtkdoc-mkdb.in |   22 ++++++++--------------
 1 files changed, 8 insertions(+), 14 deletions(-)
---
diff --git a/gtkdoc-mkdb.in b/gtkdoc-mkdb.in
index 0096fa1..4b461d7 100755
--- a/gtkdoc-mkdb.in
+++ b/gtkdoc-mkdb.in
@@ -3528,8 +3528,6 @@ sub GetSignals {
             my $symbol = "${object}::${name}";
             my $id = &CreateValidSGMLID ("$object-$name");
 
-            my $pad = ' ' x (46 - length($name));
-
             $desc .= "<refsect2 id=\"$id\" role=\"signal\"><title>The <literal>“$name”</literal> 
signal</title>\n";
             $desc .= MakeIndexterms($symbol, $id);
             $desc .= "\n";
@@ -3543,12 +3541,12 @@ sub GetSignals {
             my $pointer = $3;
             my $xref = &MakeXRef ($type, &tagify($type, "returnvalue"));
 
-            my $ret_type_len = length ($type_modifier) + length ($pointer)
-                + length ($type);
-            my $ret_type_output = "$type_modifier$xref$pointer"
-                . (' ' x ($RETURN_TYPE_FIELD_WIDTH - $ret_type_len));
+            my $ret_type_output = "$type_modifier$xref$pointer";
+            my $callback_name = "user_function";
+            $desc  .= "${ret_type_output}\n${callback_name} (";
 
-            $desc  .= "${ret_type_output}user_function " . &MakeReturnField("") . " (";
+            my $indentation = ' ' x (length($callback_name) + 2);
+            my $pad = $indentation;
 
             my $sourceparams = $SourceSymbolParams{$symbol};
             my @params = split ("\n", $SignalPrototypes[$i]);
@@ -3585,7 +3583,7 @@ sub GetSignals {
                             $xref = &MakeXRef ($type, &tagify($type, "type"));
                             $pad = ' ' x ($type_len - length($type) - length($pointer));
                             $desc .= "$xref$pad $pointer${param_name},\n";
-                            $desc .= (' ' x ($SYMBOL_FIELD_WIDTH + $RETURN_TYPE_FIELD_WIDTH));
+                            $desc .= $indentation;
                         }
                     } else {
                         &LogWarning (&GetSymbolSourceFile ($symbol), &GetSymbolSourceLine($symbol),
@@ -3629,14 +3627,10 @@ sub GetSignals {
               }
             }
 
+            $desc  .= "</programlisting>\n";
             if ($flags_string)
               {
-                $pad = ' ' x (5 + $name_len - length("user_data"));
-                $desc  .= "$pad : $flags_string</programlisting>\n";
-              }
-            else
-              {
-                $desc  .= "</programlisting>\n";
+                $desc  .= "<para>Flags: $flags_string</para>\n";
               }
 
             $synop .= "<row><entry role=\"signal_type\">${ret_type_output}</entry><entry 
role=\"signal_name\"><link linkend=\"$id\">${name}</link></entry><entry 
role=\"signal_flags\">${flags_string}</entry></row>\n";


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