summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosé Alburquerque <jaalburqu@svn.gnome.org>2012-02-13 17:41:00 -0500
committerJosé Alburquerque <jaalburqu@svn.gnome.org>2012-02-13 17:41:00 -0500
commit274870acdd9baf8b163fd224a6a4f92469796819 (patch)
tree7b2bd86535135047bcac58dbd92c2e36b6032c18
parent63725e9d3e0715f863b14969da2bc7e7abc84fc0 (diff)
downloadglibmm-274870acdd9baf8b163fd224a6a4f92469796819.tar.gz
gmmproc: docs: Convert signal and property names correctly.
* tools/pm/DocsParser.pm (substitute_identifiers): Search for gtk-doc property and signal references and convert them to appropriate C++ names so that they are referenced correctly in the documentation. Bug #668918.
-rw-r--r--ChangeLog10
-rw-r--r--tools/pm/DocsParser.pm20
2 files changed, 30 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index bb3458e5..f74ab31a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2012-02-13 José Alburquerque <jaalburquerque@gmail.com>
+
+ gmmproc: docs: Convert signal and property names correctly.
+
+ * tools/pm/DocsParser.pm (substitute_identifiers): Search for gtk-doc
+ property and signal references and convert them to appropriate C++
+ names so that they are referenced correctly in the documentation.
+
+ Bug #668918.
+
2012-02-08 José Alburquerque <jaalburquerque@gmail.com>
gmmproc: DocsParser.pm (convert_tags_to_doxygen): Correct typo.
diff --git a/tools/pm/DocsParser.pm b/tools/pm/DocsParser.pm
index 5e802422..29d1d1d2 100644
--- a/tools/pm/DocsParser.pm
+++ b/tools/pm/DocsParser.pm
@@ -433,6 +433,26 @@ sub substitute_identifiers($$)
{
# TODO: handle more than one namespace
+ # Convert property names to C++.
+ # The standard (and correct) gtk-doc way of referring to properties.
+ s/(#[A-Z]\w+):([a-z\d-]+)/my $name = "$1::property_$2()"; $name =~ s"-"_"g; "$name";/ge;
+ # This is an incorrect format but widely used so correctly treat as a
+ # property.
+ s/(\s)::([a-z\d-]+)(\s+property)/my $name = "$1property_$2()$3"; $name =~ s"-"_"g; "$name";/ge;
+ # This one catches properties written in the gtk-doc block as for example
+ # '#GtkActivatable::related-action property'. The correct way to write it
+ # would be 'GtkActivatable:related-action' (with a single colon and not
+ # two because the double colons are specifically for signals -- see the
+ # gtk-doc docs:
+ # http://developer.gnome.org/gtk-doc-manual/unstable/documenting_symbols.html.en)
+ # but a few are written with the double colon in the gtk+ docs so this
+ # protects against those errors.
+ s/([A-Z]\w+)::([a-z\d-]+)(\s+property)/my $name = "$1::property_$2()$3"; $name =~ s"-"_"g; "$name";/ge;
+
+ # Convert signal names to C++.
+ s/(^|\s)::([a-z\d-]+)([^:\w]|$)/my $name = "$1signal_$2()$3"; $name =~ s"-"_"g; "$name";/ge;
+ s/(#[A-Z]\w+)::([a-z\d-]+)([^:\w]|$)/my $name = "$1::signal_$2()$3"; $name =~ s"-"_"g; "$name";/ge;
+
s/[#%]([A-Z][a-z]*)([A-Z][A-Za-z]+)\b/$1::$2/g; # type names
s/[#%]([A-Z])([A-Z]*)_([A-Z\d_]+)\b/$1\L$2\E::$3/g; # enum values