gtkdoc: add support for array annotions

We can now use @array and @arraylen{param} annotations for arrays that
will make it to the generated gtkdoc header.

g-ir-scanner cannot properly parse 'gchar **' parameters without this.
This commit is contained in:
Thomas Martitz 2017-03-23 22:12:39 +01:00
parent b116a66862
commit 3512f6cc74
2 changed files with 7 additions and 2 deletions

View File

@ -262,6 +262,8 @@ ALIASES += "optional=\noop \xmlonly <simplesect kind=\"geany:optio
ALIASES += "cb=\noop \xmlonly <simplesect kind=\"geany:scope\">notified</simplesect>\endxmlonly"
ALIASES += "cbdata=\noop \xmlonly <simplesect kind=\"geany:closure\"></simplesect>\endxmlonly"
ALIASES += "cbfree=\noop \xmlonly <simplesect kind=\"geany:destroy\"></simplesect>\endxmlonly"
ALIASES += "array=\noop \xmlonly <simplesect kind=\"geany:array\"></simplesect>\endxmlonly"
ALIASES += "arraylen{1}=\noop \xmlonly <simplesect kind=\"geany:array\">length=\1</simplesect>\endxmlonly"
# This tag can be used to specify a number of word-keyword mappings (TCL only).

View File

@ -75,10 +75,13 @@ class AtDoc(object):
"geany:closure",
"geany:destroy"):
self.annot.append(type.split(":")[1])
elif type in ("geany:transfer",
elif type in ("geany:array",
"geany:transfer",
"geany:element-type",
"geany:scope"):
type = type.split(":")[1]
if len(str):
str = " " + str
self.annot.append("%s%s" % (type, str))
elif (type == "see"):
return "See " + str