VirtualBox

source: vbox/trunk/src/VBox/Main/idl/doxygen.xsl@ 14481

Last change on this file since 14481 was 14469, checked in by vboxsync, 16 years ago

Main: XIDL: Added support for <result> tags in <library> (MIDL, XPIDL, Doxygen). Added a couple of exemplary VBOX_E_ result codes.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 24.4 KB
Line 
1<?xml version="1.0"?>
2
3<!--
4 * A template to generate a generic IDL file from the generic interface
5 * definition expressed in XML. The generated file is intended solely to
6 * generate the documentation using Doxygen.
7
8 Copyright (C) 2006-2007 Sun Microsystems, Inc.
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 Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
19 Clara, CA 95054 USA or visit http://www.sun.com if you need
20 additional information or have any questions.
21-->
22
23<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
24<xsl:output method="html" indent="yes"/>
25
26<xsl:strip-space elements="*"/>
27
28
29<!--
30// helper definitions
31/////////////////////////////////////////////////////////////////////////////
32-->
33
34<!--
35 * uncapitalizes the first letter only if the second one is not capital
36 * otherwise leaves the string unchanged
37-->
38<xsl:template name="uncapitalize">
39 <xsl:param name="str" select="."/>
40 <xsl:choose>
41 <xsl:when test="not(contains('ABCDEFGHIJKLMNOPQRSTUVWXYZ', substring($str,2,1)))">
42 <xsl:value-of select="
43 concat(
44 translate(substring($str,1,1),'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz'),
45 substring($str,2)
46 )
47 "/>
48 </xsl:when>
49 <xsl:otherwise>
50 <xsl:value-of select="string($str)"/>
51 </xsl:otherwise>
52 </xsl:choose>
53</xsl:template>
54
55<!--
56 * translates the string to uppercase
57-->
58<xsl:template name="uppercase">
59 <xsl:param name="str" select="."/>
60 <xsl:value-of select="
61 translate($str,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')
62 "/>
63</xsl:template>
64
65
66<!--
67// Doxygen transformation rules
68/////////////////////////////////////////////////////////////////////////////
69-->
70
71<!--
72 * all text elements that are not explicitly matched are normalized
73 * (all whitespace chars are converted to single spaces)
74-->
75<!--xsl:template match="desc//text()">
76 <xsl:value-of select="concat(' ',normalize-space(.),' ')"/>
77</xsl:template-->
78
79<!--
80 * all elements that are not explicitly matched are considered to be html tags
81 * and copied w/o modifications
82-->
83<xsl:template match="desc//*">
84 <xsl:copy>
85 <xsl:apply-templates/>
86 </xsl:copy>
87</xsl:template>
88
89<!--
90 * paragraph
91-->
92<xsl:template match="desc//p">
93 <xsl:text>&#x0A;</xsl:text>
94 <xsl:apply-templates/>
95 <xsl:text>&#x0A;</xsl:text>
96</xsl:template>
97
98<!--
99 * link
100-->
101<xsl:template match="desc//link">
102 <xsl:text>@link </xsl:text>
103 <!--
104 * sometimes Doxygen is stupid and cannot resolve global enums properly,
105 * thinking they are members of the current class. Fix it by adding ::
106 * in front of any @to value that doesn't start with #.
107 -->
108 <xsl:choose>
109 <xsl:when test="not(starts-with(@to, '#')) and not(contains(@to, '::'))">
110 <xsl:text>::</xsl:text>
111 </xsl:when>
112 </xsl:choose>
113 <!--
114 * Doxygen doesn't understand autolinks like Class::func() if Class
115 * doesn't actually contain a func with no arguments. Fix it.
116 -->
117 <xsl:choose>
118 <xsl:when test="substring(@to, string-length(@to)-1)='()'">
119 <xsl:value-of select="substring-before(@to, '()')"/>
120 </xsl:when>
121 <xsl:otherwise>
122 <xsl:value-of select="@to"/>
123 </xsl:otherwise>
124 </xsl:choose>
125 <xsl:text> </xsl:text>
126 <xsl:choose>
127 <xsl:when test="normalize-space(text())">
128 <xsl:value-of select="normalize-space(text())"/>
129 </xsl:when>
130 <xsl:otherwise>
131 <xsl:choose>
132 <xsl:when test="starts-with(@to, '#')">
133 <xsl:value-of select="substring-after(@to, '#')"/>
134 </xsl:when>
135 <xsl:when test="starts-with(@to, '::')">
136 <xsl:value-of select="substring-after(@to, '::')"/>
137 </xsl:when>
138 <xsl:otherwise>
139 <xsl:value-of select="@to"/>
140 </xsl:otherwise>
141 </xsl:choose>
142 </xsl:otherwise>
143 </xsl:choose>
144 <xsl:text>@endlink</xsl:text>
145 <!--
146 * insert a dummy empty B element to distinctly separate @endlink
147 * from the following text
148 -->
149 <xsl:element name="b"/>
150</xsl:template>
151
152<!--
153 * note
154-->
155<xsl:template match="desc/note">
156 <xsl:text>&#x0A;@note </xsl:text>
157 <xsl:apply-templates/>
158 <xsl:text>&#x0A;</xsl:text>
159</xsl:template>
160
161<!--
162 * see
163-->
164<xsl:template match="desc/see">
165 <xsl:text>&#x0A;@see </xsl:text>
166 <xsl:apply-templates/>
167 <xsl:text>&#x0A;</xsl:text>
168</xsl:template>
169
170<!--
171 * comment for interfaces
172-->
173<xsl:template match="interface/desc">
174 <xsl:text>/**&#x0A;</xsl:text>
175 <xsl:apply-templates select="text() | *[not(self::note or self::see)]"/>
176 <xsl:apply-templates select="note"/>
177 <xsl:apply-templates select="see"/>
178@par Interface ID:
179<tt>{<xsl:call-template name="uppercase">
180 <xsl:with-param name="str" select="../@uuid"/>
181 </xsl:call-template>}</tt>
182 <xsl:text>&#x0A;*/&#x0A;</xsl:text>
183</xsl:template>
184
185<!--
186 * comment for attributes
187-->
188<xsl:template match="attribute/desc">
189 <xsl:text>/**&#x0A;</xsl:text>
190 <xsl:apply-templates select="text() | *[not(self::note or self::see)]"/>
191 <xsl:apply-templates select="note"/>
192 <xsl:if test="../@mod='ptr'">
193 <xsl:text>
194
195@warning This attribute is non-scriptable. In particular, this also means that an
196attempt to get or set it from a process other than the process that has created and
197owns the object will most likely fail or crash your application.
198</xsl:text>
199 </xsl:if>
200 <xsl:apply-templates select="see"/>
201 <xsl:text>&#x0A;*/&#x0A;</xsl:text>
202</xsl:template>
203
204<!--
205 * comment for methods
206-->
207<xsl:template match="method/desc">
208 <xsl:text>/**&#x0A;</xsl:text>
209 <xsl:apply-templates select="text() | *[not(self::note or self::see)]"/>
210 <xsl:for-each select="../param">
211 <xsl:apply-templates select="desc"/>
212 </xsl:for-each>
213 <xsl:apply-templates select="note"/>
214 <xsl:apply-templates select="../param/desc/note"/>
215 <xsl:if test="../param/@mod='ptr'">
216 <xsl:text>
217
218@warning This method is non-scriptable. In particular, this also means that an
219attempt to call it from a process other than the process that has created and
220owns the object will most likely fail or crash your application.
221</xsl:text>
222 </xsl:if>
223 <xsl:apply-templates select="see"/>
224 <xsl:text>&#x0A;*/&#x0A;</xsl:text>
225</xsl:template>
226
227<!--
228 * comment for method parameters
229-->
230<xsl:template match="method/param/desc">
231 <xsl:text>&#x0A;@param </xsl:text>
232 <xsl:value-of select="../@name"/>
233 <xsl:text> </xsl:text>
234 <xsl:apply-templates select="text() | *[not(self::note or self::see)]"/>
235 <xsl:text>&#x0A;</xsl:text>
236</xsl:template>
237
238<!--
239 * comment for enums
240-->
241<xsl:template match="enum/desc">
242 <xsl:text>/**&#x0A;</xsl:text>
243 <xsl:apply-templates select="text() | *[not(self::note or self::see)]"/>
244 <xsl:apply-templates select="note"/>
245 <xsl:apply-templates select="see"/>
246@par Interface ID:
247<tt>{<xsl:call-template name="uppercase">
248 <xsl:with-param name="str" select="../@uuid"/>
249 </xsl:call-template>}</tt>
250 <xsl:text>&#x0A;*/&#x0A;</xsl:text>
251</xsl:template>
252
253<!--
254 * comment for enum values
255-->
256<xsl:template match="enum/const/desc">
257 <xsl:text>/** @brief </xsl:text>
258 <xsl:apply-templates select="text() | *[not(self::note or self::see)]"/>
259 <xsl:apply-templates select="note"/>
260 <xsl:apply-templates select="see"/>
261 <xsl:text>&#x0A;*/&#x0A;</xsl:text>
262</xsl:template>
263
264<!--
265 * comment for result codes
266-->
267<xsl:template match="result/desc">
268 <xsl:text>/** @brief </xsl:text>
269 <xsl:apply-templates select="text() | *[not(self::note or self::see)]"/>
270 <xsl:apply-templates select="note"/>
271 <xsl:apply-templates select="see"/>
272 <xsl:text>&#x0A;*/&#x0A;</xsl:text>
273</xsl:template>
274
275<!--
276// templates
277/////////////////////////////////////////////////////////////////////////////
278-->
279
280
281<!--
282 * header
283-->
284<xsl:template match="/idl">
285/*
286 * DO NOT EDIT! This is a generated file.
287 *
288 * Doxygen IDL definition for VirtualBox Main API (COM interfaces)
289 * generated from XIDL (XML interface definition).
290 *
291 * Source : src/VBox/Main/idl/VirtualBox.xidl
292 * Generator : src/VBox/Main/idl/doxygen.xsl
293 *
294 * This IDL is generated using some generic OMG IDL-like syntax SOLELY
295 * for the purpose of generating the documentation using Doxygen and
296 * is not syntactically valid.
297 *
298 * DO NOT USE THIS HEADER IN ANY OTHER WAY!
299 */
300
301/** @mainpage
302 *
303 * Welcome to the <b>VirtualBox Main documentation.</b> This describes the
304 * so-called VirtualBox "Main API", which comprises all public COM interfaces
305 * and components provided by the VirtualBox server and by the VirtualBox client
306 * library.
307 *
308 * VirtualBox employs a client-server design, meaning that whenever any part of
309 * VirtualBox is running -- be it the Qt GUI, the VBoxManage command-line
310 * interface or any virtual machine --, a background server process named
311 * VBoxSVC runs in the background. This allows multiple processes to cooperate
312 * without conflicts. Some of the COM objects described by this Main documentation
313 * "live" in that server process, others "live" in the local client process. In
314 * any case, processes that use the Main API are using inter-process communication
315 * to communicate with these objects, but the details of this are hidden by the COM API.
316 *
317 * On Windows platforms, the VirtualBox Main API uses Microsoft COM, a native COM
318 * implementation. On all other platforms, Mozilla XPCOM, an open-source COM
319 * implementation, is used.
320 *
321 * All the parts that a typical VirtualBox user interacts with (the Qt GUI,
322 * the VBoxManage command-line interface and the VBoxVRDP server) are technically
323 * front-ends to the Main API and only use the interfaces that are documented
324 * in this Main API documentation. This ensures that, with any given release
325 * version of VirtualBox, all capabilities of the product that could be useful
326 * to an external client program are always exposed by way of this API.
327 *
328 * The complete API is described in a source IDL file, called VirtualBox.idl.
329 * This contains all public interfaces exposed by the Main API. Two interfaces
330 * are of supreme importance and will be needed in order for any front-end program
331 * to do anything useful: these are IVirtualBox and ISession. It is recommended
332 * to read the documentation of these interfaces first.
333 *
334 * @note VirtualBox.idl is automatically generated from a generic internal file
335 * to define all interfaces in a platform-independent way for documentation
336 * purposes. This generated file is not a syntactically valid IDL file and
337 * <i>must not</i> be used for programming.
338 */
339 <xsl:text>&#x0A;</xsl:text>
340 <xsl:apply-templates/>
341</xsl:template>
342
343
344<!--
345 * accept all <if>s
346-->
347<xsl:template match="if">
348 <xsl:apply-templates/>
349</xsl:template>
350
351
352<!--
353 * cpp_quote (ignore)
354-->
355<xsl:template match="cpp">
356</xsl:template>
357
358
359<!--
360 * #ifdef statement (@if attribute)
361-->
362<xsl:template match="@if" mode="begin">
363 <xsl:text>#if </xsl:text>
364 <xsl:value-of select="."/>
365 <xsl:text>&#x0A;</xsl:text>
366</xsl:template>
367<xsl:template match="@if" mode="end">
368 <xsl:text>#endif&#x0A;</xsl:text>
369</xsl:template>
370
371
372<!--
373 * libraries
374-->
375<xsl:template match="library">
376 <!-- result codes -->
377 <xsl:text>
378/** @defgroup VirtualBox_COM_result_codes VirtualBox COM result codes
379 *
380 * This section describes all VirtualBox-specific COM result codes that may be
381 * returned by methods of VirtualBox COM interfaces in addition to standard COM
382 * result codes.
383 *
384 * Note that in addition to a result code, every VirtualBox method returns extended
385 * error information through the IVirtualBoxErrorInfo interface on failure. This
386 * interface is a preferred way to present the error to the end user because it
387 * contains a human readable description of the error. Raw result codes (both
388 * standard and described in this section) are intended to be used by programs
389 * to analyze the reason of a failure and select an appropriate action without
390 * involving the end user (for example, retry the operation later or make a
391 * different call).
392 *
393 * @todo List what standard codes may originate from our methods.
394 */
395/*@{*/
396 </xsl:text>
397 <xsl:for-each select="result">
398 <xsl:apply-templates select="."/>
399 </xsl:for-each>
400 <xsl:text>
401/*@}*/
402
403 </xsl:text>
404 <!-- all enums go first -->
405 <xsl:apply-templates select="enum | if/enum"/>
406 <!-- everything else but result codes and enums -->
407 <xsl:apply-templates select="*[not(self::result or self::enum) and
408 not(self::if[result] or self::if[enum])]"/>
409</xsl:template>
410
411
412<!--
413 * result codes
414-->
415<xsl:template match="result">
416 <xsl:apply-templates select="@if" mode="begin"/>
417 <xsl:apply-templates select="desc"/>
418 <xsl:value-of select="concat('const HRESULT ',@name,' = ',@value,';')"/>
419 <xsl:text>&#x0A;</xsl:text>
420 <xsl:apply-templates select="@if" mode="end"/>
421</xsl:template>
422
423
424<!--
425 * interfaces
426-->
427<xsl:template match="interface">
428 <xsl:apply-templates select="desc"/>
429 <xsl:text>interface </xsl:text>
430 <xsl:value-of select="@name"/>
431 <xsl:text> : </xsl:text>
432 <xsl:value-of select="@extends"/>
433 <xsl:text>&#x0A;{&#x0A;</xsl:text>
434 <!-- attributes (properties) -->
435 <xsl:apply-templates select="attribute"/>
436 <!-- methods -->
437 <xsl:apply-templates select="method"/>
438 <!-- 'if' enclosed elements, unsorted -->
439 <xsl:apply-templates select="if"/>
440 <!-- -->
441 <xsl:text>}; /* interface </xsl:text>
442 <xsl:value-of select="@name"/>
443 <xsl:text> */&#x0A;&#x0A;</xsl:text>
444</xsl:template>
445
446
447<!--
448 * attributes
449-->
450<xsl:template match="interface//attribute | collection//attribute">
451 <xsl:if test="@array">
452 <xsl:message terminate="yes">
453 <xsl:value-of select="concat(../../@name,'::',../@name,'::',@name,': ')"/>
454 <xsl:text>'array' attributes are not supported, use 'safearray="yes"' instead.</xsl:text>
455 </xsl:message>
456 </xsl:if>
457 <xsl:apply-templates select="@if" mode="begin"/>
458 <xsl:apply-templates select="desc"/>
459 <xsl:text> </xsl:text>
460 <xsl:if test="@readonly='yes'">
461 <xsl:text>readonly </xsl:text>
462 </xsl:if>
463 <xsl:text>attribute </xsl:text>
464 <xsl:apply-templates select="@type"/>
465 <xsl:text> </xsl:text>
466 <xsl:value-of select="@name"/>
467 <xsl:text>;&#x0A;</xsl:text>
468 <xsl:apply-templates select="@if" mode="end"/>
469 <xsl:text>&#x0A;</xsl:text>
470</xsl:template>
471
472<!--
473 * methods
474-->
475<xsl:template match="interface//method | collection//method">
476 <xsl:apply-templates select="@if" mode="begin"/>
477 <xsl:apply-templates select="desc"/>
478 <xsl:text> void </xsl:text>
479 <xsl:value-of select="@name"/>
480 <xsl:if test="param">
481 <xsl:text> (&#x0A;</xsl:text>
482 <xsl:for-each select="param [position() != last()]">
483 <xsl:text> </xsl:text>
484 <xsl:apply-templates select="."/>
485 <xsl:text>,&#x0A;</xsl:text>
486 </xsl:for-each>
487 <xsl:text> </xsl:text>
488 <xsl:apply-templates select="param [last()]"/>
489 <xsl:text>&#x0A; );&#x0A;</xsl:text>
490 </xsl:if>
491 <xsl:if test="not(param)">
492 <xsl:text>();&#x0A;</xsl:text>
493 </xsl:if>
494 <xsl:apply-templates select="@if" mode="end"/>
495 <xsl:text>&#x0A;</xsl:text>
496</xsl:template>
497
498
499<!--
500 * co-classes
501-->
502<xsl:template match="module/class">
503 <!-- class and contract id: later -->
504 <!-- CLSID_xxx declarations for XPCOM, for compatibility with Win32: later -->
505</xsl:template>
506
507
508<!--
509 * enumerators
510-->
511<xsl:template match="enumerator">
512 <xsl:text>interface </xsl:text>
513 <xsl:value-of select="@name"/>
514 <xsl:text> : $unknown&#x0A;{&#x0A;</xsl:text>
515 <!-- HasMore -->
516 <xsl:text> void hasMore ([retval] out boolean more);&#x0A;&#x0A;</xsl:text>
517 <!-- GetNext -->
518 <xsl:text> void getNext ([retval] out </xsl:text>
519 <xsl:apply-templates select="@type"/>
520 <xsl:text> next);&#x0A;&#x0A;</xsl:text>
521 <!-- -->
522 <xsl:text>}; /* interface </xsl:text>
523 <xsl:value-of select="@name"/>
524 <xsl:text> */&#x0A;&#x0A;</xsl:text>
525</xsl:template>
526
527
528<!--
529 * collections
530-->
531<xsl:template match="collection">
532 <xsl:if test="not(@readonly='yes')">
533 <xsl:message terminate="yes">
534 <xsl:value-of select="concat(@name,': ')"/>
535 <xsl:text>non-readonly collections are not currently supported</xsl:text>
536 </xsl:message>
537 </xsl:if>
538 <xsl:text>interface </xsl:text>
539 <xsl:value-of select="@name"/>
540 <xsl:text> : $unknown&#x0A;{&#x0A;</xsl:text>
541 <!-- Count -->
542 <xsl:text> readonly attribute unsigned long count;&#x0A;&#x0A;</xsl:text>
543 <!-- GetItemAt -->
544 <xsl:text> void getItemAt (in unsigned long index, [retval] out </xsl:text>
545 <xsl:apply-templates select="@type"/>
546 <xsl:text> item);&#x0A;&#x0A;</xsl:text>
547 <!-- Enumerate -->
548 <xsl:text> void enumerate ([retval] out </xsl:text>
549 <xsl:apply-templates select="@enumerator"/>
550 <xsl:text> enumerator);&#x0A;&#x0A;</xsl:text>
551 <!-- other extra attributes (properties) -->
552 <xsl:apply-templates select="attribute"/>
553 <!-- other extra methods -->
554 <xsl:apply-templates select="method"/>
555 <!-- 'if' enclosed elements, unsorted -->
556 <xsl:apply-templates select="if"/>
557 <!-- -->
558 <xsl:text>}; /* interface </xsl:text>
559 <xsl:value-of select="@name"/>
560 <xsl:text> */&#x0A;&#x0A;</xsl:text>
561</xsl:template>
562
563
564<!--
565 * enums
566-->
567<xsl:template match="enum">
568 <xsl:apply-templates select="desc"/>
569 <xsl:text>enum </xsl:text>
570 <xsl:value-of select="@name"/>
571 <xsl:text>&#x0A;{&#x0A;</xsl:text>
572 <xsl:for-each select="const">
573 <xsl:apply-templates select="desc"/>
574 <xsl:text> </xsl:text>
575 <xsl:value-of select="@name"/> = <xsl:value-of select="@value"/>
576 <xsl:text>,&#x0A;</xsl:text>
577 </xsl:for-each>
578 <xsl:text>};&#x0A;&#x0A;</xsl:text>
579</xsl:template>
580
581
582<!--
583 * method parameters
584-->
585<xsl:template match="method/param">
586 <xsl:if test="@array">
587 <xsl:if test="@dir='return'">
588 <xsl:message terminate="yes">
589 <xsl:value-of select="concat(../../@name,'::',../@name,'::',@name,': ')"/>
590 <xsl:text>return 'array' parameters are not supported, use 'safearray="yes"' instead.</xsl:text>
591 </xsl:message>
592 </xsl:if>
593 <xsl:text>[array, </xsl:text>
594 <xsl:choose>
595 <xsl:when test="../param[@name=current()/@array]">
596 <xsl:if test="../param[@name=current()/@array]/@dir != @dir">
597 <xsl:message terminate="yes">
598 <xsl:value-of select="concat(../../@name,'::',../@name,': ')"/>
599 <xsl:value-of select="concat(@name,' and ',../param[@name=current()/@array]/@name)"/>
600 <xsl:text> must have the same direction</xsl:text>
601 </xsl:message>
602 </xsl:if>
603 <xsl:text>size_is(</xsl:text>
604 <xsl:if test="@dir='out'">
605 <xsl:text>, </xsl:text>
606 </xsl:if>
607 <xsl:if test="../param[@name=current()/@array]/@dir='out'">
608 <xsl:text>*</xsl:text>
609 </xsl:if>
610 <xsl:value-of select="@array"/>
611 <xsl:text>)</xsl:text>
612 </xsl:when>
613 <xsl:otherwise>
614 <xsl:message terminate="yes">
615 <xsl:value-of select="concat(../../@name,'::',../@name,'::',@name,': ')"/>
616 <xsl:text>array attribute refers to non-existent param: </xsl:text>
617 <xsl:value-of select="@array"/>
618 </xsl:message>
619 </xsl:otherwise>
620 </xsl:choose>
621 <xsl:text>] </xsl:text>
622 </xsl:if>
623 <xsl:choose>
624 <xsl:when test="@dir='in'">in </xsl:when>
625 <xsl:when test="@dir='out'">out </xsl:when>
626 <xsl:when test="@dir='return'">[retval] out </xsl:when>
627 <xsl:otherwise>in</xsl:otherwise>
628 </xsl:choose>
629 <xsl:apply-templates select="@type"/>
630 <xsl:text> </xsl:text>
631 <xsl:value-of select="@name"/>
632</xsl:template>
633
634
635<!--
636 * attribute/parameter type conversion
637-->
638<xsl:template match="
639 attribute/@type | param/@type |
640 enumerator/@type | collection/@type | collection/@enumerator
641">
642 <xsl:variable name="self_target" select="current()/ancestor::if/@target"/>
643
644 <xsl:if test="../@array and ../@safearray='yes'">
645 <xsl:message terminate="yes">
646 <xsl:value-of select="concat(../../../@name,'::',../../@name,'::',../@name,': ')"/>
647 <xsl:text>either 'array' or 'safearray="yes"' attribute is allowed, but not both!</xsl:text>
648 </xsl:message>
649 </xsl:if>
650
651 <xsl:choose>
652 <!-- modifiers (ignored for 'enumeration' attributes)-->
653 <xsl:when test="name(current())='type' and ../@mod">
654 <xsl:choose>
655 <xsl:when test="../@mod='ptr'">
656 <xsl:choose>
657 <!-- standard types -->
658 <!--xsl:when test=".='result'">??</xsl:when-->
659 <xsl:when test=".='boolean'">booleanPtr</xsl:when>
660 <xsl:when test=".='octet'">octetPtr</xsl:when>
661 <xsl:when test=".='short'">shortPtr</xsl:when>
662 <xsl:when test=".='unsigned short'">ushortPtr</xsl:when>
663 <xsl:when test=".='long'">longPtr</xsl:when>
664 <xsl:when test=".='long long'">llongPtr</xsl:when>
665 <xsl:when test=".='unsigned long'">ulongPtr</xsl:when>
666 <xsl:when test=".='unsigned long long'">ullongPtr</xsl:when>
667 <xsl:when test=".='char'">charPtr</xsl:when>
668 <!--xsl:when test=".='string'">??</xsl:when-->
669 <xsl:when test=".='wchar'">wcharPtr</xsl:when>
670 <!--xsl:when test=".='wstring'">??</xsl:when-->
671 <xsl:otherwise>
672 <xsl:message terminate="yes">
673 <xsl:value-of select="concat(../../../@name,'::',../../@name,'::',../@name,': ')"/>
674 <xsl:text>attribute 'mod=</xsl:text>
675 <xsl:value-of select="concat('&quot;',../@mod,'&quot;')"/>
676 <xsl:text>' cannot be used with type </xsl:text>
677 <xsl:value-of select="concat('&quot;',current(),'&quot;!')"/>
678 </xsl:message>
679 </xsl:otherwise>
680 </xsl:choose>
681 </xsl:when>
682 <xsl:otherwise>
683 <xsl:message terminate="yes">
684 <xsl:value-of select="concat(../../../@name,'::',../../@name,'::',../@name,': ')"/>
685 <xsl:value-of select="concat('value &quot;',../@mod,'&quot; ')"/>
686 <xsl:text>of attribute 'mod' is invalid!</xsl:text>
687 </xsl:message>
688 </xsl:otherwise>
689 </xsl:choose>
690 </xsl:when>
691 <!-- no modifiers -->
692 <xsl:otherwise>
693 <xsl:choose>
694 <!-- standard types -->
695 <xsl:when test=".='result'">result</xsl:when>
696 <xsl:when test=".='boolean'">boolean</xsl:when>
697 <xsl:when test=".='octet'">octet</xsl:when>
698 <xsl:when test=".='short'">short</xsl:when>
699 <xsl:when test=".='unsigned short'">unsigned short</xsl:when>
700 <xsl:when test=".='long'">long</xsl:when>
701 <xsl:when test=".='long long'">long long</xsl:when>
702 <xsl:when test=".='unsigned long'">unsigned long</xsl:when>
703 <xsl:when test=".='unsigned long long'">unsigned long long</xsl:when>
704 <xsl:when test=".='char'">char</xsl:when>
705 <xsl:when test=".='wchar'">wchar</xsl:when>
706 <xsl:when test=".='string'">string</xsl:when>
707 <xsl:when test=".='wstring'">wstring</xsl:when>
708 <!-- UUID type -->
709 <xsl:when test=".='uuid'">uuid</xsl:when>
710 <!-- system interface types -->
711 <xsl:when test=".='$unknown'">$unknown</xsl:when>
712 <xsl:otherwise>
713 <xsl:choose>
714 <!-- enum types -->
715 <xsl:when test="
716 (ancestor::library/enum[@name=current()]) or
717 (ancestor::library/if[@target=$self_target]/enum[@name=current()])
718 ">
719 <xsl:value-of select="."/>
720 </xsl:when>
721 <!-- custom interface types -->
722 <xsl:when test="
723 (name(current())='enumerator' and
724 ((ancestor::library/enumerator[@name=current()]) or
725 (ancestor::library/if[@target=$self_target]/enumerator[@name=current()]))
726 ) or
727 ((ancestor::library/interface[@name=current()]) or
728 (ancestor::library/if[@target=$self_target]/interface[@name=current()])
729 ) or
730 ((ancestor::library/collection[@name=current()]) or
731 (ancestor::library/if[@target=$self_target]/collection[@name=current()])
732 )
733 ">
734 <xsl:value-of select="."/>
735 </xsl:when>
736 <!-- other types -->
737 <xsl:otherwise>
738 <xsl:message terminate="yes">
739 <xsl:text>Unknown parameter type: </xsl:text>
740 <xsl:value-of select="."/>
741 </xsl:message>
742 </xsl:otherwise>
743 </xsl:choose>
744 </xsl:otherwise>
745 </xsl:choose>
746 </xsl:otherwise>
747 </xsl:choose>
748 <xsl:if test="../@safearray='yes'">
749 <xsl:text>[]</xsl:text>
750 </xsl:if>
751</xsl:template>
752
753</xsl:stylesheet>
754
Note: See TracBrowser for help on using the repository browser.

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