diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2015-02-05 12:28:18 -0500 |
---|---|---|
committer | Stefan Sauer <ensonic@users.sf.net> | 2015-09-22 16:32:26 +0200 |
commit | 1a241708ea6362526d52475527c842cdbae33052 (patch) | |
tree | f6435ab3163c5d7fd3a4684d7b592e0d87d9f57e | |
parent | 769da0942546fa9af8a3ca68b71399bbe6a77afc (diff) | |
download | gtk-doc-1a241708ea6362526d52475527c842cdbae33052.tar.gz |
Ignore standard struct members
https://bugzilla.gnome.org/show_bug.cgi?id=744061
-rw-r--r-- | gtkdoc-common.pl.in | 3 | ||||
-rwxr-xr-x | gtkdoc-mkdb.in | 5 | ||||
-rw-r--r-- | help/manual/C/index.docbook | 10 |
3 files changed, 15 insertions, 3 deletions
diff --git a/gtkdoc-common.pl.in b/gtkdoc-common.pl.in index c6a0403..4747396 100644 --- a/gtkdoc-common.pl.in +++ b/gtkdoc-common.pl.in @@ -120,6 +120,9 @@ sub ParseStructDeclaration { $declaration =~ s@\n\s*//.*?\n@\n@msg; $declaration =~ s@//.*@@g; + # Remove g_iface, parent_instance and parent_class if they are first member + $declaration =~ s/(\{)\s*(\w)+\s+(g_iface|parent_instance|parent_class)\s*;/$1/g; + my @result = (); if ($declaration =~ /^\s*$/) { diff --git a/gtkdoc-mkdb.in b/gtkdoc-mkdb.in index c52e738..4c38aaa 100755 --- a/gtkdoc-mkdb.in +++ b/gtkdoc-mkdb.in @@ -1750,6 +1750,11 @@ EOF } $desc .= "</tbody></tgroup></informaltable>\n</refsect3>\n"; foreach my $field_name (keys %field_descrs) { + # Documenting those standard fields is not required anymore, but + # we don't want to warn if they are documented anyway. + if ($field_name =~ /(g_iface|parent_instance|parent_class)/) { + next; + } &LogWarning (&GetSymbolSourceFile ($symbol), &GetSymbolSourceLine($symbol), "Field description for $symbol"."::"."$field_name is not used from source code comment block."); if ($unused_parameters ne "") { diff --git a/help/manual/C/index.docbook b/help/manual/C/index.docbook index 0e63644..3437abd 100644 --- a/help/manual/C/index.docbook +++ b/help/manual/C/index.docbook @@ -1310,10 +1310,8 @@ foo_signals[FOOBARIZE] = * This is the best widget, ever. */ typedef struct _FooWidget { - /*< private >*/ - GtkWidget parent; + GtkWidget parent_instance; - /*< public >*/ gboolean bar; } FooWidget; ]]></programlisting> @@ -1326,6 +1324,12 @@ typedef struct _FooWidget { </para> <para> + If the first field is "g_iface", "parent_instance" or "parent_class" + it will be considered private automatically and doesn't need to be + mentioned in the comment block. + </para> + + <para> Struct comment blocks can also be used for GObjects and GObjectClasses. It is usually a good idea to add a comment block for a class, if it has vmethods (as this is how they can be documented). For the GObject |