Merge lp:~noskcaj/ubuntu/trusty/gtk-doc/1.20 into lp:ubuntu/trusty/gtk-doc
- Trusty (14.04)
- 1.20
- Merge into trusty
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 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Iain Lane | Approve | ||
Review via email:
|
Commit message
Description of the change
Merge from debian
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'Makefile.am' |
2 | --- Makefile.am 2013-12-19 07:58:53 +0000 |
3 | +++ Makefile.am 2014-02-17 20:15:47 +0000 |
4 | @@ -34,11 +34,14 @@ |
5 | gtk-doc.notmpl.make \ |
6 | gtk-doc.flat.make \ |
7 | gtk-doc.notmpl-flat.make \ |
8 | - home.png \ |
9 | - left.png \ |
10 | - right.png \ |
11 | - up.png \ |
12 | - style.css |
13 | + style/home.png \ |
14 | + style/left.png \ |
15 | + style/left-insensitive.png \ |
16 | + style/right.png \ |
17 | + style/right-insensitive.png \ |
18 | + style/up.png \ |
19 | + style/up-insensitive.png \ |
20 | + style/style.css |
21 | |
22 | pkgconfigdir = $(datadir)/pkgconfig |
23 | pkgconfig_DATA = gtk-doc.pc |
24 | @@ -57,25 +60,14 @@ |
25 | |
26 | EXTRA_DIST = \ |
27 | MAINTAINERS \ |
28 | + $(gtkdocdata_DATA) \ |
29 | gtk-doc.pc.in \ |
30 | gtk-doc.m4 \ |
31 | - gtk-doc.make \ |
32 | - gtk-doc.notmpl.make \ |
33 | - gtk-doc.flat.make \ |
34 | - gtk-doc.notmpl-flat.make \ |
35 | gtk-doc.doap \ |
36 | gtk-doc.spec.in \ |
37 | gtk-doc.spec \ |
38 | - gtk-doc.dcl \ |
39 | - gtk-doc.xsl \ |
40 | gtk-doc-fo.xsl \ |
41 | - version-greater-or-equal.xsl \ |
42 | - devhelp2.xsl \ |
43 | gtk-doc.cat.in \ |
44 | - home.png \ |
45 | - left.png \ |
46 | - right.png \ |
47 | - up.png \ |
48 | doc/README \ |
49 | doc/authors.txt \ |
50 | doc/gnome.txt \ |
51 | @@ -89,7 +81,6 @@ |
52 | examples/Makefile.am \ |
53 | tools/docpercentages.pl \ |
54 | tools/gtk-doc.el \ |
55 | - style.css \ |
56 | COPYING-DOCS |
57 | |
58 | MAINTAINERCLEANFILES = \ |
59 | |
60 | === modified file 'Makefile.in' |
61 | --- Makefile.in 2013-12-19 07:58:53 +0000 |
62 | +++ Makefile.in 2014-02-17 20:15:47 +0000 |
63 | @@ -54,10 +54,11 @@ |
64 | build-aux/config.sub build-aux/depcomp build-aux/install-sh \ |
65 | build-aux/ltmain.sh build-aux/missing |
66 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 |
67 | -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ |
68 | - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ |
69 | - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ |
70 | - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac |
71 | +am__aclocal_m4_deps = $(top_srcdir)/m4/gtkdoc_jh_check_xml_catalog.m4 \ |
72 | + $(top_srcdir)/m4/gtkdoc_jh_path_xml_catalog.m4 \ |
73 | + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ |
74 | + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ |
75 | + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac |
76 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ |
77 | $(ACLOCAL_M4) |
78 | am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ |
79 | @@ -179,6 +180,7 @@ |
80 | CPP = @CPP@ |
81 | CPPFLAGS = @CPPFLAGS@ |
82 | CYGPATH_W = @CYGPATH_W@ |
83 | +DATE_FMT_CMD = @DATE_FMT_CMD@ |
84 | DBLATEX = @DBLATEX@ |
85 | DEFS = @DEFS@ |
86 | DEPDIR = @DEPDIR@ |
87 | @@ -189,6 +191,7 @@ |
88 | ECHO_N = @ECHO_N@ |
89 | ECHO_T = @ECHO_T@ |
90 | EGREP = @EGREP@ |
91 | +ELAPSED_FMT = @ELAPSED_FMT@ |
92 | EXEEXT = @EXEEXT@ |
93 | FGREP = @FGREP@ |
94 | FOP = @FOP@ |
95 | @@ -329,11 +332,14 @@ |
96 | gtk-doc.notmpl.make \ |
97 | gtk-doc.flat.make \ |
98 | gtk-doc.notmpl-flat.make \ |
99 | - home.png \ |
100 | - left.png \ |
101 | - right.png \ |
102 | - up.png \ |
103 | - style.css |
104 | + style/home.png \ |
105 | + style/left.png \ |
106 | + style/left-insensitive.png \ |
107 | + style/right.png \ |
108 | + style/right-insensitive.png \ |
109 | + style/up.png \ |
110 | + style/up-insensitive.png \ |
111 | + style/style.css |
112 | |
113 | pkgconfigdir = $(datadir)/pkgconfig |
114 | pkgconfig_DATA = gtk-doc.pc |
115 | @@ -343,25 +349,14 @@ |
116 | sgml_DATA = gtk-doc.cat |
117 | EXTRA_DIST = \ |
118 | MAINTAINERS \ |
119 | + $(gtkdocdata_DATA) \ |
120 | gtk-doc.pc.in \ |
121 | gtk-doc.m4 \ |
122 | - gtk-doc.make \ |
123 | - gtk-doc.notmpl.make \ |
124 | - gtk-doc.flat.make \ |
125 | - gtk-doc.notmpl-flat.make \ |
126 | gtk-doc.doap \ |
127 | gtk-doc.spec.in \ |
128 | gtk-doc.spec \ |
129 | - gtk-doc.dcl \ |
130 | - gtk-doc.xsl \ |
131 | gtk-doc-fo.xsl \ |
132 | - version-greater-or-equal.xsl \ |
133 | - devhelp2.xsl \ |
134 | gtk-doc.cat.in \ |
135 | - home.png \ |
136 | - left.png \ |
137 | - right.png \ |
138 | - up.png \ |
139 | doc/README \ |
140 | doc/authors.txt \ |
141 | doc/gnome.txt \ |
142 | @@ -375,7 +370,6 @@ |
143 | examples/Makefile.am \ |
144 | tools/docpercentages.pl \ |
145 | tools/gtk-doc.el \ |
146 | - style.css \ |
147 | COPYING-DOCS |
148 | |
149 | MAINTAINERCLEANFILES = \ |
150 | |
151 | === modified file 'NEWS' |
152 | --- NEWS 2013-12-19 07:58:53 +0000 |
153 | +++ NEWS 2014-02-17 20:15:47 +0000 |
154 | @@ -1,3 +1,77 @@ |
155 | +GTK-Doc 1.20 (Feb 16 2014) |
156 | +============ |
157 | + |
158 | + Important notice - starting with the next release these long deprecated |
159 | + features will be removed, please write to gtk-doc-list@gnome.org and tell us |
160 | + your concerns: |
161 | + o gtkdoc-scanobj (only used for gtkobject) |
162 | + o return values need to be documented using "Returns:". We will remove the |
163 | + heuristic that turns a paragraph starting with "Returns " into return docs. |
164 | + o gtkdoc-mktmpl - please move all the comments into the sources. |
165 | + o generating html via sgml tools (jade/openjade), using xsltproc and |
166 | + docbook-xslt is pretty common and preferred since version 1.6 |
167 | + |
168 | + Changes |
169 | + |
170 | + o 605537 : Returns: listed among parameters |
171 | + o 624001 : Support attribute-based method to deprecate symbols |
172 | + o 662424 : Class hierarchy about interfaces not generated by default |
173 | + o 665926 : should not have to document object structures |
174 | + o 666509 : Specifying --enable-gtk-doc should not be required to build source packages |
175 | + o 669417 : Duplicate IDs generated for unions registered as boxed types |
176 | + o 671519 : Self-test relies on nonportable (GNU enhanced) 'date' command |
177 | + o 692367 : gtkdocize should take a srcdir argument |
178 | + o 696570 : style updates |
179 | + o 697940 : Race condition between setup-build.stamp and scan-build.stamp |
180 | + o 701259 : /bin/bash: -chmod: command not found |
181 | + o 701638 : Support automake parallel test harness (fix error with GTKDOC_CHECK) |
182 | + o 706404 : Minor bug in gtkdoc-mkdb |
183 | + o 706438 : Empty lines added at the beginning and at the end of a programlisting |
184 | + o 707426 : master is broken in picking up flavour from configure.ac |
185 | + o 707717 : Support " Deprecated: X.Y " |
186 | + o 708268 : New *-insensitive.png files are not distributes |
187 | + o 710478 : gtkdoc-mkdb: Don't complain about annotations with hyphen |
188 | + o 711111 : gtkdoc-mkdb: sort entries in the glossary |
189 | + o 711598 : gtkdoc-scan doesn't ignore decorators containing parentheses |
190 | + o 719644 : docs: make yelp usage conditional in manual |
191 | + o 719645 : configure: emit message when looking for yelp |
192 | + o 720061 : make: create subdirectories of the content_files to the builddir |
193 | + o 721228 : configure: search for xml catalog in XDG_DATA_DIRS |
194 | + o 722479 : cp -u is not portable |
195 | + o 723118 : Mark |[ blocks as CDATA |
196 | + o 723288 : Fix MarkDown support |
197 | + o 723417 : New MarkDown parser |
198 | + o 723696 : Add support for blockquote |
199 | + o 723812 : Add support for reference links |
200 | + o 723913 : List in markdown: < p > inside the last element of a < ul > list |
201 | + o 723991 : Improve the display of the synopsis |
202 | + o 724002 : gtkdoc-scan: Fix use of uninitialised value in trace logging |
203 | + |
204 | + Contributors |
205 | + |
206 | + Alban Browaeys |
207 | + Alexander Kanavin |
208 | + Carlos Garcia Campos |
209 | + Christian Kirbach |
210 | + Daniel Mustieles |
211 | + David King |
212 | + David Nečas |
213 | + Dieter Verfaillie |
214 | + Dimitris Spingos |
215 | + Hib Eris |
216 | + Matthias Clasen |
217 | + Philip Chimento |
218 | + Philip Withnall |
219 | + Rafael Ferreira |
220 | + Rico Tzschichholz |
221 | + Ryan Lortie |
222 | + Sebastian Rasmussen |
223 | + Sébastien Wilmet |
224 | + Stefan Sauer |
225 | + Stef Walter |
226 | + William Jon McCann |
227 | + Zbigniew Jędrzejewski-Szmek |
228 | + |
229 | GTK-Doc 1.19 (Jun 05 2013) |
230 | ============ |
231 | |
232 | |
233 | === modified file 'TODO' |
234 | --- TODO 2013-12-19 07:58:53 +0000 |
235 | +++ TODO 2014-02-17 20:15:47 +0000 |
236 | @@ -16,11 +16,30 @@ |
237 | |
238 | Developers can also add items here :) |
239 | |
240 | -= Cleanups = |
241 | -== get rid of the -section.txt file == |
242 | -* section-title can be in SECTION comment already |
243 | -* when scanning a header file, everything will be put to one section |
244 | - * like we do for autogenerated section.txt file (gtkdoc-scan) |
245 | += Less files to manually edit = |
246 | +The goal is that we configure gtk-doc in configure.ac and Makefile.am and |
247 | +document the code in the sources. Right no we also have to edit a bunch of extra |
248 | +files: |
249 | + * $(DOC_MODULE).types |
250 | + * $(DOC_MODULE)-docs.xml |
251 | + * $(DOC_MODULE)-sections.txt |
252 | + |
253 | +== .types == |
254 | + |
255 | +* using SCAN_OPTION="--rebuild-types" can be used to avoid maintaining the types |
256 | + file |
257 | +* we need to check if this works well for all kind of _types (e.g. boxed) |
258 | + https://bugzilla.gnome.org/show_bug.cgi?id=605025 |
259 | + |
260 | +== -section.txt == |
261 | +https://bugzilla.gnome.org/show_bug.cgi?id=646094 |
262 | + |
263 | +* using SCAN_OPTION="--rebuild-sections" can be used to use the audogenerated |
264 | + sections file |
265 | +* when scanning a header file, everything of the header and the respective .c |
266 | + file will be put to one section |
267 | +* symbols can be hidden using __GTK_DOC_IGNORE__ |
268 | + |
269 | * we need comment markup to override the section |
270 | e.g.: " * InSection: xxxx" |
271 | this needs gtkdoc-mkdb::ScanSourceFile to understand a new tag, which |
272 | |
273 | === removed file 'acinclude.m4' |
274 | --- acinclude.m4 2004-05-15 23:11:36 +0000 |
275 | +++ acinclude.m4 1970-01-01 00:00:00 +0000 |
276 | @@ -1,55 +0,0 @@ |
277 | - |
278 | -# Checks the location of the XML Catalog |
279 | -# Usage: |
280 | -# JH_PATH_XML_CATALOG([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) |
281 | -# Defines XMLCATALOG and XML_CATALOG_FILE substitutions |
282 | -AC_DEFUN([JH_PATH_XML_CATALOG], |
283 | -[ |
284 | - # check for the presence of the XML catalog |
285 | - AC_ARG_WITH([xml-catalog], |
286 | - AC_HELP_STRING([--with-xml-catalog=CATALOG], |
287 | - [path to xml catalog to use]),, |
288 | - [with_xml_catalog=/etc/xml/catalog]) |
289 | - jh_found_xmlcatalog=true |
290 | - XML_CATALOG_FILE="$with_xml_catalog" |
291 | - AC_SUBST([XML_CATALOG_FILE]) |
292 | - AC_MSG_CHECKING([for XML catalog ($XML_CATALOG_FILE)]) |
293 | - if test -f "$XML_CATALOG_FILE"; then |
294 | - AC_MSG_RESULT([found]) |
295 | - else |
296 | - jh_found_xmlcatalog=false |
297 | - AC_MSG_RESULT([not found]) |
298 | - fi |
299 | - |
300 | - # check for the xmlcatalog program |
301 | - AC_PATH_PROG(XMLCATALOG, xmlcatalog, no) |
302 | - if test "x$XMLCATALOG" = xno; then |
303 | - jh_found_xmlcatalog=false |
304 | - fi |
305 | - |
306 | - if $jh_found_xmlcatalog; then |
307 | - ifelse([$1],,[:],[$1]) |
308 | - else |
309 | - ifelse([$2],,[AC_MSG_ERROR([could not find XML catalog])],[$2]) |
310 | - fi |
311 | -]) |
312 | - |
313 | -# Checks if a particular URI appears in the XML catalog |
314 | -# Usage: |
315 | -# JH_CHECK_XML_CATALOG(URI, [FRIENDLY-NAME], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) |
316 | -AC_DEFUN([JH_CHECK_XML_CATALOG], |
317 | -[ |
318 | - AC_REQUIRE([JH_PATH_XML_CATALOG],[JH_PATH_XML_CATALOG(,[:])])dnl |
319 | - AC_MSG_CHECKING([for ifelse([$2],,[$1],[$2]) in XML catalog]) |
320 | - if $jh_found_xmlcatalog && \ |
321 | - AC_RUN_LOG([$XMLCATALOG --noout "$XML_CATALOG_FILE" "$1" >&2]); then |
322 | - AC_MSG_RESULT([found]) |
323 | - ifelse([$3],,,[$3 |
324 | -])dnl |
325 | - else |
326 | - AC_MSG_RESULT([not found]) |
327 | - ifelse([$4],, |
328 | - [AC_MSG_ERROR([could not find ifelse([$2],,[$1],[$2]) in XML catalog])], |
329 | - [$4]) |
330 | - fi |
331 | -]) |
332 | |
333 | === modified file 'aclocal.m4' |
334 | --- aclocal.m4 2013-12-19 07:58:53 +0000 |
335 | +++ aclocal.m4 2014-02-17 20:15:47 +0000 |
336 | @@ -1643,9 +1643,10 @@ |
337 | AC_SUBST([am__untar]) |
338 | ]) # _AM_PROG_TAR |
339 | |
340 | +m4_include([m4/gtkdoc_jh_check_xml_catalog.m4]) |
341 | +m4_include([m4/gtkdoc_jh_path_xml_catalog.m4]) |
342 | m4_include([m4/libtool.m4]) |
343 | m4_include([m4/ltoptions.m4]) |
344 | m4_include([m4/ltsugar.m4]) |
345 | m4_include([m4/ltversion.m4]) |
346 | m4_include([m4/lt~obsolete.m4]) |
347 | -m4_include([acinclude.m4]) |
348 | |
349 | === modified file 'configure' |
350 | --- configure 2013-12-19 07:58:53 +0000 |
351 | +++ configure 2014-02-17 20:15:47 +0000 |
352 | @@ -1,6 +1,6 @@ |
353 | #! /bin/sh |
354 | # Guess values for system-dependent variables and create Makefiles. |
355 | -# Generated by GNU Autoconf 2.68 for gtk-doc 1.19. |
356 | +# Generated by GNU Autoconf 2.68 for gtk-doc 1.20. |
357 | # |
358 | # Report bugs to <http://bugzilla.gnome.org/enter_bug.cgi?product=gtk-doc>. |
359 | # |
360 | @@ -571,8 +571,8 @@ |
361 | # Identity of this package. |
362 | PACKAGE_NAME='gtk-doc' |
363 | PACKAGE_TARNAME='gtk-doc' |
364 | -PACKAGE_VERSION='1.19' |
365 | -PACKAGE_STRING='gtk-doc 1.19' |
366 | +PACKAGE_VERSION='1.20' |
367 | +PACKAGE_STRING='gtk-doc 1.20' |
368 | PACKAGE_BUGREPORT='http://bugzilla.gnome.org/enter_bug.cgi?product=gtk-doc' |
369 | PACKAGE_URL='' |
370 | |
371 | @@ -623,6 +623,8 @@ |
372 | XMLLINT |
373 | ITSTOOL |
374 | HELP_DIR |
375 | +DATE_FMT_CMD |
376 | +ELAPSED_FMT |
377 | TS_FMT |
378 | TRACE |
379 | glib_prefix |
380 | @@ -1349,7 +1351,7 @@ |
381 | # Omit some internal or obsolete options to make the list less imposing. |
382 | # This message is too long to be a string in the A/UX 3.1 sh. |
383 | cat <<_ACEOF |
384 | -\`configure' configures gtk-doc 1.19 to adapt to many kinds of systems. |
385 | +\`configure' configures gtk-doc 1.20 to adapt to many kinds of systems. |
386 | |
387 | Usage: $0 [OPTION]... [VAR=VALUE]... |
388 | |
389 | @@ -1419,7 +1421,7 @@ |
390 | |
391 | if test -n "$ac_init_help"; then |
392 | case $ac_init_help in |
393 | - short | recursive ) echo "Configuration of gtk-doc 1.19:";; |
394 | + short | recursive ) echo "Configuration of gtk-doc 1.20:";; |
395 | esac |
396 | cat <<\_ACEOF |
397 | |
398 | @@ -1542,7 +1544,7 @@ |
399 | test -n "$ac_init_help" && exit $ac_status |
400 | if $ac_init_version; then |
401 | cat <<\_ACEOF |
402 | -gtk-doc configure 1.19 |
403 | +gtk-doc configure 1.20 |
404 | generated by GNU Autoconf 2.68 |
405 | |
406 | Copyright (C) 2010 Free Software Foundation, Inc. |
407 | @@ -1820,7 +1822,7 @@ |
408 | This file contains any messages produced by compilers while |
409 | running configure, to aid debugging if configure makes a mistake. |
410 | |
411 | -It was created by gtk-doc $as_me 1.19, which was |
412 | +It was created by gtk-doc $as_me 1.20, which was |
413 | generated by GNU Autoconf 2.68. Invocation command line was |
414 | |
415 | $ $0 $@ |
416 | @@ -2639,7 +2641,7 @@ |
417 | |
418 | # Define the identity of the package. |
419 | PACKAGE='gtk-doc' |
420 | - VERSION='1.19' |
421 | + VERSION='1.20' |
422 | |
423 | |
424 | cat >>confdefs.h <<_ACEOF |
425 | @@ -12044,31 +12046,51 @@ |
426 | fi |
427 | |
428 | |
429 | - # check for the presence of the XML catalog |
430 | |
431 | # Check whether --with-xml-catalog was given. |
432 | if test "${with_xml_catalog+set}" = set; then : |
433 | withval=$with_xml_catalog; |
434 | else |
435 | - with_xml_catalog=/etc/xml/catalog |
436 | + with_xml_catalog='' |
437 | fi |
438 | |
439 | - jh_found_xmlcatalog=true |
440 | - XML_CATALOG_FILE="$with_xml_catalog" |
441 | - |
442 | - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XML catalog ($XML_CATALOG_FILE)" >&5 |
443 | -$as_echo_n "checking for XML catalog ($XML_CATALOG_FILE)... " >&6; } |
444 | - if test -f "$XML_CATALOG_FILE"; then |
445 | - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 |
446 | -$as_echo "found" >&6; } |
447 | - else |
448 | - jh_found_xmlcatalog=false |
449 | - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 |
450 | + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XML catalog" >&5 |
451 | +$as_echo_n "checking for XML catalog... " >&6; } |
452 | + if test -n "$with_xml_catalog"; then |
453 | + if test -f "$with_xml_catalog"; then |
454 | + jh_found_xmlcatalog=true |
455 | + else |
456 | + jh_found_xmlcatalog=false |
457 | + fi |
458 | + else |
459 | + if test -z "$XDG_DATA_DIRS"; then |
460 | + jh_xml_catalog_searchdirs="/etc:/usr/local/share:/usr/share" |
461 | + else |
462 | + jh_xml_catalog_searchdirs="/etc:$XDG_DATA_DIRS" |
463 | + fi |
464 | + jh_found_xmlcatalog=false |
465 | + jh_xml_catalog_saved_ifs="$IFS" |
466 | + IFS=':' |
467 | + for d in $jh_xml_catalog_searchdirs; do |
468 | + if test -f "$d/xml/catalog"; then |
469 | + with_xml_catalog="$d/xml/catalog" |
470 | + jh_found_xmlcatalog=true |
471 | + break |
472 | + fi |
473 | + done |
474 | + IFS="$jh_xml_catalog_saved_ifs" |
475 | + fi |
476 | + if $jh_found_xmlcatalog; then |
477 | + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_xml_catalog" >&5 |
478 | +$as_echo "$with_xml_catalog" >&6; } |
479 | + else |
480 | + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 |
481 | $as_echo "not found" >&6; } |
482 | - fi |
483 | - |
484 | - # check for the xmlcatalog program |
485 | - # Extract the first word of "xmlcatalog", so it can be a program name with args. |
486 | + fi |
487 | + XML_CATALOG_FILE="$with_xml_catalog" |
488 | + |
489 | + |
490 | + # Extract the first word of "xmlcatalog", so it can be a program name with args. |
491 | set dummy xmlcatalog; ac_word=$2 |
492 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 |
493 | $as_echo_n "checking for $ac_word... " >&6; } |
494 | @@ -12109,49 +12131,51 @@ |
495 | fi |
496 | |
497 | |
498 | - if test "x$XMLCATALOG" = xno; then |
499 | - jh_found_xmlcatalog=false |
500 | - fi |
501 | - |
502 | - if $jh_found_xmlcatalog; then |
503 | - : |
504 | - else |
505 | - : |
506 | - fi |
507 | - |
508 | - |
509 | - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DocBook XML DTD V4.3 in XML catalog" >&5 |
510 | + if test "x$XMLCATALOG" = xno; then |
511 | + jh_found_xmlcatalog=false |
512 | + fi |
513 | + |
514 | + if $jh_found_xmlcatalog; then |
515 | + : |
516 | + else |
517 | + : |
518 | + fi |
519 | + |
520 | + |
521 | + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DocBook XML DTD V4.3 in XML catalog" >&5 |
522 | $as_echo_n "checking for DocBook XML DTD V4.3 in XML catalog... " >&6; } |
523 | - if $jh_found_xmlcatalog && \ |
524 | - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$XMLCATALOG --noout \"\$XML_CATALOG_FILE\" \"-//OASIS//DTD DocBook XML V4.3//EN\" >&2"; } >&5 |
525 | + if $jh_found_xmlcatalog && \ |
526 | + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$XMLCATALOG --noout \"\$XML_CATALOG_FILE\" \"-//OASIS//DTD DocBook XML V4.3//EN\" >&2"; } >&5 |
527 | ($XMLCATALOG --noout "$XML_CATALOG_FILE" "-//OASIS//DTD DocBook XML V4.3//EN" >&2) 2>&5 |
528 | ac_status=$? |
529 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 |
530 | test $ac_status = 0; }; then |
531 | - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 |
532 | + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 |
533 | $as_echo "found" >&6; } |
534 | - else |
535 | - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 |
536 | + |
537 | + else |
538 | + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 |
539 | $as_echo "not found" >&6; } |
540 | - as_fn_error $? "could not find DocBook XML DTD V4.3 in XML catalog" "$LINENO" 5 |
541 | - fi |
542 | - |
543 | - |
544 | - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DocBook XSL Stylesheets in XML catalog" >&5 |
545 | + as_fn_error $? "could not find DocBook XML DTD V4.3 in XML catalog" "$LINENO" 5 |
546 | + fi |
547 | + |
548 | + |
549 | + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DocBook XSL Stylesheets in XML catalog" >&5 |
550 | $as_echo_n "checking for DocBook XSL Stylesheets in XML catalog... " >&6; } |
551 | - if $jh_found_xmlcatalog && \ |
552 | - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$XMLCATALOG --noout \"\$XML_CATALOG_FILE\" \"http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl\" >&2"; } >&5 |
553 | + if $jh_found_xmlcatalog && \ |
554 | + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$XMLCATALOG --noout \"\$XML_CATALOG_FILE\" \"http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl\" >&2"; } >&5 |
555 | ($XMLCATALOG --noout "$XML_CATALOG_FILE" "http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl" >&2) 2>&5 |
556 | ac_status=$? |
557 | $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 |
558 | test $ac_status = 0; }; then |
559 | - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 |
560 | + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 |
561 | $as_echo "found" >&6; } |
562 | - else |
563 | - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 |
564 | + |
565 | + else |
566 | + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 |
567 | $as_echo "not found" >&6; } |
568 | - as_fn_error $? "could not find DocBook XSL Stylesheets in XML catalog" "$LINENO" 5 |
569 | - fi |
570 | + as_fn_error $? "could not find DocBook XSL Stylesheets in XML catalog" "$LINENO" 5 |
571 | + fi |
572 | |
573 | |
574 | |
575 | @@ -12516,16 +12540,43 @@ |
576 | fi |
577 | |
578 | |
579 | -date +%s.%N | grep -q "%N" |
580 | +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether date can output nanoseconds" >&5 |
581 | +$as_echo_n "checking whether date can output nanoseconds... " >&6; } |
582 | +date +%s.%N | grep -q '%N' |
583 | if test "$?" == "1"; then |
584 | TS_FMT="+%s.%N" |
585 | + ELAPSED_FMT="+%H:%M:%S.%N" |
586 | + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 |
587 | +$as_echo "yes" >&6; } |
588 | else |
589 | TS_FMT="+%s.0" |
590 | -fi |
591 | - |
592 | - |
593 | + ELAPSED_FMT="+%H:%M:%S" |
594 | + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 |
595 | +$as_echo "no" >&6; } |
596 | +fi |
597 | + |
598 | + |
599 | + |
600 | +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether date can format dates" >&5 |
601 | +$as_echo_n "checking whether date can format dates... " >&6; } |
602 | +date >/dev/null 2>&1 --utc --date @1.1 $ELAPSED_FMT |
603 | +if test "$?" == "0"; then |
604 | + DATE_FMT_CMD="date --utc $ELAPSED_FMT --date @0" |
605 | + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 |
606 | +$as_echo "yes" >&6; } |
607 | +else |
608 | + DATE_FMT_CMD="echo " |
609 | + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 |
610 | +$as_echo "no" >&6; } |
611 | +fi |
612 | + |
613 | + |
614 | +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for yelp-tools" >&5 |
615 | +$as_echo_n "checking for yelp-tools... " >&6; } |
616 | have_yelp_tools=no |
617 | |
618 | +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 |
619 | +$as_echo "yes" >&6; } |
620 | |
621 | |
622 | |
623 | @@ -12797,6 +12848,10 @@ |
624 | |
625 | have_yelp_tools=yes |
626 | |
627 | +if test "x$have_yelp_tools" != "xyes"; then |
628 | + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 |
629 | +$as_echo "no" >&6; } |
630 | +fi |
631 | if test x$have_yelp_tools = xyes; then |
632 | HAVE_YELP_TOOLS_TRUE= |
633 | HAVE_YELP_TOOLS_FALSE='#' |
634 | @@ -13427,7 +13482,7 @@ |
635 | # report actual input values of CONFIG_FILES etc. instead of their |
636 | # values after options handling. |
637 | ac_log=" |
638 | -This file was extended by gtk-doc $as_me 1.19, which was |
639 | +This file was extended by gtk-doc $as_me 1.20, which was |
640 | generated by GNU Autoconf 2.68. Invocation command line was |
641 | |
642 | CONFIG_FILES = $CONFIG_FILES |
643 | @@ -13484,7 +13539,7 @@ |
644 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 |
645 | ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" |
646 | ac_cs_version="\\ |
647 | -gtk-doc config.status 1.19 |
648 | +gtk-doc config.status 1.20 |
649 | configured by $0, generated by GNU Autoconf 2.68, |
650 | with options \\"\$ac_cs_config\\" |
651 | |
652 | |
653 | === modified file 'configure.ac' |
654 | --- configure.ac 2013-12-19 07:58:53 +0000 |
655 | +++ configure.ac 2014-02-17 20:15:47 +0000 |
656 | @@ -5,7 +5,7 @@ |
657 | dnl Makefile can only cope with that, i.e. use 1.1, 1.2, 1.3 ... 9.9. |
658 | dnl FIXME: I can't see anything failing (1.14.1), lets try to use a three digit |
659 | dnl number for the development version |
660 | -m4_define(gtk_doc_version, 1.19) |
661 | +m4_define(gtk_doc_version, 1.20) |
662 | |
663 | AC_INIT([gtk-doc],[gtk_doc_version],[http://bugzilla.gnome.org/enter_bug.cgi?product=gtk-doc],[gtk-doc]) |
664 | |
665 | @@ -210,22 +210,44 @@ |
666 | AC_SUBST(TRACE) |
667 | |
668 | dnl check what date format we can use for the makefile tracing in tests |
669 | -date +%s.%N | grep -q "%N" |
670 | +AC_MSG_CHECKING(whether date can output nanoseconds) |
671 | +date +%s.%N | grep -q '%N' |
672 | if test "$?" == "1"; then |
673 | TS_FMT="+%s.%N" |
674 | + ELAPSED_FMT="+%H:%M:%S.%N" |
675 | + AC_MSG_RESULT(yes) |
676 | else |
677 | TS_FMT="+%s.0" |
678 | + ELAPSED_FMT="+%H:%M:%S" |
679 | + AC_MSG_RESULT(no) |
680 | fi |
681 | AC_SUBST(TS_FMT) |
682 | +AC_SUBST(ELAPSED_FMT) |
683 | + |
684 | +AC_MSG_CHECKING(whether date can format dates) |
685 | +date >/dev/null 2>&1 --utc --date @1.1 $ELAPSED_FMT |
686 | +if test "$?" == "0"; then |
687 | + DATE_FMT_CMD="date --utc $ELAPSED_FMT --date @0" |
688 | + AC_MSG_RESULT(yes) |
689 | +else |
690 | + DATE_FMT_CMD="echo " |
691 | + AC_MSG_RESULT(no) |
692 | +fi |
693 | +AC_SUBST(DATE_FMT_CMD) |
694 | |
695 | dnl |
696 | dnl Documentation |
697 | dnl |
698 | +AC_MSG_CHECKING([for yelp-tools]) |
699 | have_yelp_tools=no |
700 | m4_ifdef([YELP_HELP_INIT],[ |
701 | +AC_MSG_RESULT([yes]) |
702 | YELP_HELP_INIT |
703 | have_yelp_tools=yes |
704 | ]) |
705 | +if test "x$have_yelp_tools" != "xyes"; then |
706 | + AC_MSG_RESULT([no]) |
707 | +fi |
708 | AM_CONDITIONAL([HAVE_YELP_TOOLS],[test x$have_yelp_tools = xyes]) |
709 | |
710 | AC_CONFIG_FILES([Makefile |
711 | |
712 | === modified file 'debian/changelog' |
713 | --- debian/changelog 2013-12-19 07:58:53 +0000 |
714 | +++ debian/changelog 2014-02-17 20:15:47 +0000 |
715 | @@ -1,3 +1,17 @@ |
716 | +gtk-doc (1.20-1ubuntu1) UNRELEASED; urgency=medium |
717 | + |
718 | + * Merge from debian. Remaining changes: |
719 | + - debian/control.in: Drop optional highlight dependency, which is in |
720 | + universe. |
721 | + |
722 | + -- Jackson Doak <noskcaj@ubuntu.com> Tue, 18 Feb 2014 06:25:54 +1100 |
723 | + |
724 | +gtk-doc (1.20-1) unstable; urgency=medium |
725 | + |
726 | + * New upstream release. |
727 | + |
728 | + -- Emilio Pozuelo Monfort <pochu@debian.org> Sun, 16 Feb 2014 22:58:37 +0100 |
729 | + |
730 | gtk-doc (1.19-1ubuntu1) trusty; urgency=medium |
731 | |
732 | * Merge from debian. Remaining changes: |
733 | |
734 | === modified file 'examples/Makefile.am' |
735 | --- examples/Makefile.am 2013-12-19 07:58:53 +0000 |
736 | +++ examples/Makefile.am 2014-02-17 20:15:47 +0000 |
737 | @@ -96,7 +96,7 @@ |
738 | # Comment this out if you want 'make check' to test you doc status |
739 | # and run some sanity checks |
740 | if ENABLE_GTK_DOC |
741 | -TESTS_ENVIRONMENT = cd $(srcdir) && \ |
742 | +TESTS_ENVIRONMENT = \ |
743 | DOC_MODULE=$(DOC_MODULE) DOC_MAIN_SGML_FILE=$(DOC_MAIN_SGML_FILE) \ |
744 | SRCDIR=$(abs_srcdir) BUILDDIR=$(abs_builddir) |
745 | #TESTS = $(GTKDOC_CHECK) |
746 | |
747 | === added file 'gtk-doc.dsl' |
748 | --- gtk-doc.dsl 1970-01-01 00:00:00 +0000 |
749 | +++ gtk-doc.dsl 2014-02-17 20:15:47 +0000 |
750 | @@ -0,0 +1,464 @@ |
751 | +<!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [ |
752 | +<!ENTITY dbstyle PUBLIC "-//Norman Walsh//DOCUMENT DocBook HTML Stylesheet//EN" CDATA DSSSL> |
753 | +]> |
754 | + |
755 | +<style-sheet> |
756 | +<style-specification use="docbook"> |
757 | +<style-specification-body> |
758 | + |
759 | +(define gtkdoc-version "") |
760 | +(define gtkdoc-bookname "") |
761 | + |
762 | +;; These are some customizations to the standard HTML output produced by the |
763 | +;; Modular DocBook Stylesheets. |
764 | +;; I've copied parts of a few functions from the stylesheets so these should |
765 | +;; be checked occasionally to ensure they are up to date. |
766 | +;; |
767 | +;; The last check was with version 1.40 of the stylesheets. |
768 | +;; It will not work with versions < 1.19 since the $shade-verbatim-attr$ |
769 | +;; function was added then. Versions 1.19 to 1.39 may be OK, if you're lucky! |
770 | + |
771 | +;;(define %generate-book-toc% #f) |
772 | + |
773 | +;; If a Chapter has role="no-toc" we don't generate a table of contents. |
774 | +;; This is useful if a better contents page has been added manually, e.g. for |
775 | +;; the GTK+ Widgets & Objects page. (But it is a bit of a hack.) |
776 | +(define ($generate-chapter-toc$) |
777 | + (not (equal? (attribute-string (normalize "role") (current-node)) "no-toc"))) |
778 | + |
779 | +(define %chapter-autolabel% |
780 | + ;; Are chapters enumerated? |
781 | + #f) |
782 | + |
783 | +(define %use-id-as-filename% #t) |
784 | + |
785 | +(define %html-ext% ".html") |
786 | + |
787 | +(define ($user-html-header$ #!optional |
788 | + (home (empty-node-list)) |
789 | + (up (empty-node-list)) |
790 | + (prev (empty-node-list)) |
791 | + (next (empty-node-list))) |
792 | + (make sequence |
793 | + (if (not (string=? gtkdoc-version "")) |
794 | + (make empty-element gi: "META" |
795 | + attributes: (list |
796 | + (list "NAME" "GENERATOR") |
797 | + (list "CONTENT" (string-append |
798 | + "GTK-Doc V" |
799 | + gtkdoc-version |
800 | + " (SGML mode)")))) |
801 | + (empty-sosofo)) |
802 | + (make element gi: "STYLE" |
803 | + attributes: (list (list "TYPE" "text/css")) |
804 | + (literal ".synopsis, .classsynopsis { |
805 | + background: #eeeeee; |
806 | + border: solid 1px #aaaaaa; |
807 | + padding: 0.5em; |
808 | +} |
809 | +.programlisting { |
810 | + background: #eeeeff; |
811 | + border: solid 1px #aaaaff; |
812 | + padding: 0.5em; |
813 | +} |
814 | +.variablelist { |
815 | + padding: 4px; |
816 | + margin-left: 3em; |
817 | +} |
818 | +.navigation { |
819 | + background: #ffeeee; |
820 | + border: solid 1px #ffaaaa; |
821 | + margin-top: 0.5em; |
822 | + margin-bottom: 0.5em; |
823 | +} |
824 | +.navigation a { |
825 | + color: #770000; |
826 | +} |
827 | +.navigation a:visited { |
828 | + color: #550000; |
829 | +} |
830 | +.navigation .title { |
831 | + font-size: 200%; |
832 | +}")))) |
833 | + |
834 | + |
835 | +(mode book-titlepage-recto-mode |
836 | + (element title |
837 | + (make element gi: "TABLE" |
838 | + attributes: (list |
839 | + (list "CLASS" "navigation") |
840 | + (list "WIDTH" %gentext-nav-tblwidth%) |
841 | + (list "CELLPADDING" "2") |
842 | + (list "CELLSPACING" "0")) |
843 | + (make element gi: "TR" |
844 | + (make element gi: "TH" |
845 | + attributes: (list |
846 | + (list "ALIGN" "center") |
847 | + (list "VALIGN" "MIDDLE")) |
848 | + (make element gi: "P" |
849 | + attributes: (list (list "CLASS" (gi))) |
850 | + (process-children-trim) |
851 | + (make empty-element gi: "A" |
852 | + attributes: (list (list "NAME" (element-id)))))))))) |
853 | + |
854 | +(define (book-titlepage-separator side) |
855 | + (empty-sosofo)) |
856 | + |
857 | + |
858 | +;; This overrides the variablelist definition (copied from 1.76, |
859 | +;; dblists.dsl). It changes the table background color, cell spacing |
860 | +;; and cell padding. |
861 | +;; |
862 | +;; I have also removed the code to handle the non-table case. |
863 | +(element variablelist |
864 | + (make sequence |
865 | + (if %spacing-paras% |
866 | + (make element gi: "P" (empty-sosofo)) |
867 | + (empty-sosofo)) |
868 | + (para-check) |
869 | + |
870 | + (make element gi: "TABLE" |
871 | + attributes: '(("CLASS" "variablelist") |
872 | + ("BORDER" "0") |
873 | + ("CELLSPACING" "0") |
874 | + ("CELLPADDING" "4")) |
875 | + (if %html40% |
876 | + (make element gi: "TBODY" |
877 | + (with-mode variablelist-table |
878 | + (process-children))) |
879 | + (with-mode variablelist-table |
880 | + (process-children)))) |
881 | + (para-check 'restart))) |
882 | + |
883 | +(mode variablelist-table |
884 | + (element (variablelist title) |
885 | + (make element gi: "TR" |
886 | + attributes: '(("CLASS" "TITLE")) |
887 | + (make element gi: "TH" |
888 | + attributes: '(("ALIGN" "LEFT") |
889 | + ("VALIGN" "TOP") |
890 | + ("COLSPAN" "2")) |
891 | + (process-children)))) |
892 | + |
893 | + (element varlistentry |
894 | + (let* ((terms (select-elements (children (current-node)) |
895 | + (normalize "term"))) |
896 | + (listitem (select-elements (children (current-node)) |
897 | + (normalize "listitem")))) |
898 | + |
899 | + (make element gi: "TR" |
900 | + (make element gi: "TD" |
901 | + attributes: '(("ALIGN" "LEFT") |
902 | + ("VALIGN" "TOP")) |
903 | + (make empty-element gi: "A" |
904 | + attributes: (list |
905 | + (list "NAME" (element-id)))) |
906 | + (process-node-list terms)) |
907 | + (make element gi: "TD" |
908 | + attributes: '(("ALIGN" "LEFT") |
909 | + ("VALIGN" "TOP")) |
910 | + (process-node-list listitem))))) |
911 | + |
912 | + (element (varlistentry term) |
913 | + (make sequence |
914 | + (if %css-decoration% |
915 | + (make element gi: "SPAN" |
916 | + attributes: '(("STYLE" "white-space: nowrap")) |
917 | + (process-children-trim)) |
918 | + (make element gi: "NOBR" |
919 | + (process-children-trim))) |
920 | + (if (not (last-sibling?)) |
921 | + (literal ", ") |
922 | + (literal "")))) |
923 | + |
924 | + (element (varlistentry listitem) |
925 | + (process-children)) |
926 | +) |
927 | + |
928 | + |
929 | +;; This overrides the refsect2 definition (copied from 1.20, dbrfntry.dsl). |
930 | +;; It puts a horizontal rule before each function/struct/... description, |
931 | +;; except the first one in the refsect1. |
932 | +(element refsect2 |
933 | + (make sequence |
934 | + (if (first-sibling?) |
935 | + (empty-sosofo) |
936 | + (make empty-element gi: "HR")) |
937 | + ($block-container$))) |
938 | + |
939 | +;; Override the book declaration, so that we generate a crossreference |
940 | +;; for the book |
941 | + |
942 | +(element book |
943 | + (let* ((bookinfo (select-elements (children (current-node)) (normalize "bookinfo"))) |
944 | + (ititle (select-elements (children bookinfo) (normalize "title"))) |
945 | + (title (if (node-list-empty? ititle) |
946 | + (select-elements (children (current-node)) (normalize "title")) |
947 | + (node-list-first ititle))) |
948 | + (nl (titlepage-info-elements (current-node) bookinfo)) |
949 | + (tsosofo (with-mode head-title-mode |
950 | + (process-node-list title))) |
951 | + (dedication (select-elements (children (current-node)) (normalize "dedication")))) |
952 | + (make sequence |
953 | + (html-document |
954 | + tsosofo |
955 | + (make element gi: "DIV" |
956 | + attributes: '(("CLASS" "BOOK")) |
957 | + (if %generate-book-titlepage% |
958 | + (make sequence |
959 | + (book-titlepage nl 'recto) |
960 | + (book-titlepage nl 'verso)) |
961 | + (empty-sosofo)) |
962 | + |
963 | + (if (node-list-empty? dedication) |
964 | + (empty-sosofo) |
965 | + (with-mode dedication-page-mode |
966 | + (process-node-list dedication))) |
967 | + |
968 | + (if (not (generate-toc-in-front)) |
969 | + (process-children) |
970 | + (empty-sosofo)) |
971 | + |
972 | + (if %generate-book-toc% |
973 | + (build-toc (current-node) (toc-depth (current-node))) |
974 | + (empty-sosofo)) |
975 | + |
976 | + ;; (let loop ((gilist %generate-book-lot-list%)) |
977 | + ;; (if (null? gilist) |
978 | + ;; (empty-sosofo) |
979 | + ;; (if (not (node-list-empty? |
980 | + ;; (select-elements (descendants (current-node)) |
981 | + ;; (car gilist)))) |
982 | + ;; (make sequence |
983 | + ;; (build-lot (current-node) (car gilist)) |
984 | + ;; (loop (cdr gilist))) |
985 | + ;; (loop (cdr gilist))))) |
986 | + |
987 | + (if (generate-toc-in-front) |
988 | + (process-children) |
989 | + (empty-sosofo)))) |
990 | + (make entity |
991 | + system-id: "index.sgml" |
992 | + (with-mode generate-index-mode |
993 | + (process-children)))))) |
994 | + |
995 | +;; Mode for generating cross references |
996 | + |
997 | +(define (process-child-elements) |
998 | + (process-node-list |
999 | + (node-list-map (lambda (snl) |
1000 | + (if (equal? (node-property 'class-name snl) 'element) |
1001 | + snl |
1002 | + (empty-node-list))) |
1003 | + (children (current-node))))) |
1004 | + |
1005 | +(mode generate-index-mode |
1006 | + (element anchor |
1007 | + (if (attribute-string "href" (current-node)) |
1008 | + (empty-sosofo) |
1009 | + (make formatting-instruction data: |
1010 | + (string-append "\less-than-sign;ANCHOR id =\"" |
1011 | + (attribute-string "id" (current-node)) |
1012 | + "\" href=\"" |
1013 | + (if (not (string=? gtkdoc-bookname "")) |
1014 | + (string-append gtkdoc-bookname "/") |
1015 | + "") |
1016 | + (href-to (current-node)) |
1017 | + "\"\greater-than-sign; |
1018 | +")))) |
1019 | + |
1020 | + ;; We also want to be able to link to complete RefEntry. |
1021 | + (element refentry |
1022 | + (make sequence |
1023 | + (make formatting-instruction data: |
1024 | + (string-append "\less-than-sign;ANCHOR id =\"" |
1025 | + (attribute-string "id" (current-node)) |
1026 | + "\" href=\"" |
1027 | + (if (not (string=? gtkdoc-bookname "")) |
1028 | + (string-append gtkdoc-bookname "/") |
1029 | + "") |
1030 | + (href-to (current-node)) |
1031 | + "\"\greater-than-sign; |
1032 | +")) |
1033 | + (process-child-elements))) |
1034 | + |
1035 | + (default |
1036 | + (process-child-elements))) |
1037 | + |
1038 | +;; For hypertext links for which no target is found in the document, we output |
1039 | +;; our own special tag which we use later to resolve cross-document links. |
1040 | +(element link |
1041 | + (let* ((target (element-with-id (attribute-string (normalize "linkend"))))) |
1042 | + (if (node-list-empty? target) |
1043 | + (make element gi: "GTKDOCLINK" |
1044 | + attributes: (list |
1045 | + (list "HREF" (attribute-string (normalize "linkend")))) |
1046 | + (process-children)) |
1047 | + (make element gi: "A" |
1048 | + attributes: (list |
1049 | + (list "HREF" (href-to target))) |
1050 | + (process-children))))) |
1051 | + |
1052 | + |
1053 | +;; This overrides default-header-nav-tbl-noff (copied from 1.20, dbnavig.dsl). |
1054 | +;; I want 'Home' and 'Up' links at the top of each page, and white text on |
1055 | +;; black. |
1056 | +(define (default-header-nav-tbl-noff elemnode prev next prevsib nextsib) |
1057 | + (let* ((up (parent elemnode)) |
1058 | + (home (nav-home elemnode)) |
1059 | + (show-title? (nav-banner? elemnode)) |
1060 | + (title-sosofo |
1061 | + (make element gi: "TH" |
1062 | + attributes: (list |
1063 | + (list "WIDTH" "100%") |
1064 | + (list "align" "center")) |
1065 | + (if show-title? |
1066 | + (nav-banner elemnode) |
1067 | + (empty-sosofo)))) |
1068 | + (show-banner? (or show-title? |
1069 | + (not (node-list-empty? prev)) |
1070 | + (not (node-list-empty? next)) |
1071 | + (nav-context? elemnode))) |
1072 | + (banner-sosofo |
1073 | + (make element gi: "TR" |
1074 | + attributes: (list |
1075 | + (list "VALIGN" "middle")) |
1076 | + (if (not (node-list-empty? prev)) |
1077 | + (make element gi: "TD" |
1078 | + (make element gi: "A" |
1079 | + attributes: (list |
1080 | + (list "ACCESSKEY" "p") |
1081 | + (list "HREF" |
1082 | + (href-to prev))) |
1083 | + (make empty-element gi: "IMG" |
1084 | + attributes: (list |
1085 | + (list "SRC" "left.png") |
1086 | + (list "WIDTH" "16") |
1087 | + (list "HEIGHT" "16") |
1088 | + (list "BORDER" "0") |
1089 | + (list "ALT" "Prev"))))) |
1090 | + (empty-sosofo)) |
1091 | + (if (nav-up? elemnode) |
1092 | + (make element gi: "TD" |
1093 | + (make element gi: "A" |
1094 | + attributes: (list |
1095 | + (list "ACCESSKEY" "u") |
1096 | + (list "HREF" |
1097 | + (href-to up))) |
1098 | + (make empty-element gi: "IMG" |
1099 | + attributes: (list |
1100 | + (list "SRC" "up.png") |
1101 | + (list "WIDTH" "16") |
1102 | + (list "HEIGHT" "16") |
1103 | + (list "BORDER" "0") |
1104 | + (list "ALT" "Up"))))) |
1105 | + (empty-sosofo)) |
1106 | + (if (nav-home? elemnode) |
1107 | + (make element gi: "TD" |
1108 | + (make element gi: "A" |
1109 | + attributes: (list |
1110 | + (list "ACCESSKEY" "h") |
1111 | + (list "HREF" |
1112 | + (href-to home))) |
1113 | + (make empty-element gi: "IMG" |
1114 | + attributes: (list |
1115 | + (list "SRC" "home.png") |
1116 | + (list "WIDTH" "16") |
1117 | + (list "HEIGHT" "16") |
1118 | + (list "BORDER" "0") |
1119 | + (list "ALT" "Home"))))) |
1120 | + (empty-sosofo)) |
1121 | + title-sosofo |
1122 | + (if (not (node-list-empty? next)) |
1123 | + (make element gi: "TD" |
1124 | + (make element gi: "A" |
1125 | + attributes: (list |
1126 | + (list "ACCESSKEY" "n") |
1127 | + (list "HREF" |
1128 | + (href-to next))) |
1129 | + (make empty-element gi: "IMG" |
1130 | + attributes: (list |
1131 | + (list "SRC" "right.png") |
1132 | + (list "WIDTH" "16") |
1133 | + (list "HEIGHT" "16") |
1134 | + (list "BORDER" "0") |
1135 | + (list "ALT" "Next"))))) |
1136 | + (empty-sosofo))))) |
1137 | + |
1138 | + (if show-banner? |
1139 | + (make element gi: "TABLE" |
1140 | + attributes: (list |
1141 | + (list "WIDTH" %gentext-nav-tblwidth%) |
1142 | + (list "CLASS" "navigation") |
1143 | + (list "SUMMARY" "Navigation header") |
1144 | + (list "CELLPADDING" "2") |
1145 | + (list "CELLSPACING" "2")) |
1146 | + banner-sosofo) |
1147 | + (empty-sosofo)))) |
1148 | + |
1149 | +;; This overrides default-footer-nav-tbl (copied from 1.20, dbnavig.dsl). |
1150 | +;; It matches the header above. |
1151 | +(define (default-footer-nav-tbl elemnode prev next prevsib nextsib) |
1152 | + (let* ((show-footer? (or (not (node-list-empty? prev)) |
1153 | + (not (node-list-empty? next)))) |
1154 | + (footer-sosofo |
1155 | + (make element gi: "TR" |
1156 | + attributes: (list |
1157 | + (list "VALIGN" "middle")) |
1158 | + (make element gi: "TD" |
1159 | + attributes: (list |
1160 | + (list "ALIGN" "left")) |
1161 | + (if (not (node-list-empty? prev)) |
1162 | + (make element gi: "A" |
1163 | + attributes: (list |
1164 | + (list "ACCESSKEY" "p") |
1165 | + (list "HREF" (href-to prev))) |
1166 | + (make element gi: "B" |
1167 | + (make entity-ref name: "lt") |
1168 | + (make entity-ref name: "lt") |
1169 | + (make entity-ref name: "lt") |
1170 | + (make entity-ref name: "nbsp") |
1171 | + (element-title-sosofo prev))) |
1172 | + (empty-sosofo))) |
1173 | + (make element gi: "TD" |
1174 | + attributes: (list |
1175 | + (list "ALIGN" "right")) |
1176 | + (if (not (node-list-empty? next)) |
1177 | + (make element gi: "A" |
1178 | + attributes: (list |
1179 | + (list "ACCESSKEY" "n") |
1180 | + (list "HREF" (href-to next))) |
1181 | + (make element gi: "B" |
1182 | + (element-title-sosofo next) |
1183 | + (make entity-ref name: "nbsp") |
1184 | + (make entity-ref name: "gt") |
1185 | + (make entity-ref name: "gt") |
1186 | + (make entity-ref name: "gt"))) |
1187 | + (empty-sosofo)))))) |
1188 | + |
1189 | + (if show-footer? |
1190 | + (make element gi: "TABLE" |
1191 | + attributes: (list |
1192 | + (list "CLASS" "navigation") |
1193 | + (list "WIDTH" %gentext-nav-tblwidth%) |
1194 | + (list "SUMMARY" "Navigation footer") |
1195 | + (list "CELLPADDING" "2") |
1196 | + (list "CELLSPACING" "2")) |
1197 | + footer-sosofo) |
1198 | + (empty-sosofo)))) |
1199 | + |
1200 | + |
1201 | +(define ($section-body$) |
1202 | + (make sequence |
1203 | + (make empty-element gi: "BR" |
1204 | + attributes: (list (list "CLEAR" "all"))) |
1205 | + (make element gi: "DIV" |
1206 | + attributes: (list (list "CLASS" (gi))) |
1207 | + ($section-separator$) |
1208 | + ($section-title$) |
1209 | + (process-children)))) |
1210 | + |
1211 | +</style-specification-body> |
1212 | +</style-specification> |
1213 | +<external-specification id="docbook" document="dbstyle"> |
1214 | +</style-sheet> |
1215 | |
1216 | === modified file 'gtk-doc.dsl.in' |
1217 | --- gtk-doc.dsl.in 2004-05-15 23:11:36 +0000 |
1218 | +++ gtk-doc.dsl.in 2014-02-17 20:15:47 +0000 |
1219 | @@ -333,8 +333,8 @@ |
1220 | (make empty-element gi: "IMG" |
1221 | attributes: (list |
1222 | (list "SRC" "left.png") |
1223 | - (list "WIDTH" "24") |
1224 | - (list "HEIGHT" "24") |
1225 | + (list "WIDTH" "16") |
1226 | + (list "HEIGHT" "16") |
1227 | (list "BORDER" "0") |
1228 | (list "ALT" "Prev"))))) |
1229 | (empty-sosofo)) |
1230 | @@ -348,8 +348,8 @@ |
1231 | (make empty-element gi: "IMG" |
1232 | attributes: (list |
1233 | (list "SRC" "up.png") |
1234 | - (list "WIDTH" "24") |
1235 | - (list "HEIGHT" "24") |
1236 | + (list "WIDTH" "16") |
1237 | + (list "HEIGHT" "16") |
1238 | (list "BORDER" "0") |
1239 | (list "ALT" "Up"))))) |
1240 | (empty-sosofo)) |
1241 | @@ -363,8 +363,8 @@ |
1242 | (make empty-element gi: "IMG" |
1243 | attributes: (list |
1244 | (list "SRC" "home.png") |
1245 | - (list "WIDTH" "24") |
1246 | - (list "HEIGHT" "24") |
1247 | + (list "WIDTH" "16") |
1248 | + (list "HEIGHT" "16") |
1249 | (list "BORDER" "0") |
1250 | (list "ALT" "Home"))))) |
1251 | (empty-sosofo)) |
1252 | @@ -379,8 +379,8 @@ |
1253 | (make empty-element gi: "IMG" |
1254 | attributes: (list |
1255 | (list "SRC" "right.png") |
1256 | - (list "WIDTH" "24") |
1257 | - (list "HEIGHT" "24") |
1258 | + (list "WIDTH" "16") |
1259 | + (list "HEIGHT" "16") |
1260 | (list "BORDER" "0") |
1261 | (list "ALT" "Next"))))) |
1262 | (empty-sosofo))))) |
1263 | |
1264 | === modified file 'gtk-doc.flat.make' |
1265 | --- gtk-doc.flat.make 2013-12-19 07:58:53 +0000 |
1266 | +++ gtk-doc.flat.make 2014-02-17 20:15:47 +0000 |
1267 | @@ -49,9 +49,13 @@ |
1268 | $(DOC_MODULE)-undeclared.txt \ |
1269 | $(DOC_MODULE)-unused.txt |
1270 | |
1271 | -CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) |
1272 | - |
1273 | -if ENABLE_GTK_DOC |
1274 | +gtkdoc-check.test: Makefile |
1275 | + $(AM_V_GEN)echo "#!/bin/sh -e" > $@; \ |
1276 | + echo "$(GTKDOC_CHECK_PATH) || exit 1" >> $@; \ |
1277 | + chmod +x $@ |
1278 | + |
1279 | +CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) gtkdoc-check.test |
1280 | + |
1281 | if GTK_DOC_BUILD_HTML |
1282 | HTML_BUILD_STAMP=html-build.stamp |
1283 | else |
1284 | @@ -63,9 +67,11 @@ |
1285 | PDF_BUILD_STAMP= |
1286 | endif |
1287 | |
1288 | -all-local: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) |
1289 | -else |
1290 | -all-local: |
1291 | +all-gtk-doc: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) |
1292 | +.PHONY: all-gtk-doc |
1293 | + |
1294 | +if ENABLE_GTK_DOC |
1295 | +all-local: all-gtk-doc |
1296 | endif |
1297 | |
1298 | docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) |
1299 | @@ -83,12 +89,14 @@ |
1300 | files=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \ |
1301 | if test "x$$files" != "x" ; then \ |
1302 | for file in $$files ; do \ |
1303 | + destdir=`dirname $(abs_builddir)/$$file` ;\ |
1304 | + test -d "$$destdir" || mkdir -p "$$destdir"; \ |
1305 | test -f $(abs_srcdir)/$$file && \ |
1306 | - cp -pu $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \ |
1307 | + cp -pf $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \ |
1308 | done; \ |
1309 | fi; \ |
1310 | test -d $(abs_srcdir)/tmpl && \ |
1311 | - { cp -rp $(abs_srcdir)/tmpl $(abs_builddir)/; \ |
1312 | + { cp -pR $(abs_srcdir)/tmpl $(abs_builddir)/; \ |
1313 | chmod -R u+w $(abs_builddir)/tmpl; } \ |
1314 | fi |
1315 | $(AM_V_at)touch setup-build.stamp |
1316 | @@ -103,7 +111,7 @@ |
1317 | GTK_DOC_V_INTROSPECT_=$(GTK_DOC_V_INTROSPECT_$(AM_DEFAULT_VERBOSITY)) |
1318 | GTK_DOC_V_INTROSPECT_0=@echo " DOC Introspecting gobjects"; |
1319 | |
1320 | -scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) |
1321 | +scan-build.stamp: setup-build.stamp $(HFILE_GLOB) $(CFILE_GLOB) |
1322 | $(GTK_DOC_V_SCAN)_source_dir='' ; \ |
1323 | for i in $(DOC_SOURCE_DIR) ; do \ |
1324 | _source_dir="$${_source_dir} --source-dir=$$i" ; \ |
1325 | @@ -139,7 +147,7 @@ |
1326 | $(GTK_DOC_V_TMPL)gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS) |
1327 | $(AM_V_at)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ |
1328 | if test -w $(abs_srcdir) ; then \ |
1329 | - cp -rp $(abs_builddir)/tmpl $(abs_srcdir)/; \ |
1330 | + cp -pR $(abs_builddir)/tmpl $(abs_srcdir)/; \ |
1331 | fi \ |
1332 | fi |
1333 | $(AM_V_at)touch tmpl-build.stamp |
1334 | @@ -157,7 +165,7 @@ |
1335 | GTK_DOC_V_XML_0=@echo " DOC Building XML"; |
1336 | |
1337 | sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files) |
1338 | - $(GTK_DOC_V_XML)-chmod -R u+w $(srcdir) && _source_dir='' ; \ |
1339 | + -$(GTK_DOC_V_XML)chmod -R u+w $(srcdir) && _source_dir='' ; \ |
1340 | for i in $(DOC_SOURCE_DIR) ; do \ |
1341 | _source_dir="$${_source_dir} --source-dir=$$i" ; \ |
1342 | done ; \ |
1343 | @@ -235,6 +243,9 @@ |
1344 | clean-local: |
1345 | @rm -f *~ *.bak |
1346 | @rm -rf .libs |
1347 | + @if echo $(SCAN_OPTIONS) | grep -q "\-\-rebuild-types" ; then \ |
1348 | + rm -f $(DOC_MODULE).types; \ |
1349 | + fi |
1350 | |
1351 | distclean-local: |
1352 | @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \ |
1353 | @@ -280,15 +291,17 @@ |
1354 | # |
1355 | # Require gtk-doc when making dist |
1356 | # |
1357 | -if ENABLE_GTK_DOC |
1358 | +if HAVE_GTK_DOC |
1359 | dist-check-gtkdoc: docs |
1360 | else |
1361 | dist-check-gtkdoc: |
1362 | - @echo "*** gtk-doc must be installed and enabled in order to make dist" |
1363 | + @echo "*** gtk-doc is needed to run 'make dist'. ***" |
1364 | + @echo "*** gtk-doc was not found when 'configure' ran. ***" |
1365 | + @echo "*** please install gtk-doc and rerun 'configure'. ***" |
1366 | @false |
1367 | endif |
1368 | |
1369 | -dist-hook: dist-check-gtkdoc dist-hook-local |
1370 | +dist-hook: dist-check-gtkdoc all-gtk-doc dist-hook-local |
1371 | @mkdir $(distdir)/tmpl |
1372 | @mkdir $(distdir)/html |
1373 | @-cp ./tmpl/*.sgml $(distdir)/tmpl |
1374 | |
1375 | === modified file 'gtk-doc.m4' |
1376 | --- gtk-doc.m4 2013-12-19 07:58:53 +0000 |
1377 | +++ gtk-doc.m4 2014-02-17 20:15:47 +0000 |
1378 | @@ -1,6 +1,6 @@ |
1379 | dnl -*- mode: autoconf -*- |
1380 | |
1381 | -# serial 1 |
1382 | +# serial 2 |
1383 | |
1384 | dnl Usage: |
1385 | dnl GTK_DOC_CHECK([minimum-gtk-doc-version]) |
1386 | @@ -10,8 +10,24 @@ |
1387 | AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first |
1388 | AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first |
1389 | |
1390 | + ifelse([$1],[],[gtk_doc_requires="gtk-doc"],[gtk_doc_requires="gtk-doc >= $1"]) |
1391 | + AC_MSG_CHECKING([for gtk-doc]) |
1392 | + PKG_CHECK_EXISTS([$gtk_doc_requires],[have_gtk_doc=yes],[have_gtk_doc=no]) |
1393 | + AC_MSG_RESULT($have_gtk_doc) |
1394 | + |
1395 | + if test "$have_gtk_doc" = "no"; then |
1396 | + AC_MSG_WARN([ |
1397 | + You will not be able to create source packages with 'make dist' |
1398 | + because $gtk_doc_requires is not found.]) |
1399 | + fi |
1400 | + |
1401 | dnl check for tools we added during development |
1402 | - AC_PATH_PROG([GTKDOC_CHECK],[gtkdoc-check]) |
1403 | + dnl Use AC_CHECK_PROG to avoid the check target using an absolute path that |
1404 | + dnl may not be writable by the user. Currently, automake requires that the |
1405 | + dnl test name must end in '.test'. |
1406 | + dnl https://bugzilla.gnome.org/show_bug.cgi?id=701638 |
1407 | + AC_CHECK_PROG([GTKDOC_CHECK],[gtkdoc-check],[gtkdoc-check.test]) |
1408 | + AC_PATH_PROG([GTKDOC_CHECK_PATH],[gtkdoc-check]) |
1409 | AC_PATH_PROGS([GTKDOC_REBASE],[gtkdoc-rebase],[true]) |
1410 | AC_PATH_PROG([GTKDOC_MKPDF],[gtkdoc-mkpdf]) |
1411 | |
1412 | @@ -28,22 +44,22 @@ |
1413 | [use gtk-doc to build documentation [[default=no]]]),, |
1414 | [enable_gtk_doc=no]) |
1415 | |
1416 | - if test x$enable_gtk_doc = xyes; then |
1417 | - ifelse([$1],[], |
1418 | - [PKG_CHECK_EXISTS([gtk-doc],, |
1419 | - AC_MSG_ERROR([gtk-doc not installed and --enable-gtk-doc requested]))], |
1420 | - [PKG_CHECK_EXISTS([gtk-doc >= $1],, |
1421 | - AC_MSG_ERROR([You need to have gtk-doc >= $1 installed to build $PACKAGE_NAME]))]) |
1422 | - dnl don't check for glib if we build glib |
1423 | - if test "x$PACKAGE_NAME" != "xglib"; then |
1424 | - dnl don't fail if someone does not have glib |
1425 | - PKG_CHECK_MODULES(GTKDOC_DEPS, glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0,,[:]) |
1426 | - fi |
1427 | - fi |
1428 | - |
1429 | AC_MSG_CHECKING([whether to build gtk-doc documentation]) |
1430 | AC_MSG_RESULT($enable_gtk_doc) |
1431 | |
1432 | + if test "x$enable_gtk_doc" = "xyes" && test "$have_gtk_doc" = "no"; then |
1433 | + AC_MSG_ERROR([ |
1434 | + You must have $gtk_doc_requires installed to build documentation for |
1435 | + $PACKAGE_NAME. Please install gtk-doc or disable building the |
1436 | + documentation by adding '--disable-gtk-doc' to '[$]0'.]) |
1437 | + fi |
1438 | + |
1439 | + dnl don't check for glib if we build glib |
1440 | + if test "x$PACKAGE_NAME" != "xglib"; then |
1441 | + dnl don't fail if someone does not have glib |
1442 | + PKG_CHECK_MODULES(GTKDOC_DEPS, glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0,,[:]) |
1443 | + fi |
1444 | + |
1445 | dnl enable/disable output formats |
1446 | AC_ARG_ENABLE([gtk-doc-html], |
1447 | AS_HELP_STRING([--enable-gtk-doc-html], |
1448 | @@ -63,6 +79,7 @@ |
1449 | fi |
1450 | AC_SUBST([AM_DEFAULT_VERBOSITY]) |
1451 | |
1452 | + AM_CONDITIONAL([HAVE_GTK_DOC], [test x$have_gtk_doc = xyes]) |
1453 | AM_CONDITIONAL([ENABLE_GTK_DOC], [test x$enable_gtk_doc = xyes]) |
1454 | AM_CONDITIONAL([GTK_DOC_BUILD_HTML], [test x$enable_gtk_doc_html = xyes]) |
1455 | AM_CONDITIONAL([GTK_DOC_BUILD_PDF], [test x$enable_gtk_doc_pdf = xyes]) |
1456 | |
1457 | === modified file 'gtk-doc.make' |
1458 | --- gtk-doc.make 2013-12-19 07:58:53 +0000 |
1459 | +++ gtk-doc.make 2014-02-17 20:15:47 +0000 |
1460 | @@ -49,9 +49,13 @@ |
1461 | $(DOC_MODULE)-undeclared.txt \ |
1462 | $(DOC_MODULE)-unused.txt |
1463 | |
1464 | -CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) |
1465 | - |
1466 | -if ENABLE_GTK_DOC |
1467 | +gtkdoc-check.test: Makefile |
1468 | + $(AM_V_GEN)echo "#!/bin/sh -e" > $@; \ |
1469 | + echo "$(GTKDOC_CHECK_PATH) || exit 1" >> $@; \ |
1470 | + chmod +x $@ |
1471 | + |
1472 | +CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) gtkdoc-check.test |
1473 | + |
1474 | if GTK_DOC_BUILD_HTML |
1475 | HTML_BUILD_STAMP=html-build.stamp |
1476 | else |
1477 | @@ -63,9 +67,11 @@ |
1478 | PDF_BUILD_STAMP= |
1479 | endif |
1480 | |
1481 | -all-local: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) |
1482 | -else |
1483 | -all-local: |
1484 | +all-gtk-doc: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) |
1485 | +.PHONY: all-gtk-doc |
1486 | + |
1487 | +if ENABLE_GTK_DOC |
1488 | +all-local: all-gtk-doc |
1489 | endif |
1490 | |
1491 | docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) |
1492 | @@ -83,12 +89,14 @@ |
1493 | files=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \ |
1494 | if test "x$$files" != "x" ; then \ |
1495 | for file in $$files ; do \ |
1496 | + destdir=`dirname $(abs_builddir)/$$file` ;\ |
1497 | + test -d "$$destdir" || mkdir -p "$$destdir"; \ |
1498 | test -f $(abs_srcdir)/$$file && \ |
1499 | - cp -pu $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \ |
1500 | + cp -pf $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \ |
1501 | done; \ |
1502 | fi; \ |
1503 | test -d $(abs_srcdir)/tmpl && \ |
1504 | - { cp -rp $(abs_srcdir)/tmpl $(abs_builddir)/; \ |
1505 | + { cp -pR $(abs_srcdir)/tmpl $(abs_builddir)/; \ |
1506 | chmod -R u+w $(abs_builddir)/tmpl; } \ |
1507 | fi |
1508 | $(AM_V_at)touch setup-build.stamp |
1509 | @@ -103,7 +111,7 @@ |
1510 | GTK_DOC_V_INTROSPECT_=$(GTK_DOC_V_INTROSPECT_$(AM_DEFAULT_VERBOSITY)) |
1511 | GTK_DOC_V_INTROSPECT_0=@echo " DOC Introspecting gobjects"; |
1512 | |
1513 | -scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) |
1514 | +scan-build.stamp: setup-build.stamp $(HFILE_GLOB) $(CFILE_GLOB) |
1515 | $(GTK_DOC_V_SCAN)_source_dir='' ; \ |
1516 | for i in $(DOC_SOURCE_DIR) ; do \ |
1517 | _source_dir="$${_source_dir} --source-dir=$$i" ; \ |
1518 | @@ -139,7 +147,7 @@ |
1519 | $(GTK_DOC_V_TMPL)gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS) |
1520 | $(AM_V_at)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ |
1521 | if test -w $(abs_srcdir) ; then \ |
1522 | - cp -rp $(abs_builddir)/tmpl $(abs_srcdir)/; \ |
1523 | + cp -pR $(abs_builddir)/tmpl $(abs_srcdir)/; \ |
1524 | fi \ |
1525 | fi |
1526 | $(AM_V_at)touch tmpl-build.stamp |
1527 | @@ -157,7 +165,7 @@ |
1528 | GTK_DOC_V_XML_0=@echo " DOC Building XML"; |
1529 | |
1530 | sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files) |
1531 | - $(GTK_DOC_V_XML)-chmod -R u+w $(srcdir) && _source_dir='' ; \ |
1532 | + -$(GTK_DOC_V_XML)chmod -R u+w $(srcdir) && _source_dir='' ; \ |
1533 | for i in $(DOC_SOURCE_DIR) ; do \ |
1534 | _source_dir="$${_source_dir} --source-dir=$$i" ; \ |
1535 | done ; \ |
1536 | @@ -235,6 +243,9 @@ |
1537 | clean-local: |
1538 | @rm -f *~ *.bak |
1539 | @rm -rf .libs |
1540 | + @if echo $(SCAN_OPTIONS) | grep -q "\-\-rebuild-types" ; then \ |
1541 | + rm -f $(DOC_MODULE).types; \ |
1542 | + fi |
1543 | |
1544 | distclean-local: |
1545 | @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \ |
1546 | @@ -280,15 +291,17 @@ |
1547 | # |
1548 | # Require gtk-doc when making dist |
1549 | # |
1550 | -if ENABLE_GTK_DOC |
1551 | +if HAVE_GTK_DOC |
1552 | dist-check-gtkdoc: docs |
1553 | else |
1554 | dist-check-gtkdoc: |
1555 | - @echo "*** gtk-doc must be installed and enabled in order to make dist" |
1556 | + @echo "*** gtk-doc is needed to run 'make dist'. ***" |
1557 | + @echo "*** gtk-doc was not found when 'configure' ran. ***" |
1558 | + @echo "*** please install gtk-doc and rerun 'configure'. ***" |
1559 | @false |
1560 | endif |
1561 | |
1562 | -dist-hook: dist-check-gtkdoc dist-hook-local |
1563 | +dist-hook: dist-check-gtkdoc all-gtk-doc dist-hook-local |
1564 | @mkdir $(distdir)/tmpl |
1565 | @mkdir $(distdir)/html |
1566 | @-cp ./tmpl/*.sgml $(distdir)/tmpl |
1567 | |
1568 | === modified file 'gtk-doc.notmpl-flat.make' |
1569 | --- gtk-doc.notmpl-flat.make 2013-12-19 07:58:53 +0000 |
1570 | +++ gtk-doc.notmpl-flat.make 2014-02-17 20:15:47 +0000 |
1571 | @@ -49,9 +49,13 @@ |
1572 | $(DOC_MODULE)-undeclared.txt \ |
1573 | $(DOC_MODULE)-unused.txt |
1574 | |
1575 | -CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) |
1576 | - |
1577 | -if ENABLE_GTK_DOC |
1578 | +gtkdoc-check.test: Makefile |
1579 | + $(AM_V_GEN)echo "#!/bin/sh -e" > $@; \ |
1580 | + echo "$(GTKDOC_CHECK_PATH) || exit 1" >> $@; \ |
1581 | + chmod +x $@ |
1582 | + |
1583 | +CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) gtkdoc-check.test |
1584 | + |
1585 | if GTK_DOC_BUILD_HTML |
1586 | HTML_BUILD_STAMP=html-build.stamp |
1587 | else |
1588 | @@ -63,9 +67,11 @@ |
1589 | PDF_BUILD_STAMP= |
1590 | endif |
1591 | |
1592 | -all-local: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) |
1593 | -else |
1594 | -all-local: |
1595 | +all-gtk-doc: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) |
1596 | +.PHONY: all-gtk-doc |
1597 | + |
1598 | +if ENABLE_GTK_DOC |
1599 | +all-local: all-gtk-doc |
1600 | endif |
1601 | |
1602 | docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) |
1603 | @@ -83,8 +89,10 @@ |
1604 | files=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \ |
1605 | if test "x$$files" != "x" ; then \ |
1606 | for file in $$files ; do \ |
1607 | + destdir=`dirname $(abs_builddir)/$$file`; \ |
1608 | + test -d "$$destdir" || mkdir -p "$$destdir"; \ |
1609 | test -f $(abs_srcdir)/$$file && \ |
1610 | - cp -pu $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \ |
1611 | + cp -pf $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \ |
1612 | done; \ |
1613 | fi; \ |
1614 | fi |
1615 | @@ -101,7 +109,7 @@ |
1616 | GTK_DOC_V_INTROSPECT_=$(GTK_DOC_V_INTROSPECT_$(AM_DEFAULT_VERBOSITY)) |
1617 | GTK_DOC_V_INTROSPECT_0=@echo " DOC Introspecting gobjects"; |
1618 | |
1619 | -scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) |
1620 | +scan-build.stamp: setup-build.stamp $(HFILE_GLOB) $(CFILE_GLOB) |
1621 | $(GTK_DOC_V_SCAN)_source_dir='' ; \ |
1622 | for i in $(DOC_SOURCE_DIR) ; do \ |
1623 | _source_dir="$${_source_dir} --source-dir=$$i" ; \ |
1624 | @@ -212,6 +220,9 @@ |
1625 | clean-local: |
1626 | @rm -f *~ *.bak |
1627 | @rm -rf .libs |
1628 | + @if echo $(SCAN_OPTIONS) | grep -q "\-\-rebuild-types" ; then \ |
1629 | + rm -f $(DOC_MODULE).types; \ |
1630 | + fi |
1631 | |
1632 | distclean-local: |
1633 | @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \ |
1634 | @@ -256,15 +267,17 @@ |
1635 | # |
1636 | # Require gtk-doc when making dist |
1637 | # |
1638 | -if ENABLE_GTK_DOC |
1639 | +if HAVE_GTK_DOC |
1640 | dist-check-gtkdoc: docs |
1641 | else |
1642 | dist-check-gtkdoc: |
1643 | - @echo "*** gtk-doc must be installed and enabled in order to make dist" |
1644 | + @echo "*** gtk-doc is needed to run 'make dist'. ***" |
1645 | + @echo "*** gtk-doc was not found when 'configure' ran. ***" |
1646 | + @echo "*** please install gtk-doc and rerun 'configure'. ***" |
1647 | @false |
1648 | endif |
1649 | |
1650 | -dist-hook: dist-check-gtkdoc dist-hook-local |
1651 | +dist-hook: dist-check-gtkdoc all-gtk-doc dist-hook-local |
1652 | @mkdir $(distdir)/html |
1653 | @cp ./html/* $(distdir)/html |
1654 | @-cp ./$(DOC_MODULE).pdf $(distdir)/ |
1655 | |
1656 | === modified file 'gtk-doc.notmpl.make' |
1657 | --- gtk-doc.notmpl.make 2013-12-19 07:58:53 +0000 |
1658 | +++ gtk-doc.notmpl.make 2014-02-17 20:15:47 +0000 |
1659 | @@ -49,9 +49,13 @@ |
1660 | $(DOC_MODULE)-undeclared.txt \ |
1661 | $(DOC_MODULE)-unused.txt |
1662 | |
1663 | -CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) |
1664 | - |
1665 | -if ENABLE_GTK_DOC |
1666 | +gtkdoc-check.test: Makefile |
1667 | + $(AM_V_GEN)echo "#!/bin/sh -e" > $@; \ |
1668 | + echo "$(GTKDOC_CHECK_PATH) || exit 1" >> $@; \ |
1669 | + chmod +x $@ |
1670 | + |
1671 | +CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) gtkdoc-check.test |
1672 | + |
1673 | if GTK_DOC_BUILD_HTML |
1674 | HTML_BUILD_STAMP=html-build.stamp |
1675 | else |
1676 | @@ -63,9 +67,11 @@ |
1677 | PDF_BUILD_STAMP= |
1678 | endif |
1679 | |
1680 | -all-local: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) |
1681 | -else |
1682 | -all-local: |
1683 | +all-gtk-doc: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) |
1684 | +.PHONY: all-gtk-doc |
1685 | + |
1686 | +if ENABLE_GTK_DOC |
1687 | +all-local: all-gtk-doc |
1688 | endif |
1689 | |
1690 | docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) |
1691 | @@ -83,8 +89,10 @@ |
1692 | files=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \ |
1693 | if test "x$$files" != "x" ; then \ |
1694 | for file in $$files ; do \ |
1695 | + destdir=`dirname $(abs_builddir)/$$file`; \ |
1696 | + test -d "$$destdir" || mkdir -p "$$destdir"; \ |
1697 | test -f $(abs_srcdir)/$$file && \ |
1698 | - cp -pu $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \ |
1699 | + cp -pf $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \ |
1700 | done; \ |
1701 | fi; \ |
1702 | fi |
1703 | @@ -101,7 +109,7 @@ |
1704 | GTK_DOC_V_INTROSPECT_=$(GTK_DOC_V_INTROSPECT_$(AM_DEFAULT_VERBOSITY)) |
1705 | GTK_DOC_V_INTROSPECT_0=@echo " DOC Introspecting gobjects"; |
1706 | |
1707 | -scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) |
1708 | +scan-build.stamp: setup-build.stamp $(HFILE_GLOB) $(CFILE_GLOB) |
1709 | $(GTK_DOC_V_SCAN)_source_dir='' ; \ |
1710 | for i in $(DOC_SOURCE_DIR) ; do \ |
1711 | _source_dir="$${_source_dir} --source-dir=$$i" ; \ |
1712 | @@ -212,6 +220,9 @@ |
1713 | clean-local: |
1714 | @rm -f *~ *.bak |
1715 | @rm -rf .libs |
1716 | + @if echo $(SCAN_OPTIONS) | grep -q "\-\-rebuild-types" ; then \ |
1717 | + rm -f $(DOC_MODULE).types; \ |
1718 | + fi |
1719 | |
1720 | distclean-local: |
1721 | @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \ |
1722 | @@ -256,15 +267,17 @@ |
1723 | # |
1724 | # Require gtk-doc when making dist |
1725 | # |
1726 | -if ENABLE_GTK_DOC |
1727 | +if HAVE_GTK_DOC |
1728 | dist-check-gtkdoc: docs |
1729 | else |
1730 | dist-check-gtkdoc: |
1731 | - @echo "*** gtk-doc must be installed and enabled in order to make dist" |
1732 | + @echo "*** gtk-doc is needed to run 'make dist'. ***" |
1733 | + @echo "*** gtk-doc was not found when 'configure' ran. ***" |
1734 | + @echo "*** please install gtk-doc and rerun 'configure'. ***" |
1735 | @false |
1736 | endif |
1737 | |
1738 | -dist-hook: dist-check-gtkdoc dist-hook-local |
1739 | +dist-hook: dist-check-gtkdoc all-gtk-doc dist-hook-local |
1740 | @mkdir $(distdir)/html |
1741 | @cp ./html/* $(distdir)/html |
1742 | @-cp ./$(DOC_MODULE).pdf $(distdir)/ |
1743 | |
1744 | === modified file 'gtk-doc.pc.in' |
1745 | --- gtk-doc.pc.in 2011-05-27 09:29:25 +0000 |
1746 | +++ gtk-doc.pc.in 2014-02-17 20:15:47 +0000 |
1747 | @@ -1,6 +1,6 @@ |
1748 | prefix=@prefix@ |
1749 | exec_prefix=@exec_prefix@ |
1750 | -data_dir=@PACKAGE_DATA_DIR@ |
1751 | +data_dir=@datadir@/@PACKAGE@/data |
1752 | |
1753 | Name: gtk-doc |
1754 | Description: API documentation generator |
1755 | |
1756 | === modified file 'gtk-doc.spec' |
1757 | --- gtk-doc.spec 2013-12-19 07:58:53 +0000 |
1758 | +++ gtk-doc.spec 2014-02-17 20:15:47 +0000 |
1759 | @@ -2,7 +2,7 @@ |
1760 | |
1761 | Summary: GTK+ DocBook Documentation Generator |
1762 | Name: gtk-doc |
1763 | -Version: 1.19 |
1764 | +Version: 1.20 |
1765 | Release: 1 |
1766 | License: GPL |
1767 | Group: Utilities/Text |
1768 | |
1769 | === modified file 'gtk-doc.xsl' |
1770 | --- gtk-doc.xsl 2013-12-19 07:58:53 +0000 |
1771 | +++ gtk-doc.xsl 2014-02-17 20:15:47 +0000 |
1772 | @@ -20,6 +20,7 @@ |
1773 | |
1774 | <!-- change some parameters --> |
1775 | <!-- http://docbook.sourceforge.net/release/xsl/current/doc/html/index.html --> |
1776 | + <xsl:param name="admon.style"/> |
1777 | <xsl:param name="toc.section.depth">2</xsl:param> |
1778 | <xsl:param name="generate.toc"> |
1779 | book toc |
1780 | @@ -61,6 +62,9 @@ |
1781 | <xsl:param name="gtkdoc.version" select="''"/> |
1782 | <xsl:param name="gtkdoc.bookname" select="''"/> |
1783 | |
1784 | + <!-- Override the typical template to prevent showing titles --> |
1785 | + <xsl:param name="admon.textlabel" select="0"/> |
1786 | + |
1787 | <!-- ========================================================= --> |
1788 | |
1789 | <!-- l10n is slow, we don't ue it, so we'd like to turn it off |
1790 | @@ -390,6 +394,15 @@ |
1791 | <xsl:apply-imports/> |
1792 | </xsl:template> |
1793 | |
1794 | + <xsl:template name="user.head.title"> |
1795 | + <xsl:param name="node" select="."/> |
1796 | + <xsl:param name="title"/> |
1797 | + <xsl:variable name="home" select="/*[1]"/> |
1798 | + <title> |
1799 | + <xsl:apply-templates select="$home" mode="object.title.markup"/>: <xsl:copy-of select="$title"/> |
1800 | + </title> |
1801 | + </xsl:template> |
1802 | + |
1803 | <xsl:template name="user.head.content"> |
1804 | <xsl:if test="$gtkdoc.version"> |
1805 | <meta name="generator" content="GTK-Doc V{$gtkdoc.version} (XML mode)"/> |
1806 | @@ -454,242 +467,199 @@ |
1807 | |
1808 | <xsl:if test="$suppress.navigation = '0' and $home != ."> |
1809 | <table class="navigation" id="top" width="100%" |
1810 | - summary = "Navigation header" cellpadding="2" cellspacing="2"> |
1811 | + summary = "Navigation header" cellpadding="2" cellspacing="10"> |
1812 | <tr valign="middle"> |
1813 | - <xsl:choose> |
1814 | - <xsl:when test="count($prev) > 0"> |
1815 | - <td> |
1816 | - <a accesskey="p"> |
1817 | - <xsl:attribute name="href"> |
1818 | - <xsl:call-template name="href.target"> |
1819 | - <xsl:with-param name="object" select="$prev"/> |
1820 | - </xsl:call-template> |
1821 | - </xsl:attribute> |
1822 | - <img src="left.png" width="24" height="24" border="0"> |
1823 | - <xsl:attribute name="alt"> |
1824 | - <xsl:call-template name="gentext"> |
1825 | - <xsl:with-param name="key">nav-prev</xsl:with-param> |
1826 | - </xsl:call-template> |
1827 | - </xsl:attribute> |
1828 | - </img> |
1829 | - </a> |
1830 | - </td> |
1831 | - </xsl:when> |
1832 | - <xsl:otherwise> |
1833 | - <td> </td> |
1834 | - </xsl:otherwise> |
1835 | - </xsl:choose> |
1836 | - <xsl:choose> |
1837 | - <xsl:when test="count($up) > 0 and $up != $home"> |
1838 | - <td> |
1839 | - <a accesskey="u"> |
1840 | - <xsl:attribute name="href"> |
1841 | - <xsl:call-template name="href.target"> |
1842 | - <xsl:with-param name="object" select="$up"/> |
1843 | - </xsl:call-template> |
1844 | - </xsl:attribute> |
1845 | - <img src="up.png" width="24" height="24" border="0"> |
1846 | - <xsl:attribute name="alt"> |
1847 | - <xsl:call-template name="gentext"> |
1848 | - <xsl:with-param name="key">nav-up</xsl:with-param> |
1849 | - </xsl:call-template> |
1850 | - </xsl:attribute> |
1851 | - </img> |
1852 | - </a> |
1853 | - </td> |
1854 | - </xsl:when> |
1855 | - <xsl:otherwise> |
1856 | - <td> </td> |
1857 | - </xsl:otherwise> |
1858 | - </xsl:choose> |
1859 | - <xsl:choose> |
1860 | - <xsl:when test="$home != ."> |
1861 | - <td> |
1862 | - <a accesskey="h"> |
1863 | - <xsl:attribute name="href"> |
1864 | - <xsl:call-template name="href.target"> |
1865 | - <xsl:with-param name="object" select="$home"/> |
1866 | - </xsl:call-template> |
1867 | - </xsl:attribute> |
1868 | - <img src="home.png" width="24" height="24" border="0"> |
1869 | - <xsl:attribute name="alt"> |
1870 | - <xsl:call-template name="gentext"> |
1871 | - <xsl:with-param name="key">nav-home</xsl:with-param> |
1872 | - </xsl:call-template> |
1873 | - </xsl:attribute> |
1874 | - </img> |
1875 | - </a> |
1876 | - </td> |
1877 | - </xsl:when> |
1878 | - <xsl:otherwise> |
1879 | - <td> </td> |
1880 | - </xsl:otherwise> |
1881 | - </xsl:choose> |
1882 | - <th width="100%" align="center"> |
1883 | - <xsl:apply-templates select="$home" mode="object.title.markup"/> |
1884 | - </th> |
1885 | - <xsl:choose> |
1886 | - <xsl:when test="count($next) > 0"> |
1887 | - <td> |
1888 | - <a accesskey="n"> |
1889 | - <xsl:attribute name="href"> |
1890 | - <xsl:call-template name="href.target"> |
1891 | - <xsl:with-param name="object" select="$next"/> |
1892 | - </xsl:call-template> |
1893 | - </xsl:attribute> |
1894 | - <img src="right.png" width="24" height="24" border="0"> |
1895 | - <xsl:attribute name="alt"> |
1896 | - <xsl:call-template name="gentext"> |
1897 | - <xsl:with-param name="key">nav-next</xsl:with-param> |
1898 | - </xsl:call-template> |
1899 | - </xsl:attribute> |
1900 | - </img> |
1901 | - </a> |
1902 | - </td> |
1903 | - </xsl:when> |
1904 | - <xsl:otherwise> |
1905 | - <td> </td> |
1906 | - </xsl:otherwise> |
1907 | - </xsl:choose> |
1908 | - </tr> |
1909 | - <!--<xsl:if test="name()='refentry'"--> |
1910 | - <xsl:choose> |
1911 | - <xsl:when test="count($refsections) > 0"> |
1912 | - <tr> |
1913 | - <td colspan="5" class="shortcuts"> |
1914 | - <xsl:if test="count($sect_synopsis) > 0"> |
1915 | - <a href="#{$section_id}.synopsis" class="shortcut">Top</a> |
1916 | - </xsl:if> |
1917 | + <td width="100%" align="left" class="shortcuts"> |
1918 | + <!--<xsl:if test="name()='refentry'"--> |
1919 | + <xsl:choose> |
1920 | + <xsl:when test="count($refsections) > 0"> |
1921 | + <a href="#" class="shortcut">Top</a> |
1922 | <xsl:if test="count($sect_desc) > 0"> |
1923 | -  |  |
1924 | + <span id="nav_description"> <span class="dim">|</span>  |
1925 | <a href="#{$section_id}.description" class="shortcut"> |
1926 | <xsl:value-of select="./refsect1[@role='desc']/title"/> |
1927 | - </a> |
1928 | + </a></span> |
1929 | </xsl:if> |
1930 | <xsl:if test="count($sect_object_hierarchy) > 0"> |
1931 | -  |  |
1932 | + <span id="nav_hierarchy"> <span class="dim">|</span>  |
1933 | <a href="#{$section_id}.object-hierarchy" class="shortcut"> |
1934 | <xsl:value-of select="./refsect1[@role='object_hierarchy']/title"/> |
1935 | - </a> |
1936 | + </a></span> |
1937 | </xsl:if> |
1938 | <xsl:if test="count($sect_impl_interfaces) > 0"> |
1939 | -  |  |
1940 | + <span id="nav_interfaces"> <span class="dim">|</span>  |
1941 | <a href="#{$section_id}.implemented-interfaces" class="shortcut"> |
1942 | <xsl:value-of select="./refsect1[@role='impl_interfaces']/title"/> |
1943 | - </a> |
1944 | + </a></span> |
1945 | </xsl:if> |
1946 | <xsl:if test="count($sect_prerequisites) > 0"> |
1947 | -  |  |
1948 | + <span id="nav_prerequisites"> <span class="dim">|</span>  |
1949 | <a href="#{$section_id}.prerequisites" class="shortcut"> |
1950 | <xsl:value-of select="./refsect1[@role='prerequisites']/title"/> |
1951 | - </a> |
1952 | + </a></span> |
1953 | </xsl:if> |
1954 | <xsl:if test="count($sect_derived_interfaces) > 0"> |
1955 | -  |  |
1956 | + <span id="nav_derived_interfaces"> <span class="dim">|</span>  |
1957 | <a href="#{$section_id}.derived-interfaces" class="shortcut"> |
1958 | <xsl:value-of select="./refsect1[@role='derived_interfaces']/title"/> |
1959 | - </a> |
1960 | + </a></span> |
1961 | </xsl:if> |
1962 | <xsl:if test="count($sect_implementations) > 0"> |
1963 | -  |  |
1964 | + <span id="nav_implementations"> <span class="dim">|</span>  |
1965 | <a href="#{$section_id}.implementations" class="shortcut"> |
1966 | <xsl:value-of select="./refsect1[@role='implementations']/title"/> |
1967 | - </a> |
1968 | + </a></span> |
1969 | </xsl:if> |
1970 | <xsl:if test="count($sect_properties) > 0"> |
1971 | -  |  |
1972 | + <span id="nav_properties"> <span class="dim">|</span>  |
1973 | <a href="#{$section_id}.properties" class="shortcut"> |
1974 | <xsl:value-of select="./refsect1[@role='properties']/title"/> |
1975 | - </a> |
1976 | + </a></span> |
1977 | </xsl:if> |
1978 | <xsl:if test="count($sect_child_properties) > 0"> |
1979 | -  |  |
1980 | + <span id="nav_child_properties"> <span class="dim">|</span>  |
1981 | <a href="#{$section_id}.child-properties" class="shortcut"> |
1982 | <xsl:value-of select="./refsect1[@role='child_properties']/title"/> |
1983 | - </a> |
1984 | + </a></span> |
1985 | </xsl:if> |
1986 | <xsl:if test="count($sect_style_properties) > 0"> |
1987 | -  |  |
1988 | + <span id="nav_style_properties"> <span class="dim">|</span>  |
1989 | <a href="#{$section_id}.style-properties" class="shortcut"> |
1990 | <xsl:value-of select="./refsect1[@role='style_properties']/title"/> |
1991 | - </a> |
1992 | + </a></span> |
1993 | </xsl:if> |
1994 | <xsl:if test="count($sect_signal_proto) > 0"> |
1995 | -  |  |
1996 | + <span id="nav_signals"> <span class="dim">|</span>  |
1997 | <a href="#{$section_id}.signals" class="shortcut"> |
1998 | <xsl:value-of select="./refsect1[@role='signal_proto']/title"/> |
1999 | - </a> |
2000 | - </xsl:if> |
2001 | - <!-- |
2002 | - <xsl:if test="count($sect_details) > 0"> |
2003 | - <a href="#details" class="shortcut"> |
2004 | - <xsl:value-of select="./refsect1[@id='details']/title"/> |
2005 | - </a> |
2006 | -  |  |
2007 | - </xsl:if> |
2008 | - <xsl:if test="count($sect_property_details) > 0"> |
2009 | - <a href="#property_details" class="shortcut"> |
2010 | - <xsl:value-of select="./refsect1[@id='property_details']/title"/> |
2011 | - </a> |
2012 | -  |  |
2013 | - </xsl:if> |
2014 | - <xsl:if test="count($sect_child_property_details) > 0"> |
2015 | - <a href="#child_property_details" class="shortcut"> |
2016 | - <xsl:value-of select="./refsect1[@id='property_child_details']/title"/> |
2017 | - </a> |
2018 | -  |  |
2019 | - </xsl:if> |
2020 | - <xsl:if test="count($sect_style_property_details) > 0"> |
2021 | - <a href="#style_property_details" class="shortcut"> |
2022 | - <xsl:value-of select="./refsect1[@id='style_property_details']/title"/> |
2023 | - </a> |
2024 | -  |  |
2025 | - </xsl:if> |
2026 | - <xsl:if test="count($sect_signals) > 0"> |
2027 | - <a href="#signals" class="shortcut"> |
2028 | - <xsl:value-of select="./refsect1[@id='signals']/title"/> |
2029 | - </a> |
2030 | -  |  |
2031 | - </xsl:if> |
2032 | - --> |
2033 | - </td> |
2034 | - </tr> |
2035 | - </xsl:when> |
2036 | - <!-- this is not yet very nice, as it requires all glossdic/indexdiv |
2037 | - elements having a anchor element. maybe we can customize the xsl |
2038 | - to automaticaly create local anchors |
2039 | - --> |
2040 | - <xsl:when test="count($glssections) > 0"> |
2041 | - <tr> |
2042 | - <td colspan="5" class="shortcuts"> |
2043 | - <xsl:for-each select="./glossdiv"> |
2044 | - <xsl:if test="position() > 1"> |
2045 | -  |  |
2046 | - </xsl:if> |
2047 | - <a class="shortcut"> |
2048 | - <xsl:attribute name="href">#gls<xsl:value-of select="./title"/></xsl:attribute> |
2049 | - <xsl:value-of select="./title"/> |
2050 | - </a> |
2051 | - </xsl:for-each> |
2052 | - </td> |
2053 | - </tr> |
2054 | - </xsl:when> |
2055 | - <xsl:when test="count($idxsections) > 0"> |
2056 | - <tr> |
2057 | - <td colspan="5" class="shortcuts"> |
2058 | - <xsl:for-each select="./indexdiv/indexdiv"> |
2059 | - <xsl:if test="position() > 1"> |
2060 | -  |  |
2061 | - </xsl:if> |
2062 | - <a class="shortcut"> |
2063 | - <xsl:attribute name="href">#idx<xsl:value-of select="./title"/></xsl:attribute> |
2064 | - <xsl:value-of select="./title"/> |
2065 | - </a> |
2066 | - </xsl:for-each> |
2067 | - </td> |
2068 | - </tr> |
2069 | - </xsl:when> |
2070 | - </xsl:choose> |
2071 | + </a></span> |
2072 | + </xsl:if> |
2073 | + </xsl:when> |
2074 | + <!-- this is not yet very nice, as it requires all glossdic/indexdiv |
2075 | + elements having a anchor element. maybe we can customize the xsl |
2076 | + to automaticaly create local anchors |
2077 | + --> |
2078 | + <xsl:when test="count($glssections) > 0"> |
2079 | + <span id="nav_glossary"> |
2080 | + <xsl:for-each select="./glossdiv"> |
2081 | + <xsl:if test="position() > 1"> |
2082 | +  <span class="dim">|</span>  |
2083 | + </xsl:if> |
2084 | + <a class="shortcut"> |
2085 | + <xsl:attribute name="href">#gls<xsl:value-of select="./title"/></xsl:attribute> |
2086 | + <xsl:value-of select="./title"/> |
2087 | + </a> |
2088 | + </xsl:for-each> |
2089 | + </span> |
2090 | + </xsl:when> |
2091 | + <xsl:when test="count($idxsections) > 0"> |
2092 | + <span id="nav_index"> |
2093 | + <xsl:for-each select="./indexdiv/indexdiv"> |
2094 | + <xsl:if test="position() > 1"> |
2095 | +  <span class="dim">|</span>  |
2096 | + </xsl:if> |
2097 | + <a class="shortcut"> |
2098 | + <xsl:attribute name="href">#idx<xsl:value-of select="./title"/></xsl:attribute> |
2099 | + <xsl:value-of select="./title"/> |
2100 | + </a> |
2101 | + </xsl:for-each> |
2102 | + </span> |
2103 | + </xsl:when> |
2104 | + </xsl:choose> |
2105 | + </td> |
2106 | + <xsl:choose> |
2107 | + <xsl:when test="$home != ."> |
2108 | + <td> |
2109 | + <a accesskey="h"> |
2110 | + <xsl:attribute name="href"> |
2111 | + <xsl:call-template name="href.target"> |
2112 | + <xsl:with-param name="object" select="$home"/> |
2113 | + </xsl:call-template> |
2114 | + </xsl:attribute> |
2115 | + <img src="home.png" width="16" height="16" border="0"> |
2116 | + <xsl:attribute name="alt"> |
2117 | + <xsl:call-template name="gentext"> |
2118 | + <xsl:with-param name="key">nav-home</xsl:with-param> |
2119 | + </xsl:call-template> |
2120 | + </xsl:attribute> |
2121 | + </img> |
2122 | + </a> |
2123 | + </td> |
2124 | + </xsl:when> |
2125 | + <xsl:otherwise> |
2126 | + <td> </td> |
2127 | + </xsl:otherwise> |
2128 | + </xsl:choose> |
2129 | + <xsl:choose> |
2130 | + <xsl:when test="count($up) > 0 and $up != $home"> |
2131 | + <td> |
2132 | + <a accesskey="u"> |
2133 | + <xsl:attribute name="href"> |
2134 | + <xsl:call-template name="href.target"> |
2135 | + <xsl:with-param name="object" select="$up"/> |
2136 | + </xsl:call-template> |
2137 | + </xsl:attribute> |
2138 | + <img src="up.png" width="16" height="16" border="0"> |
2139 | + <xsl:attribute name="alt"> |
2140 | + <xsl:call-template name="gentext"> |
2141 | + <xsl:with-param name="key">nav-up</xsl:with-param> |
2142 | + </xsl:call-template> |
2143 | + </xsl:attribute> |
2144 | + </img> |
2145 | + </a> |
2146 | + </td> |
2147 | + </xsl:when> |
2148 | + <xsl:otherwise> |
2149 | + <td><img src="up-insensitive.png" width="16" height="16" border="0"/></td> |
2150 | + </xsl:otherwise> |
2151 | + </xsl:choose> |
2152 | + <xsl:choose> |
2153 | + <xsl:when test="count($prev) > 0"> |
2154 | + <td> |
2155 | + <a accesskey="p"> |
2156 | + <xsl:attribute name="href"> |
2157 | + <xsl:call-template name="href.target"> |
2158 | + <xsl:with-param name="object" select="$prev"/> |
2159 | + </xsl:call-template> |
2160 | + </xsl:attribute> |
2161 | + <img src="left.png" width="16" height="16" border="0"> |
2162 | + <xsl:attribute name="alt"> |
2163 | + <xsl:call-template name="gentext"> |
2164 | + <xsl:with-param name="key">nav-prev</xsl:with-param> |
2165 | + </xsl:call-template> |
2166 | + </xsl:attribute> |
2167 | + </img> |
2168 | + </a> |
2169 | + </td> |
2170 | + </xsl:when> |
2171 | + <xsl:otherwise> |
2172 | + <td><img src="left-insensitive.png" width="16" height="16" border="0"/></td> |
2173 | + </xsl:otherwise> |
2174 | + </xsl:choose> |
2175 | + <xsl:choose> |
2176 | + <xsl:when test="count($next) > 0"> |
2177 | + <td> |
2178 | + <a accesskey="n"> |
2179 | + <xsl:attribute name="href"> |
2180 | + <xsl:call-template name="href.target"> |
2181 | + <xsl:with-param name="object" select="$next"/> |
2182 | + </xsl:call-template> |
2183 | + </xsl:attribute> |
2184 | + <img src="right.png" width="16" height="16" border="0"> |
2185 | + <xsl:attribute name="alt"> |
2186 | + <xsl:call-template name="gentext"> |
2187 | + <xsl:with-param name="key">nav-next</xsl:with-param> |
2188 | + </xsl:call-template> |
2189 | + </xsl:attribute> |
2190 | + </img> |
2191 | + </a> |
2192 | + </td> |
2193 | + </xsl:when> |
2194 | + <xsl:otherwise> |
2195 | + <td><img src="right-insensitive.png" width="16" height="16" border="0"/></td> |
2196 | + </xsl:otherwise> |
2197 | + </xsl:choose> |
2198 | + </tr> |
2199 | </table> |
2200 | </xsl:if> |
2201 | </xsl:template> |
2202 | @@ -786,7 +756,7 @@ |
2203 | <xsl:apply-templates/> |
2204 | </p> |
2205 | </td> |
2206 | - <td valign="top" align="right"> |
2207 | + <td class="gallery_image" valign="top" align="right"> |
2208 | <xsl:choose> |
2209 | <xsl:when test="../refmeta/refmiscinfo/inlinegraphic"> |
2210 | <xsl:apply-templates select="../refmeta/refmiscinfo/inlinegraphic"/> |
2211 | @@ -828,7 +798,7 @@ |
2212 | <span class="extralinks"> |
2213 | <xsl:for-each select="../ulink[@role='extralinks']"> |
2214 | <xsl:if test="position() = 1">[ </xsl:if> |
2215 | - <xsl:if test="position() > 1"> | </xsl:if> |
2216 | + <xsl:if test="position() > 1"> <span class="dim">|</span> </xsl:if> |
2217 | <a> |
2218 | <xsl:attribute name="href"><xsl:value-of select="@url"/></xsl:attribute> |
2219 | <xsl:copy-of select="text()" /> |
2220 | |
2221 | === added file 'gtkdoc-common.pl' |
2222 | --- gtkdoc-common.pl 1970-01-01 00:00:00 +0000 |
2223 | +++ gtkdoc-common.pl 2014-02-17 20:15:47 +0000 |
2224 | @@ -0,0 +1,543 @@ |
2225 | +#!/usr/bin/perl -w |
2226 | +# -*- cperl -*- |
2227 | +# |
2228 | +# gtk-doc - GTK DocBook documentation generator. |
2229 | +# Copyright (C) 2001 Damon Chaplin |
2230 | +# |
2231 | +# This program is free software; you can redistribute it and/or modify |
2232 | +# it under the terms of the GNU General Public License as published by |
2233 | +# the Free Software Foundation; either version 2 of the License, or |
2234 | +# (at your option) any later version. |
2235 | +# |
2236 | +# This program is distributed in the hope that it will be useful, |
2237 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
2238 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2239 | +# GNU General Public License for more details. |
2240 | +# |
2241 | +# You should have received a copy of the GNU General Public License |
2242 | +# along with this program; if not, write to the Free Software |
2243 | +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
2244 | +# |
2245 | + |
2246 | +# |
2247 | +# These are functions used by several of the gtk-doc Perl scripts. |
2248 | +# We'll move more of the common routines here eventually, though they need to |
2249 | +# stop using global variables first. |
2250 | +# |
2251 | + |
2252 | +1; |
2253 | + |
2254 | + |
2255 | +############################################################################# |
2256 | +# Function : UpdateFileIfChanged |
2257 | +# Description : Compares the old version of the file with the new version and |
2258 | +# if the file has changed it moves the new version into the old |
2259 | +# versions place. This is used so we only change files if |
2260 | +# needed, so we can do proper dependency tracking and we don't |
2261 | +# needlessly check files into version control systems that haven't |
2262 | +# changed. |
2263 | +# It returns 0 if the file hasn't changed, and 1 if it has. |
2264 | +# Arguments : $old_file - the pathname of the old file. |
2265 | +# $new_file - the pathname of the new version of the file. |
2266 | +# $make_backup - 1 if a backup of the old file should be kept. |
2267 | +# It will have the .bak suffix added to the file name. |
2268 | +############################################################################# |
2269 | + |
2270 | +sub UpdateFileIfChanged { |
2271 | + my ($old_file, $new_file, $make_backup) = @_; |
2272 | + |
2273 | + #LogTrace("Comparing $old_file with $new_file..."); |
2274 | + |
2275 | + # If the old file doesn't exist we want this to default to 1. |
2276 | + my $exit_code = 1; |
2277 | + |
2278 | + if (-e $old_file) { |
2279 | + `cmp -s "$old_file" "$new_file"`; |
2280 | + $exit_code = $? >> 8; |
2281 | + #LogTrace(" cmp exit code: $exit_code ($?)"; |
2282 | + } |
2283 | + |
2284 | + if ($exit_code > 1) { |
2285 | + die "Error running 'cmp $old_file $new_file'"; |
2286 | + } |
2287 | + |
2288 | + if ($exit_code == 1) { |
2289 | + #LogTrace(" files changed - replacing old version with new version."); |
2290 | + if ($make_backup && -e $old_file) { |
2291 | + rename ($old_file, "$old_file.bak") |
2292 | + || die "Can't move $old_file to $old_file.bak: $!"; |
2293 | + } |
2294 | + rename ($new_file, $old_file) |
2295 | + || die "Can't move $new_file to $old_file: $!"; |
2296 | + |
2297 | + return 1; |
2298 | + } else { |
2299 | + #LogTrace(" files the same - deleting new version."); |
2300 | + unlink ("$new_file") |
2301 | + || die "Can't delete file: $new_file: $!"; |
2302 | + |
2303 | + return 0; |
2304 | + } |
2305 | +} |
2306 | + |
2307 | + |
2308 | +############################################################################# |
2309 | +# Function : ParseStructDeclaration |
2310 | +# Description : This function takes a structure declaration and |
2311 | +# breaks it into individual type declarations. |
2312 | +# Arguments : $declaration - the declaration to parse |
2313 | +# $is_object - true if this is an object structure |
2314 | +# $output_function_params - true if full type is wanted for |
2315 | +# function pointer members |
2316 | +# $typefunc - function reference to apply to type |
2317 | +# $namefunc - function reference to apply to name |
2318 | +############################################################################# |
2319 | + |
2320 | +sub ParseStructDeclaration { |
2321 | + my ($declaration, $is_object, $output_function_params, $typefunc, $namefunc) = @_; |
2322 | + |
2323 | + # For forward struct declarations just return an empty array. |
2324 | + if ($declaration =~ m/(?:struct|union)\s+\S+\s*;/msg) { |
2325 | + return (); |
2326 | + } |
2327 | + |
2328 | + # Remove all private parts of the declaration |
2329 | + |
2330 | + # For objects, assume private |
2331 | + if ($is_object) { |
2332 | + $declaration =~ s!((?:struct|union)\s+\w*\s*\{) |
2333 | + .*? |
2334 | + (?:/\*\s*<\s*public\s*>\s*\*/|(?=\}))!$1!msgx; |
2335 | + } |
2336 | + |
2337 | + # Remove private symbols |
2338 | + # Assume end of declaration if line begins with '}' |
2339 | + $declaration =~ s!\n?[ \t]*/\*\s*<\s*(private|protected)\s*>\s*\*/.*?(?:/\*\s*<\s*public\s*>\s*\*/|(?=^\}))!!msgx; |
2340 | + |
2341 | + # Remove all other comments |
2342 | + $declaration =~ s@\n\s*/\*([^*]+|\*(?!/))*\*/\s*\n@\n@msg; |
2343 | + $declaration =~ s@/\*([^*]+|\*(?!/))*\*/@ @g; |
2344 | + $declaration =~ s@\n\s*//.*?\n@\n@msg; |
2345 | + $declaration =~ s@//.*@@g; |
2346 | + |
2347 | + my @result = (); |
2348 | + |
2349 | + if ($declaration =~ /^\s*$/) { |
2350 | + return @result; |
2351 | + } |
2352 | + |
2353 | + # Prime match after "struct/union {" declaration |
2354 | + if (!scalar($declaration =~ m/(?:struct|union)\s+\w*\s*\{/msg)) { |
2355 | + die "Declaration '$declaration' does not begin with struct/union [NAME] {\n"; |
2356 | + } |
2357 | + |
2358 | + #LogTrace("public fields in struct/union: $declaration"); |
2359 | + |
2360 | + # Treat lines in sequence, allowing singly nested anonymous structs |
2361 | + # and unions. |
2362 | + while ($declaration =~ m/\s*([^{;]+(\{[^\}]*\}[^{;]+)?);/msg) { |
2363 | + my $line = $1; |
2364 | + |
2365 | + last if $line =~ /^\s*\}\s*\w*\s*$/; |
2366 | + |
2367 | + # FIXME: Just ignore nested structs and unions for now |
2368 | + next if $line =~ /{/; |
2369 | + |
2370 | + # ignore preprocessor directives |
2371 | + while ($line =~ /^#.*?\n\s*(.*)/msg) { |
2372 | + $line=$1; |
2373 | + } |
2374 | + |
2375 | + last if $line =~ /^\s*\}\s*\w*\s*$/; |
2376 | + |
2377 | + # Try to match structure members which are functions |
2378 | + if ($line =~ m/^ |
2379 | + (const\s+|G_CONST_RETURN\s+|unsigned\s+|signed\s+|long\s+|short\s+)*(struct\s+|enum\s+)? # mod1 |
2380 | + (\w+)\s* # type |
2381 | + (\**(?:\s*restrict)?)\s* # ptr1 |
2382 | + (const\s+)? # mod2 |
2383 | + (\**\s*) # ptr2 |
2384 | + (const\s+)? # mod3 |
2385 | + \(\s*\*\s*(\w+)\s*\)\s* # name |
2386 | + \(([^)]*)\)\s* # func_params |
2387 | + $/x) { |
2388 | + |
2389 | + my $mod1 = defined($1) ? $1 : ""; |
2390 | + if (defined($2)) { $mod1 .= $2; } |
2391 | + my $type = $3; |
2392 | + my $ptr1 = $4; |
2393 | + my $mod2 = defined($5) ? $5 : ""; |
2394 | + my $ptr2 = $6; |
2395 | + my $mod3 = defined($7) ? $7 : ""; |
2396 | + my $name = $8; |
2397 | + my $func_params = $9; |
2398 | + my $ptype = defined $typefunc ? $typefunc->($type, "<type>$type</type>") : $type; |
2399 | + my $pname = defined $namefunc ? $namefunc->($name) : $name; |
2400 | + |
2401 | + push @result, $name; |
2402 | + |
2403 | + if ($output_function_params) { |
2404 | + push @result, "$mod1$ptype$ptr1$mod2$ptr2$mod3 (*$pname) ($func_params)"; |
2405 | + } else { |
2406 | + push @result, "$pname ()"; |
2407 | + } |
2408 | + |
2409 | + |
2410 | + # Try to match normal struct fields of comma-separated variables/ |
2411 | + } elsif ($line =~ m/^ |
2412 | + ((?:const\s+|volatile\s+|unsigned\s+|signed\s+|short\s+|long\s+)?)(struct\s+|enum\s+)? # mod1 |
2413 | + (\w+)\s* # type |
2414 | + (\** \s* const\s+)? # mod2 |
2415 | + (.*) # variables |
2416 | + $/x) { |
2417 | + |
2418 | + my $mod1 = defined($1) ? $1 : ""; |
2419 | + if (defined($2)) { $mod1 .= $2; } |
2420 | + my $type = $3; |
2421 | + my $ptype = defined $typefunc ? $typefunc->($type, "<type>$type</type>") : $type; |
2422 | + my $mod2 = defined($4) ? " " . $4 : ""; |
2423 | + my $list = $5; |
2424 | + |
2425 | + #LogTrace("'$mod1' '$type' '$mod2' '$list'"); |
2426 | + |
2427 | + $mod1 =~ s/ / /g; |
2428 | + $mod2 =~ s/ / /g; |
2429 | + |
2430 | + my @names = split /,/, $list; |
2431 | + for my $n (@names) { |
2432 | + # Each variable can have any number of '*' before the |
2433 | + # identifier, and be followed by any number of pairs of |
2434 | + # brackets or a bit field specifier. |
2435 | + # e.g. *foo, ***bar, *baz[12][23], foo : 25. |
2436 | + if ($n =~ m/^\s* (\**(?:\s*restrict\b)?) \s* (\w+) \s* (?: ((?:\[[^\]]*\]\s*)+) | (:\s*\d+)?) \s* $/x) { |
2437 | + my $ptrs = $1; |
2438 | + my $name = $2; |
2439 | + my $array = defined($3) ? $3 : ""; |
2440 | + my $bits = defined($4) ? " $4" : ""; |
2441 | + |
2442 | + if ($ptrs && $ptrs !~ m/\*$/) { $ptrs .= " "; } |
2443 | + $array =~ s/ / /g; |
2444 | + $bits =~ s/ / /g; |
2445 | + |
2446 | + push @result, $name; |
2447 | + if (defined $namefunc) { |
2448 | + $name = $namefunc->($name); |
2449 | + } |
2450 | + push @result, "$mod1$ptype$mod2 $ptrs$name$array$bits;"; |
2451 | + |
2452 | + #LogTrace("Matched line: $mod1$ptype$mod2 $ptrs$name$array$bits"); |
2453 | + } else { |
2454 | + print "WARNING: Couldn't parse struct field: $n\n"; |
2455 | + } |
2456 | + } |
2457 | + |
2458 | + } else { |
2459 | + print "WARNING: Cannot parse structure field: \"$line\"\n"; |
2460 | + } |
2461 | + } |
2462 | + |
2463 | + return @result; |
2464 | +} |
2465 | + |
2466 | + |
2467 | +############################################################################# |
2468 | +# Function : ParseEnumDeclaration |
2469 | +# Description : This function takes a enumeration declaration and |
2470 | +# breaks it into individual enum member declarations. |
2471 | +# Arguments : $declaration - the declaration to parse |
2472 | +############################################################################# |
2473 | + |
2474 | +sub ParseEnumDeclaration { |
2475 | + my ($declaration, $is_object) = @_; |
2476 | + |
2477 | + # For forward enum declarations just return an empty array. |
2478 | + if ($declaration =~ m/enum\s+\S+\s*;/msg) { |
2479 | + return (); |
2480 | + } |
2481 | + |
2482 | + # Remove private symbols |
2483 | + # Assume end of declaration if line begins with '}' |
2484 | + $declaration =~ s!\n?[ \t]*/\*\s*<\s*(private|protected)\s*>\s*\*/.*?(?:/\*\s*<\s*public\s*>\s*\*/|(?=^\}))!!msgx; |
2485 | + |
2486 | + # Remove all other comments |
2487 | + $declaration =~ s@\n\s*/\*([^*]+|\*(?!/))*\*/\s*\n@\n@msg; |
2488 | + $declaration =~ s@/\*([^*]+|\*(?!/))*\*/@ @g; |
2489 | + $declaration =~ s@\n\s*//.*?\n@\n@msg; |
2490 | + $declaration =~ s@//.*@@g; |
2491 | + |
2492 | + my @result = (); |
2493 | + |
2494 | + if ($declaration =~ /^\s*$/) { |
2495 | + return @result; |
2496 | + } |
2497 | + |
2498 | + # Remove parenthesized expressions (in macros like GTK_BLAH = BLAH(1,3)) |
2499 | + # to avoid getting confused by commas they might contain. This |
2500 | + # doesn't handle nested parentheses correctly. |
2501 | + |
2502 | + $declaration =~ s/\([^)\n]+\)//g; |
2503 | + |
2504 | + # Remove comma from comma - possible whitespace - closing brace sequence |
2505 | + # since it is legal in GNU C and C99 to have a trailing comma but doesn't |
2506 | + # result in an actual enum member |
2507 | + |
2508 | + $declaration =~ s/,(\s*})/$1/g; |
2509 | + |
2510 | + # Prime match after "typedef enum {" declaration |
2511 | + if (!scalar($declaration =~ m/(typedef\s+)?enum\s*(\S+\s*)?\{/msg)) { |
2512 | + die "Enum declaration '$declaration' does not begin with 'typedef enum {' or 'enum XXX {'\n"; |
2513 | + } |
2514 | + |
2515 | + #LogTrace("public fields in enum: $declaration"); |
2516 | + |
2517 | + # Treat lines in sequence. |
2518 | + while ($declaration =~ m/\s*([^,\}]+)([,\}])/msg) { |
2519 | + my $line = $1; |
2520 | + my $terminator = $2; |
2521 | + |
2522 | + # ignore preprocessor directives |
2523 | + while ($line =~ /^#.*?\n\s*(.*)/msg) { |
2524 | + $line=$1; |
2525 | + } |
2526 | + |
2527 | + if ($line =~ m/^(\w+)\s*(=.*)?$/msg) { |
2528 | + push @result, $1; |
2529 | + |
2530 | + # Special case for GIOCondition, where the values are specified by |
2531 | + # macros which expand to include the equal sign like '=1'. |
2532 | + } elsif ($line =~ m/^(\w+)\s*GLIB_SYSDEF_POLL/msg) { |
2533 | + push @result, $1; |
2534 | + |
2535 | + # Special case include of <gdk/gdkcursors.h>, just ignore it |
2536 | + } elsif ($line =~ m/^#include/) { |
2537 | + last; |
2538 | + |
2539 | + # Special case for #ifdef/#else/#endif, just ignore it |
2540 | + } elsif ($line =~ m/^#(?:if|else|endif)/) { |
2541 | + last; |
2542 | + |
2543 | + } else { |
2544 | + warn "Cannot parse enumeration member \"$line\""; |
2545 | + } |
2546 | + |
2547 | + last if $terminator eq '}'; |
2548 | + } |
2549 | + |
2550 | + return @result; |
2551 | +} |
2552 | + |
2553 | + |
2554 | +############################################################################# |
2555 | +# Function : ParseFunctionDeclaration |
2556 | +# Description : This function takes a function declaration and |
2557 | +# breaks it into individual parameter declarations. |
2558 | +# Arguments : $declaration - the declaration to parse |
2559 | +# $typefunc - function reference to apply to type |
2560 | +# $namefunc - function reference to apply to name |
2561 | +############################################################################# |
2562 | + |
2563 | +sub ParseFunctionDeclaration { |
2564 | + my ($declaration, $typefunc, $namefunc) = @_; |
2565 | + |
2566 | + my @result = (); |
2567 | + |
2568 | + my ($param_num) = 0; |
2569 | + while ($declaration ne "") { |
2570 | + #LogTrace("[$declaration]"); |
2571 | + |
2572 | + if ($declaration =~ s/^[\s,]+//) { |
2573 | + # skip whitespace and commas |
2574 | + next; |
2575 | + |
2576 | + } elsif ($declaration =~ s/^void\s*[,\n]//) { |
2577 | + if ($param_num != 0) { |
2578 | + # FIXME: whats the problem here? |
2579 | + warn "void used as parameter in function $declaration"; |
2580 | + } |
2581 | + push @result, "void"; |
2582 | + my $xref = "<type>void</type>"; |
2583 | + my $label = defined $namefunc ? $namefunc->($xref) : $xref; |
2584 | + push @result, $label; |
2585 | + |
2586 | + } elsif ($declaration =~ s/^\s*[_a-zA-Z0-9]*\.\.\.\s*[,\n]//) { |
2587 | + push @result, "..."; |
2588 | + my $label = defined $namefunc ? $namefunc->("...") : "..."; |
2589 | + push @result, $label; |
2590 | + |
2591 | + # allow alphanumerics, '_', '[' & ']' in param names |
2592 | + # Try to match a standard parameter |
2593 | + # $1 $2 $3 $4 $5 |
2594 | + } 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]//) { |
2595 | + my $pre = defined($1) ? $1 : ""; |
2596 | + my $type = $2; |
2597 | + my $ptr = defined($3) ? $3 : ""; |
2598 | + my $name = defined($4) ? $4 : ""; |
2599 | + my $array = defined($5) ? $5 : ""; |
2600 | + |
2601 | + $pre =~ s/\s+/ /g; |
2602 | + $type =~ s/\s+/ /g; |
2603 | + $ptr =~ s/\s+/ /g; |
2604 | + $ptr =~ s/\s+$//; |
2605 | + if ($ptr && $ptr !~ m/\*$/) { $ptr .= " "; } |
2606 | + |
2607 | + #LogTrace("$symbol: '$pre' '$type' '$ptr' '$name' '$array'"); |
2608 | + |
2609 | + if (($name eq "") && $pre =~ m/^((un)?signed .*)\s?/ ) { |
2610 | + $name = $type; |
2611 | + $type = "$1"; |
2612 | + $pre = ""; |
2613 | + } |
2614 | + |
2615 | + if ($name eq "") { |
2616 | + $name = "Param" . ($param_num + 1); |
2617 | + } |
2618 | + |
2619 | + #LogTrace("$symbol: '$pre' '$type' '$ptr' '$name' '$array'"); |
2620 | + |
2621 | + push @result, $name; |
2622 | + my $xref = defined $typefunc ? $typefunc->($type, "<type>$type</type>") : $type; |
2623 | + my $label = "$pre$xref $ptr$name$array"; |
2624 | + if (defined $namefunc) { |
2625 | + $label = $namefunc->($label) |
2626 | + } |
2627 | + push @result, $label; |
2628 | + |
2629 | + # Try to match parameters which are functions |
2630 | + # $1 $2 $3 $4 $5 $6 $7 $8 |
2631 | + } 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]//) { |
2632 | + my $mod1 = defined($1) ? $1 : ""; |
2633 | + if (defined($2)) { $mod1 .= $2; } |
2634 | + my $type = $3; |
2635 | + my $ptr1 = $4; |
2636 | + my $mod2 = defined($5) ? $5 : ""; |
2637 | + my $func_ptr = $6; |
2638 | + my $name = $7; |
2639 | + my $func_params = defined($8) ? $8 : ""; |
2640 | + |
2641 | + #if (!defined($type)) { print "## no type\n"; }; |
2642 | + #if (!defined($ptr1)) { print "## no ptr1\n"; }; |
2643 | + #if (!defined($func_ptr)) { print "## no func_ptr\n"; }; |
2644 | + #if (!defined($name)) { print "## no name\n"; }; |
2645 | + |
2646 | + if ($ptr1 && $ptr1 !~ m/\*$/) { $ptr1 .= " "; } |
2647 | + $func_ptr =~ s/\s+//g; |
2648 | + |
2649 | + push @result, $name; |
2650 | + my $xref = defined $typefunc ? $typefunc->($type, "<type>$type</type>") : $type; |
2651 | + #LogTrace("Type: [$mod1][$xref][$ptr1][$mod2] ([$func_ptr][$name]) ($func_params)"); |
2652 | + my $label = "$mod1$xref$ptr1$mod2 ($func_ptr$name) ($func_params)"; |
2653 | + if (defined $namefunc) { |
2654 | + $label = $namefunc->($label) |
2655 | + } |
2656 | + push @result, $label; |
2657 | + } else { |
2658 | + warn "Can't parse args for function in \"$declaration\""; |
2659 | + last; |
2660 | + } |
2661 | + $param_num++; |
2662 | + } |
2663 | + |
2664 | + return @result; |
2665 | +} |
2666 | + |
2667 | + |
2668 | +############################################################################# |
2669 | +# Function : ParseMacroDeclaration |
2670 | +# Description : This function takes a macro declaration and |
2671 | +# breaks it into individual parameter declarations. |
2672 | +# Arguments : $declaration - the declaration to parse |
2673 | +# $namefunc - function reference to apply to name |
2674 | +############################################################################# |
2675 | + |
2676 | +sub ParseMacroDeclaration { |
2677 | + my ($declaration, $namefunc) = @_; |
2678 | + |
2679 | + my @result = (); |
2680 | + |
2681 | + if ($declaration =~ m/^\s*#\s*define\s+\w+\(([^\)]*)\)/) { |
2682 | + my $params = $1; |
2683 | + |
2684 | + $params =~ s/\\\n//g; |
2685 | + foreach $param (split (/,/, $params)) { |
2686 | + $param =~ s/^\s+//; |
2687 | + $param =~ s/\s*$//; |
2688 | + # Allow varargs variations |
2689 | + if ($param =~ m/^.*\.\.\.$/) { |
2690 | + $param = "..."; |
2691 | + } |
2692 | + if ($param =~ m/\S/) { |
2693 | + push @result, $param; |
2694 | + push @result, defined $namefunc ? $namefunc->($param) : $param; |
2695 | + } |
2696 | + } |
2697 | + } |
2698 | + |
2699 | + return @result; |
2700 | +} |
2701 | + |
2702 | + |
2703 | +############################################################################# |
2704 | +# Function : LogWarning |
2705 | +# Description : Log a warning in gcc style format |
2706 | +# Arguments : $file - the file the error comes from |
2707 | +# $line - line number for the wrong entry |
2708 | +# $message - description of the issue |
2709 | +############################################################################# |
2710 | + |
2711 | +sub LogWarning { |
2712 | + my ($file, $line, $message) = @_; |
2713 | + |
2714 | + $file="unknown" if !defined($file); |
2715 | + $line="0" if !defined($line); |
2716 | + |
2717 | + print "$file:$line: warning: $message\n" |
2718 | +} |
2719 | + |
2720 | +sub LogTrace { |
2721 | + my ($message) = @_; |
2722 | + |
2723 | + if (defined($ENV{"GTKDOC_TRACE"})) { |
2724 | + my (undef, $file, $line) = caller; |
2725 | + |
2726 | + chomp($message); |
2727 | + print "$file:$line: trace: $message\n" |
2728 | + } |
2729 | +} |
2730 | + |
2731 | + |
2732 | +############################################################################# |
2733 | +# Function : CreateValidSGMLID |
2734 | +# Description : Creates a valid SGML 'id' from the given string. |
2735 | +# According to http://www.w3.org/TR/html4/types.html#type-id |
2736 | +# "ID and NAME tokens must begin with a letter ([A-Za-z]) and |
2737 | +# may be followed by any number of letters, digits ([0-9]), |
2738 | +# hyphens ("-"), underscores ("_"), colons (":"), and |
2739 | +# periods (".")." |
2740 | +# |
2741 | +# NOTE: When creating SGML IDS, we append ":CAPS" to all |
2742 | +# all-caps identifiers to prevent name clashes (SGML ids are |
2743 | +# case-insensitive). (It basically never is the case that |
2744 | +# mixed-case identifiers would collide.) |
2745 | +# Arguments : $id - the string to be converted into a valid SGML id. |
2746 | +############################################################################# |
2747 | + |
2748 | +sub CreateValidSGMLID { |
2749 | + my ($id) = $_[0]; |
2750 | + |
2751 | + # Special case, '_' would end up as '' so we use 'gettext-macro' instead. |
2752 | + if ($id eq "_") { return "gettext-macro"; } |
2753 | + |
2754 | + $id =~ s/[_ ]/-/g; |
2755 | + $id =~ s/[,;]//g; |
2756 | + $id =~ s/^-*//; |
2757 | + $id =~ s/::/-/g; |
2758 | + $id =~ s/:/--/g; |
2759 | + |
2760 | + # Append ":CAPS" to all all-caps identifiers |
2761 | + # FIXME: there are some inconsistencies here, we have sgml.index files |
2762 | + # containing e.g. TRUE--CAPS |
2763 | + if ($id !~ /[a-z]/ && $id !~ /-CAPS$/) { $id .= ":CAPS" }; |
2764 | + |
2765 | + return $id; |
2766 | +} |
2767 | + |
2768 | |
2769 | === modified file 'gtkdoc-fixxref.in' |
2770 | --- gtkdoc-fixxref.in 2013-12-19 07:58:53 +0000 |
2771 | +++ gtkdoc-fixxref.in 2014-02-17 20:15:47 +0000 |
2772 | @@ -472,7 +472,7 @@ |
2773 | close (NEWFILE); |
2774 | |
2775 | # format source |
2776 | - 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"; |
2777 | + 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"; |
2778 | |
2779 | my $highlighted_source; |
2780 | { |
2781 | @@ -481,7 +481,7 @@ |
2782 | $highlighted_source = <NEWFILE>; |
2783 | close (NEWFILE); |
2784 | } |
2785 | - $highlighted_source =~ s#.*<pre>\n##s; |
2786 | + $highlighted_source =~ s#.*<pre\b[^>]*>\n##s; |
2787 | $highlighted_source =~ s#</pre>.*##s; |
2788 | |
2789 | # need to rewrite the stylesheet classes |
2790 | |
2791 | === modified file 'gtkdoc-mkdb.in' |
2792 | --- gtkdoc-mkdb.in 2013-12-19 07:58:53 +0000 |
2793 | +++ gtkdoc-mkdb.in 2014-02-17 20:15:47 +0000 |
2794 | @@ -25,6 +25,7 @@ |
2795 | # Description : This creates the DocBook files from the edited templates. |
2796 | ############################################################################# |
2797 | |
2798 | +use warnings; |
2799 | use strict; |
2800 | use Getopt::Long; |
2801 | |
2802 | @@ -304,29 +305,73 @@ |
2803 | my %AnnotationDefinition = ( |
2804 | 'allow-none' => "NULL is ok, both for passing and for returning.", |
2805 | 'array' => "Parameter points to an array of items.", |
2806 | - 'attribute' => "Free-form custom annotation.", |
2807 | + 'attribute' => "Deprecated free-form custom annotation, replaced by (attributes) annotation.", |
2808 | + 'attributes' => "Free-form key-value pairs.", |
2809 | 'closure' => "This parameter is a 'user_data', for callbacks; many bindings can pass NULL here.", |
2810 | + 'constructor' => "This symbol is a constructor, not a static method.", |
2811 | + 'destroy' => "This parameter is a 'destroy_data', for callbacks.", |
2812 | 'default' => "Default parameter value (for in case the <acronym>shadows</acronym>-to function has less parameters).", |
2813 | 'element-type' => "Generics and defining elements of containers and arrays.", |
2814 | 'error-domains' => "Typed errors. Similar to throws in Java.", |
2815 | + 'foreign' => "This is a foreign struct.", |
2816 | + 'get-value-func' => "The specified function is used to convert a struct from a GValue, must be a GTypeInstance.", |
2817 | 'in' => "Parameter for input. Default is <acronym>transfer none</acronym>.", |
2818 | 'inout' => "Parameter for input and for returning results. Default is <acronym>transfer full</acronym>.", |
2819 | 'in-out' => "Parameter for input and for returning results. Default is <acronym>transfer full</acronym>.", |
2820 | + 'method' => "This is a method", |
2821 | 'not-error' => "A GError parameter is not to be handled like a normal GError.", |
2822 | 'out' => "Parameter for returning results. Default is <acronym>transfer full</acronym>.", |
2823 | 'out caller-allocates' => "Out parameter, where caller must allocate storage.", |
2824 | 'out callee-allocates' => "Out parameter, where caller must allocate storage.", |
2825 | + 'ref-func' => "The specified function is used to ref a struct, must be a GTypeInstance.", |
2826 | + 'rename-to' => "Rename the original symbol's name to SYMBOL.", |
2827 | + 'scope call' => "The callback is valid only during the call to the method.", |
2828 | + 'scope async' => "The callback is valid until first called.", |
2829 | + 'scope notified' => "The callback is valid until the GDestroyNotify argument is called.", |
2830 | + 'set-value-func' => "The specified function is used to convert from a struct to a GValue, must be a GTypeInstance.", |
2831 | + 'skip' => "Exposed in C code, not necessarily available in other languages.", |
2832 | 'transfer container' => "Free data container after the code is done.", |
2833 | 'transfer floating' => "Alias for <acronym>transfer none</acronym>, used for objects with floating refs.", |
2834 | 'transfer full' => "Free data after the code is done.", |
2835 | 'transfer none' => "Don't free data after the code is done.", |
2836 | - 'scope call' => "The callback is valid only during the call to the method.", |
2837 | - 'scope async' => "The callback is valid until first called.", |
2838 | - 'scope notified' => "The callback is valid until the GDestroyNotify argument is called.", |
2839 | - 'skip' => "Exposed in C code, not necessarily available in other languages.", |
2840 | - 'type' => "Override the parsed C type with given type." |
2841 | + 'type' => "Override the parsed C type with given type.", |
2842 | + 'unref-func' => "The specified function is used to unref a struct, must be a GTypeInstance.", |
2843 | + 'virtual' => "This is the invoker for a virtual method.", |
2844 | + 'value' => "The specified value overrides the evaluated value of the constant." |
2845 | ); |
2846 | |
2847 | +# Elements to consider non-block items in MarkDown parsing |
2848 | +my %MD_TEXT_LEVEL_ELEMENTS = ( "literal" => 1, |
2849 | + "emphasis" => 1, |
2850 | + "envar" => 1, |
2851 | + "filename" => 1, |
2852 | + "firstterm" => 1, |
2853 | + "function" => 1, |
2854 | + "manvolnum" => 1, |
2855 | + "option" => 1, |
2856 | + "replaceable" => 1, |
2857 | + "structname" => 1, |
2858 | + "title" => 1, |
2859 | + "varname" => 1 ); |
2860 | +my %MD_ESCAPABLE_CHARS = ( "\\" => 1, |
2861 | + "`" => 1, |
2862 | + "*" => 1, |
2863 | + "_" => 1, |
2864 | + "{" => 1, |
2865 | + "}" => 1, |
2866 | + "[" => 1, |
2867 | + "]" => 1, |
2868 | + "(" => 1, |
2869 | + ")" => 1, |
2870 | + ">" => 1, |
2871 | + "#" => 1, |
2872 | + "+" => 1, |
2873 | + "-" => 1, |
2874 | + "." => 1, |
2875 | + "!" => 1 ); |
2876 | +my %MD_GTK_ESCAPABLE_CHARS = ( "@" => 1, |
2877 | + "%" => 1 ); |
2878 | + |
2879 | # Create the root DocBook output directory if it doens't exist. |
2880 | if (! -e $SGML_OUTPUT_DIR) { |
2881 | mkdir ("$SGML_OUTPUT_DIR", 0777) |
2882 | @@ -336,6 +381,7 @@ |
2883 | # Function and other declaration output settings. |
2884 | my $RETURN_TYPE_FIELD_WIDTH = 20; |
2885 | my $SYMBOL_FIELD_WIDTH = 36; |
2886 | +my $MAX_SYMBOL_FIELD_WIDTH = 40; |
2887 | my $SIGNAL_FIELD_WIDTH = 16; |
2888 | my $PARAM_FIELD_COUNT = 2; |
2889 | |
2890 | @@ -530,10 +576,12 @@ |
2891 | my $title = ""; |
2892 | my $section_id = ""; |
2893 | my $subsection = ""; |
2894 | - my $synopsis; |
2895 | - my $details; |
2896 | my $num_symbols; |
2897 | my $changed = 0; |
2898 | + my $functions_synop = ""; |
2899 | + my $other_synop = ""; |
2900 | + my $functions_details = ""; |
2901 | + my $other_details = ""; |
2902 | my $signals_synop = ""; |
2903 | my $signals_desc = ""; |
2904 | my $args_synop = ""; |
2905 | @@ -542,7 +590,8 @@ |
2906 | my $args_desc = ""; |
2907 | my $child_args_desc = ""; |
2908 | my $style_args_desc = ""; |
2909 | - my $hierarchy = ""; |
2910 | + my $hierarchy_str = ""; |
2911 | + my @hierarchy = (); |
2912 | my $interfaces = ""; |
2913 | my $implementations = ""; |
2914 | my $prerequisites = ""; |
2915 | @@ -559,15 +608,14 @@ |
2916 | next; |
2917 | |
2918 | } elsif (m/^<SECTION>/) { |
2919 | - $synopsis = ""; |
2920 | - $details = ""; |
2921 | $num_symbols = 0; |
2922 | $in_section = 1; |
2923 | @file_objects = (); |
2924 | %symbol_def_line = (); |
2925 | |
2926 | } elsif (m/^<SUBSECTION\s*(.*)>/i) { |
2927 | - $synopsis .= "\n"; |
2928 | + $other_synop .= "\n"; |
2929 | + $functions_synop .= "\n"; |
2930 | $subsection = $1; |
2931 | |
2932 | } elsif (m/^<SUBSECTION>/) { |
2933 | @@ -638,8 +686,16 @@ |
2934 | $signals_synop = <<EOF; |
2935 | <refsect1 id="$section_id.signals" role="signal_proto"> |
2936 | <title role="signal_proto.title">Signals</title> |
2937 | -<synopsis> |
2938 | -${signals_synop}</synopsis> |
2939 | +<informaltable frame="none"> |
2940 | +<tgroup cols="3"> |
2941 | +<colspec colname="signals_return" colwidth="150px"/> |
2942 | +<colspec colname="signals_name" colwidth="300px"/> |
2943 | +<colspec colname="signals_flags" colwidth="200px"/> |
2944 | +<tbody> |
2945 | +${signals_synop} |
2946 | +</tbody> |
2947 | +</tgroup> |
2948 | +</informaltable> |
2949 | </refsect1> |
2950 | EOF |
2951 | $signals_desc = TrimTextBlock($signals_desc); |
2952 | @@ -651,14 +707,22 @@ |
2953 | EOF |
2954 | } |
2955 | |
2956 | - $args_synop =~ s/^\n*//g; |
2957 | - $args_synop =~ s/\n+$/\n/g; |
2958 | + $args_synop =~ s/^\n*//g; |
2959 | + $args_synop =~ s/\n+$/\n/g; |
2960 | if ($args_synop ne '') { |
2961 | $args_synop = <<EOF; |
2962 | <refsect1 id="$section_id.properties" role="properties"> |
2963 | <title role="properties.title">Properties</title> |
2964 | -<synopsis> |
2965 | -${args_synop}</synopsis> |
2966 | +<informaltable frame="none"> |
2967 | +<tgroup cols="3"> |
2968 | +<colspec colname="properties_type" colwidth="150px"/> |
2969 | +<colspec colname="properties_name" colwidth="300px"/> |
2970 | +<colspec colname="properties_flags" colwidth="200px"/> |
2971 | +<tbody> |
2972 | +${args_synop} |
2973 | +</tbody> |
2974 | +</tgroup> |
2975 | +</informaltable> |
2976 | </refsect1> |
2977 | EOF |
2978 | $args_desc = TrimTextBlock($args_desc); |
2979 | @@ -670,14 +734,22 @@ |
2980 | EOF |
2981 | } |
2982 | |
2983 | - $child_args_synop =~ s/^\n*//g; |
2984 | - $child_args_synop =~ s/\n+$/\n/g; |
2985 | + $child_args_synop =~ s/^\n*//g; |
2986 | + $child_args_synop =~ s/\n+$/\n/g; |
2987 | if ($child_args_synop ne '') { |
2988 | $args_synop .= <<EOF; |
2989 | <refsect1 id="$section_id.child-properties" role="child_properties"> |
2990 | <title role="child_properties.title">Child Properties</title> |
2991 | -<synopsis> |
2992 | -${child_args_synop}</synopsis> |
2993 | +<informaltable frame="none"> |
2994 | +<tgroup cols="3"> |
2995 | +<colspec colname="child_properties_type" colwidth="150px"/> |
2996 | +<colspec colname="child_properties_name" colwidth="300px"/> |
2997 | +<colspec colname="child_properties_flags" colwidth="200px"/> |
2998 | +<tbody> |
2999 | +${child_args_synop} |
3000 | +</tbody> |
3001 | +</tgroup> |
3002 | +</informaltable> |
3003 | </refsect1> |
3004 | EOF |
3005 | $child_args_desc = TrimTextBlock($child_args_desc); |
3006 | @@ -689,14 +761,22 @@ |
3007 | EOF |
3008 | } |
3009 | |
3010 | - $style_args_synop =~ s/^\n*//g; |
3011 | - $style_args_synop =~ s/\n+$/\n/g; |
3012 | + $style_args_synop =~ s/^\n*//g; |
3013 | + $style_args_synop =~ s/\n+$/\n/g; |
3014 | if ($style_args_synop ne '') { |
3015 | $args_synop .= <<EOF; |
3016 | <refsect1 id="$section_id.style-properties" role="style_properties"> |
3017 | <title role="style_properties.title">Style Properties</title> |
3018 | -<synopsis> |
3019 | -${style_args_synop}</synopsis> |
3020 | +<informaltable frame="none"> |
3021 | +<tgroup cols="3"> |
3022 | +<colspec colname="style_properties_type" colwidth="150px"/> |
3023 | +<colspec colname="style_properties_name" colwidth="300px"/> |
3024 | +<colspec colname="style_properties_flags" colwidth="200px"/> |
3025 | +<tbody> |
3026 | +${style_args_synop} |
3027 | +</tbody> |
3028 | +</tgroup> |
3029 | +</informaltable> |
3030 | </refsect1> |
3031 | EOF |
3032 | $style_args_desc = TrimTextBlock($style_args_desc); |
3033 | @@ -708,12 +788,12 @@ |
3034 | EOF |
3035 | } |
3036 | |
3037 | - $hierarchy = TrimTextBlock($hierarchy); |
3038 | - if ($hierarchy ne "") { |
3039 | - $hierarchy = <<EOF; |
3040 | + $hierarchy_str = &AddTreeLineArt(\@hierarchy) . "\n"; |
3041 | + if ($hierarchy_str ne "") { |
3042 | + $hierarchy_str = <<EOF; |
3043 | <refsect1 id="$section_id.object-hierarchy" role="object_hierarchy"> |
3044 | <title role="object_hierarchy.title">Object Hierarchy</title> |
3045 | -$hierarchy |
3046 | +<screen>$hierarchy_str</screen> |
3047 | </refsect1> |
3048 | EOF |
3049 | } |
3050 | @@ -758,14 +838,51 @@ |
3051 | EOF |
3052 | } |
3053 | |
3054 | - $synopsis =~ s/^\n*//g; |
3055 | - $synopsis =~ s/\n+$/\n/g; |
3056 | + $functions_synop =~ s/^\n*//g; |
3057 | + $functions_synop =~ s/\n+$/\n/g; |
3058 | + if ($functions_synop ne '') { |
3059 | + $functions_synop = <<EOF; |
3060 | +<refsect1 id="$section_id.functions" role="functions_proto"> |
3061 | +<title role="functions_proto.title">Functions</title> |
3062 | +<informaltable pgwide="1" frame="none"> |
3063 | +<tgroup cols="2"> |
3064 | +<colspec colname="functions_return" colwidth="150px"/> |
3065 | +<colspec colname="functions_name"/> |
3066 | +<tbody> |
3067 | +${functions_synop} |
3068 | +</tbody> |
3069 | +</tgroup> |
3070 | +</informaltable> |
3071 | +</refsect1> |
3072 | +EOF |
3073 | + } |
3074 | + |
3075 | + $other_synop =~ s/^\n*//g; |
3076 | + $other_synop =~ s/\n+$/\n/g; |
3077 | + if ($other_synop ne '') { |
3078 | + $other_synop = <<EOF; |
3079 | +<refsect1 id="$section_id.other" role="other_proto"> |
3080 | +<title role="other_proto.title">Types and Values</title> |
3081 | +<informaltable role="enum_members_table" pgwide="1" frame="none"> |
3082 | +<tgroup cols="2"> |
3083 | +<colspec colname="name" colwidth="150px"/> |
3084 | +<colspec colname="description"/> |
3085 | +<tbody> |
3086 | +${other_synop} |
3087 | +</tbody> |
3088 | +</tgroup> |
3089 | +</informaltable> |
3090 | +</refsect1> |
3091 | +EOF |
3092 | + } |
3093 | + |
3094 | my $file_changed = &OutputSGMLFile ($filename, $title, $section_id, |
3095 | $section_includes, |
3096 | - \$synopsis, \$details, |
3097 | + \$functions_synop, \$other_synop, |
3098 | + \$functions_details, \$other_details, |
3099 | \$signals_synop, \$signals_desc, |
3100 | \$args_synop, \$args_desc, |
3101 | - \$hierarchy, \$interfaces, |
3102 | + \$hierarchy_str, \$interfaces, |
3103 | \$implementations, |
3104 | \$prerequisites, \$derived, |
3105 | \@file_objects); |
3106 | @@ -778,6 +895,10 @@ |
3107 | $subsection = ""; |
3108 | $in_section = 0; |
3109 | $section_includes = ""; |
3110 | + $functions_synop = ""; |
3111 | + $other_synop = ""; |
3112 | + $functions_details = ""; |
3113 | + $other_details = ""; |
3114 | $signals_synop = ""; |
3115 | $signals_desc = ""; |
3116 | $args_synop = ""; |
3117 | @@ -786,52 +907,63 @@ |
3118 | $args_desc = ""; |
3119 | $child_args_desc = ""; |
3120 | $style_args_desc = ""; |
3121 | - $hierarchy = ""; |
3122 | - $interfaces = ""; |
3123 | - $implementations = ""; |
3124 | + $hierarchy_str = ""; |
3125 | + @hierarchy = (); |
3126 | + $interfaces = ""; |
3127 | + $implementations = ""; |
3128 | $prerequisites = ""; |
3129 | $derived = ""; |
3130 | |
3131 | } elsif (m/^(\S+)/) { |
3132 | my $symbol = $1; |
3133 | - #print " Symbol: $symbol\n"; |
3134 | + @TRACE@(" Symbol: $symbol in subsection: $subsection\n"); |
3135 | |
3136 | # check for duplicate entries |
3137 | if (! defined $symbol_def_line{$symbol}) { |
3138 | my $declaration = $Declarations{$symbol}; |
3139 | if (defined ($declaration)) { |
3140 | + if (&CheckIsObject ($symbol)) { |
3141 | + push @file_objects, $symbol; |
3142 | + } |
3143 | # We don't want standard macros/functions of GObjects, |
3144 | # or private declarations. |
3145 | if ($subsection ne "Standard" && $subsection ne "Private") { |
3146 | - if (&CheckIsObject ($symbol)) { |
3147 | - push @file_objects, $symbol; |
3148 | - } |
3149 | my ($synop, $desc) = &OutputDeclaration ($symbol, |
3150 | $declaration); |
3151 | - my ($sig_synop, $sig_desc) = &GetSignals ($symbol); |
3152 | - my ($arg_synop, $child_arg_synop, $style_arg_synop, |
3153 | - $arg_desc, $child_arg_desc, $style_arg_desc) = &GetArgs ($symbol); |
3154 | - my $hier = &GetHierarchy ($symbol); |
3155 | - my $ifaces = &GetInterfaces ($symbol); |
3156 | - my $impls = &GetImplementations ($symbol); |
3157 | - my $prereqs = &GetPrerequisites ($symbol); |
3158 | - my $der = &GetDerived ($symbol); |
3159 | - $synopsis .= $synop; |
3160 | - $details .= $desc; |
3161 | - $signals_synop .= $sig_synop; |
3162 | - $signals_desc .= $sig_desc; |
3163 | - $args_synop .= $arg_synop; |
3164 | - $child_args_synop .= $child_arg_synop; |
3165 | - $style_args_synop .= $style_arg_synop; |
3166 | - $args_desc .= $arg_desc; |
3167 | - $child_args_desc .= $child_arg_desc; |
3168 | - $style_args_desc .= $style_arg_desc; |
3169 | - $hierarchy .= $hier; |
3170 | - $interfaces .= $ifaces; |
3171 | - $implementations .= $impls; |
3172 | - $prerequisites .= $prereqs; |
3173 | - $derived .= $der; |
3174 | + my $type = $DeclarationTypes {$symbol}; |
3175 | + |
3176 | + if ($type eq 'FUNCTION' || $type eq 'USER_FUNCTION') { |
3177 | + $functions_synop .= $synop; |
3178 | + $functions_details .= $desc; |
3179 | + } elsif ($type eq 'MACRO' && $declaration =~ /$symbol[ ]*\(/) { |
3180 | + $functions_synop .= $synop; |
3181 | + $functions_details .= $desc; |
3182 | + } else { |
3183 | + $other_synop .= $synop; |
3184 | + $other_details .= $desc; |
3185 | + } |
3186 | } |
3187 | + my ($sig_synop, $sig_desc) = &GetSignals ($symbol); |
3188 | + my ($arg_synop, $child_arg_synop, $style_arg_synop, |
3189 | + $arg_desc, $child_arg_desc, $style_arg_desc) = &GetArgs ($symbol); |
3190 | + my $ifaces = &GetInterfaces ($symbol); |
3191 | + my $impls = &GetImplementations ($symbol); |
3192 | + my $prereqs = &GetPrerequisites ($symbol); |
3193 | + my $der = &GetDerived ($symbol); |
3194 | + @hierarchy = &GetHierarchy ($symbol, \@hierarchy); |
3195 | + |
3196 | + $signals_synop .= $sig_synop; |
3197 | + $signals_desc .= $sig_desc; |
3198 | + $args_synop .= $arg_synop; |
3199 | + $child_args_synop .= $child_arg_synop; |
3200 | + $style_args_synop .= $style_arg_synop; |
3201 | + $args_desc .= $arg_desc; |
3202 | + $child_args_desc .= $child_arg_desc; |
3203 | + $style_args_desc .= $style_arg_desc; |
3204 | + $interfaces .= $ifaces; |
3205 | + $implementations .= $impls; |
3206 | + $prerequisites .= $prereqs; |
3207 | + $derived .= $der; |
3208 | |
3209 | # Note that the declaration has been output. |
3210 | $DeclarationOutput{$symbol} = 1; |
3211 | @@ -1107,7 +1239,7 @@ |
3212 | <title>Annotation Glossary</title> |
3213 | EOF |
3214 | |
3215 | - foreach my $annotation (keys(%AnnotationsUsed)) { |
3216 | + foreach my $annotation (sort(keys(%AnnotationsUsed))) { |
3217 | if(defined($AnnotationDefinition{$annotation})) { |
3218 | my $def = $AnnotationDefinition{$annotation}; |
3219 | my $curletter = uc(substr($annotation,0,1)); |
3220 | @@ -1255,7 +1387,7 @@ |
3221 | } |
3222 | |
3223 | ############################################################################# |
3224 | -# Function : Outpu{Symbol,Section}ExtraLinks |
3225 | +# Function : Output{Symbol,Section}ExtraLinks |
3226 | # Description : Returns extralinks for the symbol (if enabled). |
3227 | # Arguments : $symbol - the name of the function/macro begin described. |
3228 | ############################################################################# |
3229 | @@ -1319,7 +1451,7 @@ |
3230 | my ($symbol, $declaration) = @_; |
3231 | my $id = &CreateValidSGMLID ($symbol); |
3232 | my $condition = &MakeConditionDescription ($symbol); |
3233 | - my $synop = &MakeReturnField("#define") . "<link linkend=\"$id\">$symbol</link>"; |
3234 | + my $synop = "<row><entry role=\"define_keyword\">#define</entry><entry role=\"function_name\"><link linkend=\"$id\">$symbol</link>"; |
3235 | my $desc; |
3236 | |
3237 | my @fields = ParseMacroDeclaration($declaration, \&CreateValidSGML); |
3238 | @@ -1331,25 +1463,9 @@ |
3239 | $desc .= OutputSymbolExtraLinks($symbol); |
3240 | |
3241 | if (@fields) { |
3242 | - if (length ($symbol) < $SYMBOL_FIELD_WIDTH) { |
3243 | - $synop .= (' ' x ($SYMBOL_FIELD_WIDTH - length ($symbol))); |
3244 | - } |
3245 | - |
3246 | - $synop .= "("; |
3247 | - for (my $i = 1; $i <= $#fields; $i += 2) { |
3248 | - my $field_name = $fields[$i]; |
3249 | - |
3250 | - if ($i == 1) { |
3251 | - $synop .= "$field_name"; |
3252 | - } else { |
3253 | - $synop .= ",\n" |
3254 | - . (' ' x ($SYMBOL_FIELD_WIDTH + $RETURN_TYPE_FIELD_WIDTH)) |
3255 | - . " $field_name"; |
3256 | - } |
3257 | - } |
3258 | - $synop .= ")"; |
3259 | + $synop .= "<phrase role=\"c_punctuation\">()</phrase>"; |
3260 | } |
3261 | - $synop .= "\n"; |
3262 | + $synop .= "</entry></row>\n"; |
3263 | |
3264 | # Don't output the macro definition if is is a conditional macro or it |
3265 | # looks like a function, i.e. starts with "g_" or "_?gnome_", or it is |
3266 | @@ -1358,9 +1474,9 @@ |
3267 | if (!defined ($DeclarationConditional{$symbol}) && ($symbol !~ m/^g_/) |
3268 | && ($symbol !~ m/^_?gnome_/) && (($declaration =~ tr/\n//) < 2)) { |
3269 | my $decl_out = &CreateValidSGML ($declaration); |
3270 | - $desc .= "<programlisting>$decl_out</programlisting>\n"; |
3271 | + $desc .= "<programlisting language=\"C\">$decl_out</programlisting>\n"; |
3272 | } else { |
3273 | - $desc .= "<programlisting>" . &MakeReturnField("#define") . "$symbol"; |
3274 | + $desc .= "<programlisting language=\"C\">" . &MakeReturnField("#define") . "$symbol"; |
3275 | if ($declaration =~ m/^\s*#\s*define\s+\w+(\([^\)]*\))/) { |
3276 | my $args = $1; |
3277 | my $pad = ' ' x ($RETURN_TYPE_FIELD_WIDTH - length ("#define ")); |
3278 | @@ -1377,7 +1493,7 @@ |
3279 | my $parameters_output = 0; |
3280 | |
3281 | if (defined ($SymbolDocs{$symbol})) { |
3282 | - my $symbol_docs = &ExpandAbbreviations($symbol, $SymbolDocs{$symbol}); |
3283 | + my $symbol_docs = &ConvertMarkDown($symbol, $SymbolDocs{$symbol}); |
3284 | |
3285 | # Try to insert the parameter table at the author's desired position. |
3286 | # Otherwise we need to tag it onto the end. |
3287 | @@ -1409,8 +1525,8 @@ |
3288 | my ($symbol, $declaration) = @_; |
3289 | my $id = &CreateValidSGMLID ($symbol); |
3290 | my $condition = &MakeConditionDescription ($symbol); |
3291 | - my $synop = &MakeReturnField("typedef") . "<link linkend=\"$id\">$symbol</link>;\n"; |
3292 | my $desc = "<refsect2 id=\"$id\" role=\"typedef\"$condition>\n<title>$symbol</title>\n"; |
3293 | + my $synop = "<row><entry role=\"typedef_keyword\">typedef</entry><entry role=\"function_name\"><link linkend=\"$id\">$symbol</link></entry></row>\n"; |
3294 | |
3295 | $desc .= MakeIndexterms($symbol, $id); |
3296 | $desc .= "\n"; |
3297 | @@ -1418,13 +1534,13 @@ |
3298 | |
3299 | if (!defined ($DeclarationConditional{$symbol})) { |
3300 | my $decl_out = &CreateValidSGML ($declaration); |
3301 | - $desc .= "<programlisting>$decl_out</programlisting>\n"; |
3302 | + $desc .= "<programlisting language=\"C\">$decl_out</programlisting>\n"; |
3303 | } |
3304 | |
3305 | $desc .= &MakeDeprecationNote($symbol); |
3306 | |
3307 | if (defined ($SymbolDocs{$symbol})) { |
3308 | - $desc .= &ExpandAbbreviations($symbol, $SymbolDocs{$symbol}); |
3309 | + $desc .= &ConvertMarkDown($symbol, $SymbolDocs{$symbol}); |
3310 | } |
3311 | $desc .= OutputSymbolTraits ($symbol); |
3312 | $desc .= "</refsect2>\n"; |
3313 | @@ -1470,16 +1586,17 @@ |
3314 | $has_typedef = 1; |
3315 | } |
3316 | |
3317 | - my $synop; |
3318 | + my $type_output; |
3319 | my $desc; |
3320 | if ($has_typedef) { |
3321 | # For structs with typedefs we just output the struct name. |
3322 | - $synop = &MakeReturnField("") . "<link linkend=\"$id\">$symbol</link>;\n"; |
3323 | + $type_output = ""; |
3324 | $desc = "<refsect2 id=\"$id\" role=\"struct\"$condition>\n<title>$symbol</title>\n"; |
3325 | } else { |
3326 | - $synop = &MakeReturnField("struct") . "<link linkend=\"$id\">$symbol</link>;\n"; |
3327 | + $type_output = "struct"; |
3328 | $desc = "<refsect2 id=\"$id\" role=\"struct\"$condition>\n<title>struct $symbol</title>\n"; |
3329 | } |
3330 | + my $synop = "<row><entry role=\"datatype_keyword\">${type_output}</entry><entry role=\"function_name\"><link linkend=\"$id\">$symbol</link></entry></row>\n"; |
3331 | |
3332 | $desc .= MakeIndexterms($symbol, $id); |
3333 | $desc .= "\n"; |
3334 | @@ -1544,12 +1661,12 @@ |
3335 | } |
3336 | |
3337 | $decl_out = &CreateValidSGML ($decl_out); |
3338 | - $desc .= "<programlisting>$decl_out</programlisting>\n"; |
3339 | + $desc .= "<programlisting language=\"C\">$decl_out</programlisting>\n"; |
3340 | |
3341 | $desc .= &MakeDeprecationNote($symbol); |
3342 | |
3343 | if (defined ($SymbolDocs{$symbol})) { |
3344 | - $desc .= &ExpandAbbreviations($symbol, $SymbolDocs{$symbol}); |
3345 | + $desc .= &ConvertMarkDown($symbol, $SymbolDocs{$symbol}); |
3346 | } |
3347 | |
3348 | # Create a table of fields and descriptions |
3349 | @@ -1582,22 +1699,31 @@ |
3350 | my $missing_parameters = ""; |
3351 | my $unused_parameters = ""; |
3352 | |
3353 | - $desc .= "<variablelist role=\"struct\">\n"; |
3354 | + $desc .= <<EOF; |
3355 | +<refsect3 role="struct_members">\n<title>Members</title> |
3356 | +<informaltable role="struct_members_table" pgwide="1" frame="none"> |
3357 | +<tgroup cols="3"> |
3358 | +<colspec colname="struct_members_name" colwidth="300px"/> |
3359 | +<colspec colname="struct_members_description"/> |
3360 | +<colspec colname="struct_members_annotations" colwidth="200px"/> |
3361 | +<tbody> |
3362 | +EOF |
3363 | + |
3364 | while (@fields) { |
3365 | my $field_name = shift @fields; |
3366 | my $text = shift @fields; |
3367 | my $field_descr = $field_descrs{$field_name}; |
3368 | my $param_annotations = ""; |
3369 | |
3370 | - $desc .= "<varlistentry><term>$text</term>\n"; |
3371 | + $desc .= "<row><entry role=\"struct_member_name\"><para>$text</para></entry>\n"; |
3372 | if (defined $field_descr) { |
3373 | ($field_descr,$param_annotations) = &ExpandAnnotation($symbol, $field_descr); |
3374 | - $field_descr = &ExpandAbbreviations($symbol, $field_descr); |
3375 | - $field_descr .= $param_annotations; |
3376 | + $field_descr = &ConvertMarkDown($symbol, $field_descr); |
3377 | # trim |
3378 | $field_descr =~ s/^(\s|\n)+//msg; |
3379 | $field_descr =~ s/(\s|\n)+$//msg; |
3380 | - $desc .= "<listitem><simpara>$field_descr</simpara></listitem>\n"; |
3381 | + $desc .= "<listitem>$field_descr</listitem>\n"; |
3382 | + $desc .= "<entry role=\"struct_member_description\">$field_descr</entry>\n<entry role=\"struct_member_annotations\">$param_annotations</entry>\n"; |
3383 | delete $field_descrs{$field_name}; |
3384 | } else { |
3385 | &LogWarning (&GetSymbolSourceFile ($symbol), &GetSymbolSourceLine($symbol), |
3386 | @@ -1607,11 +1733,11 @@ |
3387 | } else { |
3388 | $missing_parameters = $field_name; |
3389 | } |
3390 | - $desc .= "<listitem />\n"; |
3391 | + $desc .= "<entry /><entry />\n"; |
3392 | } |
3393 | - $desc .= "</varlistentry>\n"; |
3394 | + $desc .= "</row>\n"; |
3395 | } |
3396 | - $desc .= "</variablelist>"; |
3397 | + $desc .= "</tbody></tgroup></informaltable>\n</refsect3>\n"; |
3398 | foreach my $field_name (keys %field_descrs) { |
3399 | &LogWarning (&GetSymbolSourceFile ($symbol), &GetSymbolSourceLine($symbol), |
3400 | "Field description for $symbol"."::"."$field_name is not used from source code comment block."); |
3401 | @@ -1656,8 +1782,22 @@ |
3402 | |
3403 | sub OutputUnion { |
3404 | my ($symbol, $declaration) = @_; |
3405 | - my $id = &CreateValidSGMLID ($symbol); |
3406 | - my $condition = &MakeConditionDescription ($symbol); |
3407 | + |
3408 | + my $is_gtype = 0; |
3409 | + if (&CheckIsObject ($symbol)) { |
3410 | + @TRACE@("Found union gtype: $symbol\n"); |
3411 | + $is_gtype = 1; |
3412 | + } |
3413 | + |
3414 | + my $id; |
3415 | + my $condition; |
3416 | + if ($is_gtype) { |
3417 | + $id = &CreateValidSGMLID ($symbol . "_union"); |
3418 | + $condition = &MakeConditionDescription ($symbol . "_union"); |
3419 | + } else { |
3420 | + $id = &CreateValidSGMLID ($symbol); |
3421 | + $condition = &MakeConditionDescription ($symbol); |
3422 | + } |
3423 | |
3424 | # Determine if it is a simple struct or it also has a typedef. |
3425 | my $has_typedef = 0; |
3426 | @@ -1665,29 +1805,25 @@ |
3427 | $has_typedef = 1; |
3428 | } |
3429 | |
3430 | - my $synop; |
3431 | + my $type_output; |
3432 | my $desc; |
3433 | if ($has_typedef) { |
3434 | # For unions with typedefs we just output the union name. |
3435 | - $synop = &MakeReturnField("") . "<link linkend=\"$id\">$symbol</link>;\n"; |
3436 | + $type_output = ""; |
3437 | $desc = "<refsect2 id=\"$id\" role=\"union\"$condition>\n<title>$symbol</title>\n"; |
3438 | } else { |
3439 | - $synop = &MakeReturnField("union") . "<link linkend=\"$id\">$symbol</link>;\n"; |
3440 | + $type_output = "union"; |
3441 | $desc = "<refsect2 id=\"$id\" role=\"union\"$condition>\n<title>union $symbol</title>\n"; |
3442 | } |
3443 | + my $synop = "<row><entry role=\"datatype_keyword\">${type_output}</entry><entry role=\"function_name\"><link linkend=\"$id\">$symbol</link></entry></row>\n"; |
3444 | |
3445 | $desc .= MakeIndexterms($symbol, $id); |
3446 | $desc .= "\n"; |
3447 | $desc .= OutputSymbolExtraLinks($symbol); |
3448 | - |
3449 | - # FIXME: we do more for structs |
3450 | - my $decl_out = &CreateValidSGML ($declaration); |
3451 | - $desc .= "<programlisting>$decl_out</programlisting>\n"; |
3452 | - |
3453 | $desc .= &MakeDeprecationNote($symbol); |
3454 | |
3455 | if (defined ($SymbolDocs{$symbol})) { |
3456 | - $desc .= &ExpandAbbreviations($symbol, $SymbolDocs{$symbol}); |
3457 | + $desc .= &ConvertMarkDown($symbol, $SymbolDocs{$symbol}); |
3458 | } |
3459 | |
3460 | # Create a table of fields and descriptions |
3461 | @@ -1720,22 +1856,31 @@ |
3462 | my $missing_parameters = ""; |
3463 | my $unused_parameters = ""; |
3464 | |
3465 | - $desc .= "<variablelist role=\"union\">\n"; |
3466 | + $desc .= <<EOF; |
3467 | +<refsect3 role="union_members">\n<title>Members</title> |
3468 | +<informaltable role="union_members_table" pgwide="1" frame="none"> |
3469 | +<tgroup cols="3"> |
3470 | +<colspec colname="union_members_name" colwidth="300px"/> |
3471 | +<colspec colname="union_members_description"/> |
3472 | +<colspec colname="union_members_annotations" colwidth="200px"/> |
3473 | +<tbody> |
3474 | +EOF |
3475 | + |
3476 | while (@fields) { |
3477 | my $field_name = shift @fields; |
3478 | my $text = shift @fields; |
3479 | my $field_descr = $field_descrs{$field_name}; |
3480 | my $param_annotations = ""; |
3481 | |
3482 | - $desc .= "<varlistentry><term>$text</term>\n"; |
3483 | + $desc .= "<row><entry role=\"union_member_name\"><para>$text</para></entry>\n"; |
3484 | if (defined $field_descr) { |
3485 | ($field_descr,$param_annotations) = &ExpandAnnotation($symbol, $field_descr); |
3486 | - $field_descr = &ExpandAbbreviations($symbol, $field_descr); |
3487 | - $field_descr .= $param_annotations; |
3488 | + $field_descr = &ConvertMarkDown($symbol, $field_descr); |
3489 | + |
3490 | # trim |
3491 | $field_descr =~ s/^(\s|\n)+//msg; |
3492 | $field_descr =~ s/(\s|\n)+$//msg; |
3493 | - $desc .= "<listitem><simpara>$field_descr</simpara></listitem>\n"; |
3494 | + $desc .= "<entry role=\"union_member_description\">$field_descr</entry>\n<entry role=\"union_member_annotations\">$param_annotations</entry>\n"; |
3495 | delete $field_descrs{$field_name}; |
3496 | } else { |
3497 | &LogWarning (&GetSymbolSourceFile ($symbol), &GetSymbolSourceLine($symbol), |
3498 | @@ -1745,11 +1890,11 @@ |
3499 | } else { |
3500 | $missing_parameters = $field_name; |
3501 | } |
3502 | - $desc .= "<listitem />\n"; |
3503 | + $desc .= "<entry /><entry />\n"; |
3504 | } |
3505 | - $desc .= "</varlistentry>\n"; |
3506 | + $desc .= "</row>\n"; |
3507 | } |
3508 | - $desc .= "</variablelist>"; |
3509 | + $desc .= "</tbody></tgroup></informaltable>\n</refsect3>"; |
3510 | foreach my $field_name (keys %field_descrs) { |
3511 | &LogWarning (&GetSymbolSourceFile ($symbol), &GetSymbolSourceLine($symbol), |
3512 | "Field description for $symbol"."::"."$field_name is not used from source code comment block."); |
3513 | @@ -1811,56 +1956,16 @@ |
3514 | $condition = &MakeConditionDescription ($symbol); |
3515 | } |
3516 | |
3517 | - my $synop = &MakeReturnField("enum") . "<link linkend=\"$id\">$symbol</link>;\n"; |
3518 | + my $synop = "<row><entry role=\"datatype_keyword\">enum</entry><entry role=\"function_name\"><link linkend=\"$id\">$symbol</link></entry></row>\n"; |
3519 | my $desc = "<refsect2 id=\"$id\" role=\"enum\"$condition>\n<title>enum $symbol</title>\n"; |
3520 | |
3521 | $desc .= MakeIndexterms($symbol, $id); |
3522 | $desc .= "\n"; |
3523 | $desc .= OutputSymbolExtraLinks($symbol); |
3524 | - |
3525 | - my $decl_out = ""; |
3526 | - my $public = 1; |
3527 | - my $new_declaration = ""; |
3528 | - my $decl_line; |
3529 | - my $decl = $declaration; |
3530 | - |
3531 | - if ($decl =~ m/^\s*(typedef\s+)?enum\s*\w*\s*(?:\/\*.*\*\/)?\s*{(.*)}\s*\w*\s*;\s*$/s) { |
3532 | - my $has_typedef = defined($1) ? 1 : 0; |
3533 | - my $enum_contents = $2; |
3534 | - |
3535 | - foreach $decl_line (split (/\n/, $enum_contents)) { |
3536 | - #print "Enum line: $decl_line\n"; |
3537 | - if ($decl_line =~ m%/\*\s*<\s*public\s*>\s*\*/%) { |
3538 | - $public = 1; |
3539 | - } elsif ($decl_line =~ m%/\*\s*<\s*(private|protected)\s*>\s*\*/%) { |
3540 | - $public = 0; |
3541 | - } elsif ($public) { |
3542 | - $new_declaration .= $decl_line . "\n"; |
3543 | - } |
3544 | - } |
3545 | - |
3546 | - if ($new_declaration) { |
3547 | - # Strip any blank lines off the ends. |
3548 | - $new_declaration =~ s/^\s*\n//; |
3549 | - $new_declaration =~ s/\n\s*$/\n/; |
3550 | - |
3551 | - if ($has_typedef) { |
3552 | - $decl_out = "typedef enum {\n" . $new_declaration |
3553 | - . "} $symbol;\n"; |
3554 | - } else { |
3555 | - $decl_out = "enum $symbol {\n" . $new_declaration |
3556 | - . "};\n"; |
3557 | - } |
3558 | - } |
3559 | - } |
3560 | - |
3561 | - $decl_out = &CreateValidSGML ($decl_out); |
3562 | - $desc .= "<programlisting>$decl_out</programlisting>\n"; |
3563 | - |
3564 | $desc .= &MakeDeprecationNote($symbol); |
3565 | |
3566 | if (defined ($SymbolDocs{$symbol})) { |
3567 | - $desc .= &ExpandAbbreviations($symbol, $SymbolDocs{$symbol}); |
3568 | + $desc .= &ConvertMarkDown($symbol, $SymbolDocs{$symbol}); |
3569 | } |
3570 | |
3571 | # Create a table of fields and descriptions |
3572 | @@ -1885,18 +1990,27 @@ |
3573 | my $missing_parameters = ""; |
3574 | my $unused_parameters = ""; |
3575 | |
3576 | - $desc .= "<variablelist role=\"enum\">\n"; |
3577 | + $desc .= <<EOF; |
3578 | +<refsect3 role="enum_members">\n<title>Members</title> |
3579 | +<informaltable role="enum_members_table" pgwide="1" frame="none"> |
3580 | +<tgroup cols="3"> |
3581 | +<colspec colname="enum_members_name" colwidth="300px"/> |
3582 | +<colspec colname="enum_members_description"/> |
3583 | +<colspec colname="enum_members_annotations" colwidth="200px"/> |
3584 | +<tbody> |
3585 | +EOF |
3586 | + |
3587 | for my $field_name (@fields) { |
3588 | my $field_descr = $field_descrs{$field_name}; |
3589 | my $param_annotations = ""; |
3590 | |
3591 | $id = &CreateValidSGMLID ($field_name); |
3592 | $condition = &MakeConditionDescription ($field_name); |
3593 | - $desc .= "<varlistentry id=\"$id\" role=\"constant\"$condition>\n<term><literal>$field_name</literal></term>\n"; |
3594 | + $desc .= "<row role=\"constant\"><entry role=\"enum_member_name\"><para id=\"$id\">$field_name</para></entry>\n"; |
3595 | if (defined $field_descr) { |
3596 | ($field_descr,$param_annotations) = &ExpandAnnotation($symbol, $field_descr); |
3597 | - $field_descr = &ExpandAbbreviations($symbol, $field_descr); |
3598 | - $desc .= "<listitem><simpara>$field_descr$param_annotations</simpara></listitem>\n"; |
3599 | + $field_descr = &ConvertMarkDown($symbol, $field_descr); |
3600 | + $desc .= "<entry role=\"enum_member_description\">$field_descr</entry>\n<entry role=\"enum_member_annotations\">$param_annotations</entry>\n"; |
3601 | delete $field_descrs{$field_name}; |
3602 | } else { |
3603 | if ($found) { |
3604 | @@ -1908,11 +2022,11 @@ |
3605 | $missing_parameters = $field_name; |
3606 | } |
3607 | } |
3608 | - $desc .= "<listitem />\n"; |
3609 | + $desc .= "<entry /><entry />\n"; |
3610 | } |
3611 | - $desc .= "</varlistentry>\n"; |
3612 | + $desc .= "</row>\n"; |
3613 | } |
3614 | - $desc .= "</variablelist>"; |
3615 | + $desc .= "</tbody></tgroup></informaltable>\n</refsect3>"; |
3616 | foreach my $field_name (keys %field_descrs) { |
3617 | &LogWarning (&GetSymbolSourceFile ($symbol), &GetSymbolSourceLine($symbol), |
3618 | "Value description for $symbol"."::"."$field_name is not used from source code comment block."); |
3619 | @@ -1961,23 +2075,23 @@ |
3620 | |
3621 | @TRACE@("ouputing variable: '$symbol' '$declaration'"); |
3622 | |
3623 | - my $synop; |
3624 | + my $type_output; |
3625 | 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*;/) { |
3626 | my $mod1 = defined ($1) ? $1 : ""; |
3627 | my $ptr = defined ($3) ? $3 : ""; |
3628 | my $space = defined ($4) ? $4 : ""; |
3629 | my $mod2 = defined ($5) ? $5 : ""; |
3630 | - $synop = &MakeReturnField("extern $mod1$ptr$space$mod2") . "<link linkend=\"$id\">$symbol</link>;\n"; |
3631 | + $type_output = "extern $mod1$ptr$space$mod2"; |
3632 | } 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*=/) { |
3633 | my $mod1 = defined ($1) ? $1 : ""; |
3634 | my $ptr = defined ($3) ? $3 : ""; |
3635 | my $space = defined ($4) ? $4 : ""; |
3636 | my $mod2 = defined ($5) ? $5 : ""; |
3637 | - $synop = &MakeReturnField("$mod1$ptr$space$mod2") . "<link linkend=\"$id\">$symbol</link>;\n"; |
3638 | - |
3639 | + $type_output = "$mod1$ptr$space$mod2"; |
3640 | } else { |
3641 | - $synop = &MakeReturnField("extern") . "<link linkend=\"$id\">$symbol</link>;\n"; |
3642 | + $type_output = "extern"; |
3643 | } |
3644 | + my $synop = "<row><entry role=\"variable_type\">${type_output}</entry><entry role=\"function_name\"><link linkend=\"$id\">$symbol</link></entry></row>\n"; |
3645 | |
3646 | my $desc = "<refsect2 id=\"$id\" role=\"variable\"$condition>\n<title>$symbol</title>\n"; |
3647 | |
3648 | @@ -1986,12 +2100,12 @@ |
3649 | $desc .= OutputSymbolExtraLinks($symbol); |
3650 | |
3651 | my $decl_out = &CreateValidSGML ($declaration); |
3652 | - $desc .= "<programlisting>$decl_out</programlisting>\n"; |
3653 | + $desc .= "<programlisting language=\"C\">$decl_out</programlisting>\n"; |
3654 | |
3655 | $desc .= &MakeDeprecationNote($symbol); |
3656 | |
3657 | if (defined ($SymbolDocs{$symbol})) { |
3658 | - $desc .= &ExpandAbbreviations($symbol, $SymbolDocs{$symbol}); |
3659 | + $desc .= &ConvertMarkDown($symbol, $SymbolDocs{$symbol}); |
3660 | } |
3661 | $desc .= OutputSymbolTraits ($symbol); |
3662 | $desc .= "</refsect2>\n"; |
3663 | @@ -2027,54 +2141,40 @@ |
3664 | # We output const rather than G_CONST_RETURN. |
3665 | $type_modifier =~ s/G_CONST_RETURN/const/g; |
3666 | $pointer =~ s/G_CONST_RETURN/const/g; |
3667 | - $pointer =~ s/^\s+/ /g; |
3668 | + $pointer =~ s/^\s+/ /g; |
3669 | |
3670 | - my $ret_type_len = length ($start) + length ($type_modifier)+ length ($type) |
3671 | - + length ($pointer); |
3672 | my $ret_type_output; |
3673 | - my $symbol_len; |
3674 | - if ($ret_type_len < $RETURN_TYPE_FIELD_WIDTH) { |
3675 | - $ret_type_output = "$start$type_modifier$xref$pointer" |
3676 | - . (' ' x ($RETURN_TYPE_FIELD_WIDTH - $ret_type_len)); |
3677 | - $symbol_len = 0; |
3678 | - } else { |
3679 | - #$ret_type_output = "$start$type_modifier$xref$pointer\n" . (' ' x $RETURN_TYPE_FIELD_WIDTH); |
3680 | - |
3681 | - $ret_type_output = "$start$type_modifier$xref$pointer "; |
3682 | - $symbol_len = $ret_type_len + 1 - $RETURN_TYPE_FIELD_WIDTH; |
3683 | - } |
3684 | - #@TRACE@("$symbol ret type output: [$ret_type_output], $ret_type_len"); |
3685 | - |
3686 | - $symbol_len += length ($symbol); |
3687 | + $ret_type_output = "$start$type_modifier$xref$pointer\n"; |
3688 | + |
3689 | + my $indent_len; |
3690 | + $indent_len = length ($symbol) + 2; |
3691 | my $char1 = my $char2 = my $char3 = ""; |
3692 | if ($symbol_type eq 'USER_FUNCTION') { |
3693 | - $symbol_len += 3; |
3694 | - $char1 = "("; |
3695 | + $indent_len += 3; |
3696 | + $char1 = "<phrase role=\"c_punctuation\">(</phrase>"; |
3697 | $char2 = "*"; |
3698 | - $char3 = ")"; |
3699 | + $char3 = "<phrase role=\"c_punctuation\">)</phrase>"; |
3700 | } |
3701 | |
3702 | my ($symbol_output, $symbol_desc_output); |
3703 | - if ($symbol_len < $SYMBOL_FIELD_WIDTH) { |
3704 | - $symbol_output = "$char1<link linkend=\"$id\">$char2$symbol</link>$char3" |
3705 | - . (' ' x ($SYMBOL_FIELD_WIDTH - $symbol_len)); |
3706 | - $symbol_desc_output = "$char1$char2$symbol$char3" |
3707 | - . (' ' x ($SYMBOL_FIELD_WIDTH - $symbol_len)); |
3708 | + $symbol_output = "$char1<link linkend=\"$id\">$char2$symbol</link>$char3"; |
3709 | + if ($indent_len < $MAX_SYMBOL_FIELD_WIDTH) { |
3710 | + $symbol_desc_output = "$char1$char2$symbol$char3 "; |
3711 | } else { |
3712 | - $symbol_output = "$char1<link linkend=\"$id\">$char2$symbol</link>$char3\n" |
3713 | - . (' ' x ($SYMBOL_FIELD_WIDTH + $RETURN_TYPE_FIELD_WIDTH)); |
3714 | + $indent_len = $MAX_SYMBOL_FIELD_WIDTH - 8; |
3715 | $symbol_desc_output = "$char1$char2$symbol$char3\n" |
3716 | - . (' ' x ($SYMBOL_FIELD_WIDTH + $RETURN_TYPE_FIELD_WIDTH)); |
3717 | + . (' ' x ($indent_len - 1)); |
3718 | } |
3719 | |
3720 | - my $synop = $ret_type_output . $symbol_output . '('; |
3721 | - my $desc = "<refsect2 id=\"$id\" role=\"function\"$condition>\n<title>${symbol} ()</title>\n"; |
3722 | + my $synop = "<row><entry role=\"function_type\">${ret_type_output}</entry><entry role=\"function_name\">${symbol_output} <phrase role=\"c_punctuation\">()</phrase></entry></row>\n"; |
3723 | + |
3724 | + my $desc = "<refsect2 id=\"$id\" role=\"function\"$condition>\n<title>${symbol} ()</title>\n"; |
3725 | |
3726 | $desc .= MakeIndexterms($symbol, $id); |
3727 | $desc .= "\n"; |
3728 | $desc .= OutputSymbolExtraLinks($symbol); |
3729 | |
3730 | - $desc .= "<programlisting>${ret_type_output}$symbol_desc_output("; |
3731 | + $desc .= "<programlisting language=\"C\">${ret_type_output}$symbol_desc_output("; |
3732 | |
3733 | my @fields = ParseFunctionDeclaration($declaration, \&MakeXRef, |
3734 | sub { |
3735 | @@ -2085,20 +2185,15 @@ |
3736 | my $field_name = $fields[$i]; |
3737 | |
3738 | if ($i == 1) { |
3739 | - $synop .= "$field_name"; |
3740 | $desc .= "$field_name"; |
3741 | } else { |
3742 | - $synop .= ",\n" |
3743 | - . (' ' x ($SYMBOL_FIELD_WIDTH + $RETURN_TYPE_FIELD_WIDTH)) |
3744 | - . " $field_name"; |
3745 | $desc .= ",\n" |
3746 | - . (' ' x ($SYMBOL_FIELD_WIDTH + $RETURN_TYPE_FIELD_WIDTH)) |
3747 | - . " $field_name"; |
3748 | + . (' ' x $indent_len) |
3749 | + . "$field_name"; |
3750 | } |
3751 | |
3752 | } |
3753 | |
3754 | - $synop .= ");\n"; |
3755 | $desc .= ");</programlisting>\n"; |
3756 | |
3757 | $desc .= &MakeDeprecationNote($symbol); |
3758 | @@ -2107,7 +2202,7 @@ |
3759 | my $parameters_output = 0; |
3760 | |
3761 | if (defined ($SymbolDocs{$symbol})) { |
3762 | - my $symbol_docs = &ExpandAbbreviations($symbol, $SymbolDocs{$symbol}); |
3763 | + my $symbol_docs = &ConvertMarkDown($symbol, $SymbolDocs{$symbol}); |
3764 | |
3765 | # Try to insert the parameter table at the author's desired position. |
3766 | # Otherwise we need to tag it onto the end. |
3767 | @@ -2166,13 +2261,12 @@ |
3768 | my $param_annotations = ""; |
3769 | |
3770 | ($param_desc,$param_annotations) = & ExpandAnnotation($symbol, $param_desc); |
3771 | - $param_desc = &ExpandAbbreviations($symbol, $param_desc); |
3772 | - $param_desc .= $param_annotations; |
3773 | + $param_desc = &ConvertMarkDown($symbol, $param_desc); |
3774 | # trim |
3775 | $param_desc =~ s/^(\s|\n)+//msg; |
3776 | $param_desc =~ s/(\s|\n)+$//msg; |
3777 | if ($param_name eq "Returns") { |
3778 | - $returns = "$param_desc"; |
3779 | + $returns = "$param_desc\n<para>$param_annotations</para>"; |
3780 | } elsif ($param_name eq "void") { |
3781 | #print "!!!! void in params for $symbol?\n"; |
3782 | } else { |
3783 | @@ -2190,7 +2284,7 @@ |
3784 | } |
3785 | } |
3786 | if($param_desc ne "") { |
3787 | - $params_desc .= "<varlistentry><term><parameter>$param_name</parameter> :</term>\n<listitem><simpara>$param_desc</simpara></listitem></varlistentry>\n"; |
3788 | + $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"; |
3789 | $num_params++; |
3790 | } |
3791 | } |
3792 | @@ -2207,24 +2301,31 @@ |
3793 | |
3794 | # Signals have an implicit user_data parameter which we describe. |
3795 | if ($symbol_type eq "SIGNAL") { |
3796 | - $params_desc .= "<varlistentry><term><parameter>user_data</parameter> :</term>\n<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>\n"; |
3797 | + $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"; |
3798 | } |
3799 | |
3800 | # Start a table if we need one. |
3801 | - if ($params_desc || $returns) { |
3802 | - $output .= "<variablelist role=\"params\">\n"; |
3803 | - if ($params_desc ne "") { |
3804 | - #$output .= "<varlistentry><term>Parameters:</term><listitem></listitem></varlistentry>\n"; |
3805 | - $output .= $params_desc; |
3806 | - } |
3807 | - |
3808 | - # Output the returns info last |
3809 | - if ($returns) { |
3810 | - $output .= "<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>$returns</simpara></listitem></varlistentry>\n"; |
3811 | - } |
3812 | - |
3813 | - # Finish the table. |
3814 | - $output .= "</variablelist>"; |
3815 | + if ($params_desc ne "") { |
3816 | + $output .= <<EOF; |
3817 | +<refsect3 role="parameters">\n<title>Parameters</title> |
3818 | +<informaltable role="parameters_table" pgwide="1" frame="none"> |
3819 | +<tgroup cols="3"> |
3820 | +<colspec colname="parameters_name" colwidth="150px"/> |
3821 | +<colspec colname="parameters_description"/> |
3822 | +<colspec colname="parameters_annotations" colwidth="200px"/> |
3823 | +<tbody> |
3824 | +EOF |
3825 | + $output .= $params_desc; |
3826 | + $output .= "</tbody></tgroup></informaltable>\n</refsect3>"; |
3827 | + } |
3828 | + |
3829 | + # Output the returns info last |
3830 | + if ($returns ne "") { |
3831 | + $output .= <<EOF; |
3832 | +<refsect3 role=\"returns\">\n<title>Returns</title> |
3833 | +EOF |
3834 | + $output .= $returns; |
3835 | + $output .= "\n</refsect3>"; |
3836 | } |
3837 | |
3838 | # remember missing/unused parameters (needed in tmpl-free build) |
3839 | @@ -2284,8 +2385,10 @@ |
3840 | # $section_id - the SGML id to use for the toplevel tag. |
3841 | # $includes - comma-separates list of include files added at top of |
3842 | # synopsis, with '<' '>' around them (if not already enclosed in ""). |
3843 | -# $synopsis - reference to the DocBook for the Synopsis part. |
3844 | -# $details - reference to the DocBook for the Details part. |
3845 | +# $functions_synop - reference to the DocBook for the Functions Synopsis part. |
3846 | +# $other_synop - reference to the DocBook for the Types and Values Synopsis part. |
3847 | +# $functions_details - reference to the DocBook for the Functions Details part. |
3848 | +# $other_details - reference to the DocBook for the Types and Values Details part. |
3849 | # $signal_synop - reference to the DocBook for the Signal Synopsis part |
3850 | # $signal_desc - reference to the DocBook for the Signal Description part |
3851 | # $args_synop - reference to the DocBook for the Arg Synopsis part |
3852 | @@ -2299,7 +2402,7 @@ |
3853 | ############################################################################# |
3854 | |
3855 | sub OutputSGMLFile { |
3856 | - my ($file, $title, $section_id, $includes, $synopsis, $details, $signals_synop, $signals_desc, $args_synop, $args_desc, $hierarchy, $interfaces, $implementations, $prerequisites, $derived, $file_objects) = @_; |
3857 | + 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) = @_; |
3858 | |
3859 | #print "Output sgml for file $file with title '$title'\n"; |
3860 | |
3861 | @@ -2313,6 +2416,7 @@ |
3862 | if (!defined ($short_desc) || $short_desc =~ m/^\s*$/) { |
3863 | $short_desc = ""; |
3864 | } else { |
3865 | + # Don't use ConvertMarkDown here for now since we don't want blocks |
3866 | $short_desc = &ExpandAbbreviations("$title:Short_description", |
3867 | $short_desc); |
3868 | #print "Found short_desc: $short_desc"; |
3869 | @@ -2321,7 +2425,7 @@ |
3870 | if (!defined ($long_desc) || $long_desc =~ m/^\s*$/) { |
3871 | $long_desc = ""; |
3872 | } else { |
3873 | - $long_desc = &ExpandAbbreviations("$title:Long_description", |
3874 | + $long_desc = &ConvertMarkDown("$title:Long_description", |
3875 | $long_desc); |
3876 | #print "Found long_desc: $long_desc"; |
3877 | } |
3878 | @@ -2329,7 +2433,7 @@ |
3879 | if (!defined ($see_also) || $see_also =~ m%^\s*(<para>)?\s*(</para>)?\s*$%) { |
3880 | $see_also = ""; |
3881 | } else { |
3882 | - $see_also = &ExpandAbbreviations("$title:See_Also", $see_also); |
3883 | + $see_also = &ConvertMarkDown("$title:See_Also", $see_also); |
3884 | #print "Found see_also: $see_also"; |
3885 | } |
3886 | if ($see_also) { |
3887 | @@ -2376,18 +2480,19 @@ |
3888 | $year += 1900; |
3889 | |
3890 | my $include_output = ""; |
3891 | - my $include; |
3892 | - foreach $include (split (/,/, $includes)) { |
3893 | + if ($includes) { |
3894 | + $include_output .= "<refsect1 id=\"$section_id.includes\"><title>Includes</title><synopsis>"; |
3895 | + my $include; |
3896 | + foreach $include (split (/,/, $includes)) { |
3897 | if ($include =~ m/^\".+\"$/) { |
3898 | - $include_output .= "#include ${include}\n"; |
3899 | + $include_output .= "#include ${include}\n"; |
3900 | } |
3901 | else { |
3902 | - $include =~ s/^\s+|\s+$//gs; |
3903 | - $include_output .= "#include <${include}>\n"; |
3904 | + $include =~ s/^\s+|\s+$//gs; |
3905 | + $include_output .= "#include <${include}>\n"; |
3906 | } |
3907 | - } |
3908 | - if ($include_output ne '') { |
3909 | - $include_output = "\n$include_output\n"; |
3910 | + } |
3911 | + $include_output .= "</synopsis></refsect1>\n"; |
3912 | } |
3913 | |
3914 | my $extralinks = OutputSectionExtraLinks($title,"Section:$file"); |
3915 | @@ -2428,19 +2533,19 @@ |
3916 | <refpurpose>$short_desc</refpurpose> |
3917 | </refnamediv> |
3918 | $stability |
3919 | -<refsynopsisdiv id="$section_id.synopsis" role="synopsis"> |
3920 | -<title role="synopsis.title">Synopsis</title> |
3921 | -$object_anchors |
3922 | -<synopsis>$include_output$${synopsis}</synopsis> |
3923 | -</refsynopsisdiv> |
3924 | -$$hierarchy$$prerequisites$$derived$$interfaces$$implementations$$args_synop$$signals_synop |
3925 | +$$functions_synop$$args_synop$$signals_synop$object_anchors$$other_synop$$hierarchy$$prerequisites$$derived$$interfaces$$implementations |
3926 | +$include_output |
3927 | <refsect1 id="$section_id.description" role="desc"> |
3928 | <title role="desc.title">Description</title> |
3929 | $extralinks$long_desc |
3930 | </refsect1> |
3931 | -<refsect1 id="$section_id.details" role="details"> |
3932 | -<title role="details.title">Details</title> |
3933 | -$$details |
3934 | +<refsect1 id="$section_id.functions_details" role="details"> |
3935 | +<title role="details.title">Functions</title> |
3936 | +$$functions_details |
3937 | +</refsect1> |
3938 | +<refsect1 id="$section_id.other_details" role="details"> |
3939 | +<title role="details.title">Types and Values</title> |
3940 | +$$other_details |
3941 | </refsect1> |
3942 | $$args_desc$$signals_desc$see_also |
3943 | </refentry> |
3944 | @@ -2654,7 +2759,8 @@ |
3945 | # If we're not in CDATA convert to entities. |
3946 | $text =~ s/&(?![a-zA-Z#]+;)/&/g; # Do this first, or the others get messed up. |
3947 | $text =~ s/<(?![a-zA-Z\/!])/</g; |
3948 | - $text =~ s/(?<![a-zA-Z0-9"'\/-])>/>/g; |
3949 | + # Allow ">" at beginning of string for blockquote markdown |
3950 | + $text =~ s/(?<=[^\w\n"'\/-])>/>/g; |
3951 | |
3952 | # Handle "#include <xxxxx>" |
3953 | $text =~ s/#include(\s+)<([^>]+)>/#include$1<$2>/g; |
3954 | @@ -2747,12 +2853,13 @@ |
3955 | sub ExpandAbbreviations { |
3956 | my ($symbol, $text) = @_; |
3957 | |
3958 | + # Note: This is a fallback and normally done in the markdown parser |
3959 | + |
3960 | # Convert "|[" and "]|" into the start and end of program listing examples. |
3961 | - # FIXME: we like to have a way to specify parameters e.g. language="c" |
3962 | - $text =~ s%\|\[%<informalexample><programlisting>%g; |
3963 | - $text =~ s%\]\|%</programlisting></informalexample>%g; |
3964 | - # TODO: check for a xml comment after |[ and pick the language attribute from |
3965 | - # that |
3966 | + # Support \[<!-- language="C" --> modifiers |
3967 | + $text =~ s%\|\[<!-- language="([^"]+)" -->%<informalexample><programlisting language="$1"><![CDATA[%g; |
3968 | + $text =~ s%\|\[%<informalexample><programlisting><![CDATA[%g; |
3969 | + $text =~ s%\]\|%]]></programlisting></informalexample>%g; |
3970 | |
3971 | # keep CDATA unmodified, preserve ulink tags (ideally we preseve all tags |
3972 | # as such) |
3973 | @@ -2787,6 +2894,8 @@ |
3974 | \&ExpandAbbreviationsEndTag, |
3975 | \&ExpandAbbreviationsCallback2); |
3976 | } elsif ($tag eq "") { |
3977 | + # NOTE: this is a fallback. It is normally done by the Markdown parser. |
3978 | + |
3979 | # We are outside any CDATA or <programlisting> sections, so we expand |
3980 | # any gtk-doc abbreviations. |
3981 | |
3982 | @@ -2814,15 +2923,6 @@ |
3983 | # Convert '#symbol', but not '\#symbol'. |
3984 | $text =~ s/(\A|[^\\])#([\w\-:\.]+[\w]+)/$1.&MakeHashXRef($2, "type");/eg; |
3985 | $text =~ s/\\#/#/g; |
3986 | - |
3987 | - # Expand urls |
3988 | - # FIXME: should we skip urls that are already tagged? (e.g. <literal>http://...</literal>) |
3989 | - # this is apparently also called for markup and not just for plain text |
3990 | - # disable for now. |
3991 | - #$text =~ s%(http|https|ftp)://(.*?)((?:\s|,|\)|\]|\<|\.\s))%<ulink url="$1://$2">$2</ulink>$3%g; |
3992 | - |
3993 | - # TODO: optionally check all words from $text against internal symbols and |
3994 | - # warn if those could be xreffed, but miss a %,# or () |
3995 | } |
3996 | |
3997 | return $text; |
3998 | @@ -2838,6 +2938,9 @@ |
3999 | # FIXME: why is this different from &ExpandAbbreviationsCallback(), |
4000 | # why not just call it |
4001 | $text =~ s/#(\w+)/&MakeHashXRef($1, "");/eg; |
4002 | + } elsif ($tag eq "<![CDATA[") { |
4003 | + # NOTE: this is a fallback. It is normally done by the Markdown parser. |
4004 | + $text = &ReplaceEntities ($text, $symbol); |
4005 | } |
4006 | |
4007 | return $text; |
4008 | @@ -2859,13 +2962,13 @@ |
4009 | # If the symbol is in the form "Object::signal", then change the symbol to |
4010 | # "Object-signal" and use "signal" as the text. |
4011 | if ($symbol =~ s/::/-/) { |
4012 | - $text = "\"$'\""; |
4013 | + $text = "“$'”"; |
4014 | } |
4015 | |
4016 | # If the symbol is in the form "Object:property", then change the symbol to |
4017 | # "Object--property" and use "property" as the text. |
4018 | if ($symbol =~ s/:/--/) { |
4019 | - $text = "\"$'\""; |
4020 | + $text = "“$'”"; |
4021 | } |
4022 | |
4023 | if ($tag ne "") { |
4024 | @@ -3029,24 +3132,26 @@ |
4025 | sub MakeDeprecationNote { |
4026 | my ($symbol) = $_[0]; |
4027 | my $desc = ""; |
4028 | - my $note = ""; |
4029 | if (exists $Deprecated{$symbol}) { |
4030 | - $desc .= "<warning>"; |
4031 | - |
4032 | - if ($Deprecated{$symbol} =~ /^\s*([0-9\.]+)\s*:/) { |
4033 | - $desc .= "<para><literal>$symbol</literal> has been deprecated since version $1 and should not be used in newly-written code."; |
4034 | + my $note; |
4035 | + |
4036 | + $desc .= "<warning><para><literal>$symbol</literal> "; |
4037 | + |
4038 | + $note = $Deprecated{$symbol}; |
4039 | + |
4040 | + if ($note =~ /^\s*([0-9\.]+)\s*:?/) { |
4041 | + $desc .= "has been deprecated since version $1 and should not be used in newly-written code.</para>"; |
4042 | } else { |
4043 | - $desc .= "<para><literal>$symbol</literal> is deprecated and should not be used in newly-written code."; |
4044 | + $desc .= "is deprecated and should not be used in newly-written code.</para>"; |
4045 | } |
4046 | - if ($Deprecated{$symbol} ne "") { |
4047 | - $note = &ExpandAbbreviations($symbol, $Deprecated{$symbol}); |
4048 | - $note =~ s/^\s*([0-9\.]+)\s*:\s*//; |
4049 | - $note =~ s/^\s+//; |
4050 | - $note =~ s/\s+$//; |
4051 | - $note =~ s%\n{2,}%\n</para>\n<para>\n%g; |
4052 | + $note =~ s/^\s*([0-9\.]+)\s*:?\s*//; |
4053 | + $note =~ s/^\s+//; |
4054 | + $note =~ s/\s+$//; |
4055 | + if ($note ne "") { |
4056 | + $note = &ConvertMarkDown($symbol, $note); |
4057 | $desc .= " " . $note; |
4058 | } |
4059 | - $desc .= "</para></warning>\n"; |
4060 | + $desc .= "</warning>\n"; |
4061 | } |
4062 | return $desc; |
4063 | } |
4064 | @@ -3093,7 +3198,9 @@ |
4065 | } |
4066 | |
4067 | if ($desc ne "") { |
4068 | - $desc=" condition=\"".$desc."\""; |
4069 | + my $cond = $desc; |
4070 | + $cond =~ s/\"/"/g; |
4071 | + $desc=" condition=\"".$cond."\""; |
4072 | #print "condition for '$symbol' = '$desc'\n"; |
4073 | } |
4074 | return $desc; |
4075 | @@ -3104,12 +3211,15 @@ |
4076 | # Description : Returns the DocBook output describing the ancestors and |
4077 | # immediate children of a GObject subclass. It uses the |
4078 | # global @Objects and @ObjectLevels arrays to walk the tree. |
4079 | +# |
4080 | # Arguments : $object - the GtkObject subclass. |
4081 | +# @hierarchy - previous hierarchy |
4082 | ############################################################################# |
4083 | |
4084 | sub GetHierarchy { |
4085 | - my ($object) = @_; |
4086 | - |
4087 | + my ($object,$hierarchy_ref) = @_; |
4088 | + my @hierarchy = @{$hierarchy_ref}; |
4089 | + |
4090 | # Find object in the objects array. |
4091 | my $found = 0; |
4092 | my @children = (); |
4093 | @@ -3132,7 +3242,7 @@ |
4094 | } |
4095 | } |
4096 | if (!$found) { |
4097 | - return ""; |
4098 | + return @hierarchy; |
4099 | } |
4100 | |
4101 | # Walk up the hierarchy, pushing ancestors onto the ancestors array. |
4102 | @@ -3148,9 +3258,9 @@ |
4103 | } |
4104 | } |
4105 | |
4106 | - # Output the ancestors list, indented and with links. |
4107 | - my $hierarchy = "<synopsis>\n"; |
4108 | - $level = 0; |
4109 | + # Output the ancestors, indented and with links. |
4110 | + my $last_index = 0; |
4111 | + $level = 1; |
4112 | for ($i = $#ancestors; $i >= 0; $i--) { |
4113 | my $link_text; |
4114 | # Don't add a link to the current object, i.e. when i == 0. |
4115 | @@ -3160,25 +3270,59 @@ |
4116 | } else { |
4117 | $link_text = "$ancestors[$i]"; |
4118 | } |
4119 | - if ($level == 0) { |
4120 | - $hierarchy .= " $link_text\n"; |
4121 | + my $indented_text = ' ' x ($level * 4) . $link_text; |
4122 | + # Check if we already have this object |
4123 | + my $index = -1; |
4124 | + for ($j = 0; $j <= $#hierarchy; $j++) { |
4125 | + if ($hierarchy[$j] eq $indented_text) { |
4126 | + $index = $j; |
4127 | + last; |
4128 | + } |
4129 | + } |
4130 | + if ($index == -1) { |
4131 | + # We have a new entry, find insert position in alphabetical order |
4132 | + my $indent = ' ' x ($level * 4); |
4133 | + my $found = 0; |
4134 | + for ($j = $last_index; $j <= $#hierarchy; $j++) { |
4135 | + if ($hierarchy[$j] !~ m/^${indent}/) { |
4136 | + $last_index = $j; |
4137 | + $found = 1; |
4138 | + last; |
4139 | + } elsif ($hierarchy[$j] =~ m/^${indent}[^ ]/) { |
4140 | + my $stripped_text = $hierarchy[$j]; |
4141 | + if ($indented_text !~ m/<link linkend/) { |
4142 | + $stripped_text =~ s%<link linkend="[A-Za-z]*">%%; |
4143 | + $stripped_text =~ s%</link>%%; |
4144 | + } |
4145 | + if ($indented_text lt $stripped_text) { |
4146 | + $last_index = $j; |
4147 | + $found = 1; |
4148 | + last; |
4149 | + } |
4150 | + } |
4151 | + } |
4152 | + if (!$found) { |
4153 | + $last_index = 1 + $#hierarchy; |
4154 | + } |
4155 | + splice @hierarchy, $last_index, 0, ($indented_text); |
4156 | + $last_index++; |
4157 | } else { |
4158 | -# $hierarchy .= ' ' x ($level * 6 - 3) . "|\n"; |
4159 | - $hierarchy .= ' ' x ($level * 6 - 3) . "+----$link_text\n"; |
4160 | + # Already have this one, remmeber index as base insert point |
4161 | + $last_index = $index + 1; |
4162 | } |
4163 | $level++; |
4164 | } |
4165 | + # Output the children, indented and with links. |
4166 | for ($i = 0; $i <= $#children; $i++) { |
4167 | - my $id = &CreateValidSGMLID ($children[$i]); |
4168 | - my $link_text = "<link linkend=\"$id\">$children[$i]</link>"; |
4169 | - $hierarchy .= ' ' x ($level * 6 - 3) . "+----$link_text\n"; |
4170 | - } |
4171 | - $hierarchy .= "</synopsis>\n"; |
4172 | + my $id = &CreateValidSGMLID ($children[$i]); |
4173 | + my $indented_text = ' ' x ($level * 4) . "<link linkend=\"$id\">$children[$i]</link>"; |
4174 | + splice @hierarchy, $last_index, 0, ($indented_text); |
4175 | + $last_index++; |
4176 | + } |
4177 | |
4178 | - return $hierarchy; |
4179 | + return @hierarchy; |
4180 | } |
4181 | |
4182 | - |
4183 | ############################################################################# |
4184 | # Function : GetInterfaces |
4185 | # Description : Returns the DocBook output describing the interfaces |
4186 | @@ -3366,15 +3510,12 @@ |
4187 | my $symbol = "${object}::${name}"; |
4188 | my $id = &CreateValidSGMLID ("$object-$name"); |
4189 | |
4190 | - my $pad = ' ' x (46 - length($name)); |
4191 | - $synop .= " "<link linkend=\"$id\">$name</link>"$pad "; |
4192 | - |
4193 | - $desc .= "<refsect2 id=\"$id\" role=\"signal\"><title>The <literal>"$name"</literal> signal</title>\n"; |
4194 | + $desc .= "<refsect2 id=\"$id\" role=\"signal\"><title>The <literal>“$name”</literal> signal</title>\n"; |
4195 | $desc .= MakeIndexterms($symbol, $id); |
4196 | $desc .= "\n"; |
4197 | $desc .= OutputSymbolExtraLinks($symbol); |
4198 | |
4199 | - $desc .= "<programlisting>"; |
4200 | + $desc .= "<programlisting language=\"C\">"; |
4201 | |
4202 | $SignalReturns[$i] =~ m/\s*(const\s+)?(\w+)\s*(\**)/; |
4203 | my $type_modifier = defined($1) ? $1 : ""; |
4204 | @@ -3382,12 +3523,12 @@ |
4205 | my $pointer = $3; |
4206 | my $xref = &MakeXRef ($type, &tagify($type, "returnvalue")); |
4207 | |
4208 | - my $ret_type_len = length ($type_modifier) + length ($pointer) |
4209 | - + length ($type); |
4210 | - my $ret_type_output = "$type_modifier$xref$pointer" |
4211 | - . (' ' x ($RETURN_TYPE_FIELD_WIDTH - $ret_type_len)); |
4212 | + my $ret_type_output = "$type_modifier$xref$pointer"; |
4213 | + my $callback_name = "user_function"; |
4214 | + $desc .= "${ret_type_output}\n${callback_name} ("; |
4215 | |
4216 | - $desc .= "${ret_type_output}user_function " . &MakeReturnField("") . " ("; |
4217 | + my $indentation = ' ' x (length($callback_name) + 2); |
4218 | + my $pad = $indentation; |
4219 | |
4220 | my $sourceparams = $SourceSymbolParams{$symbol}; |
4221 | my @params = split ("\n", $SignalPrototypes[$i]); |
4222 | @@ -3398,32 +3539,33 @@ |
4223 | # do two passes, the first one is to calculate padding |
4224 | for ($l = 0; $l < 2; $l++) { |
4225 | for ($j = 0; $j <= $#params; $j++) { |
4226 | + my $param_name; |
4227 | # allow alphanumerics, '_', '[' & ']' in param names |
4228 | if ($params[$j] =~ m/^\s*(\w+)\s*(\**)\s*([\w\[\]]+)\s*$/) { |
4229 | $type = $1; |
4230 | $pointer = $2; |
4231 | if (defined($sourceparams)) { |
4232 | - $name = $$sourceparams[$PARAM_FIELD_COUNT * $j]; |
4233 | + $param_name = $$sourceparams[$PARAM_FIELD_COUNT * $j]; |
4234 | } |
4235 | else { |
4236 | - $name = $3; |
4237 | + $param_name = $3; |
4238 | } |
4239 | - if (!defined($name)) { |
4240 | - $name = "arg$j"; |
4241 | + if (!defined($param_name)) { |
4242 | + $param_name = "arg$j"; |
4243 | } |
4244 | if ($l == 0) { |
4245 | if (length($type) + length($pointer) > $type_len) { |
4246 | $type_len = length($type) + length($pointer); |
4247 | } |
4248 | - if (length($name) > $name_len) { |
4249 | - $name_len = length($name); |
4250 | + if (length($param_name) > $name_len) { |
4251 | + $name_len = length($param_name); |
4252 | } |
4253 | } |
4254 | else { |
4255 | $xref = &MakeXRef ($type, &tagify($type, "type")); |
4256 | $pad = ' ' x ($type_len - length($type) - length($pointer)); |
4257 | - $desc .= "$xref$pad $pointer$name,\n"; |
4258 | - $desc .= (' ' x ($SYMBOL_FIELD_WIDTH + $RETURN_TYPE_FIELD_WIDTH)); |
4259 | + $desc .= "$xref$pad $pointer${param_name},\n"; |
4260 | + $desc .= $indentation; |
4261 | } |
4262 | } else { |
4263 | &LogWarning (&GetSymbolSourceFile ($symbol), &GetSymbolSourceLine($symbol), |
4264 | @@ -3434,60 +3576,48 @@ |
4265 | $xref = &MakeXRef ("gpointer", &tagify("gpointer", "type")); |
4266 | $pad = ' ' x ($type_len - length("gpointer")); |
4267 | $desc .= "$xref$pad user_data)"; |
4268 | + $desc .= "</programlisting>\n"; |
4269 | |
4270 | my $flags = $SignalFlags[$i]; |
4271 | my $flags_string = ""; |
4272 | |
4273 | if (defined ($flags)) { |
4274 | if ($flags =~ m/f/) { |
4275 | - $flags_string = "<link linkend=\"G-SIGNAL-RUN-FIRST:CAPS\"><literal>Run First</literal></link>"; |
4276 | + $flags_string = "<link linkend=\"G-SIGNAL-RUN-FIRST:CAPS\">Run First</link>"; |
4277 | } |
4278 | elsif ($flags =~ m/l/) { |
4279 | - $flags_string = "<link linkend=\"G-SIGNAL-RUN-LAST:CAPS\"><literal>Run Last</literal></link>"; |
4280 | + $flags_string = "<link linkend=\"G-SIGNAL-RUN-LAST:CAPS\">Run Last</link>"; |
4281 | } |
4282 | elsif ($flags =~ m/c/) { |
4283 | - $flags_string = "<link linkend=\"G-SIGNAL-RUN-CLEANUP:CAPS\"><literal>Cleanup</literal></link>"; |
4284 | + $flags_string = "<link linkend=\"G-SIGNAL-RUN-CLEANUP:CAPS\">Cleanup</link>"; |
4285 | $flags_string = "Cleanup"; |
4286 | } |
4287 | if ($flags =~ m/r/) { |
4288 | if ($flags_string) { $flags_string .= " / "; } |
4289 | - $flags_string = "<link linkend=\"G-SIGNAL-NO-RECURSE:CAPS\"><literal>No Recursion</literal></link>"; |
4290 | + $flags_string = "<link linkend=\"G-SIGNAL-NO-RECURSE:CAPS\">No Recursion</link>"; |
4291 | } |
4292 | if ($flags =~ m/d/) { |
4293 | if ($flags_string) { $flags_string .= " / "; } |
4294 | - $flags_string = "<link linkend=\"G-SIGNAL-DETAILED:CAPS\"><literal>Has Details</literal></link>"; |
4295 | + $flags_string = "<link linkend=\"G-SIGNAL-DETAILED:CAPS\">Has Details</link>"; |
4296 | } |
4297 | if ($flags =~ m/a/) { |
4298 | if ($flags_string) { $flags_string .= " / "; } |
4299 | - $flags_string = "<link linkend=\"G-SIGNAL-ACTION:CAPS\"><literal>Action</literal></link>"; |
4300 | + $flags_string = "<link linkend=\"G-SIGNAL-ACTION:CAPS\">Action</link>"; |
4301 | } |
4302 | if ($flags =~ m/h/) { |
4303 | if ($flags_string) { $flags_string .= " / "; } |
4304 | - $flags_string = "<link linkend=\"G-SIGNAL-NO-HOOKS:CAPS\"><literal>No Hooks</literal></link>"; |
4305 | + $flags_string = "<link linkend=\"G-SIGNAL-NO-HOOKS:CAPS\">No Hooks</link>"; |
4306 | } |
4307 | } |
4308 | |
4309 | - if ($flags_string) |
4310 | - { |
4311 | - $synop .= ": $flags_string\n"; |
4312 | - |
4313 | - $pad = ' ' x (5 + $name_len - length("user_data")); |
4314 | - $desc .= "$pad : $flags_string</programlisting>\n"; |
4315 | - } |
4316 | - else |
4317 | - { |
4318 | - $synop .= "\n"; |
4319 | - $desc .= "</programlisting>\n"; |
4320 | - } |
4321 | - |
4322 | - $desc .= &MakeDeprecationNote($symbol); |
4323 | + $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"; |
4324 | |
4325 | my $parameters = &OutputParamDescriptions ("SIGNAL", $symbol); |
4326 | my $parameters_output = 0; |
4327 | |
4328 | $AllSymbols{$symbol} = 1; |
4329 | if (defined ($SymbolDocs{$symbol})) { |
4330 | - my $symbol_docs = &ExpandAbbreviations($symbol, $SymbolDocs{$symbol}); |
4331 | + my $symbol_docs = &ConvertMarkDown($symbol, $SymbolDocs{$symbol}); |
4332 | |
4333 | # Try to insert the parameter table at the author's desired |
4334 | # position. Otherwise we need to tag it onto the end. |
4335 | @@ -3500,10 +3630,14 @@ |
4336 | $AllDocumentedSymbols{$symbol} = 1; |
4337 | } |
4338 | } |
4339 | + $desc .= &MakeDeprecationNote($symbol); |
4340 | |
4341 | if ($parameters_output == 0) { |
4342 | $desc .= $parameters; |
4343 | - } |
4344 | + } |
4345 | + if ($flags_string) { |
4346 | + $desc .= "<para>Flags: $flags_string</para>\n"; |
4347 | + } |
4348 | $desc .= OutputSymbolTraits ($symbol); |
4349 | $desc .= "</refsect2>"; |
4350 | } |
4351 | @@ -3563,14 +3697,14 @@ |
4352 | my $default_output = CreateValidSGML ($default); |
4353 | |
4354 | if ($type eq "GtkString") { |
4355 | - $type = "char*"; |
4356 | + $type = "char *"; |
4357 | } |
4358 | if ($type eq "GtkSignal") { |
4359 | $type = "GtkSignalFunc, gpointer"; |
4360 | $type_output = &MakeXRef ("GtkSignalFunc") . ", " |
4361 | . &MakeXRef ("gpointer"); |
4362 | } elsif ($type =~ m/^(\w+)\*$/) { |
4363 | - $type_output = &MakeXRef ($1, &tagify($1, "type")) . "*"; |
4364 | + $type_output = &MakeXRef ($1, &tagify($1, "type")) . " *"; |
4365 | } else { |
4366 | $type_output = &MakeXRef ($type, &tagify($type, "type")); |
4367 | } |
4368 | @@ -3595,7 +3729,7 @@ |
4369 | my $blurb; |
4370 | if (defined($SymbolDocs{$symbol}) && |
4371 | !IsEmptyDoc($SymbolDocs{$symbol})) { |
4372 | - $blurb = &ExpandAbbreviations($symbol, $SymbolDocs{$symbol}); |
4373 | + $blurb = &ConvertMarkDown($symbol, $SymbolDocs{$symbol}); |
4374 | #print ".. [$SymbolDocs{$symbol}][$blurb]\n"; |
4375 | $AllDocumentedSymbols{$symbol} = 1; |
4376 | } |
4377 | @@ -3610,17 +3744,20 @@ |
4378 | } |
4379 | |
4380 | my $pad1 = " " x (24 - length ($name)); |
4381 | - my $pad2 = " " x (20 - length ($type)); |
4382 | |
4383 | - my $arg_synop = " "<link linkend=\"$id\">$name</link>"$pad1 $type_output $pad2 : $flags_string\n"; |
4384 | - my $arg_desc = "<refsect2 id=\"$id\" role=\"property\"><title>The <literal>"$name"</literal> $kind</title>\n"; |
4385 | + 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"; |
4386 | + my $arg_desc = "<refsect2 id=\"$id\" role=\"property\"><title>The <literal>“$name”</literal> $kind</title>\n"; |
4387 | $arg_desc .= MakeIndexterms($symbol, $id); |
4388 | $arg_desc .= "\n"; |
4389 | $arg_desc .= OutputSymbolExtraLinks($symbol); |
4390 | |
4391 | - $arg_desc .= "<programlisting> "$name"$pad1 $type_output $pad2 : $flags_string</programlisting>\n"; |
4392 | + $arg_desc .= "<programlisting> “$name”$pad1 $type_output</programlisting>\n"; |
4393 | + $arg_desc .= $blurb; |
4394 | $arg_desc .= &MakeDeprecationNote($symbol); |
4395 | - $arg_desc .= $blurb; |
4396 | + |
4397 | + if ($flags_string) { |
4398 | + $arg_desc .= "<para>Flags: $flags_string</para>\n"; |
4399 | + } |
4400 | if ($range ne "") { |
4401 | $arg_desc .= "<para>Allowed values: $range_output</para>\n"; |
4402 | } |
4403 | @@ -3877,9 +4014,7 @@ |
4404 | } |
4405 | |
4406 | if ($deprecated_desc) { |
4407 | - if (exists $Deprecated{$symbol}) { |
4408 | - } |
4409 | - else { |
4410 | + if (!exists $Deprecated{$symbol}) { |
4411 | # don't warn for signals and properties |
4412 | #if ($symbol !~ m/::?(.*)/) { |
4413 | if (defined $DeclarationTypes{$symbol}) { |
4414 | @@ -3910,7 +4045,7 @@ |
4415 | $symbol = $1; |
4416 | #print "SECTION DOCS found in source for : '$symbol'\n"; |
4417 | $ignore_broken_returns = 1; |
4418 | - } elsif (m%^\s*([\w:-]*\w)\s*:?\s*(\([a-z ]+\)\s*)*$%) { |
4419 | + } elsif (m%^\s*([\w:-]*\w)\s*:?\s*(\([-a-z0-9_ ]+\)\s*)*$%) { |
4420 | $symbol = $1; |
4421 | #print "SYMBOL DOCS found in source for : '$symbol'\n"; |
4422 | } |
4423 | @@ -4340,14 +4475,7 @@ |
4424 | # Do not add <para> to nothing, it breaks missing docs checks. |
4425 | my $src_doc_para = ""; |
4426 | if ($src_doc ne "") { |
4427 | - # Expand markdown (and do paragraphs) |
4428 | - $src_doc_para = &ConvertMarkDown ($src_doc, $symbol); |
4429 | - ## fixup xml markup |
4430 | - # FIXME: this is questionable, as we can't make assumtions on the content really |
4431 | - #$src_doc_para =~ s%^<para>\n(<refsect[1-9])%$1%gms; |
4432 | - #$src_doc_para =~ s%^<para>\n<para>%<para>%gms; |
4433 | - #$src_doc_para =~ s%(</refsect[1-9]>)\n</para>$%$1%gms; |
4434 | - #print "$symbol : [$src_doc][$src_doc_para]\n"; |
4435 | + $src_doc_para = $src_doc; |
4436 | } |
4437 | |
4438 | if ($symbol =~ m/$TMPL_DIR\/.+:Long_Description/) { |
4439 | @@ -4526,109 +4654,742 @@ |
4440 | return 0; |
4441 | } |
4442 | |
4443 | - |
4444 | ############################################################################# |
4445 | # Function : ConvertMarkDown |
4446 | -# Description : Converts mark down syntax to the respective docbook, but only |
4447 | -# outside CDATA and <programlisting> tags. |
4448 | +# Description : Converts mark down syntax to the respective docbook. |
4449 | # http://de.wikipedia.org/wiki/Markdown |
4450 | -# Code snippets have been takesn from |
4451 | -# http://daringfireball.net/projects/markdown/ |
4452 | -# Copyright (c) 2004 John Gruber |
4453 | -# Arguments : the doc-string, the symbol name |
4454 | +# Inspired by the design of ParseDown |
4455 | +# http://parsedown.org/ |
4456 | +# Copyright (c) 2013 Emanuil Rusev, erusev.com |
4457 | +# Arguments : the symbol name, the doc-string |
4458 | ############################################################################# |
4459 | -my $md_in_refsect2; |
4460 | + |
4461 | sub ConvertMarkDown { |
4462 | - my ($text, $symbol) = @_; |
4463 | - |
4464 | - # reset state |
4465 | - $md_in_refsect2=0; |
4466 | - |
4467 | - # convert |
4468 | - $text = &ModifyXMLElements ($text, $symbol, |
4469 | - "<!\\[CDATA\\[|<programlisting[^>]*>|\\|\\[", |
4470 | - \&ConvertMarkDownEndTag, |
4471 | - \&ConvertMarkDownCallback); |
4472 | - # encapsulate and terminate |
4473 | - $text = "<para>\n$text\n</para>"; |
4474 | - if ($md_in_refsect2==1) { |
4475 | - $text = "$text</refsect2>" |
4476 | - } |
4477 | + my ($symbol, $text) = @_; |
4478 | + |
4479 | + $text = &MarkDownParse ($text, $symbol); |
4480 | + |
4481 | return $text |
4482 | } |
4483 | |
4484 | -sub ConvertMarkDownEndTag { |
4485 | - if ($_[0] eq "<!\[CDATA\[") { |
4486 | - return "]]>"; |
4487 | - } elsif ($_[0] eq "|[") { |
4488 | - return "]\\|"; |
4489 | - } else { |
4490 | - return "</programlisting>"; |
4491 | - } |
4492 | -} |
4493 | - |
4494 | -sub ConvertMarkDownCallback { |
4495 | - my ($text, $symbol, $tag) = @_; |
4496 | - |
4497 | - # If we're not in CDATA or a <programlisting> we convert blank lines so |
4498 | - # they start a new <para>. |
4499 | - if ($tag eq "") { |
4500 | - my $end_of_para=""; |
4501 | - my $end_of_section=""; |
4502 | - my $have_list=0; |
4503 | - |
4504 | - $end_of_para = "$end_of_para</para>"; |
4505 | - $end_of_section = "$end_of_section</para>"; |
4506 | - if ($md_in_refsect2==1) { |
4507 | - $end_of_section= "$end_of_section</refsect2>"; |
4508 | - } |
4509 | - |
4510 | - # TODO(ensonic): it would be nice to add id parameters to the refsect2 elements |
4511 | - |
4512 | - # Setext-style headers: |
4513 | - # Header 1 |
4514 | - # ======== |
4515 | - # |
4516 | - # Header 2 |
4517 | - # -------- |
4518 | - # |
4519 | - if($text =~ s%^\n(.+)[ \t]*\n=+[ \t]*\n\n%$end_of_section<refsect2><title>$1</title><para>\n%gm) { |
4520 | - $md_in_refsect2=1; |
4521 | - } |
4522 | - |
4523 | - # atx-style headers: |
4524 | - # # Header 1 |
4525 | - # ## Header 2 |
4526 | - # ## Header 2 with closing hashes ## |
4527 | - # ... |
4528 | - # ###### Header 6 |
4529 | - # |
4530 | - if($text =~ s%^\n\#[ \t]*(.+?)[ \t]*\#\n+%$end_of_section<refsect2><title>$1</title><para>\n%gm) { |
4531 | - $md_in_refsect2=1; |
4532 | - } |
4533 | - |
4534 | - # Simple (unnested) lists: |
4535 | - # Please select: |
4536 | - # - item 1 |
4537 | - # - item 2 with loooong |
4538 | - # description |
4539 | - # - item 3 |
4540 | - # |
4541 | - # New paragraph. |
4542 | - $text.="\n"; # we need a new line to avoid too complicated matching rules below |
4543 | - if ($text =~ s%(?<=\n)-\s+(.+?)(?=(?:\n-\s+)|(?:\n\n)|(?:\n$))%<listitem><para>$1</para></listitem>%gs) { |
4544 | - $text =~ s%(?<!</listitem>)(\n<listitem>)%\n<itemizedlist>$1%g; |
4545 | - $text =~ s%(</listitem>\n)(?!<listitem>)%$1</itemizedlist>\n%g; |
4546 | - } |
4547 | - chomp $text; |
4548 | - |
4549 | - # Make Paragraphs on blank lines |
4550 | - $text =~ s%\n{2,}%\n$end_of_para\n<para>\n%g; |
4551 | - } |
4552 | - |
4553 | - return $text; |
4554 | -} |
4555 | - |
4556 | +# SUPPORTED MARKDOWN |
4557 | +# ================== |
4558 | +# |
4559 | +# Atx-style Headers |
4560 | +# ----------------- |
4561 | +# |
4562 | +# # Header 1 |
4563 | +# |
4564 | +# ## Header 2 ## |
4565 | +# |
4566 | +# Setext-style Headers |
4567 | +# -------------------- |
4568 | +# |
4569 | +# Header 1 |
4570 | +# ======== |
4571 | +# |
4572 | +# Header 2 |
4573 | +# -------- |
4574 | +# |
4575 | +# Ordered (unnested) Lists |
4576 | +# ------------------------ |
4577 | +# |
4578 | +# 1. item 1 |
4579 | +# |
4580 | +# 1. item 2 with loooong |
4581 | +# description |
4582 | +# |
4583 | +# 3. item 3 |
4584 | +# |
4585 | +# Note: we require a blank line above the list items |
4586 | +# |
4587 | + |
4588 | +# TODO(ensonic): it would be nice to add id parameters to the refsect2 elements |
4589 | + |
4590 | +sub MarkDownParseBlocks { |
4591 | + my ($linesref, $symbol, $context) = @_; |
4592 | + my $line; |
4593 | + my @md_blocks = (); |
4594 | + my $md_block = { type => "" }; |
4595 | + |
4596 | + OUTER: foreach $line (@$linesref) { |
4597 | + my $first_char = substr ($line, 0, 1); |
4598 | + my $deindented_line; |
4599 | + |
4600 | + if ($md_block->{"type"} eq "markup") { |
4601 | + if (!$md_block->{"closed"}) { |
4602 | + if (index ($line, $md_block->{"start"}) != -1) { |
4603 | + $md_block->{"depth"}++; |
4604 | + } |
4605 | + if (index ($line, $md_block->{"end"}) != -1) { |
4606 | + if ($md_block->{"depth"} > 0) { |
4607 | + $md_block->{"depth"}--; |
4608 | + } else { |
4609 | + $md_block->{"closed"} = 1; |
4610 | + } |
4611 | + } |
4612 | + $md_block->{"text"} .= "\n" . $line; |
4613 | + next OUTER; |
4614 | + } |
4615 | + } |
4616 | + |
4617 | + $deindented_line = $line; |
4618 | + $deindented_line =~ s/^\s+//; |
4619 | + |
4620 | + if ($md_block->{"type"} eq "heading") { |
4621 | + # a heading is ended by any level less than or equal |
4622 | + if ($md_block->{"level"} == 1) { |
4623 | + if ($line =~ /^={4,}[ \t]*$/) { |
4624 | + my $text = pop $md_block->{"lines"}; |
4625 | + $md_block->{"interrupted"} = 0; |
4626 | + push @md_blocks, $md_block; |
4627 | + |
4628 | + $md_block = { type => "heading", |
4629 | + text => $text, |
4630 | + lines => [], |
4631 | + level => 1 }; |
4632 | + next OUTER; |
4633 | + } elsif ($line =~ /^[#][ \t]+(.+?)[ \t]*[#]*[ \t]*(?:{#([^}]+)})?[ \t]*$/) { |
4634 | + $md_block->{"interrupted"} = 0; |
4635 | + push @md_blocks, $md_block; |
4636 | + |
4637 | + $md_block = { type => "heading", |
4638 | + text => $1, |
4639 | + id => $2, |
4640 | + lines => [], |
4641 | + level => 1 }; |
4642 | + next OUTER; |
4643 | + } else { |
4644 | + # push lines into the block until the end is reached |
4645 | + push $md_block->{"lines"}, $line; |
4646 | + next OUTER; |
4647 | + } |
4648 | + } else { |
4649 | + if ($line =~ /^[=]{4,}[ \t]*$/) { |
4650 | + my $text = pop $md_block->{"lines"}; |
4651 | + $md_block->{"interrupted"} = 0; |
4652 | + push @md_blocks, $md_block; |
4653 | + |
4654 | + $md_block = { type => "heading", |
4655 | + text => $text, |
4656 | + lines => [], |
4657 | + level => 1 }; |
4658 | + next OUTER; |
4659 | + } elsif ($line =~ /^[-]{4,}[ \t]*$/) { |
4660 | + my $text = pop $md_block->{"lines"}; |
4661 | + $md_block->{"interrupted"} = 0; |
4662 | + push @md_blocks, $md_block; |
4663 | + |
4664 | + $md_block = { type => "heading", |
4665 | + text => $text, |
4666 | + lines => [], |
4667 | + level => 2 }; |
4668 | + next OUTER; |
4669 | + } elsif ($line =~ /^([#]{1,2})[ \t]+(.+?)[ \t]*[#]*[ \t]*(?:{#([^}]+)})?[ \t]*$/) { |
4670 | + $md_block->{"interrupted"} = 0; |
4671 | + push @md_blocks, $md_block; |
4672 | + |
4673 | + $md_block = { type => "heading", |
4674 | + text => $2, |
4675 | + id => $3, |
4676 | + lines => [], |
4677 | + level => length($1) }; |
4678 | + next OUTER; |
4679 | + } else { |
4680 | + # push lines into the block until the end is reached |
4681 | + push $md_block->{"lines"}, $line; |
4682 | + next OUTER; |
4683 | + } |
4684 | + } |
4685 | + } elsif ($md_block->{"type"} eq "code") { |
4686 | + if ($line =~ /^[ \t]*\]\|/) { |
4687 | + push @md_blocks, $md_block; |
4688 | + $md_block = { type => "paragraph", |
4689 | + text => "", |
4690 | + lines => [] }; |
4691 | + } else { |
4692 | + push $md_block->{"lines"}, $line; |
4693 | + } |
4694 | + next OUTER; |
4695 | + } |
4696 | + |
4697 | + if ($deindented_line eq "") { |
4698 | + $md_block->{"interrupted"} = 1; |
4699 | + next; |
4700 | + } |
4701 | + |
4702 | + if ($md_block->{"type"} eq "quote") { |
4703 | + if (!$md_block->{"interrupted"}) { |
4704 | + $line =~ s/^[ ]*>[ ]?//; |
4705 | + push $md_block->{"lines"}, $line; |
4706 | + next OUTER; |
4707 | + } |
4708 | + } elsif ($md_block->{"type"} eq "li") { |
4709 | + my $marker = $md_block->{"marker"}; |
4710 | + if ($line =~ /^([ ]{0,3})($marker)[ ](.*)/) { |
4711 | + my $indentation = $1; |
4712 | + if ($md_block->{"indentation"} ne $indentation) { |
4713 | + push $md_block->{"lines"}, $line; |
4714 | + } else { |
4715 | + my $lines = $3; |
4716 | + my $ordered = $md_block->{"ordered"}; |
4717 | + $lines =~ s/^[ ]{0,4}//; |
4718 | + $md_block->{"last"} = 0; |
4719 | + push @md_blocks, $md_block; |
4720 | + $md_block = { type => "li", |
4721 | + ordered => $ordered, |
4722 | + indentation => $indentation, |
4723 | + marker => $marker, |
4724 | + first => 0, |
4725 | + last => 1, |
4726 | + lines => [ $lines ] }; |
4727 | + } |
4728 | + next OUTER; |
4729 | + } |
4730 | + |
4731 | + if ($md_block->{"interrupted"}) { |
4732 | + if ($first_char eq " ") { |
4733 | + push $md_block->{"lines"}, ""; |
4734 | + $line =~ s/^[ ]{0,4}//; |
4735 | + push $md_block->{"lines"}, $line; |
4736 | + $md_block->{"interrupted"} = 0; |
4737 | + next OUTER; |
4738 | + } |
4739 | + } else { |
4740 | + $line =~ s/^[ ]{0,4}//; |
4741 | + push $md_block->{"lines"}, $line; |
4742 | + next OUTER; |
4743 | + } |
4744 | + } |
4745 | + |
4746 | + # indentation sensitive types |
4747 | + |
4748 | + if ($line =~ /^([#]{1,2})[ \t]+(.+?)[ \t]*[#]*[ \t]*(?:{#([^}]+)})?[ \t]*$/) { |
4749 | + # atx heading (#) |
4750 | + push @md_blocks, $md_block; |
4751 | + |
4752 | + $md_block = { type => "heading", |
4753 | + text => $2, |
4754 | + id => $3, |
4755 | + lines => [], |
4756 | + level => length($1) }; |
4757 | + |
4758 | + next OUTER; |
4759 | + } elsif ($line =~ /^={4,}[ \t]*$/) { |
4760 | + # setext heading (====) |
4761 | + |
4762 | + if ($md_block->{"type"} eq "paragraph" && $md_block->{"interrupted"}) { |
4763 | + push @md_blocks, $md_block; |
4764 | + $md_block->{"type"} = "heading"; |
4765 | + $md_block->{"lines"} = []; |
4766 | + $md_block->{"level"} = 1; |
4767 | + } |
4768 | + |
4769 | + next OUTER; |
4770 | + } elsif ($line =~ /^-{4,}[ \t]*$/) { |
4771 | + # setext heading (-----) |
4772 | + |
4773 | + if ($md_block->{"type"} eq "paragraph" && $md_block->{"interrupted"}) { |
4774 | + push @md_blocks, $md_block; |
4775 | + $md_block->{"type"} = "heading"; |
4776 | + $md_block->{"lines"} = []; |
4777 | + $md_block->{"level"} = 2; |
4778 | + } |
4779 | + |
4780 | + next OUTER; |
4781 | + } elsif ($line =~ /^[ \t]*\|\[[ ]*(?:<!-- language="([^"]+?)" -->)?/) { |
4782 | + # code |
4783 | + $md_block->{"interrupted"} = 1; |
4784 | + push @md_blocks, $md_block; |
4785 | + $md_block = { type => "code", |
4786 | + language => $1, |
4787 | + lines => [] }; |
4788 | + next OUTER; |
4789 | + } |
4790 | + |
4791 | + # indentation insensitive types |
4792 | + |
4793 | + if ($line =~ /^[ ]*<!DOCTYPE/) { |
4794 | + push @md_blocks, $md_block; |
4795 | + |
4796 | + $md_block = { type => "markup", |
4797 | + text => $deindented_line, |
4798 | + start => "<", |
4799 | + end => ">", |
4800 | + closed => 0, |
4801 | + depth => 0 }; |
4802 | + |
4803 | + } elsif ($line =~ /^[ ]*<\??(\w+)[^>]*([\/\?])?[ \t]*>/) { |
4804 | + # markup, including <?xml version="1.0"?> |
4805 | + my $tag = $1; |
4806 | + my $is_self_closing = defined($2); |
4807 | + # FIXME: why do we need to skip https? here, if we generalize this to all |
4808 | + # uri schemes we get parsing errors |
4809 | + if (! $MD_TEXT_LEVEL_ELEMENTS{$tag} && $tag !~ /^https?/) { |
4810 | + push @md_blocks, $md_block; |
4811 | + |
4812 | + if ($is_self_closing) { |
4813 | + $md_block = { type => "self-closing tag", |
4814 | + text => $deindented_line }; |
4815 | + $is_self_closing = 0; |
4816 | + next OUTER; |
4817 | + } |
4818 | + |
4819 | + $md_block = { type => "markup", |
4820 | + text => $deindented_line, |
4821 | + start => "<" . $tag . ">", |
4822 | + end => "</" . $tag . ">", |
4823 | + closed => 0, |
4824 | + depth => 0 }; |
4825 | + if ($deindented_line =~ /<\/$tag>/) { |
4826 | + $md_block->{"closed"} = 1; |
4827 | + } |
4828 | + next OUTER; |
4829 | + } |
4830 | + } elsif ($line =~ /^([ ]*)[*+-][ ](.*)/) { |
4831 | + # li |
4832 | + push @md_blocks, $md_block; |
4833 | + my $lines = $2; |
4834 | + my $indentation = $1; |
4835 | + $lines =~ s/^[ ]{0,4}//; |
4836 | + $md_block = { type => "li", |
4837 | + ordered => 0, |
4838 | + indentation => $indentation, |
4839 | + marker => "[*+-]", |
4840 | + first => 1, |
4841 | + last => 1, |
4842 | + lines => [ $lines ] }; |
4843 | + next OUTER; |
4844 | + } elsif ($line =~ /^[ ]*>[ ]?(.*)/) { |
4845 | + push @md_blocks, $md_block; |
4846 | + $md_block = { type => "quote", |
4847 | + lines => [ $1 ] }; |
4848 | + next OUTER; |
4849 | + } |
4850 | + |
4851 | + # list item |
4852 | + |
4853 | + if ($line =~ /^([ ]{0,4})\d+[.][ ]+(.*)/) { |
4854 | + push @md_blocks, $md_block; |
4855 | + my $lines = $2; |
4856 | + my $indentation = $1; |
4857 | + $lines =~ s/^[ ]{0,4}//; |
4858 | + |
4859 | + $md_block = { type => "li", |
4860 | + ordered => 1, |
4861 | + indentation => $indentation, |
4862 | + marker => "\\d+[.]", |
4863 | + first => 1, |
4864 | + last => 1, |
4865 | + lines => [ $lines ] }; |
4866 | + |
4867 | + next; |
4868 | + } |
4869 | + |
4870 | + # paragraph |
4871 | + if ($md_block->{"type"} eq "paragraph") { |
4872 | + if ($md_block->{"interrupted"}) { |
4873 | + push @md_blocks, $md_block; |
4874 | + $md_block = { type => "paragraph", |
4875 | + interrupted => 0, |
4876 | + text => $line }; |
4877 | + } else { |
4878 | + $md_block->{"text"} .= "\n" . $line; |
4879 | + } |
4880 | + } else { |
4881 | + push @md_blocks, $md_block; |
4882 | + $md_block = { type => "paragraph", |
4883 | + text => $line }; |
4884 | + } |
4885 | + } |
4886 | + |
4887 | + push @md_blocks, $md_block; |
4888 | + |
4889 | + shift @md_blocks; |
4890 | + |
4891 | + return @md_blocks; |
4892 | +} |
4893 | + |
4894 | +sub MarkDownParseSpanElementsInner { |
4895 | + my ($text, $markersref) = @_; |
4896 | + my $markup = ""; |
4897 | + my %markers = map { $_ => 1 } @$markersref; |
4898 | + |
4899 | + while ($text ne "") { |
4900 | + my $closest_marker = ""; |
4901 | + my $closest_marker_index = 0; |
4902 | + my $closest_marker_position = -1; |
4903 | + my $text_marker = ""; |
4904 | + my $i = 0; |
4905 | + my $offset = 0; |
4906 | + my @markers_rest; |
4907 | + my $marker; |
4908 | + my $use; |
4909 | + |
4910 | + while ( ($marker, $use) = each %markers ) { |
4911 | + my $marker_position; |
4912 | + |
4913 | + if (!$use) { |
4914 | + next; |
4915 | + } |
4916 | + |
4917 | + $marker_position = index ($text, $marker); |
4918 | + |
4919 | + if ($marker_position < 0) { |
4920 | + $markers{$marker} = 0; |
4921 | + next; |
4922 | + } |
4923 | + |
4924 | + if ($closest_marker eq "" || $marker_position < $closest_marker_position) { |
4925 | + $closest_marker = $marker; |
4926 | + $closest_marker_index = $i; |
4927 | + $closest_marker_position = $marker_position; |
4928 | + } |
4929 | + } |
4930 | + |
4931 | + if ($closest_marker_position >= 0) { |
4932 | + $text_marker = substr ($text, $closest_marker_position); |
4933 | + } |
4934 | + |
4935 | + if ($text_marker eq "") { |
4936 | + $markup .= $text; |
4937 | + $text = ""; |
4938 | + next; # last |
4939 | + } |
4940 | + |
4941 | + $markup .= substr ($text, 0, $closest_marker_position); |
4942 | + $text = substr ($text, $closest_marker_position); |
4943 | + @markers_rest = map { $markers{$_} ? ($_ eq $closest_marker ? () : $_) : () } keys %markers; |
4944 | + |
4945 | + if ($closest_marker eq "![" || $closest_marker eq "[") { |
4946 | + my %element; |
4947 | + |
4948 | + if (index ($text, "]") && $text =~ /\[((?:[^][]|(?R))*)\]/) { |
4949 | + my $remaining_text; |
4950 | + |
4951 | + %element = ( "!" => (substr ($text, 0, 1) eq "!"), |
4952 | + "a" => $1 ); |
4953 | + |
4954 | + $offset = length ($&); |
4955 | + if ($element{"!"}) { |
4956 | + $offset++; |
4957 | + } |
4958 | + |
4959 | + $remaining_text = substr ($text, $offset); |
4960 | + if ($remaining_text =~ /^\([ ]*([^)'"]*?)(?:[ ]+['"](.+?)['"])?[ ]*\)/) { |
4961 | + $element{"»"} = $1; |
4962 | + if (defined ($2)) { |
4963 | + $element{"#"} = $2; |
4964 | + } |
4965 | + $offset += length ($&); |
4966 | + } elsif ($remaining_text =~ /^\s*\[([^\]<]*?)\]/) { |
4967 | + $element{"ref"} = $1; |
4968 | + $offset += length ($&); |
4969 | + } else { |
4970 | + undef %element; |
4971 | + } |
4972 | + } |
4973 | + |
4974 | + if (%element) { |
4975 | + if ($element{"»"}) { |
4976 | + $element{"»"} =~ s/&/&/g; |
4977 | + $element{"»"} =~ s/</</g; |
4978 | + } |
4979 | + if ($element{"!"}) { |
4980 | + $markup .= "<inlinemediaobject><imageobject><imagedata fileref=\"" . $element{"»"} . "\"></imagedata></imageobject>"; |
4981 | + |
4982 | + if (defined ($element{"a"})) { |
4983 | + $markup .= "<textobject><phrase>" . $element{"a"} . "</phrase></textobject>"; |
4984 | + } |
4985 | + |
4986 | + $markup .= "</inlinemediaobject>"; |
4987 | + } elsif ($element{"ref"}) { |
4988 | + $element{"a"} = &MarkDownParseSpanElementsInner ($element{"a"}, \@markers_rest); |
4989 | + $markup .= "<link linkend=\"" . $element{"ref"} . "\""; |
4990 | + |
4991 | + if (defined ($element{"#"})) { |
4992 | + # title attribute not supported |
4993 | + } |
4994 | + |
4995 | + $markup .= ">" . $element{"a"} . "</link>"; |
4996 | + } else { |
4997 | + $element{"a"} = &MarkDownParseSpanElementsInner ($element{"a"}, \@markers_rest); |
4998 | + $markup .= "<ulink url=\"" . $element{"»"} . "\""; |
4999 | + |
5000 | + if (defined ($element{"#"})) { |
The diff has been truncated for viewing.
Just did this myself, then I thought about checking the queue & I saw your one here. Uploaded!