diff options
author | Kjell Ahlstedt <kjell.ahlstedt@bredband.net> | 2014-11-21 14:09:44 +0100 |
---|---|---|
committer | Kjell Ahlstedt <kjell.ahlstedt@bredband.net> | 2014-11-21 14:09:44 +0100 |
commit | 491b05f2a8e503109400e692aee0f5f7da788284 (patch) | |
tree | fd0963b91f741490e836b25c05891021da19bfb7 /tools | |
parent | 983dd287da4b00baedbd04ce0f777c043d93f5b0 (diff) | |
download | glibmm-491b05f2a8e503109400e692aee0f5f7da788284.tar.gz |
gmmproc: _WRAP_GERROR: Add documentation to the generated enum Code
* tools/pm/Output.pm: output_wrap_gerror(): Get the enum documentation from
the docs.xml file.
* tools/m4/gerror.m4: Include the documentation before 'enum Code' in
the generated code.
_WRAP_GERROR was overlooked when José Alburquerque implemented the
documentation of other enums (bug 544694).
Diffstat (limited to 'tools')
-rw-r--r-- | tools/m4/gerror.m4 | 7 | ||||
-rw-r--r-- | tools/pm/Output.pm | 15 |
2 files changed, 17 insertions, 5 deletions
diff --git a/tools/m4/gerror.m4 b/tools/m4/gerror.m4 index f18109f8..a8b8437e 100644 --- a/tools/m4/gerror.m4 +++ b/tools/m4/gerror.m4 @@ -1,7 +1,6 @@ -dnl $Id$ - dnl -dnl _GERROR(PixbufError,GdkPixbufError,GDK_PIXBUF_ERROR,`<enum_value_list>',[NO_GTYPE]) +dnl _GERROR(PixbufError,GdkPixbufError,GDK_PIXBUF_ERROR,`<enum_value_list>',[NO_GTYPE], `<enum_docs>') +dnl $1 $2 $3 $4 $5 $6 dnl m4_define(`_GERROR',`dnl @@ -16,6 +15,8 @@ _POP() class __CPPNAME__ : public Glib::Error { public: + $6 + */ enum Code { $4 diff --git a/tools/pm/Output.pm b/tools/pm/Output.pm index 22af9ef8..05e0fa16 100644 --- a/tools/pm/Output.pm +++ b/tools/pm/Output.pm @@ -759,12 +759,23 @@ sub output_wrap_gerror($$$$$$$) my $no_gtype = ""; my $elements = $objEnum->build_element_list(\@flags, \$no_gtype, " "); - my $str = sprintf("_GERROR(%s,%s,%s,\`%s\',%s)dnl\n", + # Get the enum documentation from the parsed docs. + my $enum_docs = + DocsParser::lookup_enum_documentation("$c_enum", "Code", \@flags); + + # Make sure indentation of enum documentation is correct. + $enum_docs =~ s/\n\s*\*/\n \*/g; + + # Prevent Doxygen from auto-linking to a class called Error. + $enum_docs =~ s/([^%])(Error code)/$1%$2/g; + + my $str = sprintf("_GERROR(%s,%s,%s,\`%s\',%s,\`%s\')dnl\n", $cpp_type, $c_enum, $domain, $elements, - $no_gtype + $no_gtype, + $enum_docs ); $self->append($str); |