Merge lp:~noskcaj/ubuntu/trusty/gtk-doc/1.20 into lp:ubuntu/trusty/gtk-doc

Proposed by Jackson Doak
Status: Merged
Merge reported by: Iain Lane
Merged at revision: not available
Proposed branch: lp:~noskcaj/ubuntu/trusty/gtk-doc/1.20
Merge into: lp:ubuntu/trusty/gtk-doc
Diff against target: 34087 lines (+17101/-5168)
96 files modified
Makefile.am (+9/-18)
Makefile.in (+16/-22)
NEWS (+74/-0)
TODO (+24/-5)
acinclude.m4 (+0/-55)
aclocal.m4 (+2/-1)
configure (+115/-60)
configure.ac (+24/-2)
debian/changelog (+14/-0)
examples/Makefile.am (+1/-1)
gtk-doc.dsl (+464/-0)
gtk-doc.dsl.in (+8/-8)
gtk-doc.flat.make (+27/-14)
gtk-doc.m4 (+32/-15)
gtk-doc.make (+27/-14)
gtk-doc.notmpl-flat.make (+24/-11)
gtk-doc.notmpl.make (+24/-11)
gtk-doc.pc.in (+1/-1)
gtk-doc.spec (+1/-1)
gtk-doc.xsl (+168/-198)
gtkdoc-common.pl (+543/-0)
gtkdoc-fixxref.in (+2/-2)
gtkdoc-mkdb.in (+1296/-495)
gtkdoc-mkhtml.in (+4/-3)
gtkdoc-scan.in (+87/-38)
gtkdoc-scangobj.in (+5/-5)
gtkdocize.in (+35/-7)
help/Makefile.in (+7/-4)
help/manual/C/index.docbook (+149/-37)
help/manual/Makefile.am (+3/-1)
help/manual/Makefile.in (+9/-6)
help/manual/bn_IN/index.docbook (+146/-34)
help/manual/de/de.po (+1382/-1158)
help/manual/de/fdl-appendix.xml (+29/-227)
help/manual/de/index.docbook (+258/-401)
help/manual/el/el.po (+1080/-750)
help/manual/el/index.docbook (+169/-38)
help/manual/en_GB/index.docbook (+152/-35)
help/manual/es/es.po (+1300/-778)
help/manual/es/index.docbook (+109/-39)
help/manual/fr/index.docbook (+163/-27)
help/manual/gu/index.docbook (+151/-34)
help/manual/pt_BR/fdl-appendix.xml (+233/-0)
help/manual/pt_BR/index.docbook (+1529/-0)
help/manual/pt_BR/pt_BR.po (+5360/-0)
help/manual/sl/index.docbook (+147/-35)
help/manual/sv/index.docbook (+147/-35)
help/manual/ta/index.docbook (+151/-34)
help/manual/te/index.docbook (+151/-34)
help/manual/zh_CN/index.docbook (+165/-38)
m4/gtkdoc_jh_check_xml_catalog.m4 (+16/-0)
m4/gtkdoc_jh_path_xml_catalog.m4 (+61/-0)
style.css (+0/-266)
style/style.css (+461/-0)
tests/Makefile.am (+2/-0)
tests/Makefile.in (+9/-4)
tests/annotations/Makefile.in (+7/-4)
tests/annotations/docs/Makefile.in (+21/-15)
tests/annotations/docs/tester-sections.txt (+1/-0)
tests/annotations/src/Makefile.in (+7/-4)
tests/annotations/src/tester.c (+10/-0)
tests/annotations/src/tester.h (+2/-0)
tests/bugs/Makefile.in (+7/-4)
tests/bugs/docs/Makefile.am (+1/-1)
tests/bugs/docs/Makefile.in (+22/-16)
tests/bugs/docs/tester-sections.txt (+3/-0)
tests/bugs/src/Makefile.in (+7/-4)
tests/bugs/src/tester.c (+30/-0)
tests/bugs/src/tester.h (+8/-0)
tests/empty.sh (+5/-0)
tests/empty/Makefile.in (+7/-4)
tests/empty/docs/Makefile.in (+21/-15)
tests/empty/docs/tester-sections.txt (+3/-0)
tests/empty/src/Makefile.in (+7/-4)
tests/empty/src/tester.c (+12/-0)
tests/empty/src/tester.h (+10/-0)
tests/fail/Makefile.in (+7/-4)
tests/fail/docs/Makefile.in (+21/-15)
tests/fail/src/Makefile.in (+7/-4)
tests/gobject/Makefile.in (+7/-4)
tests/gobject/docs-tmpl/Makefile.in (+24/-18)
tests/gobject/docs-tmpl/tester-docs.xml (+1/-0)
tests/gobject/docs-tmpl/tester-sections.txt (+13/-0)
tests/gobject/docs/Makefile.in (+21/-15)
tests/gobject/docs/tester-docs.xml (+1/-0)
tests/gobject/docs/tester-sections.txt (+13/-0)
tests/gobject/docs/tester.types (+2/-0)
tests/gobject/src/Makefile.in (+7/-4)
tests/gobject/src/gobject.c (+143/-4)
tests/gobject/src/gobject.h (+15/-0)
tests/gobject/src/gtypes.c (+13/-0)
tests/gobject/src/gtypes.h (+14/-0)
tests/gtk-doc.make (+17/-14)
tests/gtk-doc.notmpl.make (+14/-11)
tests/gtkdoctest.sh (+2/-1)
tests/sanity.sh (+2/-1)
To merge this branch: bzr merge lp:~noskcaj/ubuntu/trusty/gtk-doc/1.20
Reviewer Review Type Date Requested Status
Iain Lane Approve
Review via email: mp+206807@code.launchpad.net

Description of the change

Merge from debian

To post a comment you must log in.
Revision history for this message
Iain Lane (laney) wrote :

