1b8e80941Smrg<?xml version="1.0"?>
2b8e80941Smrg
3b8e80941Smrg<!--
4b8e80941Smrg
5b8e80941SmrgCopyright 2008 VMware, Inc.
6b8e80941SmrgAll Rights Reserved.
7b8e80941Smrg
8b8e80941SmrgPermission is hereby granted, free of charge, to any person obtaining a
9b8e80941Smrgcopy of this software and associated documentation files (the
10b8e80941Smrg"Software"), to deal in the Software without restriction, including
11b8e80941Smrgwithout limitation the rights to use, copy, modify, merge, publish,
12b8e80941Smrgdistribute, sub license, and/or sell copies of the Software, and to
13b8e80941Smrgpermit persons to whom the Software is furnished to do so, subject to
14b8e80941Smrgthe following conditions:
15b8e80941Smrg
16b8e80941SmrgThe above copyright notice and this permission notice (including the
17b8e80941Smrgnext paragraph) shall be included in all copies or substantial portions
18b8e80941Smrgof the Software.
19b8e80941Smrg
20b8e80941SmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21b8e80941SmrgOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22b8e80941SmrgMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
23b8e80941SmrgIN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
24b8e80941SmrgANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25b8e80941SmrgTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26b8e80941SmrgSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27b8e80941Smrg
28b8e80941Smrg!-->
29b8e80941Smrg
30b8e80941Smrg<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
31b8e80941Smrg
32b8e80941Smrg	<xsl:output method="html" />
33b8e80941Smrg
34b8e80941Smrg	<xsl:strip-space elements="*" />
35b8e80941Smrg
36b8e80941Smrg	<xsl:template match="/trace">
37b8e80941Smrg		<html>
38b8e80941Smrg			<head>
39b8e80941Smrg				<title>Gallium Trace</title>
40b8e80941Smrg			</head>
41b8e80941Smrg			<style>
42b8e80941Smrg				body {
43b8e80941Smrg					font-family: verdana, sans-serif;
44b8e80941Smrg					font-size: 11px;
45b8e80941Smrg					font-weight: normal;
46b8e80941Smrg					text-align : left;
47b8e80941Smrg				}
48b8e80941Smrg
49b8e80941Smrg				.fun {
50b8e80941Smrg					font-weight: bold;
51b8e80941Smrg				}
52b8e80941Smrg
53b8e80941Smrg				.var {
54b8e80941Smrg					font-style: italic;
55b8e80941Smrg				}
56b8e80941Smrg
57b8e80941Smrg				.typ {
58b8e80941Smrg					display: none;
59b8e80941Smrg				}
60b8e80941Smrg
61b8e80941Smrg				.lit {
62b8e80941Smrg					color: #0000ff;
63b8e80941Smrg				}
64b8e80941Smrg
65b8e80941Smrg				.ptr {
66b8e80941Smrg					color: #008000;
67b8e80941Smrg				}
68b8e80941Smrg			</style>
69b8e80941Smrg			<body>
70b8e80941Smrg				<ol class="calls">
71b8e80941Smrg					<xsl:apply-templates/>
72b8e80941Smrg				</ol>
73b8e80941Smrg			</body>
74b8e80941Smrg		</html>
75b8e80941Smrg	</xsl:template>
76b8e80941Smrg
77b8e80941Smrg	<xsl:template match="call">
78b8e80941Smrg		<li>
79b8e80941Smrg			<xsl:attribute name="value">
80b8e80941Smrg				<xsl:apply-templates select="@no"/>
81b8e80941Smrg			</xsl:attribute>
82b8e80941Smrg			<span class="fun">
83b8e80941Smrg				<xsl:value-of select="@class"/>
84b8e80941Smrg				<xsl:text>::</xsl:text>
85b8e80941Smrg				<xsl:value-of select="@method"/>
86b8e80941Smrg			</span>
87b8e80941Smrg			<xsl:text>(</xsl:text>
88b8e80941Smrg			<xsl:apply-templates select="arg"/>
89b8e80941Smrg			<xsl:text>)</xsl:text>
90b8e80941Smrg			<xsl:apply-templates select="ret"/>
91b8e80941Smrg		</li>
92b8e80941Smrg	</xsl:template>
93b8e80941Smrg
94b8e80941Smrg	<xsl:template match="arg|member">
95b8e80941Smrg			<xsl:apply-templates select="@name"/>
96b8e80941Smrg			<xsl:text> = </xsl:text>
97b8e80941Smrg			<xsl:apply-templates />
98b8e80941Smrg			<xsl:if test="position() != last()">
99b8e80941Smrg				<xsl:text>, </xsl:text>
100b8e80941Smrg			</xsl:if>
101b8e80941Smrg	</xsl:template>
102b8e80941Smrg
103b8e80941Smrg	<xsl:template match="ret">
104b8e80941Smrg		<xsl:text> = </xsl:text>
105b8e80941Smrg		<xsl:apply-templates />
106b8e80941Smrg	</xsl:template>
107b8e80941Smrg
108b8e80941Smrg	<xsl:template match="bool|int|uint|float|enum">
109b8e80941Smrg		<span class="lit">
110b8e80941Smrg			<xsl:value-of select="text()"/>
111b8e80941Smrg		</span>
112b8e80941Smrg	</xsl:template>
113b8e80941Smrg
114b8e80941Smrg	<xsl:template match="bytes">
115b8e80941Smrg		<span class="lit">
116b8e80941Smrg			<xsl:text>...</xsl:text>
117b8e80941Smrg		</span>
118b8e80941Smrg	</xsl:template>
119b8e80941Smrg
120b8e80941Smrg	<xsl:template match="string">
121b8e80941Smrg		<span class="lit">
122b8e80941Smrg			<xsl:text>"</xsl:text>
123b8e80941Smrg			<xsl:call-template name="break">
124b8e80941Smrg				<xsl:with-param name="text" select="text()"/>
125b8e80941Smrg			</xsl:call-template>
126b8e80941Smrg			<xsl:text>"</xsl:text>
127b8e80941Smrg		</span>
128b8e80941Smrg	</xsl:template>
129b8e80941Smrg
130b8e80941Smrg	<xsl:template match="array|struct">
131b8e80941Smrg		<xsl:text>{</xsl:text>
132b8e80941Smrg		<xsl:apply-templates />
133b8e80941Smrg		<xsl:text>}</xsl:text>
134b8e80941Smrg	</xsl:template>
135b8e80941Smrg
136b8e80941Smrg	<xsl:template match="elem">
137b8e80941Smrg		<xsl:apply-templates />
138b8e80941Smrg		<xsl:if test="position() != last()">
139b8e80941Smrg			<xsl:text>, </xsl:text>
140b8e80941Smrg		</xsl:if>
141b8e80941Smrg	</xsl:template>
142b8e80941Smrg
143b8e80941Smrg	<xsl:template match="null">
144b8e80941Smrg		<span class="ptr">
145b8e80941Smrg			<xsl:text>NULL</xsl:text>
146b8e80941Smrg		</span>
147b8e80941Smrg	</xsl:template>
148b8e80941Smrg
149b8e80941Smrg	<xsl:template match="ptr">
150b8e80941Smrg		<span class="ptr">
151b8e80941Smrg			<xsl:value-of select="text()"/>
152b8e80941Smrg		</span>
153b8e80941Smrg	</xsl:template>
154b8e80941Smrg
155b8e80941Smrg	<xsl:template match="@name">
156b8e80941Smrg		<span class="var">
157b8e80941Smrg			<xsl:value-of select="."/>
158b8e80941Smrg		</span>
159b8e80941Smrg	</xsl:template>
160b8e80941Smrg	
161b8e80941Smrg	<xsl:template name="break">
162b8e80941Smrg		<xsl:param name="text" select="."/>
163b8e80941Smrg		<xsl:choose>
164b8e80941Smrg			<xsl:when test="contains($text, '&#xa;')">
165b8e80941Smrg				<xsl:value-of select="substring-before($text, '&#xa;')"/>
166b8e80941Smrg				<br/>
167b8e80941Smrg				<xsl:call-template name="break">
168b8e80941Smrg					 <xsl:with-param name="text" select="substring-after($text, '&#xa;')"/>
169b8e80941Smrg				</xsl:call-template>
170b8e80941Smrg			</xsl:when>
171b8e80941Smrg			<xsl:otherwise>
172b8e80941Smrg				<xsl:value-of select="$text"/>
173b8e80941Smrg			</xsl:otherwise>
174b8e80941Smrg		</xsl:choose>
175b8e80941Smrg	</xsl:template>
176b8e80941Smrg
177b8e80941Smrg	<xsl:template name="replace">
178b8e80941Smrg		<xsl:param name="text"/>
179b8e80941Smrg		<xsl:param name="from"/>
180b8e80941Smrg		<xsl:param name="to"/>
181b8e80941Smrg		<xsl:choose>
182b8e80941Smrg			<xsl:when test="contains($text,$from)">
183b8e80941Smrg				<xsl:value-of select="concat(substring-before($text,$from),$to)"/>
184b8e80941Smrg				<xsl:call-template name="replace">
185b8e80941Smrg					<xsl:with-param name="text" select="substring-after($text,$from)"/>
186b8e80941Smrg					<xsl:with-param name="from" select="$from"/>
187b8e80941Smrg					<xsl:with-param name="to" select="$to"/>
188b8e80941Smrg				</xsl:call-template>
189b8e80941Smrg			</xsl:when>
190b8e80941Smrg			<xsl:otherwise>
191b8e80941Smrg				<xsl:value-of select="$text"/>
192b8e80941Smrg			</xsl:otherwise>
193b8e80941Smrg		</xsl:choose>
194b8e80941Smrg	</xsl:template>
195b8e80941Smrg
196b8e80941Smrg</xsl:transform>
197