Add API status scripts
[reactos.git] / reactos / tools / rgenstat / web / rapistatus.xsl
1 <?xml version="1.0" ?>
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
3
4 <xsl:output method="html" indent="no"/>
5 <!-- <xsl:output method="xml"/>-->
6 <!-- Will not work: <xsl:strip-space elements="*"/> -->
7
8 <xsl:template match="/">
9 <HTML>
10 <HEAD>
11 <TITLE>
12 ReactOS API Status
13 </TITLE>
14 <SCRIPT src="rapistatus.js"></SCRIPT>
15 <LINK rel="stylesheet" type="text/css" href="rapistatus.css"></LINK>
16 </HEAD>
17 <BODY onLoad="onLoad();">
18 <P>
19 <H1>ReactOS API Status</H1>
20 </P>
21 <P>
22 <TABLE>
23 <TR>
24 <TD> <INPUT type="checkbox" ID="implemented" onClick="selectImplemented();" checked="1"/> </TD>
25 <TD> <IMG src="i.gif"/> </TD>
26 <TD> Implemented </TD>
27 <TD width="20"/>
28 </TR>
29 <TR>
30 <TD> <INPUT type="checkbox" ID="unimplemented" onClick="selectUnimplemented();" checked="1"/> </TD>
31 <TD> <IMG src="u.gif"/> </TD>
32 <TD> Unimplemented </TD>
33 <TD width="20"/>
34 </TR>
35 </TABLE>
36 </P>
37 <DIV ID="ROOT">
38 <xsl:apply-templates/>
39 </DIV>
40 <P>
41 Legend :<BR/>
42 <TABLE>
43 <TR>
44 <TD> <IMG src="c.gif"/> </TD>
45 <TD> Component </TD>
46 <TD> <IMG src="i.gif"/> </TD>
47 <TD> Implemented </TD>
48 <TD> <IMG src="sc.gif"/> </TD>
49 <TD> Complete </TD>
50 <TR>
51 </TR>
52 <TD> <IMG src="f.gif"/> </TD>
53 <TD> Function </TD>
54 <TD> <IMG src="u.gif"/> </TD>
55 <TD> Unimplemented </TD>
56 <TD></TD>
57 <TD></TD>
58 </TR>
59 </TABLE>
60
61 </P>
62 </BODY>
63 </HTML>
64 </xsl:template>
65
66
67 <!-- component -->
68 <xsl:template match="/components">
69 <xsl:apply-templates select="component">
70 <xsl:sort select="@name"/>
71 </xsl:apply-templates>
72 </xsl:template>
73
74 <xsl:template match="components/component[@implemented_total or @unimplemented_total]">
75 <DIV>
76 <xsl:call-template name="ELEMENT">
77 <xsl:with-param name="class">c</xsl:with-param>
78 </xsl:call-template>
79 <xsl:apply-templates/>
80 </DIV>
81 </xsl:template>
82
83
84 <!-- function -->
85 <xsl:template match="functions">
86 <xsl:apply-templates select="function">
87 <xsl:sort select="@name"/>
88 </xsl:apply-templates>
89 </xsl:template>
90
91 <xsl:template match="functions/function">
92 <DIV>
93 <xsl:call-template name="ELEMENT">
94 <xsl:with-param name="class">f</xsl:with-param>
95 </xsl:call-template>
96 <xsl:apply-templates/>
97 </DIV>
98 </xsl:template>
99
100
101 <!-- support templates -->
102
103 <xsl:template name="ELEMENT">
104 <xsl:param name="class"/>
105 <xsl:param name="image"/>
106 <xsl:attribute name="class">
107 <xsl:value-of select="$class"/>
108 <xsl:text>_</xsl:text>
109 </xsl:attribute>
110 <xsl:call-template name="toggle"/>
111 <xsl:choose>
112 <xsl:when test="./node() and local-name() != 'component' and @implemented = 'true'">
113 <img src="i.gif" class="i"/>
114 </xsl:when>
115 <xsl:when test="./node() and local-name() != 'component' and @implemented = 'false'">
116 <img src="u.gif" class="u"/>
117 </xsl:when>
118 <xsl:when test="./node() and local-name() = 'component' and @complete >= 100">
119 <img src="sc.gif"/>
120 </xsl:when>
121 <xsl:otherwise>
122 <img src="tb.gif" with="12" height="12"/>
123 </xsl:otherwise>
124 </xsl:choose>
125 <xsl:choose>
126 <xsl:when test="$image">
127 <img src="{$image}.gif" class="t"/>
128 </xsl:when>
129 <xsl:otherwise>
130 <img src="{$class}.gif" class="t"/>
131 </xsl:otherwise>
132 </xsl:choose>
133 <xsl:call-template name="name"/>
134 <xsl:call-template name="file"/>
135 <xsl:call-template name="status"/>
136 </xsl:template>
137
138 <xsl:template name="status">
139 <xsl:if test="@complete and @complete != 0">
140 <SPAN class="st">
141 <img src="sc.gif"/>
142 <xsl:text>: </xsl:text>
143 <xsl:value-of select="@complete"/>
144 <xsl:text>%</xsl:text>
145 </SPAN>
146 </xsl:if>
147 <xsl:if test="@implemented_total">
148 <SPAN class="st">
149 <img src="i.gif"/>: <xsl:value-of select="@implemented_total"/>
150 </SPAN>
151 </xsl:if>
152 <xsl:if test="@unimplemented_total">
153 <SPAN class="st">
154 <img src="u.gif"/>: <xsl:value-of select="@unimplemented_total"/>
155 </SPAN>
156 </xsl:if>
157 </xsl:template>
158
159 <xsl:template name="toggle">
160 <xsl:choose>
161 <xsl:when test="local-name() = 'component'">
162 <IMG src="tp.gif" class="t"/>
163 </xsl:when>
164 <xsl:otherwise>
165 <IMG src="tb.gif"/>
166 </xsl:otherwise>
167 </xsl:choose>
168 </xsl:template>
169
170 <xsl:template name="name">
171 <xsl:if test="@name">
172 <SPAN class="l"><xsl:value-of select="@name"/></SPAN>
173 </xsl:if>
174 </xsl:template>
175
176 <xsl:template name="file">
177 <xsl:if test="@file">
178 <SPAN class="h"><xsl:value-of select="@file"/></SPAN>
179 </xsl:if>
180 </xsl:template>
181
182 </xsl:stylesheet>