VirtualBox

source: vbox/trunk/src/VBox/Main/win32/VirtualBox_rgs.xsl@ 4504

Last change on this file since 4504 was 4103, checked in by vboxsync, 17 years ago

Main: Generate .rgs from from XIDL to avoid data duplication.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Revision Author Id
File size: 4.1 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 Copyright (C) 2007 innotek GmbH
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 as published by the Free Software Foundation,
14 in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
15 distribution. VirtualBox OSE is distributed in the hope that it will
16 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="text"/>
23
24<xsl:strip-space elements="*"/>
25
26<!--
27// parameters
28/////////////////////////////////////////////////////////////////////////////
29-->
30
31<!-- Name of the module to generate the RGS script for -->
32<xsl:param name="Module"/>
33
34
35<!--
36// templates
37/////////////////////////////////////////////////////////////////////////////
38-->
39
40<!--
41 * header
42-->
43<xsl:template match="/idl">
44HKCR
45{
46<xsl:apply-templates/>
47}
48</xsl:template>
49
50
51<!--
52 * libraries
53-->
54<xsl:template match="idl/library">
55 NoRemove AppID
56 {
57 {<xsl:value-of select="@appUuid"/>} = s '<xsl:value-of select="@name"/> Application'
58 }
59
60<xsl:apply-templates select="module[@name=$Module]/class"/>
61</xsl:template>
62
63
64<!--
65 * classes
66-->
67<xsl:template match="library//module/class">
68 <xsl:variable name="cname" select="concat(//library/@name,'.',@name)"/>
69 <xsl:variable name="desc" select="concat(@name,' Class')"/>
70 <xsl:text> </xsl:text>
71 <xsl:value-of select="concat($cname,'.1')"/> = s '<xsl:value-of select="$desc"/>'
72 {
73 CLSID = s '{<xsl:value-of select="@uuid"/>}'
74 }
75 <xsl:value-of select="$cname"/> = s '<xsl:value-of select="$desc"/>'
76 {
77 CLSID = s '{<xsl:value-of select="@uuid"/>}'
78 CurVer = s '<xsl:value-of select="concat($cname,'.1')"/>'
79 }
80 NoRemove CLSID
81 {
82 ForceRemove {<xsl:value-of select="@uuid"/>} = s '<xsl:value-of select="$desc"/>'
83 {
84 ProgId = s '<xsl:value-of select="concat($cname,'.1')"/>'
85 VersionIndependentProgID = s '<xsl:value-of select="$cname"/>'
86 <xsl:choose>
87 <xsl:when test="../@context='InprocServer'">InprocServer32</xsl:when>
88 <xsl:when test="../@context='LocalServer'">LocalServer32</xsl:when>
89 <xsl:otherwise>
90 <xsl:message terminate="yes">
91 <xsl:value-of select="concat(../../@name,'::',../@name,': ')"/>
92 <xsl:text>module context </xsl:text>
93 <xsl:value-of select="concat('&quot;',../@context,'&quot;')"/>
94 <xsl:text> is invalid!</xsl:text>
95 </xsl:message>
96 </xsl:otherwise>
97 </xsl:choose> = s '%MODULE%'
98 <xsl:if test="../@context='InprocServer'">
99 <xsl:variable name="tmodel" select="(./@threadingModel | ../@threadingModel)[last()]"/>{
100 val ThreadingModel = s '<xsl:choose>
101 <xsl:when test="$tmodel='Apartment'">Apartment</xsl:when>
102 <xsl:when test="$tmodel='Free'">Free</xsl:when>
103 <xsl:when test="$tmodel='Both'">Both</xsl:when>
104 <xsl:when test="$tmodel='Neutral'">Neutral</xsl:when>
105 <xsl:when test="$tmodel='Single'">Single</xsl:when>
106 <xsl:when test="$tmodel='Rental'">Rental</xsl:when>
107 <xsl:otherwise>
108 <xsl:message terminate="yes">
109 <xsl:value-of select="concat(../../@name,'::',@name,': ')"/>
110 <xsl:text>class (or module) threading model </xsl:text>
111 <xsl:value-of select="concat('&quot;',$tmodel,'&quot;')"/>
112 <xsl:text> is invalid!</xsl:text>
113 </xsl:message>
114 </xsl:otherwise>
115 </xsl:choose>'
116 }
117 </xsl:if>
118 val AppId = s '{<xsl:value-of select="//library/@appUuid"/>}'
119 'TypeLib' = s '{<xsl:value-of select="//library/@uuid"/>}'
120 }
121 }
122
123</xsl:template>
124
125
126<!--
127 * eat everything else not explicitly matched
128-->
129<xsl:template match="*">
130</xsl:template>
131
132
133</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.

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