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