summaryrefslogtreecommitdiffstats
path: root/src/VBox/Main/idl/xpidl_iid.xsl
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 14:19:18 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 14:19:18 +0000
commit4035b1bfb1e5843a539a8b624d21952b756974d1 (patch)
treef1e9cd5bf548cbc57ff2fddfb2b4aa9ae95587e2 /src/VBox/Main/idl/xpidl_iid.xsl
parentInitial commit. (diff)
downloadvirtualbox-upstream.tar.xz
virtualbox-upstream.zip
Adding upstream version 6.1.22-dfsg.upstream/6.1.22-dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/VBox/Main/idl/xpidl_iid.xsl')
-rw-r--r--src/VBox/Main/idl/xpidl_iid.xsl160
1 files changed, 160 insertions, 0 deletions
diff --git a/src/VBox/Main/idl/xpidl_iid.xsl b/src/VBox/Main/idl/xpidl_iid.xsl
new file mode 100644
index 00000000..76d6f68c
--- /dev/null
+++ b/src/VBox/Main/idl/xpidl_iid.xsl
@@ -0,0 +1,160 @@
+<?xml version="1.0"?>
+<!-- $Id: xpidl_iid.xsl $ -->
+
+<!--
+ * A template to generate a header file containing IIDs for XPCOM
+ * from the generic interface definition expressed in XML.
+
+ Copyright (C) 2006-2020 Oracle Corporation
+
+ This file is part of VirtualBox Open Source Edition (OSE), as
+ available from http://www.virtualbox.org. This file is free software;
+ you can redistribute it and/or modify it under the terms of the GNU
+ General Public License (GPL) as published by the Free Software
+ Foundation, in version 2 as it comes in the "COPYING" file of the
+ VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+-->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:output method="text"/>
+
+<xsl:strip-space elements="*"/>
+
+<!--
+// templates
+/////////////////////////////////////////////////////////////////////////////
+-->
+
+
+<!--
+ * not explicitly matched elements and attributes
+-->
+<xsl:template match="*"/>
+
+
+<!--
+ * header
+-->
+<xsl:template match="/idl">
+ <xsl:text>
+/*
+ * DO NOT EDIT! This is a generated file.
+ *
+ * XPCOM C definitions for VirtualBox Main API (IIDs for COM interfaces)
+ * generated from XIDL (XML interface definition).
+ *
+ * Source : src/VBox/Main/idl/VirtualBox.xidl
+ * Generator : src/VBox/Main/idl/xpidl_iid.xsl
+ */
+
+#ifndef nsID_h__
+struct nsID
+{
+ unsigned int m0;
+ unsigned short m1;
+ unsigned short m2;
+ unsigned char m3[8];
+};
+
+typedef struct nsID nsID;
+typedef struct nsID nsIID;
+typedef struct nsID nsCID;
+#endif /* nsID_h__ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+</xsl:text>
+ <xsl:apply-templates/>
+ <xsl:text>
+
+#ifdef __cplusplus
+}
+#endif
+
+</xsl:text>
+</xsl:template>
+
+
+<!--
+ * ignore all |if|s except those for XPIDL target
+-->
+<xsl:template match="if">
+ <xsl:if test="@target='xpidl'">
+ <xsl:apply-templates/>
+ </xsl:if>
+</xsl:template>
+
+
+<!--
+ * libraries
+-->
+<xsl:template match="library">
+ <xsl:apply-templates select="application/if | application/interface"/>
+ <xsl:apply-templates select="application/module"/>
+</xsl:template>
+
+
+<!--
+ * interfaces
+-->
+<xsl:template match="interface">
+ <xsl:text>const nsID IID_</xsl:text>
+ <xsl:value-of select="@name"/>
+ <xsl:text> = {&#x0A;</xsl:text>
+ <xsl:text> 0x</xsl:text><xsl:value-of select="substring(@uuid,1,8)"/>
+ <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,10,4)"/>
+ <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,15,4)"/>
+ <xsl:text>, \&#x0A; </xsl:text>
+ <xsl:text>{ 0x</xsl:text><xsl:value-of select="substring(@uuid,20,2)"/>
+ <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,22,2)"/>
+ <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,25,2)"/>
+ <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,27,2)"/>
+ <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,29,2)"/>
+ <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,31,2)"/>
+ <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,33,2)"/>
+ <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,35,2)"/>
+ <xsl:text> } \&#x0A;};&#x0A;&#x0A;</xsl:text>
+</xsl:template>
+
+
+<!--
+ * modules
+-->
+<xsl:template match="module">
+ <xsl:apply-templates select="class"/>
+</xsl:template>
+
+
+<!--
+ * co-classes
+-->
+<xsl:template match="module/class">
+ <xsl:text>const nsCID CLSID_</xsl:text>
+ <xsl:value-of select="@name"/>
+ <xsl:text> = {&#x0A;</xsl:text>
+ <xsl:text> 0x</xsl:text><xsl:value-of select="substring(@uuid,1,8)"/>
+ <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,10,4)"/>
+ <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,15,4)"/>
+ <xsl:text>, \&#x0A; </xsl:text>
+ <xsl:text>{ 0x</xsl:text><xsl:value-of select="substring(@uuid,20,2)"/>
+ <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,22,2)"/>
+ <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,25,2)"/>
+ <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,27,2)"/>
+ <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,29,2)"/>
+ <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,31,2)"/>
+ <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,33,2)"/>
+ <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,35,2)"/>
+ <xsl:text> } \&#x0A;};&#x0A;&#x0A;</xsl:text>
+</xsl:template>
+
+
+<xsl:template match="application[@uuid='ec0e78e8-fa43-43e8-ac0a-02c784c4a4fa']//module/class" />
+
+<xsl:template match="application[@uuid='ec0e78e8-fa43-43e8-ac0a-02c784c4a4fa']/if//interface
+| application[@uuid='ec0e78e8-fa43-43e8-ac0a-02c784c4a4fa']//interface" />
+
+</xsl:stylesheet>
+