Add API status scripts
authorCasper Hornstrup <chorns@users.sourceforge.net>
Wed, 27 Jul 2005 20:04:48 +0000 (20:04 +0000)
committerCasper Hornstrup <chorns@users.sourceforge.net>
Wed, 27 Jul 2005 20:04:48 +0000 (20:04 +0000)
svn path=/trunk/; revision=16812

cis/ReactOS.ApiStatus/Default.build [new file with mode: 0644]
cis/ReactOS.ApiStatus/config.template.include [new file with mode: 0644]
cis/ReactOS.ApiStatus/rapistatus.xsl [new file with mode: 0755]

diff --git a/cis/ReactOS.ApiStatus/Default.build b/cis/ReactOS.ApiStatus/Default.build
new file mode 100644 (file)
index 0000000..abcc52a
--- /dev/null
@@ -0,0 +1,46 @@
+<?xml version="1.0"?>
+<!--
+   Copyright (C) 2005 Casper S. Hornstrup
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+-->
+<project name="ReactOS.ApiStatus" default="publish">
+
+       <property name="reactos.dir" value="reactos" />
+       <property name="apistatus.xsl" value="rapistatus.xsl" />
+       <property name="apistatus.xml" value="rapistatus.xml" />
+       <property name="apistatus.html" value="index.html" />
+       <include buildfile="config.include" />
+
+       <target name="publish">
+               <delete dir="${reactos.dir}" if="${directory::exists(reactos.dir)}" />
+               <exec program="svn" commandline="export -r HEAD ${source.url} ${reactos.dir}" />
+               <exec program="rgenstat" commandline="reactos\apistatus.lst ${apistatus.xml}" />
+               <style style="${apistatus.xsl}" destdir="${reactos.dir}" in="${apistatus.xml}" out="${apistatus.html}" />
+               <copy todir="${publish.dir}" overwrite="true">
+                       <fileset basedir=".">
+                               <include name="${apistatus.xml}" />
+                               <include name="${apistatus.html}" />
+                       </fileset>
+               </copy>
+               <delete>
+                       <fileset basedir=".">
+                               <include name="${apistatus.xml}" />
+                               <include name="${apistatus.html}" />
+                       </fileset>
+               </delete>
+               <delete dir="${reactos.dir}" if="${directory::exists(reactos.dir)}" />
+       </target>
+</project>
diff --git a/cis/ReactOS.ApiStatus/config.template.include b/cis/ReactOS.ApiStatus/config.template.include
new file mode 100644 (file)
index 0000000..68b56b9
--- /dev/null
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+   Copyright (C) 2005 Casper S. Hornstrup
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+-->
+<project>
+       <property name="source.url" value="svn://svn.reactos.com/trunk/reactos" />
+       <property name="publish.dir" value="C:\api" />
+</project>
diff --git a/cis/ReactOS.ApiStatus/rapistatus.xsl b/cis/ReactOS.ApiStatus/rapistatus.xsl
new file mode 100755 (executable)
index 0000000..d429ec4
--- /dev/null
@@ -0,0 +1,182 @@
+<?xml version="1.0" ?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+       <xsl:output method="html" indent="no"/>
+       <!--    <xsl:output method="xml"/>-->
+<!-- Will not work:    <xsl:strip-space elements="*"/> -->
+
+       <xsl:template match="/">
+               <HTML>
+                       <HEAD>
+                               <TITLE>
+                                       ReactOS API Status
+                               </TITLE>
+                               <SCRIPT src="rapistatus.js"></SCRIPT>
+                               <LINK rel="stylesheet" type="text/css" href="rapistatus.css"></LINK>
+                       </HEAD>
+                       <BODY onLoad="onLoad();">
+                               <P>
+                                       <H1>ReactOS API Status</H1>
+                               </P>
+                               <P>
+                                       <TABLE>
+                                               <TR>
+                                                       <TD> <INPUT type="checkbox" ID="implemented" onClick="selectImplemented();" checked="1"/> </TD>
+                                                       <TD> <IMG src="i.gif"/> </TD>
+                                                       <TD> Implemented </TD>
+                                                       <TD width="20"/>
+                                               </TR>
+                                               <TR>
+                                                       <TD> <INPUT type="checkbox" ID="unimplemented" onClick="selectUnimplemented();" checked="1"/> </TD>
+                                                       <TD> <IMG src="u.gif"/> </TD>
+                                                       <TD> Unimplemented </TD>
+                                                       <TD width="20"/>
+                                               </TR>
+                                       </TABLE>
+                               </P>
+                               <DIV ID="ROOT">
+                                       <xsl:apply-templates/>
+                               </DIV>
+                               <P>
+                                       Legend :<BR/>
+                                       <TABLE>
+                                               <TR>
+                                                       <TD> <IMG src="c.gif"/> </TD>
+                                                       <TD> Component </TD>
+                                                       <TD> <IMG src="i.gif"/> </TD>
+                                                       <TD> Implemented </TD>
+                                                       <TD> <IMG src="sc.gif"/> </TD>
+                                                       <TD> Complete </TD>
+                                               <TR>
+                                               </TR>
+                                                       <TD> <IMG src="f.gif"/> </TD>
+                                                       <TD> Function </TD>
+                                                       <TD> <IMG src="u.gif"/> </TD>
+                                                       <TD> Unimplemented </TD>
+                                                       <TD></TD>
+                                                       <TD></TD>
+                                               </TR>
+                                       </TABLE>
+
+                               </P>
+                       </BODY>
+               </HTML>
+       </xsl:template>
+
+
+       <!-- component -->
+       <xsl:template match="/components">
+               <xsl:apply-templates select="component">
+                       <xsl:sort select="@name"/>
+               </xsl:apply-templates>
+       </xsl:template>
+
+       <xsl:template match="components/component[@implemented_total or @unimplemented_total]">
+               <DIV>
+                       <xsl:call-template name="ELEMENT">
+                               <xsl:with-param name="class">c</xsl:with-param>
+                       </xsl:call-template>
+                       <xsl:apply-templates/>
+               </DIV>
+       </xsl:template>
+
+
+       <!-- function -->
+       <xsl:template match="functions">
+               <xsl:apply-templates select="function">
+                       <xsl:sort select="@name"/>
+               </xsl:apply-templates>
+       </xsl:template>
+
+       <xsl:template match="functions/function">
+               <DIV>
+                       <xsl:call-template name="ELEMENT">
+                               <xsl:with-param name="class">f</xsl:with-param>
+                       </xsl:call-template>
+                       <xsl:apply-templates/>
+               </DIV>
+       </xsl:template>
+
+
+       <!-- support templates -->
+
+       <xsl:template name="ELEMENT">
+               <xsl:param name="class"/>
+               <xsl:param name="image"/>
+                       <xsl:attribute name="class">
+                       <xsl:value-of select="$class"/>
+                       <xsl:text>_</xsl:text>
+                       </xsl:attribute>
+                       <xsl:call-template name="toggle"/>
+                       <xsl:choose>
+                               <xsl:when test="./node() and local-name() != 'component' and @implemented = 'true'">
+          <img src="i.gif" class="i"/>
+                               </xsl:when>
+                               <xsl:when test="./node() and local-name() != 'component' and @implemented = 'false'">
+          <img src="u.gif" class="u"/>
+                               </xsl:when>
+                               <xsl:when test="./node() and local-name() = 'component' and @complete >= 100">
+          <img src="sc.gif"/>
+                               </xsl:when>
+                               <xsl:otherwise>
+          <img src="tb.gif" with="12" height="12"/>
+                               </xsl:otherwise>
+                       </xsl:choose>
+                       <xsl:choose>
+                               <xsl:when test="$image">
+                                       <img src="{$image}.gif" class="t"/>
+                               </xsl:when>
+                               <xsl:otherwise>
+                                       <img src="{$class}.gif" class="t"/>
+                               </xsl:otherwise>
+                       </xsl:choose>
+                       <xsl:call-template name="name"/>
+                       <xsl:call-template name="file"/>
+                       <xsl:call-template name="status"/>
+       </xsl:template>
+
+       <xsl:template name="status">
+               <xsl:if test="@complete and @complete != 0">
+                       <SPAN class="st">
+                               <img src="sc.gif"/>
+                               <xsl:text>: </xsl:text>
+                               <xsl:value-of select="@complete"/>
+                               <xsl:text>%</xsl:text>
+                       </SPAN>
+               </xsl:if>
+               <xsl:if test="@implemented_total">
+                       <SPAN class="st">
+                               <img src="i.gif"/>: <xsl:value-of select="@implemented_total"/>
+                       </SPAN>
+               </xsl:if>
+               <xsl:if test="@unimplemented_total">
+                       <SPAN class="st">
+                               <img src="u.gif"/>: <xsl:value-of select="@unimplemented_total"/>
+                       </SPAN>
+               </xsl:if>
+       </xsl:template>
+
+       <xsl:template name="toggle">
+               <xsl:choose>
+                       <xsl:when test="local-name() = 'component'">
+                               <IMG src="tp.gif" class="t"/>
+                       </xsl:when>
+                       <xsl:otherwise>
+                       <IMG src="tb.gif"/>
+                       </xsl:otherwise>
+               </xsl:choose>
+       </xsl:template>
+
+       <xsl:template name="name">
+               <xsl:if test="@name">
+                       <SPAN class="l"><xsl:value-of select="@name"/></SPAN>
+               </xsl:if>
+       </xsl:template>
+
+       <xsl:template name="file">
+               <xsl:if test="@file">
+                       <SPAN class="h"><xsl:value-of select="@file"/></SPAN>
+               </xsl:if>
+       </xsl:template>
+
+</xsl:stylesheet>