101e04c3fSmrg<?xml version="1.0"?>
201e04c3fSmrg
301e04c3fSmrg<!--
401e04c3fSmrg
501e04c3fSmrgCopyright 2008 VMware, Inc.
601e04c3fSmrgAll Rights Reserved.
701e04c3fSmrg
801e04c3fSmrgPermission is hereby granted, free of charge, to any person obtaining a
901e04c3fSmrgcopy of this software and associated documentation files (the
1001e04c3fSmrg"Software"), to deal in the Software without restriction, including
1101e04c3fSmrgwithout limitation the rights to use, copy, modify, merge, publish,
1201e04c3fSmrgdistribute, sub license, and/or sell copies of the Software, and to
1301e04c3fSmrgpermit persons to whom the Software is furnished to do so, subject to
1401e04c3fSmrgthe following conditions:
1501e04c3fSmrg
1601e04c3fSmrgThe above copyright notice and this permission notice (including the
1701e04c3fSmrgnext paragraph) shall be included in all copies or substantial portions
1801e04c3fSmrgof the Software.
1901e04c3fSmrg
2001e04c3fSmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2101e04c3fSmrgOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2201e04c3fSmrgMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
2301e04c3fSmrgIN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
2401e04c3fSmrgANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
2501e04c3fSmrgTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
2601e04c3fSmrgSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2701e04c3fSmrg
2801e04c3fSmrg!-->
2901e04c3fSmrg
3001e04c3fSmrg<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3101e04c3fSmrg
3201e04c3fSmrg	<xsl:output method="html" />
3301e04c3fSmrg
3401e04c3fSmrg	<xsl:strip-space elements="*" />
3501e04c3fSmrg
3601e04c3fSmrg	<xsl:template match="/trace">
3701e04c3fSmrg		<html>
3801e04c3fSmrg			<head>
3901e04c3fSmrg				<title>Gallium Trace</title>
4001e04c3fSmrg			</head>
4101e04c3fSmrg			<style>
4201e04c3fSmrg				body {
4301e04c3fSmrg					font-family: verdana, sans-serif;
4401e04c3fSmrg					font-size: 11px;
4501e04c3fSmrg					font-weight: normal;
4601e04c3fSmrg					text-align : left;
4701e04c3fSmrg				}
4801e04c3fSmrg
4901e04c3fSmrg				.fun {
5001e04c3fSmrg					font-weight: bold;
5101e04c3fSmrg				}
5201e04c3fSmrg
5301e04c3fSmrg				.var {
5401e04c3fSmrg					font-style: italic;
5501e04c3fSmrg				}
5601e04c3fSmrg
5701e04c3fSmrg				.typ {
5801e04c3fSmrg					display: none;
5901e04c3fSmrg				}
6001e04c3fSmrg
6101e04c3fSmrg				.lit {
6201e04c3fSmrg					color: #0000ff;
6301e04c3fSmrg				}
6401e04c3fSmrg
6501e04c3fSmrg				.ptr {
6601e04c3fSmrg					color: #008000;
6701e04c3fSmrg				}
6801e04c3fSmrg			</style>
6901e04c3fSmrg			<body>
7001e04c3fSmrg				<ol class="calls">
7101e04c3fSmrg					<xsl:apply-templates/>
7201e04c3fSmrg				</ol>
7301e04c3fSmrg			</body>
7401e04c3fSmrg		</html>
7501e04c3fSmrg	</xsl:template>
7601e04c3fSmrg
7701e04c3fSmrg	<xsl:template match="call">
7801e04c3fSmrg		<li>
7901e04c3fSmrg			<xsl:attribute name="value">
8001e04c3fSmrg				<xsl:apply-templates select="@no"/>
8101e04c3fSmrg			</xsl:attribute>
8201e04c3fSmrg			<span class="fun">
8301e04c3fSmrg				<xsl:value-of select="@class"/>
8401e04c3fSmrg				<xsl:text>::</xsl:text>
8501e04c3fSmrg				<xsl:value-of select="@method"/>
8601e04c3fSmrg			</span>
8701e04c3fSmrg			<xsl:text>(</xsl:text>
8801e04c3fSmrg			<xsl:apply-templates select="arg"/>
8901e04c3fSmrg			<xsl:text>)</xsl:text>
9001e04c3fSmrg			<xsl:apply-templates select="ret"/>
9101e04c3fSmrg		</li>
9201e04c3fSmrg	</xsl:template>
9301e04c3fSmrg
9401e04c3fSmrg	<xsl:template match="arg|member">
9501e04c3fSmrg			<xsl:apply-templates select="@name"/>
9601e04c3fSmrg			<xsl:text> = </xsl:text>
9701e04c3fSmrg			<xsl:apply-templates />
9801e04c3fSmrg			<xsl:if test="position() != last()">
9901e04c3fSmrg				<xsl:text>, </xsl:text>
10001e04c3fSmrg			</xsl:if>
10101e04c3fSmrg	</xsl:template>
10201e04c3fSmrg
10301e04c3fSmrg	<xsl:template match="ret">
10401e04c3fSmrg		<xsl:text> = </xsl:text>
10501e04c3fSmrg		<xsl:apply-templates />
10601e04c3fSmrg	</xsl:template>
10701e04c3fSmrg
10801e04c3fSmrg	<xsl:template match="bool|int|uint|float|enum">
10901e04c3fSmrg		<span class="lit">
11001e04c3fSmrg			<xsl:value-of select="text()"/>
11101e04c3fSmrg		</span>
11201e04c3fSmrg	</xsl:template>
11301e04c3fSmrg
11401e04c3fSmrg	<xsl:template match="bytes">
11501e04c3fSmrg		<span class="lit">
11601e04c3fSmrg			<xsl:text>...</xsl:text>
11701e04c3fSmrg		</span>
11801e04c3fSmrg	</xsl:template>
11901e04c3fSmrg
12001e04c3fSmrg	<xsl:template match="string">
12101e04c3fSmrg		<span class="lit">
12201e04c3fSmrg			<xsl:text>"</xsl:text>
12301e04c3fSmrg			<xsl:call-template name="break">
12401e04c3fSmrg				<xsl:with-param name="text" select="text()"/>
12501e04c3fSmrg			</xsl:call-template>
12601e04c3fSmrg			<xsl:text>"</xsl:text>
12701e04c3fSmrg		</span>
12801e04c3fSmrg	</xsl:template>
12901e04c3fSmrg
13001e04c3fSmrg	<xsl:template match="array|struct">
13101e04c3fSmrg		<xsl:text>{</xsl:text>
13201e04c3fSmrg		<xsl:apply-templates />
13301e04c3fSmrg		<xsl:text>}</xsl:text>
13401e04c3fSmrg	</xsl:template>
13501e04c3fSmrg
13601e04c3fSmrg	<xsl:template match="elem">
13701e04c3fSmrg		<xsl:apply-templates />
13801e04c3fSmrg		<xsl:if test="position() != last()">
13901e04c3fSmrg			<xsl:text>, </xsl:text>
14001e04c3fSmrg		</xsl:if>
14101e04c3fSmrg	</xsl:template>
14201e04c3fSmrg
14301e04c3fSmrg	<xsl:template match="null">
14401e04c3fSmrg		<span class="ptr">
14501e04c3fSmrg			<xsl:text>NULL</xsl:text>
14601e04c3fSmrg		</span>
14701e04c3fSmrg	</xsl:template>
14801e04c3fSmrg
14901e04c3fSmrg	<xsl:template match="ptr">
15001e04c3fSmrg		<span class="ptr">
15101e04c3fSmrg			<xsl:value-of select="text()"/>
15201e04c3fSmrg		</span>
15301e04c3fSmrg	</xsl:template>
15401e04c3fSmrg
15501e04c3fSmrg	<xsl:template match="@name">
15601e04c3fSmrg		<span class="var">
15701e04c3fSmrg			<xsl:value-of select="."/>
15801e04c3fSmrg		</span>
15901e04c3fSmrg	</xsl:template>
16001e04c3fSmrg	
16101e04c3fSmrg	<xsl:template name="break">
16201e04c3fSmrg		<xsl:param name="text" select="."/>
16301e04c3fSmrg		<xsl:choose>
16401e04c3fSmrg			<xsl:when test="contains($text, '&#xa;')">
16501e04c3fSmrg				<xsl:value-of select="substring-before($text, '&#xa;')"/>
16601e04c3fSmrg				<br/>
16701e04c3fSmrg				<xsl:call-template name="break">
16801e04c3fSmrg					 <xsl:with-param name="text" select="substring-after($text, '&#xa;')"/>
16901e04c3fSmrg				</xsl:call-template>
17001e04c3fSmrg			</xsl:when>
17101e04c3fSmrg			<xsl:otherwise>
17201e04c3fSmrg				<xsl:value-of select="$text"/>
17301e04c3fSmrg			</xsl:otherwise>
17401e04c3fSmrg		</xsl:choose>
17501e04c3fSmrg	</xsl:template>
17601e04c3fSmrg
17701e04c3fSmrg	<xsl:template name="replace">
17801e04c3fSmrg		<xsl:param name="text"/>
17901e04c3fSmrg		<xsl:param name="from"/>
18001e04c3fSmrg		<xsl:param name="to"/>
18101e04c3fSmrg		<xsl:choose>
18201e04c3fSmrg			<xsl:when test="contains($text,$from)">
18301e04c3fSmrg				<xsl:value-of select="concat(substring-before($text,$from),$to)"/>
18401e04c3fSmrg				<xsl:call-template name="replace">
18501e04c3fSmrg					<xsl:with-param name="text" select="substring-after($text,$from)"/>
18601e04c3fSmrg					<xsl:with-param name="from" select="$from"/>
18701e04c3fSmrg					<xsl:with-param name="to" select="$to"/>
18801e04c3fSmrg				</xsl:call-template>
18901e04c3fSmrg			</xsl:when>
19001e04c3fSmrg			<xsl:otherwise>
19101e04c3fSmrg				<xsl:value-of select="$text"/>
19201e04c3fSmrg			</xsl:otherwise>
19301e04c3fSmrg		</xsl:choose>
19401e04c3fSmrg	</xsl:template>
19501e04c3fSmrg
19601e04c3fSmrg</xsl:transform>
197