Just did this myself, then I thought about checking the queue & I saw your one here. Uploaded!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Makefile.am'
--- Makefile.am 2013-12-19 07:58:53 +0000
+++ Makefile.am 2014-02-17 20:15:47 +0000
@@ -34,11 +34,14 @@
34 gtk-doc.notmpl.make \34 gtk-doc.notmpl.make \
35 gtk-doc.flat.make \35 gtk-doc.flat.make \
36 gtk-doc.notmpl-flat.make \36 gtk-doc.notmpl-flat.make \
37 home.png \37 style/home.png \
38 left.png \38 style/left.png \
39 right.png \39 style/left-insensitive.png \
40 up.png \40 style/right.png \
41 style.css41 style/right-insensitive.png \
42 style/up.png \
43 style/up-insensitive.png \
44 style/style.css
4245
43pkgconfigdir = $(datadir)/pkgconfig46pkgconfigdir = $(datadir)/pkgconfig
44pkgconfig_DATA = gtk-doc.pc47pkgconfig_DATA = gtk-doc.pc
@@ -57,25 +60,14 @@
5760
58EXTRA_DIST = \61EXTRA_DIST = \
59 MAINTAINERS \62 MAINTAINERS \
63 $(gtkdocdata_DATA) \
60 gtk-doc.pc.in \64 gtk-doc.pc.in \
61 gtk-doc.m4 \65 gtk-doc.m4 \
62 gtk-doc.make \
63 gtk-doc.notmpl.make \
64 gtk-doc.flat.make \
65 gtk-doc.notmpl-flat.make \
66 gtk-doc.doap \66 gtk-doc.doap \
67 gtk-doc.spec.in \67 gtk-doc.spec.in \
68 gtk-doc.spec \68 gtk-doc.spec \
69 gtk-doc.dcl \
70 gtk-doc.xsl \
71 gtk-doc-fo.xsl \69 gtk-doc-fo.xsl \
72 version-greater-or-equal.xsl \
73 devhelp2.xsl \
74 gtk-doc.cat.in \70 gtk-doc.cat.in \
75 home.png \
76 left.png \
77 right.png \
78 up.png \
79 doc/README \71 doc/README \
80 doc/authors.txt \72 doc/authors.txt \
81 doc/gnome.txt \73 doc/gnome.txt \
@@ -89,7 +81,6 @@
89 examples/Makefile.am \81 examples/Makefile.am \
90 tools/docpercentages.pl \82 tools/docpercentages.pl \
91 tools/gtk-doc.el \83 tools/gtk-doc.el \
92 style.css \
93 COPYING-DOCS84 COPYING-DOCS
9485
95MAINTAINERCLEANFILES = \86MAINTAINERCLEANFILES = \
9687
=== modified file 'Makefile.in'
--- Makefile.in 2013-12-19 07:58:53 +0000
+++ Makefile.in 2014-02-17 20:15:47 +0000
@@ -54,10 +54,11 @@
54 build-aux/config.sub build-aux/depcomp build-aux/install-sh \54 build-aux/config.sub build-aux/depcomp build-aux/install-sh \
55 build-aux/ltmain.sh build-aux/missing55 build-aux/ltmain.sh build-aux/missing
56ACLOCAL_M4 = $(top_srcdir)/aclocal.m456ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
57am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \57am__aclocal_m4_deps = $(top_srcdir)/m4/gtkdoc_jh_check_xml_catalog.m4 \
58 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \58 $(top_srcdir)/m4/gtkdoc_jh_path_xml_catalog.m4 \
59 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \59 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
60 $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac60 $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
61 $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
61am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \62am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
62 $(ACLOCAL_M4)63 $(ACLOCAL_M4)
63am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \64am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
@@ -179,6 +180,7 @@
179CPP = @CPP@180CPP = @CPP@
180CPPFLAGS = @CPPFLAGS@181CPPFLAGS = @CPPFLAGS@
181CYGPATH_W = @CYGPATH_W@182CYGPATH_W = @CYGPATH_W@
183DATE_FMT_CMD = @DATE_FMT_CMD@
182DBLATEX = @DBLATEX@184DBLATEX = @DBLATEX@
183DEFS = @DEFS@185DEFS = @DEFS@
184DEPDIR = @DEPDIR@186DEPDIR = @DEPDIR@
@@ -189,6 +191,7 @@
189ECHO_N = @ECHO_N@191ECHO_N = @ECHO_N@
190ECHO_T = @ECHO_T@192ECHO_T = @ECHO_T@
191EGREP = @EGREP@193EGREP = @EGREP@
194ELAPSED_FMT = @ELAPSED_FMT@
192EXEEXT = @EXEEXT@195EXEEXT = @EXEEXT@
193FGREP = @FGREP@196FGREP = @FGREP@
194FOP = @FOP@197FOP = @FOP@
@@ -329,11 +332,14 @@
329 gtk-doc.notmpl.make \332 gtk-doc.notmpl.make \
330 gtk-doc.flat.make \333 gtk-doc.flat.make \
331 gtk-doc.notmpl-flat.make \334 gtk-doc.notmpl-flat.make \
332 home.png \335 style/home.png \
333 left.png \336 style/left.png \
334 right.png \337 style/left-insensitive.png \
335 up.png \338 style/right.png \
336 style.css339 style/right-insensitive.png \
340 style/up.png \
341 style/up-insensitive.png \
342 style/style.css
337343
338pkgconfigdir = $(datadir)/pkgconfig344pkgconfigdir = $(datadir)/pkgconfig
339pkgconfig_DATA = gtk-doc.pc345pkgconfig_DATA = gtk-doc.pc
@@ -343,25 +349,14 @@
343sgml_DATA = gtk-doc.cat349sgml_DATA = gtk-doc.cat
344EXTRA_DIST = \350EXTRA_DIST = \
345 MAINTAINERS \351 MAINTAINERS \
352 $(gtkdocdata_DATA) \
346 gtk-doc.pc.in \353 gtk-doc.pc.in \
347 gtk-doc.m4 \354 gtk-doc.m4 \
348 gtk-doc.make \
349 gtk-doc.notmpl.make \
350 gtk-doc.flat.make \
351 gtk-doc.notmpl-flat.make \
352 gtk-doc.doap \355 gtk-doc.doap \
353 gtk-doc.spec.in \356 gtk-doc.spec.in \
354 gtk-doc.spec \357 gtk-doc.spec \
355 gtk-doc.dcl \
356 gtk-doc.xsl \
357 gtk-doc-fo.xsl \358 gtk-doc-fo.xsl \
358 version-greater-or-equal.xsl \
359 devhelp2.xsl \
360 gtk-doc.cat.in \359 gtk-doc.cat.in \
361 home.png \
362 left.png \
363 right.png \
364 up.png \
365 doc/README \360 doc/README \
366 doc/authors.txt \361 doc/authors.txt \
367 doc/gnome.txt \362 doc/gnome.txt \
@@ -375,7 +370,6 @@
375 examples/Makefile.am \370 examples/Makefile.am \
376 tools/docpercentages.pl \371 tools/docpercentages.pl \
377 tools/gtk-doc.el \372 tools/gtk-doc.el \
378 style.css \
379 COPYING-DOCS373 COPYING-DOCS
380374
381MAINTAINERCLEANFILES = \375MAINTAINERCLEANFILES = \
382376
=== modified file 'NEWS'
--- NEWS 2013-12-19 07:58:53 +0000
+++ NEWS 2014-02-17 20:15:47 +0000
@@ -1,3 +1,77 @@
1GTK-Doc 1.20 (Feb 16 2014)
2============
3
4 Important notice - starting with the next release these long deprecated
5 features will be removed, please write to gtk-doc-list@gnome.org and tell us
6 your concerns:
7 o gtkdoc-scanobj (only used for gtkobject)
8 o return values need to be documented using "Returns:". We will remove the
9 heuristic that turns a paragraph starting with "Returns " into return docs.
10 o gtkdoc-mktmpl - please move all the comments into the sources.
11 o generating html via sgml tools (jade/openjade), using xsltproc and
12 docbook-xslt is pretty common and preferred since version 1.6
13
14 Changes
15
16 o 605537 : Returns: listed among parameters
17 o 624001 : Support attribute-based method to deprecate symbols
18 o 662424 : Class hierarchy about interfaces not generated by default
19 o 665926 : should not have to document object structures
20 o 666509 : Specifying --enable-gtk-doc should not be required to build source packages
21 o 669417 : Duplicate IDs generated for unions registered as boxed types
22 o 671519 : Self-test relies on nonportable (GNU enhanced) 'date' command
23 o 692367 : gtkdocize should take a srcdir argument
24 o 696570 : style updates
25 o 697940 : Race condition between setup-build.stamp and scan-build.stamp
26 o 701259 : /bin/bash: -chmod: command not found
27 o 701638 : Support automake parallel test harness (fix error with GTKDOC_CHECK)
28 o 706404 : Minor bug in gtkdoc-mkdb
29 o 706438 : Empty lines added at the beginning and at the end of a programlisting
30 o 707426 : master is broken in picking up flavour from configure.ac
31 o 707717 : Support " Deprecated: X.Y "
32 o 708268 : New *-insensitive.png files are not distributes
33 o 710478 : gtkdoc-mkdb: Don't complain about annotations with hyphen
34 o 711111 : gtkdoc-mkdb: sort entries in the glossary
35 o 711598 : gtkdoc-scan doesn't ignore decorators containing parentheses
36 o 719644 : docs: make yelp usage conditional in manual
37 o 719645 : configure: emit message when looking for yelp
38 o 720061 : make: create subdirectories of the content_files to the builddir
39 o 721228 : configure: search for xml catalog in XDG_DATA_DIRS
40 o 722479 : cp -u is not portable
41 o 723118 : Mark |[ blocks as CDATA
42 o 723288 : Fix MarkDown support
43 o 723417 : New MarkDown parser
44 o 723696 : Add support for blockquote
45 o 723812 : Add support for reference links
46 o 723913 : List in markdown: < p > inside the last element of a < ul > list
47 o 723991 : Improve the display of the synopsis
48 o 724002 : gtkdoc-scan: Fix use of uninitialised value in trace logging
49
50 Contributors
51
52 Alban Browaeys
53 Alexander Kanavin
54 Carlos Garcia Campos
55 Christian Kirbach
56 Daniel Mustieles
57 David King
58 David Nečas
59 Dieter Verfaillie
60 Dimitris Spingos
61 Hib Eris
62 Matthias Clasen
63 Philip Chimento
64 Philip Withnall
65 Rafael Ferreira
66 Rico Tzschichholz
67 Ryan Lortie
68 Sebastian Rasmussen
69 Sébastien Wilmet
70 Stefan Sauer
71 Stef Walter
72 William Jon McCann
73 Zbigniew Jędrzejewski-Szmek
74
1GTK-Doc 1.19 (Jun 05 2013)75GTK-Doc 1.19 (Jun 05 2013)
2============76============
377
478
=== modified file 'TODO'
--- TODO 2013-12-19 07:58:53 +0000
+++ TODO 2014-02-17 20:15:47 +0000
@@ -16,11 +16,30 @@
1616
17Developers can also add items here :)17Developers can also add items here :)
1818
19= Cleanups =19= Less files to manually edit =
20== get rid of the -section.txt file ==20The goal is that we configure gtk-doc in configure.ac and Makefile.am and
21* section-title can be in SECTION comment already21document the code in the sources. Right no we also have to edit a bunch of extra
22* when scanning a header file, everything will be put to one section22files:
23 * like we do for autogenerated section.txt file (gtkdoc-scan)23 * $(DOC_MODULE).types
24 * $(DOC_MODULE)-docs.xml
25 * $(DOC_MODULE)-sections.txt
26
27== .types ==
28
29* using SCAN_OPTION="--rebuild-types" can be used to avoid maintaining the types
30 file
31* we need to check if this works well for all kind of _types (e.g. boxed)
32 https://bugzilla.gnome.org/show_bug.cgi?id=605025
33
34== -section.txt ==
35https://bugzilla.gnome.org/show_bug.cgi?id=646094
36
37* using SCAN_OPTION="--rebuild-sections" can be used to use the audogenerated
38 sections file
39* when scanning a header file, everything of the header and the respective .c
40 file will be put to one section
41* symbols can be hidden using __GTK_DOC_IGNORE__
42
24* we need comment markup to override the section43* we need comment markup to override the section
25 e.g.: " * InSection: xxxx"44 e.g.: " * InSection: xxxx"
26 this needs gtkdoc-mkdb::ScanSourceFile to understand a new tag, which45 this needs gtkdoc-mkdb::ScanSourceFile to understand a new tag, which
2746
=== removed file 'acinclude.m4'
--- acinclude.m4 2004-05-15 23:11:36 +0000
+++ acinclude.m4 1970-01-01 00:00:00 +0000
@@ -1,55 +0,0 @@
1
2# Checks the location of the XML Catalog
3# Usage:
4# JH_PATH_XML_CATALOG([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
5# Defines XMLCATALOG and XML_CATALOG_FILE substitutions
6AC_DEFUN([JH_PATH_XML_CATALOG],
7[
8 # check for the presence of the XML catalog
9 AC_ARG_WITH([xml-catalog],
10 AC_HELP_STRING([--with-xml-catalog=CATALOG],
11 [path to xml catalog to use]),,
12 [with_xml_catalog=/etc/xml/catalog])
13 jh_found_xmlcatalog=true
14 XML_CATALOG_FILE="$with_xml_catalog"
15 AC_SUBST([XML_CATALOG_FILE])
16 AC_MSG_CHECKING([for XML catalog ($XML_CATALOG_FILE)])
17 if test -f "$XML_CATALOG_FILE"; then
18 AC_MSG_RESULT([found])
19 else
20 jh_found_xmlcatalog=false
21 AC_MSG_RESULT([not found])
22 fi
23
24 # check for the xmlcatalog program
25 AC_PATH_PROG(XMLCATALOG, xmlcatalog, no)
26 if test "x$XMLCATALOG" = xno; then
27 jh_found_xmlcatalog=false
28 fi
29
30 if $jh_found_xmlcatalog; then
31 ifelse([$1],,[:],[$1])
32 else
33 ifelse([$2],,[AC_MSG_ERROR([could not find XML catalog])],[$2])
34 fi
35])
36
37# Checks if a particular URI appears in the XML catalog
38# Usage:
39# JH_CHECK_XML_CATALOG(URI, [FRIENDLY-NAME], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
40AC_DEFUN([JH_CHECK_XML_CATALOG],
41[
42 AC_REQUIRE([JH_PATH_XML_CATALOG],[JH_PATH_XML_CATALOG(,[:])])dnl
43 AC_MSG_CHECKING([for ifelse([$2],,[$1],[$2]) in XML catalog])
44 if $jh_found_xmlcatalog && \
45 AC_RUN_LOG([$XMLCATALOG --noout "$XML_CATALOG_FILE" "$1" >&2]); then
46 AC_MSG_RESULT([found])
47 ifelse([$3],,,[$3
48])dnl
49 else
50 AC_MSG_RESULT([not found])
51 ifelse([$4],,
52 [AC_MSG_ERROR([could not find ifelse([$2],,[$1],[$2]) in XML catalog])],
53 [$4])
54 fi
55])
560
=== modified file 'aclocal.m4'
--- aclocal.m4 2013-12-19 07:58:53 +0000
+++ aclocal.m4 2014-02-17 20:15:47 +0000
@@ -1643,9 +1643,10 @@
1643AC_SUBST([am__untar])1643AC_SUBST([am__untar])
1644]) # _AM_PROG_TAR1644]) # _AM_PROG_TAR
16451645
1646m4_include([m4/gtkdoc_jh_check_xml_catalog.m4])
1647m4_include([m4/gtkdoc_jh_path_xml_catalog.m4])
1646m4_include([m4/libtool.m4])1648m4_include([m4/libtool.m4])
1647m4_include([m4/ltoptions.m4])1649m4_include([m4/ltoptions.m4])
1648m4_include([m4/ltsugar.m4])1650m4_include([m4/ltsugar.m4])
1649m4_include([m4/ltversion.m4])1651m4_include([m4/ltversion.m4])
1650m4_include([m4/lt~obsolete.m4])1652m4_include([m4/lt~obsolete.m4])
1651m4_include([acinclude.m4])
16521653
=== modified file 'configure'
--- configure 2013-12-19 07:58:53 +0000
+++ configure 2014-02-17 20:15:47 +0000
@@ -1,6 +1,6 @@
1#! /bin/sh1#! /bin/sh
2# Guess values for system-dependent variables and create Makefiles.2# Guess values for system-dependent variables and create Makefiles.
3# Generated by GNU Autoconf 2.68 for gtk-doc 1.19.3# Generated by GNU Autoconf 2.68 for gtk-doc 1.20.
4#4#
5# Report bugs to <http://bugzilla.gnome.org/enter_bug.cgi?product=gtk-doc>.5# Report bugs to <http://bugzilla.gnome.org/enter_bug.cgi?product=gtk-doc>.
6#6#
@@ -571,8 +571,8 @@
571# Identity of this package.571# Identity of this package.
572PACKAGE_NAME='gtk-doc'572PACKAGE_NAME='gtk-doc'
573PACKAGE_TARNAME='gtk-doc'573PACKAGE_TARNAME='gtk-doc'
574PACKAGE_VERSION='1.19'574PACKAGE_VERSION='1.20'
575PACKAGE_STRING='gtk-doc 1.19'575PACKAGE_STRING='gtk-doc 1.20'
576PACKAGE_BUGREPORT='http://bugzilla.gnome.org/enter_bug.cgi?product=gtk-doc'576PACKAGE_BUGREPORT='http://bugzilla.gnome.org/enter_bug.cgi?product=gtk-doc'
577PACKAGE_URL=''577PACKAGE_URL=''
578578
@@ -623,6 +623,8 @@
623XMLLINT623XMLLINT
624ITSTOOL624ITSTOOL
625HELP_DIR625HELP_DIR
626DATE_FMT_CMD
627ELAPSED_FMT
626TS_FMT628TS_FMT
627TRACE629TRACE
628glib_prefix630glib_prefix
@@ -1349,7 +1351,7 @@
1349 # Omit some internal or obsolete options to make the list less imposing.1351 # Omit some internal or obsolete options to make the list less imposing.
1350 # This message is too long to be a string in the A/UX 3.1 sh.1352 # This message is too long to be a string in the A/UX 3.1 sh.
1351 cat <<_ACEOF1353 cat <<_ACEOF
1352\`configure' configures gtk-doc 1.19 to adapt to many kinds of systems.1354\`configure' configures gtk-doc 1.20 to adapt to many kinds of systems.
13531355
1354Usage: $0 [OPTION]... [VAR=VALUE]...1356Usage: $0 [OPTION]... [VAR=VALUE]...
13551357
@@ -1419,7 +1421,7 @@
14191421
1420if test -n "$ac_init_help"; then1422if test -n "$ac_init_help"; then
1421 case $ac_init_help in1423 case $ac_init_help in
1422 short | recursive ) echo "Configuration of gtk-doc 1.19:";;1424 short | recursive ) echo "Configuration of gtk-doc 1.20:";;
1423 esac1425 esac
1424 cat <<\_ACEOF1426 cat <<\_ACEOF
14251427
@@ -1542,7 +1544,7 @@
1542test -n "$ac_init_help" && exit $ac_status1544test -n "$ac_init_help" && exit $ac_status
1543if $ac_init_version; then1545if $ac_init_version; then
1544 cat <<\_ACEOF1546 cat <<\_ACEOF
1545gtk-doc configure 1.191547gtk-doc configure 1.20
1546generated by GNU Autoconf 2.681548generated by GNU Autoconf 2.68
15471549
1548Copyright (C) 2010 Free Software Foundation, Inc.1550Copyright (C) 2010 Free Software Foundation, Inc.
@@ -1820,7 +1822,7 @@
1820This file contains any messages produced by compilers while1822This file contains any messages produced by compilers while
1821running configure, to aid debugging if configure makes a mistake.1823running configure, to aid debugging if configure makes a mistake.
18221824
1823It was created by gtk-doc $as_me 1.19, which was1825It was created by gtk-doc $as_me 1.20, which was
1824generated by GNU Autoconf 2.68. Invocation command line was1826generated by GNU Autoconf 2.68. Invocation command line was
18251827
1826 $ $0 $@1828 $ $0 $@
@@ -2639,7 +2641,7 @@
26392641
2640# Define the identity of the package.2642# Define the identity of the package.
2641 PACKAGE='gtk-doc'2643 PACKAGE='gtk-doc'
2642 VERSION='1.19'2644 VERSION='1.20'
26432645
26442646
2645cat >>confdefs.h <<_ACEOF2647cat >>confdefs.h <<_ACEOF
@@ -12044,31 +12046,51 @@
12044fi12046fi
1204512047
1204612048
12047 # check for the presence of the XML catalog
1204812049
12049# Check whether --with-xml-catalog was given.12050# Check whether --with-xml-catalog was given.
12050if test "${with_xml_catalog+set}" = set; then :12051if test "${with_xml_catalog+set}" = set; then :
12051 withval=$with_xml_catalog;12052 withval=$with_xml_catalog;
12052else12053else
12053 with_xml_catalog=/etc/xml/catalog12054 with_xml_catalog=''
12054fi12055fi
1205512056
12056 jh_found_xmlcatalog=true12057 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XML catalog" >&5
12057 XML_CATALOG_FILE="$with_xml_catalog"12058$as_echo_n "checking for XML catalog... " >&6; }
1205812059 if test -n "$with_xml_catalog"; then
12059 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XML catalog ($XML_CATALOG_FILE)" >&512060 if test -f "$with_xml_catalog"; then
12060$as_echo_n "checking for XML catalog ($XML_CATALOG_FILE)... " >&6; }12061 jh_found_xmlcatalog=true
12061 if test -f "$XML_CATALOG_FILE"; then12062 else
12062 { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&512063 jh_found_xmlcatalog=false
12063$as_echo "found" >&6; }12064 fi
12064 else12065 else
12065 jh_found_xmlcatalog=false12066 if test -z "$XDG_DATA_DIRS"; then
12066 { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&512067 jh_xml_catalog_searchdirs="/etc:/usr/local/share:/usr/share"
12068 else
12069 jh_xml_catalog_searchdirs="/etc:$XDG_DATA_DIRS"
12070 fi
12071 jh_found_xmlcatalog=false
12072 jh_xml_catalog_saved_ifs="$IFS"
12073 IFS=':'
12074 for d in $jh_xml_catalog_searchdirs; do
12075 if test -f "$d/xml/catalog"; then
12076 with_xml_catalog="$d/xml/catalog"
12077 jh_found_xmlcatalog=true
12078 break
12079 fi
12080 done
12081 IFS="$jh_xml_catalog_saved_ifs"
12082 fi
12083 if $jh_found_xmlcatalog; then
12084 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_xml_catalog" >&5
12085$as_echo "$with_xml_catalog" >&6; }
12086 else
12087 { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
12067$as_echo "not found" >&6; }12088$as_echo "not found" >&6; }
12068 fi12089 fi
1206912090 XML_CATALOG_FILE="$with_xml_catalog"
12070 # check for the xmlcatalog program12091
12071 # Extract the first word of "xmlcatalog", so it can be a program name with args.12092
12093 # Extract the first word of "xmlcatalog", so it can be a program name with args.
12072set dummy xmlcatalog; ac_word=$212094set dummy xmlcatalog; ac_word=$2
12073{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&512095{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
12074$as_echo_n "checking for $ac_word... " >&6; }12096$as_echo_n "checking for $ac_word... " >&6; }
@@ -12109,49 +12131,51 @@
12109fi12131fi
1211012132
1211112133
12112 if test "x$XMLCATALOG" = xno; then12134 if test "x$XMLCATALOG" = xno; then
12113 jh_found_xmlcatalog=false12135 jh_found_xmlcatalog=false
12114 fi12136 fi
1211512137
12116 if $jh_found_xmlcatalog; then12138 if $jh_found_xmlcatalog; then
12117 :12139 :
12118 else12140 else
12119 :12141 :
12120 fi12142 fi
1212112143
1212212144
12123 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DocBook XML DTD V4.3 in XML catalog" >&512145 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DocBook XML DTD V4.3 in XML catalog" >&5
12124$as_echo_n "checking for DocBook XML DTD V4.3 in XML catalog... " >&6; }12146$as_echo_n "checking for DocBook XML DTD V4.3 in XML catalog... " >&6; }
12125 if $jh_found_xmlcatalog && \12147 if $jh_found_xmlcatalog && \
12126 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$XMLCATALOG --noout \"\$XML_CATALOG_FILE\" \"-//OASIS//DTD DocBook XML V4.3//EN\" >&2"; } >&512148 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$XMLCATALOG --noout \"\$XML_CATALOG_FILE\" \"-//OASIS//DTD DocBook XML V4.3//EN\" >&2"; } >&5
12127 ($XMLCATALOG --noout "$XML_CATALOG_FILE" "-//OASIS//DTD DocBook XML V4.3//EN" >&2) 2>&512149 ($XMLCATALOG --noout "$XML_CATALOG_FILE" "-//OASIS//DTD DocBook XML V4.3//EN" >&2) 2>&5
12128 ac_status=$?12150 ac_status=$?
12129 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&512151 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
12130 test $ac_status = 0; }; then12152 test $ac_status = 0; }; then
12131 { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&512153 { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5
12132$as_echo "found" >&6; }12154$as_echo "found" >&6; }
12133 else12155
12134 { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&512156 else
12157 { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
12135$as_echo "not found" >&6; }12158$as_echo "not found" >&6; }
12136 as_fn_error $? "could not find DocBook XML DTD V4.3 in XML catalog" "$LINENO" 512159 as_fn_error $? "could not find DocBook XML DTD V4.3 in XML catalog" "$LINENO" 5
12137 fi12160 fi
1213812161
1213912162
12140 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DocBook XSL Stylesheets in XML catalog" >&512163 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DocBook XSL Stylesheets in XML catalog" >&5
12141$as_echo_n "checking for DocBook XSL Stylesheets in XML catalog... " >&6; }12164$as_echo_n "checking for DocBook XSL Stylesheets in XML catalog... " >&6; }
12142 if $jh_found_xmlcatalog && \12165 if $jh_found_xmlcatalog && \
12143 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$XMLCATALOG --noout \"\$XML_CATALOG_FILE\" \"http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl\" >&2"; } >&512166 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$XMLCATALOG --noout \"\$XML_CATALOG_FILE\" \"http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl\" >&2"; } >&5
12144 ($XMLCATALOG --noout "$XML_CATALOG_FILE" "http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl" >&2) 2>&512167 ($XMLCATALOG --noout "$XML_CATALOG_FILE" "http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl" >&2) 2>&5
12145 ac_status=$?12168 ac_status=$?
12146 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&512169 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
12147 test $ac_status = 0; }; then12170 test $ac_status = 0; }; then
12148 { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&512171 { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5
12149$as_echo "found" >&6; }12172$as_echo "found" >&6; }
12150 else12173
12151 { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&512174 else
12175 { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
12152$as_echo "not found" >&6; }12176$as_echo "not found" >&6; }
12153 as_fn_error $? "could not find DocBook XSL Stylesheets in XML catalog" "$LINENO" 512177 as_fn_error $? "could not find DocBook XSL Stylesheets in XML catalog" "$LINENO" 5
12154 fi12178 fi
1215512179
1215612180
1215712181
@@ -12516,16 +12540,43 @@
12516fi12540fi
1251712541
1251812542
12519date +%s.%N | grep -q "%N"12543{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether date can output nanoseconds" >&5
12544$as_echo_n "checking whether date can output nanoseconds... " >&6; }
12545date +%s.%N | grep -q '%N'
12520if test "$?" == "1"; then12546if test "$?" == "1"; then
12521 TS_FMT="+%s.%N"12547 TS_FMT="+%s.%N"
12548 ELAPSED_FMT="+%H:%M:%S.%N"
12549 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
12550$as_echo "yes" >&6; }
12522else12551else
12523 TS_FMT="+%s.0"12552 TS_FMT="+%s.0"
12524fi12553 ELAPSED_FMT="+%H:%M:%S"
1252512554 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1252612555$as_echo "no" >&6; }
12556fi
12557
12558
12559
12560{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether date can format dates" >&5
12561$as_echo_n "checking whether date can format dates... " >&6; }
12562date >/dev/null 2>&1 --utc --date @1.1 $ELAPSED_FMT
12563if test "$?" == "0"; then
12564 DATE_FMT_CMD="date --utc $ELAPSED_FMT --date @0"
12565 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
12566$as_echo "yes" >&6; }
12567else
12568 DATE_FMT_CMD="echo "
12569 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12570$as_echo "no" >&6; }
12571fi
12572
12573
12574{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for yelp-tools" >&5
12575$as_echo_n "checking for yelp-tools... " >&6; }
12527have_yelp_tools=no12576have_yelp_tools=no
1252812577
12578{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
12579$as_echo "yes" >&6; }
1252912580
1253012581
1253112582
@@ -12797,6 +12848,10 @@
1279712848
12798have_yelp_tools=yes12849have_yelp_tools=yes
1279912850
12851if test "x$have_yelp_tools" != "xyes"; then
12852 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12853$as_echo "no" >&6; }
12854fi
12800 if test x$have_yelp_tools = xyes; then12855 if test x$have_yelp_tools = xyes; then
12801 HAVE_YELP_TOOLS_TRUE=12856 HAVE_YELP_TOOLS_TRUE=
12802 HAVE_YELP_TOOLS_FALSE='#'12857 HAVE_YELP_TOOLS_FALSE='#'
@@ -13427,7 +13482,7 @@
13427# report actual input values of CONFIG_FILES etc. instead of their13482# report actual input values of CONFIG_FILES etc. instead of their
13428# values after options handling.13483# values after options handling.
13429ac_log="13484ac_log="
13430This file was extended by gtk-doc $as_me 1.19, which was13485This file was extended by gtk-doc $as_me 1.20, which was
13431generated by GNU Autoconf 2.68. Invocation command line was13486generated by GNU Autoconf 2.68. Invocation command line was
1343213487
13433 CONFIG_FILES = $CONFIG_FILES13488 CONFIG_FILES = $CONFIG_FILES
@@ -13484,7 +13539,7 @@
13484cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=113539cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
13485ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"13540ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
13486ac_cs_version="\\13541ac_cs_version="\\
13487gtk-doc config.status 1.1913542gtk-doc config.status 1.20
13488configured by $0, generated by GNU Autoconf 2.68,13543configured by $0, generated by GNU Autoconf 2.68,
13489 with options \\"\$ac_cs_config\\"13544 with options \\"\$ac_cs_config\\"
1349013545
1349113546
=== modified file 'configure.ac'
--- configure.ac 2013-12-19 07:58:53 +0000
+++ configure.ac 2014-02-17 20:15:47 +0000
@@ -5,7 +5,7 @@
5dnl Makefile can only cope with that, i.e. use 1.1, 1.2, 1.3 ... 9.9.5dnl Makefile can only cope with that, i.e. use 1.1, 1.2, 1.3 ... 9.9.
6dnl FIXME: I can't see anything failing (1.14.1), lets try to use a three digit6dnl FIXME: I can't see anything failing (1.14.1), lets try to use a three digit
7dnl number for the development version7dnl number for the development version
8m4_define(gtk_doc_version, 1.19)8m4_define(gtk_doc_version, 1.20)
99
10AC_INIT([gtk-doc],[gtk_doc_version],[http://bugzilla.gnome.org/enter_bug.cgi?product=gtk-doc],[gtk-doc])10AC_INIT([gtk-doc],[gtk_doc_version],[http://bugzilla.gnome.org/enter_bug.cgi?product=gtk-doc],[gtk-doc])
1111
@@ -210,22 +210,44 @@
210AC_SUBST(TRACE)210AC_SUBST(TRACE)
211211
212dnl check what date format we can use for the makefile tracing in tests212dnl check what date format we can use for the makefile tracing in tests
213date +%s.%N | grep -q "%N"213AC_MSG_CHECKING(whether date can output nanoseconds)
214date +%s.%N | grep -q '%N'
214if test "$?" == "1"; then215if test "$?" == "1"; then
215 TS_FMT="+%s.%N"216 TS_FMT="+%s.%N"
217 ELAPSED_FMT="+%H:%M:%S.%N"
218 AC_MSG_RESULT(yes)
216else219else
217 TS_FMT="+%s.0"220 TS_FMT="+%s.0"
221 ELAPSED_FMT="+%H:%M:%S"
222 AC_MSG_RESULT(no)
218fi223fi
219AC_SUBST(TS_FMT)224AC_SUBST(TS_FMT)
225AC_SUBST(ELAPSED_FMT)
226
227AC_MSG_CHECKING(whether date can format dates)
228date >/dev/null 2>&1 --utc --date @1.1 $ELAPSED_FMT
229if test "$?" == "0"; then
230 DATE_FMT_CMD="date --utc $ELAPSED_FMT --date @0"
231 AC_MSG_RESULT(yes)
232else
233 DATE_FMT_CMD="echo "
234 AC_MSG_RESULT(no)
235fi
236AC_SUBST(DATE_FMT_CMD)
220237
221dnl238dnl
222dnl Documentation239dnl Documentation
223dnl240dnl
241AC_MSG_CHECKING([for yelp-tools])
224have_yelp_tools=no242have_yelp_tools=no
225m4_ifdef([YELP_HELP_INIT],[243m4_ifdef([YELP_HELP_INIT],[
244AC_MSG_RESULT([yes])
226YELP_HELP_INIT245YELP_HELP_INIT
227have_yelp_tools=yes246have_yelp_tools=yes
228])247])
248if test "x$have_yelp_tools" != "xyes"; then
249 AC_MSG_RESULT([no])
250fi
229AM_CONDITIONAL([HAVE_YELP_TOOLS],[test x$have_yelp_tools = xyes])251AM_CONDITIONAL([HAVE_YELP_TOOLS],[test x$have_yelp_tools = xyes])
230252
231AC_CONFIG_FILES([Makefile253AC_CONFIG_FILES([Makefile
232254
=== modified file 'debian/changelog'
--- debian/changelog 2013-12-19 07:58:53 +0000
+++ debian/changelog 2014-02-17 20:15:47 +0000
@@ -1,3 +1,17 @@
1gtk-doc (1.20-1ubuntu1) UNRELEASED; urgency=medium
2
3 * Merge from debian. Remaining changes:
4 - debian/control.in: Drop optional highlight dependency, which is in
5 universe.
6
7 -- Jackson Doak <noskcaj@ubuntu.com> Tue, 18 Feb 2014 06:25:54 +1100
8
9gtk-doc (1.20-1) unstable; urgency=medium
10
11 * New upstream release.
12
13 -- Emilio Pozuelo Monfort <pochu@debian.org> Sun, 16 Feb 2014 22:58:37 +0100
14
1gtk-doc (1.19-1ubuntu1) trusty; urgency=medium15gtk-doc (1.19-1ubuntu1) trusty; urgency=medium
216
3 * Merge from debian. Remaining changes:17 * Merge from debian. Remaining changes:
418
=== modified file 'examples/Makefile.am'
--- examples/Makefile.am 2013-12-19 07:58:53 +0000
+++ examples/Makefile.am 2014-02-17 20:15:47 +0000
@@ -96,7 +96,7 @@
96# Comment this out if you want 'make check' to test you doc status96# Comment this out if you want 'make check' to test you doc status
97# and run some sanity checks97# and run some sanity checks
98if ENABLE_GTK_DOC98if ENABLE_GTK_DOC
99TESTS_ENVIRONMENT = cd $(srcdir) && \99TESTS_ENVIRONMENT = \
100 DOC_MODULE=$(DOC_MODULE) DOC_MAIN_SGML_FILE=$(DOC_MAIN_SGML_FILE) \100 DOC_MODULE=$(DOC_MODULE) DOC_MAIN_SGML_FILE=$(DOC_MAIN_SGML_FILE) \
101 SRCDIR=$(abs_srcdir) BUILDDIR=$(abs_builddir)101 SRCDIR=$(abs_srcdir) BUILDDIR=$(abs_builddir)
102#TESTS = $(GTKDOC_CHECK)102#TESTS = $(GTKDOC_CHECK)
103103
=== added file 'gtk-doc.dsl'
--- gtk-doc.dsl 1970-01-01 00:00:00 +0000
+++ gtk-doc.dsl 2014-02-17 20:15:47 +0000
@@ -0,0 +1,464 @@
1<!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
2<!ENTITY dbstyle PUBLIC "-//Norman Walsh//DOCUMENT DocBook HTML Stylesheet//EN" CDATA DSSSL>
3]>
4
5<style-sheet>
6<style-specification use="docbook">
7<style-specification-body>
8
9(define gtkdoc-version "")
10(define gtkdoc-bookname "")
11
12;; These are some customizations to the standard HTML output produced by the
13;; Modular DocBook Stylesheets.
14;; I've copied parts of a few functions from the stylesheets so these should
15;; be checked occasionally to ensure they are up to date.
16;;
17;; The last check was with version 1.40 of the stylesheets.
18;; It will not work with versions < 1.19 since the $shade-verbatim-attr$
19;; function was added then. Versions 1.19 to 1.39 may be OK, if you're lucky!
20
21;;(define %generate-book-toc% #f)
22
23;; If a Chapter has role="no-toc" we don't generate a table of contents.
24;; This is useful if a better contents page has been added manually, e.g. for
25;; the GTK+ Widgets & Objects page. (But it is a bit of a hack.)
26(define ($generate-chapter-toc$)
27 (not (equal? (attribute-string (normalize "role") (current-node)) "no-toc")))
28
29(define %chapter-autolabel%
30 ;; Are chapters enumerated?
31 #f)
32
33(define %use-id-as-filename% #t)
34
35(define %html-ext% ".html")
36
37(define ($user-html-header$ #!optional
38 (home (empty-node-list))
39 (up (empty-node-list))
40 (prev (empty-node-list))
41 (next (empty-node-list)))
42 (make sequence
43 (if (not (string=? gtkdoc-version ""))
44 (make empty-element gi: "META"
45 attributes: (list
46 (list "NAME" "GENERATOR")
47 (list "CONTENT" (string-append
48 "GTK-Doc V"
49 gtkdoc-version
50 " (SGML mode)"))))
51 (empty-sosofo))
52 (make element gi: "STYLE"
53 attributes: (list (list "TYPE" "text/css"))
54 (literal ".synopsis, .classsynopsis {
55 background: #eeeeee;
56 border: solid 1px #aaaaaa;
57 padding: 0.5em;
58}
59.programlisting {
60 background: #eeeeff;
61 border: solid 1px #aaaaff;
62 padding: 0.5em;
63}
64.variablelist {
65 padding: 4px;
66 margin-left: 3em;
67}
68.navigation {
69 background: #ffeeee;
70 border: solid 1px #ffaaaa;
71 margin-top: 0.5em;
72 margin-bottom: 0.5em;
73}
74.navigation a {
75 color: #770000;
76}
77.navigation a:visited {
78 color: #550000;
79}
80.navigation .title {
81 font-size: 200%;
82}"))))
83
84
85(mode book-titlepage-recto-mode
86 (element title
87 (make element gi: "TABLE"
88 attributes: (list
89 (list "CLASS" "navigation")
90 (list "WIDTH" %gentext-nav-tblwidth%)
91 (list "CELLPADDING" "2")
92 (list "CELLSPACING" "0"))
93 (make element gi: "TR"
94 (make element gi: "TH"
95 attributes: (list
96 (list "ALIGN" "center")
97 (list "VALIGN" "MIDDLE"))
98 (make element gi: "P"
99 attributes: (list (list "CLASS" (gi)))
100 (process-children-trim)
101 (make empty-element gi: "A"
102 attributes: (list (list "NAME" (element-id))))))))))
103
104(define (book-titlepage-separator side)
105 (empty-sosofo))
106
107
108;; This overrides the variablelist definition (copied from 1.76,
109;; dblists.dsl). It changes the table background color, cell spacing
110;; and cell padding.
111;;
112;; I have also removed the code to handle the non-table case.
113(element variablelist
114 (make sequence
115 (if %spacing-paras%
116 (make element gi: "P" (empty-sosofo))
117 (empty-sosofo))
118 (para-check)
119
120 (make element gi: "TABLE"
121 attributes: '(("CLASS" "variablelist")
122 ("BORDER" "0")
123 ("CELLSPACING" "0")
124 ("CELLPADDING" "4"))
125 (if %html40%
126 (make element gi: "TBODY"
127 (with-mode variablelist-table
128 (process-children)))
129 (with-mode variablelist-table
130 (process-children))))
131 (para-check 'restart)))
132
133(mode variablelist-table
134 (element (variablelist title)
135 (make element gi: "TR"
136 attributes: '(("CLASS" "TITLE"))
137 (make element gi: "TH"
138 attributes: '(("ALIGN" "LEFT")
139 ("VALIGN" "TOP")
140 ("COLSPAN" "2"))
141 (process-children))))
142
143 (element varlistentry
144 (let* ((terms (select-elements (children (current-node))
145 (normalize "term")))
146 (listitem (select-elements (children (current-node))
147 (normalize "listitem"))))
148
149 (make element gi: "TR"
150 (make element gi: "TD"
151 attributes: '(("ALIGN" "LEFT")
152 ("VALIGN" "TOP"))
153 (make empty-element gi: "A"
154 attributes: (list
155 (list "NAME" (element-id))))
156 (process-node-list terms))
157 (make element gi: "TD"
158 attributes: '(("ALIGN" "LEFT")
159 ("VALIGN" "TOP"))
160 (process-node-list listitem)))))
161
162 (element (varlistentry term)
163 (make sequence
164 (if %css-decoration%
165 (make element gi: "SPAN"
166 attributes: '(("STYLE" "white-space: nowrap"))
167 (process-children-trim))
168 (make element gi: "NOBR"
169 (process-children-trim)))
170 (if (not (last-sibling?))
171 (literal ", ")
172 (literal ""))))
173
174 (element (varlistentry listitem)
175 (process-children))
176)
177
178
179;; This overrides the refsect2 definition (copied from 1.20, dbrfntry.dsl).
180;; It puts a horizontal rule before each function/struct/... description,
181;; except the first one in the refsect1.
182(element refsect2
183 (make sequence
184 (if (first-sibling?)
185 (empty-sosofo)
186 (make empty-element gi: "HR"))
187 ($block-container$)))
188
189;; Override the book declaration, so that we generate a crossreference
190;; for the book
191
192(element book
193 (let* ((bookinfo (select-elements (children (current-node)) (normalize "bookinfo")))
194 (ititle (select-elements (children bookinfo) (normalize "title")))
195 (title (if (node-list-empty? ititle)
196 (select-elements (children (current-node)) (normalize "title"))
197 (node-list-first ititle)))
198 (nl (titlepage-info-elements (current-node) bookinfo))
199 (tsosofo (with-mode head-title-mode
200 (process-node-list title)))
201 (dedication (select-elements (children (current-node)) (normalize "dedication"))))
202 (make sequence
203 (html-document
204 tsosofo
205 (make element gi: "DIV"
206 attributes: '(("CLASS" "BOOK"))
207 (if %generate-book-titlepage%
208 (make sequence
209 (book-titlepage nl 'recto)
210 (book-titlepage nl 'verso))
211 (empty-sosofo))
212
213 (if (node-list-empty? dedication)
214 (empty-sosofo)
215 (with-mode dedication-page-mode
216 (process-node-list dedication)))
217
218 (if (not (generate-toc-in-front))
219 (process-children)
220 (empty-sosofo))
221
222 (if %generate-book-toc%
223 (build-toc (current-node) (toc-depth (current-node)))
224 (empty-sosofo))
225
226 ;; (let loop ((gilist %generate-book-lot-list%))
227 ;; (if (null? gilist)
228 ;; (empty-sosofo)
229 ;; (if (not (node-list-empty?
230 ;; (select-elements (descendants (current-node))
231 ;; (car gilist))))
232 ;; (make sequence
233 ;; (build-lot (current-node) (car gilist))
234 ;; (loop (cdr gilist)))
235 ;; (loop (cdr gilist)))))
236
237 (if (generate-toc-in-front)
238 (process-children)
239 (empty-sosofo))))
240 (make entity
241 system-id: "index.sgml"
242 (with-mode generate-index-mode
243 (process-children))))))
244
245;; Mode for generating cross references
246
247(define (process-child-elements)
248 (process-node-list
249 (node-list-map (lambda (snl)
250 (if (equal? (node-property 'class-name snl) 'element)
251 snl
252 (empty-node-list)))
253 (children (current-node)))))
254
255(mode generate-index-mode
256 (element anchor
257 (if (attribute-string "href" (current-node))
258 (empty-sosofo)
259 (make formatting-instruction data:
260 (string-append "\less-than-sign;ANCHOR id =\""
261 (attribute-string "id" (current-node))
262 "\" href=\""
263 (if (not (string=? gtkdoc-bookname ""))
264 (string-append gtkdoc-bookname "/")
265 "")
266 (href-to (current-node))
267 "\"\greater-than-sign;
268"))))
269
270 ;; We also want to be able to link to complete RefEntry.
271 (element refentry
272 (make sequence
273 (make formatting-instruction data:
274 (string-append "\less-than-sign;ANCHOR id =\""
275 (attribute-string "id" (current-node))
276 "\" href=\""
277 (if (not (string=? gtkdoc-bookname ""))
278 (string-append gtkdoc-bookname "/")
279 "")
280 (href-to (current-node))
281 "\"\greater-than-sign;
282"))
283 (process-child-elements)))
284
285 (default
286 (process-child-elements)))
287
288;; For hypertext links for which no target is found in the document, we output
289;; our own special tag which we use later to resolve cross-document links.
290(element link
291 (let* ((target (element-with-id (attribute-string (normalize "linkend")))))
292 (if (node-list-empty? target)
293 (make element gi: "GTKDOCLINK"
294 attributes: (list
295 (list "HREF" (attribute-string (normalize "linkend"))))
296 (process-children))
297 (make element gi: "A"
298 attributes: (list
299 (list "HREF" (href-to target)))
300 (process-children)))))
301
302
303;; This overrides default-header-nav-tbl-noff (copied from 1.20, dbnavig.dsl).
304;; I want 'Home' and 'Up' links at the top of each page, and white text on
305;; black.
306(define (default-header-nav-tbl-noff elemnode prev next prevsib nextsib)
307 (let* ((up (parent elemnode))
308 (home (nav-home elemnode))
309 (show-title? (nav-banner? elemnode))
310 (title-sosofo
311 (make element gi: "TH"
312 attributes: (list
313 (list "WIDTH" "100%")
314 (list "align" "center"))
315 (if show-title?
316 (nav-banner elemnode)
317 (empty-sosofo))))
318 (show-banner? (or show-title?
319 (not (node-list-empty? prev))
320 (not (node-list-empty? next))
321 (nav-context? elemnode)))
322 (banner-sosofo
323 (make element gi: "TR"
324 attributes: (list
325 (list "VALIGN" "middle"))
326 (if (not (node-list-empty? prev))
327 (make element gi: "TD"
328 (make element gi: "A"
329 attributes: (list
330 (list "ACCESSKEY" "p")
331 (list "HREF"
332 (href-to prev)))
333 (make empty-element gi: "IMG"
334 attributes: (list
335 (list "SRC" "left.png")
336 (list "WIDTH" "16")
337 (list "HEIGHT" "16")
338 (list "BORDER" "0")
339 (list "ALT" "Prev")))))
340 (empty-sosofo))
341 (if (nav-up? elemnode)
342 (make element gi: "TD"
343 (make element gi: "A"
344 attributes: (list
345 (list "ACCESSKEY" "u")
346 (list "HREF"
347 (href-to up)))
348 (make empty-element gi: "IMG"
349 attributes: (list
350 (list "SRC" "up.png")
351 (list "WIDTH" "16")
352 (list "HEIGHT" "16")
353 (list "BORDER" "0")
354 (list "ALT" "Up")))))
355 (empty-sosofo))
356 (if (nav-home? elemnode)
357 (make element gi: "TD"
358 (make element gi: "A"
359 attributes: (list
360 (list "ACCESSKEY" "h")
361 (list "HREF"
362 (href-to home)))
363 (make empty-element gi: "IMG"
364 attributes: (list
365 (list "SRC" "home.png")
366 (list "WIDTH" "16")
367 (list "HEIGHT" "16")
368 (list "BORDER" "0")
369 (list "ALT" "Home")))))
370 (empty-sosofo))
371 title-sosofo
372 (if (not (node-list-empty? next))
373 (make element gi: "TD"
374 (make element gi: "A"
375 attributes: (list
376 (list "ACCESSKEY" "n")
377 (list "HREF"
378 (href-to next)))
379 (make empty-element gi: "IMG"
380 attributes: (list
381 (list "SRC" "right.png")
382 (list "WIDTH" "16")
383 (list "HEIGHT" "16")
384 (list "BORDER" "0")
385 (list "ALT" "Next")))))
386 (empty-sosofo)))))
387
388 (if show-banner?
389 (make element gi: "TABLE"
390 attributes: (list
391 (list "WIDTH" %gentext-nav-tblwidth%)
392 (list "CLASS" "navigation")
393 (list "SUMMARY" "Navigation header")
394 (list "CELLPADDING" "2")
395 (list "CELLSPACING" "2"))
396 banner-sosofo)
397 (empty-sosofo))))
398
399;; This overrides default-footer-nav-tbl (copied from 1.20, dbnavig.dsl).
400;; It matches the header above.
401(define (default-footer-nav-tbl elemnode prev next prevsib nextsib)
402 (let* ((show-footer? (or (not (node-list-empty? prev))
403 (not (node-list-empty? next))))
404 (footer-sosofo
405 (make element gi: "TR"
406 attributes: (list
407 (list "VALIGN" "middle"))
408 (make element gi: "TD"
409 attributes: (list
410 (list "ALIGN" "left"))
411 (if (not (node-list-empty? prev))
412 (make element gi: "A"
413 attributes: (list
414 (list "ACCESSKEY" "p")
415 (list "HREF" (href-to prev)))
416 (make element gi: "B"
417 (make entity-ref name: "lt")
418 (make entity-ref name: "lt")
419 (make entity-ref name: "lt")
420 (make entity-ref name: "nbsp")
421 (element-title-sosofo prev)))
422 (empty-sosofo)))
423 (make element gi: "TD"
424 attributes: (list
425 (list "ALIGN" "right"))
426 (if (not (node-list-empty? next))
427 (make element gi: "A"
428 attributes: (list
429 (list "ACCESSKEY" "n")
430 (list "HREF" (href-to next)))
431 (make element gi: "B"
432 (element-title-sosofo next)
433 (make entity-ref name: "nbsp")
434 (make entity-ref name: "gt")
435 (make entity-ref name: "gt")
436 (make entity-ref name: "gt")))
437 (empty-sosofo))))))
438
439 (if show-footer?
440 (make element gi: "TABLE"
441 attributes: (list
442 (list "CLASS" "navigation")
443 (list "WIDTH" %gentext-nav-tblwidth%)
444 (list "SUMMARY" "Navigation footer")
445 (list "CELLPADDING" "2")
446 (list "CELLSPACING" "2"))
447 footer-sosofo)
448 (empty-sosofo))))
449
450
451(define ($section-body$)
452 (make sequence
453 (make empty-element gi: "BR"
454 attributes: (list (list "CLEAR" "all")))
455 (make element gi: "DIV"
456 attributes: (list (list "CLASS" (gi)))
457 ($section-separator$)
458 ($section-title$)
459 (process-children))))
460
461</style-specification-body>
462</style-specification>
463<external-specification id="docbook" document="dbstyle">
464</style-sheet>
0465
=== modified file 'gtk-doc.dsl.in'
--- gtk-doc.dsl.in 2004-05-15 23:11:36 +0000
+++ gtk-doc.dsl.in 2014-02-17 20:15:47 +0000
@@ -333,8 +333,8 @@
333 (make empty-element gi: "IMG"333 (make empty-element gi: "IMG"
334 attributes: (list334 attributes: (list
335 (list "SRC" "left.png")335 (list "SRC" "left.png")
336 (list "WIDTH" "24")336 (list "WIDTH" "16")
337 (list "HEIGHT" "24")337 (list "HEIGHT" "16")
338 (list "BORDER" "0")338 (list "BORDER" "0")
339 (list "ALT" "Prev")))))339 (list "ALT" "Prev")))))
340 (empty-sosofo))340 (empty-sosofo))
@@ -348,8 +348,8 @@
348 (make empty-element gi: "IMG"348 (make empty-element gi: "IMG"
349 attributes: (list349 attributes: (list
350 (list "SRC" "up.png")350 (list "SRC" "up.png")
351 (list "WIDTH" "24")351 (list "WIDTH" "16")
352 (list "HEIGHT" "24")352 (list "HEIGHT" "16")
353 (list "BORDER" "0")353 (list "BORDER" "0")
354 (list "ALT" "Up")))))354 (list "ALT" "Up")))))
355 (empty-sosofo))355 (empty-sosofo))
@@ -363,8 +363,8 @@
363 (make empty-element gi: "IMG"363 (make empty-element gi: "IMG"
364 attributes: (list364 attributes: (list
365 (list "SRC" "home.png")365 (list "SRC" "home.png")
366 (list "WIDTH" "24")366 (list "WIDTH" "16")
367 (list "HEIGHT" "24")367 (list "HEIGHT" "16")
368 (list "BORDER" "0")368 (list "BORDER" "0")
369 (list "ALT" "Home")))))369 (list "ALT" "Home")))))
370 (empty-sosofo))370 (empty-sosofo))
@@ -379,8 +379,8 @@
379 (make empty-element gi: "IMG"379 (make empty-element gi: "IMG"
380 attributes: (list380 attributes: (list
381 (list "SRC" "right.png")381 (list "SRC" "right.png")
382 (list "WIDTH" "24")382 (list "WIDTH" "16")
383 (list "HEIGHT" "24")383 (list "HEIGHT" "16")
384 (list "BORDER" "0")384 (list "BORDER" "0")
385 (list "ALT" "Next")))))385 (list "ALT" "Next")))))
386 (empty-sosofo)))))386 (empty-sosofo)))))
387387
=== modified file 'gtk-doc.flat.make'
--- gtk-doc.flat.make 2013-12-19 07:58:53 +0000
+++ gtk-doc.flat.make 2014-02-17 20:15:47 +0000
@@ -49,9 +49,13 @@
49 $(DOC_MODULE)-undeclared.txt \49 $(DOC_MODULE)-undeclared.txt \
50 $(DOC_MODULE)-unused.txt50 $(DOC_MODULE)-unused.txt
5151
52CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS)52gtkdoc-check.test: Makefile
5353 $(AM_V_GEN)echo "#!/bin/sh -e" > $@; \
54if ENABLE_GTK_DOC54 echo "$(GTKDOC_CHECK_PATH) || exit 1" >> $@; \
55 chmod +x $@
56
57CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) gtkdoc-check.test
58
55if GTK_DOC_BUILD_HTML59if GTK_DOC_BUILD_HTML
56HTML_BUILD_STAMP=html-build.stamp60HTML_BUILD_STAMP=html-build.stamp
57else61else
@@ -63,9 +67,11 @@
63PDF_BUILD_STAMP=67PDF_BUILD_STAMP=
64endif68endif
6569
66all-local: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP)70all-gtk-doc: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP)
67else71.PHONY: all-gtk-doc
68all-local:72
73if ENABLE_GTK_DOC
74all-local: all-gtk-doc
69endif75endif
7076
71docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP)77docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP)
@@ -83,12 +89,14 @@
83 files=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \89 files=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \
84 if test "x$$files" != "x" ; then \90 if test "x$$files" != "x" ; then \
85 for file in $$files ; do \91 for file in $$files ; do \
92 destdir=`dirname $(abs_builddir)/$$file` ;\
93 test -d "$$destdir" || mkdir -p "$$destdir"; \
86 test -f $(abs_srcdir)/$$file && \94 test -f $(abs_srcdir)/$$file && \
87 cp -pu $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \95 cp -pf $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \
88 done; \96 done; \
89 fi; \97 fi; \
90 test -d $(abs_srcdir)/tmpl && \98 test -d $(abs_srcdir)/tmpl && \
91 { cp -rp $(abs_srcdir)/tmpl $(abs_builddir)/; \99 { cp -pR $(abs_srcdir)/tmpl $(abs_builddir)/; \
92 chmod -R u+w $(abs_builddir)/tmpl; } \100 chmod -R u+w $(abs_builddir)/tmpl; } \
93 fi101 fi
94 $(AM_V_at)touch setup-build.stamp102 $(AM_V_at)touch setup-build.stamp
@@ -103,7 +111,7 @@
103GTK_DOC_V_INTROSPECT_=$(GTK_DOC_V_INTROSPECT_$(AM_DEFAULT_VERBOSITY))111GTK_DOC_V_INTROSPECT_=$(GTK_DOC_V_INTROSPECT_$(AM_DEFAULT_VERBOSITY))
104GTK_DOC_V_INTROSPECT_0=@echo " DOC Introspecting gobjects";112GTK_DOC_V_INTROSPECT_0=@echo " DOC Introspecting gobjects";
105113
106scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB)114scan-build.stamp: setup-build.stamp $(HFILE_GLOB) $(CFILE_GLOB)
107 $(GTK_DOC_V_SCAN)_source_dir='' ; \115 $(GTK_DOC_V_SCAN)_source_dir='' ; \
108 for i in $(DOC_SOURCE_DIR) ; do \116 for i in $(DOC_SOURCE_DIR) ; do \
109 _source_dir="$${_source_dir} --source-dir=$$i" ; \117 _source_dir="$${_source_dir} --source-dir=$$i" ; \
@@ -139,7 +147,7 @@
139 $(GTK_DOC_V_TMPL)gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS)147 $(GTK_DOC_V_TMPL)gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS)
140 $(AM_V_at)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \148 $(AM_V_at)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
141 if test -w $(abs_srcdir) ; then \149 if test -w $(abs_srcdir) ; then \
142 cp -rp $(abs_builddir)/tmpl $(abs_srcdir)/; \150 cp -pR $(abs_builddir)/tmpl $(abs_srcdir)/; \
143 fi \151 fi \
144 fi152 fi
145 $(AM_V_at)touch tmpl-build.stamp153 $(AM_V_at)touch tmpl-build.stamp
@@ -157,7 +165,7 @@
157GTK_DOC_V_XML_0=@echo " DOC Building XML";165GTK_DOC_V_XML_0=@echo " DOC Building XML";
158166
159sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files)167sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files)
160 $(GTK_DOC_V_XML)-chmod -R u+w $(srcdir) && _source_dir='' ; \168 -$(GTK_DOC_V_XML)chmod -R u+w $(srcdir) && _source_dir='' ; \
161 for i in $(DOC_SOURCE_DIR) ; do \169 for i in $(DOC_SOURCE_DIR) ; do \
162 _source_dir="$${_source_dir} --source-dir=$$i" ; \170 _source_dir="$${_source_dir} --source-dir=$$i" ; \
163 done ; \171 done ; \
@@ -235,6 +243,9 @@
235clean-local:243clean-local:
236 @rm -f *~ *.bak244 @rm -f *~ *.bak
237 @rm -rf .libs245 @rm -rf .libs
246 @if echo $(SCAN_OPTIONS) | grep -q "\-\-rebuild-types" ; then \
247 rm -f $(DOC_MODULE).types; \
248 fi
238249
239distclean-local:250distclean-local:
240 @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \251 @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \
@@ -280,15 +291,17 @@
280#291#
281# Require gtk-doc when making dist292# Require gtk-doc when making dist
282#293#
283if ENABLE_GTK_DOC294if HAVE_GTK_DOC
284dist-check-gtkdoc: docs295dist-check-gtkdoc: docs
285else296else
286dist-check-gtkdoc:297dist-check-gtkdoc:
287 @echo "*** gtk-doc must be installed and enabled in order to make dist"298 @echo "*** gtk-doc is needed to run 'make dist'. ***"
299 @echo "*** gtk-doc was not found when 'configure' ran. ***"
300 @echo "*** please install gtk-doc and rerun 'configure'. ***"
288 @false301 @false
289endif302endif
290303
291dist-hook: dist-check-gtkdoc dist-hook-local304dist-hook: dist-check-gtkdoc all-gtk-doc dist-hook-local
292 @mkdir $(distdir)/tmpl305 @mkdir $(distdir)/tmpl
293 @mkdir $(distdir)/html306 @mkdir $(distdir)/html
294 @-cp ./tmpl/*.sgml $(distdir)/tmpl307 @-cp ./tmpl/*.sgml $(distdir)/tmpl
295308
=== modified file 'gtk-doc.m4'
--- gtk-doc.m4 2013-12-19 07:58:53 +0000
+++ gtk-doc.m4 2014-02-17 20:15:47 +0000
@@ -1,6 +1,6 @@
1dnl -*- mode: autoconf -*-1dnl -*- mode: autoconf -*-
22
3# serial 13# serial 2
44
5dnl Usage:5dnl Usage:
6dnl GTK_DOC_CHECK([minimum-gtk-doc-version])6dnl GTK_DOC_CHECK([minimum-gtk-doc-version])
@@ -10,8 +10,24 @@
10 AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first10 AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
11 AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first11 AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
1212
13 ifelse([$1],[],[gtk_doc_requires="gtk-doc"],[gtk_doc_requires="gtk-doc >= $1"])
14 AC_MSG_CHECKING([for gtk-doc])
15 PKG_CHECK_EXISTS([$gtk_doc_requires],[have_gtk_doc=yes],[have_gtk_doc=no])
16 AC_MSG_RESULT($have_gtk_doc)
17
18 if test "$have_gtk_doc" = "no"; then
19 AC_MSG_WARN([
20 You will not be able to create source packages with 'make dist'
21 because $gtk_doc_requires is not found.])
22 fi
23
13 dnl check for tools we added during development24 dnl check for tools we added during development
14 AC_PATH_PROG([GTKDOC_CHECK],[gtkdoc-check])25 dnl Use AC_CHECK_PROG to avoid the check target using an absolute path that
26 dnl may not be writable by the user. Currently, automake requires that the
27 dnl test name must end in '.test'.
28 dnl https://bugzilla.gnome.org/show_bug.cgi?id=701638
29 AC_CHECK_PROG([GTKDOC_CHECK],[gtkdoc-check],[gtkdoc-check.test])
30 AC_PATH_PROG([GTKDOC_CHECK_PATH],[gtkdoc-check])
15 AC_PATH_PROGS([GTKDOC_REBASE],[gtkdoc-rebase],[true])31 AC_PATH_PROGS([GTKDOC_REBASE],[gtkdoc-rebase],[true])
16 AC_PATH_PROG([GTKDOC_MKPDF],[gtkdoc-mkpdf])32 AC_PATH_PROG([GTKDOC_MKPDF],[gtkdoc-mkpdf])
1733
@@ -28,22 +44,22 @@
28 [use gtk-doc to build documentation [[default=no]]]),,44 [use gtk-doc to build documentation [[default=no]]]),,
29 [enable_gtk_doc=no])45 [enable_gtk_doc=no])
3046
31 if test x$enable_gtk_doc = xyes; then
32 ifelse([$1],[],
33 [PKG_CHECK_EXISTS([gtk-doc],,
34 AC_MSG_ERROR([gtk-doc not installed and --enable-gtk-doc requested]))],
35 [PKG_CHECK_EXISTS([gtk-doc >= $1],,
36 AC_MSG_ERROR([You need to have gtk-doc >= $1 installed to build $PACKAGE_NAME]))])
37 dnl don't check for glib if we build glib
38 if test "x$PACKAGE_NAME" != "xglib"; then
39 dnl don't fail if someone does not have glib
40 PKG_CHECK_MODULES(GTKDOC_DEPS, glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0,,[:])
41 fi
42 fi
43
44 AC_MSG_CHECKING([whether to build gtk-doc documentation])47 AC_MSG_CHECKING([whether to build gtk-doc documentation])
45 AC_MSG_RESULT($enable_gtk_doc)48 AC_MSG_RESULT($enable_gtk_doc)
4649
50 if test "x$enable_gtk_doc" = "xyes" && test "$have_gtk_doc" = "no"; then
51 AC_MSG_ERROR([
52 You must have $gtk_doc_requires installed to build documentation for
53 $PACKAGE_NAME. Please install gtk-doc or disable building the
54 documentation by adding '--disable-gtk-doc' to '[$]0'.])
55 fi
56
57 dnl don't check for glib if we build glib
58 if test "x$PACKAGE_NAME" != "xglib"; then
59 dnl don't fail if someone does not have glib
60 PKG_CHECK_MODULES(GTKDOC_DEPS, glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0,,[:])
61 fi
62
47 dnl enable/disable output formats63 dnl enable/disable output formats
48 AC_ARG_ENABLE([gtk-doc-html],64 AC_ARG_ENABLE([gtk-doc-html],
49 AS_HELP_STRING([--enable-gtk-doc-html],65 AS_HELP_STRING([--enable-gtk-doc-html],
@@ -63,6 +79,7 @@
63 fi79 fi
64 AC_SUBST([AM_DEFAULT_VERBOSITY])80 AC_SUBST([AM_DEFAULT_VERBOSITY])
6581
82 AM_CONDITIONAL([HAVE_GTK_DOC], [test x$have_gtk_doc = xyes])
66 AM_CONDITIONAL([ENABLE_GTK_DOC], [test x$enable_gtk_doc = xyes])83 AM_CONDITIONAL([ENABLE_GTK_DOC], [test x$enable_gtk_doc = xyes])
67 AM_CONDITIONAL([GTK_DOC_BUILD_HTML], [test x$enable_gtk_doc_html = xyes])84 AM_CONDITIONAL([GTK_DOC_BUILD_HTML], [test x$enable_gtk_doc_html = xyes])
68 AM_CONDITIONAL([GTK_DOC_BUILD_PDF], [test x$enable_gtk_doc_pdf = xyes])85 AM_CONDITIONAL([GTK_DOC_BUILD_PDF], [test x$enable_gtk_doc_pdf = xyes])
6986
=== modified file 'gtk-doc.make'
--- gtk-doc.make 2013-12-19 07:58:53 +0000
+++ gtk-doc.make 2014-02-17 20:15:47 +0000
@@ -49,9 +49,13 @@
49 $(DOC_MODULE)-undeclared.txt \49 $(DOC_MODULE)-undeclared.txt \
50 $(DOC_MODULE)-unused.txt50 $(DOC_MODULE)-unused.txt
5151
52CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS)52gtkdoc-check.test: Makefile
5353 $(AM_V_GEN)echo "#!/bin/sh -e" > $@; \
54if ENABLE_GTK_DOC54 echo "$(GTKDOC_CHECK_PATH) || exit 1" >> $@; \
55 chmod +x $@
56
57CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) gtkdoc-check.test
58
55if GTK_DOC_BUILD_HTML59if GTK_DOC_BUILD_HTML
56HTML_BUILD_STAMP=html-build.stamp60HTML_BUILD_STAMP=html-build.stamp
57else61else
@@ -63,9 +67,11 @@
63PDF_BUILD_STAMP=67PDF_BUILD_STAMP=
64endif68endif
6569
66all-local: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP)70all-gtk-doc: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP)
67else71.PHONY: all-gtk-doc
68all-local:72
73if ENABLE_GTK_DOC
74all-local: all-gtk-doc
69endif75endif
7076
71docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP)77docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP)
@@ -83,12 +89,14 @@
83 files=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \89 files=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \
84 if test "x$$files" != "x" ; then \90 if test "x$$files" != "x" ; then \
85 for file in $$files ; do \91 for file in $$files ; do \
92 destdir=`dirname $(abs_builddir)/$$file` ;\
93 test -d "$$destdir" || mkdir -p "$$destdir"; \
86 test -f $(abs_srcdir)/$$file && \94 test -f $(abs_srcdir)/$$file && \
87 cp -pu $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \95 cp -pf $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \
88 done; \96 done; \
89 fi; \97 fi; \
90 test -d $(abs_srcdir)/tmpl && \98 test -d $(abs_srcdir)/tmpl && \
91 { cp -rp $(abs_srcdir)/tmpl $(abs_builddir)/; \99 { cp -pR $(abs_srcdir)/tmpl $(abs_builddir)/; \
92 chmod -R u+w $(abs_builddir)/tmpl; } \100 chmod -R u+w $(abs_builddir)/tmpl; } \
93 fi101 fi
94 $(AM_V_at)touch setup-build.stamp102 $(AM_V_at)touch setup-build.stamp
@@ -103,7 +111,7 @@
103GTK_DOC_V_INTROSPECT_=$(GTK_DOC_V_INTROSPECT_$(AM_DEFAULT_VERBOSITY))111GTK_DOC_V_INTROSPECT_=$(GTK_DOC_V_INTROSPECT_$(AM_DEFAULT_VERBOSITY))
104GTK_DOC_V_INTROSPECT_0=@echo " DOC Introspecting gobjects";112GTK_DOC_V_INTROSPECT_0=@echo " DOC Introspecting gobjects";
105113
106scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB)114scan-build.stamp: setup-build.stamp $(HFILE_GLOB) $(CFILE_GLOB)
107 $(GTK_DOC_V_SCAN)_source_dir='' ; \115 $(GTK_DOC_V_SCAN)_source_dir='' ; \
108 for i in $(DOC_SOURCE_DIR) ; do \116 for i in $(DOC_SOURCE_DIR) ; do \
109 _source_dir="$${_source_dir} --source-dir=$$i" ; \117 _source_dir="$${_source_dir} --source-dir=$$i" ; \
@@ -139,7 +147,7 @@
139 $(GTK_DOC_V_TMPL)gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS)147 $(GTK_DOC_V_TMPL)gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS)
140 $(AM_V_at)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \148 $(AM_V_at)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
141 if test -w $(abs_srcdir) ; then \149 if test -w $(abs_srcdir) ; then \
142 cp -rp $(abs_builddir)/tmpl $(abs_srcdir)/; \150 cp -pR $(abs_builddir)/tmpl $(abs_srcdir)/; \
143 fi \151 fi \
144 fi152 fi
145 $(AM_V_at)touch tmpl-build.stamp153 $(AM_V_at)touch tmpl-build.stamp
@@ -157,7 +165,7 @@
157GTK_DOC_V_XML_0=@echo " DOC Building XML";165GTK_DOC_V_XML_0=@echo " DOC Building XML";
158166
159sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files)167sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files)
160 $(GTK_DOC_V_XML)-chmod -R u+w $(srcdir) && _source_dir='' ; \168 -$(GTK_DOC_V_XML)chmod -R u+w $(srcdir) && _source_dir='' ; \
161 for i in $(DOC_SOURCE_DIR) ; do \169 for i in $(DOC_SOURCE_DIR) ; do \
162 _source_dir="$${_source_dir} --source-dir=$$i" ; \170 _source_dir="$${_source_dir} --source-dir=$$i" ; \
163 done ; \171 done ; \
@@ -235,6 +243,9 @@
235clean-local:243clean-local:
236 @rm -f *~ *.bak244 @rm -f *~ *.bak
237 @rm -rf .libs245 @rm -rf .libs
246 @if echo $(SCAN_OPTIONS) | grep -q "\-\-rebuild-types" ; then \
247 rm -f $(DOC_MODULE).types; \
248 fi
238249
239distclean-local:250distclean-local:
240 @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \251 @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \
@@ -280,15 +291,17 @@
280#291#
281# Require gtk-doc when making dist292# Require gtk-doc when making dist
282#293#
283if ENABLE_GTK_DOC294if HAVE_GTK_DOC
284dist-check-gtkdoc: docs295dist-check-gtkdoc: docs
285else296else
286dist-check-gtkdoc:297dist-check-gtkdoc:
287 @echo "*** gtk-doc must be installed and enabled in order to make dist"298 @echo "*** gtk-doc is needed to run 'make dist'. ***"
299 @echo "*** gtk-doc was not found when 'configure' ran. ***"
300 @echo "*** please install gtk-doc and rerun 'configure'. ***"
288 @false301 @false
289endif302endif
290303
291dist-hook: dist-check-gtkdoc dist-hook-local304dist-hook: dist-check-gtkdoc all-gtk-doc dist-hook-local
292 @mkdir $(distdir)/tmpl305 @mkdir $(distdir)/tmpl
293 @mkdir $(distdir)/html306 @mkdir $(distdir)/html
294 @-cp ./tmpl/*.sgml $(distdir)/tmpl307 @-cp ./tmpl/*.sgml $(distdir)/tmpl
295308
=== modified file 'gtk-doc.notmpl-flat.make'
--- gtk-doc.notmpl-flat.make 2013-12-19 07:58:53 +0000
+++ gtk-doc.notmpl-flat.make 2014-02-17 20:15:47 +0000
@@ -49,9 +49,13 @@
49 $(DOC_MODULE)-undeclared.txt \49 $(DOC_MODULE)-undeclared.txt \
50 $(DOC_MODULE)-unused.txt50 $(DOC_MODULE)-unused.txt
5151
52CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS)52gtkdoc-check.test: Makefile
5353 $(AM_V_GEN)echo "#!/bin/sh -e" > $@; \
54if ENABLE_GTK_DOC54 echo "$(GTKDOC_CHECK_PATH) || exit 1" >> $@; \
55 chmod +x $@
56
57CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) gtkdoc-check.test
58
55if GTK_DOC_BUILD_HTML59if GTK_DOC_BUILD_HTML
56HTML_BUILD_STAMP=html-build.stamp60HTML_BUILD_STAMP=html-build.stamp
57else61else
@@ -63,9 +67,11 @@
63PDF_BUILD_STAMP=67PDF_BUILD_STAMP=
64endif68endif
6569
66all-local: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP)70all-gtk-doc: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP)
67else71.PHONY: all-gtk-doc
68all-local:72
73if ENABLE_GTK_DOC
74all-local: all-gtk-doc
69endif75endif
7076
71docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP)77docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP)
@@ -83,8 +89,10 @@
83 files=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \89 files=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \
84 if test "x$$files" != "x" ; then \90 if test "x$$files" != "x" ; then \
85 for file in $$files ; do \91 for file in $$files ; do \
92 destdir=`dirname $(abs_builddir)/$$file`; \
93 test -d "$$destdir" || mkdir -p "$$destdir"; \
86 test -f $(abs_srcdir)/$$file && \94 test -f $(abs_srcdir)/$$file && \
87 cp -pu $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \95 cp -pf $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \
88 done; \96 done; \
89 fi; \97 fi; \
90 fi98 fi
@@ -101,7 +109,7 @@
101GTK_DOC_V_INTROSPECT_=$(GTK_DOC_V_INTROSPECT_$(AM_DEFAULT_VERBOSITY))109GTK_DOC_V_INTROSPECT_=$(GTK_DOC_V_INTROSPECT_$(AM_DEFAULT_VERBOSITY))
102GTK_DOC_V_INTROSPECT_0=@echo " DOC Introspecting gobjects";110GTK_DOC_V_INTROSPECT_0=@echo " DOC Introspecting gobjects";
103111
104scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB)112scan-build.stamp: setup-build.stamp $(HFILE_GLOB) $(CFILE_GLOB)
105 $(GTK_DOC_V_SCAN)_source_dir='' ; \113 $(GTK_DOC_V_SCAN)_source_dir='' ; \
106 for i in $(DOC_SOURCE_DIR) ; do \114 for i in $(DOC_SOURCE_DIR) ; do \
107 _source_dir="$${_source_dir} --source-dir=$$i" ; \115 _source_dir="$${_source_dir} --source-dir=$$i" ; \
@@ -212,6 +220,9 @@
212clean-local:220clean-local:
213 @rm -f *~ *.bak221 @rm -f *~ *.bak
214 @rm -rf .libs222 @rm -rf .libs
223 @if echo $(SCAN_OPTIONS) | grep -q "\-\-rebuild-types" ; then \
224 rm -f $(DOC_MODULE).types; \
225 fi
215226
216distclean-local:227distclean-local:
217 @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \228 @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \
@@ -256,15 +267,17 @@
256#267#
257# Require gtk-doc when making dist268# Require gtk-doc when making dist
258#269#
259if ENABLE_GTK_DOC270if HAVE_GTK_DOC
260dist-check-gtkdoc: docs271dist-check-gtkdoc: docs
261else272else
262dist-check-gtkdoc:273dist-check-gtkdoc:
263 @echo "*** gtk-doc must be installed and enabled in order to make dist"274 @echo "*** gtk-doc is needed to run 'make dist'. ***"
275 @echo "*** gtk-doc was not found when 'configure' ran. ***"
276 @echo "*** please install gtk-doc and rerun 'configure'. ***"
264 @false277 @false
265endif278endif
266279
267dist-hook: dist-check-gtkdoc dist-hook-local280dist-hook: dist-check-gtkdoc all-gtk-doc dist-hook-local
268 @mkdir $(distdir)/html281 @mkdir $(distdir)/html
269 @cp ./html/* $(distdir)/html282 @cp ./html/* $(distdir)/html
270 @-cp ./$(DOC_MODULE).pdf $(distdir)/283 @-cp ./$(DOC_MODULE).pdf $(distdir)/
271284
=== modified file 'gtk-doc.notmpl.make'
--- gtk-doc.notmpl.make 2013-12-19 07:58:53 +0000
+++ gtk-doc.notmpl.make 2014-02-17 20:15:47 +0000
@@ -49,9 +49,13 @@
49 $(DOC_MODULE)-undeclared.txt \49 $(DOC_MODULE)-undeclared.txt \
50 $(DOC_MODULE)-unused.txt50 $(DOC_MODULE)-unused.txt
5151
52CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS)52gtkdoc-check.test: Makefile
5353 $(AM_V_GEN)echo "#!/bin/sh -e" > $@; \
54if ENABLE_GTK_DOC54 echo "$(GTKDOC_CHECK_PATH) || exit 1" >> $@; \
55 chmod +x $@
56
57CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) gtkdoc-check.test
58
55if GTK_DOC_BUILD_HTML59if GTK_DOC_BUILD_HTML
56HTML_BUILD_STAMP=html-build.stamp60HTML_BUILD_STAMP=html-build.stamp
57else61else
@@ -63,9 +67,11 @@
63PDF_BUILD_STAMP=67PDF_BUILD_STAMP=
64endif68endif
6569
66all-local: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP)70all-gtk-doc: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP)
67else71.PHONY: all-gtk-doc
68all-local:72
73if ENABLE_GTK_DOC
74all-local: all-gtk-doc
69endif75endif
7076
71docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP)77docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP)
@@ -83,8 +89,10 @@
83 files=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \89 files=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \
84 if test "x$$files" != "x" ; then \90 if test "x$$files" != "x" ; then \
85 for file in $$files ; do \91 for file in $$files ; do \
92 destdir=`dirname $(abs_builddir)/$$file`; \
93 test -d "$$destdir" || mkdir -p "$$destdir"; \
86 test -f $(abs_srcdir)/$$file && \94 test -f $(abs_srcdir)/$$file && \
87 cp -pu $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \95 cp -pf $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \
88 done; \96 done; \
89 fi; \97 fi; \
90 fi98 fi
@@ -101,7 +109,7 @@
101GTK_DOC_V_INTROSPECT_=$(GTK_DOC_V_INTROSPECT_$(AM_DEFAULT_VERBOSITY))109GTK_DOC_V_INTROSPECT_=$(GTK_DOC_V_INTROSPECT_$(AM_DEFAULT_VERBOSITY))
102GTK_DOC_V_INTROSPECT_0=@echo " DOC Introspecting gobjects";110GTK_DOC_V_INTROSPECT_0=@echo " DOC Introspecting gobjects";
103111
104scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB)112scan-build.stamp: setup-build.stamp $(HFILE_GLOB) $(CFILE_GLOB)
105 $(GTK_DOC_V_SCAN)_source_dir='' ; \113 $(GTK_DOC_V_SCAN)_source_dir='' ; \
106 for i in $(DOC_SOURCE_DIR) ; do \114 for i in $(DOC_SOURCE_DIR) ; do \
107 _source_dir="$${_source_dir} --source-dir=$$i" ; \115 _source_dir="$${_source_dir} --source-dir=$$i" ; \
@@ -212,6 +220,9 @@
212clean-local:220clean-local:
213 @rm -f *~ *.bak221 @rm -f *~ *.bak
214 @rm -rf .libs222 @rm -rf .libs
223 @if echo $(SCAN_OPTIONS) | grep -q "\-\-rebuild-types" ; then \
224 rm -f $(DOC_MODULE).types; \
225 fi
215226
216distclean-local:227distclean-local:
217 @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \228 @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \
@@ -256,15 +267,17 @@
256#267#
257# Require gtk-doc when making dist268# Require gtk-doc when making dist
258#269#
259if ENABLE_GTK_DOC270if HAVE_GTK_DOC
260dist-check-gtkdoc: docs271dist-check-gtkdoc: docs
261else272else
262dist-check-gtkdoc:273dist-check-gtkdoc:
263 @echo "*** gtk-doc must be installed and enabled in order to make dist"274 @echo "*** gtk-doc is needed to run 'make dist'. ***"
275 @echo "*** gtk-doc was not found when 'configure' ran. ***"
276 @echo "*** please install gtk-doc and rerun 'configure'. ***"
264 @false277 @false
265endif278endif
266279
267dist-hook: dist-check-gtkdoc dist-hook-local280dist-hook: dist-check-gtkdoc all-gtk-doc dist-hook-local
268 @mkdir $(distdir)/html281 @mkdir $(distdir)/html
269 @cp ./html/* $(distdir)/html282 @cp ./html/* $(distdir)/html
270 @-cp ./$(DOC_MODULE).pdf $(distdir)/283 @-cp ./$(DOC_MODULE).pdf $(distdir)/
271284
=== modified file 'gtk-doc.pc.in'
--- gtk-doc.pc.in 2011-05-27 09:29:25 +0000
+++ gtk-doc.pc.in 2014-02-17 20:15:47 +0000
@@ -1,6 +1,6 @@
1prefix=@prefix@1prefix=@prefix@
2exec_prefix=@exec_prefix@2exec_prefix=@exec_prefix@
3data_dir=@PACKAGE_DATA_DIR@3data_dir=@datadir@/@PACKAGE@/data
44
5Name: gtk-doc5Name: gtk-doc
6Description: API documentation generator6Description: API documentation generator
77
=== modified file 'gtk-doc.spec'
--- gtk-doc.spec 2013-12-19 07:58:53 +0000
+++ gtk-doc.spec 2014-02-17 20:15:47 +0000
@@ -2,7 +2,7 @@
22
3Summary: GTK+ DocBook Documentation Generator3Summary: GTK+ DocBook Documentation Generator
4Name: gtk-doc4Name: gtk-doc
5Version: 1.195Version: 1.20
6Release: 16Release: 1
7License: GPL7License: GPL
8Group: Utilities/Text8Group: Utilities/Text
99
=== modified file 'gtk-doc.xsl'
--- gtk-doc.xsl 2013-12-19 07:58:53 +0000
+++ gtk-doc.xsl 2014-02-17 20:15:47 +0000
@@ -20,6 +20,7 @@
2020
21 <!-- change some parameters -->21 <!-- change some parameters -->
22 <!-- http://docbook.sourceforge.net/release/xsl/current/doc/html/index.html -->22 <!-- http://docbook.sourceforge.net/release/xsl/current/doc/html/index.html -->
23 <xsl:param name="admon.style"/>
23 <xsl:param name="toc.section.depth">2</xsl:param>24 <xsl:param name="toc.section.depth">2</xsl:param>
24 <xsl:param name="generate.toc">25 <xsl:param name="generate.toc">
25 book toc26 book toc
@@ -61,6 +62,9 @@
61 <xsl:param name="gtkdoc.version" select="''"/>62 <xsl:param name="gtkdoc.version" select="''"/>
62 <xsl:param name="gtkdoc.bookname" select="''"/>63 <xsl:param name="gtkdoc.bookname" select="''"/>
6364
65 <!-- Override the typical template to prevent showing titles -->
66 <xsl:param name="admon.textlabel" select="0"/>
67
64 <!-- ========================================================= -->68 <!-- ========================================================= -->
6569
66 <!-- l10n is slow, we don't ue it, so we'd like to turn it off70 <!-- l10n is slow, we don't ue it, so we'd like to turn it off
@@ -390,6 +394,15 @@
390 <xsl:apply-imports/>394 <xsl:apply-imports/>
391 </xsl:template>395 </xsl:template>
392396
397 <xsl:template name="user.head.title">
398 <xsl:param name="node" select="."/>
399 <xsl:param name="title"/>
400 <xsl:variable name="home" select="/*[1]"/>
401 <title>
402 <xsl:apply-templates select="$home" mode="object.title.markup"/>: <xsl:copy-of select="$title"/>
403 </title>
404 </xsl:template>
405
393 <xsl:template name="user.head.content">406 <xsl:template name="user.head.content">
394 <xsl:if test="$gtkdoc.version">407 <xsl:if test="$gtkdoc.version">
395 <meta name="generator" content="GTK-Doc V{$gtkdoc.version} (XML mode)"/>408 <meta name="generator" content="GTK-Doc V{$gtkdoc.version} (XML mode)"/>
@@ -454,242 +467,199 @@
454467
455 <xsl:if test="$suppress.navigation = '0' and $home != .">468 <xsl:if test="$suppress.navigation = '0' and $home != .">
456 <table class="navigation" id="top" width="100%"469 <table class="navigation" id="top" width="100%"
457 summary = "Navigation header" cellpadding="2" cellspacing="2">470 summary = "Navigation header" cellpadding="2" cellspacing="10">
458 <tr valign="middle">471 <tr valign="middle">
459 <xsl:choose>472 <td width="100%" align="left" class="shortcuts">
460 <xsl:when test="count($prev) > 0">473 <!--<xsl:if test="name()='refentry'"-->
461 <td>474 <xsl:choose>
462 <a accesskey="p">475 <xsl:when test="count($refsections) > 0">
463 <xsl:attribute name="href">476 <a href="#" class="shortcut">Top</a>
464 <xsl:call-template name="href.target">
465 <xsl:with-param name="object" select="$prev"/>
466 </xsl:call-template>
467 </xsl:attribute>
468 <img src="left.png" width="24" height="24" border="0">
469 <xsl:attribute name="alt">
470 <xsl:call-template name="gentext">
471 <xsl:with-param name="key">nav-prev</xsl:with-param>
472 </xsl:call-template>
473 </xsl:attribute>
474 </img>
475 </a>
476 </td>
477 </xsl:when>
478 <xsl:otherwise>
479 <td>&#160;</td>
480 </xsl:otherwise>
481 </xsl:choose>
482 <xsl:choose>
483 <xsl:when test="count($up) > 0 and $up != $home">
484 <td>
485 <a accesskey="u">
486 <xsl:attribute name="href">
487 <xsl:call-template name="href.target">
488 <xsl:with-param name="object" select="$up"/>
489 </xsl:call-template>
490 </xsl:attribute>
491 <img src="up.png" width="24" height="24" border="0">
492 <xsl:attribute name="alt">
493 <xsl:call-template name="gentext">
494 <xsl:with-param name="key">nav-up</xsl:with-param>
495 </xsl:call-template>
496 </xsl:attribute>
497 </img>
498 </a>
499 </td>
500 </xsl:when>
501 <xsl:otherwise>
502 <td>&#160;</td>
503 </xsl:otherwise>
504 </xsl:choose>
505 <xsl:choose>
506 <xsl:when test="$home != .">
507 <td>
508 <a accesskey="h">
509 <xsl:attribute name="href">
510 <xsl:call-template name="href.target">
511 <xsl:with-param name="object" select="$home"/>
512 </xsl:call-template>
513 </xsl:attribute>
514 <img src="home.png" width="24" height="24" border="0">
515 <xsl:attribute name="alt">
516 <xsl:call-template name="gentext">
517 <xsl:with-param name="key">nav-home</xsl:with-param>
518 </xsl:call-template>
519 </xsl:attribute>
520 </img>
521 </a>
522 </td>
523 </xsl:when>
524 <xsl:otherwise>
525 <td>&#160;</td>
526 </xsl:otherwise>
527 </xsl:choose>
528 <th width="100%" align="center">
529 <xsl:apply-templates select="$home" mode="object.title.markup"/>
530 </th>
531 <xsl:choose>
532 <xsl:when test="count($next) > 0">
533 <td>
534 <a accesskey="n">
535 <xsl:attribute name="href">
536 <xsl:call-template name="href.target">
537 <xsl:with-param name="object" select="$next"/>
538 </xsl:call-template>
539 </xsl:attribute>
540 <img src="right.png" width="24" height="24" border="0">
541 <xsl:attribute name="alt">
542 <xsl:call-template name="gentext">
543 <xsl:with-param name="key">nav-next</xsl:with-param>
544 </xsl:call-template>
545 </xsl:attribute>
546 </img>
547 </a>
548 </td>
549 </xsl:when>
550 <xsl:otherwise>
551 <td>&#160;</td>
552 </xsl:otherwise>
553 </xsl:choose>
554 </tr>
555 <!--<xsl:if test="name()='refentry'"-->
556 <xsl:choose>
557 <xsl:when test="count($refsections) > 0">
558 <tr>
559 <td colspan="5" class="shortcuts">
560 <xsl:if test="count($sect_synopsis) > 0">
561 <a href="#{$section_id}.synopsis" class="shortcut">Top</a>
562 </xsl:if>
563 <xsl:if test="count($sect_desc) > 0">477 <xsl:if test="count($sect_desc) > 0">
564 &#160;|&#160;478 <span id="nav_description">&#160;<span class="dim">|</span>&#160;
565 <a href="#{$section_id}.description" class="shortcut">479 <a href="#{$section_id}.description" class="shortcut">
566 <xsl:value-of select="./refsect1[@role='desc']/title"/>480 <xsl:value-of select="./refsect1[@role='desc']/title"/>
567 </a>481 </a></span>
568 </xsl:if>482 </xsl:if>
569 <xsl:if test="count($sect_object_hierarchy) > 0">483 <xsl:if test="count($sect_object_hierarchy) > 0">
570 &#160;|&#160;484 <span id="nav_hierarchy">&#160;<span class="dim">|</span>&#160;
571 <a href="#{$section_id}.object-hierarchy" class="shortcut">485 <a href="#{$section_id}.object-hierarchy" class="shortcut">
572 <xsl:value-of select="./refsect1[@role='object_hierarchy']/title"/>486 <xsl:value-of select="./refsect1[@role='object_hierarchy']/title"/>
573 </a>487 </a></span>
574 </xsl:if>488 </xsl:if>
575 <xsl:if test="count($sect_impl_interfaces) > 0">489 <xsl:if test="count($sect_impl_interfaces) > 0">
576 &#160;|&#160;490 <span id="nav_interfaces">&#160;<span class="dim">|</span>&#160;
577 <a href="#{$section_id}.implemented-interfaces" class="shortcut">491 <a href="#{$section_id}.implemented-interfaces" class="shortcut">
578 <xsl:value-of select="./refsect1[@role='impl_interfaces']/title"/>492 <xsl:value-of select="./refsect1[@role='impl_interfaces']/title"/>
579 </a>493 </a></span>
580 </xsl:if>494 </xsl:if>
581 <xsl:if test="count($sect_prerequisites) > 0">495 <xsl:if test="count($sect_prerequisites) > 0">
582 &#160;|&#160;496 <span id="nav_prerequisites">&#160;<span class="dim">|</span>&#160;
583 <a href="#{$section_id}.prerequisites" class="shortcut">497 <a href="#{$section_id}.prerequisites" class="shortcut">
584 <xsl:value-of select="./refsect1[@role='prerequisites']/title"/>498 <xsl:value-of select="./refsect1[@role='prerequisites']/title"/>
585 </a>499 </a></span>
586 </xsl:if>500 </xsl:if>
587 <xsl:if test="count($sect_derived_interfaces) > 0">501 <xsl:if test="count($sect_derived_interfaces) > 0">
588 &#160;|&#160;502 <span id="nav_derived_interfaces">&#160;<span class="dim">|</span>&#160;
589 <a href="#{$section_id}.derived-interfaces" class="shortcut">503 <a href="#{$section_id}.derived-interfaces" class="shortcut">
590 <xsl:value-of select="./refsect1[@role='derived_interfaces']/title"/>504 <xsl:value-of select="./refsect1[@role='derived_interfaces']/title"/>
591 </a>505 </a></span>
592 </xsl:if>506 </xsl:if>
593 <xsl:if test="count($sect_implementations) > 0">507 <xsl:if test="count($sect_implementations) > 0">
594 &#160;|&#160;508 <span id="nav_implementations">&#160;<span class="dim">|</span>&#160;
595 <a href="#{$section_id}.implementations" class="shortcut">509 <a href="#{$section_id}.implementations" class="shortcut">
596 <xsl:value-of select="./refsect1[@role='implementations']/title"/>510 <xsl:value-of select="./refsect1[@role='implementations']/title"/>
597 </a>511 </a></span>
598 </xsl:if>512 </xsl:if>
599 <xsl:if test="count($sect_properties) > 0">513 <xsl:if test="count($sect_properties) > 0">
600 &#160;|&#160;514 <span id="nav_properties">&#160;<span class="dim">|</span>&#160;
601 <a href="#{$section_id}.properties" class="shortcut">515 <a href="#{$section_id}.properties" class="shortcut">
602 <xsl:value-of select="./refsect1[@role='properties']/title"/>516 <xsl:value-of select="./refsect1[@role='properties']/title"/>
603 </a>517 </a></span>
604 </xsl:if>518 </xsl:if>
605 <xsl:if test="count($sect_child_properties) > 0">519 <xsl:if test="count($sect_child_properties) > 0">
606 &#160;|&#160;520 <span id="nav_child_properties">&#160;<span class="dim">|</span>&#160;
607 <a href="#{$section_id}.child-properties" class="shortcut">521 <a href="#{$section_id}.child-properties" class="shortcut">
608 <xsl:value-of select="./refsect1[@role='child_properties']/title"/>522 <xsl:value-of select="./refsect1[@role='child_properties']/title"/>
609 </a>523 </a></span>
610 </xsl:if>524 </xsl:if>
611 <xsl:if test="count($sect_style_properties) > 0">525 <xsl:if test="count($sect_style_properties) > 0">
612 &#160;|&#160;526 <span id="nav_style_properties">&#160;<span class="dim">|</span>&#160;
613 <a href="#{$section_id}.style-properties" class="shortcut">527 <a href="#{$section_id}.style-properties" class="shortcut">
614 <xsl:value-of select="./refsect1[@role='style_properties']/title"/>528 <xsl:value-of select="./refsect1[@role='style_properties']/title"/>
615 </a>529 </a></span>
616 </xsl:if>530 </xsl:if>
617 <xsl:if test="count($sect_signal_proto) > 0">531 <xsl:if test="count($sect_signal_proto) > 0">
618 &#160;|&#160;532 <span id="nav_signals">&#160;<span class="dim">|</span>&#160;
619 <a href="#{$section_id}.signals" class="shortcut">533 <a href="#{$section_id}.signals" class="shortcut">
620 <xsl:value-of select="./refsect1[@role='signal_proto']/title"/>534 <xsl:value-of select="./refsect1[@role='signal_proto']/title"/>
621 </a>535 </a></span>
622 </xsl:if>536 </xsl:if>
623 <!--537 </xsl:when>
624 <xsl:if test="count($sect_details) > 0">538 <!-- this is not yet very nice, as it requires all glossdic/indexdiv
625 <a href="#details" class="shortcut">539 elements having a anchor element. maybe we can customize the xsl
626 <xsl:value-of select="./refsect1[@id='details']/title"/>540 to automaticaly create local anchors
627 </a>541 -->
628 &#160;|&#160;542 <xsl:when test="count($glssections) > 0">
629 </xsl:if>543 <span id="nav_glossary">
630 <xsl:if test="count($sect_property_details) > 0">544 <xsl:for-each select="./glossdiv">
631 <a href="#property_details" class="shortcut">545 <xsl:if test="position() > 1">
632 <xsl:value-of select="./refsect1[@id='property_details']/title"/>546 &#160;<span class="dim">|</span>&#160;
633 </a>547 </xsl:if>
634 &#160;|&#160;548 <a class="shortcut">
635 </xsl:if>549 <xsl:attribute name="href">#gls<xsl:value-of select="./title"/></xsl:attribute>
636 <xsl:if test="count($sect_child_property_details) > 0">550 <xsl:value-of select="./title"/>
637 <a href="#child_property_details" class="shortcut">551 </a>
638 <xsl:value-of select="./refsect1[@id='property_child_details']/title"/>552 </xsl:for-each>
639 </a>553 </span>
640 &#160;|&#160;554 </xsl:when>
641 </xsl:if>555 <xsl:when test="count($idxsections) > 0">
642 <xsl:if test="count($sect_style_property_details) > 0">556 <span id="nav_index">
643 <a href="#style_property_details" class="shortcut">557 <xsl:for-each select="./indexdiv/indexdiv">
644 <xsl:value-of select="./refsect1[@id='style_property_details']/title"/>558 <xsl:if test="position() > 1">
645 </a>559 &#160;<span class="dim">|</span>&#160;
646 &#160;|&#160;560 </xsl:if>
647 </xsl:if>561 <a class="shortcut">
648 <xsl:if test="count($sect_signals) > 0">562 <xsl:attribute name="href">#idx<xsl:value-of select="./title"/></xsl:attribute>
649 <a href="#signals" class="shortcut">563 <xsl:value-of select="./title"/>
650 <xsl:value-of select="./refsect1[@id='signals']/title"/>564 </a>
651 </a>565 </xsl:for-each>
652 &#160;|&#160;566 </span>
653 </xsl:if>567 </xsl:when>
654 -->568 </xsl:choose>
655 </td>569 </td>
656 </tr>570 <xsl:choose>
657 </xsl:when>571 <xsl:when test="$home != .">
658 <!-- this is not yet very nice, as it requires all glossdic/indexdiv572 <td>
659 elements having a anchor element. maybe we can customize the xsl573 <a accesskey="h">
660 to automaticaly create local anchors574 <xsl:attribute name="href">
661 -->575 <xsl:call-template name="href.target">
662 <xsl:when test="count($glssections) > 0">576 <xsl:with-param name="object" select="$home"/>
663 <tr>577 </xsl:call-template>
664 <td colspan="5" class="shortcuts">578 </xsl:attribute>
665 <xsl:for-each select="./glossdiv">579 <img src="home.png" width="16" height="16" border="0">
666 <xsl:if test="position() > 1">580 <xsl:attribute name="alt">
667 &#160;|&#160;581 <xsl:call-template name="gentext">
668 </xsl:if>582 <xsl:with-param name="key">nav-home</xsl:with-param>
669 <a class="shortcut">583 </xsl:call-template>
670 <xsl:attribute name="href">#gls<xsl:value-of select="./title"/></xsl:attribute>584 </xsl:attribute>
671 <xsl:value-of select="./title"/>585 </img>
672 </a>586 </a>
673 </xsl:for-each>587 </td>
674 </td>588 </xsl:when>
675 </tr>589 <xsl:otherwise>
676 </xsl:when>590 <td>&#160;</td>
677 <xsl:when test="count($idxsections) > 0">591 </xsl:otherwise>
678 <tr>592 </xsl:choose>
679 <td colspan="5" class="shortcuts">593 <xsl:choose>
680 <xsl:for-each select="./indexdiv/indexdiv">594 <xsl:when test="count($up) > 0 and $up != $home">
681 <xsl:if test="position() > 1">595 <td>
682 &#160;|&#160;596 <a accesskey="u">
683 </xsl:if>597 <xsl:attribute name="href">
684 <a class="shortcut">598 <xsl:call-template name="href.target">
685 <xsl:attribute name="href">#idx<xsl:value-of select="./title"/></xsl:attribute>599 <xsl:with-param name="object" select="$up"/>
686 <xsl:value-of select="./title"/>600 </xsl:call-template>
687 </a>601 </xsl:attribute>
688 </xsl:for-each>602 <img src="up.png" width="16" height="16" border="0">
689 </td>603 <xsl:attribute name="alt">
690 </tr>604 <xsl:call-template name="gentext">
691 </xsl:when>605 <xsl:with-param name="key">nav-up</xsl:with-param>
692 </xsl:choose>606 </xsl:call-template>
607 </xsl:attribute>
608 </img>
609 </a>
610 </td>
611 </xsl:when>
612 <xsl:otherwise>
613 <td><img src="up-insensitive.png" width="16" height="16" border="0"/></td>
614 </xsl:otherwise>
615 </xsl:choose>
616 <xsl:choose>
617 <xsl:when test="count($prev) > 0">
618 <td>
619 <a accesskey="p">
620 <xsl:attribute name="href">
621 <xsl:call-template name="href.target">
622 <xsl:with-param name="object" select="$prev"/>
623 </xsl:call-template>
624 </xsl:attribute>
625 <img src="left.png" width="16" height="16" border="0">
626 <xsl:attribute name="alt">
627 <xsl:call-template name="gentext">
628 <xsl:with-param name="key">nav-prev</xsl:with-param>
629 </xsl:call-template>
630 </xsl:attribute>
631 </img>
632 </a>
633 </td>
634 </xsl:when>
635 <xsl:otherwise>
636 <td><img src="left-insensitive.png" width="16" height="16" border="0"/></td>
637 </xsl:otherwise>
638 </xsl:choose>
639 <xsl:choose>
640 <xsl:when test="count($next) > 0">
641 <td>
642 <a accesskey="n">
643 <xsl:attribute name="href">
644 <xsl:call-template name="href.target">
645 <xsl:with-param name="object" select="$next"/>
646 </xsl:call-template>
647 </xsl:attribute>
648 <img src="right.png" width="16" height="16" border="0">
649 <xsl:attribute name="alt">
650 <xsl:call-template name="gentext">
651 <xsl:with-param name="key">nav-next</xsl:with-param>
652 </xsl:call-template>
653 </xsl:attribute>
654 </img>
655 </a>
656 </td>
657 </xsl:when>
658 <xsl:otherwise>
659 <td><img src="right-insensitive.png" width="16" height="16" border="0"/></td>
660 </xsl:otherwise>
661 </xsl:choose>
662 </tr>
693 </table>663 </table>
694 </xsl:if>664 </xsl:if>
695 </xsl:template>665 </xsl:template>
@@ -786,7 +756,7 @@
786 <xsl:apply-templates/>756 <xsl:apply-templates/>
787 </p>757 </p>
788 </td>758 </td>
789 <td valign="top" align="right">759 <td class="gallery_image" valign="top" align="right">
790 <xsl:choose>760 <xsl:choose>
791 <xsl:when test="../refmeta/refmiscinfo/inlinegraphic">761 <xsl:when test="../refmeta/refmiscinfo/inlinegraphic">
792 <xsl:apply-templates select="../refmeta/refmiscinfo/inlinegraphic"/>762 <xsl:apply-templates select="../refmeta/refmiscinfo/inlinegraphic"/>
@@ -828,7 +798,7 @@
828 <span class="extralinks">798 <span class="extralinks">
829 <xsl:for-each select="../ulink[@role='extralinks']">799 <xsl:for-each select="../ulink[@role='extralinks']">
830 <xsl:if test="position() = 1">[&#160;</xsl:if>800 <xsl:if test="position() = 1">[&#160;</xsl:if>
831 <xsl:if test="position() > 1">&#160;|&#160;</xsl:if>801 <xsl:if test="position() > 1">&#160;<span class="dim">|</span>&#160;</xsl:if>
832 <a>802 <a>
833 <xsl:attribute name="href"><xsl:value-of select="@url"/></xsl:attribute>803 <xsl:attribute name="href"><xsl:value-of select="@url"/></xsl:attribute>
834 <xsl:copy-of select="text()" />804 <xsl:copy-of select="text()" />
835805
=== added file 'gtkdoc-common.pl'
--- gtkdoc-common.pl 1970-01-01 00:00:00 +0000
+++ gtkdoc-common.pl 2014-02-17 20:15:47 +0000
@@ -0,0 +1,543 @@
1#!/usr/bin/perl -w
2# -*- cperl -*-
3#
4# gtk-doc - GTK DocBook documentation generator.
5# Copyright (C) 2001 Damon Chaplin
6#
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 2 of the License, or
10# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program; if not, write to the Free Software
19# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20#
21
22#
23# These are functions used by several of the gtk-doc Perl scripts.
24# We'll move more of the common routines here eventually, though they need to
25# stop using global variables first.
26#
27
281;
29
30
31#############################################################################
32# Function : UpdateFileIfChanged
33# Description : Compares the old version of the file with the new version and
34# if the file has changed it moves the new version into the old
35# versions place. This is used so we only change files if
36# needed, so we can do proper dependency tracking and we don't
37# needlessly check files into version control systems that haven't
38# changed.
39# It returns 0 if the file hasn't changed, and 1 if it has.
40# Arguments : $old_file - the pathname of the old file.
41# $new_file - the pathname of the new version of the file.
42# $make_backup - 1 if a backup of the old file should be kept.
43# It will have the .bak suffix added to the file name.
44#############################################################################
45
46sub UpdateFileIfChanged {
47 my ($old_file, $new_file, $make_backup) = @_;
48
49 #LogTrace("Comparing $old_file with $new_file...");
50
51 # If the old file doesn't exist we want this to default to 1.
52 my $exit_code = 1;
53
54 if (-e $old_file) {
55 `cmp -s "$old_file" "$new_file"`;
56 $exit_code = $? >> 8;
57 #LogTrace(" cmp exit code: $exit_code ($?)";
58 }
59
60 if ($exit_code > 1) {
61 die "Error running 'cmp $old_file $new_file'";
62 }
63
64 if ($exit_code == 1) {
65 #LogTrace(" files changed - replacing old version with new version.");
66 if ($make_backup && -e $old_file) {
67 rename ($old_file, "$old_file.bak")
68 || die "Can't move $old_file to $old_file.bak: $!";
69 }
70 rename ($new_file, $old_file)
71 || die "Can't move $new_file to $old_file: $!";
72
73 return 1;
74 } else {
75 #LogTrace(" files the same - deleting new version.");
76 unlink ("$new_file")
77 || die "Can't delete file: $new_file: $!";
78
79 return 0;
80 }
81}
82
83
84#############################################################################
85# Function : ParseStructDeclaration
86# Description : This function takes a structure declaration and
87# breaks it into individual type declarations.
88# Arguments : $declaration - the declaration to parse
89# $is_object - true if this is an object structure
90# $output_function_params - true if full type is wanted for
91# function pointer members
92# $typefunc - function reference to apply to type
93# $namefunc - function reference to apply to name
94#############################################################################
95
96sub ParseStructDeclaration {
97 my ($declaration, $is_object, $output_function_params, $typefunc, $namefunc) = @_;
98
99 # For forward struct declarations just return an empty array.
100 if ($declaration =~ m/(?:struct|union)\s+\S+\s*;/msg) {
101 return ();
102 }
103
104 # Remove all private parts of the declaration
105
106 # For objects, assume private
107 if ($is_object) {
108 $declaration =~ s!((?:struct|union)\s+\w*\s*\{)
109 .*?
110 (?:/\*\s*<\s*public\s*>\s*\*/|(?=\}))!$1!msgx;
111 }
112
113 # Remove private symbols
114 # Assume end of declaration if line begins with '}'
115 $declaration =~ s!\n?[ \t]*/\*\s*<\s*(private|protected)\s*>\s*\*/.*?(?:/\*\s*<\s*public\s*>\s*\*/|(?=^\}))!!msgx;
116
117 # Remove all other comments
118 $declaration =~ s@\n\s*/\*([^*]+|\*(?!/))*\*/\s*\n@\n@msg;
119 $declaration =~ s@/\*([^*]+|\*(?!/))*\*/@ @g;
120 $declaration =~ s@\n\s*//.*?\n@\n@msg;
121 $declaration =~ s@//.*@@g;
122
123 my @result = ();
124
125 if ($declaration =~ /^\s*$/) {
126 return @result;
127 }
128
129 # Prime match after "struct/union {" declaration
130 if (!scalar($declaration =~ m/(?:struct|union)\s+\w*\s*\{/msg)) {
131 die "Declaration '$declaration' does not begin with struct/union [NAME] {\n";
132 }
133
134 #LogTrace("public fields in struct/union: $declaration");
135
136 # Treat lines in sequence, allowing singly nested anonymous structs
137 # and unions.
138 while ($declaration =~ m/\s*([^{;]+(\{[^\}]*\}[^{;]+)?);/msg) {
139 my $line = $1;
140
141 last if $line =~ /^\s*\}\s*\w*\s*$/;
142
143 # FIXME: Just ignore nested structs and unions for now
144 next if $line =~ /{/;
145
146 # ignore preprocessor directives
147 while ($line =~ /^#.*?\n\s*(.*)/msg) {
148 $line=$1;
149 }
150
151 last if $line =~ /^\s*\}\s*\w*\s*$/;
152
153 # Try to match structure members which are functions
154 if ($line =~ m/^
155 (const\s+|G_CONST_RETURN\s+|unsigned\s+|signed\s+|long\s+|short\s+)*(struct\s+|enum\s+)? # mod1
156 (\w+)\s* # type
157 (\**(?:\s*restrict)?)\s* # ptr1
158 (const\s+)? # mod2
159 (\**\s*) # ptr2
160 (const\s+)? # mod3
161 \(\s*\*\s*(\w+)\s*\)\s* # name
162 \(([^)]*)\)\s* # func_params
163 $/x) {
164
165 my $mod1 = defined($1) ? $1 : "";
166 if (defined($2)) { $mod1 .= $2; }
167 my $type = $3;
168 my $ptr1 = $4;
169 my $mod2 = defined($5) ? $5 : "";
170 my $ptr2 = $6;
171 my $mod3 = defined($7) ? $7 : "";
172 my $name = $8;
173 my $func_params = $9;
174 my $ptype = defined $typefunc ? $typefunc->($type, "<type>$type</type>") : $type;
175 my $pname = defined $namefunc ? $namefunc->($name) : $name;
176
177 push @result, $name;
178
179 if ($output_function_params) {
180 push @result, "$mod1$ptype$ptr1$mod2$ptr2$mod3 (*$pname) ($func_params)";
181 } else {
182 push @result, "$pname&#160;()";
183 }
184
185
186 # Try to match normal struct fields of comma-separated variables/
187 } elsif ($line =~ m/^
188 ((?:const\s+|volatile\s+|unsigned\s+|signed\s+|short\s+|long\s+)?)(struct\s+|enum\s+)? # mod1
189 (\w+)\s* # type
190 (\** \s* const\s+)? # mod2
191 (.*) # variables
192 $/x) {
193
194 my $mod1 = defined($1) ? $1 : "";
195 if (defined($2)) { $mod1 .= $2; }
196 my $type = $3;
197 my $ptype = defined $typefunc ? $typefunc->($type, "<type>$type</type>") : $type;
198 my $mod2 = defined($4) ? " " . $4 : "";
199 my $list = $5;
200
201 #LogTrace("'$mod1' '$type' '$mod2' '$list'");
202
203 $mod1 =~ s/ /&#160;/g;
204 $mod2 =~ s/ /&#160;/g;
205
206 my @names = split /,/, $list;
207 for my $n (@names) {
208 # Each variable can have any number of '*' before the
209 # identifier, and be followed by any number of pairs of
210 # brackets or a bit field specifier.
211 # e.g. *foo, ***bar, *baz[12][23], foo : 25.
212 if ($n =~ m/^\s* (\**(?:\s*restrict\b)?) \s* (\w+) \s* (?: ((?:\[[^\]]*\]\s*)+) | (:\s*\d+)?) \s* $/x) {
213 my $ptrs = $1;
214 my $name = $2;
215 my $array = defined($3) ? $3 : "";
216 my $bits = defined($4) ? " $4" : "";
217
218 if ($ptrs && $ptrs !~ m/\*$/) { $ptrs .= " "; }
219 $array =~ s/ /&#160;/g;
220 $bits =~ s/ /&#160;/g;
221
222 push @result, $name;
223 if (defined $namefunc) {
224 $name = $namefunc->($name);
225 }
226 push @result, "$mod1$ptype$mod2&#160;$ptrs$name$array$bits;";
227
228 #LogTrace("Matched line: $mod1$ptype$mod2 $ptrs$name$array$bits");
229 } else {
230 print "WARNING: Couldn't parse struct field: $n\n";
231 }
232 }
233
234 } else {
235 print "WARNING: Cannot parse structure field: \"$line\"\n";
236 }
237 }
238
239 return @result;
240}
241
242
243#############################################################################
244# Function : ParseEnumDeclaration
245# Description : This function takes a enumeration declaration and
246# breaks it into individual enum member declarations.
247# Arguments : $declaration - the declaration to parse
248#############################################################################
249
250sub ParseEnumDeclaration {
251 my ($declaration, $is_object) = @_;
252
253 # For forward enum declarations just return an empty array.
254 if ($declaration =~ m/enum\s+\S+\s*;/msg) {
255 return ();
256 }
257
258 # Remove private symbols
259 # Assume end of declaration if line begins with '}'
260 $declaration =~ s!\n?[ \t]*/\*\s*<\s*(private|protected)\s*>\s*\*/.*?(?:/\*\s*<\s*public\s*>\s*\*/|(?=^\}))!!msgx;
261
262 # Remove all other comments
263 $declaration =~ s@\n\s*/\*([^*]+|\*(?!/))*\*/\s*\n@\n@msg;
264 $declaration =~ s@/\*([^*]+|\*(?!/))*\*/@ @g;
265 $declaration =~ s@\n\s*//.*?\n@\n@msg;
266 $declaration =~ s@//.*@@g;
267
268 my @result = ();
269
270 if ($declaration =~ /^\s*$/) {
271 return @result;
272 }
273
274 # Remove parenthesized expressions (in macros like GTK_BLAH = BLAH(1,3))
275 # to avoid getting confused by commas they might contain. This
276 # doesn't handle nested parentheses correctly.
277
278 $declaration =~ s/\([^)\n]+\)//g;
279
280 # Remove comma from comma - possible whitespace - closing brace sequence
281 # since it is legal in GNU C and C99 to have a trailing comma but doesn't
282 # result in an actual enum member
283
284 $declaration =~ s/,(\s*})/$1/g;
285
286 # Prime match after "typedef enum {" declaration
287 if (!scalar($declaration =~ m/(typedef\s+)?enum\s*(\S+\s*)?\{/msg)) {
288 die "Enum declaration '$declaration' does not begin with 'typedef enum {' or 'enum XXX {'\n";
289 }
290
291 #LogTrace("public fields in enum: $declaration");
292
293 # Treat lines in sequence.
294 while ($declaration =~ m/\s*([^,\}]+)([,\}])/msg) {
295 my $line = $1;
296 my $terminator = $2;
297
298 # ignore preprocessor directives
299 while ($line =~ /^#.*?\n\s*(.*)/msg) {
300 $line=$1;
301 }
302
303 if ($line =~ m/^(\w+)\s*(=.*)?$/msg) {
304 push @result, $1;
305
306 # Special case for GIOCondition, where the values are specified by
307 # macros which expand to include the equal sign like '=1'.
308 } elsif ($line =~ m/^(\w+)\s*GLIB_SYSDEF_POLL/msg) {
309 push @result, $1;
310
311 # Special case include of <gdk/gdkcursors.h>, just ignore it
312 } elsif ($line =~ m/^#include/) {
313 last;
314
315 # Special case for #ifdef/#else/#endif, just ignore it
316 } elsif ($line =~ m/^#(?:if|else|endif)/) {
317 last;
318
319 } else {
320 warn "Cannot parse enumeration member \"$line\"";
321 }
322
323 last if $terminator eq '}';
324 }
325
326 return @result;
327}
328
329
330#############################################################################
331# Function : ParseFunctionDeclaration
332# Description : This function takes a function declaration and
333# breaks it into individual parameter declarations.
334# Arguments : $declaration - the declaration to parse
335# $typefunc - function reference to apply to type
336# $namefunc - function reference to apply to name
337#############################################################################
338
339sub ParseFunctionDeclaration {
340 my ($declaration, $typefunc, $namefunc) = @_;
341
342 my @result = ();
343
344 my ($param_num) = 0;
345 while ($declaration ne "") {
346 #LogTrace("[$declaration]");
347
348 if ($declaration =~ s/^[\s,]+//) {
349 # skip whitespace and commas
350 next;
351
352 } elsif ($declaration =~ s/^void\s*[,\n]//) {
353 if ($param_num != 0) {
354 # FIXME: whats the problem here?
355 warn "void used as parameter in function $declaration";
356 }
357 push @result, "void";
358 my $xref = "<type>void</type>";
359 my $label = defined $namefunc ? $namefunc->($xref) : $xref;
360 push @result, $label;
361
362 } elsif ($declaration =~ s/^\s*[_a-zA-Z0-9]*\.\.\.\s*[,\n]//) {
363 push @result, "...";
364 my $label = defined $namefunc ? $namefunc->("...") : "...";
365 push @result, $label;
366
367 # allow alphanumerics, '_', '[' & ']' in param names
368 # Try to match a standard parameter
369 # $1 $2 $3 $4 $5
370 } elsif ($declaration =~ s/^\s*((?:(?:G_CONST_RETURN|G_GNUC_[A-Z_]+\s+|unsigned long|unsigned short|signed long|signed short|unsigned|signed|long|short|volatile|const)\s+)*)((?:struct\b|enum\b)?\s*\w+)\s*((?:(?:const\b|restrict\b|G_GNUC_[A-Z_]+\b)?\s*\*?\s*(?:const\b|restrict\b|G_GNUC_[A-Z_]+\b)?\s*)*)(\w+)?\s*((?:\[\S*\])*)\s*(?:G_GNUC_[A-Z_]+)?\s*[,\n]//) {
371 my $pre = defined($1) ? $1 : "";
372 my $type = $2;
373 my $ptr = defined($3) ? $3 : "";
374 my $name = defined($4) ? $4 : "";
375 my $array = defined($5) ? $5 : "";
376
377 $pre =~ s/\s+/ /g;
378 $type =~ s/\s+/ /g;
379 $ptr =~ s/\s+/ /g;
380 $ptr =~ s/\s+$//;
381 if ($ptr && $ptr !~ m/\*$/) { $ptr .= " "; }
382
383 #LogTrace("$symbol: '$pre' '$type' '$ptr' '$name' '$array'");
384
385 if (($name eq "") && $pre =~ m/^((un)?signed .*)\s?/ ) {
386 $name = $type;
387 $type = "$1";
388 $pre = "";
389 }
390
391 if ($name eq "") {
392 $name = "Param" . ($param_num + 1);
393 }
394
395 #LogTrace("$symbol: '$pre' '$type' '$ptr' '$name' '$array'");
396
397 push @result, $name;
398 my $xref = defined $typefunc ? $typefunc->($type, "<type>$type</type>") : $type;
399 my $label = "$pre$xref $ptr$name$array";
400 if (defined $namefunc) {
401 $label = $namefunc->($label)
402 }
403 push @result, $label;
404
405 # Try to match parameters which are functions
406 # $1 $2 $3 $4 $5 $6 $7 $8
407 } elsif ($declaration =~ s/^(const\s+|G_CONST_RETURN\s+|G_GNUC_[A-Z_]+\s+|signed\s+|unsigned\s+)*(struct\s+)?(\w+)\s*(\**)\s*(?:restrict\b)?\s*(const\s+)?\(\s*(\*[\s\*]*)\s*(\w+)\s*\)\s*\(([^)]*)\)\s*[,\n]//) {
408 my $mod1 = defined($1) ? $1 : "";
409 if (defined($2)) { $mod1 .= $2; }
410 my $type = $3;
411 my $ptr1 = $4;
412 my $mod2 = defined($5) ? $5 : "";
413 my $func_ptr = $6;
414 my $name = $7;
415 my $func_params = defined($8) ? $8 : "";
416
417 #if (!defined($type)) { print "## no type\n"; };
418 #if (!defined($ptr1)) { print "## no ptr1\n"; };
419 #if (!defined($func_ptr)) { print "## no func_ptr\n"; };
420 #if (!defined($name)) { print "## no name\n"; };
421
422 if ($ptr1 && $ptr1 !~ m/\*$/) { $ptr1 .= " "; }
423 $func_ptr =~ s/\s+//g;
424
425 push @result, $name;
426 my $xref = defined $typefunc ? $typefunc->($type, "<type>$type</type>") : $type;
427 #LogTrace("Type: [$mod1][$xref][$ptr1][$mod2] ([$func_ptr][$name]) ($func_params)");
428 my $label = "$mod1$xref$ptr1$mod2 ($func_ptr$name) ($func_params)";
429 if (defined $namefunc) {
430 $label = $namefunc->($label)
431 }
432 push @result, $label;
433 } else {
434 warn "Can't parse args for function in \"$declaration\"";
435 last;
436 }
437 $param_num++;
438 }
439
440 return @result;
441}
442
443
444#############################################################################
445# Function : ParseMacroDeclaration
446# Description : This function takes a macro declaration and
447# breaks it into individual parameter declarations.
448# Arguments : $declaration - the declaration to parse
449# $namefunc - function reference to apply to name
450#############################################################################
451
452sub ParseMacroDeclaration {
453 my ($declaration, $namefunc) = @_;
454
455 my @result = ();
456
457 if ($declaration =~ m/^\s*#\s*define\s+\w+\(([^\)]*)\)/) {
458 my $params = $1;
459
460 $params =~ s/\\\n//g;
461 foreach $param (split (/,/, $params)) {
462 $param =~ s/^\s+//;
463 $param =~ s/\s*$//;
464 # Allow varargs variations
465 if ($param =~ m/^.*\.\.\.$/) {
466 $param = "...";
467 }
468 if ($param =~ m/\S/) {
469 push @result, $param;
470 push @result, defined $namefunc ? $namefunc->($param) : $param;
471 }
472 }
473 }
474
475 return @result;
476}
477
478
479#############################################################################
480# Function : LogWarning
481# Description : Log a warning in gcc style format
482# Arguments : $file - the file the error comes from
483# $line - line number for the wrong entry
484# $message - description of the issue
485#############################################################################
486
487sub LogWarning {
488 my ($file, $line, $message) = @_;
489
490 $file="unknown" if !defined($file);
491 $line="0" if !defined($line);
492
493 print "$file:$line: warning: $message\n"
494}
495
496sub LogTrace {
497 my ($message) = @_;
498
499 if (defined($ENV{"GTKDOC_TRACE"})) {
500 my (undef, $file, $line) = caller;
501
502 chomp($message);
503 print "$file:$line: trace: $message\n"
504 }
505}
506
507
508#############################################################################
509# Function : CreateValidSGMLID
510# Description : Creates a valid SGML 'id' from the given string.
511# According to http://www.w3.org/TR/html4/types.html#type-id
512# "ID and NAME tokens must begin with a letter ([A-Za-z]) and
513# may be followed by any number of letters, digits ([0-9]),
514# hyphens ("-"), underscores ("_"), colons (":"), and
515# periods (".")."
516#
517# NOTE: When creating SGML IDS, we append ":CAPS" to all
518# all-caps identifiers to prevent name clashes (SGML ids are
519# case-insensitive). (It basically never is the case that
520# mixed-case identifiers would collide.)
521# Arguments : $id - the string to be converted into a valid SGML id.
522#############################################################################
523
524sub CreateValidSGMLID {
525 my ($id) = $_[0];
526
527 # Special case, '_' would end up as '' so we use 'gettext-macro' instead.
528 if ($id eq "_") { return "gettext-macro"; }
529
530 $id =~ s/[_ ]/-/g;
531 $id =~ s/[,;]//g;
532 $id =~ s/^-*//;
533 $id =~ s/::/-/g;
534 $id =~ s/:/--/g;
535
536 # Append ":CAPS" to all all-caps identifiers
537 # FIXME: there are some inconsistencies here, we have sgml.index files
538 # containing e.g. TRUE--CAPS
539 if ($id !~ /[a-z]/ && $id !~ /-CAPS$/) { $id .= ":CAPS" };
540
541 return $id;
542}
543
0544
=== modified file 'gtkdoc-fixxref.in'
--- gtkdoc-fixxref.in 2013-12-19 07:58:53 +0000
+++ gtkdoc-fixxref.in 2014-02-17 20:15:47 +0000
@@ -472,7 +472,7 @@
472 close (NEWFILE);472 close (NEWFILE);
473473
474 # format source474 # format source
475 system "echo 'let html_number_lines=0|let html_use_css=1|let use_xhtml=1|syn on|e $temp_source_file|run! syntax/2html.vim|w! $temp_source_file.html|qa!' | @HIGHLIGHT@ -n -e -u NONE -T xterm >/dev/null";475 system "echo 'let html_number_lines=0|let html_use_css=1|let html_use_xhtml=1|syn on|e $temp_source_file|run! syntax/2html.vim|w! $temp_source_file.html|qa!' | @HIGHLIGHT@ -n -e -u NONE -T xterm >/dev/null";
476476
477 my $highlighted_source;477 my $highlighted_source;
478 {478 {
@@ -481,7 +481,7 @@
481 $highlighted_source = <NEWFILE>;481 $highlighted_source = <NEWFILE>;
482 close (NEWFILE);482 close (NEWFILE);
483 }483 }
484 $highlighted_source =~ s#.*<pre>\n##s;484 $highlighted_source =~ s#.*<pre\b[^>]*>\n##s;
485 $highlighted_source =~ s#</pre>.*##s;485 $highlighted_source =~ s#</pre>.*##s;
486486
487 # need to rewrite the stylesheet classes487 # need to rewrite the stylesheet classes
488488
=== modified file 'gtkdoc-mkdb.in'
--- gtkdoc-mkdb.in 2013-12-19 07:58:53 +0000
+++ gtkdoc-mkdb.in 2014-02-17 20:15:47 +0000
@@ -25,6 +25,7 @@
25# Description : This creates the DocBook files from the edited templates.25# Description : This creates the DocBook files from the edited templates.
26#############################################################################26#############################################################################
2727
28use warnings;
28use strict;29use strict;
29use Getopt::Long;30use Getopt::Long;
3031
@@ -304,29 +305,73 @@
304my %AnnotationDefinition = (305my %AnnotationDefinition = (
305 'allow-none' => "NULL is ok, both for passing and for returning.",306 'allow-none' => "NULL is ok, both for passing and for returning.",
306 'array' => "Parameter points to an array of items.",307 'array' => "Parameter points to an array of items.",
307 'attribute' => "Free-form custom annotation.",308 'attribute' => "Deprecated free-form custom annotation, replaced by (attributes) annotation.",
309 'attributes' => "Free-form key-value pairs.",
308 'closure' => "This parameter is a 'user_data', for callbacks; many bindings can pass NULL here.",310 'closure' => "This parameter is a 'user_data', for callbacks; many bindings can pass NULL here.",
311 'constructor' => "This symbol is a constructor, not a static method.",
312 'destroy' => "This parameter is a 'destroy_data', for callbacks.",
309 'default' => "Default parameter value (for in case the <acronym>shadows</acronym>-to function has less parameters).",313 'default' => "Default parameter value (for in case the <acronym>shadows</acronym>-to function has less parameters).",
310 'element-type' => "Generics and defining elements of containers and arrays.",314 'element-type' => "Generics and defining elements of containers and arrays.",
311 'error-domains' => "Typed errors. Similar to throws in Java.",315 'error-domains' => "Typed errors. Similar to throws in Java.",
316 'foreign' => "This is a foreign struct.",
317 'get-value-func' => "The specified function is used to convert a struct from a GValue, must be a GTypeInstance.",
312 'in' => "Parameter for input. Default is <acronym>transfer none</acronym>.",318 'in' => "Parameter for input. Default is <acronym>transfer none</acronym>.",
313 'inout' => "Parameter for input and for returning results. Default is <acronym>transfer full</acronym>.",319 'inout' => "Parameter for input and for returning results. Default is <acronym>transfer full</acronym>.",
314 'in-out' => "Parameter for input and for returning results. Default is <acronym>transfer full</acronym>.",320 'in-out' => "Parameter for input and for returning results. Default is <acronym>transfer full</acronym>.",
321 'method' => "This is a method",
315 'not-error' => "A GError parameter is not to be handled like a normal GError.",322 'not-error' => "A GError parameter is not to be handled like a normal GError.",
316 'out' => "Parameter for returning results. Default is <acronym>transfer full</acronym>.",323 'out' => "Parameter for returning results. Default is <acronym>transfer full</acronym>.",
317 'out caller-allocates' => "Out parameter, where caller must allocate storage.",324 'out caller-allocates' => "Out parameter, where caller must allocate storage.",
318 'out callee-allocates' => "Out parameter, where caller must allocate storage.",325 'out callee-allocates' => "Out parameter, where caller must allocate storage.",
326 'ref-func' => "The specified function is used to ref a struct, must be a GTypeInstance.",
327 'rename-to' => "Rename the original symbol's name to SYMBOL.",
328 'scope call' => "The callback is valid only during the call to the method.",
329 'scope async' => "The callback is valid until first called.",
330 'scope notified' => "The callback is valid until the GDestroyNotify argument is called.",
331 'set-value-func' => "The specified function is used to convert from a struct to a GValue, must be a GTypeInstance.",
332 'skip' => "Exposed in C code, not necessarily available in other languages.",
319 'transfer container' => "Free data container after the code is done.",333 'transfer container' => "Free data container after the code is done.",
320 'transfer floating' => "Alias for <acronym>transfer none</acronym>, used for objects with floating refs.",334 'transfer floating' => "Alias for <acronym>transfer none</acronym>, used for objects with floating refs.",
321 'transfer full' => "Free data after the code is done.",335 'transfer full' => "Free data after the code is done.",
322 'transfer none' => "Don't free data after the code is done.",336 'transfer none' => "Don't free data after the code is done.",
323 'scope call' => "The callback is valid only during the call to the method.",337 'type' => "Override the parsed C type with given type.",
324 'scope async' => "The callback is valid until first called.",338 'unref-func' => "The specified function is used to unref a struct, must be a GTypeInstance.",
325 'scope notified' => "The callback is valid until the GDestroyNotify argument is called.",339 'virtual' => "This is the invoker for a virtual method.",
326 'skip' => "Exposed in C code, not necessarily available in other languages.",340 'value' => "The specified value overrides the evaluated value of the constant."
327 'type' => "Override the parsed C type with given type."
328);341);
329342
343# Elements to consider non-block items in MarkDown parsing
344my %MD_TEXT_LEVEL_ELEMENTS = ( "literal" => 1,
345 "emphasis" => 1,
346 "envar" => 1,
347 "filename" => 1,
348 "firstterm" => 1,
349 "function" => 1,
350 "manvolnum" => 1,
351 "option" => 1,
352 "replaceable" => 1,
353 "structname" => 1,
354 "title" => 1,
355 "varname" => 1 );
356my %MD_ESCAPABLE_CHARS = ( "\\" => 1,
357 "`" => 1,
358 "*" => 1,
359 "_" => 1,
360 "{" => 1,
361 "}" => 1,
362 "[" => 1,
363 "]" => 1,
364 "(" => 1,
365 ")" => 1,
366 ">" => 1,
367 "#" => 1,
368 "+" => 1,
369 "-" => 1,
370 "." => 1,
371 "!" => 1 );
372my %MD_GTK_ESCAPABLE_CHARS = ( "@" => 1,
373 "%" => 1 );
374
330# Create the root DocBook output directory if it doens't exist.375# Create the root DocBook output directory if it doens't exist.
331if (! -e $SGML_OUTPUT_DIR) {376if (! -e $SGML_OUTPUT_DIR) {
332 mkdir ("$SGML_OUTPUT_DIR", 0777)377 mkdir ("$SGML_OUTPUT_DIR", 0777)
@@ -336,6 +381,7 @@
336# Function and other declaration output settings.381# Function and other declaration output settings.
337my $RETURN_TYPE_FIELD_WIDTH = 20;382my $RETURN_TYPE_FIELD_WIDTH = 20;
338my $SYMBOL_FIELD_WIDTH = 36;383my $SYMBOL_FIELD_WIDTH = 36;
384my $MAX_SYMBOL_FIELD_WIDTH = 40;
339my $SIGNAL_FIELD_WIDTH = 16;385my $SIGNAL_FIELD_WIDTH = 16;
340my $PARAM_FIELD_COUNT = 2;386my $PARAM_FIELD_COUNT = 2;
341387
@@ -530,10 +576,12 @@
530 my $title = "";576 my $title = "";
531 my $section_id = "";577 my $section_id = "";
532 my $subsection = "";578 my $subsection = "";
533 my $synopsis;
534 my $details;
535 my $num_symbols;579 my $num_symbols;
536 my $changed = 0;580 my $changed = 0;
581 my $functions_synop = "";
582 my $other_synop = "";
583 my $functions_details = "";
584 my $other_details = "";
537 my $signals_synop = "";585 my $signals_synop = "";
538 my $signals_desc = "";586 my $signals_desc = "";
539 my $args_synop = "";587 my $args_synop = "";
@@ -542,7 +590,8 @@
542 my $args_desc = "";590 my $args_desc = "";
543 my $child_args_desc = "";591 my $child_args_desc = "";
544 my $style_args_desc = "";592 my $style_args_desc = "";
545 my $hierarchy = "";593 my $hierarchy_str = "";
594 my @hierarchy = ();
546 my $interfaces = "";595 my $interfaces = "";
547 my $implementations = "";596 my $implementations = "";
548 my $prerequisites = "";597 my $prerequisites = "";
@@ -559,15 +608,14 @@
559 next;608 next;
560609
561 } elsif (m/^<SECTION>/) {610 } elsif (m/^<SECTION>/) {
562 $synopsis = "";
563 $details = "";
564 $num_symbols = 0;611 $num_symbols = 0;
565 $in_section = 1;612 $in_section = 1;
566 @file_objects = ();613 @file_objects = ();
567 %symbol_def_line = ();614 %symbol_def_line = ();
568615
569 } elsif (m/^<SUBSECTION\s*(.*)>/i) {616 } elsif (m/^<SUBSECTION\s*(.*)>/i) {
570 $synopsis .= "\n";617 $other_synop .= "\n";
618 $functions_synop .= "\n";
571 $subsection = $1;619 $subsection = $1;
572620
573 } elsif (m/^<SUBSECTION>/) {621 } elsif (m/^<SUBSECTION>/) {
@@ -638,8 +686,16 @@
638 $signals_synop = <<EOF;686 $signals_synop = <<EOF;
639<refsect1 id="$section_id.signals" role="signal_proto">687<refsect1 id="$section_id.signals" role="signal_proto">
640<title role="signal_proto.title">Signals</title>688<title role="signal_proto.title">Signals</title>
641<synopsis>689<informaltable frame="none">
642${signals_synop}</synopsis>690<tgroup cols="3">
691<colspec colname="signals_return" colwidth="150px"/>
692<colspec colname="signals_name" colwidth="300px"/>
693<colspec colname="signals_flags" colwidth="200px"/>
694<tbody>
695${signals_synop}
696</tbody>
697</tgroup>
698</informaltable>
643</refsect1>699</refsect1>
644EOF700EOF
645 $signals_desc = TrimTextBlock($signals_desc);701 $signals_desc = TrimTextBlock($signals_desc);
@@ -651,14 +707,22 @@
651EOF707EOF
652 }708 }
653709
654 $args_synop =~ s/^\n*//g;710 $args_synop =~ s/^\n*//g;
655 $args_synop =~ s/\n+$/\n/g;711 $args_synop =~ s/\n+$/\n/g;
656 if ($args_synop ne '') {712 if ($args_synop ne '') {
657 $args_synop = <<EOF;713 $args_synop = <<EOF;
658<refsect1 id="$section_id.properties" role="properties">714<refsect1 id="$section_id.properties" role="properties">
659<title role="properties.title">Properties</title>715<title role="properties.title">Properties</title>
660<synopsis>716<informaltable frame="none">
661${args_synop}</synopsis>717<tgroup cols="3">
718<colspec colname="properties_type" colwidth="150px"/>
719<colspec colname="properties_name" colwidth="300px"/>
720<colspec colname="properties_flags" colwidth="200px"/>
721<tbody>
722${args_synop}
723</tbody>
724</tgroup>
725</informaltable>
662</refsect1>726</refsect1>
663EOF727EOF
664 $args_desc = TrimTextBlock($args_desc);728 $args_desc = TrimTextBlock($args_desc);
@@ -670,14 +734,22 @@
670EOF734EOF
671 }735 }
672736
673 $child_args_synop =~ s/^\n*//g;737 $child_args_synop =~ s/^\n*//g;
674 $child_args_synop =~ s/\n+$/\n/g;738 $child_args_synop =~ s/\n+$/\n/g;
675 if ($child_args_synop ne '') {739 if ($child_args_synop ne '') {
676 $args_synop .= <<EOF;740 $args_synop .= <<EOF;
677<refsect1 id="$section_id.child-properties" role="child_properties">741<refsect1 id="$section_id.child-properties" role="child_properties">
678<title role="child_properties.title">Child Properties</title>742<title role="child_properties.title">Child Properties</title>
679<synopsis>743<informaltable frame="none">
680${child_args_synop}</synopsis>744<tgroup cols="3">
745<colspec colname="child_properties_type" colwidth="150px"/>
746<colspec colname="child_properties_name" colwidth="300px"/>
747<colspec colname="child_properties_flags" colwidth="200px"/>
748<tbody>
749${child_args_synop}
750</tbody>
751</tgroup>
752</informaltable>
681</refsect1>753</refsect1>
682EOF754EOF
683 $child_args_desc = TrimTextBlock($child_args_desc);755 $child_args_desc = TrimTextBlock($child_args_desc);
@@ -689,14 +761,22 @@
689EOF761EOF
690 }762 }
691763
692 $style_args_synop =~ s/^\n*//g;764 $style_args_synop =~ s/^\n*//g;
693 $style_args_synop =~ s/\n+$/\n/g;765 $style_args_synop =~ s/\n+$/\n/g;
694 if ($style_args_synop ne '') {766 if ($style_args_synop ne '') {
695 $args_synop .= <<EOF;767 $args_synop .= <<EOF;
696<refsect1 id="$section_id.style-properties" role="style_properties">768<refsect1 id="$section_id.style-properties" role="style_properties">
697<title role="style_properties.title">Style Properties</title>769<title role="style_properties.title">Style Properties</title>
698<synopsis>770<informaltable frame="none">
699${style_args_synop}</synopsis>771<tgroup cols="3">
772<colspec colname="style_properties_type" colwidth="150px"/>
773<colspec colname="style_properties_name" colwidth="300px"/>
774<colspec colname="style_properties_flags" colwidth="200px"/>
775<tbody>
776${style_args_synop}
777</tbody>
778</tgroup>
779</informaltable>
700</refsect1>780</refsect1>
701EOF781EOF
702 $style_args_desc = TrimTextBlock($style_args_desc);782 $style_args_desc = TrimTextBlock($style_args_desc);
@@ -708,12 +788,12 @@
708EOF788EOF
709 }789 }
710790
711 $hierarchy = TrimTextBlock($hierarchy);791 $hierarchy_str = &AddTreeLineArt(\@hierarchy) . "\n";
712 if ($hierarchy ne "") {792 if ($hierarchy_str ne "") {
713 $hierarchy = <<EOF;793 $hierarchy_str = <<EOF;
714<refsect1 id="$section_id.object-hierarchy" role="object_hierarchy">794<refsect1 id="$section_id.object-hierarchy" role="object_hierarchy">
715<title role="object_hierarchy.title">Object Hierarchy</title>795<title role="object_hierarchy.title">Object Hierarchy</title>
716$hierarchy796<screen>$hierarchy_str</screen>
717</refsect1>797</refsect1>
718EOF798EOF
719 }799 }
@@ -758,14 +838,51 @@
758EOF838EOF
759 }839 }
760840
761 $synopsis =~ s/^\n*//g;841 $functions_synop =~ s/^\n*//g;
762 $synopsis =~ s/\n+$/\n/g;842 $functions_synop =~ s/\n+$/\n/g;
843 if ($functions_synop ne '') {
844 $functions_synop = <<EOF;
845<refsect1 id="$section_id.functions" role="functions_proto">
846<title role="functions_proto.title">Functions</title>
847<informaltable pgwide="1" frame="none">
848<tgroup cols="2">
849<colspec colname="functions_return" colwidth="150px"/>
850<colspec colname="functions_name"/>
851<tbody>
852${functions_synop}
853</tbody>
854</tgroup>
855</informaltable>
856</refsect1>
857EOF
858 }
859
860 $other_synop =~ s/^\n*//g;
861 $other_synop =~ s/\n+$/\n/g;
862 if ($other_synop ne '') {
863 $other_synop = <<EOF;
864<refsect1 id="$section_id.other" role="other_proto">
865<title role="other_proto.title">Types and Values</title>
866<informaltable role="enum_members_table" pgwide="1" frame="none">
867<tgroup cols="2">
868<colspec colname="name" colwidth="150px"/>
869<colspec colname="description"/>
870<tbody>
871${other_synop}
872</tbody>
873</tgroup>
874</informaltable>
875</refsect1>
876EOF
877 }
878
763 my $file_changed = &OutputSGMLFile ($filename, $title, $section_id,879 my $file_changed = &OutputSGMLFile ($filename, $title, $section_id,
764 $section_includes,880 $section_includes,
765 \$synopsis, \$details,881 \$functions_synop, \$other_synop,
882 \$functions_details, \$other_details,
766 \$signals_synop, \$signals_desc,883 \$signals_synop, \$signals_desc,
767 \$args_synop, \$args_desc,884 \$args_synop, \$args_desc,
768 \$hierarchy, \$interfaces,885 \$hierarchy_str, \$interfaces,
769 \$implementations,886 \$implementations,
770 \$prerequisites, \$derived,887 \$prerequisites, \$derived,
771 \@file_objects);888 \@file_objects);
@@ -778,6 +895,10 @@
778 $subsection = "";895 $subsection = "";
779 $in_section = 0;896 $in_section = 0;
780 $section_includes = "";897 $section_includes = "";
898 $functions_synop = "";
899 $other_synop = "";
900 $functions_details = "";
901 $other_details = "";
781 $signals_synop = "";902 $signals_synop = "";
782 $signals_desc = "";903 $signals_desc = "";
783 $args_synop = "";904 $args_synop = "";
@@ -786,52 +907,63 @@
786 $args_desc = "";907 $args_desc = "";
787 $child_args_desc = "";908 $child_args_desc = "";
788 $style_args_desc = "";909 $style_args_desc = "";
789 $hierarchy = "";910 $hierarchy_str = "";
790 $interfaces = "";911 @hierarchy = ();
791 $implementations = "";912 $interfaces = "";
913 $implementations = "";
792 $prerequisites = "";914 $prerequisites = "";
793 $derived = "";915 $derived = "";
794916
795 } elsif (m/^(\S+)/) {917 } elsif (m/^(\S+)/) {
796 my $symbol = $1;918 my $symbol = $1;
797 #print " Symbol: $symbol\n";919 @TRACE@(" Symbol: $symbol in subsection: $subsection\n");
798920
799 # check for duplicate entries921 # check for duplicate entries
800 if (! defined $symbol_def_line{$symbol}) {922 if (! defined $symbol_def_line{$symbol}) {
801 my $declaration = $Declarations{$symbol};923 my $declaration = $Declarations{$symbol};
802 if (defined ($declaration)) {924 if (defined ($declaration)) {
925 if (&CheckIsObject ($symbol)) {
926 push @file_objects, $symbol;
927 }
803 # We don't want standard macros/functions of GObjects,928 # We don't want standard macros/functions of GObjects,
804 # or private declarations.929 # or private declarations.
805 if ($subsection ne "Standard" && $subsection ne "Private") {930 if ($subsection ne "Standard" && $subsection ne "Private") {
806 if (&CheckIsObject ($symbol)) {
807 push @file_objects, $symbol;
808 }
809 my ($synop, $desc) = &OutputDeclaration ($symbol,931 my ($synop, $desc) = &OutputDeclaration ($symbol,
810 $declaration);932 $declaration);
811 my ($sig_synop, $sig_desc) = &GetSignals ($symbol);933 my $type = $DeclarationTypes {$symbol};
812 my ($arg_synop, $child_arg_synop, $style_arg_synop,934
813 $arg_desc, $child_arg_desc, $style_arg_desc) = &GetArgs ($symbol);935 if ($type eq 'FUNCTION' || $type eq 'USER_FUNCTION') {
814 my $hier = &GetHierarchy ($symbol);936 $functions_synop .= $synop;
815 my $ifaces = &GetInterfaces ($symbol);937 $functions_details .= $desc;
816 my $impls = &GetImplementations ($symbol);938 } elsif ($type eq 'MACRO' && $declaration =~ /$symbol[ ]*\(/) {
817 my $prereqs = &GetPrerequisites ($symbol);939 $functions_synop .= $synop;
818 my $der = &GetDerived ($symbol);940 $functions_details .= $desc;
819 $synopsis .= $synop;941 } else {
820 $details .= $desc;942 $other_synop .= $synop;
821 $signals_synop .= $sig_synop;943 $other_details .= $desc;
822 $signals_desc .= $sig_desc;944 }
823 $args_synop .= $arg_synop;
824 $child_args_synop .= $child_arg_synop;
825 $style_args_synop .= $style_arg_synop;
826 $args_desc .= $arg_desc;
827 $child_args_desc .= $child_arg_desc;
828 $style_args_desc .= $style_arg_desc;
829 $hierarchy .= $hier;
830 $interfaces .= $ifaces;
831 $implementations .= $impls;
832 $prerequisites .= $prereqs;
833 $derived .= $der;
834 }945 }
946 my ($sig_synop, $sig_desc) = &GetSignals ($symbol);
947 my ($arg_synop, $child_arg_synop, $style_arg_synop,
948 $arg_desc, $child_arg_desc, $style_arg_desc) = &GetArgs ($symbol);
949 my $ifaces = &GetInterfaces ($symbol);
950 my $impls = &GetImplementations ($symbol);
951 my $prereqs = &GetPrerequisites ($symbol);
952 my $der = &GetDerived ($symbol);
953 @hierarchy = &GetHierarchy ($symbol, \@hierarchy);
954
955 $signals_synop .= $sig_synop;
956 $signals_desc .= $sig_desc;
957 $args_synop .= $arg_synop;
958 $child_args_synop .= $child_arg_synop;
959 $style_args_synop .= $style_arg_synop;
960 $args_desc .= $arg_desc;
961 $child_args_desc .= $child_arg_desc;
962 $style_args_desc .= $style_arg_desc;
963 $interfaces .= $ifaces;
964 $implementations .= $impls;
965 $prerequisites .= $prereqs;
966 $derived .= $der;
835967
836 # Note that the declaration has been output.968 # Note that the declaration has been output.
837 $DeclarationOutput{$symbol} = 1;969 $DeclarationOutput{$symbol} = 1;
@@ -1107,7 +1239,7 @@
1107 <title>Annotation Glossary</title>1239 <title>Annotation Glossary</title>
1108EOF1240EOF
11091241
1110 foreach my $annotation (keys(%AnnotationsUsed)) {1242 foreach my $annotation (sort(keys(%AnnotationsUsed))) {
1111 if(defined($AnnotationDefinition{$annotation})) {1243 if(defined($AnnotationDefinition{$annotation})) {
1112 my $def = $AnnotationDefinition{$annotation};1244 my $def = $AnnotationDefinition{$annotation};
1113 my $curletter = uc(substr($annotation,0,1));1245 my $curletter = uc(substr($annotation,0,1));
@@ -1255,7 +1387,7 @@
1255}1387}
12561388
1257#############################################################################1389#############################################################################
1258# Function : Outpu{Symbol,Section}ExtraLinks1390# Function : Output{Symbol,Section}ExtraLinks
1259# Description : Returns extralinks for the symbol (if enabled).1391# Description : Returns extralinks for the symbol (if enabled).
1260# Arguments : $symbol - the name of the function/macro begin described.1392# Arguments : $symbol - the name of the function/macro begin described.
1261#############################################################################1393#############################################################################
@@ -1319,7 +1451,7 @@
1319 my ($symbol, $declaration) = @_;1451 my ($symbol, $declaration) = @_;
1320 my $id = &CreateValidSGMLID ($symbol);1452 my $id = &CreateValidSGMLID ($symbol);
1321 my $condition = &MakeConditionDescription ($symbol);1453 my $condition = &MakeConditionDescription ($symbol);
1322 my $synop = &MakeReturnField("#define") . "<link linkend=\"$id\">$symbol</link>";1454 my $synop = "<row><entry role=\"define_keyword\">#define</entry><entry role=\"function_name\"><link linkend=\"$id\">$symbol</link>";
1323 my $desc;1455 my $desc;
13241456
1325 my @fields = ParseMacroDeclaration($declaration, \&CreateValidSGML);1457 my @fields = ParseMacroDeclaration($declaration, \&CreateValidSGML);
@@ -1331,25 +1463,9 @@
1331 $desc .= OutputSymbolExtraLinks($symbol);1463 $desc .= OutputSymbolExtraLinks($symbol);
13321464
1333 if (@fields) {1465 if (@fields) {
1334 if (length ($symbol) < $SYMBOL_FIELD_WIDTH) {1466 $synop .= "<phrase role=\"c_punctuation\">()</phrase>";
1335 $synop .= (' ' x ($SYMBOL_FIELD_WIDTH - length ($symbol)));
1336 }
1337
1338 $synop .= "(";
1339 for (my $i = 1; $i <= $#fields; $i += 2) {
1340 my $field_name = $fields[$i];
1341
1342 if ($i == 1) {
1343 $synop .= "$field_name";
1344 } else {
1345 $synop .= ",\n"
1346 . (' ' x ($SYMBOL_FIELD_WIDTH + $RETURN_TYPE_FIELD_WIDTH))
1347 . " $field_name";
1348 }
1349 }
1350 $synop .= ")";
1351 }1467 }
1352 $synop .= "\n";1468 $synop .= "</entry></row>\n";
13531469
1354 # Don't output the macro definition if is is a conditional macro or it1470 # Don't output the macro definition if is is a conditional macro or it
1355 # looks like a function, i.e. starts with "g_" or "_?gnome_", or it is1471 # looks like a function, i.e. starts with "g_" or "_?gnome_", or it is
@@ -1358,9 +1474,9 @@
1358 if (!defined ($DeclarationConditional{$symbol}) && ($symbol !~ m/^g_/)1474 if (!defined ($DeclarationConditional{$symbol}) && ($symbol !~ m/^g_/)
1359 && ($symbol !~ m/^_?gnome_/) && (($declaration =~ tr/\n//) < 2)) {1475 && ($symbol !~ m/^_?gnome_/) && (($declaration =~ tr/\n//) < 2)) {
1360 my $decl_out = &CreateValidSGML ($declaration);1476 my $decl_out = &CreateValidSGML ($declaration);
1361 $desc .= "<programlisting>$decl_out</programlisting>\n";1477 $desc .= "<programlisting language=\"C\">$decl_out</programlisting>\n";
1362 } else {1478 } else {
1363 $desc .= "<programlisting>" . &MakeReturnField("#define") . "$symbol";1479 $desc .= "<programlisting language=\"C\">" . &MakeReturnField("#define") . "$symbol";
1364 if ($declaration =~ m/^\s*#\s*define\s+\w+(\([^\)]*\))/) {1480 if ($declaration =~ m/^\s*#\s*define\s+\w+(\([^\)]*\))/) {
1365 my $args = $1;1481 my $args = $1;
1366 my $pad = ' ' x ($RETURN_TYPE_FIELD_WIDTH - length ("#define "));1482 my $pad = ' ' x ($RETURN_TYPE_FIELD_WIDTH - length ("#define "));
@@ -1377,7 +1493,7 @@
1377 my $parameters_output = 0;1493 my $parameters_output = 0;
13781494
1379 if (defined ($SymbolDocs{$symbol})) {1495 if (defined ($SymbolDocs{$symbol})) {
1380 my $symbol_docs = &ExpandAbbreviations($symbol, $SymbolDocs{$symbol});1496 my $symbol_docs = &ConvertMarkDown($symbol, $SymbolDocs{$symbol});
13811497
1382 # Try to insert the parameter table at the author's desired position.1498 # Try to insert the parameter table at the author's desired position.
1383 # Otherwise we need to tag it onto the end.1499 # Otherwise we need to tag it onto the end.
@@ -1409,8 +1525,8 @@
1409 my ($symbol, $declaration) = @_;1525 my ($symbol, $declaration) = @_;
1410 my $id = &CreateValidSGMLID ($symbol);1526 my $id = &CreateValidSGMLID ($symbol);
1411 my $condition = &MakeConditionDescription ($symbol);1527 my $condition = &MakeConditionDescription ($symbol);
1412 my $synop = &MakeReturnField("typedef") . "<link linkend=\"$id\">$symbol</link>;\n";
1413 my $desc = "<refsect2 id=\"$id\" role=\"typedef\"$condition>\n<title>$symbol</title>\n";1528 my $desc = "<refsect2 id=\"$id\" role=\"typedef\"$condition>\n<title>$symbol</title>\n";
1529 my $synop = "<row><entry role=\"typedef_keyword\">typedef</entry><entry role=\"function_name\"><link linkend=\"$id\">$symbol</link></entry></row>\n";
14141530
1415 $desc .= MakeIndexterms($symbol, $id);1531 $desc .= MakeIndexterms($symbol, $id);
1416 $desc .= "\n";1532 $desc .= "\n";
@@ -1418,13 +1534,13 @@
14181534
1419 if (!defined ($DeclarationConditional{$symbol})) {1535 if (!defined ($DeclarationConditional{$symbol})) {
1420 my $decl_out = &CreateValidSGML ($declaration);1536 my $decl_out = &CreateValidSGML ($declaration);
1421 $desc .= "<programlisting>$decl_out</programlisting>\n";1537 $desc .= "<programlisting language=\"C\">$decl_out</programlisting>\n";
1422 }1538 }
14231539
1424 $desc .= &MakeDeprecationNote($symbol);1540 $desc .= &MakeDeprecationNote($symbol);
14251541
1426 if (defined ($SymbolDocs{$symbol})) {1542 if (defined ($SymbolDocs{$symbol})) {
1427 $desc .= &ExpandAbbreviations($symbol, $SymbolDocs{$symbol});1543 $desc .= &ConvertMarkDown($symbol, $SymbolDocs{$symbol});
1428 }1544 }
1429 $desc .= OutputSymbolTraits ($symbol);1545 $desc .= OutputSymbolTraits ($symbol);
1430 $desc .= "</refsect2>\n";1546 $desc .= "</refsect2>\n";
@@ -1470,16 +1586,17 @@
1470 $has_typedef = 1;1586 $has_typedef = 1;
1471 }1587 }
14721588
1473 my $synop;1589 my $type_output;
1474 my $desc;1590 my $desc;
1475 if ($has_typedef) {1591 if ($has_typedef) {
1476 # For structs with typedefs we just output the struct name.1592 # For structs with typedefs we just output the struct name.
1477 $synop = &MakeReturnField("") . "<link linkend=\"$id\">$symbol</link>;\n";1593 $type_output = "";
1478 $desc = "<refsect2 id=\"$id\" role=\"struct\"$condition>\n<title>$symbol</title>\n";1594 $desc = "<refsect2 id=\"$id\" role=\"struct\"$condition>\n<title>$symbol</title>\n";
1479 } else {1595 } else {
1480 $synop = &MakeReturnField("struct") . "<link linkend=\"$id\">$symbol</link>;\n";1596 $type_output = "struct";
1481 $desc = "<refsect2 id=\"$id\" role=\"struct\"$condition>\n<title>struct $symbol</title>\n";1597 $desc = "<refsect2 id=\"$id\" role=\"struct\"$condition>\n<title>struct $symbol</title>\n";
1482 }1598 }
1599 my $synop = "<row><entry role=\"datatype_keyword\">${type_output}</entry><entry role=\"function_name\"><link linkend=\"$id\">$symbol</link></entry></row>\n";
14831600
1484 $desc .= MakeIndexterms($symbol, $id);1601 $desc .= MakeIndexterms($symbol, $id);
1485 $desc .= "\n";1602 $desc .= "\n";
@@ -1544,12 +1661,12 @@
1544 }1661 }
15451662
1546 $decl_out = &CreateValidSGML ($decl_out);1663 $decl_out = &CreateValidSGML ($decl_out);
1547 $desc .= "<programlisting>$decl_out</programlisting>\n";1664 $desc .= "<programlisting language=\"C\">$decl_out</programlisting>\n";
15481665
1549 $desc .= &MakeDeprecationNote($symbol);1666 $desc .= &MakeDeprecationNote($symbol);
15501667
1551 if (defined ($SymbolDocs{$symbol})) {1668 if (defined ($SymbolDocs{$symbol})) {
1552 $desc .= &ExpandAbbreviations($symbol, $SymbolDocs{$symbol});1669 $desc .= &ConvertMarkDown($symbol, $SymbolDocs{$symbol});
1553 }1670 }
15541671
1555 # Create a table of fields and descriptions1672 # Create a table of fields and descriptions
@@ -1582,22 +1699,31 @@
1582 my $missing_parameters = "";1699 my $missing_parameters = "";
1583 my $unused_parameters = "";1700 my $unused_parameters = "";
15841701
1585 $desc .= "<variablelist role=\"struct\">\n";1702 $desc .= <<EOF;
1703<refsect3 role="struct_members">\n<title>Members</title>
1704<informaltable role="struct_members_table" pgwide="1" frame="none">
1705<tgroup cols="3">
1706<colspec colname="struct_members_name" colwidth="300px"/>
1707<colspec colname="struct_members_description"/>
1708<colspec colname="struct_members_annotations" colwidth="200px"/>
1709<tbody>
1710EOF
1711
1586 while (@fields) {1712 while (@fields) {
1587 my $field_name = shift @fields;1713 my $field_name = shift @fields;
1588 my $text = shift @fields;1714 my $text = shift @fields;
1589 my $field_descr = $field_descrs{$field_name};1715 my $field_descr = $field_descrs{$field_name};
1590 my $param_annotations = "";1716 my $param_annotations = "";
15911717
1592 $desc .= "<varlistentry><term>$text</term>\n";1718 $desc .= "<row><entry role=\"struct_member_name\"><para>$text</para></entry>\n";
1593 if (defined $field_descr) {1719 if (defined $field_descr) {
1594 ($field_descr,$param_annotations) = &ExpandAnnotation($symbol, $field_descr);1720 ($field_descr,$param_annotations) = &ExpandAnnotation($symbol, $field_descr);
1595 $field_descr = &ExpandAbbreviations($symbol, $field_descr);1721 $field_descr = &ConvertMarkDown($symbol, $field_descr);
1596 $field_descr .= $param_annotations;
1597 # trim1722 # trim
1598 $field_descr =~ s/^(\s|\n)+//msg;1723 $field_descr =~ s/^(\s|\n)+//msg;
1599 $field_descr =~ s/(\s|\n)+$//msg;1724 $field_descr =~ s/(\s|\n)+$//msg;
1600 $desc .= "<listitem><simpara>$field_descr</simpara></listitem>\n";1725 $desc .= "<listitem>$field_descr</listitem>\n";
1726 $desc .= "<entry role=\"struct_member_description\">$field_descr</entry>\n<entry role=\"struct_member_annotations\">$param_annotations</entry>\n";
1601 delete $field_descrs{$field_name};1727 delete $field_descrs{$field_name};
1602 } else {1728 } else {
1603 &LogWarning (&GetSymbolSourceFile ($symbol), &GetSymbolSourceLine($symbol),1729 &LogWarning (&GetSymbolSourceFile ($symbol), &GetSymbolSourceLine($symbol),
@@ -1607,11 +1733,11 @@
1607 } else {1733 } else {
1608 $missing_parameters = $field_name;1734 $missing_parameters = $field_name;
1609 }1735 }
1610 $desc .= "<listitem />\n";1736 $desc .= "<entry /><entry />\n";
1611 }1737 }
1612 $desc .= "</varlistentry>\n";1738 $desc .= "</row>\n";
1613 }1739 }
1614 $desc .= "</variablelist>";1740 $desc .= "</tbody></tgroup></informaltable>\n</refsect3>\n";
1615 foreach my $field_name (keys %field_descrs) {1741 foreach my $field_name (keys %field_descrs) {
1616 &LogWarning (&GetSymbolSourceFile ($symbol), &GetSymbolSourceLine($symbol),1742 &LogWarning (&GetSymbolSourceFile ($symbol), &GetSymbolSourceLine($symbol),
1617 "Field description for $symbol"."::"."$field_name is not used from source code comment block.");1743 "Field description for $symbol"."::"."$field_name is not used from source code comment block.");
@@ -1656,8 +1782,22 @@
16561782
1657sub OutputUnion {1783sub OutputUnion {
1658 my ($symbol, $declaration) = @_;1784 my ($symbol, $declaration) = @_;
1659 my $id = &CreateValidSGMLID ($symbol);1785
1660 my $condition = &MakeConditionDescription ($symbol);1786 my $is_gtype = 0;
1787 if (&CheckIsObject ($symbol)) {
1788 @TRACE@("Found union gtype: $symbol\n");
1789 $is_gtype = 1;
1790 }
1791
1792 my $id;
1793 my $condition;
1794 if ($is_gtype) {
1795 $id = &CreateValidSGMLID ($symbol . "_union");
1796 $condition = &MakeConditionDescription ($symbol . "_union");
1797 } else {
1798 $id = &CreateValidSGMLID ($symbol);
1799 $condition = &MakeConditionDescription ($symbol);
1800 }
16611801
1662 # Determine if it is a simple struct or it also has a typedef.1802 # Determine if it is a simple struct or it also has a typedef.
1663 my $has_typedef = 0;1803 my $has_typedef = 0;
@@ -1665,29 +1805,25 @@
1665 $has_typedef = 1;1805 $has_typedef = 1;
1666 }1806 }
16671807
1668 my $synop;1808 my $type_output;
1669 my $desc;1809 my $desc;
1670 if ($has_typedef) {1810 if ($has_typedef) {
1671 # For unions with typedefs we just output the union name.1811 # For unions with typedefs we just output the union name.
1672 $synop = &MakeReturnField("") . "<link linkend=\"$id\">$symbol</link>;\n";1812 $type_output = "";
1673 $desc = "<refsect2 id=\"$id\" role=\"union\"$condition>\n<title>$symbol</title>\n";1813 $desc = "<refsect2 id=\"$id\" role=\"union\"$condition>\n<title>$symbol</title>\n";
1674 } else {1814 } else {
1675 $synop = &MakeReturnField("union") . "<link linkend=\"$id\">$symbol</link>;\n";1815 $type_output = "union";
1676 $desc = "<refsect2 id=\"$id\" role=\"union\"$condition>\n<title>union $symbol</title>\n";1816 $desc = "<refsect2 id=\"$id\" role=\"union\"$condition>\n<title>union $symbol</title>\n";
1677 }1817 }
1818 my $synop = "<row><entry role=\"datatype_keyword\">${type_output}</entry><entry role=\"function_name\"><link linkend=\"$id\">$symbol</link></entry></row>\n";
16781819
1679 $desc .= MakeIndexterms($symbol, $id);1820 $desc .= MakeIndexterms($symbol, $id);
1680 $desc .= "\n";1821 $desc .= "\n";
1681 $desc .= OutputSymbolExtraLinks($symbol);1822 $desc .= OutputSymbolExtraLinks($symbol);
1682
1683 # FIXME: we do more for structs
1684 my $decl_out = &CreateValidSGML ($declaration);
1685 $desc .= "<programlisting>$decl_out</programlisting>\n";
1686
1687 $desc .= &MakeDeprecationNote($symbol);1823 $desc .= &MakeDeprecationNote($symbol);
16881824
1689 if (defined ($SymbolDocs{$symbol})) {1825 if (defined ($SymbolDocs{$symbol})) {
1690 $desc .= &ExpandAbbreviations($symbol, $SymbolDocs{$symbol});1826 $desc .= &ConvertMarkDown($symbol, $SymbolDocs{$symbol});
1691 }1827 }
16921828
1693 # Create a table of fields and descriptions1829 # Create a table of fields and descriptions
@@ -1720,22 +1856,31 @@
1720 my $missing_parameters = "";1856 my $missing_parameters = "";
1721 my $unused_parameters = "";1857 my $unused_parameters = "";
17221858
1723 $desc .= "<variablelist role=\"union\">\n";1859 $desc .= <<EOF;
1860<refsect3 role="union_members">\n<title>Members</title>
1861<informaltable role="union_members_table" pgwide="1" frame="none">
1862<tgroup cols="3">
1863<colspec colname="union_members_name" colwidth="300px"/>
1864<colspec colname="union_members_description"/>
1865<colspec colname="union_members_annotations" colwidth="200px"/>
1866<tbody>
1867EOF
1868
1724 while (@fields) {1869 while (@fields) {
1725 my $field_name = shift @fields;1870 my $field_name = shift @fields;
1726 my $text = shift @fields;1871 my $text = shift @fields;
1727 my $field_descr = $field_descrs{$field_name};1872 my $field_descr = $field_descrs{$field_name};
1728 my $param_annotations = "";1873 my $param_annotations = "";
17291874
1730 $desc .= "<varlistentry><term>$text</term>\n";1875 $desc .= "<row><entry role=\"union_member_name\"><para>$text</para></entry>\n";
1731 if (defined $field_descr) {1876 if (defined $field_descr) {
1732 ($field_descr,$param_annotations) = &ExpandAnnotation($symbol, $field_descr);1877 ($field_descr,$param_annotations) = &ExpandAnnotation($symbol, $field_descr);
1733 $field_descr = &ExpandAbbreviations($symbol, $field_descr);1878 $field_descr = &ConvertMarkDown($symbol, $field_descr);
1734 $field_descr .= $param_annotations;1879
1735 # trim1880 # trim
1736 $field_descr =~ s/^(\s|\n)+//msg;1881 $field_descr =~ s/^(\s|\n)+//msg;
1737 $field_descr =~ s/(\s|\n)+$//msg;1882 $field_descr =~ s/(\s|\n)+$//msg;
1738 $desc .= "<listitem><simpara>$field_descr</simpara></listitem>\n";1883 $desc .= "<entry role=\"union_member_description\">$field_descr</entry>\n<entry role=\"union_member_annotations\">$param_annotations</entry>\n";
1739 delete $field_descrs{$field_name};1884 delete $field_descrs{$field_name};
1740 } else {1885 } else {
1741 &LogWarning (&GetSymbolSourceFile ($symbol), &GetSymbolSourceLine($symbol),1886 &LogWarning (&GetSymbolSourceFile ($symbol), &GetSymbolSourceLine($symbol),
@@ -1745,11 +1890,11 @@
1745 } else {1890 } else {
1746 $missing_parameters = $field_name;1891 $missing_parameters = $field_name;
1747 }1892 }
1748 $desc .= "<listitem />\n";1893 $desc .= "<entry /><entry />\n";
1749 }1894 }
1750 $desc .= "</varlistentry>\n";1895 $desc .= "</row>\n";
1751 }1896 }
1752 $desc .= "</variablelist>";1897 $desc .= "</tbody></tgroup></informaltable>\n</refsect3>";
1753 foreach my $field_name (keys %field_descrs) {1898 foreach my $field_name (keys %field_descrs) {
1754 &LogWarning (&GetSymbolSourceFile ($symbol), &GetSymbolSourceLine($symbol),1899 &LogWarning (&GetSymbolSourceFile ($symbol), &GetSymbolSourceLine($symbol),
1755 "Field description for $symbol"."::"."$field_name is not used from source code comment block.");1900 "Field description for $symbol"."::"."$field_name is not used from source code comment block.");
@@ -1811,56 +1956,16 @@
1811 $condition = &MakeConditionDescription ($symbol);1956 $condition = &MakeConditionDescription ($symbol);
1812 }1957 }
18131958
1814 my $synop = &MakeReturnField("enum") . "<link linkend=\"$id\">$symbol</link>;\n";1959 my $synop = "<row><entry role=\"datatype_keyword\">enum</entry><entry role=\"function_name\"><link linkend=\"$id\">$symbol</link></entry></row>\n";
1815 my $desc = "<refsect2 id=\"$id\" role=\"enum\"$condition>\n<title>enum $symbol</title>\n";1960 my $desc = "<refsect2 id=\"$id\" role=\"enum\"$condition>\n<title>enum $symbol</title>\n";
18161961
1817 $desc .= MakeIndexterms($symbol, $id);1962 $desc .= MakeIndexterms($symbol, $id);
1818 $desc .= "\n";1963 $desc .= "\n";
1819 $desc .= OutputSymbolExtraLinks($symbol);1964 $desc .= OutputSymbolExtraLinks($symbol);
1820
1821 my $decl_out = "";
1822 my $public = 1;
1823 my $new_declaration = "";
1824 my $decl_line;
1825 my $decl = $declaration;
1826
1827 if ($decl =~ m/^\s*(typedef\s+)?enum\s*\w*\s*(?:\/\*.*\*\/)?\s*{(.*)}\s*\w*\s*;\s*$/s) {
1828 my $has_typedef = defined($1) ? 1 : 0;
1829 my $enum_contents = $2;
1830
1831 foreach $decl_line (split (/\n/, $enum_contents)) {
1832 #print "Enum line: $decl_line\n";
1833 if ($decl_line =~ m%/\*\s*<\s*public\s*>\s*\*/%) {
1834 $public = 1;
1835 } elsif ($decl_line =~ m%/\*\s*<\s*(private|protected)\s*>\s*\*/%) {
1836 $public = 0;
1837 } elsif ($public) {
1838 $new_declaration .= $decl_line . "\n";
1839 }
1840 }
1841
1842 if ($new_declaration) {
1843 # Strip any blank lines off the ends.
1844 $new_declaration =~ s/^\s*\n//;
1845 $new_declaration =~ s/\n\s*$/\n/;
1846
1847 if ($has_typedef) {
1848 $decl_out = "typedef enum {\n" . $new_declaration
1849 . "} $symbol;\n";
1850 } else {
1851 $decl_out = "enum $symbol {\n" . $new_declaration
1852 . "};\n";
1853 }
1854 }
1855 }
1856
1857 $decl_out = &CreateValidSGML ($decl_out);
1858 $desc .= "<programlisting>$decl_out</programlisting>\n";
1859
1860 $desc .= &MakeDeprecationNote($symbol);1965 $desc .= &MakeDeprecationNote($symbol);
18611966
1862 if (defined ($SymbolDocs{$symbol})) {1967 if (defined ($SymbolDocs{$symbol})) {
1863 $desc .= &ExpandAbbreviations($symbol, $SymbolDocs{$symbol});1968 $desc .= &ConvertMarkDown($symbol, $SymbolDocs{$symbol});
1864 }1969 }
18651970
1866 # Create a table of fields and descriptions1971 # Create a table of fields and descriptions
@@ -1885,18 +1990,27 @@
1885 my $missing_parameters = "";1990 my $missing_parameters = "";
1886 my $unused_parameters = "";1991 my $unused_parameters = "";
18871992
1888 $desc .= "<variablelist role=\"enum\">\n";1993 $desc .= <<EOF;
1994<refsect3 role="enum_members">\n<title>Members</title>
1995<informaltable role="enum_members_table" pgwide="1" frame="none">
1996<tgroup cols="3">
1997<colspec colname="enum_members_name" colwidth="300px"/>
1998<colspec colname="enum_members_description"/>
1999<colspec colname="enum_members_annotations" colwidth="200px"/>
2000<tbody>
2001EOF
2002
1889 for my $field_name (@fields) {2003 for my $field_name (@fields) {
1890 my $field_descr = $field_descrs{$field_name};2004 my $field_descr = $field_descrs{$field_name};
1891 my $param_annotations = "";2005 my $param_annotations = "";
18922006
1893 $id = &CreateValidSGMLID ($field_name);2007 $id = &CreateValidSGMLID ($field_name);
1894 $condition = &MakeConditionDescription ($field_name);2008 $condition = &MakeConditionDescription ($field_name);
1895 $desc .= "<varlistentry id=\"$id\" role=\"constant\"$condition>\n<term><literal>$field_name</literal></term>\n";2009 $desc .= "<row role=\"constant\"><entry role=\"enum_member_name\"><para id=\"$id\">$field_name</para></entry>\n";
1896 if (defined $field_descr) {2010 if (defined $field_descr) {
1897 ($field_descr,$param_annotations) = &ExpandAnnotation($symbol, $field_descr);2011 ($field_descr,$param_annotations) = &ExpandAnnotation($symbol, $field_descr);
1898 $field_descr = &ExpandAbbreviations($symbol, $field_descr);2012 $field_descr = &ConvertMarkDown($symbol, $field_descr);
1899 $desc .= "<listitem><simpara>$field_descr$param_annotations</simpara></listitem>\n";2013 $desc .= "<entry role=\"enum_member_description\">$field_descr</entry>\n<entry role=\"enum_member_annotations\">$param_annotations</entry>\n";
1900 delete $field_descrs{$field_name};2014 delete $field_descrs{$field_name};
1901 } else {2015 } else {
1902 if ($found) {2016 if ($found) {
@@ -1908,11 +2022,11 @@
1908 $missing_parameters = $field_name;2022 $missing_parameters = $field_name;
1909 }2023 }
1910 }2024 }
1911 $desc .= "<listitem />\n";2025 $desc .= "<entry /><entry />\n";
1912 }2026 }
1913 $desc .= "</varlistentry>\n";2027 $desc .= "</row>\n";
1914 }2028 }
1915 $desc .= "</variablelist>";2029 $desc .= "</tbody></tgroup></informaltable>\n</refsect3>";
1916 foreach my $field_name (keys %field_descrs) {2030 foreach my $field_name (keys %field_descrs) {
1917 &LogWarning (&GetSymbolSourceFile ($symbol), &GetSymbolSourceLine($symbol),2031 &LogWarning (&GetSymbolSourceFile ($symbol), &GetSymbolSourceLine($symbol),
1918 "Value description for $symbol"."::"."$field_name is not used from source code comment block.");2032 "Value description for $symbol"."::"."$field_name is not used from source code comment block.");
@@ -1961,23 +2075,23 @@
1961 2075
1962 @TRACE@("ouputing variable: '$symbol' '$declaration'");2076 @TRACE@("ouputing variable: '$symbol' '$declaration'");
19632077
1964 my $synop;2078 my $type_output;
1965 if ($declaration =~ m/^\s*extern\s+((const\s+|signed\s+|unsigned\s+|long\s+|short\s+)*\w+)(\s+\*+|\*+|\s)(\s*)(const\s+)*([A-Za-z]\w*)\s*;/) {2079 if ($declaration =~ m/^\s*extern\s+((const\s+|signed\s+|unsigned\s+|long\s+|short\s+)*\w+)(\s+\*+|\*+|\s)(\s*)(const\s+)*([A-Za-z]\w*)\s*;/) {
1966 my $mod1 = defined ($1) ? $1 : "";2080 my $mod1 = defined ($1) ? $1 : "";
1967 my $ptr = defined ($3) ? $3 : "";2081 my $ptr = defined ($3) ? $3 : "";
1968 my $space = defined ($4) ? $4 : "";2082 my $space = defined ($4) ? $4 : "";
1969 my $mod2 = defined ($5) ? $5 : "";2083 my $mod2 = defined ($5) ? $5 : "";
1970 $synop = &MakeReturnField("extern $mod1$ptr$space$mod2") . "<link linkend=\"$id\">$symbol</link>;\n";2084 $type_output = "extern $mod1$ptr$space$mod2";
1971 } elsif ($declaration =~ m/^\s*((const\s+|signed\s+|unsigned\s+|long\s+|short\s+)*\w+)(\s+\*+|\*+|\s)(\s*)(const\s+)*([A-Za-z]\w*)\s*=/) {2085 } elsif ($declaration =~ m/^\s*((const\s+|signed\s+|unsigned\s+|long\s+|short\s+)*\w+)(\s+\*+|\*+|\s)(\s*)(const\s+)*([A-Za-z]\w*)\s*=/) {
1972 my $mod1 = defined ($1) ? $1 : "";2086 my $mod1 = defined ($1) ? $1 : "";
1973 my $ptr = defined ($3) ? $3 : "";2087 my $ptr = defined ($3) ? $3 : "";
1974 my $space = defined ($4) ? $4 : "";2088 my $space = defined ($4) ? $4 : "";
1975 my $mod2 = defined ($5) ? $5 : "";2089 my $mod2 = defined ($5) ? $5 : "";
1976 $synop = &MakeReturnField("$mod1$ptr$space$mod2") . "<link linkend=\"$id\">$symbol</link>;\n";2090 $type_output = "$mod1$ptr$space$mod2";
1977
1978 } else {2091 } else {
1979 $synop = &MakeReturnField("extern") . "<link linkend=\"$id\">$symbol</link>;\n";2092 $type_output = "extern";
1980 }2093 }
2094 my $synop = "<row><entry role=\"variable_type\">${type_output}</entry><entry role=\"function_name\"><link linkend=\"$id\">$symbol</link></entry></row>\n";
19812095
1982 my $desc = "<refsect2 id=\"$id\" role=\"variable\"$condition>\n<title>$symbol</title>\n";2096 my $desc = "<refsect2 id=\"$id\" role=\"variable\"$condition>\n<title>$symbol</title>\n";
19832097
@@ -1986,12 +2100,12 @@
1986 $desc .= OutputSymbolExtraLinks($symbol);2100 $desc .= OutputSymbolExtraLinks($symbol);
19872101
1988 my $decl_out = &CreateValidSGML ($declaration);2102 my $decl_out = &CreateValidSGML ($declaration);
1989 $desc .= "<programlisting>$decl_out</programlisting>\n";2103 $desc .= "<programlisting language=\"C\">$decl_out</programlisting>\n";
19902104
1991 $desc .= &MakeDeprecationNote($symbol);2105 $desc .= &MakeDeprecationNote($symbol);
19922106
1993 if (defined ($SymbolDocs{$symbol})) {2107 if (defined ($SymbolDocs{$symbol})) {
1994 $desc .= &ExpandAbbreviations($symbol, $SymbolDocs{$symbol});2108 $desc .= &ConvertMarkDown($symbol, $SymbolDocs{$symbol});
1995 }2109 }
1996 $desc .= OutputSymbolTraits ($symbol);2110 $desc .= OutputSymbolTraits ($symbol);
1997 $desc .= "</refsect2>\n";2111 $desc .= "</refsect2>\n";
@@ -2027,54 +2141,40 @@
2027 # We output const rather than G_CONST_RETURN.2141 # We output const rather than G_CONST_RETURN.
2028 $type_modifier =~ s/G_CONST_RETURN/const/g;2142 $type_modifier =~ s/G_CONST_RETURN/const/g;
2029 $pointer =~ s/G_CONST_RETURN/const/g;2143 $pointer =~ s/G_CONST_RETURN/const/g;
2030 $pointer =~ s/^\s+/ /g;2144 $pointer =~ s/^\s+/&#160;/g;
20312145
2032 my $ret_type_len = length ($start) + length ($type_modifier)+ length ($type)
2033 + length ($pointer);
2034 my $ret_type_output;2146 my $ret_type_output;
2035 my $symbol_len;2147 $ret_type_output = "$start$type_modifier$xref$pointer\n";
2036 if ($ret_type_len < $RETURN_TYPE_FIELD_WIDTH) {2148
2037 $ret_type_output = "$start$type_modifier$xref$pointer"2149 my $indent_len;
2038 . (' ' x ($RETURN_TYPE_FIELD_WIDTH - $ret_type_len));2150 $indent_len = length ($symbol) + 2;
2039 $symbol_len = 0;
2040 } else {
2041 #$ret_type_output = "$start$type_modifier$xref$pointer\n" . (' ' x $RETURN_TYPE_FIELD_WIDTH);
2042
2043 $ret_type_output = "$start$type_modifier$xref$pointer ";
2044 $symbol_len = $ret_type_len + 1 - $RETURN_TYPE_FIELD_WIDTH;
2045 }
2046 #@TRACE@("$symbol ret type output: [$ret_type_output], $ret_type_len");
2047
2048 $symbol_len += length ($symbol);
2049 my $char1 = my $char2 = my $char3 = "";2151 my $char1 = my $char2 = my $char3 = "";
2050 if ($symbol_type eq 'USER_FUNCTION') {2152 if ($symbol_type eq 'USER_FUNCTION') {
2051 $symbol_len += 3;2153 $indent_len += 3;
2052 $char1 = "(";2154 $char1 = "<phrase role=\"c_punctuation\">(</phrase>";
2053 $char2 = "*";2155 $char2 = "*";
2054 $char3 = ")";2156 $char3 = "<phrase role=\"c_punctuation\">)</phrase>";
2055 }2157 }
20562158
2057 my ($symbol_output, $symbol_desc_output);2159 my ($symbol_output, $symbol_desc_output);
2058 if ($symbol_len < $SYMBOL_FIELD_WIDTH) {2160 $symbol_output = "$char1<link linkend=\"$id\">$char2$symbol</link>$char3";
2059 $symbol_output = "$char1<link linkend=\"$id\">$char2$symbol</link>$char3"2161 if ($indent_len < $MAX_SYMBOL_FIELD_WIDTH) {
2060 . (' ' x ($SYMBOL_FIELD_WIDTH - $symbol_len));2162 $symbol_desc_output = "$char1$char2$symbol$char3 ";
2061 $symbol_desc_output = "$char1$char2$symbol$char3"
2062 . (' ' x ($SYMBOL_FIELD_WIDTH - $symbol_len));
2063 } else {2163 } else {
2064 $symbol_output = "$char1<link linkend=\"$id\">$char2$symbol</link>$char3\n"2164 $indent_len = $MAX_SYMBOL_FIELD_WIDTH - 8;
2065 . (' ' x ($SYMBOL_FIELD_WIDTH + $RETURN_TYPE_FIELD_WIDTH));
2066 $symbol_desc_output = "$char1$char2$symbol$char3\n"2165 $symbol_desc_output = "$char1$char2$symbol$char3\n"
2067 . (' ' x ($SYMBOL_FIELD_WIDTH + $RETURN_TYPE_FIELD_WIDTH));2166 . (' ' x ($indent_len - 1));
2068 }2167 }
20692168
2070 my $synop = $ret_type_output . $symbol_output . '(';2169 my $synop = "<row><entry role=\"function_type\">${ret_type_output}</entry><entry role=\"function_name\">${symbol_output}&#160;<phrase role=\"c_punctuation\">()</phrase></entry></row>\n";
2071 my $desc = "<refsect2 id=\"$id\" role=\"function\"$condition>\n<title>${symbol} ()</title>\n";2170
2171 my $desc = "<refsect2 id=\"$id\" role=\"function\"$condition>\n<title>${symbol}&#160;()</title>\n";
20722172
2073 $desc .= MakeIndexterms($symbol, $id);2173 $desc .= MakeIndexterms($symbol, $id);
2074 $desc .= "\n";2174 $desc .= "\n";
2075 $desc .= OutputSymbolExtraLinks($symbol);2175 $desc .= OutputSymbolExtraLinks($symbol);
20762176
2077 $desc .= "<programlisting>${ret_type_output}$symbol_desc_output(";2177 $desc .= "<programlisting language=\"C\">${ret_type_output}$symbol_desc_output(";
20782178
2079 my @fields = ParseFunctionDeclaration($declaration, \&MakeXRef,2179 my @fields = ParseFunctionDeclaration($declaration, \&MakeXRef,
2080 sub {2180 sub {
@@ -2085,20 +2185,15 @@
2085 my $field_name = $fields[$i];2185 my $field_name = $fields[$i];
20862186
2087 if ($i == 1) {2187 if ($i == 1) {
2088 $synop .= "$field_name";
2089 $desc .= "$field_name";2188 $desc .= "$field_name";
2090 } else {2189 } else {
2091 $synop .= ",\n"
2092 . (' ' x ($SYMBOL_FIELD_WIDTH + $RETURN_TYPE_FIELD_WIDTH))
2093 . " $field_name";
2094 $desc .= ",\n"2190 $desc .= ",\n"
2095 . (' ' x ($SYMBOL_FIELD_WIDTH + $RETURN_TYPE_FIELD_WIDTH))2191 . (' ' x $indent_len)
2096 . " $field_name";2192 . "$field_name";
2097 }2193 }
20982194
2099 }2195 }
21002196
2101 $synop .= ");\n";
2102 $desc .= ");</programlisting>\n";2197 $desc .= ");</programlisting>\n";
21032198
2104 $desc .= &MakeDeprecationNote($symbol);2199 $desc .= &MakeDeprecationNote($symbol);
@@ -2107,7 +2202,7 @@
2107 my $parameters_output = 0;2202 my $parameters_output = 0;
21082203
2109 if (defined ($SymbolDocs{$symbol})) {2204 if (defined ($SymbolDocs{$symbol})) {
2110 my $symbol_docs = &ExpandAbbreviations($symbol, $SymbolDocs{$symbol});2205 my $symbol_docs = &ConvertMarkDown($symbol, $SymbolDocs{$symbol});
21112206
2112 # Try to insert the parameter table at the author's desired position.2207 # Try to insert the parameter table at the author's desired position.
2113 # Otherwise we need to tag it onto the end.2208 # Otherwise we need to tag it onto the end.
@@ -2166,13 +2261,12 @@
2166 my $param_annotations = "";2261 my $param_annotations = "";
21672262
2168 ($param_desc,$param_annotations) = & ExpandAnnotation($symbol, $param_desc);2263 ($param_desc,$param_annotations) = & ExpandAnnotation($symbol, $param_desc);
2169 $param_desc = &ExpandAbbreviations($symbol, $param_desc);2264 $param_desc = &ConvertMarkDown($symbol, $param_desc);
2170 $param_desc .= $param_annotations;
2171 # trim2265 # trim
2172 $param_desc =~ s/^(\s|\n)+//msg;2266 $param_desc =~ s/^(\s|\n)+//msg;
2173 $param_desc =~ s/(\s|\n)+$//msg;2267 $param_desc =~ s/(\s|\n)+$//msg;
2174 if ($param_name eq "Returns") {2268 if ($param_name eq "Returns") {
2175 $returns = "$param_desc";2269 $returns = "$param_desc\n<para>$param_annotations</para>";
2176 } elsif ($param_name eq "void") {2270 } elsif ($param_name eq "void") {
2177 #print "!!!! void in params for $symbol?\n";2271 #print "!!!! void in params for $symbol?\n";
2178 } else {2272 } else {
@@ -2190,7 +2284,7 @@
2190 }2284 }
2191 }2285 }
2192 if($param_desc ne "") {2286 if($param_desc ne "") {
2193 $params_desc .= "<varlistentry><term><parameter>$param_name</parameter>&#160;:</term>\n<listitem><simpara>$param_desc</simpara></listitem></varlistentry>\n";2287 $params_desc .= "<row><entry role=\"parameter_name\"><para>$param_name</para></entry>\n<entry role=\"parameter_description\">$param_desc</entry>\n<entry role=\"parameter_annotations\">$param_annotations</entry></row>\n";
2194 $num_params++;2288 $num_params++;
2195 }2289 }
2196 }2290 }
@@ -2207,24 +2301,31 @@
22072301
2208 # Signals have an implicit user_data parameter which we describe.2302 # Signals have an implicit user_data parameter which we describe.
2209 if ($symbol_type eq "SIGNAL") {2303 if ($symbol_type eq "SIGNAL") {
2210 $params_desc .= "<varlistentry><term><parameter>user_data</parameter>&#160;:</term>\n<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>\n";2304 $params_desc .= "<row><entry role=\"parameter_name\"><simpara>user_data</simpara></entry>\n<entry role=\"parameter_description\"><simpara>user data set when the signal handler was connected.</simpara></entry>\n<entry role=\"parameter_annotations\"></entry></row>\n";
2211 }2305 }
22122306
2213 # Start a table if we need one.2307 # Start a table if we need one.
2214 if ($params_desc || $returns) {2308 if ($params_desc ne "") {
2215 $output .= "<variablelist role=\"params\">\n";2309 $output .= <<EOF;
2216 if ($params_desc ne "") {2310<refsect3 role="parameters">\n<title>Parameters</title>
2217 #$output .= "<varlistentry><term>Parameters:</term><listitem></listitem></varlistentry>\n";2311<informaltable role="parameters_table" pgwide="1" frame="none">
2218 $output .= $params_desc;2312<tgroup cols="3">
2219 }2313<colspec colname="parameters_name" colwidth="150px"/>
22202314<colspec colname="parameters_description"/>
2221 # Output the returns info last2315<colspec colname="parameters_annotations" colwidth="200px"/>
2222 if ($returns) {2316<tbody>
2223 $output .= "<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>$returns</simpara></listitem></varlistentry>\n";2317EOF
2224 }2318 $output .= $params_desc;
22252319 $output .= "</tbody></tgroup></informaltable>\n</refsect3>";
2226 # Finish the table.2320 }
2227 $output .= "</variablelist>";2321
2322 # Output the returns info last
2323 if ($returns ne "") {
2324 $output .= <<EOF;
2325<refsect3 role=\"returns\">\n<title>Returns</title>
2326EOF
2327 $output .= $returns;
2328 $output .= "\n</refsect3>";
2228 }2329 }
22292330
2230 # remember missing/unused parameters (needed in tmpl-free build)2331 # remember missing/unused parameters (needed in tmpl-free build)
@@ -2284,8 +2385,10 @@
2284# $section_id - the SGML id to use for the toplevel tag.2385# $section_id - the SGML id to use for the toplevel tag.
2285# $includes - comma-separates list of include files added at top of2386# $includes - comma-separates list of include files added at top of
2286# synopsis, with '<' '>' around them (if not already enclosed in "").2387# synopsis, with '<' '>' around them (if not already enclosed in "").
2287# $synopsis - reference to the DocBook for the Synopsis part.2388# $functions_synop - reference to the DocBook for the Functions Synopsis part.
2288# $details - reference to the DocBook for the Details part.2389# $other_synop - reference to the DocBook for the Types and Values Synopsis part.
2390# $functions_details - reference to the DocBook for the Functions Details part.
2391# $other_details - reference to the DocBook for the Types and Values Details part.
2289# $signal_synop - reference to the DocBook for the Signal Synopsis part2392# $signal_synop - reference to the DocBook for the Signal Synopsis part
2290# $signal_desc - reference to the DocBook for the Signal Description part2393# $signal_desc - reference to the DocBook for the Signal Description part
2291# $args_synop - reference to the DocBook for the Arg Synopsis part2394# $args_synop - reference to the DocBook for the Arg Synopsis part
@@ -2299,7 +2402,7 @@
2299#############################################################################2402#############################################################################
23002403
2301sub OutputSGMLFile {2404sub OutputSGMLFile {
2302 my ($file, $title, $section_id, $includes, $synopsis, $details, $signals_synop, $signals_desc, $args_synop, $args_desc, $hierarchy, $interfaces, $implementations, $prerequisites, $derived, $file_objects) = @_;2405 my ($file, $title, $section_id, $includes, $functions_synop, $other_synop, $functions_details, $other_details, $signals_synop, $signals_desc, $args_synop, $args_desc, $hierarchy, $interfaces, $implementations, $prerequisites, $derived, $file_objects) = @_;
23032406
2304 #print "Output sgml for file $file with title '$title'\n";2407 #print "Output sgml for file $file with title '$title'\n";
23052408
@@ -2313,6 +2416,7 @@
2313 if (!defined ($short_desc) || $short_desc =~ m/^\s*$/) {2416 if (!defined ($short_desc) || $short_desc =~ m/^\s*$/) {
2314 $short_desc = "";2417 $short_desc = "";
2315 } else {2418 } else {
2419 # Don't use ConvertMarkDown here for now since we don't want blocks
2316 $short_desc = &ExpandAbbreviations("$title:Short_description",2420 $short_desc = &ExpandAbbreviations("$title:Short_description",
2317 $short_desc);2421 $short_desc);
2318 #print "Found short_desc: $short_desc";2422 #print "Found short_desc: $short_desc";
@@ -2321,7 +2425,7 @@
2321 if (!defined ($long_desc) || $long_desc =~ m/^\s*$/) {2425 if (!defined ($long_desc) || $long_desc =~ m/^\s*$/) {
2322 $long_desc = "";2426 $long_desc = "";
2323 } else {2427 } else {
2324 $long_desc = &ExpandAbbreviations("$title:Long_description",2428 $long_desc = &ConvertMarkDown("$title:Long_description",
2325 $long_desc);2429 $long_desc);
2326 #print "Found long_desc: $long_desc";2430 #print "Found long_desc: $long_desc";
2327 }2431 }
@@ -2329,7 +2433,7 @@
2329 if (!defined ($see_also) || $see_also =~ m%^\s*(<para>)?\s*(</para>)?\s*$%) {2433 if (!defined ($see_also) || $see_also =~ m%^\s*(<para>)?\s*(</para>)?\s*$%) {
2330 $see_also = "";2434 $see_also = "";
2331 } else {2435 } else {
2332 $see_also = &ExpandAbbreviations("$title:See_Also", $see_also);2436 $see_also = &ConvertMarkDown("$title:See_Also", $see_also);
2333 #print "Found see_also: $see_also";2437 #print "Found see_also: $see_also";
2334 }2438 }
2335 if ($see_also) {2439 if ($see_also) {
@@ -2376,18 +2480,19 @@
2376 $year += 1900;2480 $year += 1900;
23772481
2378 my $include_output = "";2482 my $include_output = "";
2379 my $include;2483 if ($includes) {
2380 foreach $include (split (/,/, $includes)) {2484 $include_output .= "<refsect1 id=\"$section_id.includes\"><title>Includes</title><synopsis>";
2485 my $include;
2486 foreach $include (split (/,/, $includes)) {
2381 if ($include =~ m/^\".+\"$/) {2487 if ($include =~ m/^\".+\"$/) {
2382 $include_output .= "#include ${include}\n";2488 $include_output .= "#include ${include}\n";
2383 }2489 }
2384 else {2490 else {
2385 $include =~ s/^\s+|\s+$//gs;2491 $include =~ s/^\s+|\s+$//gs;
2386 $include_output .= "#include &lt;${include}&gt;\n";2492 $include_output .= "#include &lt;${include}&gt;\n";
2387 }2493 }
2388 }2494 }
2389 if ($include_output ne '') {2495 $include_output .= "</synopsis></refsect1>\n";
2390 $include_output = "\n$include_output\n";
2391 }2496 }
23922497
2393 my $extralinks = OutputSectionExtraLinks($title,"Section:$file");2498 my $extralinks = OutputSectionExtraLinks($title,"Section:$file");
@@ -2428,19 +2533,19 @@
2428<refpurpose>$short_desc</refpurpose>2533<refpurpose>$short_desc</refpurpose>
2429</refnamediv>2534</refnamediv>
2430$stability2535$stability
2431<refsynopsisdiv id="$section_id.synopsis" role="synopsis">2536$$functions_synop$$args_synop$$signals_synop$object_anchors$$other_synop$$hierarchy$$prerequisites$$derived$$interfaces$$implementations
2432<title role="synopsis.title">Synopsis</title>2537$include_output
2433$object_anchors
2434<synopsis>$include_output$${synopsis}</synopsis>
2435</refsynopsisdiv>
2436$$hierarchy$$prerequisites$$derived$$interfaces$$implementations$$args_synop$$signals_synop
2437<refsect1 id="$section_id.description" role="desc">2538<refsect1 id="$section_id.description" role="desc">
2438<title role="desc.title">Description</title>2539<title role="desc.title">Description</title>
2439$extralinks$long_desc2540$extralinks$long_desc
2440</refsect1>2541</refsect1>
2441<refsect1 id="$section_id.details" role="details">2542<refsect1 id="$section_id.functions_details" role="details">
2442<title role="details.title">Details</title>2543<title role="details.title">Functions</title>
2443$$details2544$$functions_details
2545</refsect1>
2546<refsect1 id="$section_id.other_details" role="details">
2547<title role="details.title">Types and Values</title>
2548$$other_details
2444</refsect1>2549</refsect1>
2445$$args_desc$$signals_desc$see_also2550$$args_desc$$signals_desc$see_also
2446</refentry>2551</refentry>
@@ -2654,7 +2759,8 @@
2654 # If we're not in CDATA convert to entities.2759 # If we're not in CDATA convert to entities.
2655 $text =~ s/&(?![a-zA-Z#]+;)/&amp;/g; # Do this first, or the others get messed up.2760 $text =~ s/&(?![a-zA-Z#]+;)/&amp;/g; # Do this first, or the others get messed up.
2656 $text =~ s/<(?![a-zA-Z\/!])/&lt;/g;2761 $text =~ s/<(?![a-zA-Z\/!])/&lt;/g;
2657 $text =~ s/(?<![a-zA-Z0-9"'\/-])>/&gt;/g;2762 # Allow ">" at beginning of string for blockquote markdown
2763 $text =~ s/(?<=[^\w\n"'\/-])>/&gt;/g;
26582764
2659 # Handle "#include <xxxxx>"2765 # Handle "#include <xxxxx>"
2660 $text =~ s/#include(\s+)<([^>]+)>/#include$1&lt;$2&gt;/g;2766 $text =~ s/#include(\s+)<([^>]+)>/#include$1&lt;$2&gt;/g;
@@ -2747,12 +2853,13 @@
2747sub ExpandAbbreviations {2853sub ExpandAbbreviations {
2748 my ($symbol, $text) = @_;2854 my ($symbol, $text) = @_;
27492855
2856 # Note: This is a fallback and normally done in the markdown parser
2857
2750 # Convert "|[" and "]|" into the start and end of program listing examples.2858 # Convert "|[" and "]|" into the start and end of program listing examples.
2751 # FIXME: we like to have a way to specify parameters e.g. language="c"2859 # Support \[<!-- language="C" --> modifiers
2752 $text =~ s%\|\[%<informalexample><programlisting>%g;2860 $text =~ s%\|\[<!-- language="([^"]+)" -->%<informalexample><programlisting language="$1"><![CDATA[%g;
2753 $text =~ s%\]\|%</programlisting></informalexample>%g;2861 $text =~ s%\|\[%<informalexample><programlisting><![CDATA[%g;
2754 # TODO: check for a xml comment after |[ and pick the language attribute from2862 $text =~ s%\]\|%]]></programlisting></informalexample>%g;
2755 # that
27562863
2757 # keep CDATA unmodified, preserve ulink tags (ideally we preseve all tags2864 # keep CDATA unmodified, preserve ulink tags (ideally we preseve all tags
2758 # as such)2865 # as such)
@@ -2787,6 +2894,8 @@
2787 \&ExpandAbbreviationsEndTag,2894 \&ExpandAbbreviationsEndTag,
2788 \&ExpandAbbreviationsCallback2);2895 \&ExpandAbbreviationsCallback2);
2789 } elsif ($tag eq "") {2896 } elsif ($tag eq "") {
2897 # NOTE: this is a fallback. It is normally done by the Markdown parser.
2898
2790 # We are outside any CDATA or <programlisting> sections, so we expand2899 # We are outside any CDATA or <programlisting> sections, so we expand
2791 # any gtk-doc abbreviations.2900 # any gtk-doc abbreviations.
27922901
@@ -2814,15 +2923,6 @@
2814 # Convert '#symbol', but not '\#symbol'.2923 # Convert '#symbol', but not '\#symbol'.
2815 $text =~ s/(\A|[^\\])#([\w\-:\.]+[\w]+)/$1.&MakeHashXRef($2, "type");/eg;2924 $text =~ s/(\A|[^\\])#([\w\-:\.]+[\w]+)/$1.&MakeHashXRef($2, "type");/eg;
2816 $text =~ s/\\#/#/g;2925 $text =~ s/\\#/#/g;
2817
2818 # Expand urls
2819 # FIXME: should we skip urls that are already tagged? (e.g. <literal>http://...</literal>)
2820 # this is apparently also called for markup and not just for plain text
2821 # disable for now.
2822 #$text =~ s%(http|https|ftp)://(.*?)((?:\s|,|\)|\]|\<|\.\s))%<ulink url="$1://$2">$2</ulink>$3%g;
2823
2824 # TODO: optionally check all words from $text against internal symbols and
2825 # warn if those could be xreffed, but miss a %,# or ()
2826 }2926 }
28272927
2828 return $text;2928 return $text;
@@ -2838,6 +2938,9 @@
2838 # FIXME: why is this different from &ExpandAbbreviationsCallback(),2938 # FIXME: why is this different from &ExpandAbbreviationsCallback(),
2839 # why not just call it2939 # why not just call it
2840 $text =~ s/#(\w+)/&MakeHashXRef($1, "");/eg;2940 $text =~ s/#(\w+)/&MakeHashXRef($1, "");/eg;
2941 } elsif ($tag eq "<![CDATA[") {
2942 # NOTE: this is a fallback. It is normally done by the Markdown parser.
2943 $text = &ReplaceEntities ($text, $symbol);
2841 }2944 }
28422945
2843 return $text;2946 return $text;
@@ -2859,13 +2962,13 @@
2859 # If the symbol is in the form "Object::signal", then change the symbol to2962 # If the symbol is in the form "Object::signal", then change the symbol to
2860 # "Object-signal" and use "signal" as the text.2963 # "Object-signal" and use "signal" as the text.
2861 if ($symbol =~ s/::/-/) {2964 if ($symbol =~ s/::/-/) {
2862 $text = "\"$'\"";2965 $text = "“$'”";
2863 }2966 }
28642967
2865 # If the symbol is in the form "Object:property", then change the symbol to2968 # If the symbol is in the form "Object:property", then change the symbol to
2866 # "Object--property" and use "property" as the text.2969 # "Object--property" and use "property" as the text.
2867 if ($symbol =~ s/:/--/) {2970 if ($symbol =~ s/:/--/) {
2868 $text = "\"$'\"";2971 $text = "“$'”";
2869 }2972 }
28702973
2871 if ($tag ne "") {2974 if ($tag ne "") {
@@ -3029,24 +3132,26 @@
3029sub MakeDeprecationNote {3132sub MakeDeprecationNote {
3030 my ($symbol) = $_[0];3133 my ($symbol) = $_[0];
3031 my $desc = "";3134 my $desc = "";
3032 my $note = "";
3033 if (exists $Deprecated{$symbol}) {3135 if (exists $Deprecated{$symbol}) {
3034 $desc .= "<warning>";3136 my $note;
30353137
3036 if ($Deprecated{$symbol} =~ /^\s*([0-9\.]+)\s*:/) {3138 $desc .= "<warning><para><literal>$symbol</literal> ";
3037 $desc .= "<para><literal>$symbol</literal> has been deprecated since version $1 and should not be used in newly-written code.";3139
3140 $note = $Deprecated{$symbol};
3141
3142 if ($note =~ /^\s*([0-9\.]+)\s*:?/) {
3143 $desc .= "has been deprecated since version $1 and should not be used in newly-written code.</para>";
3038 } else {3144 } else {
3039 $desc .= "<para><literal>$symbol</literal> is deprecated and should not be used in newly-written code.";3145 $desc .= "is deprecated and should not be used in newly-written code.</para>";
3040 }3146 }
3041 if ($Deprecated{$symbol} ne "") {3147 $note =~ s/^\s*([0-9\.]+)\s*:?\s*//;
3042 $note = &ExpandAbbreviations($symbol, $Deprecated{$symbol});3148 $note =~ s/^\s+//;
3043 $note =~ s/^\s*([0-9\.]+)\s*:\s*//;3149 $note =~ s/\s+$//;
3044 $note =~ s/^\s+//;3150 if ($note ne "") {
3045 $note =~ s/\s+$//;3151 $note = &ConvertMarkDown($symbol, $note);
3046 $note =~ s%\n{2,}%\n</para>\n<para>\n%g;
3047 $desc .= " " . $note;3152 $desc .= " " . $note;
3048 }3153 }
3049 $desc .= "</para></warning>\n";3154 $desc .= "</warning>\n";
3050 }3155 }
3051 return $desc;3156 return $desc;
3052}3157}
@@ -3093,7 +3198,9 @@
3093 }3198 }
30943199
3095 if ($desc ne "") {3200 if ($desc ne "") {
3096 $desc=" condition=\"".$desc."\"";3201 my $cond = $desc;
3202 $cond =~ s/\"/&quot;/g;
3203 $desc=" condition=\"".$cond."\"";
3097 #print "condition for '$symbol' = '$desc'\n";3204 #print "condition for '$symbol' = '$desc'\n";
3098 }3205 }
3099 return $desc;3206 return $desc;
@@ -3104,12 +3211,15 @@
3104# Description : Returns the DocBook output describing the ancestors and3211# Description : Returns the DocBook output describing the ancestors and
3105# immediate children of a GObject subclass. It uses the3212# immediate children of a GObject subclass. It uses the
3106# global @Objects and @ObjectLevels arrays to walk the tree.3213# global @Objects and @ObjectLevels arrays to walk the tree.
3214#
3107# Arguments : $object - the GtkObject subclass.3215# Arguments : $object - the GtkObject subclass.
3216# @hierarchy - previous hierarchy
3108#############################################################################3217#############################################################################
31093218
3110sub GetHierarchy {3219sub GetHierarchy {
3111 my ($object) = @_;3220 my ($object,$hierarchy_ref) = @_;
31123221 my @hierarchy = @{$hierarchy_ref};
3222
3113 # Find object in the objects array.3223 # Find object in the objects array.
3114 my $found = 0;3224 my $found = 0;
3115 my @children = ();3225 my @children = ();
@@ -3132,7 +3242,7 @@
3132 }3242 }
3133 }3243 }
3134 if (!$found) {3244 if (!$found) {
3135 return "";3245 return @hierarchy;
3136 }3246 }
31373247
3138 # Walk up the hierarchy, pushing ancestors onto the ancestors array.3248 # Walk up the hierarchy, pushing ancestors onto the ancestors array.
@@ -3148,9 +3258,9 @@
3148 }3258 }
3149 }3259 }
31503260
3151 # Output the ancestors list, indented and with links.3261 # Output the ancestors, indented and with links.
3152 my $hierarchy = "<synopsis>\n";3262 my $last_index = 0;
3153 $level = 0;3263 $level = 1;
3154 for ($i = $#ancestors; $i >= 0; $i--) {3264 for ($i = $#ancestors; $i >= 0; $i--) {
3155 my $link_text;3265 my $link_text;
3156 # Don't add a link to the current object, i.e. when i == 0.3266 # Don't add a link to the current object, i.e. when i == 0.
@@ -3160,25 +3270,59 @@
3160 } else {3270 } else {
3161 $link_text = "$ancestors[$i]";3271 $link_text = "$ancestors[$i]";
3162 }3272 }
3163 if ($level == 0) {3273 my $indented_text = ' ' x ($level * 4) . $link_text;
3164 $hierarchy .= " $link_text\n";3274 # Check if we already have this object
3275 my $index = -1;
3276 for ($j = 0; $j <= $#hierarchy; $j++) {
3277 if ($hierarchy[$j] eq $indented_text) {
3278 $index = $j;
3279 last;
3280 }
3281 }
3282 if ($index == -1) {
3283 # We have a new entry, find insert position in alphabetical order
3284 my $indent = ' ' x ($level * 4);
3285 my $found = 0;
3286 for ($j = $last_index; $j <= $#hierarchy; $j++) {
3287 if ($hierarchy[$j] !~ m/^${indent}/) {
3288 $last_index = $j;
3289 $found = 1;
3290 last;
3291 } elsif ($hierarchy[$j] =~ m/^${indent}[^ ]/) {
3292 my $stripped_text = $hierarchy[$j];
3293 if ($indented_text !~ m/<link linkend/) {
3294 $stripped_text =~ s%<link linkend="[A-Za-z]*">%%;
3295 $stripped_text =~ s%</link>%%;
3296 }
3297 if ($indented_text lt $stripped_text) {
3298 $last_index = $j;
3299 $found = 1;
3300 last;
3301 }
3302 }
3303 }
3304 if (!$found) {
3305 $last_index = 1 + $#hierarchy;
3306 }
3307 splice @hierarchy, $last_index, 0, ($indented_text);
3308 $last_index++;
3165 } else {3309 } else {
3166# $hierarchy .= ' ' x ($level * 6 - 3) . "|\n";3310 # Already have this one, remmeber index as base insert point
3167 $hierarchy .= ' ' x ($level * 6 - 3) . "+----$link_text\n";3311 $last_index = $index + 1;
3168 }3312 }
3169 $level++;3313 $level++;
3170 }3314 }
3315 # Output the children, indented and with links.
3171 for ($i = 0; $i <= $#children; $i++) {3316 for ($i = 0; $i <= $#children; $i++) {
3172 my $id = &CreateValidSGMLID ($children[$i]);3317 my $id = &CreateValidSGMLID ($children[$i]);
3173 my $link_text = "<link linkend=\"$id\">$children[$i]</link>";3318 my $indented_text = ' ' x ($level * 4) . "<link linkend=\"$id\">$children[$i]</link>";
3174 $hierarchy .= ' ' x ($level * 6 - 3) . "+----$link_text\n";3319 splice @hierarchy, $last_index, 0, ($indented_text);
3175 }3320 $last_index++;
3176 $hierarchy .= "</synopsis>\n";3321 }
31773322
3178 return $hierarchy;3323 return @hierarchy;
3179}3324}
31803325
3181
3182#############################################################################3326#############################################################################
3183# Function : GetInterfaces3327# Function : GetInterfaces
3184# Description : Returns the DocBook output describing the interfaces3328# Description : Returns the DocBook output describing the interfaces
@@ -3366,15 +3510,12 @@
3366 my $symbol = "${object}::${name}";3510 my $symbol = "${object}::${name}";
3367 my $id = &CreateValidSGMLID ("$object-$name");3511 my $id = &CreateValidSGMLID ("$object-$name");
33683512
3369 my $pad = ' ' x (46 - length($name));3513 $desc .= "<refsect2 id=\"$id\" role=\"signal\"><title>The <literal>“$name”</literal> signal</title>\n";
3370 $synop .= " &quot;<link linkend=\"$id\">$name</link>&quot;$pad ";
3371
3372 $desc .= "<refsect2 id=\"$id\" role=\"signal\"><title>The <literal>&quot;$name&quot;</literal> signal</title>\n";
3373 $desc .= MakeIndexterms($symbol, $id);3514 $desc .= MakeIndexterms($symbol, $id);
3374 $desc .= "\n";3515 $desc .= "\n";
3375 $desc .= OutputSymbolExtraLinks($symbol);3516 $desc .= OutputSymbolExtraLinks($symbol);
33763517
3377 $desc .= "<programlisting>";3518 $desc .= "<programlisting language=\"C\">";
33783519
3379 $SignalReturns[$i] =~ m/\s*(const\s+)?(\w+)\s*(\**)/;3520 $SignalReturns[$i] =~ m/\s*(const\s+)?(\w+)\s*(\**)/;
3380 my $type_modifier = defined($1) ? $1 : "";3521 my $type_modifier = defined($1) ? $1 : "";
@@ -3382,12 +3523,12 @@
3382 my $pointer = $3;3523 my $pointer = $3;
3383 my $xref = &MakeXRef ($type, &tagify($type, "returnvalue"));3524 my $xref = &MakeXRef ($type, &tagify($type, "returnvalue"));
33843525
3385 my $ret_type_len = length ($type_modifier) + length ($pointer)3526 my $ret_type_output = "$type_modifier$xref$pointer";
3386 + length ($type);3527 my $callback_name = "user_function";
3387 my $ret_type_output = "$type_modifier$xref$pointer"3528 $desc .= "${ret_type_output}\n${callback_name} (";
3388 . (' ' x ($RETURN_TYPE_FIELD_WIDTH - $ret_type_len));
33893529
3390 $desc .= "${ret_type_output}user_function " . &MakeReturnField("") . " (";3530 my $indentation = ' ' x (length($callback_name) + 2);
3531 my $pad = $indentation;
33913532
3392 my $sourceparams = $SourceSymbolParams{$symbol};3533 my $sourceparams = $SourceSymbolParams{$symbol};
3393 my @params = split ("\n", $SignalPrototypes[$i]);3534 my @params = split ("\n", $SignalPrototypes[$i]);
@@ -3398,32 +3539,33 @@
3398 # do two passes, the first one is to calculate padding3539 # do two passes, the first one is to calculate padding
3399 for ($l = 0; $l < 2; $l++) {3540 for ($l = 0; $l < 2; $l++) {
3400 for ($j = 0; $j <= $#params; $j++) {3541 for ($j = 0; $j <= $#params; $j++) {
3542 my $param_name;
3401 # allow alphanumerics, '_', '[' & ']' in param names3543 # allow alphanumerics, '_', '[' & ']' in param names
3402 if ($params[$j] =~ m/^\s*(\w+)\s*(\**)\s*([\w\[\]]+)\s*$/) {3544 if ($params[$j] =~ m/^\s*(\w+)\s*(\**)\s*([\w\[\]]+)\s*$/) {
3403 $type = $1;3545 $type = $1;
3404 $pointer = $2;3546 $pointer = $2;
3405 if (defined($sourceparams)) {3547 if (defined($sourceparams)) {
3406 $name = $$sourceparams[$PARAM_FIELD_COUNT * $j];3548 $param_name = $$sourceparams[$PARAM_FIELD_COUNT * $j];
3407 }3549 }
3408 else {3550 else {
3409 $name = $3;3551 $param_name = $3;
3410 }3552 }
3411 if (!defined($name)) {3553 if (!defined($param_name)) {
3412 $name = "arg$j";3554 $param_name = "arg$j";
3413 }3555 }
3414 if ($l == 0) {3556 if ($l == 0) {
3415 if (length($type) + length($pointer) > $type_len) {3557 if (length($type) + length($pointer) > $type_len) {
3416 $type_len = length($type) + length($pointer);3558 $type_len = length($type) + length($pointer);
3417 }3559 }
3418 if (length($name) > $name_len) {3560 if (length($param_name) > $name_len) {
3419 $name_len = length($name);3561 $name_len = length($param_name);
3420 }3562 }
3421 }3563 }
3422 else {3564 else {
3423 $xref = &MakeXRef ($type, &tagify($type, "type"));3565 $xref = &MakeXRef ($type, &tagify($type, "type"));
3424 $pad = ' ' x ($type_len - length($type) - length($pointer));3566 $pad = ' ' x ($type_len - length($type) - length($pointer));
3425 $desc .= "$xref$pad $pointer$name,\n";3567 $desc .= "$xref$pad $pointer${param_name},\n";
3426 $desc .= (' ' x ($SYMBOL_FIELD_WIDTH + $RETURN_TYPE_FIELD_WIDTH));3568 $desc .= $indentation;
3427 }3569 }
3428 } else {3570 } else {
3429 &LogWarning (&GetSymbolSourceFile ($symbol), &GetSymbolSourceLine($symbol),3571 &LogWarning (&GetSymbolSourceFile ($symbol), &GetSymbolSourceLine($symbol),
@@ -3434,60 +3576,48 @@
3434 $xref = &MakeXRef ("gpointer", &tagify("gpointer", "type"));3576 $xref = &MakeXRef ("gpointer", &tagify("gpointer", "type"));
3435 $pad = ' ' x ($type_len - length("gpointer"));3577 $pad = ' ' x ($type_len - length("gpointer"));
3436 $desc .= "$xref$pad user_data)";3578 $desc .= "$xref$pad user_data)";
3579 $desc .= "</programlisting>\n";
34373580
3438 my $flags = $SignalFlags[$i];3581 my $flags = $SignalFlags[$i];
3439 my $flags_string = "";3582 my $flags_string = "";
34403583
3441 if (defined ($flags)) {3584 if (defined ($flags)) {
3442 if ($flags =~ m/f/) {3585 if ($flags =~ m/f/) {
3443 $flags_string = "<link linkend=\"G-SIGNAL-RUN-FIRST:CAPS\"><literal>Run First</literal></link>";3586 $flags_string = "<link linkend=\"G-SIGNAL-RUN-FIRST:CAPS\">Run First</link>";
3444 }3587 }
3445 elsif ($flags =~ m/l/) {3588 elsif ($flags =~ m/l/) {
3446 $flags_string = "<link linkend=\"G-SIGNAL-RUN-LAST:CAPS\"><literal>Run Last</literal></link>";3589 $flags_string = "<link linkend=\"G-SIGNAL-RUN-LAST:CAPS\">Run Last</link>";
3447 }3590 }
3448 elsif ($flags =~ m/c/) {3591 elsif ($flags =~ m/c/) {
3449 $flags_string = "<link linkend=\"G-SIGNAL-RUN-CLEANUP:CAPS\"><literal>Cleanup</literal></link>";3592 $flags_string = "<link linkend=\"G-SIGNAL-RUN-CLEANUP:CAPS\">Cleanup</link>";
3450 $flags_string = "Cleanup";3593 $flags_string = "Cleanup";
3451 }3594 }
3452 if ($flags =~ m/r/) {3595 if ($flags =~ m/r/) {
3453 if ($flags_string) { $flags_string .= " / "; }3596 if ($flags_string) { $flags_string .= " / "; }
3454 $flags_string = "<link linkend=\"G-SIGNAL-NO-RECURSE:CAPS\"><literal>No Recursion</literal></link>";3597 $flags_string = "<link linkend=\"G-SIGNAL-NO-RECURSE:CAPS\">No Recursion</link>";
3455 }3598 }
3456 if ($flags =~ m/d/) {3599 if ($flags =~ m/d/) {
3457 if ($flags_string) { $flags_string .= " / "; }3600 if ($flags_string) { $flags_string .= " / "; }
3458 $flags_string = "<link linkend=\"G-SIGNAL-DETAILED:CAPS\"><literal>Has Details</literal></link>";3601 $flags_string = "<link linkend=\"G-SIGNAL-DETAILED:CAPS\">Has Details</link>";
3459 }3602 }
3460 if ($flags =~ m/a/) {3603 if ($flags =~ m/a/) {
3461 if ($flags_string) { $flags_string .= " / "; }3604 if ($flags_string) { $flags_string .= " / "; }
3462 $flags_string = "<link linkend=\"G-SIGNAL-ACTION:CAPS\"><literal>Action</literal></link>";3605 $flags_string = "<link linkend=\"G-SIGNAL-ACTION:CAPS\">Action</link>";
3463 }3606 }
3464 if ($flags =~ m/h/) {3607 if ($flags =~ m/h/) {
3465 if ($flags_string) { $flags_string .= " / "; }3608 if ($flags_string) { $flags_string .= " / "; }
3466 $flags_string = "<link linkend=\"G-SIGNAL-NO-HOOKS:CAPS\"><literal>No Hooks</literal></link>";3609 $flags_string = "<link linkend=\"G-SIGNAL-NO-HOOKS:CAPS\">No Hooks</link>";
3467 }3610 }
3468 }3611 }
34693612
3470 if ($flags_string)3613 $synop .= "<row><entry role=\"signal_type\">${ret_type_output}</entry><entry role=\"signal_name\"><link linkend=\"$id\">${name}</link></entry><entry role=\"signal_flags\">${flags_string}</entry></row>\n";
3471 {
3472 $synop .= ": $flags_string\n";
3473
3474 $pad = ' ' x (5 + $name_len - length("user_data"));
3475 $desc .= "$pad : $flags_string</programlisting>\n";
3476 }
3477 else
3478 {
3479 $synop .= "\n";
3480 $desc .= "</programlisting>\n";
3481 }
3482
3483 $desc .= &MakeDeprecationNote($symbol);
34843614
3485 my $parameters = &OutputParamDescriptions ("SIGNAL", $symbol);3615 my $parameters = &OutputParamDescriptions ("SIGNAL", $symbol);
3486 my $parameters_output = 0;3616 my $parameters_output = 0;
34873617
3488 $AllSymbols{$symbol} = 1;3618 $AllSymbols{$symbol} = 1;
3489 if (defined ($SymbolDocs{$symbol})) {3619 if (defined ($SymbolDocs{$symbol})) {
3490 my $symbol_docs = &ExpandAbbreviations($symbol, $SymbolDocs{$symbol});3620 my $symbol_docs = &ConvertMarkDown($symbol, $SymbolDocs{$symbol});
34913621
3492 # Try to insert the parameter table at the author's desired3622 # Try to insert the parameter table at the author's desired
3493 # position. Otherwise we need to tag it onto the end.3623 # position. Otherwise we need to tag it onto the end.
@@ -3500,10 +3630,14 @@
3500 $AllDocumentedSymbols{$symbol} = 1;3630 $AllDocumentedSymbols{$symbol} = 1;
3501 }3631 }
3502 }3632 }
3633 $desc .= &MakeDeprecationNote($symbol);
35033634
3504 if ($parameters_output == 0) {3635 if ($parameters_output == 0) {
3505 $desc .= $parameters;3636 $desc .= $parameters;
3506 }3637 }
3638 if ($flags_string) {
3639 $desc .= "<para>Flags: $flags_string</para>\n";
3640 }
3507 $desc .= OutputSymbolTraits ($symbol);3641 $desc .= OutputSymbolTraits ($symbol);
3508 $desc .= "</refsect2>";3642 $desc .= "</refsect2>";
3509 }3643 }
@@ -3563,14 +3697,14 @@
3563 my $default_output = CreateValidSGML ($default);3697 my $default_output = CreateValidSGML ($default);
35643698
3565 if ($type eq "GtkString") {3699 if ($type eq "GtkString") {
3566 $type = "char*";3700 $type = "char&#160;*";
3567 }3701 }
3568 if ($type eq "GtkSignal") {3702 if ($type eq "GtkSignal") {
3569 $type = "GtkSignalFunc, gpointer";3703 $type = "GtkSignalFunc, gpointer";
3570 $type_output = &MakeXRef ("GtkSignalFunc") . ", "3704 $type_output = &MakeXRef ("GtkSignalFunc") . ", "
3571 . &MakeXRef ("gpointer");3705 . &MakeXRef ("gpointer");
3572 } elsif ($type =~ m/^(\w+)\*$/) {3706 } elsif ($type =~ m/^(\w+)\*$/) {
3573 $type_output = &MakeXRef ($1, &tagify($1, "type")) . "*";3707 $type_output = &MakeXRef ($1, &tagify($1, "type")) . "&#160;*";
3574 } else {3708 } else {
3575 $type_output = &MakeXRef ($type, &tagify($type, "type"));3709 $type_output = &MakeXRef ($type, &tagify($type, "type"));
3576 }3710 }
@@ -3595,7 +3729,7 @@
3595 my $blurb;3729 my $blurb;
3596 if (defined($SymbolDocs{$symbol}) &&3730 if (defined($SymbolDocs{$symbol}) &&
3597 !IsEmptyDoc($SymbolDocs{$symbol})) {3731 !IsEmptyDoc($SymbolDocs{$symbol})) {
3598 $blurb = &ExpandAbbreviations($symbol, $SymbolDocs{$symbol});3732 $blurb = &ConvertMarkDown($symbol, $SymbolDocs{$symbol});
3599 #print ".. [$SymbolDocs{$symbol}][$blurb]\n";3733 #print ".. [$SymbolDocs{$symbol}][$blurb]\n";
3600 $AllDocumentedSymbols{$symbol} = 1;3734 $AllDocumentedSymbols{$symbol} = 1;
3601 }3735 }
@@ -3610,17 +3744,20 @@
3610 }3744 }
36113745
3612 my $pad1 = " " x (24 - length ($name));3746 my $pad1 = " " x (24 - length ($name));
3613 my $pad2 = " " x (20 - length ($type));
36143747
3615 my $arg_synop = " &quot;<link linkend=\"$id\">$name</link>&quot;$pad1 $type_output $pad2 : $flags_string\n";3748 my $arg_synop = "<row><entry role=\"property_type\">$type_output</entry><entry role=\"property_name\"><link linkend=\"$id\">$name</link></entry><entry role=\"property_flags\">$flags_string</entry></row>\n";
3616 my $arg_desc = "<refsect2 id=\"$id\" role=\"property\"><title>The <literal>&quot;$name&quot;</literal> $kind</title>\n";3749 my $arg_desc = "<refsect2 id=\"$id\" role=\"property\"><title>The <literal>“$name”</literal> $kind</title>\n";
3617 $arg_desc .= MakeIndexterms($symbol, $id);3750 $arg_desc .= MakeIndexterms($symbol, $id);
3618 $arg_desc .= "\n";3751 $arg_desc .= "\n";
3619 $arg_desc .= OutputSymbolExtraLinks($symbol);3752 $arg_desc .= OutputSymbolExtraLinks($symbol);
36203753
3621 $arg_desc .= "<programlisting> &quot;$name&quot;$pad1 $type_output $pad2 : $flags_string</programlisting>\n";3754 $arg_desc .= "<programlisting> “$name”$pad1 $type_output</programlisting>\n";
3755 $arg_desc .= $blurb;
3622 $arg_desc .= &MakeDeprecationNote($symbol);3756 $arg_desc .= &MakeDeprecationNote($symbol);
3623 $arg_desc .= $blurb;3757
3758 if ($flags_string) {
3759 $arg_desc .= "<para>Flags: $flags_string</para>\n";
3760 }
3624 if ($range ne "") {3761 if ($range ne "") {
3625 $arg_desc .= "<para>Allowed values: $range_output</para>\n";3762 $arg_desc .= "<para>Allowed values: $range_output</para>\n";
3626 }3763 }
@@ -3877,9 +4014,7 @@
3877 }4014 }
38784015
3879 if ($deprecated_desc) {4016 if ($deprecated_desc) {
3880 if (exists $Deprecated{$symbol}) {4017 if (!exists $Deprecated{$symbol}) {
3881 }
3882 else {
3883 # don't warn for signals and properties4018 # don't warn for signals and properties
3884 #if ($symbol !~ m/::?(.*)/) {4019 #if ($symbol !~ m/::?(.*)/) {
3885 if (defined $DeclarationTypes{$symbol}) {4020 if (defined $DeclarationTypes{$symbol}) {
@@ -3910,7 +4045,7 @@
3910 $symbol = $1;4045 $symbol = $1;
3911 #print "SECTION DOCS found in source for : '$symbol'\n";4046 #print "SECTION DOCS found in source for : '$symbol'\n";
3912 $ignore_broken_returns = 1;4047 $ignore_broken_returns = 1;
3913 } elsif (m%^\s*([\w:-]*\w)\s*:?\s*(\([a-z ]+\)\s*)*$%) {4048 } elsif (m%^\s*([\w:-]*\w)\s*:?\s*(\([-a-z0-9_ ]+\)\s*)*$%) {
3914 $symbol = $1;4049 $symbol = $1;
3915 #print "SYMBOL DOCS found in source for : '$symbol'\n";4050 #print "SYMBOL DOCS found in source for : '$symbol'\n";
3916 }4051 }
@@ -4340,14 +4475,7 @@
4340 # Do not add <para> to nothing, it breaks missing docs checks.4475 # Do not add <para> to nothing, it breaks missing docs checks.
4341 my $src_doc_para = "";4476 my $src_doc_para = "";
4342 if ($src_doc ne "") {4477 if ($src_doc ne "") {
4343 # Expand markdown (and do paragraphs)4478 $src_doc_para = $src_doc;
4344 $src_doc_para = &ConvertMarkDown ($src_doc, $symbol);
4345 ## fixup xml markup
4346 # FIXME: this is questionable, as we can't make assumtions on the content really
4347 #$src_doc_para =~ s%^<para>\n(<refsect[1-9])%$1%gms;
4348 #$src_doc_para =~ s%^<para>\n<para>%<para>%gms;
4349 #$src_doc_para =~ s%(</refsect[1-9]>)\n</para>$%$1%gms;
4350 #print "$symbol : [$src_doc][$src_doc_para]\n";
4351 }4479 }
43524480
4353 if ($symbol =~ m/$TMPL_DIR\/.+:Long_Description/) {4481 if ($symbol =~ m/$TMPL_DIR\/.+:Long_Description/) {
@@ -4526,109 +4654,742 @@
4526 return 0;4654 return 0;
4527}4655}
45284656
4529
4530#############################################################################4657#############################################################################
4531# Function : ConvertMarkDown4658# Function : ConvertMarkDown
4532# Description : Converts mark down syntax to the respective docbook, but only4659# Description : Converts mark down syntax to the respective docbook.
4533# outside CDATA and <programlisting> tags.
4534# http://de.wikipedia.org/wiki/Markdown4660# http://de.wikipedia.org/wiki/Markdown
4535# Code snippets have been takesn from4661# Inspired by the design of ParseDown
4536# http://daringfireball.net/projects/markdown/4662# http://parsedown.org/
4537# Copyright (c) 2004 John Gruber4663# Copyright (c) 2013 Emanuil Rusev, erusev.com
4538# Arguments : the doc-string, the symbol name4664# Arguments : the symbol name, the doc-string
4539#############################################################################4665#############################################################################
4540my $md_in_refsect2;4666
4541sub ConvertMarkDown {4667sub ConvertMarkDown {
4542 my ($text, $symbol) = @_;4668 my ($symbol, $text) = @_;
45434669
4544 # reset state4670 $text = &MarkDownParse ($text, $symbol);
4545 $md_in_refsect2=0;4671
4546
4547 # convert
4548 $text = &ModifyXMLElements ($text, $symbol,
4549 "<!\\[CDATA\\[|<programlisting[^>]*>|\\|\\[",
4550 \&ConvertMarkDownEndTag,
4551 \&ConvertMarkDownCallback);
4552 # encapsulate and terminate
4553 $text = "<para>\n$text\n</para>";
4554 if ($md_in_refsect2==1) {
4555 $text = "$text</refsect2>"
4556 }
4557 return $text4672 return $text
4558}4673}
45594674
4560sub ConvertMarkDownEndTag {4675# SUPPORTED MARKDOWN
4561 if ($_[0] eq "<!\[CDATA\[") {4676# ==================
4562 return "]]>";4677#
4563 } elsif ($_[0] eq "|[") {4678# Atx-style Headers
4564 return "]\\|";4679# -----------------
4565 } else {4680#
4566 return "</programlisting>";4681# # Header 1
4567 }4682#
4568}4683# ## Header 2 ##
45694684#
4570sub ConvertMarkDownCallback {4685# Setext-style Headers
4571 my ($text, $symbol, $tag) = @_;4686# --------------------
45724687#
4573 # If we're not in CDATA or a <programlisting> we convert blank lines so4688# Header 1
4574 # they start a new <para>.4689# ========
4575 if ($tag eq "") {4690#
4576 my $end_of_para="";4691# Header 2
4577 my $end_of_section="";4692# --------
4578 my $have_list=0;4693#
45794694# Ordered (unnested) Lists
4580 $end_of_para = "$end_of_para</para>";4695# ------------------------
4581 $end_of_section = "$end_of_section</para>";4696#
4582 if ($md_in_refsect2==1) {4697# 1. item 1
4583 $end_of_section= "$end_of_section</refsect2>";4698#
4584 }4699# 1. item 2 with loooong
45854700# description
4586 # TODO(ensonic): it would be nice to add id parameters to the refsect2 elements4701#
45874702# 3. item 3
4588 # Setext-style headers:4703#
4589 # Header 14704# Note: we require a blank line above the list items
4590 # ========4705#
4591 #4706
4592 # Header 24707# TODO(ensonic): it would be nice to add id parameters to the refsect2 elements
4593 # --------4708
4594 #4709sub MarkDownParseBlocks {
4595 if($text =~ s%^\n(.+)[ \t]*\n=+[ \t]*\n\n%$end_of_section<refsect2><title>$1</title><para>\n%gm) {4710 my ($linesref, $symbol, $context) = @_;
4596 $md_in_refsect2=1;4711 my $line;
4597 }4712 my @md_blocks = ();
45984713 my $md_block = { type => "" };
4599 # atx-style headers:4714
4600 # # Header 14715 OUTER: foreach $line (@$linesref) {
4601 # ## Header 24716 my $first_char = substr ($line, 0, 1);
4602 # ## Header 2 with closing hashes ##4717 my $deindented_line;
4603 # ...4718
4604 # ###### Header 64719 if ($md_block->{"type"} eq "markup") {
4605 #4720 if (!$md_block->{"closed"}) {
4606 if($text =~ s%^\n\#[ \t]*(.+?)[ \t]*\#\n+%$end_of_section<refsect2><title>$1</title><para>\n%gm) {4721 if (index ($line, $md_block->{"start"}) != -1) {
4607 $md_in_refsect2=1;4722 $md_block->{"depth"}++;
4608 }4723 }
46094724 if (index ($line, $md_block->{"end"}) != -1) {
4610 # Simple (unnested) lists:4725 if ($md_block->{"depth"} > 0) {
4611 # Please select:4726 $md_block->{"depth"}--;
4612 # - item 14727 } else {
4613 # - item 2 with loooong4728 $md_block->{"closed"} = 1;
4614 # description4729 }
4615 # - item 34730 }
4616 #4731 $md_block->{"text"} .= "\n" . $line;
4617 # New paragraph.4732 next OUTER;
4618 $text.="\n"; # we need a new line to avoid too complicated matching rules below4733 }
4619 if ($text =~ s%(?<=\n)-\s+(.+?)(?=(?:\n-\s+)|(?:\n\n)|(?:\n$))%<listitem><para>$1</para></listitem>%gs) {4734 }
4620 $text =~ s%(?<!</listitem>)(\n<listitem>)%\n<itemizedlist>$1%g;4735
4621 $text =~ s%(</listitem>\n)(?!<listitem>)%$1</itemizedlist>\n%g;4736 $deindented_line = $line;
4622 }4737 $deindented_line =~ s/^\s+//;
4623 chomp $text;4738
46244739 if ($md_block->{"type"} eq "heading") {
4625 # Make Paragraphs on blank lines4740 # a heading is ended by any level less than or equal
4626 $text =~ s%\n{2,}%\n$end_of_para\n<para>\n%g;4741 if ($md_block->{"level"} == 1) {
4627 }4742 if ($line =~ /^={4,}[ \t]*$/) {
46284743 my $text = pop $md_block->{"lines"};
4629 return $text;4744 $md_block->{"interrupted"} = 0;
4630}4745 push @md_blocks, $md_block;
46314746
4747 $md_block = { type => "heading",
4748 text => $text,
4749 lines => [],
4750 level => 1 };
4751 next OUTER;
4752 } elsif ($line =~ /^[#][ \t]+(.+?)[ \t]*[#]*[ \t]*(?:{#([^}]+)})?[ \t]*$/) {
4753 $md_block->{"interrupted"} = 0;
4754 push @md_blocks, $md_block;
4755
4756 $md_block = { type => "heading",
4757 text => $1,
4758 id => $2,
4759 lines => [],
4760 level => 1 };
4761 next OUTER;
4762 } else {
4763 # push lines into the block until the end is reached
4764 push $md_block->{"lines"}, $line;
4765 next OUTER;
4766 }
4767 } else {
4768 if ($line =~ /^[=]{4,}[ \t]*$/) {
4769 my $text = pop $md_block->{"lines"};
4770 $md_block->{"interrupted"} = 0;
4771 push @md_blocks, $md_block;
4772
4773 $md_block = { type => "heading",
4774 text => $text,
4775 lines => [],
4776 level => 1 };
4777 next OUTER;
4778 } elsif ($line =~ /^[-]{4,}[ \t]*$/) {
4779 my $text = pop $md_block->{"lines"};
4780 $md_block->{"interrupted"} = 0;
4781 push @md_blocks, $md_block;
4782
4783 $md_block = { type => "heading",
4784 text => $text,
4785 lines => [],
4786 level => 2 };
4787 next OUTER;
4788 } elsif ($line =~ /^([#]{1,2})[ \t]+(.+?)[ \t]*[#]*[ \t]*(?:{#([^}]+)})?[ \t]*$/) {
4789 $md_block->{"interrupted"} = 0;
4790 push @md_blocks, $md_block;
4791
4792 $md_block = { type => "heading",
4793 text => $2,
4794 id => $3,
4795 lines => [],
4796 level => length($1) };
4797 next OUTER;
4798 } else {
4799 # push lines into the block until the end is reached
4800 push $md_block->{"lines"}, $line;
4801 next OUTER;
4802 }
4803 }
4804 } elsif ($md_block->{"type"} eq "code") {
4805 if ($line =~ /^[ \t]*\]\|/) {
4806 push @md_blocks, $md_block;
4807 $md_block = { type => "paragraph",
4808 text => "",
4809 lines => [] };
4810 } else {
4811 push $md_block->{"lines"}, $line;
4812 }
4813 next OUTER;
4814 }
4815
4816 if ($deindented_line eq "") {
4817 $md_block->{"interrupted"} = 1;
4818 next;
4819 }
4820
4821 if ($md_block->{"type"} eq "quote") {
4822 if (!$md_block->{"interrupted"}) {
4823 $line =~ s/^[ ]*>[ ]?//;
4824 push $md_block->{"lines"}, $line;
4825 next OUTER;
4826 }
4827 } elsif ($md_block->{"type"} eq "li") {
4828 my $marker = $md_block->{"marker"};
4829 if ($line =~ /^([ ]{0,3})($marker)[ ](.*)/) {
4830 my $indentation = $1;
4831 if ($md_block->{"indentation"} ne $indentation) {
4832 push $md_block->{"lines"}, $line;
4833 } else {
4834 my $lines = $3;
4835 my $ordered = $md_block->{"ordered"};
4836 $lines =~ s/^[ ]{0,4}//;
4837 $md_block->{"last"} = 0;
4838 push @md_blocks, $md_block;
4839 $md_block = { type => "li",
4840 ordered => $ordered,
4841 indentation => $indentation,
4842 marker => $marker,
4843 first => 0,
4844 last => 1,
4845 lines => [ $lines ] };
4846 }
4847 next OUTER;
4848 }
4849
4850 if ($md_block->{"interrupted"}) {
4851 if ($first_char eq " ") {
4852 push $md_block->{"lines"}, "";
4853 $line =~ s/^[ ]{0,4}//;
4854 push $md_block->{"lines"}, $line;
4855 $md_block->{"interrupted"} = 0;
4856 next OUTER;
4857 }
4858 } else {
4859 $line =~ s/^[ ]{0,4}//;
4860 push $md_block->{"lines"}, $line;
4861 next OUTER;
4862 }
4863 }
4864
4865 # indentation sensitive types
4866
4867 if ($line =~ /^([#]{1,2})[ \t]+(.+?)[ \t]*[#]*[ \t]*(?:{#([^}]+)})?[ \t]*$/) {
4868 # atx heading (#)
4869 push @md_blocks, $md_block;
4870
4871 $md_block = { type => "heading",
4872 text => $2,
4873 id => $3,
4874 lines => [],
4875 level => length($1) };
4876
4877 next OUTER;
4878 } elsif ($line =~ /^={4,}[ \t]*$/) {
4879 # setext heading (====)
4880
4881 if ($md_block->{"type"} eq "paragraph" && $md_block->{"interrupted"}) {
4882 push @md_blocks, $md_block;
4883 $md_block->{"type"} = "heading";
4884 $md_block->{"lines"} = [];
4885 $md_block->{"level"} = 1;
4886 }
4887
4888 next OUTER;
4889 } elsif ($line =~ /^-{4,}[ \t]*$/) {
4890 # setext heading (-----)
4891
4892 if ($md_block->{"type"} eq "paragraph" && $md_block->{"interrupted"}) {
4893 push @md_blocks, $md_block;
4894 $md_block->{"type"} = "heading";
4895 $md_block->{"lines"} = [];
4896 $md_block->{"level"} = 2;
4897 }
4898
4899 next OUTER;
4900 } elsif ($line =~ /^[ \t]*\|\[[ ]*(?:<!-- language="([^"]+?)" -->)?/) {
4901 # code
4902 $md_block->{"interrupted"} = 1;
4903 push @md_blocks, $md_block;
4904 $md_block = { type => "code",
4905 language => $1,
4906 lines => [] };
4907 next OUTER;
4908 }
4909
4910 # indentation insensitive types
4911
4912 if ($line =~ /^[ ]*<!DOCTYPE/) {
4913 push @md_blocks, $md_block;
4914
4915 $md_block = { type => "markup",
4916 text => $deindented_line,
4917 start => "<",
4918 end => ">",
4919 closed => 0,
4920 depth => 0 };
4921
4922 } elsif ($line =~ /^[ ]*<\??(\w+)[^>]*([\/\?])?[ \t]*>/) {
4923 # markup, including <?xml version="1.0"?>
4924 my $tag = $1;
4925 my $is_self_closing = defined($2);
4926 # FIXME: why do we need to skip https? here, if we generalize this to all
4927 # uri schemes we get parsing errors
4928 if (! $MD_TEXT_LEVEL_ELEMENTS{$tag} && $tag !~ /^https?/) {
4929 push @md_blocks, $md_block;
4930
4931 if ($is_self_closing) {
4932 $md_block = { type => "self-closing tag",
4933 text => $deindented_line };
4934 $is_self_closing = 0;
4935 next OUTER;
4936 }
4937
4938 $md_block = { type => "markup",
4939 text => $deindented_line,
4940 start => "<" . $tag . ">",
4941 end => "</" . $tag . ">",
4942 closed => 0,
4943 depth => 0 };
4944 if ($deindented_line =~ /<\/$tag>/) {
4945 $md_block->{"closed"} = 1;
4946 }
4947 next OUTER;
4948 }
4949 } elsif ($line =~ /^([ ]*)[*+-][ ](.*)/) {
4950 # li
4951 push @md_blocks, $md_block;
4952 my $lines = $2;
4953 my $indentation = $1;
4954 $lines =~ s/^[ ]{0,4}//;
4955 $md_block = { type => "li",
4956 ordered => 0,
4957 indentation => $indentation,
4958 marker => "[*+-]",
4959 first => 1,
4960 last => 1,
4961 lines => [ $lines ] };
4962 next OUTER;
4963 } elsif ($line =~ /^[ ]*>[ ]?(.*)/) {
4964 push @md_blocks, $md_block;
4965 $md_block = { type => "quote",
4966 lines => [ $1 ] };
4967 next OUTER;
4968 }
4969
4970 # list item
4971
4972 if ($line =~ /^([ ]{0,4})\d+[.][ ]+(.*)/) {
4973 push @md_blocks, $md_block;
4974 my $lines = $2;
4975 my $indentation = $1;
4976 $lines =~ s/^[ ]{0,4}//;
4977
4978 $md_block = { type => "li",
4979 ordered => 1,
4980 indentation => $indentation,
4981 marker => "\\d+[.]",
4982 first => 1,
4983 last => 1,
4984 lines => [ $lines ] };
4985
4986 next;
4987 }
4988
4989 # paragraph
4990 if ($md_block->{"type"} eq "paragraph") {
4991 if ($md_block->{"interrupted"}) {
4992 push @md_blocks, $md_block;
4993 $md_block = { type => "paragraph",
4994 interrupted => 0,
4995 text => $line };
4996 } else {
4997 $md_block->{"text"} .= "\n" . $line;
4998 }
4999 } else {
5000 push @md_blocks, $md_block;
5001 $md_block = { type => "paragraph",
5002 text => $line };
5003 }
5004 }
5005
5006 push @md_blocks, $md_block;
5007
5008 shift @md_blocks;
5009
5010 return @md_blocks;
5011}
5012
5013sub MarkDownParseSpanElementsInner {
5014 my ($text, $markersref) = @_;
5015 my $markup = "";
5016 my %markers = map { $_ => 1 } @$markersref;
5017
5018 while ($text ne "") {
5019 my $closest_marker = "";
5020 my $closest_marker_index = 0;
5021 my $closest_marker_position = -1;
5022 my $text_marker = "";
5023 my $i = 0;
5024 my $offset = 0;
5025 my @markers_rest;
5026 my $marker;
5027 my $use;
5028
5029 while ( ($marker, $use) = each %markers ) {
5030 my $marker_position;
5031
5032 if (!$use) {
5033 next;
5034 }
5035
5036 $marker_position = index ($text, $marker);
5037
5038 if ($marker_position < 0) {
5039 $markers{$marker} = 0;
5040 next;
5041 }
5042
5043 if ($closest_marker eq "" || $marker_position < $closest_marker_position) {
5044 $closest_marker = $marker;
5045 $closest_marker_index = $i;
5046 $closest_marker_position = $marker_position;
5047 }
5048 }
5049
5050 if ($closest_marker_position >= 0) {
5051 $text_marker = substr ($text, $closest_marker_position);
5052 }
5053
5054 if ($text_marker eq "") {
5055 $markup .= $text;
5056 $text = "";
5057 next; # last
5058 }
5059
5060 $markup .= substr ($text, 0, $closest_marker_position);
5061 $text = substr ($text, $closest_marker_position);
5062 @markers_rest = map { $markers{$_} ? ($_ eq $closest_marker ? () : $_) : () } keys %markers;
5063
5064 if ($closest_marker eq "![" || $closest_marker eq "[") {
5065 my %element;
5066
5067 if (index ($text, "]") && $text =~ /\[((?:[^][]|(?R))*)\]/) {
5068 my $remaining_text;
5069
5070 %element = ( "!" => (substr ($text, 0, 1) eq "!"),
5071 "a" => $1 );
5072
5073 $offset = length ($&);
5074 if ($element{"!"}) {
5075 $offset++;
5076 }
5077
5078 $remaining_text = substr ($text, $offset);
5079 if ($remaining_text =~ /^\([ ]*([^)'"]*?)(?:[ ]+['"](.+?)['"])?[ ]*\)/) {
5080 $element{"»"} = $1;
5081 if (defined ($2)) {
5082 $element{"#"} = $2;
5083 }
5084 $offset += length ($&);
5085 } elsif ($remaining_text =~ /^\s*\[([^\]<]*?)\]/) {
5086 $element{"ref"} = $1;
5087 $offset += length ($&);
5088 } else {
5089 undef %element;
5090 }
5091 }
5092
5093 if (%element) {
5094 if ($element{"»"}) {
5095 $element{"»"} =~ s/&/&amp;/g;
5096 $element{"»"} =~ s/</&lt;/g;
5097 }
5098 if ($element{"!"}) {
5099 $markup .= "<inlinemediaobject><imageobject><imagedata fileref=\"" . $element{"»"} . "\"></imagedata></imageobject>";
5100
5101 if (defined ($element{"a"})) {
5102 $markup .= "<textobject><phrase>" . $element{"a"} . "</phrase></textobject>";
5103 }
5104
5105 $markup .= "</inlinemediaobject>";
5106 } elsif ($element{"ref"}) {
5107 $element{"a"} = &MarkDownParseSpanElementsInner ($element{"a"}, \@markers_rest);
5108 $markup .= "<link linkend=\"" . $element{"ref"} . "\"";
5109
5110 if (defined ($element{"#"})) {
5111 # title attribute not supported
5112 }
5113
5114 $markup .= ">" . $element{"a"} . "</link>";
5115 } else {
5116 $element{"a"} = &MarkDownParseSpanElementsInner ($element{"a"}, \@markers_rest);
5117 $markup .= "<ulink url=\"" . $element{"»"} . "\"";
5118
5119 if (defined ($element{"#"})) {
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: