VirtualBox

source: vbox/trunk/src/VBox/Installer/win/VirtualBox_TypeLib.xsl@ 80224

Last change on this file since 80224 was 76242, checked in by vboxsync, 6 years ago

Installer/win: Corrected the VirtualBox_TypeLib*.xsl script to deal with library/if/application ordering too. bugref:3300

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Revision Author Id
File size: 6.5 KB
Line 
1<?xml version="1.0"?>
2
3<!--
4 * A template to generate a WiX include file that contains
5 * type library definitions for VirtualBox COM components
6 * from the generic interface definition expressed in XML.
7
8 Copyright (C) 2007-2016 Oracle Corporation
9
10 This file is part of VirtualBox Open Source Edition (OSE), as
11 available from http://www.virtualbox.org. This file is free software;
12 you can redistribute it and/or modify it under the terms of the GNU
13 General Public License (GPL) as published by the Free Software
14 Foundation, in version 2 as it comes in the "COPYING" file of the
15 VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16 hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17-->
18
19<xsl:stylesheet version="1.0"
20 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
21
22<xsl:output method="xml"
23 version="1.0"
24 encoding="utf-8"
25 indent="yes"/>
26
27<xsl:strip-space elements="*"/>
28
29<xsl:param name="a_sTarget">all</xsl:param>
30<xsl:param name="a_sWithSDS" select="no"/>
31
32
33<!--
34// templates
35/////////////////////////////////////////////////////////////////////////////
36-->
37
38<!--
39 * header
40-->
41<xsl:template match="/idl">
42 <xsl:comment>
43/*
44 * DO NOT EDIT! This is a generated file.
45 *
46 * WiX include script for the VirtualBox Type Library
47 * generated from XIDL (XML interface definition).
48 *
49 * Source : src/VBox/Main/idl/VirtualBox.xidl
50 * Generator : src/VBox/Installer/VirtualBox_TypeLib.xsl
51 * Arguments : a_sTarget=<xsl:value-of select="$a_sTarget"/>
52 */
53 </xsl:comment>
54 <xsl:apply-templates/>
55</xsl:template>
56
57
58<!--
59 * libraries
60-->
61<xsl:template match="idl/library">
62 <Include>
63 <TypeLib>
64 <xsl:attribute name="Id"><xsl:value-of select="@uuid"/></xsl:attribute>
65 <xsl:attribute name="Advertise">yes</xsl:attribute>
66 <xsl:attribute name="MajorVersion"><xsl:value-of select="substring(@version,1,1)"/></xsl:attribute>
67 <xsl:attribute name="MinorVersion"><xsl:value-of select="substring(@version,3)"/></xsl:attribute>
68 <xsl:attribute name="Language">0</xsl:attribute>
69 <xsl:attribute name="Description"><xsl:value-of select="@name"/></xsl:attribute>
70 <xsl:attribute name="HelpDirectory"><xsl:text>msm_VBoxApplicationFolder</xsl:text></xsl:attribute>
71 <xsl:apply-templates select="application | if[@target='midl']/application"/>
72 </TypeLib>
73 </Include>
74</xsl:template>
75
76
77 <!--
78* filters to skip VBoxSDS class and interfaces if a VBOX_WITH_SDS is not defined in kmk
79-->
80 <xsl:template match="application[@uuid='ec0e78e8-fa43-43e8-ac0a-02c784c4a4fa']">
81 <xsl:if test="$a_sWithSDS='yes'" >
82 <xsl:call-template name="application_template" />
83 </xsl:if>
84 </xsl:template>
85
86 <!--
87 * applications
88 -->
89 <xsl:template match="idl/library//application" name="application_template">
90 <AppId>
91 <xsl:attribute name="Id">
92 <xsl:value-of select="@uuid"/>
93 </xsl:attribute>
94 <xsl:attribute name="Description">
95 <xsl:value-of select="@name"/> Application
96 </xsl:attribute>
97 <!--
98 The name of windows service should be defined as module name in .xidl.
99 It's viable for correct registration of COM windows service.
100 -->
101 <xsl:if test="module/@context = 'LocalService'">
102 <xsl:attribute name="LocalService" >
103 <xsl:value-of select="module/@name"/>
104 </xsl:attribute>
105 </xsl:if>
106 <xsl:choose>
107 <xsl:when test="$a_sTarget = 'VBoxClient-x86'">
108 <xsl:apply-templates select="module[@name='VBoxC']/class"/>
109 </xsl:when>
110 <xsl:otherwise>
111 <xsl:apply-templates select="module/class"/>
112 </xsl:otherwise>
113 </xsl:choose>
114 </AppId>
115 </xsl:template>
116
117
118<!--
119 * classes
120-->
121<xsl:template match="library//module/class">
122 <Class>
123 <xsl:attribute name="Id"><xsl:value-of select="@uuid"/></xsl:attribute>
124 <xsl:attribute name="Description"><xsl:value-of select="@name"/> Class</xsl:attribute>
125 <xsl:attribute name="Server"><xsl:value-of select="../@name"/></xsl:attribute>
126 <xsl:attribute name="Context">
127 <xsl:choose>
128 <xsl:when test="../@context='InprocServer'">InprocServer32</xsl:when>
129 <xsl:when test="../@context='LocalServer'" >LocalServer32</xsl:when>
130 <xsl:when test="../@context='LocalService'">LocalServer32</xsl:when>
131 <xsl:otherwise>
132 <xsl:message terminate="yes">
133 <xsl:value-of select="concat(../../@name,'::',../@name,': ')"/>
134 <xsl:text>module context </xsl:text>
135 <xsl:value-of select="concat('&quot;',../@context,'&quot;')"/>
136 <xsl:text> is invalid!</xsl:text>
137 </xsl:message>
138 </xsl:otherwise>
139 </xsl:choose>
140 </xsl:attribute>
141 <xsl:if test="../@context='InprocServer'">
142 <xsl:variable name="tmodel" select="(./@threadingModel | ../@threadingModel)[last()]"/>
143 <xsl:attribute name="ThreadingModel">
144 <xsl:choose>
145 <xsl:when test="$tmodel='Apartment'">apartment</xsl:when>
146 <xsl:when test="$tmodel='Free'">free</xsl:when>
147 <xsl:when test="$tmodel='Both'">both</xsl:when>
148 <xsl:when test="$tmodel='Neutral'">neutral</xsl:when>
149 <xsl:when test="$tmodel='Single'">single</xsl:when>
150 <xsl:when test="$tmodel='Rental'">rental</xsl:when>
151 <xsl:otherwise>
152 <xsl:message terminate="yes">
153 <xsl:value-of select="concat(../../@name,'::',@name,': ')"/>
154 <xsl:text>class (or module) threading model </xsl:text>
155 <xsl:value-of select="concat('&quot;',$tmodel,'&quot;')"/>
156 <xsl:text> is invalid!</xsl:text>
157 </xsl:message>
158 </xsl:otherwise>
159 </xsl:choose>
160 </xsl:attribute>
161 </xsl:if>
162 <ProgId>
163 <xsl:attribute name="Id">
164 <xsl:value-of select="concat(//library/@name,'.',@name,'.1')"/>
165 </xsl:attribute>
166 <xsl:attribute name="Description"><xsl:value-of select="@name"/> Class</xsl:attribute>
167 <ProgId>
168 <xsl:attribute name="Id">
169 <xsl:value-of select="concat(//library/@name,'.',@name)"/>
170 </xsl:attribute>
171 <xsl:attribute name="Description"><xsl:value-of select="@name"/> Class</xsl:attribute>
172 </ProgId>
173 </ProgId>
174 </Class>
175</xsl:template>
176
177<!--
178 * eat everything else not explicitly matched
179-->
180<xsl:template match="*">
181</xsl:template>
182
183
184</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette