[glibmm] gmmproc: Convert all property documentation to C++
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm] gmmproc: Convert all property documentation to C++
- Date: Sun, 17 Sep 2017 08:28:36 +0000 (UTC)
commit efbf6b5f09c1bc172b2482c96136e74aea7c49a8
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date: Sun Sep 17 09:51:33 2017 +0200
gmmproc: Convert all property documentation to C++
Bug 787698
tools/pm/DocsParser.pm | 14 +++++++-------
tools/pm/Output.pm | 5 -----
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 17e7cda..23f9728 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 1a9e671..c35cadf 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 a5fc618..5efca50 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;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]