VirtualBox

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

Last change on this file since 93105 was 82969, checked in by vboxsync, 5 years ago

Copyright year updates - manual ones.

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