diff --git a/.gitignore b/.gitignore index ec701cbe..61c602a2 100644 --- a/.gitignore +++ b/.gitignore @@ -112,6 +112,7 @@ Makefile.in /doc/*.toc /doc/reference /doc/geany-gtkdoc.h +/doc/geany-sciwrappers-gtkdoc.h /doc/xml/ #----------------------------------------------------------------------- diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in index e7abe324..6d83977a 100644 --- a/doc/Doxyfile.in +++ b/doc/Doxyfile.in @@ -850,7 +850,8 @@ RECURSIVE = NO # Note that relative paths are relative to the directory from which doxygen is # run. -EXCLUDE = @top_srcdir@/doc/geany-gtkdoc.h +EXCLUDE = @top_srcdir@/doc/geany-gtkdoc.h \ + @top_srcdir@/doc/geany-sciwrappers-gtkdoc.h # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded diff --git a/doc/Makefile.am b/doc/Makefile.am index c3b07ab8..3c57960c 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -129,16 +129,19 @@ Doxyfile-gi.stamp: Doxyfile-gi Doxyfile.stamp $(doxygen_sources) $(AM_V_GEN)$(DOXYGEN) Doxyfile-gi && echo "" > $@ geany-gtkdoc.h: Doxyfile-gi.stamp $(top_srcdir)/scripts/gen-api-gtkdoc.py - $(AM_V_GEN)$(top_srcdir)/scripts/gen-api-gtkdoc.py xml -d $(builddir) -o $@ + $(AM_V_GEN)$(top_srcdir)/scripts/gen-api-gtkdoc.py xml -d $(builddir) -o $@ \ + --sci-output geany-sciwrappers-gtkdoc.h + +geany-sciwrappers-gtkdoc.h: geany-gtkdoc.h geany_gtkdocincludedir = $(includedir)/geany/gtkdoc -nodist_geany_gtkdocinclude_HEADERS = geany-gtkdoc.h +nodist_geany_gtkdocinclude_HEADERS = geany-gtkdoc.h geany-sciwrappers-gtkdoc.h -ALL_LOCAL_TARGETS += geany-gtkdoc.h +ALL_LOCAL_TARGETS += geany-gtkdoc.h geany-sciwrappers-gtkdoc.h CLEAN_LOCAL_TARGETS += clean-gtkdoc-header-local clean-gtkdoc-header-local: - -rm -rf xml/ Doxyfile-gi Doxyfile-gi.stamp geany-gtkdoc.h + -rm -rf xml/ Doxyfile-gi Doxyfile-gi.stamp geany-gtkdoc.h geany-sciwrappers-gtkdoc.h endif diff --git a/scripts/gen-api-gtkdoc.py b/scripts/gen-api-gtkdoc.py index d3ae4ef7..0acaa98e 100755 --- a/scripts/gen-api-gtkdoc.py +++ b/scripts/gen-api-gtkdoc.py @@ -341,6 +341,7 @@ class DoxyFunction(DoxyElement): def main(args): xml_dir = None outfile = None + scioutfile = None parser = OptionParser(usage="usage: %prog [options] XML_DIR") parser.add_option("--xmldir", metavar="DIRECTORY", help="Path to Doxygen-generated XML files", @@ -349,6 +350,8 @@ def main(args): action="store", dest="outdir", default=".") parser.add_option("-o", "--output", metavar="FILE", help="Write output to FILE", action="store", dest="outfile") + parser.add_option("--sci-output", metavar="FILE", help="Write output to FILE (only sciwrappers)", + action="store", dest="scioutfile") opts, args = parser.parse_args(args[1:]) xml_dir = args[0] @@ -397,11 +400,25 @@ def main(args): else: outfile = sys.stdout + if (opts.scioutfile): + try: + scioutfile = open(opts.scioutfile, "w+") + except OSError as err: + sys.stderr.write("failed to open \"%s\" for writing (%s)\n" % (opts.scioutfile, err.strerror)) + return 1 + else: + scioutfile = outfile + try: outfile.write("/*\n * Automatically generated file - do not edit\n */\n\n") outfile.write("#include \"gtkcompat.h\"\n") outfile.write("#include \"Scintilla.h\"\n") outfile.write("#include \"ScintillaWidget.h\"\n") + if (scioutfile != outfile): + scioutfile.write("/*\n * Automatically generated file - do not edit\n */\n\n") + scioutfile.write("#include \"gtkcompat.h\"\n") + scioutfile.write("#include \"Scintilla.h\"\n") + scioutfile.write("#include \"ScintillaWidget.h\"\n") # write enums first, so typedefs to them are valid (as forward enum declaration # is invalid). It's fine as an enum can't contain reference to other types. @@ -423,6 +440,13 @@ def main(args): outfile.write(e.to_gtkdoc()) outfile.write(e.definition) outfile.write("\n\n") + if (e.name.startswith("sci_")): + if (scioutfile != outfile): + scioutfile.write("\n\n") + scioutfile.write(e.to_gtkdoc()) + scioutfile.write(e.definition) + scioutfile.write("\n\n") + except BrokenPipeError: # probably piped to head or tail return 0