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/chunk.xsl"/>
7 <xsl:include href=
"devhelp.xsl"/>
8 <xsl:include href=
"devhelp2.xsl"/>
9 <xsl:include href=
"version-greater-or-equal.xsl"/>
11 <!-- change some parameters -->
12 <xsl:param name=
"toc.section.depth">2</xsl:param>
13 <xsl:param name=
"generate.toc">
20 <xsl:param name=
"default.encoding" select=
"'UTF-8'"/>
21 <xsl:param name=
"chunker.output.encoding" select=
"'UTF-8'"/>
22 <xsl:param name=
"chunker.output.indent" select=
"'yes'"/>
23 <xsl:param name=
"chunker.output.doctype-public" select=
"'-//W3C//DTD HTML 4.01 Transitional//EN'"/>
24 <xsl:param name=
"chunk.fast" select=
"1"/>
25 <xsl:param name=
"chapter.autolabel" select=
"0"/>
26 <xsl:param name=
"use.id.as.filename" select=
"1"/>
27 <xsl:param name=
"html.ext" select=
"'.html'"/>
28 <xsl:param name=
"refentry.generate.name" select=
"0"/>
29 <xsl:param name=
"refentry.generate.title" select=
"1"/>
31 <!-- use index filtering (if available) -->
32 <xsl:param name=
"index.on.role" select=
"1"/>
34 <!-- display variablelists as tables -->
35 <xsl:param name=
"variablelist.as.table" select=
"1"/>
37 <!-- this gets set on the command line ... -->
38 <xsl:param name=
"gtkdoc.version" select=
"''"/>
39 <xsl:param name=
"gtkdoc.bookname" select=
"''"/>
41 <!-- ========================================================= -->
42 <!-- template to create the index.sgml anchor index -->
44 <xsl:template match=
"book|article">
45 <xsl:variable name=
"tooldver">
46 <xsl:call-template name=
"version-greater-or-equal">
47 <xsl:with-param name=
"ver1" select=
"$VERSION" />
48 <xsl:with-param name=
"ver2">1.36</xsl:with-param>
51 <xsl:if test=
"$tooldver = 0">
52 <xsl:message terminate=
"yes">
53 FATAL-ERROR: You need the DocBook XSL Stylesheets version
1.36 or higher
54 to build the documentation.
55 Get a newer version at http://docbook.sourceforge.net/projects/xsl/
60 <!-- generate the index.sgml href index -->
61 <xsl:call-template name=
"generate.index"/>
62 <xsl:call-template name=
"generate.devhelp"/>
63 <xsl:call-template name=
"generate.devhelp2"/>
66 <xsl:template name=
"generate.index">
67 <xsl:call-template name=
"write.text.chunk">
68 <xsl:with-param name=
"filename" select=
"'index.sgml'"/>
69 <xsl:with-param name=
"content">
70 <xsl:apply-templates select=
"//releaseinfo/ulink"
71 mode=
"generate.index.mode"/>
72 <!-- check all anchor and refentry elements -->
73 <xsl:apply-templates select=
"//anchor|//refentry|//refsect1|//refsect2|//refsynopsisdiv"
74 mode=
"generate.index.mode"/>
76 <xsl:with-param name=
"default.encoding" select=
"'UTF-8'"/>
77 <xsl:with-param name=
"chunker.output.indent" select=
"'no'"/>
81 <xsl:template match=
"*" mode=
"generate.index.mode">
82 <xsl:if test=
"not(@href) and count(@id) > 0">
83 <xsl:text><ANCHOR id=
"</xsl:text>
84 <xsl:value-of select=
"@id"/>
85 <xsl:text>" href=
"</xsl:text>
86 <xsl:if test=
"$gtkdoc.bookname">
87 <xsl:value-of select=
"$gtkdoc.bookname"/>
88 <xsl:text>/
</xsl:text>
90 <xsl:call-template name=
"href.target"/>
91 <xsl:text>"> </xsl:text>
95 <xsl:template match=
"//releaseinfo/ulink" mode=
"generate.index.mode">
96 <xsl:if test=
"@role='online-location'">
97 <xsl:text><ONLINE href=
"</xsl:text>
98 <xsl:value-of select=
"@url"/>
99 <xsl:text>"> </xsl:text>
103 <!-- ========================================================= -->
104 <!-- template to output gtkdoclink elements for the unknown targets -->
106 <xsl:template match=
"link">
108 <xsl:when test=
"id(@linkend)">
112 <GTKDOCLINK HREF=
"{@linkend}">
113 <xsl:apply-templates/>
119 <!-- ========================================================= -->
120 <!-- Below are the visual portions of the stylesheet. They provide
121 the normal gtk-doc output style. -->
123 <xsl:param name=
"shade.verbatim" select=
"0"/>
124 <xsl:param name=
"refentry.separator" select=
"0"/>
126 <xsl:template match=
"refsect2">
127 <xsl:if test=
"preceding-sibling::refsect2">
133 <xsl:template name=
"user.head.content">
134 <xsl:if test=
"$gtkdoc.version">
135 <meta name=
"generator"
136 content=
"GTK-Doc V{$gtkdoc.version} (XML mode)"/>
138 <link rel=
"stylesheet" href=
"style.css" type=
"text/css"/>
140 <!-- copied from the html.head template in the docbook stylesheets
141 we don't want links for all refentrys, thats just too much
143 <xsl:variable name=
"this" select=
"."/>
144 <xsl:for-each select=
"//part
149 |//appendix[not(parent::article)]|appendix
150 |//glossary[not(parent::article)]|glossary
151 |//index[not(parent::article)]|index">
152 <link rel=
"{local-name(.)}">
153 <xsl:attribute name=
"href">
154 <xsl:call-template name=
"href.target">
155 <xsl:with-param name=
"context" select=
"$this"/>
156 <xsl:with-param name=
"object" select=
"."/>
159 <xsl:attribute name=
"title">
160 <xsl:apply-templates select=
"." mode=
"object.title.markup.textonly"/>
166 <xsl:template name=
"user.footer.content">
170 <xsl:when test=
"$gtkdoc.version">
171 Generated by GTK-Doc V
<xsl:copy-of select=
"$gtkdoc.version" />
180 <xsl:template match=
"title" mode=
"book.titlepage.recto.mode">
181 <table class=
"navigation" id=
"top" width=
"100%"
182 cellpadding=
"2" cellspacing=
"0">
185 <p class=
"{name(.)}">
186 <xsl:value-of select=
"."/>
193 <xsl:template name=
"header.navigation">
194 <xsl:param name=
"prev" select=
"/foo"/>
195 <xsl:param name=
"next" select=
"/foo"/>
196 <xsl:variable name=
"home" select=
"/*[1]"/>
197 <xsl:variable name=
"up" select=
"parent::*"/>
198 <xsl:variable name=
"sections" select=
"./refsect1[@role]"/>
199 <xsl:variable name=
"section_id" select=
"./@id"/>
200 <xsl:variable name=
"sect_object_hierarchy" select=
"./refsect1[@role='object_hierarchy']"/>
201 <xsl:variable name=
"sect_impl_interfaces" select=
"./refsect1[@role='impl_interfaces']"/>
202 <xsl:variable name=
"sect_prerequisites" select=
"./refsect1[@role='prerequisites']"/>
203 <xsl:variable name=
"sect_derived_interfaces" select=
"./refsect1[@role='derived_interfaces']"/>
204 <xsl:variable name=
"sect_implementations" select=
"./refsect1[@role='implementations']"/>
205 <xsl:variable name=
"sect_properties" select=
"./refsect1[@role='properties']"/>
206 <xsl:variable name=
"sect_child_properties" select=
"./refsect1[@role='child_properties']"/>
207 <xsl:variable name=
"sect_style_properties" select=
"./refsect1[@role='style_properties']"/>
208 <xsl:variable name=
"sect_signal_proto" select=
"./refsect1[@role='signal_proto']"/>
209 <xsl:variable name=
"sect_desc" select=
"./refsect1[@role='desc']"/>
210 <xsl:variable name=
"sect_synopsis" select=
"./refsynopsisdiv[@role='synopsis']"/>
212 <xsl:variable name="sect_details" select="./refsect1[@id='details']"/>
213 <xsl:variable name="sect_property_details" select="./refsect1[@id='property_details']"/>
214 <xsl:variable name="sect_child_property_details" select="./refsect1[@id='child_property_details']"/>
215 <xsl:variable name="sect_style_property_details" select="./refsect1[@id='style_property_details']"/>
216 <xsl:variable name="sect_signals" select="./refsect1[@id='signals']"/>
219 <xsl:if test=
"$suppress.navigation = '0' and $home != .">
220 <table class=
"navigation" id=
"top" width=
"100%"
221 summary =
"Navigation header" cellpadding=
"2" cellspacing=
"2">
224 <xsl:when test=
"count($prev) > 0">
227 <xsl:attribute name=
"href">
228 <xsl:call-template name=
"href.target">
229 <xsl:with-param name=
"object" select=
"$prev"/>
232 <img src=
"left.png" width=
"24" height=
"24" border=
"0">
233 <xsl:attribute name=
"alt">
234 <xsl:call-template name=
"gentext">
235 <xsl:with-param name=
"key">nav-prev
</xsl:with-param>
247 <xsl:when test=
"count($up) > 0 and $up != $home">
250 <xsl:attribute name=
"href">
251 <xsl:call-template name=
"href.target">
252 <xsl:with-param name=
"object" select=
"$up"/>
255 <img src=
"up.png" width=
"24" height=
"24" border=
"0">
256 <xsl:attribute name=
"alt">
257 <xsl:call-template name=
"gentext">
258 <xsl:with-param name=
"key">nav-up
</xsl:with-param>
270 <xsl:when test=
"$home != .">
273 <xsl:attribute name=
"href">
274 <xsl:call-template name=
"href.target">
275 <xsl:with-param name=
"object" select=
"$home"/>
278 <img src=
"home.png" width=
"24" height=
"24" border=
"0">
279 <xsl:attribute name=
"alt">
280 <xsl:call-template name=
"gentext">
281 <xsl:with-param name=
"key">nav-home
</xsl:with-param>
292 <th width=
"100%" align=
"center">
293 <xsl:apply-templates select=
"$home" mode=
"object.title.markup"/>
296 <xsl:when test=
"count($next) > 0">
299 <xsl:attribute name=
"href">
300 <xsl:call-template name=
"href.target">
301 <xsl:with-param name=
"object" select=
"$next"/>
304 <img src=
"right.png" width=
"24" height=
"24" border=
"0">
305 <xsl:attribute name=
"alt">
306 <xsl:call-template name=
"gentext">
307 <xsl:with-param name=
"key">nav-next
</xsl:with-param>
319 <!--<xsl:if test="name()='refentry'"-->
320 <xsl:if test=
"count($sections) > 0">
322 <td colspan=
"5" class=
"shortcuts">
324 <xsl:if test=
"count($sect_synopsis) > 0">
325 <a href=
"#{$section_id}.synopsis" class=
"shortcut">Top
</a>
327 <xsl:if test=
"count($sect_desc) > 0">
329 <a href=
"#{$section_id}.description" class=
"shortcut">
330 <xsl:value-of select=
"./refsect1[@role='desc']/title"/>
333 <xsl:if test=
"count($sect_object_hierarchy) > 0">
335 <a href=
"#{$section_id}.object-hierarchy" class=
"shortcut">
336 <xsl:value-of select=
"./refsect1[@role='object_hierarchy']/title"/>
339 <xsl:if test=
"count($sect_impl_interfaces) > 0">
341 <a href=
"#{$section_id}.implemented-interfaces" class=
"shortcut">
342 <xsl:value-of select=
"./refsect1[@role='impl_interfaces']/title"/>
345 <xsl:if test=
"count($sect_prerequisites) > 0">
347 <a href=
"#{$section_id}.prerequisites" class=
"shortcut">
348 <xsl:value-of select=
"./refsect1[@role='prerequisites']/title"/>
351 <xsl:if test=
"count($sect_derived_interfaces) > 0">
353 <a href=
"#{$section_id}.derived-interfaces" class=
"shortcut">
354 <xsl:value-of select=
"./refsect1[@role='derived_interfaces']/title"/>
357 <xsl:if test=
"count($sect_implementations) > 0">
359 <a href=
"#{$section_id}.implementations" class=
"shortcut">
360 <xsl:value-of select=
"./refsect1[@role='implementations']/title"/>
363 <xsl:if test=
"count($sect_properties) > 0">
365 <a href=
"#{$section_id}.properties" class=
"shortcut">
366 <xsl:value-of select=
"./refsect1[@role='properties']/title"/>
369 <xsl:if test=
"count($sect_child_properties) > 0">
371 <a href=
"#{$section_id}.child-properties" class=
"shortcut">
372 <xsl:value-of select=
"./refsect1[@role='child_properties']/title"/>
375 <xsl:if test=
"count($sect_style_properties) > 0">
377 <a href=
"#{$section_id}.style-properties" class=
"shortcut">
378 <xsl:value-of select=
"./refsect1[@role='style_properties']/title"/>
381 <xsl:if test=
"count($sect_signal_proto) > 0">
383 <a href=
"#{$section_id}.signals" class=
"shortcut">
384 <xsl:value-of select=
"./refsect1[@role='signal_proto']/title"/>
388 <xsl:if test="count($sect_details) > 0">
389 <a href="#details" class="shortcut">
390 <xsl:value-of select="./refsect1[@id='details']/title"/>
394 <xsl:if test="count($sect_property_details) > 0">
395 <a href="#property_details" class="shortcut">
396 <xsl:value-of select="./refsect1[@id='property_details']/title"/>
400 <xsl:if test="count($sect_child_property_details) > 0">
401 <a href="#child_property_details" class="shortcut">
402 <xsl:value-of select="./refsect1[@id='property_child_details']/title"/>
406 <xsl:if test="count($sect_style_property_details) > 0">
407 <a href="#style_property_details" class="shortcut">
408 <xsl:value-of select="./refsect1[@id='style_property_details']/title"/>
412 <xsl:if test="count($sect_signals) > 0">
413 <a href="#signals" class="shortcut">
414 <xsl:value-of select="./refsect1[@id='signals']/title"/>
427 <xsl:template name=
"footer.navigation">
430 <!-- avoid creating multiple identical indices
431 if the stylesheets don't support filtered indices
433 <xsl:template match=
"index">
434 <xsl:variable name=
"has-filtered-index">
435 <xsl:call-template name=
"version-greater-or-equal">
436 <xsl:with-param name=
"ver1" select=
"$VERSION" />
437 <xsl:with-param name=
"ver2">1.66</xsl:with-param>
440 <xsl:if test=
"($has-filtered-index = 1) or (count(@role) = 0)">
445 <xsl:template match=
"index" mode=
"toc">
446 <xsl:variable name=
"has-filtered-index">
447 <xsl:call-template name=
"version-greater-or-equal">
448 <xsl:with-param name=
"ver1" select=
"$VERSION" />
449 <xsl:with-param name=
"ver2">1.66</xsl:with-param>
452 <xsl:if test=
"($has-filtered-index = 1) or (count(@role) = 0)">
457 <xsl:template match=
"para">
459 <xsl:when test=
"@role = 'gallery'">
460 <div class=
"container">
461 <div class=
"gallery-spacer"> </div>
462 <xsl:apply-templates mode=
"gallery.mode"/>
463 <div class=
"gallery-spacer"> </div>
472 <xsl:template match=
"link" mode=
"gallery.mode">
473 <div class=
"gallery-float">
474 <xsl:apply-templates select=
"."/>
478 <!-- add gallery handling to refnamediv template -->
479 <xsl:template match=
"refnamediv">
480 <div class=
"{name(.)}">
482 <tr><td valign=
"top">
483 <xsl:call-template name=
"anchor"/>
485 <xsl:when test=
"$refentry.generate.name != 0">
487 <xsl:call-template name=
"gentext">
488 <xsl:with-param name=
"key" select=
"'RefName'"/>
492 <xsl:when test=
"$refentry.generate.title != 0">
495 <xsl:when test=
"../refmeta/refentrytitle">
496 <xsl:apply-templates select=
"../refmeta/refentrytitle"/>
499 <xsl:apply-templates select=
"refname[1]"/>
506 <xsl:apply-templates/>
509 <td valign=
"top" align=
"right">
510 <!-- find the gallery image to use here
511 - determine the id of the enclosing refentry
512 - look for an inlinegraphic inside a link with linkend == refentryid inside a para with role == gallery
515 <xsl:variable name=
"refentryid" select=
"../@id"/>
516 <xsl:apply-templates select=
"//para[@role = 'gallery']/link[@linkend = $refentryid]/inlinegraphic"/>
522 <!-- Exterminate any trace of indexterms in the main flow -->
523 <xsl:template match=
"indexterm">
526 <!-- ==================================================================== -->
528 <xsl:template match=
"acronym">
529 <xsl:call-template name=
"generate.acronym.link"/>
532 <xsl:template name=
"generate.acronym.link">
533 <xsl:param name=
"acronym">
534 <xsl:apply-templates/>
537 We use for-each to change context to the database document because key()
538 only locates elements in the same document as the context node!
541 <xsl:param name=
"value" >
542 <xsl:value-of select=
"//glossentry/glossterm[text()=$acronym]/../glossdef/para[1]" />
545 <xsl:when test=
"$value=''">
548 In gtk-doc.xsl: For acronym (
<xsl:value-of select=
"$acronym"/>) no value found!
551 <xsl:attribute name=
"href">
552 <xsl:text>http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=
</xsl:text>
553 <xsl:value-of select=
"$acronym"/>
555 <xsl:call-template name=
"inline.charseq"/>
561 <xsl:attribute name=
"title">
562 <xsl:value-of select=
"$value"/>
564 <xsl:call-template name=
"inline.charseq"/>