VirtualBox

source: vbox/trunk/src/VBox/Main/idl/xpidl.xsl@ 96399

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

src/VBox/Main: XML/XSL comment fixes

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 39.5 KB
Line 
1<?xml version="1.0"?>
2<!-- $Id: xpidl.xsl 96308 2022-08-18 19:00:04Z vboxsync $ -->
3
4<!--
5 * A template to generate a XPCOM IDL compatible interface definition file
6 * from the generic interface definition expressed in XML.
7-->
8<!--
9 Copyright (C) 2006-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" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
21<xsl:output method="text"/>
22
23<xsl:strip-space elements="*"/>
24
25<xsl:include href="typemap-shared.inc.xsl"/>
26
27
28<!-- - - - - - - - - - - - - - - - - - - - - - -
29 XSLT parameters
30 - - - - - - - - - - - - - - - - - - - - - - -->
31
32<!-- xpidl doesn't support enums. This parameter performs certain hacks that helps
33 us bridge the gap and get similar behaviour as msidl.
34
35 The https://bugzilla.mozilla.org/show_bug.cgi?id=8781 bug discusses why xpidl
36 doesn't do enums. It boils down to the gcc short-enum option and similar
37 portability concerns.
38 -->
39<xsl:param name="g_fHackEnumsOntoCppEnums" select="'yes'"/>
40
41
42<!--
43// templates
44/////////////////////////////////////////////////////////////////////////////
45-->
46
47
48<!--
49 * not explicitly matched elements and attributes
50-->
51<xsl:template match="*"/>
52
53
54<!--
55 * header
56-->
57<xsl:template match="/idl">
58 <xsl:text>
59/*
60 * DO NOT EDIT! This is a generated file.
61 *
62 * XPCOM IDL (XPIDL) definition for VirtualBox Main API (COM interfaces)
63 * generated from XIDL (XML interface definition).
64 *
65 * Source : src/VBox/Main/idl/VirtualBox.xidl
66 * Generator : src/VBox/Main/idl/xpidl.xsl
67 */
68
69#include "nsISupports.idl"
70#include "nsIException.idl"
71
72</xsl:text>
73 <!-- native typedefs for the 'mod="ptr"' attribute -->
74 <xsl:text>
75[ptr] native booleanPtr (PRBool);
76[ptr] native octetPtr (PRUint8);
77[ptr] native shortPtr (PRInt16);
78[ptr] native ushortPtr (PRUint16);
79[ptr] native longPtr (PRInt32);
80[ptr] native llongPtr (PRInt64);
81[ptr] native ulongPtr (PRUint32);
82[ptr] native ullongPtr (PRUint64);
83<!-- charPtr is already defined in nsrootidl.idl -->
84<!-- [ptr] native charPtr (char) -->
85[ptr] native stringPtr (string);
86[ptr] native wcharPtr (wchar);
87[ptr] native wstringPtr (wstring);
88
89</xsl:text>
90 <xsl:apply-templates/>
91</xsl:template>
92
93
94<!--
95 * ignore all |if|s except those for XPIDL target
96-->
97<xsl:template match="if">
98 <xsl:if test="@target='xpidl'">
99 <xsl:apply-templates/>
100 </xsl:if>
101</xsl:template>
102<xsl:template match="if" mode="forward">
103 <xsl:if test="@target='xpidl'">
104 <xsl:apply-templates mode="forward"/>
105 </xsl:if>
106</xsl:template>
107<xsl:template match="if" mode="forwarder">
108 <xsl:if test="@target='midl'">
109 <xsl:apply-templates mode="forwarder"/>
110 </xsl:if>
111</xsl:template>
112
113
114<!--
115 * cpp_quote
116-->
117<xsl:template match="cpp">
118 <xsl:if test="text()">
119 <xsl:text>%{C++</xsl:text>
120 <xsl:value-of select="text()"/>
121 <xsl:text>&#x0A;%}&#x0A;&#x0A;</xsl:text>
122 </xsl:if>
123 <xsl:if test="not(text()) and @line">
124 <xsl:text>%{C++&#x0A;</xsl:text>
125 <xsl:value-of select="@line"/>
126 <xsl:text>&#x0A;%}&#x0A;&#x0A;</xsl:text>
127 </xsl:if>
128</xsl:template>
129
130
131<!--
132 * #if statement (@if attribute)
133 * @note
134 * xpidl doesn't support any preprocessor defines other than #include
135 * (it just ignores them), so the generated IDL will most likely be
136 * invalid. So for now we forbid using @if attributes
137-->
138<xsl:template match="@if" mode="begin">
139 <xsl:message terminate="yes">
140 @if attributes are not currently allowed because xpidl lacks
141 support for #ifdef and stuff.
142 </xsl:message>
143 <xsl:text>#if </xsl:text>
144 <xsl:value-of select="."/>
145 <xsl:text>&#x0A;</xsl:text>
146</xsl:template>
147<xsl:template match="@if" mode="end">
148 <xsl:text>#endif&#x0A;</xsl:text>
149</xsl:template>
150
151
152<!--
153 * libraries
154-->
155<xsl:template match="library">
156 <xsl:text>%{C++&#x0A;</xsl:text>
157 <xsl:text>#ifndef VBOX_EXTERN_C&#x0A;</xsl:text>
158 <xsl:text># ifdef __cplusplus&#x0A;</xsl:text>
159 <xsl:text># define VBOX_EXTERN_C extern "C"&#x0A;</xsl:text>
160 <xsl:text># else // !__cplusplus&#x0A;</xsl:text>
161 <xsl:text># define VBOX_EXTERN_C extern&#x0A;</xsl:text>
162 <xsl:text># endif // !__cplusplus&#x0A;</xsl:text>
163 <xsl:text>#endif // !VBOX_EXTERN_C&#x0A;</xsl:text>
164 <!-- result codes -->
165 <xsl:text>// result codes declared in API spec&#x0A;</xsl:text>
166 <xsl:for-each select="application/result">
167 <xsl:apply-templates select="."/>
168 </xsl:for-each>
169 <xsl:text>%}&#x0A;&#x0A;</xsl:text>
170 <!-- forward declarations -->
171 <xsl:apply-templates select="application/if | application/interface" mode="forward"/>
172 <xsl:text>&#x0A;</xsl:text>
173 <!-- all enums go first -->
174 <xsl:apply-templates select="application/enum | application/if/enum"/>
175 <!-- everything else but result codes and enums
176 <xsl:apply-templates select="*[not(self::application/result or self::application/enum) and
177 not(self::application[result] or self::application/if[enum])]"/> -->
178 <!-- the modules (i.e. everything else) -->
179 <xsl:apply-templates select="application/interface | application/if[interface]
180 | application/module | application/if[module]"/>
181 <!-- -->
182</xsl:template>
183
184
185 <!--
186 * applications
187-->
188<xsl:template match="application">
189 <xsl:apply-templates/>
190</xsl:template>
191<xsl:template match="application" mode="forward">
192 <xsl:apply-templates mode="forward"/>
193</xsl:template>
194
195<!--
196 * result codes
197-->
198<xsl:template match="result">
199 <xsl:value-of select="concat('#define ',@name,' ((nsresult)',@value, ')')"/>
200 <xsl:text>&#x0A;</xsl:text>
201</xsl:template>
202
203
204<!--
205 * forward declarations
206-->
207<xsl:template match="interface" mode="forward">
208 <xsl:text>interface </xsl:text>
209 <xsl:value-of select="@name"/>
210 <xsl:text>;&#x0A;</xsl:text>
211</xsl:template>
212
213
214<!--
215 * interfaces
216-->
217<xsl:template match="interface">[
218 uuid(<xsl:value-of select="@uuid"/>),
219 scriptable
220]
221<xsl:text>interface </xsl:text>
222 <xsl:variable name="name" select="@name"/>
223 <xsl:value-of select="$name"/>
224 <xsl:text> : </xsl:text>
225 <xsl:choose>
226 <xsl:when test="@extends='$unknown'">nsISupports</xsl:when>
227 <xsl:when test="@extends='$errorinfo'">nsIException</xsl:when>
228 <xsl:otherwise><xsl:value-of select="@extends"/></xsl:otherwise>
229 </xsl:choose>
230 <xsl:call-template name="xsltprocNewlineOutputHack"/>
231 <xsl:text>{&#x0A;</xsl:text>
232 <!-- attributes (properties) -->
233 <xsl:apply-templates select="attribute"/>
234 <xsl:variable name="reservedAttributes" select="@reservedAttributes"/>
235 <xsl:if test="$reservedAttributes > 0">
236 <!-- tricky way to do a "for" loop without recursion -->
237 <xsl:for-each select="(//*)[position() &lt;= $reservedAttributes]">
238 <xsl:text> readonly attribute unsigned long InternalAndReservedAttribute</xsl:text>
239 <xsl:value-of select="concat(position(), $name)"/>
240 <xsl:text>;&#x0A;&#x0A;</xsl:text>
241 </xsl:for-each>
242 </xsl:if>
243 <!-- methods -->
244 <xsl:apply-templates select="method"/>
245 <xsl:variable name="reservedMethods" select="@reservedMethods"/>
246 <xsl:if test="$reservedMethods > 0">
247 <!-- tricky way to do a "for" loop without recursion -->
248 <xsl:for-each select="(//*)[position() &lt;= $reservedMethods]">
249 <xsl:text> void InternalAndReservedMethod</xsl:text>
250 <xsl:value-of select="concat(position(), $name)"/>
251 <xsl:text>();&#x0A;&#x0A;</xsl:text>
252 </xsl:for-each>
253 </xsl:if>
254 <!-- 'if' enclosed elements, unsorted -->
255 <xsl:apply-templates select="if"/>
256 <!-- -->
257 <xsl:text>}; /* interface </xsl:text>
258 <xsl:value-of select="$name"/>
259 <xsl:text> */&#x0A;&#x0A;</xsl:text>
260 <!-- Interface implementation forwarder macro -->
261 <xsl:text>/* Interface implementation forwarder macro */&#x0A;</xsl:text>
262 <xsl:text>%{C++&#x0A;</xsl:text>
263 <!-- 1) individual methods -->
264 <xsl:apply-templates select="attribute" mode="forwarder"/>
265 <xsl:apply-templates select="method" mode="forwarder"/>
266 <xsl:apply-templates select="if" mode="forwarder"/>
267 <!-- 2) COM_FORWARD_Interface_TO(smth) -->
268 <xsl:text>#define COM_FORWARD_</xsl:text>
269 <xsl:value-of select="$name"/>
270 <xsl:text>_TO(smth) NS_FORWARD_</xsl:text>
271 <xsl:call-template name="string-to-upper">
272 <xsl:with-param name="str" select="$name"/>
273 </xsl:call-template>
274 <xsl:text> (smth)&#x0A;</xsl:text>
275 <!-- 3) COM_FORWARD_Interface_TO_OBJ(obj) -->
276 <xsl:text>#define COM_FORWARD_</xsl:text>
277 <xsl:value-of select="$name"/>
278 <xsl:text>_TO_OBJ(obj) COM_FORWARD_</xsl:text>
279 <xsl:value-of select="$name"/>
280 <xsl:text>_TO ((obj)->)&#x0A;</xsl:text>
281 <!-- 4) COM_FORWARD_Interface_TO_BASE(base) -->
282 <xsl:text>#define COM_FORWARD_</xsl:text>
283 <xsl:value-of select="$name"/>
284 <xsl:text>_TO_BASE(base) COM_FORWARD_</xsl:text>
285 <xsl:value-of select="$name"/>
286 <xsl:text>_TO (base::)&#x0A;&#x0A;</xsl:text>
287 <!-- -->
288 <xsl:text>// for compatibility with Win32&#x0A;</xsl:text>
289 <xsl:text>VBOX_EXTERN_C const nsID IID_</xsl:text>
290 <xsl:value-of select="$name"/>
291 <xsl:text>;&#x0A;</xsl:text>
292 <xsl:text>%}&#x0A;&#x0A;</xsl:text>
293 <!-- end -->
294</xsl:template>
295
296
297<!--
298 * attributes
299-->
300<xsl:template match="interface//attribute">
301 <xsl:apply-templates select="@if" mode="begin"/>
302 <xsl:if test="@mod='ptr'">
303 <!-- attributes using native types must be non-scriptable -->
304 <xsl:text> [noscript]&#x0A;</xsl:text>
305 </xsl:if>
306 <xsl:choose>
307 <!-- safearray pseudo attribute -->
308 <xsl:when test="@safearray='yes'">
309 <!-- getter -->
310 <xsl:text> void get</xsl:text>
311 <xsl:call-template name="capitalize">
312 <xsl:with-param name="str" select="@name"/>
313 </xsl:call-template>
314 <xsl:text> (&#x0A;</xsl:text>
315 <!-- array size -->
316 <xsl:text> out unsigned long </xsl:text>
317 <xsl:value-of select="@name"/>
318 <xsl:text>Size,&#x0A;</xsl:text>
319 <!-- array pointer -->
320 <xsl:text> [array, size_is(</xsl:text>
321 <xsl:value-of select="@name"/>
322 <xsl:text>Size), retval] out </xsl:text>
323 <xsl:apply-templates select="@type"/>
324 <xsl:text> </xsl:text>
325 <xsl:value-of select="@name"/>
326 <xsl:text>&#x0A; );&#x0A;</xsl:text>
327 <!-- setter -->
328 <xsl:if test="not(@readonly='yes')">
329 <xsl:text> void set</xsl:text>
330 <xsl:call-template name="capitalize">
331 <xsl:with-param name="str" select="@name"/>
332 </xsl:call-template>
333 <xsl:text> (&#x0A;</xsl:text>
334 <!-- array size -->
335 <xsl:text> in unsigned long </xsl:text>
336 <xsl:value-of select="@name"/>
337 <xsl:text>Size,&#x0A;</xsl:text>
338 <!-- array pointer -->
339 <xsl:text> [array, size_is(</xsl:text>
340 <xsl:value-of select="@name"/>
341 <xsl:text>Size)] in </xsl:text>
342 <xsl:apply-templates select="@type"/>
343 <xsl:text> </xsl:text>
344 <xsl:value-of select="@name"/>
345 <xsl:text>&#x0A; );&#x0A;</xsl:text>
346 </xsl:if>
347 </xsl:when>
348 <!-- normal attribute -->
349 <xsl:otherwise>
350 <xsl:text> </xsl:text>
351 <xsl:if test="@readonly='yes'">
352 <xsl:text>readonly </xsl:text>
353 </xsl:if>
354 <xsl:text>attribute </xsl:text>
355 <xsl:apply-templates select="@type"/>
356 <xsl:text> </xsl:text>
357 <xsl:value-of select="@name"/>
358 <xsl:text>;&#x0A;</xsl:text>
359 </xsl:otherwise>
360 </xsl:choose>
361 <xsl:apply-templates select="@if" mode="end"/>
362 <xsl:text>&#x0A;</xsl:text>
363</xsl:template>
364
365<xsl:template match="interface//attribute" mode="forwarder">
366
367 <xsl:variable name="parent" select="ancestor::interface"/>
368
369 <xsl:apply-templates select="@if" mode="begin"/>
370
371 <!-- getter: COM_FORWARD_Interface_GETTER_Name_TO(smth) -->
372 <xsl:text>#define COM_FORWARD_</xsl:text>
373 <xsl:value-of select="$parent/@name"/>
374 <xsl:text>_GETTER_</xsl:text>
375 <xsl:call-template name="capitalize">
376 <xsl:with-param name="str" select="@name"/>
377 </xsl:call-template>
378 <xsl:text>_TO(smth) NS_IMETHOD Get</xsl:text>
379 <xsl:call-template name="capitalize">
380 <xsl:with-param name="str" select="@name"/>
381 </xsl:call-template>
382 <xsl:text> (</xsl:text>
383 <xsl:if test="@safearray='yes'">
384 <xsl:text>PRUint32 * a</xsl:text>
385 <xsl:call-template name="capitalize">
386 <xsl:with-param name="str" select="@name"/>
387 </xsl:call-template>
388 <xsl:text>Size, </xsl:text>
389 </xsl:if>
390 <xsl:apply-templates select="@type" mode="forwarder"/>
391 <xsl:if test="@safearray='yes'">
392 <xsl:text> *</xsl:text>
393 </xsl:if>
394 <xsl:text> * a</xsl:text>
395 <xsl:call-template name="capitalize">
396 <xsl:with-param name="str" select="@name"/>
397 </xsl:call-template>
398 <xsl:text>) { return smth Get</xsl:text>
399 <xsl:call-template name="capitalize">
400 <xsl:with-param name="str" select="@name"/>
401 </xsl:call-template>
402 <xsl:text> (</xsl:text>
403 <xsl:if test="@safearray='yes'">
404 <xsl:text>a</xsl:text>
405 <xsl:call-template name="capitalize">
406 <xsl:with-param name="str" select="@name"/>
407 </xsl:call-template>
408 <xsl:text>Size, </xsl:text>
409 </xsl:if>
410 <xsl:text>a</xsl:text>
411 <xsl:call-template name="capitalize">
412 <xsl:with-param name="str" select="@name"/>
413 </xsl:call-template>
414 <xsl:text>); }&#x0A;</xsl:text>
415 <!-- getter: COM_FORWARD_Interface_GETTER_Name_TO_OBJ(obj) -->
416 <xsl:text>#define COM_FORWARD_</xsl:text>
417 <xsl:value-of select="$parent/@name"/>
418 <xsl:text>_GETTER_</xsl:text>
419 <xsl:call-template name="capitalize">
420 <xsl:with-param name="str" select="@name"/>
421 </xsl:call-template>
422 <xsl:text>_TO_OBJ(obj) COM_FORWARD_</xsl:text>
423 <xsl:value-of select="$parent/@name"/>
424 <xsl:text>_GETTER_</xsl:text>
425 <xsl:call-template name="capitalize">
426 <xsl:with-param name="str" select="@name"/>
427 </xsl:call-template>
428 <xsl:text>_TO ((obj)->)&#x0A;</xsl:text>
429 <!-- getter: COM_FORWARD_Interface_GETTER_Name_TO_BASE(base) -->
430 <xsl:text>#define COM_FORWARD_</xsl:text>
431 <xsl:value-of select="$parent/@name"/>
432 <xsl:text>_GETTER_</xsl:text>
433 <xsl:call-template name="capitalize">
434 <xsl:with-param name="str" select="@name"/>
435 </xsl:call-template>
436 <xsl:text>_TO_BASE(base) COM_FORWARD_</xsl:text>
437 <xsl:value-of select="$parent/@name"/>
438 <xsl:text>_GETTER_</xsl:text>
439 <xsl:call-template name="capitalize">
440 <xsl:with-param name="str" select="@name"/>
441 </xsl:call-template>
442 <xsl:text>_TO (base::)&#x0A;</xsl:text>
443 <!-- -->
444 <xsl:if test="not(@readonly='yes')">
445 <!-- setter: COM_FORWARD_Interface_SETTER_Name_TO(smth) -->
446 <xsl:text>#define COM_FORWARD_</xsl:text>
447 <xsl:value-of select="$parent/@name"/>
448 <xsl:text>_SETTER_</xsl:text>
449 <xsl:call-template name="capitalize">
450 <xsl:with-param name="str" select="@name"/>
451 </xsl:call-template>
452 <xsl:text>_TO(smth) NS_IMETHOD Set</xsl:text>
453 <xsl:call-template name="capitalize">
454 <xsl:with-param name="str" select="@name"/>
455 </xsl:call-template>
456 <xsl:text> (</xsl:text>
457 <xsl:if test="@safearray='yes'">
458 <xsl:text>PRUint32 a</xsl:text>
459 <xsl:call-template name="capitalize">
460 <xsl:with-param name="str" select="@name"/>
461 </xsl:call-template>
462 <xsl:text>Size, </xsl:text>
463 </xsl:if>
464 <xsl:if test="not(@safearray='yes') and (@type='string' or @type='wstring')">
465 <xsl:text>const </xsl:text>
466 </xsl:if>
467 <xsl:apply-templates select="@type" mode="forwarder"/>
468 <xsl:if test="@safearray='yes'">
469 <xsl:text> *</xsl:text>
470 </xsl:if>
471 <xsl:text> a</xsl:text>
472 <xsl:call-template name="capitalize">
473 <xsl:with-param name="str" select="@name"/>
474 </xsl:call-template>
475 <xsl:text>) { return smth Set</xsl:text>
476 <xsl:call-template name="capitalize">
477 <xsl:with-param name="str" select="@name"/>
478 </xsl:call-template>
479 <xsl:text> (a</xsl:text>
480 <xsl:call-template name="capitalize">
481 <xsl:with-param name="str" select="@name"/>
482 </xsl:call-template>
483 <xsl:text>); }&#x0A;</xsl:text>
484 <!-- setter: COM_FORWARD_Interface_SETTER_Name_TO_OBJ(obj) -->
485 <xsl:text>#define COM_FORWARD_</xsl:text>
486 <xsl:value-of select="$parent/@name"/>
487 <xsl:text>_SETTER_</xsl:text>
488 <xsl:call-template name="capitalize">
489 <xsl:with-param name="str" select="@name"/>
490 </xsl:call-template>
491 <xsl:text>_TO_OBJ(obj) COM_FORWARD_</xsl:text>
492 <xsl:value-of select="$parent/@name"/>
493 <xsl:text>_SETTER_</xsl:text>
494 <xsl:call-template name="capitalize">
495 <xsl:with-param name="str" select="@name"/>
496 </xsl:call-template>
497 <xsl:text>_TO ((obj)->)&#x0A;</xsl:text>
498 <!-- setter: COM_FORWARD_Interface_SETTER_Name_TO_BASE(base) -->
499 <xsl:text>#define COM_FORWARD_</xsl:text>
500 <xsl:value-of select="$parent/@name"/>
501 <xsl:text>_SETTER_</xsl:text>
502 <xsl:call-template name="capitalize">
503 <xsl:with-param name="str" select="@name"/>
504 </xsl:call-template>
505 <xsl:text>_TO_BASE(base) COM_FORWARD_</xsl:text>
506 <xsl:value-of select="$parent/@name"/>
507 <xsl:text>_SETTER_</xsl:text>
508 <xsl:call-template name="capitalize">
509 <xsl:with-param name="str" select="@name"/>
510 </xsl:call-template>
511 <xsl:text>_TO (base::)&#x0A;</xsl:text>
512 </xsl:if>
513
514 <xsl:apply-templates select="@if" mode="end"/>
515
516</xsl:template>
517
518
519<!--
520 * methods
521-->
522<xsl:template match="interface//method">
523 <xsl:apply-templates select="@if" mode="begin"/>
524 <xsl:if test="param/@mod='ptr'">
525 <!-- methods using native types must be non-scriptable -->
526 <xsl:text> [noscript]&#x0A;</xsl:text>
527 </xsl:if>
528 <xsl:text> void </xsl:text>
529 <xsl:value-of select="@name"/>
530 <xsl:if test="param">
531 <xsl:text> (&#x0A;</xsl:text>
532 <xsl:for-each select="param [position() != last()]">
533 <xsl:text> </xsl:text>
534 <xsl:apply-templates select="."/>
535 <xsl:text>,&#x0A;</xsl:text>
536 </xsl:for-each>
537 <xsl:text> </xsl:text>
538 <xsl:apply-templates select="param [last()]"/>
539 <xsl:text>&#x0A; );&#x0A;</xsl:text>
540 </xsl:if>
541 <xsl:if test="not(param)">
542 <xsl:text>();&#x0A;</xsl:text>
543 </xsl:if>
544 <xsl:apply-templates select="@if" mode="end"/>
545 <xsl:text>&#x0A;</xsl:text>
546</xsl:template>
547
548<xsl:template match="interface//method" mode="forwarder">
549
550 <xsl:variable name="parent" select="ancestor::interface"/>
551
552 <xsl:apply-templates select="@if" mode="begin"/>
553
554 <xsl:text>#define COM_FORWARD_</xsl:text>
555 <xsl:value-of select="$parent/@name"/>
556 <xsl:text>_</xsl:text>
557 <xsl:call-template name="capitalize">
558 <xsl:with-param name="str" select="@name"/>
559 </xsl:call-template>
560 <xsl:text>_TO(smth) NS_IMETHOD </xsl:text>
561 <xsl:call-template name="capitalize">
562 <xsl:with-param name="str" select="@name"/>
563 </xsl:call-template>
564 <xsl:choose>
565 <xsl:when test="param">
566 <xsl:text> (</xsl:text>
567 <xsl:for-each select="param [position() != last()]">
568 <xsl:apply-templates select="." mode="forwarder"/>
569 <xsl:text>, </xsl:text>
570 </xsl:for-each>
571 <xsl:apply-templates select="param [last()]" mode="forwarder"/>
572 <xsl:text>) { return smth </xsl:text>
573 <xsl:call-template name="capitalize">
574 <xsl:with-param name="str" select="@name"/>
575 </xsl:call-template>
576 <xsl:text> (</xsl:text>
577 <xsl:for-each select="param [position() != last()]">
578 <xsl:if test="@safearray='yes'">
579 <xsl:text>a</xsl:text>
580 <xsl:call-template name="capitalize">
581 <xsl:with-param name="str" select="@name"/>
582 </xsl:call-template>
583 <xsl:text>Size+++, </xsl:text>
584 </xsl:if>
585 <xsl:text>a</xsl:text>
586 <xsl:call-template name="capitalize">
587 <xsl:with-param name="str" select="@name"/>
588 </xsl:call-template>
589 <xsl:text>, </xsl:text>
590 </xsl:for-each>
591 <xsl:if test="param [last()]/@safearray='yes'">
592 <xsl:text>a</xsl:text>
593 <xsl:call-template name="capitalize">
594 <xsl:with-param name="str" select="param [last()]/@name"/>
595 </xsl:call-template>
596 <xsl:text>Size, </xsl:text>
597 </xsl:if>
598 <xsl:text>a</xsl:text>
599 <xsl:call-template name="capitalize">
600 <xsl:with-param name="str" select="param [last()]/@name"/>
601 </xsl:call-template>
602 <xsl:text>); }</xsl:text>
603 </xsl:when>
604 <xsl:otherwise test="not(param)">
605 <xsl:text>() { return smth </xsl:text>
606 <xsl:call-template name="capitalize">
607 <xsl:with-param name="str" select="@name"/>
608 </xsl:call-template>
609 <xsl:text>(); }</xsl:text>
610 </xsl:otherwise>
611 </xsl:choose>
612 <xsl:text>&#x0A;</xsl:text>
613 <!-- COM_FORWARD_Interface_Method_TO_OBJ(obj) -->
614 <xsl:text>#define COM_FORWARD_</xsl:text>
615 <xsl:value-of select="$parent/@name"/>
616 <xsl:text>_</xsl:text>
617 <xsl:call-template name="capitalize">
618 <xsl:with-param name="str" select="@name"/>
619 </xsl:call-template>
620 <xsl:text>_TO_OBJ(obj) COM_FORWARD_</xsl:text>
621 <xsl:value-of select="$parent/@name"/>
622 <xsl:text>_</xsl:text>
623 <xsl:call-template name="capitalize">
624 <xsl:with-param name="str" select="@name"/>
625 </xsl:call-template>
626 <xsl:text>_TO ((obj)->)&#x0A;</xsl:text>
627 <!-- COM_FORWARD_Interface_Method_TO_BASE(base) -->
628 <xsl:text>#define COM_FORWARD_</xsl:text>
629 <xsl:value-of select="$parent/@name"/>
630 <xsl:text>_</xsl:text>
631 <xsl:call-template name="capitalize">
632 <xsl:with-param name="str" select="@name"/>
633 </xsl:call-template>
634 <xsl:text>_TO_BASE(base) COM_FORWARD_</xsl:text>
635 <xsl:value-of select="$parent/@name"/>
636 <xsl:text>_</xsl:text>
637 <xsl:call-template name="capitalize">
638 <xsl:with-param name="str" select="@name"/>
639 </xsl:call-template>
640 <xsl:text>_TO (base::)&#x0A;</xsl:text>
641
642 <xsl:apply-templates select="@if" mode="end"/>
643
644</xsl:template>
645
646
647<!--
648 * modules
649-->
650<xsl:template match="module">
651 <xsl:apply-templates select="class"/>
652</xsl:template>
653
654
655<!--
656 * co-classes
657-->
658<xsl:template match="module/class">
659 <!-- class and contract id -->
660 <xsl:text>%{C++&#x0A;</xsl:text>
661 <xsl:text>// Definitions for module </xsl:text>
662 <xsl:value-of select="../@name"/>
663 <xsl:text>, class </xsl:text>
664 <xsl:value-of select="@name"/>
665 <xsl:text>:&#x0A;</xsl:text>
666 <xsl:text>#define NS_</xsl:text>
667 <xsl:call-template name="string-to-upper">
668 <xsl:with-param name="str" select="@name"/>
669 </xsl:call-template>
670 <xsl:text>_CID { \&#x0A;</xsl:text>
671 <xsl:text> 0x</xsl:text><xsl:value-of select="substring(@uuid,1,8)"/>
672 <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,10,4)"/>
673 <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,15,4)"/>
674 <xsl:text>, \&#x0A; </xsl:text>
675 <xsl:text>{ 0x</xsl:text><xsl:value-of select="substring(@uuid,20,2)"/>
676 <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,22,2)"/>
677 <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,25,2)"/>
678 <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,27,2)"/>
679 <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,29,2)"/>
680 <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,31,2)"/>
681 <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,33,2)"/>
682 <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,35,2)"/>
683 <xsl:text> } \&#x0A;}&#x0A;</xsl:text>
684 <xsl:text>#define NS_</xsl:text>
685 <xsl:call-template name="string-to-upper">
686 <xsl:with-param name="str" select="@name"/>
687 </xsl:call-template>
688 <!-- Contract ID -->
689 <xsl:text>_CONTRACTID &quot;@</xsl:text>
690 <xsl:value-of select="@namespace"/>
691 <xsl:text>/</xsl:text>
692 <xsl:value-of select="@name"/>
693 <xsl:text>;1&quot;&#x0A;</xsl:text>
694 <!-- CLSID_xxx declarations for XPCOM, for compatibility with Win32 -->
695 <xsl:text>// for compatibility with Win32&#x0A;</xsl:text>
696 <xsl:text>VBOX_EXTERN_C const nsCID CLSID_</xsl:text>
697 <xsl:value-of select="@name"/>
698 <xsl:text>;&#x0A;</xsl:text>
699 <xsl:text>%}&#x0A;&#x0A;</xsl:text>
700</xsl:template>
701
702
703<!--
704 * enums
705-->
706<xsl:template match="enum">[
707 uuid(<xsl:value-of select="@uuid"/>),
708 scriptable
709]
710<xsl:text>interface </xsl:text>
711 <xsl:value-of select="@name"/>
712 <xsl:text>&#x0A;{&#x0A;</xsl:text>
713 <xsl:for-each select="const">
714 <xsl:text> const PRUint32 </xsl:text>
715 <xsl:value-of select="@name"/> = <xsl:value-of select="@value"/>
716 <xsl:text>;&#x0A;</xsl:text>
717 </xsl:for-each>
718 <xsl:text>};&#x0A;&#x0A;</xsl:text>
719 <xsl:choose>
720
721 <xsl:when test="$g_fHackEnumsOntoCppEnums = 'yes'">
722 <xsl:text>
723/* IDL typedef for enum </xsl:text><xsl:value-of select="@name" /><xsl:text> and C++ mappings. */
724%{C++
725#ifndef VBOX_WITH_XPCOM_CPP_ENUM_HACK
726%}
727typedef PRUint32 </xsl:text><xsl:value-of select="concat(@name, '_T')" /><xsl:text>;
728%{C++
729</xsl:text>
730 <xsl:for-each select="const">
731 <xsl:value-of select="concat('# define ', ../@name, '_', @name, ' ', ../@name, '::', @name, '&#x0A;')"/>
732 </xsl:for-each>
733 <xsl:text>#else /* VBOX_WITH_XPCOM_CPP_ENUM_HACK */
734typedef enum </xsl:text>
735 <xsl:value-of select="concat(@name, '_T')" />
736 <xsl:text> {
737</xsl:text>
738 <xsl:for-each select="const">
739 <xsl:value-of select="concat(' ', ../@name, '_', @name, ' = ', ../@name, '::', @name, ',&#x0A;')"/>
740 </xsl:for-each>
741 <xsl:value-of select="concat(' ', @name, '_32BitHack = 0x7fffffff', '&#x0A;')"/>
742 <xsl:text>} </xsl:text><xsl:value-of select="concat(@name, '_T')"/><xsl:text>;
743# ifdef AssertCompileSize
744AssertCompileSize(</xsl:text><xsl:value-of select="concat(@name, '_T')"/><xsl:text>, sizeof(PRUint32));
745# endif
746#endif /* VBOX_WITH_XPCOM_CPP_ENUM_HACK */
747%}
748
749</xsl:text>
750 </xsl:when>
751
752 <xsl:otherwise>
753 <!-- -->
754 <xsl:value-of select="concat('/* cross-platform type name for ', @name, ' */&#x0A;')"/>
755 <xsl:text>%{C++&#x0A;</xsl:text>
756 <xsl:value-of select="concat('#define ', @name, '_T', ' ',
757 'PRUint32&#x0A;')"/>
758 <xsl:text>%}&#x0A;&#x0A;</xsl:text>
759 <!-- -->
760 <xsl:value-of select="concat('/* cross-platform constants for ', @name, ' */&#x0A;')"/>
761 <xsl:text>%{C++&#x0A;</xsl:text>
762 <xsl:for-each select="const">
763 <xsl:value-of select="concat('#define ', ../@name, '_', @name, ' ',
764 ../@name, '::', @name, '&#x0A;')"/>
765 </xsl:for-each>
766 <xsl:text>%}&#x0A;&#x0A;</xsl:text>
767 </xsl:otherwise>
768 </xsl:choose>
769</xsl:template>
770
771
772<!--
773 * method parameters
774-->
775<xsl:template match="method/param">
776 <xsl:choose>
777 <!-- safearray parameters -->
778 <xsl:when test="@safearray='yes'">
779 <!-- array size -->
780 <xsl:choose>
781 <xsl:when test="@dir='in'">in </xsl:when>
782 <xsl:when test="@dir='out'">out </xsl:when>
783 <xsl:when test="@dir='return'">out </xsl:when>
784 <xsl:otherwise>in </xsl:otherwise>
785 </xsl:choose>
786 <xsl:text>unsigned long </xsl:text>
787 <xsl:value-of select="@name"/>
788 <xsl:text>Size,&#x0A;</xsl:text>
789 <!-- array pointer -->
790 <xsl:text> [array, size_is(</xsl:text>
791 <xsl:value-of select="@name"/>
792 <xsl:text>Size)</xsl:text>
793 <xsl:choose>
794 <xsl:when test="@dir='in'">] in </xsl:when>
795 <xsl:when test="@dir='out'">] out </xsl:when>
796 <xsl:when test="@dir='return'"> , retval] out </xsl:when>
797 <xsl:otherwise>] in </xsl:otherwise>
798 </xsl:choose>
799 <xsl:apply-templates select="@type"/>
800 <xsl:text> </xsl:text>
801 <xsl:value-of select="@name"/>
802 </xsl:when>
803 <!-- normal and array parameters -->
804 <xsl:otherwise>
805 <xsl:choose>
806 <xsl:when test="@dir='in'">in </xsl:when>
807 <xsl:when test="@dir='out'">out </xsl:when>
808 <xsl:when test="@dir='return'">[retval] out </xsl:when>
809 <xsl:otherwise>in </xsl:otherwise>
810 </xsl:choose>
811 <xsl:apply-templates select="@type"/>
812 <xsl:text> </xsl:text>
813 <xsl:value-of select="@name"/>
814 </xsl:otherwise>
815 </xsl:choose>
816</xsl:template>
817
818<xsl:template match="method/param" mode="forwarder">
819 <xsl:if test="@safearray='yes'">
820 <xsl:text>PRUint32</xsl:text>
821 <xsl:if test="@dir='out' or @dir='return'">
822 <xsl:text> *</xsl:text>
823 </xsl:if>
824 <xsl:text> a</xsl:text>
825 <xsl:call-template name="capitalize">
826 <xsl:with-param name="str" select="@name"/>
827 </xsl:call-template>
828 <xsl:text>Size, </xsl:text>
829 </xsl:if>
830 <xsl:apply-templates select="@type" mode="forwarder"/>
831 <xsl:if test="@dir='out' or @dir='return'">
832 <xsl:text> *</xsl:text>
833 </xsl:if>
834 <xsl:if test="@safearray='yes'">
835 <xsl:text> *</xsl:text>
836 </xsl:if>
837 <xsl:text> a</xsl:text>
838 <xsl:call-template name="capitalize">
839 <xsl:with-param name="str" select="@name"/>
840 </xsl:call-template>
841</xsl:template>
842
843
844<!--
845 * attribute/parameter type conversion
846-->
847<xsl:template match="attribute/@type | param/@type">
848 <xsl:variable name="self_target" select="current()/ancestor::if/@target"/>
849
850 <xsl:choose>
851 <!-- modifiers (ignored for 'enumeration' attributes)-->
852 <xsl:when test="name(current())='type' and ../@mod">
853 <xsl:choose>
854 <xsl:when test="../@mod='ptr'">
855 <xsl:choose>
856 <!-- standard types -->
857 <!--xsl:when test=".='result'">??</xsl:when-->
858 <xsl:when test=".='boolean'">booleanPtr</xsl:when>
859 <xsl:when test=".='octet'">octetPtr</xsl:when>
860 <xsl:when test=".='short'">shortPtr</xsl:when>
861 <xsl:when test=".='unsigned short'">ushortPtr</xsl:when>
862 <xsl:when test=".='long'">longPtr</xsl:when>
863 <xsl:when test=".='long long'">llongPtr</xsl:when>
864 <xsl:when test=".='unsigned long'">ulongPtr</xsl:when>
865 <xsl:when test=".='unsigned long long'">ullongPtr</xsl:when>
866 <xsl:otherwise>
867 <xsl:message terminate="yes">
868 <xsl:value-of select="concat(../../../@name,'::',../../@name,'::',../@name,': ')"/>
869 <xsl:text>attribute 'mod=</xsl:text>
870 <xsl:value-of select="concat('&quot;',../@mod,'&quot;')"/>
871 <xsl:text>' cannot be used with type </xsl:text>
872 <xsl:value-of select="concat('&quot;',current(),'&quot;!')"/>
873 </xsl:message>
874 </xsl:otherwise>
875 </xsl:choose>
876 </xsl:when>
877 <xsl:when test="../@mod='string'">
878 <xsl:choose>
879 <!-- standard types -->
880 <!--xsl:when test=".='result'">??</xsl:when-->
881 <xsl:when test=".='uuid'">wstring</xsl:when>
882 <xsl:otherwise>
883 <xsl:message terminate="yes">
884 <xsl:value-of select="concat(../../../@name,'::',../../@name,'::',../@name,': ')"/>
885 <xsl:text>attribute 'mod=</xsl:text>
886 <xsl:value-of select="concat('&quot;',../@mod,'&quot;')"/>
887 <xsl:text>' cannot be used with type </xsl:text>
888 <xsl:value-of select="concat('&quot;',current(),'&quot;!')"/>
889 </xsl:message>
890 </xsl:otherwise>
891 </xsl:choose>
892 </xsl:when>
893 <xsl:otherwise>
894 <xsl:message terminate="yes">
895 <xsl:value-of select="concat(../../../@name,'::',../../@name,'::',../@name,': ')"/>
896 <xsl:value-of select="concat('value &quot;',../@mod,'&quot; ')"/>
897 <xsl:text>of attribute 'mod' is invalid!</xsl:text>
898 </xsl:message>
899 </xsl:otherwise>
900 </xsl:choose>
901 </xsl:when>
902 <!-- no modifiers -->
903 <xsl:otherwise>
904 <xsl:choose>
905 <!-- standard types -->
906 <xsl:when test=".='result'">nsresult</xsl:when>
907 <xsl:when test=".='boolean'">boolean</xsl:when>
908 <xsl:when test=".='octet'">octet</xsl:when>
909 <xsl:when test=".='short'">short</xsl:when>
910 <xsl:when test=".='unsigned short'">unsigned short</xsl:when>
911 <xsl:when test=".='long'">long</xsl:when>
912 <xsl:when test=".='long long'">long long</xsl:when>
913 <xsl:when test=".='unsigned long'">unsigned long</xsl:when>
914 <xsl:when test=".='unsigned long long'">unsigned long long</xsl:when>
915 <xsl:when test=".='char'">char</xsl:when>
916 <xsl:when test=".='wchar'">wchar</xsl:when>
917 <xsl:when test=".='string'">string</xsl:when>
918 <xsl:when test=".='wstring'">wstring</xsl:when>
919 <!-- UUID type -->
920 <xsl:when test=".='uuid'">
921 <xsl:choose>
922 <xsl:when test="name(..)='attribute'">
923 <xsl:choose>
924 <xsl:when test="../@readonly='yes'">
925 <xsl:text>nsIDPtr</xsl:text>
926 </xsl:when>
927 <xsl:otherwise>
928 <xsl:message terminate="yes">
929 <xsl:value-of select="../@name"/>
930 <xsl:text>: Non-readonly uuid attributes are not supported!</xsl:text>
931 </xsl:message>
932 </xsl:otherwise>
933 </xsl:choose>
934 </xsl:when>
935 <xsl:when test="name(..)='param'">
936 <xsl:choose>
937 <xsl:when test="../@dir='in' and not(../@safearray='yes')">
938 <xsl:text>nsIDRef</xsl:text>
939 </xsl:when>
940 <xsl:otherwise>
941 <xsl:text>nsIDPtr</xsl:text>
942 </xsl:otherwise>
943 </xsl:choose>
944 </xsl:when>
945 </xsl:choose>
946 </xsl:when>
947 <!-- system interface types -->
948 <xsl:when test=".='$unknown'">nsISupports</xsl:when>
949 <xsl:otherwise>
950 <xsl:choose>
951 <!-- enum types -->
952 <xsl:when test="
953 (ancestor::library/application/enum[@name=current()]) or
954 (ancestor::library/application/if[@target=$self_target]/enum[@name=current()])
955 ">
956 <xsl:choose>
957 <xsl:when test="$g_fHackEnumsOntoCppEnums = 'yes'">
958 <xsl:value-of select="concat(., '_T')" />
959 </xsl:when>
960 <xsl:otherwise>
961 <xsl:text>PRUint32</xsl:text>
962 </xsl:otherwise>
963 </xsl:choose>
964 </xsl:when>
965 <!-- custom interface types -->
966 <xsl:when test="
967 (ancestor::library/application/interface[@name=current()]) or
968 (ancestor::library/application/if[@target=$self_target]/interface[@name=current()])
969 ">
970 <xsl:value-of select="."/>
971 </xsl:when>
972 <!-- other types -->
973 <xsl:otherwise>
974 <xsl:message terminate="yes">
975 <xsl:text>Unknown parameter type: </xsl:text>
976 <xsl:value-of select="."/>
977 </xsl:message>
978 </xsl:otherwise>
979 </xsl:choose>
980 </xsl:otherwise>
981 </xsl:choose>
982 </xsl:otherwise>
983 </xsl:choose>
984</xsl:template>
985
986<xsl:template match="attribute/@type | param/@type" mode="forwarder">
987
988 <xsl:variable name="self_target" select="current()/ancestor::if/@target"/>
989
990 <xsl:choose>
991 <!-- modifiers (ignored for 'enumeration' attributes)-->
992 <xsl:when test="name(current())='type' and ../@mod">
993 <xsl:choose>
994 <xsl:when test="../@mod='ptr'">
995 <xsl:choose>
996 <!-- standard types -->
997 <!--xsl:when test=".='result'">??</xsl:when-->
998 <xsl:when test=".='boolean'">PRBool *</xsl:when>
999 <xsl:when test=".='octet'">PRUint8 *</xsl:when>
1000 <xsl:when test=".='short'">PRInt16 *</xsl:when>
1001 <xsl:when test=".='unsigned short'">PRUint16 *</xsl:when>
1002 <xsl:when test=".='long'">PRInt32 *</xsl:when>
1003 <xsl:when test=".='long long'">PRInt64 *</xsl:when>
1004 <xsl:when test=".='unsigned long'">PRUint32 *</xsl:when>
1005 <xsl:when test=".='unsigned long long'">PRUint64 *</xsl:when>
1006 <xsl:when test=".='char'">char *</xsl:when>
1007 <xsl:otherwise>
1008 <xsl:message terminate="yes">
1009 <xsl:value-of select="concat(../../../@name,'::',../../@name,'::',../@name,': ')"/>
1010 <xsl:text>attribute 'mod=</xsl:text>
1011 <xsl:value-of select="concat('&quot;',../@mod,'&quot;')"/>
1012 <xsl:text>' cannot be used with type </xsl:text>
1013 <xsl:value-of select="concat('&quot;',current(),'&quot;!')"/>
1014 </xsl:message>
1015 </xsl:otherwise>
1016 </xsl:choose>
1017 </xsl:when>
1018 <xsl:when test="../@mod='string'">
1019 <xsl:choose>
1020 <!-- standard types -->
1021 <!--xsl:when test=".='result'">??</xsl:when-->
1022 <xsl:when test=".='uuid'">PRUnichar *</xsl:when>
1023 <xsl:otherwise>
1024 <xsl:message terminate="yes">
1025 <xsl:value-of select="concat(../../../@name,'::',../../@name,'::',../@name,': ')"/>
1026 <xsl:text>attribute 'mod=</xsl:text>
1027 <xsl:value-of select="concat('&quot;',../@mod,'&quot;')"/>
1028 <xsl:text>' cannot be used with type </xsl:text>
1029 <xsl:value-of select="concat('&quot;',current(),'&quot;!')"/>
1030 </xsl:message>
1031 </xsl:otherwise>
1032 </xsl:choose>
1033 </xsl:when>
1034 </xsl:choose>
1035 </xsl:when>
1036 <!-- no modifiers -->
1037 <xsl:otherwise>
1038 <xsl:choose>
1039 <!-- standard types -->
1040 <xsl:when test=".='result'">nsresult</xsl:when>
1041 <xsl:when test=".='boolean'">PRBool</xsl:when>
1042 <xsl:when test=".='octet'">PRUint8</xsl:when>
1043 <xsl:when test=".='short'">PRInt16</xsl:when>
1044 <xsl:when test=".='unsigned short'">PRUint16</xsl:when>
1045 <xsl:when test=".='long'">PRInt32</xsl:when>
1046 <xsl:when test=".='long long'">PRInt64</xsl:when>
1047 <xsl:when test=".='unsigned long'">PRUint32</xsl:when>
1048 <xsl:when test=".='unsigned long long'">PRUint64</xsl:when>
1049 <xsl:when test=".='char'">char</xsl:when>
1050 <xsl:when test=".='wchar'">PRUnichar</xsl:when>
1051 <!-- string types -->
1052 <xsl:when test=".='string'">char *</xsl:when>
1053 <xsl:when test=".='wstring'">PRUnichar *</xsl:when>
1054 <!-- UUID type -->
1055 <xsl:when test=".='uuid'">
1056 <xsl:choose>
1057 <xsl:when test="name(..)='attribute'">
1058 <xsl:choose>
1059 <xsl:when test="../@readonly='yes'">
1060 <xsl:text>nsID *</xsl:text>
1061 </xsl:when>
1062 </xsl:choose>
1063 </xsl:when>
1064 <xsl:when test="name(..)='param'">
1065 <xsl:choose>
1066 <xsl:when test="../@dir='in' and not(../@safearray='yes')">
1067 <xsl:text>const nsID &amp;</xsl:text>
1068 </xsl:when>
1069 <xsl:otherwise>
1070 <xsl:text>nsID *</xsl:text>
1071 </xsl:otherwise>
1072 </xsl:choose>
1073 </xsl:when>
1074 </xsl:choose>
1075 </xsl:when>
1076 <!-- system interface types -->
1077 <xsl:when test=".='$unknown'">nsISupports *</xsl:when>
1078 <xsl:otherwise>
1079 <xsl:choose>
1080 <!-- enum types -->
1081 <xsl:when test="
1082 (ancestor::library/application/enum[@name=current()]) or
1083 (ancestor::library/application/if[@target=$self_target]/enum[@name=current()])
1084 ">
1085 <xsl:text>PRUint32</xsl:text>
1086 </xsl:when>
1087 <!-- custom interface types -->
1088 <xsl:when test="
1089 (ancestor::library/application/interface[@name=current()]) or
1090 (ancestor::library/application/if[@target=$self_target]/interface[@name=current()])
1091 ">
1092 <xsl:value-of select="."/>
1093 <xsl:text> *</xsl:text>
1094 </xsl:when>
1095 <!-- other types -->
1096 </xsl:choose>
1097 </xsl:otherwise>
1098 </xsl:choose>
1099 </xsl:otherwise>
1100 </xsl:choose>
1101</xsl:template>
1102
1103<!-- Filters for switch off VBoxSDS definitions -->
1104
1105<xsl:template match="application[@uuid='ec0e78e8-fa43-43e8-ac0a-02c784c4a4fa']//module/class" />
1106
1107<xsl:template match="application[@uuid='ec0e78e8-fa43-43e8-ac0a-02c784c4a4fa']/if//interface
1108| application[@uuid='ec0e78e8-fa43-43e8-ac0a-02c784c4a4fa']//interface" />
1109
1110<xsl:template match="application[@uuid='ec0e78e8-fa43-43e8-ac0a-02c784c4a4fa']//interface" mode="forward" />
1111
1112
1113</xsl:stylesheet>
1114
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