• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!-- The following is content that used to be in the EGL XSL directives
2     now found in khronos-man.xsl. It is OpenCL formatting stuff done by
3     Miller & Mattson and is being ignored for the moment. -->
4
5    <!-- Set this param to a placeholder for the base URL of the
6         external specification document. Include the beginning of the
7         'namedest' function as well. See the script pageNumberLookup.rb
8         to see how this placeholder gets replaced by the actual spec
9         URL and target page number. This placeholder can be any string,
10         and only needs to match the same placeholder string in
11         pageNumberLookup.rb. -->
12    <!-- This isn't used by EGL at present -->
13    <xsl:param name="SpecBaseUrl">http://www.khronos.org/registry/egl/specs/eglTBD.pdf#namedest=</xsl:param>
14
15    <!-- The following template creates the link for the Specification section  -->
16    <!-- This isn't used by EGL at present -->
17    <xsl:template match="olink">
18        <xsl:text disable-output-escaping="yes">&lt;a href="</xsl:text>
19        <xsl:value-of select="$SpecBaseUrl" />
20        <xsl:value-of select="@uri" />
21        <xsl:text disable-output-escaping="yes">" target="OpenCL Spec"&gt;</xsl:text>
22        <xsl:value-of select="." />
23        <xsl:text disable-output-escaping="yes">&lt;/a&gt;</xsl:text>
24    </xsl:template>
25
26    <!-- The following enables use of ulink for regular URLs on the pages-->
27    <!-- This isn't used by EGL at present -->
28    <xsl:template match="ulink">
29        <xsl:text disable-output-escaping="yes">&lt;a href="</xsl:text>
30        <xsl:value-of select="@url" />
31        <xsl:text disable-output-escaping="yes">"&gt;</xsl:text>
32        <xsl:value-of select="." />
33        <xsl:text disable-output-escaping="yes">&lt;/a&gt;</xsl:text>
34    </xsl:template>
35
36
37    <!-- The templates gentext-refname and refnamediv are inserted here so
38         we can have the refname displayed as the H1 header on the page  -->
39    <xsl:template name="gentext-refname">
40        <xsl:param name="key" select="local-name(.)"/>
41        <xsl:param name="lang">
42            <xsl:call-template name="l10n.language"/>
43        </xsl:param>
44        <xsl:value-of select="refname"/>
45    </xsl:template>
46
47    <xsl:template match="refnamediv">
48        <div class="{name(.)}">
49            <xsl:call-template name="anchor"/>
50            <xsl:choose>
51                <xsl:when test="preceding-sibling::refnamediv">
52                    <!-- no title on secondary refnamedivs! -->
53                </xsl:when>
54                <xsl:when test="$refentry.generate.name != 0">
55                    <h1>
56                        <xsl:call-template name="gentext-refname">
57                            <xsl:with-param name="key" select="'RefName'"/>
58                        </xsl:call-template>
59                    </h1>
60                </xsl:when>
61                <xsl:when test="$refentry.generate.title != 0">
62                    <h2>
63                        <xsl:choose>
64                            <xsl:when test="../refmeta/refentrytitle">
65                                  <xsl:apply-templates select="../refmeta/refentrytitle"/>
66                            </xsl:when>
67                            <xsl:otherwise>
68                                  <xsl:apply-templates select="refname[1]"/>
69                            </xsl:otherwise>
70                        </xsl:choose>
71                    </h2>
72                </xsl:when>
73            </xsl:choose>
74            <p>
75                <xsl:apply-templates/>
76            </p>
77        </div>
78    </xsl:template>
79
80    <!-- The templates refname and refpurpose are inserted here so that we can
81    modify the layout of these values on the HTML page -->
82    <xsl:template match="refname" />
83    <xsl:template match="refpurpose">
84        <xsl:apply-templates/>
85    </xsl:template>
86
87
88    <!-- The Link template allows us to embed links in the <funcprototype>,
89         even though this is not valid DocBook markup -->
90    <xsl:template match="link" mode="ansi-tabular">
91        <xsl:apply-templates select="."/>
92    </xsl:template>
93
94    <!-- This is somewhat redundant with the following template -->
95    <xsl:template match="funcdef/replaceable">
96        <xsl:call-template name="inline.italicseq"/>
97    </xsl:template>
98
99    <!-- The following template enables the <replaceable> tag inside
100        <funcdef>, <paramdef>, and <function> to generate <em> in the HTML output -->
101    <xsl:template match="funcdef/replaceable" mode="ansi-tabular">
102        <xsl:call-template name="inline.italicseq"/>
103    </xsl:template>
104
105    <xsl:template match="paramdef/replaceable" mode="ansi-tabular">
106        <xsl:call-template name="inline.italicseq"/>
107    </xsl:template>
108
109    <xsl:template match="function/replaceable" mode="ansi-nontabular">
110        <xsl:call-template name="inline.italicseq"/>
111    </xsl:template>
112
113    <xsl:template match="refname/replaceable" mode="kr-nontabular">
114        <xsl:call-template name="inline.italicseq"/>
115    </xsl:template>
116
117    <!-- The templates funcprototype and paramdef are here so we can modify
118         the layout of the synopsis so that it is not broken into so many
119         columns in the table, control indenting, and more. -->
120
121    <!-- funcprototype: ansi, tabular -->
122
123    <xsl:template match="funcprototype" mode="ansi-tabular">
124        <table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0">
125            <xsl:if test="following-sibling::funcprototype">
126                <xsl:attribute name="style">padding-bottom: 1em</xsl:attribute>
127            </xsl:if>
128            <tr valign="bottom">
129                <td>
130                    <xsl:apply-templates select="funcdef" mode="ansi-tabular"/>
131                    <xsl:apply-templates select="(void|varargs|paramdef)[1]" mode="ansi-tabular"/>
132                </td>
133            </tr>
134            <xsl:for-each select="(void|varargs|paramdef)[position() &gt; 1]">
135                <tr valign="top">
136                    <td>&#160;</td>
137                    <xsl:apply-templates select="." mode="ansi-tabular"/>
138                </tr>
139            </xsl:for-each>
140        </table>
141    </xsl:template>
142
143    <xsl:template match="paramdef" mode="ansi-tabular">
144        <xsl:choose>
145            <xsl:when test="type and funcparams">
146                <td>
147                    <xsl:apply-templates select="type" mode="kr-tabular-funcsynopsis-mode"/>
148                    <xsl:text>&#160;</xsl:text>
149                </td>
150                <td>
151                    <xsl:apply-templates select="type/following-sibling::node()" mode="kr-tabular-funcsynopsis-mode"/>
152                </td>
153            </xsl:when>
154            <xsl:otherwise>
155                <td>
156                    <xsl:apply-templates select="parameter/preceding-sibling::node()[not(self::parameter)]" mode="ansi-tabular"/>
157                    <xsl:text>&#160;</xsl:text>
158                    <xsl:apply-templates select="parameter" mode="ansi-tabular"/>
159                    <xsl:apply-templates select="parameter/following-sibling::node()[not(self::parameter)]" mode="ansi-tabular"/>
160                    <xsl:choose>
161                        <xsl:when test="following-sibling::*">
162                            <xsl:text>, </xsl:text>
163                        </xsl:when>
164                        <xsl:otherwise>
165                            <code>)</code>
166                            <!-- OpenCL functions do not end with a semi-colon.
167                            <xsl:text>;</xsl:text> -->
168                        </xsl:otherwise>
169                    </xsl:choose>
170                </td>
171            </xsl:otherwise>
172        </xsl:choose>
173    </xsl:template>
174
175