trace: Add missing XSL and CSS.
[mesa.git] / src / gallium / drivers / trace / trace.xsl
1 <?xml version="1.0"?>
2
3 <!--
4
5 Copyright 2008 Tungsten Graphics, Inc.
6
7 This program is free software: you can redistribute it and/or modify it
8 under the terms of the GNU Lesser General Public License as published
9 by the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>.
19
20 !-->
21
22 <xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
23
24 <xsl:output method="html" />
25
26 <xsl:strip-space elements="*" />
27
28 <xsl:template match="/trace">
29 <html>
30 <head>
31 <title>Gallium Trace</title>
32 <link rel="stylesheet" type="text/css" href="trace.css"/>
33 </head>
34 <body>
35 <ul class="calls">
36 <xsl:apply-templates/>
37 </ul>
38 </body>
39 </html>
40 </xsl:template>
41
42 <xsl:template match="call">
43 <li>
44 <span class="fun">
45 <xsl:value-of select="@class"/>
46 <xsl:text>::</xsl:text>
47 <xsl:value-of select="@method"/>
48 </span>
49 <xsl:text>(</xsl:text>
50 <ul class="args">
51 <xsl:apply-templates select="arg"/>
52 </ul>
53 <xsl:text>)</xsl:text>
54 <xsl:apply-templates select="ret"/>
55 </li>
56 </xsl:template>
57
58 <xsl:template match="arg|member">
59 <li>
60 <xsl:apply-templates select="@name"/>
61 <xsl:text> = </xsl:text>
62 <xsl:apply-templates />
63 <xsl:if test="position() != last()">
64 <xsl:text>, </xsl:text>
65 </xsl:if>
66 </li>
67 </xsl:template>
68
69 <xsl:template match="ret">
70 <xsl:text> = </xsl:text>
71 <xsl:apply-templates />
72 </xsl:template>
73
74 <xsl:template match="bool|int|uint">
75 <span class="lit">
76 <xsl:value-of select="text()"/>
77 </span>
78 </xsl:template>
79
80 <xsl:template match="string">
81 <span class="lit">
82 <xsl:text>"</xsl:text>
83 <xsl:value-of select="text()"/>
84 <xsl:text>"</xsl:text>
85 </span>
86 </xsl:template>
87
88 <xsl:template match="array|struct">
89 <xsl:text>{</xsl:text>
90 <xsl:apply-templates />
91 <xsl:text>}</xsl:text>
92 </xsl:template>
93
94 <xsl:template match="elem">
95 <li>
96 <xsl:apply-templates />
97 <xsl:if test="position() != last()">
98 <xsl:text>, </xsl:text>
99 </xsl:if>
100 </li>
101 </xsl:template>
102
103 <xsl:template match="ptr">
104 <span class="ptr">
105 <xsl:value-of select="text()"/>
106 </span>
107 </xsl:template>
108
109 <xsl:template match="@name">
110 <span class="var">
111 <xsl:value-of select="."/>
112 </span>
113 </xsl:template>
114 </xsl:transform>