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 <xsl:key name=
"acronym.key"
10 match=
"glossentry/glossterm"
12 <xsl:key name=
"gallery.key"
13 match=
"para[@role='gallery']/link"
16 <!-- change some parameters -->
17 <xsl:param name=
"toc.section.depth">2</xsl:param>
18 <xsl:param name=
"generate.toc">
25 <xsl:param name=
"default.encoding" select=
"'UTF-8'"/>
26 <xsl:param name=
"chapter.autolabel" select=
"0"/>
27 <xsl:param name=
"use.id.as.filename" select=
"1"/>
28 <xsl:param name=
"html.ext" select=
"'.html'"/>
29 <xsl:param name=
"refentry.generate.name" select=
"0"/>
30 <xsl:param name=
"refentry.generate.title" select=
"1"/>
32 <!-- use index filtering (if available) -->
33 <xsl:param name=
"index.on.role" select=
"1"/>
35 <!-- display variablelists as tables -->
36 <xsl:param name=
"variablelist.as.table" select=
"1"/>
38 <!-- this gets set on the command line ... -->
39 <xsl:param name=
"gtkdoc.version" select=
"''"/>
40 <xsl:param name=
"gtkdoc.bookname" select=
"''"/>
42 <!-- Override the typical template to prevent showing titles -->
43 <xsl:param name=
"admon.textlabel" select=
"0"/>
45 <!-- ========================================================= -->
46 <!-- template to create the index.sgml anchor index -->
48 <xsl:template match=
"book|article">
49 <xsl:variable name=
"tooldver">
50 <xsl:call-template name=
"version-greater-or-equal">
51 <xsl:with-param name=
"ver1" select=
"$VERSION" />
52 <xsl:with-param name=
"ver2">1.36</xsl:with-param>
55 <xsl:if test=
"$tooldver = 0">
56 <xsl:message terminate=
"yes">
57 FATAL-ERROR: You need the DocBook XSL Stylesheets version
1.36 or higher
58 to build the documentation.
59 Get a newer version at http://docbook.sourceforge.net/projects/xsl/
64 <!-- generate the index.sgml href index -->
65 <xsl:call-template name=
"generate.index"/>
68 <xsl:template name=
"generate.index">
69 <xsl:call-template name=
"write.text.chunk">
70 <xsl:with-param name=
"filename" select=
"'index.sgml'"/>
71 <xsl:with-param name=
"content">
72 <xsl:apply-templates select=
"//releaseinfo/ulink"
73 mode=
"generate.index.mode"/>
74 <!-- check all anchor and refentry elements -->
76 The obvious way to write this is //anchor|//refentry|etc...
77 The obvious way is slow because it causes multiple traversals
78 in libxslt. This take about half the time.
80 <xsl:apply-templates select=
"//*[name()='anchor' or name()='refentry' or name()='refsect1' or
81 name() = 'refsect2' or name()='refsynopsisdiv']"
82 mode=
"generate.index.mode"/>
84 <xsl:with-param name=
"default.encoding" select=
"'UTF-8'"/>
85 <xsl:with-param name=
"chunker.output.indent" select=
"'no'"/>
89 <xsl:template match=
"*" mode=
"generate.index.mode">
90 <xsl:if test=
"not(@href) and count(@id) > 0">
91 <xsl:text><ANCHOR id=
"</xsl:text>
92 <xsl:value-of select=
"@id"/>
93 <xsl:text>" href=
"</xsl:text>
94 <xsl:if test=
"$gtkdoc.bookname">
95 <xsl:value-of select=
"$gtkdoc.bookname"/>
96 <xsl:text>/
</xsl:text>
98 <xsl:call-template name=
"href.target"/>
99 <xsl:text>"> </xsl:text>
103 <xsl:template match=
"//releaseinfo/ulink" mode=
"generate.index.mode">
104 <xsl:if test=
"@role='online-location'">
105 <xsl:text><ONLINE href=
"</xsl:text>
106 <xsl:value-of select=
"@url"/>
107 <xsl:text>"> </xsl:text>
111 <!-- ========================================================= -->
112 <!-- template to output gtkdoclink elements for the unknown targets -->
114 <xsl:template match=
"link">
116 <xsl:when test=
"id(@linkend)">
120 <GTKDOCLINK HREF=
"{@linkend}">
121 <xsl:apply-templates/>
127 <!-- ========================================================= -->
128 <!-- Below are the visual portions of the stylesheet. They provide
129 the normal gtk-doc output style. -->
131 <xsl:param name=
"shade.verbatim" select=
"0"/>
132 <xsl:param name=
"refentry.separator" select=
"0"/>
134 <xsl:template match=
"refsect2">
135 <xsl:if test=
"preceding-sibling::refsect2">
141 <xsl:template name=
"user.head.title">
142 <xsl:variable name=
"home" select=
"/*[1]"/>
144 <xsl:apply-templates select=
"$home" mode=
"object.title.markup"/>:
<xsl:copy-of select=
"$title"/>
148 <xsl:template name=
"user.head.content">
149 <xsl:if test=
"$gtkdoc.version">
150 <meta name=
"generator"
151 content=
"GTK-Doc V{$gtkdoc.version} (XML mode)"/>
153 <link rel=
"stylesheet" href=
"style.css" type=
"text/css"/>
155 <!-- copied from the html.head template in the docbook stylesheets
156 we don't want links for all refentrys, thats just too much
158 <xsl:variable name=
"this" select=
"."/>
159 <xsl:for-each select=
"//part
164 |//appendix[not(parent::article)]|appendix
165 |//glossary[not(parent::article)]|glossary
166 |//index[not(parent::article)]|index">
167 <link rel=
"{local-name(.)}">
168 <xsl:attribute name=
"href">
169 <xsl:call-template name=
"href.target">
170 <xsl:with-param name=
"context" select=
"$this"/>
171 <xsl:with-param name=
"object" select=
"."/>
174 <xsl:attribute name=
"title">
175 <xsl:apply-templates select=
"." mode=
"object.title.markup.textonly"/>
181 <xsl:template name=
"user.footer.content">
185 <xsl:when test=
"$gtkdoc.version">
186 Generated by GTK-Doc V
<xsl:copy-of select=
"$gtkdoc.version" />
195 <xsl:template match=
"title" mode=
"book.titlepage.recto.mode">
196 <table class=
"navigation" id=
"top" width=
"100%"
197 cellpadding=
"2" cellspacing=
"0">
200 <p class=
"{name(.)}">
201 <xsl:value-of select=
"."/>
208 <xsl:template name=
"header.navigation">
209 <xsl:param name=
"prev" select=
"/foo"/>
210 <xsl:param name=
"next" select=
"/foo"/>
211 <xsl:variable name=
"home" select=
"/*[1]"/>
212 <xsl:variable name=
"up" select=
"parent::*"/>
213 <xsl:variable name=
"sections" select=
"./refsect1[@role]"/>
214 <xsl:variable name=
"section_id" select=
"./@id"/>
215 <xsl:variable name=
"sect_object_hierarchy" select=
"./refsect1[@role='object_hierarchy']"/>
216 <xsl:variable name=
"sect_impl_interfaces" select=
"./refsect1[@role='impl_interfaces']"/>
217 <xsl:variable name=
"sect_prerequisites" select=
"./refsect1[@role='prerequisites']"/>
218 <xsl:variable name=
"sect_derived_interfaces" select=
"./refsect1[@role='derived_interfaces']"/>
219 <xsl:variable name=
"sect_implementations" select=
"./refsect1[@role='implementations']"/>
220 <xsl:variable name=
"sect_properties" select=
"./refsect1[@role='properties']"/>
221 <xsl:variable name=
"sect_child_properties" select=
"./refsect1[@role='child_properties']"/>
222 <xsl:variable name=
"sect_style_properties" select=
"./refsect1[@role='style_properties']"/>
223 <xsl:variable name=
"sect_signal_proto" select=
"./refsect1[@role='signal_proto']"/>
224 <xsl:variable name=
"sect_desc" select=
"./refsect1[@role='desc']"/>
225 <xsl:variable name=
"sect_synopsis" select=
"./refsynopsisdiv[@role='synopsis']"/>
227 <xsl:variable name="sect_details" select="./refsect1[@id='details']"/>
228 <xsl:variable name="sect_property_details" select="./refsect1[@id='property_details']"/>
229 <xsl:variable name="sect_child_property_details" select="./refsect1[@id='child_property_details']"/>
230 <xsl:variable name="sect_style_property_details" select="./refsect1[@id='style_property_details']"/>
231 <xsl:variable name="sect_signals" select="./refsect1[@id='signals']"/>
234 <xsl:if test=
"$suppress.navigation = '0' and $home != .">
235 <table class=
"navigation" id=
"top" width=
"100%"
236 summary =
"Navigation header" cellpadding=
"2" cellspacing=
"5">
238 <td width=
"100%" align=
"left" class=
"shortcuts">
239 <!--<xsl:if test="name()='refentry'"-->
240 <a href=
"#" class=
"shortcut">Top
</a>
241 <xsl:if test=
"count($sections) > 0">
242 <xsl:if test=
"count($sect_desc) > 0">
243 <span id=
"nav_description">  <span class=
"dim">|
</span> 
244 <a href=
"#{$section_id}.description" class=
"shortcut">
245 <xsl:value-of select=
"./refsect1[@role='desc']/title"/>
248 <xsl:if test=
"count($sect_object_hierarchy) > 0">
249 <span id=
"nav_hierarchy">  <span class=
"dim">|
</span> 
250 <a href=
"#{$section_id}.object-hierarchy" class=
"shortcut">
251 <xsl:value-of select=
"./refsect1[@role='object_hierarchy']/title"/>
254 <xsl:if test=
"count($sect_impl_interfaces) > 0">
255 <span id=
"nav_interfaces">  <span class=
"dim">|
</span> 
256 <a href=
"#{$section_id}.implemented-interfaces" class=
"shortcut">
257 <xsl:value-of select=
"./refsect1[@role='impl_interfaces']/title"/>
260 <xsl:if test=
"count($sect_prerequisites) > 0">
261 <span id=
"nav_prerequisites">  <span class=
"dim">|
</span> 
262 <a href=
"#{$section_id}.prerequisites" class=
"shortcut">
263 <xsl:value-of select=
"./refsect1[@role='prerequisites']/title"/>
266 <xsl:if test=
"count($sect_derived_interfaces) > 0">
267 <span id=
"nav_derived_interfaces">  <span class=
"dim">|
</span> 
268 <a href=
"#{$section_id}.derived-interfaces" class=
"shortcut">
269 <xsl:value-of select=
"./refsect1[@role='derived_interfaces']/title"/>
272 <xsl:if test=
"count($sect_implementations) > 0">
273 <span id=
"nav_implementations">  <span class=
"dim">|
</span> 
274 <a href=
"#{$section_id}.implementations" class=
"shortcut">
275 <xsl:value-of select=
"./refsect1[@role='implementations']/title"/>
278 <xsl:if test=
"count($sect_properties) > 0">
279 <span id=
"nav_properties">  <span class=
"dim">|
</span> 
280 <a href=
"#{$section_id}.properties" class=
"shortcut">
281 <xsl:value-of select=
"./refsect1[@role='properties']/title"/>
284 <xsl:if test=
"count($sect_child_properties) > 0">
285 <span id=
"nav_child_properties">  <span class=
"dim">|
</span> 
286 <a href=
"#{$section_id}.child-properties" class=
"shortcut">
287 <xsl:value-of select=
"./refsect1[@role='child_properties']/title"/>
290 <xsl:if test=
"count($sect_style_properties) > 0">
291 <span id=
"nav_style_properties">  <span class=
"dim">|
</span> 
292 <a href=
"#{$section_id}.style-properties" class=
"shortcut">
293 <xsl:value-of select=
"./refsect1[@role='style_properties']/title"/>
296 <xsl:if test=
"count($sect_signal_proto) > 0">
297 <span id=
"nav_signals">  <span class=
"dim">|
</span> 
298 <a href=
"#{$section_id}.signals" class=
"shortcut">
299 <xsl:value-of select=
"./refsect1[@role='signal_proto']/title"/>
305 <xsl:when test=
"$home != .">
308 <xsl:attribute name=
"href">
309 <xsl:call-template name=
"href.target">
310 <xsl:with-param name=
"object" select=
"$home"/>
313 <img src=
"home.png" width=
"16" height=
"16" border=
"0">
314 <xsl:attribute name=
"alt">
315 <xsl:call-template name=
"gentext">
316 <xsl:with-param name=
"key">nav-home
</xsl:with-param>
328 <xsl:when test=
"count($up) > 0 and $up != $home">
331 <xsl:attribute name=
"href">
332 <xsl:call-template name=
"href.target">
333 <xsl:with-param name=
"object" select=
"$up"/>
336 <img src=
"up.png" width=
"16" height=
"16" border=
"0">
337 <xsl:attribute name=
"alt">
338 <xsl:call-template name=
"gentext">
339 <xsl:with-param name=
"key">nav-up
</xsl:with-param>
347 <td><img src=
"up-insensitive.png" width=
"16" height=
"16" border=
"0"/></td>
351 <xsl:when test=
"count($prev) > 0">
354 <xsl:attribute name=
"href">
355 <xsl:call-template name=
"href.target">
356 <xsl:with-param name=
"object" select=
"$prev"/>
359 <img src=
"left.png" width=
"16" height=
"16" border=
"0">
360 <xsl:attribute name=
"alt">
361 <xsl:call-template name=
"gentext">
362 <xsl:with-param name=
"key">nav-prev
</xsl:with-param>
370 <td><img src=
"left-insensitive.png" width=
"16" height=
"16" border=
"0"/></td>
374 <xsl:when test=
"count($next) > 0">
377 <xsl:attribute name=
"href">
378 <xsl:call-template name=
"href.target">
379 <xsl:with-param name=
"object" select=
"$next"/>
382 <img src=
"right.png" width=
"16" height=
"16" border=
"0">
383 <xsl:attribute name=
"alt">
384 <xsl:call-template name=
"gentext">
385 <xsl:with-param name=
"key">nav-next
</xsl:with-param>
393 <td><img src=
"right-insensitive.png" width=
"16" height=
"16" border=
"0"/></td>
401 <xsl:template name=
"footer.navigation">
404 <!-- avoid creating multiple identical indices
405 if the stylesheets don't support filtered indices
407 <xsl:template match=
"index">
408 <xsl:variable name=
"has-filtered-index">
409 <xsl:call-template name=
"version-greater-or-equal">
410 <xsl:with-param name=
"ver1" select=
"$VERSION" />
411 <xsl:with-param name=
"ver2">1.66</xsl:with-param>
414 <xsl:if test=
"($has-filtered-index = 1) or (count(@role) = 0)">
419 <xsl:template match=
"index" mode=
"toc">
420 <xsl:variable name=
"has-filtered-index">
421 <xsl:call-template name=
"version-greater-or-equal">
422 <xsl:with-param name=
"ver1" select=
"$VERSION" />
423 <xsl:with-param name=
"ver2">1.66</xsl:with-param>
426 <xsl:if test=
"($has-filtered-index = 1) or (count(@role) = 0)">
431 <xsl:template match=
"para">
433 <xsl:when test=
"@role = 'gallery'">
434 <div class=
"container">
435 <div class=
"gallery-spacer"> </div>
436 <xsl:apply-templates mode=
"gallery.mode"/>
437 <div class=
"gallery-spacer"> </div>
446 <xsl:template match=
"link" mode=
"gallery.mode">
447 <div class=
"gallery-float">
448 <xsl:apply-templates select=
"."/>
452 <!-- add gallery handling to refnamediv template -->
453 <xsl:template match=
"refnamediv">
454 <div class=
"{name(.)}">
456 <tr><td valign=
"top">
457 <xsl:call-template name=
"anchor"/>
459 <xsl:when test=
"$refentry.generate.name != 0">
461 <xsl:call-template name=
"gentext">
462 <xsl:with-param name=
"key" select=
"'RefName'"/>
466 <xsl:when test=
"$refentry.generate.title != 0">
469 <xsl:when test=
"../refmeta/refentrytitle">
470 <xsl:apply-templates select=
"../refmeta/refentrytitle"/>
473 <xsl:apply-templates select=
"refname[1]"/>
480 <xsl:apply-templates/>
483 <td class=
"gallery_image" valign=
"top" align=
"right">
484 <!-- find the gallery image to use here
485 - determine the id of the enclosing refentry
486 - look for an inlinegraphic inside a link with linkend == refentryid inside a para with role == gallery
489 <xsl:variable name=
"refentryid" select=
"../@id"/>
490 <xsl:apply-templates select=
"key('gallery.key', $refentryid)/inlinegraphic"/>
496 <!-- Exterminate any trace of indexterms in the main flow -->
497 <xsl:template match=
"indexterm">
500 <!-- ==================================================================== -->
502 <xsl:template match=
"acronym">
503 <xsl:call-template name=
"generate.acronym.link"/>
506 <xsl:template name=
"generate.acronym.link">
507 <xsl:param name=
"acronym">
508 <xsl:apply-templates/>
511 We use for-each to change context to the database document because key()
512 only locates elements in the same document as the context node!
515 <xsl:param name=
"value" >
516 <xsl:value-of select=
"key('acronym.key', $acronym)/../glossdef/para[1]" />
519 <xsl:when test=
"$value=''">
522 In gtk-doc.xsl: For acronym (
<xsl:value-of select=
"$acronym"/>) no value found!
525 <xsl:attribute name=
"href">
526 <xsl:text>http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=
</xsl:text>
527 <xsl:value-of select=
"$acronym"/>
529 <xsl:call-template name=
"inline.charseq"/>
535 <xsl:attribute name=
"title">
536 <xsl:value-of select=
"$value"/>
538 <xsl:call-template name=
"inline.charseq"/>