diff options
author | Kjell Ahlstedt <kjellahlstedt@gmail.com> | 2017-09-17 09:51:33 +0200 |
---|---|---|
committer | Kjell Ahlstedt <kjellahlstedt@gmail.com> | 2017-09-17 09:51:33 +0200 |
commit | efbf6b5f09c1bc172b2482c96136e74aea7c49a8 (patch) | |
tree | df22b617e92d1d2df31f5e116b3412fbcfc07ed2 /tools/pm | |
parent | d69d1bb407d420e8c3c3f52c520c8bc889dc31cf (diff) | |
download | glibmm-efbf6b5f09c1bc172b2482c96136e74aea7c49a8.tar.gz |
gmmproc: Convert all property documentation to C++
Bug 787698
Diffstat (limited to 'tools/pm')
-rw-r--r-- | tools/pm/DocsParser.pm | 14 | ||||
-rw-r--r-- | tools/pm/Output.pm | 5 | ||||
-rw-r--r-- | tools/pm/Property.pm | 8 |
3 files changed, 15 insertions, 12 deletions
diff --git a/tools/pm/DocsParser.pm b/tools/pm/DocsParser.pm index 17e7cda1..23f97282 100644 --- a/tools/pm/DocsParser.pm +++ b/tools/pm/DocsParser.pm @@ -300,7 +300,7 @@ sub lookup_enum_documentation($$$$$$$) # Replace @newin in the enum description, but don't in the element descriptions. my $description = "\@enum $cpp_enum_name\n"; $description .= $$objFunction{description}; - DocsParser::convert_docs_to_cpp($objFunction, \$description); + DocsParser::convert_docs_to_cpp($c_enum_name, \$description); DocsParser::replace_or_add_newin(\$description, $newin); # Add note about deprecation if we have specified that in our _WRAP_ENUM(), @@ -311,7 +311,7 @@ sub lookup_enum_documentation($$$$$$$) } # Append the enum description docs. - DocsParser::convert_docs_to_cpp($objFunction, \$docs); + DocsParser::convert_docs_to_cpp($c_enum_name, \$docs); $docs .= "\n\n$description"; DocsParser::add_m4_quotes(\$docs); @@ -350,7 +350,7 @@ sub lookup_documentation($$$;$) print "DocsParser.pm: Warning: No C docs for: \"$functionName\"\n"; } - DocsParser::convert_docs_to_cpp($objFunction, \$text); + DocsParser::convert_docs_to_cpp($functionName, \$text); DocsParser::replace_or_add_newin(\$text, $newin); # A blank line, marking the end of a paragraph, is needed after @newin. # Most @newins are at the end of a function description. @@ -569,7 +569,7 @@ sub append_parameter_docs($$;$) $param_name_mappings{$param} = "slot"; } - DocsParser::convert_docs_to_cpp($obj_function, \$desc); + DocsParser::convert_docs_to_cpp($$obj_function{name}, \$desc); if(length($desc) > 0) { $desc .= '.' unless($desc =~ /(?:^|\.)$/); @@ -585,7 +585,7 @@ sub append_return_docs($$) my ($obj_function, $text) = @_; my $desc = $$obj_function{return_description}; - DocsParser::convert_docs_to_cpp($obj_function, \$desc); + DocsParser::convert_docs_to_cpp($$obj_function{name}, \$desc); $desc =~ s/\.$//; $$text .= "\n\@return \u${desc}." unless($desc eq ""); @@ -594,7 +594,7 @@ sub append_return_docs($$) sub convert_docs_to_cpp($$) { - my ($obj_function, $text) = @_; + my ($doc_func, $text) = @_; # Chop off leading and trailing whitespace. $$text =~ s/^\s+//; @@ -603,7 +603,7 @@ sub convert_docs_to_cpp($$) # Convert C documentation to C++. DocsParser::remove_c_memory_handling_info($text); DocsParser::convert_tags_to_doxygen($text); - DocsParser::substitute_identifiers($$obj_function{name}, $text); + DocsParser::substitute_identifiers($doc_func, $text); $$text =~ s/\bX\s+Window\b/X \%Window/g; $$text =~ s/\bWindow\s+manager/\%Window manager/g; diff --git a/tools/pm/Output.pm b/tools/pm/Output.pm index 1a9e671b..c35cadf7 100644 --- a/tools/pm/Output.pm +++ b/tools/pm/Output.pm @@ -921,7 +921,6 @@ sub output_wrap_any_property($$$$$$$$$$) my $objdoc = $objProperty->get_docs("", ""); if ($objdoc ne "") { - add_m4_quotes(\$objdoc); $documentation = "$objdoc\n *\n * $documentation"; } } @@ -929,10 +928,6 @@ sub output_wrap_any_property($$$$$$$$$$) { # Try to get the (usually short) documentation from the Property object. $documentation = $objProperty->get_docs($deprecation_docs, $newin); - if ($documentation ne "") - { - add_m4_quotes(\$documentation); - } } # Default value, if available: diff --git a/tools/pm/Property.pm b/tools/pm/Property.pm index a5fc6184..5efca500 100644 --- a/tools/pm/Property.pm +++ b/tools/pm/Property.pm @@ -2,6 +2,7 @@ package Property; use strict; use warnings; +use DocsParser; BEGIN { use Exporter (); @@ -131,6 +132,8 @@ sub get_docs($$) my ($self, $deprecation_docs, $newin) = @_; my $text = $$self{docs}; + DocsParser::convert_docs_to_cpp("$$self{class}:$$self{name}", \$text); + #Add note about deprecation if we have specified that in our _WRAP_PROPERTY() #or_WRAP_CHILD_PROPERTY() call: if($deprecation_docs ne "") @@ -143,6 +146,11 @@ sub get_docs($$) $text .= "\n *\n * \@newin{$newin}"; } + if ($text ne "") + { + DocsParser::add_m4_quotes(\$text); + } + return $text; } |