VirtualBox

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

Last change on this file since 106001 was 98103, checked in by vboxsync, 23 months ago

Copyright year updates by scm.

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