VirtualBox

source: vbox/trunk/src/VBox/Main/src-all/win/VirtualBox_rgs.xsl@ 96308

Last change on this file since 96308 was 96308, checked in by vboxsync, 3 years ago

src/VBox/Main: XML/XSL comment fixes

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Revision Author Id
File size: 5.7 KB
Line 
1<?xml version="1.0"?>
2
3<!--
4 * A template to generate a RGS resource script that contains
5 * registry definitions necessary to properly register
6 * VirtualBox Main API COM components.
7-->
8<!--
9 Copyright (C) 2007-2020 Oracle Corporation
10
11 This file is part of VirtualBox Open Source Edition (OSE), as
12 available from http://www.virtualbox.org. This file is free software;
13 you can redistribute it and/or modify it under the terms of the GNU
14 General Public License (GPL) as published by the Free Software
15 Foundation, in version 2 as it comes in the "COPYING" file of the
16 VirtualBox OSE distribution. VirtualBox OSE is distributed in the
17 hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
18-->
19
20<xsl:stylesheet version="1.0"
21 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
22
23<xsl:output method="text"/>
24
25<xsl:strip-space elements="*"/>
26
27<!--
28// parameters
29/////////////////////////////////////////////////////////////////////////////
30-->
31
32<!-- Name of the application to generate the RGS script for -->
33<xsl:param name="Application"/>
34<!-- Name of the module to generate the RGS script for -->
35<xsl:param name="Module"/>
36
37
38<!--
39// templates
40/////////////////////////////////////////////////////////////////////////////
41-->
42
43<!--
44 * header
45-->
46<xsl:template match="/idl">
47 <xsl:apply-templates/>
48</xsl:template>
49
50
51<!--
52 * libraries
53-->
54<xsl:template match="library">
55 <xsl:apply-templates/>
56</xsl:template>
57
58
59<!--
60 * applications
61-->
62<xsl:template match="application">
63 <xsl:if test="@name=$Application">
64 <xsl:variable name="context" select="//module[@name=$Module]/@context"/>
65<xsl:text>HKCR
66{
67 NoRemove AppID
68 {
69 ForceRemove {</xsl:text><xsl:value-of select="@uuid"/>} = s '<xsl:value-of select="@name"/><xsl:text> </xsl:text>
70 <xsl:choose>
71 <xsl:when test="$context='LocalService'">
72 <xsl:text>Service</xsl:text>
73 </xsl:when>
74 <xsl:otherwise>
75 <xsl:text>Application</xsl:text>
76 </xsl:otherwise>
77 </xsl:choose>
78 <xsl:text>'
79</xsl:text>
80 <xsl:if test="$context='LocalService'">
81 <xsl:text> {
82 val LocalService = s '</xsl:text><xsl:value-of select="$Module"/><xsl:text>'
83 }
84</xsl:text>
85 </xsl:if>
86 <xsl:text> '</xsl:text><xsl:value-of select="$Module"/>
87 <xsl:choose>
88 <xsl:when test="$context='InprocServer'">
89 <xsl:text>.dll</xsl:text>
90 </xsl:when>
91 <xsl:otherwise>
92 <xsl:text>.exe</xsl:text>
93 </xsl:otherwise>
94 </xsl:choose>
95 <xsl:text>'
96 {
97 val AppID = s '{</xsl:text><xsl:value-of select="//library/application[@name=$Application]/@uuid"/><xsl:text>}'
98 }
99 }
100
101</xsl:text>
102 <xsl:apply-templates select="module[@name=$Module]/class"/>
103<xsl:text>}
104</xsl:text>
105 </xsl:if>
106</xsl:template>
107
108
109<!--
110 * classes
111-->
112<xsl:template match="library//module/class">
113 <xsl:variable name="cname" select="concat(//library/application/@name,'.',@name)"/>
114 <xsl:variable name="desc" select="concat(@name,' Class')"/>
115 <xsl:text> </xsl:text>
116 <xsl:value-of select="concat($cname,'.1')"/> = s '<xsl:value-of select="$desc"/>'
117 {
118 CLSID = s '{<xsl:value-of select="@uuid"/>}'
119 }
120 <xsl:value-of select="$cname"/> = s '<xsl:value-of select="$desc"/>'
121 {
122 CLSID = s '{<xsl:value-of select="@uuid"/>}'
123 CurVer = s '<xsl:value-of select="concat($cname,'.1')"/>'
124 }
125 NoRemove CLSID
126 {
127 ForceRemove {<xsl:value-of select="@uuid"/>} = s '<xsl:value-of select="$desc"/>'
128 {
129 val AppID = s '{<xsl:value-of select="//library/application[@name=$Application]/@uuid"/><xsl:text>}'
130</xsl:text>
131 <xsl:if test="../@context!='LocalService'">
132 <xsl:text> ProgID = s '</xsl:text><xsl:value-of select="concat($cname,'.1')"/><xsl:text>'
133 VersionIndependentProgID = s '</xsl:text><xsl:value-of select="$cname"/><xsl:text>'
134 </xsl:text>
135 <xsl:choose>
136 <xsl:when test="../@context='InprocServer'">InprocServer32</xsl:when>
137 <xsl:when test="../@context='LocalServer'">LocalServer32</xsl:when>
138 <xsl:otherwise>
139 <xsl:message terminate="yes">
140 <xsl:value-of select="concat(../../@name,'::',../@name,': ')"/>
141 <xsl:text>module context </xsl:text>
142 <xsl:value-of select="concat('&quot;',../@context,'&quot;')"/>
143 <xsl:text> is invalid!</xsl:text>
144 </xsl:message>
145 </xsl:otherwise>
146 </xsl:choose><xsl:text> = s '%MODULE%'
147</xsl:text>
148 <xsl:if test="../@context='InprocServer'">
149 <xsl:variable name="tmodel" select="(./@threadingModel | ../@threadingModel)[last()]"/><xsl:text> {
150 val ThreadingModel = s '</xsl:text>
151 <xsl:choose>
152 <xsl:when test="$tmodel='Apartment'">Apartment</xsl:when>
153 <xsl:when test="$tmodel='Free'">Free</xsl:when>
154 <xsl:when test="$tmodel='Both'">Both</xsl:when>
155 <xsl:when test="$tmodel='Neutral'">Neutral</xsl:when>
156 <xsl:when test="$tmodel='Single'">Single</xsl:when>
157 <xsl:when test="$tmodel='Rental'">Rental</xsl:when>
158 <xsl:otherwise>
159 <xsl:message terminate="yes">
160 <xsl:value-of select="concat(../../@name,'::',@name,': ')"/>
161 <xsl:text>class (or module) threading model </xsl:text>
162 <xsl:value-of select="concat('&quot;',$tmodel,'&quot;')"/>
163 <xsl:text> is invalid!</xsl:text>
164 </xsl:message>
165 </xsl:otherwise>
166 </xsl:choose><xsl:text>'
167 }
168</xsl:text>
169 </xsl:if>
170 <xsl:text> TypeLib = s '{</xsl:text><xsl:value-of select="//library/@uuid"/><xsl:text>}'
171</xsl:text>
172 </xsl:if>
173 <xsl:text> }
174 }
175</xsl:text>
176</xsl:template>
177
178
179<!--
180 * eat everything else not explicitly matched
181-->
182<xsl:template match="*">
183</xsl:template>
184
185
186</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