Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gtkdoc hdr #890

Merged
merged 34 commits into from Mar 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
d8f75b7
doxygen: generate xml too in preparation for gtkdoc generation
kugel- Aug 10, 2015
bfa0946
doxygen: various doxygen-related fixes in preparation for gtkdoc gene…
kugel- Sep 16, 2015
658821d
api: add script to generate {geany,geany-scintilla}-gtkdoc.h
kugel- Aug 10, 2015
7279037
project: change GeanyProject::file_patterns type to GStrv
kugel- Feb 11, 2016
5290f18
Exclude new generated files from VCS
codebrainz Feb 7, 2016
5534e5c
Move globals into main() function
codebrainz Feb 7, 2016
402e771
Use 4-space indentation to follow PEP-8
codebrainz Feb 7, 2016
4f3e32e
Rename global "constant" to follow PEP-8 naming
codebrainz Feb 7, 2016
5a391c7
Replace comments and asserts with doc-comments and doc-tests
codebrainz Feb 7, 2016
8033e26
Remove commented-out code
codebrainz Feb 7, 2016
c0bde0d
Add check for lxml package if Python is enabled
codebrainz Feb 7, 2016
b741ea7
doc: Makefile.am cleanup
kugel- Feb 15, 2016
c35f29a
scripts: gen-api-gtkdoc.py cleanup
kugel- Feb 15, 2016
f2ebd28
doc: gir annotations cleanup
kugel- Feb 15, 2016
607c95e
stash: drop @transfer annotation, not needed for boxed types
kugel- Feb 16, 2016
e9e2ddf
Add an option to control GtkDoc header generation
b4n Feb 18, 2016
240b590
Fix distcheck
b4n Feb 18, 2016
91a8bb6
Don't generate GtkDoc header stuff if GtkDoc header will not be built
b4n Feb 18, 2016
66c3323
Force enable GtkDoc header on distcheck
b4n Feb 18, 2016
3e9eb35
Install python-lxml on Travis for the GtkDoc header generation
b4n Feb 18, 2016
91daa9f
Fix handling of some GtkDoc annotations
b4n Feb 18, 2016
2280ca4
project: fix build with old glib versions
kugel- Feb 20, 2016
7f9129c
Mark private fields as private in the GtkDoc header
b4n Feb 19, 2016
3d51d8f
GeanyFiletypeGroupID shall be gir-only
kugel- Feb 25, 2016
1f53552
Undo removal of "can be NULL" remark
kugel- Feb 25, 2016
d57ca1d
Fix inclusion of spurious `@`s in the GtkDoc header
b4n Feb 27, 2016
2b8cfb3
Use `%NULL`, `%FALSE` and `%TRUE` in the GtkDoc output
b4n Feb 28, 2016
f69c72f
Improve HTML rendition of some annotations
b4n Feb 28, 2016
e4bdf45
Add support for `out` and `optional` GI annotations
b4n Feb 28, 2016
1be0bc7
Mark output parameters as such
b4n Feb 28, 2016
f90da20
Add `@nullable` annotations everywhere
b4n Feb 28, 2016
871c562
Further improve annotations rendition in HTML output
b4n Feb 28, 2016
00f0ce5
PEP8 the GtkDoc header generator script a little
b4n Feb 28, 2016
6f79a94
Add GPL header to GtkDoc header generation script
b4n Feb 28, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -99,6 +99,7 @@ Makefile.in
# /doc/
#-----------------------------------------------------------------------
/doc/Doxyfile
/doc/Doxyfile-gi
/doc/Doxyfile.stamp
/doc/geany.1
/doc/geany.html
Expand All @@ -110,6 +111,8 @@ Makefile.in
/doc/*.tex
/doc/*.toc
/doc/reference
/doc/geany-gtkdoc.h
/doc/xml/

#-----------------------------------------------------------------------
# /tests/
Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -16,6 +16,7 @@ install:
- sudo apt-get install -y python-docutils rst2pdf
# try not to install doxygen-latex because we don't need it and it's huge
- sudo apt-get install -y --no-install-recommends doxygen
- sudo apt-get install -y python-lxml
before_script:
- export CFLAGS="-g -O2 -Werror=pointer-arith -Werror=aggregate-return -Werror=implicit-function-declaration"
script:
Expand Down
4 changes: 3 additions & 1 deletion Makefile.am
Expand Up @@ -5,7 +5,8 @@ SUBDIRS = tagmanager scintilla src plugins icons po doc data tests
AUTOMAKE_OPTIONS = 1.7

ACLOCAL_AMFLAGS = -I m4
AM_DISTCHECK_CONFIGURE_FLAGS = --enable-api-docs --enable-html-docs --enable-pdf-docs
AM_DISTCHECK_CONFIGURE_FLAGS = --enable-api-docs --enable-html-docs --enable-pdf-docs \
--enable-gtkdoc-header

WIN32_BUILD_FILES = \
geany_private.rc \
Expand All @@ -15,6 +16,7 @@ WIN32_BUILD_FILES = \

EXTRA_DIST = \
autogen.sh \
scripts/gen-api-gtkdoc.py \
wscript \
waf \
geany.desktop.in \
Expand Down
1 change: 1 addition & 0 deletions configure.ac
Expand Up @@ -123,6 +123,7 @@ AC_SUBST([pkgdatadir])
# Documentation tools
GEANY_CHECK_DOCUTILS
GEANY_CHECK_DOXYGEN
GEANY_CHECK_GTKDOC_HEADER

# libgeany
GEANY_LIB_INIT
Expand Down
19 changes: 17 additions & 2 deletions doc/Doxyfile.in
Expand Up @@ -247,7 +247,22 @@ ALIASES = "signal=- @ref " \
"endsignalproto=@endcode " \
"signaldesc=" \
"signals=@b Signals: " \
"endsignals= "
"endsignals= " \
"gironly=@internal"

# Apparently Doxygen doesn't seem to like \<type>only without a previous command, so create a no-op
ALIASES += "noop=\if FALSE \endif"
ALIASES += "transfer{1}=\noop \xmlonly <simplesect kind=\"geany:transfer\">\1</simplesect>\endxmlonly \htmlonly <em title=\"Ownership transfer to the caller: \1\">(transfer: \1)</em> \endhtmlonly"
ALIASES += "elementtype{1}=\noop \xmlonly <simplesect kind=\"geany:element-type\">\1</simplesect>\endxmlonly \htmlonly <em title=\"Type of the elements in the container: \1\">(element-type: \1)</em> \endhtmlonly"
ALIASES += "scope{1}=\noop \xmlonly <simplesect kind=\"geany:scope\">\1</simplesect>\endxmlonly \htmlonly <em>(scope: \1)</em> \endhtmlonly"
ALIASES += "girskip=\noop \xmlonly <simplesect kind=\"geany:skip\"></simplesect>\endxmlonly"
ALIASES += "nullable=\noop \xmlonly <simplesect kind=\"geany:nullable\"></simplesect>\endxmlonly"
ALIASES += "out=\noop \xmlonly <simplesect kind=\"geany:out\"></simplesect>\endxmlonly \htmlonly <em title=\"Output parameter\">(out)</em> \endhtmlonly"
ALIASES += "optional=\noop \xmlonly <simplesect kind=\"geany:optional\"></simplesect>\endxmlonly"
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"


# This tag can be used to specify a number of word-keyword mappings (TCL only).
# A mapping has the form "name=value". For example adding "class=itcl::class"
Expand Down Expand Up @@ -834,7 +849,7 @@ RECURSIVE = NO
# Note that relative paths are relative to the directory from which doxygen is
# run.

EXCLUDE =
EXCLUDE = @top_srcdir@/doc/geany-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
Expand Down
41 changes: 39 additions & 2 deletions doc/Makefile.am
Expand Up @@ -102,12 +102,49 @@ doxygen_sources = \
Doxyfile.stamp: Doxyfile $(doxygen_sources)
$(AM_V_GEN)$(DOXYGEN) Doxyfile && echo "" > $@

all-local: Doxyfile.stamp
ALL_LOCAL_TARGETS = Doxyfile.stamp
CLEAN_LOCAL_TARGETS = clean-api-docs-local

clean-local: clean-api-docs-local
clean-api-docs-local:
-rm -rf reference/ Doxyfile.stamp doxygen_*

if ENABLE_GTKDOC_HEADER

# set WARN_IF_UNDOCUMENTED because apparently doxygens warns for undocumented stuff
# in headers (even though it's correctly documented in the corresponding .c file) only
# for xml output
Doxyfile-gi: Doxyfile
$(AM_V_GEN)$(SED) \
-e 's,gironly=@internal,gironly=,' \
-e 's,^\(GENERATE_HTML.*\)YES,\1NO,' \
-e 's,^\(GENERATE_XML.*\)NO,\1YES,' \
-e 's,^\(WARN_IF_UNDOCUMENTED.*\)YES,\1NO,' \
-e 's,^\(SORT_MEMBER_DOCS.*\)YES,\1NO,' \
-e 's,^\(SORT_BRIEF_DOCS.*\)YES,\1NO,' \
$< > $@ || { $(RM) $@ && exit 1; }

# we depend on Doxyfile.stamp not have this run in parallel with it to avoid
# concurrent Doxygen runs, which might overwrite each other's files
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 $@

geany_gtkdocincludedir = $(includedir)/geany/gtkdoc
nodist_geany_gtkdocinclude_HEADERS = geany-gtkdoc.h

ALL_LOCAL_TARGETS += geany-gtkdoc.h
CLEAN_LOCAL_TARGETS += clean-gtkdoc-header-local

clean-gtkdoc-header-local:
-rm -rf xml/ Doxyfile-gi Doxyfile-gi.stamp geany-gtkdoc.h

endif

all-local: $(ALL_LOCAL_TARGETS)
clean-local: $(CLEAN_LOCAL_TARGETS)

endif

uninstall-local:
Expand Down
4 changes: 3 additions & 1 deletion doc/pluginsymbols.c
Expand Up @@ -87,7 +87,9 @@ KeyBindingGroup *plugin_key_group;
* @param dialog The plugin preferences dialog widget - this should only be used to
* connect the @c "response" signal. If settings should be read from the dialog, the
* response will be either @c GTK_RESPONSE_OK or @c GTK_RESPONSE_APPLY.
* @return A container widget holding preference widgets.
*
* @return @transfer{floating} A container widget holding preference widgets.
*
* @note Using @link stash.h Stash @endlink can make implementing preferences easier.
* @see plugin_configure_single(). */
GtkWidget *plugin_configure(GtkDialog *dialog);
Expand Down
42 changes: 42 additions & 0 deletions m4/geany-gtkdoc-header.m4
@@ -0,0 +1,42 @@
AC_DEFUN([_GEANY_CHECK_GTKDOC_HEADER_ERROR],
[
AC_MSG_ERROR([GtkDoc header generation enabled but $1])
])

