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">
24 <xsl:param name=
"process.empty.source.toc">1</xsl:param>
26 <xsl:param name=
"default.encoding" select=
"'UTF-8'"/>
27 <xsl:param name=
"chapter.autolabel" select=
"0"/>
28 <xsl:param name=
"use.id.as.filename" select=
"1"/>
29 <xsl:param name=
"html.ext" select=
"'.html'"/>
30 <xsl:param name=
"refentry.generate.name" select=
"0"/>
31 <xsl:param name=
"refentry.generate.title" select=
"1"/>
33 <!-- use index filtering (if available) -->
34 <xsl:param name=
"index.on.role" select=
"1"/>
36 <!-- display variablelists as tables -->
37 <xsl:param name=
"variablelist.as.table" select=
"1"/>
39 <!-- this gets set on the command line ... -->
40 <xsl:param name=
"gtkdoc.version" select=
"''"/>
41 <xsl:param name=
"gtkdoc.bookname" select=
"''"/>
43 <!-- Override the typical template to prevent showing titles -->
44 <xsl:param name=
"admon.textlabel" select=
"0"/>
46 <!-- ========================================================= -->
47 <!-- template to create the index.sgml anchor index -->
49 <xsl:template match=
"book|article">
50 <xsl:variable name=
"tooldver">
51 <xsl:call-template name=
"version-greater-or-equal">
52 <xsl:with-param name=
"ver1" select=
"$VERSION" />
53 <xsl:with-param name=
"ver2">1.36</xsl:with-param>
56 <xsl:if test=
"$tooldver = 0">
57 <xsl:message terminate=
"yes">
58 FATAL-ERROR: You need the DocBook XSL Stylesheets version
1.36 or higher
59 to build the documentation.
60 Get a newer version at http://docbook.sourceforge.net/projects/xsl/
65 <!-- generate the index.sgml href index -->
66 <xsl:call-template name=
"generate.index"/>
69 <xsl:template name=
"generate.index">
70 <xsl:call-template name=
"write.text.chunk">
71 <xsl:with-param name=
"filename" select=
"'index.sgml'"/>
72 <xsl:with-param name=
"content">
73 <xsl:apply-templates select=
"//releaseinfo/ulink"
74 mode=
"generate.index.mode"/>
75 <!-- check all anchor and refentry elements -->
77 The obvious way to write this is //anchor|//refentry|etc...
78 The obvious way is slow because it causes multiple traversals
79 in libxslt. This take about half the time.
81 <xsl:apply-templates select=
"//*[name()='anchor' or name()='refentry' or name()='refsect1' or
82 name() = 'refsect2' or name()='refsynopsisdiv']"
83 mode=
"generate.index.mode"/>
85 <xsl:with-param name=
"default.encoding" select=
"'UTF-8'"/>
86 <xsl:with-param name=
"chunker.output.indent" select=
"'no'"/>
90 <xsl:template match=
"*" mode=
"generate.index.mode">
91 <xsl:if test=
"not(@href) and count(@id) > 0">
92 <xsl:text><ANCHOR id=
"</xsl:text>
93 <xsl:value-of select=
"@id"/>
94 <xsl:text>" href=
"</xsl:text>
95 <xsl:if test=
"$gtkdoc.bookname">
96 <xsl:value-of select=
"$gtkdoc.bookname"/>
97 <xsl:text>/
</xsl:text>
99 <xsl:call-template name=
"href.target"/>
100 <xsl:text>"> </xsl:text>
104 <xsl:template match=
"//releaseinfo/ulink" mode=
"generate.index.mode">
105 <xsl:if test=
"@role='online-location'">
106 <xsl:text><ONLINE href=
"</xsl:text>
107 <xsl:value-of select=
"@url"/>
108 <xsl:text>"> </xsl:text>
112 <!-- ========================================================= -->
113 <!-- template to output gtkdoclink elements for the unknown targets -->
115 <xsl:template match=
"link">
117 <xsl:when test=
"id(@linkend)">
121 <GTKDOCLINK HREF=
"{@linkend}">
122 <xsl:apply-templates/>
128 <!-- ========================================================= -->
129 <!-- Below are the visual portions of the stylesheet. They provide
130 the normal gtk-doc output style. -->
132 <xsl:param name=
"shade.verbatim" select=
"0"/>
133 <xsl:param name=
"refentry.separator" select=
"0"/>
135 <xsl:template match=
"refsect2">
136 <xsl:if test=
"preceding-sibling::refsect2">
142 <xsl:template name=
"user.head.title">
143 <xsl:variable name=
"home" select=
"/*[1]"/>
145 <xsl:apply-templates select=
"$home" mode=
"object.title.markup"/>:
<xsl:copy-of select=
"$title"/>
149 <xsl:template name=
"user.head.content">
150 <xsl:if test=
"$gtkdoc.version">
151 <meta name=
"generator"
152 content=
"GTK-Doc V{$gtkdoc.version} (XML mode)"/>
154 <link rel=
"stylesheet" href=
"style.css" type=
"text/css"/>
156 <!-- copied from the html.head template in the docbook stylesheets
157 we don't want links for all refentrys, thats just too much
159 <xsl:variable name=
"this" select=
"."/>
160 <xsl:for-each select=
"//part
165 |//appendix[not(parent::article)]|appendix
166 |//glossary[not(parent::article)]|glossary
167 |//index[not(parent::article)]|index">
168 <link rel=
"{local-name(.)}">
169 <xsl:attribute name=
"href">
170 <xsl:call-template name=
"href.target">
171 <xsl:with-param name=
"context" select=
"$this"/>
172 <xsl:with-param name=
"object" select=
"."/>
175 <xsl:attribute name=
"title">
176 <xsl:apply-templates select=
"." mode=
"object.title.markup.textonly"/>
182 <xsl:template name=
"user.footer.content">
186 <xsl:when test=
"$gtkdoc.version">
187 Generated by GTK-Doc V
<xsl:copy-of select=
"$gtkdoc.version" />
196 <xsl:template match=
"title" mode=
"book.titlepage.recto.mode">
197 <table class=
"navigation" id=
"top" width=
"100%"
198 cellpadding=
"2" cellspacing=
"0">
201 <p class=
"{name(.)}">
202 <xsl:value-of select=
"."/>
209 <xsl:template name=
"header.navigation">
210 <xsl:param name=
"prev" select=
"/foo"/>
211 <xsl:param name=
"next" select=
"/foo"/>
212 <xsl:variable name=
"home" select=
"/*[1]"/>
213 <xsl:variable name=
"up" select=
"parent::*"/>
214 <xsl:variable name=
"sections" select=
"./refsect1[@role]"/>
215 <xsl:variable name=
"section_id" select=
"./@id"/>
216 <xsl:variable name=
"sect_object_hierarchy" select=
"./refsect1[@role='object_hierarchy']"/>
217 <xsl:variable name=
"sect_impl_interfaces" select=
"./refsect1[@role='impl_interfaces']"/>
218 <xsl:variable name=
"sect_prerequisites" select=
"./refsect1[@role='prerequisites']"/>
219 <xsl:variable name=
"sect_derived_interfaces" select=
"./refsect1[@role='derived_interfaces']"/>
220 <xsl:variable name=
"sect_implementations" select=
"./refsect1[@role='implementations']"/>
221 <xsl:variable name=
"sect_properties" select=
"./refsect1[@role='properties']"/>
222 <xsl:variable name=
"sect_child_properties" select=
"./refsect1[@role='child_properties']"/>
223 <xsl:variable name=
"sect_style_properties" select=
"./refsect1[@role='style_properties']"/>
224 <xsl:variable name=
"sect_signal_proto" select=
"./refsect1[@role='signal_proto']"/>
225 <xsl:variable name=
"sect_desc" select=
"./refsect1[@role='desc']"/>
226 <xsl:variable name=
"sect_synopsis" select=
"./refsynopsisdiv[@role='synopsis']"/>
228 <xsl:variable name="sect_details" select="./refsect1[@id='details']"/>
229 <xsl:variable name="sect_property_details" select="./refsect1[@id='property_details']"/>
230 <xsl:variable name="sect_child_property_details" select="./refsect1[@id='child_property_details']"/>
231 <xsl:variable name="sect_style_property_details" select="./refsect1[@id='style_property_details']"/>
232 <xsl:variable name="sect_signals" select="./refsect1[@id='signals']"/>
235 <xsl:if test=
"$suppress.navigation = '0' and $home != .">
236 <table class=
"navigation" id=
"top" width=
"100%"
237 summary =
"Navigation header" cellpadding=
"2" cellspacing=
"5">
239 <td width=
"100%" align=
"left" class=
"shortcuts">
240 <!--<xsl:if test="name()='refentry'"-->
241 <a href=
"#" class=
"shortcut">Top
</a>
242 <xsl:if test=
"count($sections) > 0">
243 <xsl:if test=
"count($sect_desc) > 0">
244 <span id=
"nav_description">  <span class=
"dim">|
</span> 
245 <a href=
"#{$section_id}.description" class=
"shortcut">
246 <xsl:value-of select=
"./refsect1[@role='desc']/title"/>
249 <xsl:if test=
"count($sect_object_hierarchy) > 0">
250 <span id=
"nav_hierarchy">  <span class=
"dim">|
</span> 
251 <a href=
"#{$section_id}.object-hierarchy" class=
"shortcut">
252 <xsl:value-of select=
"./refsect1[@role='object_hierarchy']/title"/>
255 <xsl:if test=
"count($sect_impl_interfaces) > 0">
256 <span id=
"nav_interfaces">  <span class=
"dim">|
</span> 
257 <a href=
"#{$section_id}.implemented-interfaces" class=
"shortcut">
258 <xsl:value-of select=
"./refsect1[@role='impl_interfaces']/title"/>
261 <xsl:if test=
"count($sect_prerequisites) > 0">
262 <span id=
"nav_prerequisites">  <span class=
"dim">|
</span> 
263 <a href=
"#{$section_id}.prerequisites" class=
"shortcut">
264 <xsl:value-of select=
"./refsect1[@role='prerequisites']/title"/>
267 <xsl:if test=
"count($sect_derived_interfaces) > 0">
268 <span id=
"nav_derived_interfaces">  <span class=
"dim">|
</span> 
269 <a href=
"#{$section_id}.derived-interfaces" class=
"shortcut">
270 <xsl:value-of select=
"./refsect1[@role='derived_interfaces']/title"/>
273 <xsl:if test=
"count($sect_implementations) > 0">
274 <span id=
"nav_implementations">  <span class=
"dim">|
</span> 
275 <a href=
"#{$section_id}.implementations" class=
"shortcut">
276 <xsl:value-of select=
"./refsect1[@role='implementations']/title"/>
279 <xsl:if test=
"count($sect_properties) > 0">
280 <span id=
"nav_properties">  <span class=
"dim">|
</span> 
281 <a href=
"#{$section_id}.properties" class=
"shortcut">
282 <xsl:value-of select=
"./refsect1[@role='properties']/title"/>
285 <xsl:if test=
"count($sect_child_properties) > 0">
286 <span id=
"nav_child_properties">  <span class=
"dim">|
</span> 
287 <a href=
"#{$section_id}.child-properties" class=
"shortcut">
288 <xsl:value-of select=
"./refsect1[@role='child_properties']/title"/>
291 <xsl:if test=
"count($sect_style_properties) > 0">
292 <span id=
"nav_style_properties">  <span class=
"dim">|
</span> 
293 <a href=
"#{$section_id}.style-properties" class=
"shortcut">
294 <xsl:value-of select=
"./refsect1[@role='style_properties']/title"/>
297 <xsl:if test=
"count($sect_signal_proto) > 0">
298 <span id=
"nav_signals">  <span class=
"dim">|
</span> 
299 <a href=
"#{$section_id}.signals" class=
"shortcut">
300 <xsl:value-of select=
"./refsect1[@role='signal_proto']/title"/>
306 <xsl:when test=
"$home != .">
309 <xsl:attribute name=
"href">
310 <xsl:call-template name=
"href.target">
311 <xsl:with-param name=
"object" select=
"$home"/>
314 <img src=
"home.png" width=
"16" height=
"16" border=
"0">
315 <xsl:attribute name=
"alt">
316 <xsl:call-template name=
"gentext">
317 <xsl:with-param name=
"key">nav-home
</xsl:with-param>
329 <xsl:when test=
"count($up) > 0 and $up != $home">
332 <xsl:attribute name=
"href">
333 <xsl:call-template name=
"href.target">
334 <xsl:with-param name=
"object" select=
"$up"/>
337 <img src=
"up.png" width=
"16" height=
"16" border=
"0">
338 <xsl:attribute name=
"alt">
339 <xsl:call-template name=
"gentext">
340 <xsl:with-param name=
"key">nav-up
</xsl:with-param>
348 <td><img src=
"up-insensitive.png" width=
"16" height=
"16" border=
"0"/></td>
352 <xsl:when test=
"count($prev) > 0">
355 <xsl:attribute name=
"href">
356 <xsl:call-template name=
"href.target">
357 <xsl:with-param name=
"object" select=
"$prev"/>
360 <img src=
"left.png" width=
"16" height=
"16" border=
"0">
361 <xsl:attribute name=
"alt">
362 <xsl:call-template name=
"gentext">
363 <xsl:with-param name=
"key">nav-prev
</xsl:with-param>
371 <td><img src=
"left-insensitive.png" width=
"16" height=
"16" border=
"0"/></td>
375 <xsl:when test=
"count($next) > 0">
378 <xsl:attribute name=
"href">
379 <xsl:call-template name=
"href.target">
380 <xsl:with-param name=
"object" select=
"$next"/>
383 <img src=
"right.png" width=
"16" height=
"16" border=
"0">
384 <xsl:attribute name=
"alt">
385 <xsl:call-template name=
"gentext">
386 <xsl:with-param name=
"key">nav-next
</xsl:with-param>
394 <td><img src=
"right-insensitive.png" width=
"16" height=
"16" border=
"0"/></td>
402 <xsl:template name=
"footer.navigation">
405 <!-- avoid creating multiple identical indices
406 if the stylesheets don't support filtered indices
408 <xsl:template match=
"index">
409 <xsl:variable name=
"has-filtered-index">
410 <xsl:call-template name=
"version-greater-or-equal">
411 <xsl:with-param name=
"ver1" select=
"$VERSION" />
412 <xsl:with-param name=
"ver2">1.66</xsl:with-param>
415 <xsl:if test=
"($has-filtered-index = 1) or (count(@role) = 0)">
420 <xsl:template match=
"index" mode=
"toc">
421 <xsl:variable name=
"has-filtered-index">
422 <xsl:call-template name=
"version-greater-or-equal">
423 <xsl:with-param name=
"ver1" select=
"$VERSION" />
424 <xsl:with-param name=
"ver2">1.66</xsl:with-param>
427 <xsl:if test=
"($has-filtered-index = 1) or (count(@role) = 0)">
432 <xsl:template match=
"para">
434 <xsl:when test=
"@role = 'gallery'">
435 <div class=
"container">
436 <div class=
"gallery-spacer"> </div>
437 <xsl:apply-templates mode=
"gallery.mode"/>
438 <div class=
"gallery-spacer"> </div>
447 <xsl:template match=
"link" mode=
"gallery.mode">
448 <div class=
"gallery-float">
449 <xsl:apply-templates select=
"."/>
453 <!-- add gallery handling to refnamediv template -->
454 <xsl:template match=
"refnamediv">
455 <div class=
"{name(.)}">
457 <tr><td valign=
"top">
458 <xsl:call-template name=
"anchor"/>
460 <xsl:when test=
"$refentry.generate.name != 0">
462 <xsl:call-template name=
"gentext">
463 <xsl:with-param name=
"key" select=
"'RefName'"/>
467 <xsl:when test=
"$refentry.generate.title != 0">
470 <xsl:when test=
"../refmeta/refentrytitle">
471 <xsl:apply-templates select=
"../refmeta/refentrytitle"/>
474 <xsl:apply-templates select=
"refname[1]"/>
481 <xsl:apply-templates/>
484 <td class=
"gallery_image" valign=
"top" align=
"right">
485 <!-- find the gallery image to use here
486 - determine the id of the enclosing refentry
487 - look for an inlinegraphic inside a link with linkend == refentryid inside a para with role == gallery
490 <xsl:variable name=
"refentryid" select=
"../@id"/>
491 <xsl:apply-templates select=
"key('gallery.key', $refentryid)/inlinegraphic"/>
497 <!-- Exterminate any trace of indexterms in the main flow -->
498 <xsl:template match=
"indexterm">
501 <!-- ==================================================================== -->
503 <xsl:template match=
"acronym">
504 <xsl:call-template name=
"generate.acronym.link"/>
507 <xsl:template name=
"generate.acronym.link">
508 <xsl:param name=
"acronym">
509 <xsl:apply-templates/>
512 We use for-each to change context to the database document because key()
513 only locates elements in the same document as the context node!
516 <xsl:param name=
"value" >
517 <xsl:value-of select=
"key('acronym.key', $acronym)/../glossdef/para[1]" />
520 <xsl:when test=
"$value=''">
523 In gtk-doc.xsl: For acronym (
<xsl:value-of select=
"$acronym"/>) no value found!
526 <xsl:attribute name=
"href">
527 <xsl:text>http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=
</xsl:text>
528 <xsl:value-of select=
"$acronym"/>
530 <xsl:call-template name=
"inline.charseq"/>
536 <xsl:attribute name=
"title">
537 <xsl:value-of select=
"$value"/>
539 <xsl:call-template name=
"inline.charseq"/>