1 <?xml version='
1.0'
?> <!--*- mode: xml -*-->
2 <xsl:stylesheet xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform"
5 <!-- import the chunked XSL stylesheet -->
6 <xsl:import href=
"http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl"/>
7 <xsl:include href=
"version-greater-or-equal.xsl"/>
9 <!-- change some parameters -->
10 <xsl:param name=
"toc.section.depth">2</xsl:param>
11 <xsl:param name=
"generate.toc">
18 <xsl:param name=
"default.encoding" select=
"'UTF-8'"/>
19 <xsl:param name=
"chapter.autolabel" select=
"0"/>
20 <xsl:param name=
"use.id.as.filename" select=
"1"/>
21 <xsl:param name=
"html.ext" select=
"'.html'"/>
22 <xsl:param name=
"refentry.generate.name" select=
"0"/>
23 <xsl:param name=
"refentry.generate.title" select=
"1"/>
25 <!-- use index filtering (if available) -->
26 <xsl:param name=
"index.on.role" select=
"1"/>
28 <!-- display variablelists as tables -->
29 <xsl:param name=
"variablelist.as.table" select=
"1"/>
31 <!-- this gets set on the command line ... -->
32 <xsl:param name=
"gtkdoc.version" select=
"''"/>
33 <xsl:param name=
"gtkdoc.bookname" select=
"''"/>
35 <!-- ========================================================= -->
36 <!-- template to create the index.sgml anchor index -->
38 <xsl:template match=
"book|article">
39 <xsl:variable name=
"tooldver">
40 <xsl:call-template name=
"version-greater-or-equal">
41 <xsl:with-param name=
"ver1" select=
"$VERSION" />
42 <xsl:with-param name=
"ver2">1.36</xsl:with-param>
45 <xsl:if test=
"$tooldver = 0">
46 <xsl:message terminate=
"yes">
47 FATAL-ERROR: You need the DocBook XSL Stylesheets version
1.36 or higher
48 to build the documentation.
49 Get a newer version at http://docbook.sourceforge.net/projects/xsl/
54 <!-- generate the index.sgml href index -->
55 <xsl:call-template name=
"generate.index"/>
58 <xsl:template name=
"generate.index">
59 <xsl:call-template name=
"write.text.chunk">
60 <xsl:with-param name=
"filename" select=
"'index.sgml'"/>
61 <xsl:with-param name=
"content">
62 <xsl:apply-templates select=
"//releaseinfo/ulink"
63 mode=
"generate.index.mode"/>
64 <!-- check all anchor and refentry elements -->
65 <xsl:apply-templates select=
"//anchor|//refentry|//refsect1|//refsect2|//refsynopsisdiv"
66 mode=
"generate.index.mode"/>
68 <xsl:with-param name=
"default.encoding" select=
"'UTF-8'"/>
69 <xsl:with-param name=
"chunker.output.indent" select=
"'no'"/>
73 <xsl:template match=
"*" mode=
"generate.index.mode">
74 <xsl:if test=
"not(@href) and count(@id) > 0">
75 <xsl:text><ANCHOR id=
"</xsl:text>
76 <xsl:value-of select=
"@id"/>
77 <xsl:text>" href=
"</xsl:text>
78 <xsl:if test=
"$gtkdoc.bookname">
79 <xsl:value-of select=
"$gtkdoc.bookname"/>
80 <xsl:text>/
</xsl:text>
82 <xsl:call-template name=
"href.target"/>
83 <xsl:text>"> </xsl:text>
87 <xsl:template match=
"//releaseinfo/ulink" mode=
"generate.index.mode">
88 <xsl:if test=
"@role='online-location'">
89 <xsl:text><ONLINE href=
"</xsl:text>
90 <xsl:value-of select=
"@url"/>
91 <xsl:text>"> </xsl:text>
95 <!-- ========================================================= -->
96 <!-- template to output gtkdoclink elements for the unknown targets -->
98 <xsl:template match=
"link">
100 <xsl:when test=
"id(@linkend)">
104 <GTKDOCLINK HREF=
"{@linkend}">
105 <xsl:apply-templates/>
111 <!-- ========================================================= -->
112 <!-- Below are the visual portions of the stylesheet. They provide
113 the normal gtk-doc output style. -->
115 <xsl:param name=
"shade.verbatim" select=
"0"/>
116 <xsl:param name=
"refentry.separator" select=
"0"/>
118 <xsl:template match=
"refsect2">
119 <xsl:if test=
"preceding-sibling::refsect2">
125 <xsl:template name=
"user.head.content">
126 <xsl:if test=
"$gtkdoc.version">
127 <meta name=
"generator"
128 content=
"GTK-Doc V{$gtkdoc.version} (XML mode)"/>
130 <link rel=
"stylesheet" href=
"style.css" type=
"text/css"/>
132 <!-- copied from the html.head template in the docbook stylesheets
133 we don't want links for all refentrys, thats just too much
135 <xsl:variable name=
"this" select=
"."/>
136 <xsl:for-each select=
"//part
141 |//appendix[not(parent::article)]|appendix
142 |//glossary[not(parent::article)]|glossary
143 |//index[not(parent::article)]|index">
144 <link rel=
"{local-name(.)}">
145 <xsl:attribute name=
"href">
146 <xsl:call-template name=
"href.target">
147 <xsl:with-param name=
"context" select=
"$this"/>
148 <xsl:with-param name=
"object" select=
"."/>
151 <xsl:attribute name=
"title">
152 <xsl:apply-templates select=
"." mode=
"object.title.markup.textonly"/>
158 <xsl:template name=
"user.footer.content">
162 <xsl:when test=
"$gtkdoc.version">
163 Generated by GTK-Doc V
<xsl:copy-of select=
"$gtkdoc.version" />
172 <xsl:template match=
"title" mode=
"book.titlepage.recto.mode">
173 <table class=
"navigation" id=
"top" width=
"100%"
174 cellpadding=
"2" cellspacing=
"0">
177 <p class=
"{name(.)}">
178 <xsl:value-of select=
"."/>
185 <xsl:template name=
"header.navigation">
186 <xsl:param name=
"prev" select=
"/foo"/>
187 <xsl:param name=
"next" select=
"/foo"/>
188 <xsl:variable name=
"home" select=
"/*[1]"/>
189 <xsl:variable name=
"up" select=
"parent::*"/>
190 <xsl:variable name=
"sections" select=
"./refsect1[@role]"/>
191 <xsl:variable name=
"section_id" select=
"./@id"/>
192 <xsl:variable name=
"sect_object_hierarchy" select=
"./refsect1[@role='object_hierarchy']"/>
193 <xsl:variable name=
"sect_impl_interfaces" select=
"./refsect1[@role='impl_interfaces']"/>
194 <xsl:variable name=
"sect_prerequisites" select=
"./refsect1[@role='prerequisites']"/>
195 <xsl:variable name=
"sect_derived_interfaces" select=
"./refsect1[@role='derived_interfaces']"/>
196 <xsl:variable name=
"sect_implementations" select=
"./refsect1[@role='implementations']"/>
197 <xsl:variable name=
"sect_properties" select=
"./refsect1[@role='properties']"/>
198 <xsl:variable name=
"sect_child_properties" select=
"./refsect1[@role='child_properties']"/>
199 <xsl:variable name=
"sect_style_properties" select=
"./refsect1[@role='style_properties']"/>
200 <xsl:variable name=
"sect_signal_proto" select=
"./refsect1[@role='signal_proto']"/>
201 <xsl:variable name=
"sect_desc" select=
"./refsect1[@role='desc']"/>
202 <xsl:variable name=
"sect_synopsis" select=
"./refsynopsisdiv[@role='synopsis']"/>
204 <xsl:variable name="sect_details" select="./refsect1[@id='details']"/>
205 <xsl:variable name="sect_property_details" select="./refsect1[@id='property_details']"/>
206 <xsl:variable name="sect_child_property_details" select="./refsect1[@id='child_property_details']"/>
207 <xsl:variable name="sect_style_property_details" select="./refsect1[@id='style_property_details']"/>
208 <xsl:variable name="sect_signals" select="./refsect1[@id='signals']"/>
211 <xsl:if test=
"$suppress.navigation = '0' and $home != .">
212 <table class=
"navigation" id=
"top" width=
"100%"
213 summary =
"Navigation header" cellpadding=
"2" cellspacing=
"2">
216 <xsl:when test=
"count($prev) > 0">
219 <xsl:attribute name=
"href">
220 <xsl:call-template name=
"href.target">
221 <xsl:with-param name=
"object" select=
"$prev"/>
224 <img src=
"left.png" width=
"24" height=
"24" border=
"0">
225 <xsl:attribute name=
"alt">
226 <xsl:call-template name=
"gentext">
227 <xsl:with-param name=
"key">nav-prev
</xsl:with-param>
239 <xsl:when test=
"count($up) > 0 and $up != $home">
242 <xsl:attribute name=
"href">
243 <xsl:call-template name=
"href.target">
244 <xsl:with-param name=
"object" select=
"$up"/>
247 <img src=
"up.png" width=
"24" height=
"24" border=
"0">
248 <xsl:attribute name=
"alt">
249 <xsl:call-template name=
"gentext">
250 <xsl:with-param name=
"key">nav-up
</xsl:with-param>
262 <xsl:when test=
"$home != .">
265 <xsl:attribute name=
"href">
266 <xsl:call-template name=
"href.target">
267 <xsl:with-param name=
"object" select=
"$home"/>
270 <img src=
"home.png" width=
"24" height=
"24" border=
"0">
271 <xsl:attribute name=
"alt">
272 <xsl:call-template name=
"gentext">
273 <xsl:with-param name=
"key">nav-home
</xsl:with-param>
284 <th width=
"100%" align=
"center">
285 <xsl:apply-templates select=
"$home" mode=
"object.title.markup"/>
288 <xsl:when test=
"count($next) > 0">
291 <xsl:attribute name=
"href">
292 <xsl:call-template name=
"href.target">
293 <xsl:with-param name=
"object" select=
"$next"/>
296 <img src=
"right.png" width=
"24" height=
"24" border=
"0">
297 <xsl:attribute name=
"alt">
298 <xsl:call-template name=
"gentext">
299 <xsl:with-param name=
"key">nav-next
</xsl:with-param>
311 <!--<xsl:if test="name()='refentry'"-->
312 <xsl:if test=
"count($sections) > 0">
314 <td colspan=
"5" class=
"shortcuts">
315 <xsl:if test=
"count($sect_synopsis) > 0">
316 <a href=
"#{$section_id}.synopsis" class=
"shortcut">Top
</a>
318 <xsl:if test=
"count($sect_desc) > 0">
320 <a href=
"#{$section_id}.description" class=
"shortcut">
321 <xsl:value-of select=
"./refsect1[@role='desc']/title"/>
324 <xsl:if test=
"count($sect_object_hierarchy) > 0">
326 <a href=
"#{$section_id}.object-hierarchy" class=
"shortcut">
327 <xsl:value-of select=
"./refsect1[@role='object_hierarchy']/title"/>
330 <xsl:if test=
"count($sect_impl_interfaces) > 0">
332 <a href=
"#{$section_id}.implemented-interfaces" class=
"shortcut">
333 <xsl:value-of select=
"./refsect1[@role='impl_interfaces']/title"/>
336 <xsl:if test=
"count($sect_prerequisites) > 0">
338 <a href=
"#{$section_id}.prerequisites" class=
"shortcut">
339 <xsl:value-of select=
"./refsect1[@role='prerequisites']/title"/>
342 <xsl:if test=
"count($sect_derived_interfaces) > 0">
344 <a href=
"#{$section_id}.derived-interfaces" class=
"shortcut">
345 <xsl:value-of select=
"./refsect1[@role='derived_interfaces']/title"/>
348 <xsl:if test=
"count($sect_implementations) > 0">
350 <a href=
"#{$section_id}.implementations" class=
"shortcut">
351 <xsl:value-of select=
"./refsect1[@role='implementations']/title"/>
354 <xsl:if test=
"count($sect_properties) > 0">
356 <a href=
"#{$section_id}.properties" class=
"shortcut">
357 <xsl:value-of select=
"./refsect1[@role='properties']/title"/>
360 <xsl:if test=
"count($sect_child_properties) > 0">
362 <a href=
"#{$section_id}.child-properties" class=
"shortcut">
363 <xsl:value-of select=
"./refsect1[@role='child_properties']/title"/>
366 <xsl:if test=
"count($sect_style_properties) > 0">
368 <a href=
"#{$section_id}.style-properties" class=
"shortcut">
369 <xsl:value-of select=
"./refsect1[@role='style_properties']/title"/>
372 <xsl:if test=
"count($sect_signal_proto) > 0">
374 <a href=
"#{$section_id}.signals" class=
"shortcut">
375 <xsl:value-of select=
"./refsect1[@role='signal_proto']/title"/>
379 <xsl:if test="count($sect_details) > 0">
380 <a href="#details" class="shortcut">
381 <xsl:value-of select="./refsect1[@id='details']/title"/>
385 <xsl:if test="count($sect_property_details) > 0">
386 <a href="#property_details" class="shortcut">
387 <xsl:value-of select="./refsect1[@id='property_details']/title"/>
391 <xsl:if test="count($sect_child_property_details) > 0">
392 <a href="#child_property_details" class="shortcut">
393 <xsl:value-of select="./refsect1[@id='property_child_details']/title"/>
397 <xsl:if test="count($sect_style_property_details) > 0">
398 <a href="#style_property_details" class="shortcut">
399 <xsl:value-of select="./refsect1[@id='style_property_details']/title"/>
403 <xsl:if test="count($sect_signals) > 0">
404 <a href="#signals" class="shortcut">
405 <xsl:value-of select="./refsect1[@id='signals']/title"/>
417 <xsl:template name=
"footer.navigation">
420 <!-- avoid creating multiple identical indices
421 if the stylesheets don't support filtered indices
423 <xsl:template match=
"index">
424 <xsl:variable name=
"has-filtered-index">
425 <xsl:call-template name=
"version-greater-or-equal">
426 <xsl:with-param name=
"ver1" select=
"$VERSION" />
427 <xsl:with-param name=
"ver2">1.66</xsl:with-param>
430 <xsl:if test=
"($has-filtered-index = 1) or (count(@role) = 0)">
435 <xsl:template match=
"index" mode=
"toc">
436 <xsl:variable name=
"has-filtered-index">
437 <xsl:call-template name=
"version-greater-or-equal">
438 <xsl:with-param name=
"ver1" select=
"$VERSION" />
439 <xsl:with-param name=
"ver2">1.66</xsl:with-param>
442 <xsl:if test=
"($has-filtered-index = 1) or (count(@role) = 0)">
447 <xsl:template match=
"para">
449 <xsl:when test=
"@role = 'gallery'">
450 <div class=
"container">
451 <div class=
"gallery-spacer"> </div>
452 <xsl:apply-templates mode=
"gallery.mode"/>
453 <div class=
"gallery-spacer"> </div>
462 <xsl:template match=
"link" mode=
"gallery.mode">
463 <div class=
"gallery-float">
464 <xsl:apply-templates select=
"."/>
468 <!-- add gallery handling to refnamediv template -->
469 <xsl:template match=
"refnamediv">
470 <div class=
"{name(.)}">
472 <tr><td valign=
"top">
473 <xsl:call-template name=
"anchor"/>
475 <xsl:when test=
"$refentry.generate.name != 0">
477 <xsl:call-template name=
"gentext">
478 <xsl:with-param name=
"key" select=
"'RefName'"/>
482 <xsl:when test=
"$refentry.generate.title != 0">
485 <xsl:when test=
"../refmeta/refentrytitle">
486 <xsl:apply-templates select=
"../refmeta/refentrytitle"/>
489 <xsl:apply-templates select=
"refname[1]"/>
496 <xsl:apply-templates/>
499 <td valign=
"top" align=
"right">
500 <!-- find the gallery image to use here
501 - determine the id of the enclosing refentry
502 - look for an inlinegraphic inside a link with linkend == refentryid inside a para with role == gallery
505 <xsl:variable name=
"refentryid" select=
"../@id"/>
506 <xsl:apply-templates select=
"//para[@role = 'gallery']/link[@linkend = $refentryid]/inlinegraphic"/>
512 <!-- Exterminate any trace of indexterms in the main flow -->
513 <xsl:template match=
"indexterm">
516 <!-- ==================================================================== -->
518 <xsl:template match=
"acronym">
519 <xsl:call-template name=
"generate.acronym.link"/>
522 <xsl:template name=
"generate.acronym.link">
523 <xsl:param name=
"acronym">
524 <xsl:apply-templates/>
527 We use for-each to change context to the database document because key()
528 only locates elements in the same document as the context node!
531 <xsl:param name=
"value" >
532 <xsl:value-of select=
"//glossentry/glossterm[text()=$acronym]/../glossdef/para[1]" />
535 <xsl:when test=
"$value=''">
538 In gtk-doc.xsl: For acronym (
<xsl:value-of select=
"$acronym"/>) no value found!
541 <xsl:attribute name=
"href">
542 <xsl:text>http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=
</xsl:text>
543 <xsl:value-of select=
"$acronym"/>
545 <xsl:call-template name=
"inline.charseq"/>
551 <xsl:attribute name=
"title">
552 <xsl:value-of select=
"$value"/>
554 <xsl:call-template name=
"inline.charseq"/>