dnl GEANY_CHECK_GTKDOC_HEADER
dnl checks for GtkDoc header generation requirements and define
dnl ENABLE_GTKDOC_HEADER Automake conditional as appropriate
AC_DEFUN([GEANY_CHECK_GTKDOC_HEADER],
[
AC_REQUIRE([GEANY_CHECK_DOXYGEN])

AC_ARG_ENABLE([gtkdoc-header],
[AS_HELP_STRING([--enable-gtkdoc-header],
[generate the GtkDoc header suitable for GObject introspection [default=auto]])],
[geany_enable_gtkdoc_header="$enableval"],
[geany_enable_gtkdoc_header="auto"])

AS_IF([test "x$geany_enable_gtkdoc_header$geany_with_doxygen" = "xyesno"],
[_GEANY_CHECK_GTKDOC_HEADER_ERROR([Doxygen support not available])],
[test "x$geany_enable_gtkdoc_header" != "xno"],
[
dnl python
AM_PATH_PYTHON([2.7], [have_python=yes], [have_python=no])
dnl lxml module
AS_IF([test "x$have_python" = xyes],
[have_python_and_lxml=yes
AC_MSG_CHECKING([for python lxml package])
AS_IF([$PYTHON -c 'import lxml' 2>&1 >/dev/null],
[have_python_and_lxml=yes],
[have_python_and_lxml=no])
AC_MSG_RESULT([$have_python_and_lxml])],
[have_python_and_lxml=no])
dnl final result
AS_IF([test "x$geany_enable_gtkdoc_header$have_python_and_lxml" = "xyesno"],
[_GEANY_CHECK_GTKDOC_HEADER_ERROR([python or its lxml module not found])],
[geany_enable_gtkdoc_header=yes])
])

AM_CONDITIONAL([ENABLE_GTKDOC_HEADER], [test "x$geany_enable_gtkdoc_header" = "xyes"])
GEANY_STATUS_ADD([Generate GtkDoc header], [$geany_enable_gtkdoc_header])
])