diff options
author | Johan Dahlin <jdahlin@async.com.br> | 2009-01-13 21:13:00 +0000 |
---|---|---|
committer | Johan Dahlin <johan@src.gnome.org> | 2009-01-13 21:13:00 +0000 |
commit | 4eda1cb480808442a2840219c99cc93ee949a7a5 (patch) | |
tree | c0e724f076f3f3ecb56a5df60ecc0a69df765a87 /giscanner/girwriter.py | |
parent | 0d792f2b62d4f3d5b1045198cb02beabbc8d9fec (diff) | |
download | gobject-introspection-4eda1cb480808442a2840219c99cc93ee949a7a5.tar.gz |
Bug 555036 – put gtk-doc in GIR
2009-01-13 Johan Dahlin <jdahlin@async.com.br>
Bug 555036 – put gtk-doc in GIR
* giscanner/annotationparser.py:
* giscanner/ast.py:
* giscanner/girwriter.py:
* giscanner/glibast.py:
* tests/scanner/annotation-1.0-expected.gir:
* tests/scanner/annotation.h:
* tests/scanner/foo-1.0-expected.gir:
svn path=/trunk/; revision=1032
Diffstat (limited to 'giscanner/girwriter.py')
-rw-r--r-- | giscanner/girwriter.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/giscanner/girwriter.py b/giscanner/girwriter.py index e72b0289..a5d1637a 100644 --- a/giscanner/girwriter.py +++ b/giscanner/girwriter.py @@ -119,6 +119,8 @@ class GIRWriter(XMLWriter): def _write_function(self, func, tag_name='function'): attrs = [('name', func.name), ('c:identifier', func.symbol)] + if func.doc: + attrs.append(('doc', func.doc)) self._append_version(func, attrs) self._append_deprecated(func, attrs) self._append_throws(func, attrs) @@ -143,6 +145,8 @@ class GIRWriter(XMLWriter): attrs = [] attrs.append(('transfer-ownership', return_.transfer)) + if return_.doc: + attrs.append(('doc', return_.doc)) with self.tagcontext('return-value', attrs): self._write_type(return_.type) @@ -171,6 +175,8 @@ class GIRWriter(XMLWriter): attrs.append(('closure', '%d' % parameter.closure_index)) if parameter.destroy_index >= 0: attrs.append(('destroy', '%d' % parameter.destroy_index)) + if parameter.doc: + attrs.append(('doc', parameter.doc)) with self.tagcontext('parameter', attrs): self._write_type(parameter.type) @@ -222,6 +228,8 @@ class GIRWriter(XMLWriter): def _write_enum(self, enum): attrs = [('name', enum.name)] + if enum.doc: + attrs.append(('doc', enum.doc)) self._append_version(enum, attrs) self._append_deprecated(enum, attrs) if isinstance(enum, GLibEnum): @@ -236,6 +244,8 @@ class GIRWriter(XMLWriter): def _write_bitfield(self, bitfield): attrs = [('name', bitfield.name)] + if bitfield.doc: + attrs.append(('doc', bitfield.doc)) self._append_version(bitfield, attrs) self._append_deprecated(bitfield, attrs) if isinstance(bitfield, GLibFlags): @@ -265,6 +275,8 @@ class GIRWriter(XMLWriter): def _write_class(self, node): attrs = [('name', node.name), ('c:type', node.ctype)] + if node.doc: + attrs.append(('doc', node.doc)) self._append_version(node, attrs) self._append_deprecated(node, attrs) if isinstance(node, Class): @@ -303,6 +315,8 @@ class GIRWriter(XMLWriter): def _write_boxed(self, boxed): attrs = [('c:type', boxed.ctype), ('glib:name', boxed.name)] + if boxed.doc: + attrs.append(('doc', boxed.doc)) attrs.extend(self._boxed_attrs(boxed)) with self.tagcontext('glib:boxed', attrs): self._write_boxed_ctors_methods(boxed) @@ -320,12 +334,16 @@ class GIRWriter(XMLWriter): attrs.append(('construct', '1')) if prop.construct_only: attrs.append(('construct-only', '1')) + if prop.doc: + attrs.append(('doc', prop.doc)) with self.tagcontext('property', attrs): self._write_type(prop.type) def _write_callback(self, callback): # FIXME: reuse _write_function attrs = [('name', callback.name), ('c:type', callback.ctype)] + if callback.doc: + attrs.append(('doc', callback.doc)) self._append_version(callback, attrs) self._append_deprecated(callback, attrs) self._append_throws(callback, attrs) @@ -348,6 +366,8 @@ class GIRWriter(XMLWriter): ('c:type', record.symbol)] if record.disguised: attrs.append(('disguised', '1')) + if record.doc: + attrs.append(('doc', record.doc)) self._append_version(record, attrs) self._append_deprecated(record, attrs) if isinstance(record, GLibBoxed): @@ -362,6 +382,8 @@ class GIRWriter(XMLWriter): def _write_union(self, union): attrs = [('name', union.name), ('c:type', union.symbol)] + if union.doc: + attrs.append(('doc', union.doc)) self._append_version(union, attrs) self._append_deprecated(union, attrs) if isinstance(union, GLibBoxed): @@ -396,6 +418,8 @@ class GIRWriter(XMLWriter): def _write_signal(self, signal): attrs = [('name', signal.name)] + if signal.doc: + attrs.append(('doc', signal.doc)) self._append_version(signal, attrs) self._append_deprecated(signal, attrs) with self.tagcontext('glib:signal', attrs): |