VirtualBox

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

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

Main/XIDL: Added recognition of the following new tags:

  • <desc>/<result> in <method> and <attribute>;
  • <descGroup> everywhere to define logical description groups (modules in doxygen);
  • <desc> in <idl> to generat main documentation page.
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 23.3 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<!--
172 * common comment prologue (handles group IDs)
173-->
174<xsl:template match="desc" mode="begin">
175 <xsl:text>/**&#x0A;</xsl:text>
176 <xsl:param name="id" select="@group | preceding::descGroup[1]/@id"/>
177 <xsl:if test="$id">
178 <xsl:value-of select="concat(' @ingroup ',$id,'&#x0A;')"/>
179 </xsl:if>
180</xsl:template>
181
182<!--
183 * common brief comment prologue (handles group IDs)
184-->
185<xsl:template match="desc" mode="begin_brief">
186 <xsl:text>/**&#x0A;</xsl:text>
187 <xsl:param name="id" select="@group | preceding::descGroup[1]/@id"/>
188 <xsl:if test="$id">
189 <xsl:value-of select="concat(' @ingroup ',$id,'&#x0A;')"/>
190 </xsl:if>
191 <xsl:text> @brief&#x0A;</xsl:text>
192</xsl:template>
193
194<!--
195 * common middle part of the comment block
196-->
197<xsl:template match="desc" mode="middle">
198 <xsl:apply-templates select="text() | *[not(self::note or self::see)]"/>
199 <xsl:apply-templates select="note"/>
200 <xsl:apply-templates select="see"/>
201</xsl:template>
202
203<!--
204 * result part of the comment block
205-->
206<xsl:template match="desc" mode="results">
207 <xsl:if test="result">
208 <xsl:text>
209 @par Expected result codes:
210 </xsl:text>
211 <table>
212 <xsl:for-each select="result">
213 <tr>
214 <xsl:choose>
215 <xsl:when test="ancestor::library/result[@name=current()/@name]">
216 <td><xsl:value-of select=
217 "concat('@link ::',@name,' ',@name,' @endlink')"/></td>
218 </xsl:when>
219 <xsl:otherwise>
220 <td><xsl:value-of select="@name"/></td>
221 </xsl:otherwise>
222 </xsl:choose>
223 <td><xsl:value-of select="text()"/></td>
224 </tr>
225 </xsl:for-each>
226 </table>
227 </xsl:if>
228</xsl:template>
229
230
231<!--
232 * comment for interfaces
233-->
234<xsl:template match="interface/desc">
235 <xsl:apply-templates select="." mode="begin"/>
236 <xsl:apply-templates select="." mode="middle"/>
237@par Interface ID:
238<tt>{<xsl:call-template name="uppercase">
239 <xsl:with-param name="str" select="../@uuid"/>
240 </xsl:call-template>}</tt>
241 <xsl:text>&#x0A;*/&#x0A;</xsl:text>
242</xsl:template>
243
244<!--
245 * comment for attributes
246-->
247<xsl:template match="attribute/desc">
248 <xsl:apply-templates select="." mode="begin"/>
249 <xsl:apply-templates select="text() | *[not(self::note or self::see)]"/>
250 <xsl:apply-templates select="." mode="results"/>
251 <xsl:apply-templates select="note"/>
252 <xsl:if test="../@mod='ptr'">
253 <xsl:text>
254
255@warning This attribute is non-scriptable. In particular, this also means that an
256attempt to get or set it from a process other than the process that has created and
257owns the object will most likely fail or crash your application.
258</xsl:text>
259 </xsl:if>
260 <xsl:apply-templates select="see"/>
261 <xsl:text>&#x0A;*/&#x0A;</xsl:text>
262</xsl:template>
263
264<!--
265 * comment for methods
266-->
267<xsl:template match="method/desc">
268 <xsl:apply-templates select="." mode="begin"/>
269 <xsl:apply-templates select="text() | *[not(self::note or self::see)]"/>
270 <xsl:for-each select="../param">
271 <xsl:apply-templates select="desc"/>
272 </xsl:for-each>
273 <xsl:apply-templates select="." mode="results"/>
274 <xsl:apply-templates select="note"/>
275 <xsl:apply-templates select="../param/desc/note"/>
276 <xsl:if test="../param/@mod='ptr'">
277 <xsl:text>
278
279@warning This method is non-scriptable. In particular, this also means that an
280attempt to call it from a process other than the process that has created and
281owns the object will most likely fail or crash your application.
282</xsl:text>
283 </xsl:if>
284 <xsl:apply-templates select="see"/>
285 <xsl:text>&#x0A;*/&#x0A;</xsl:text>
286</xsl:template>
287
288<!--
289 * comment for method parameters
290-->
291<xsl:template match="method/param/desc">
292 <xsl:text>&#x0A;@param </xsl:text>
293 <xsl:value-of select="../@name"/>
294 <xsl:text> </xsl:text>
295 <xsl:apply-templates select="text() | *[not(self::note or self::see)]"/>
296 <xsl:text>&#x0A;</xsl:text>
297</xsl:template>
298
299<!--
300 * comment for enums
301-->
302<xsl:template match="enum/desc">
303 <xsl:apply-templates select="." mode="begin"/>
304 <xsl:apply-templates select="." mode="middle"/>
305@par Interface ID:
306<tt>{<xsl:call-template name="uppercase">
307 <xsl:with-param name="str" select="../@uuid"/>
308 </xsl:call-template>}</tt>
309 <xsl:text>&#x0A;*/&#x0A;</xsl:text>
310</xsl:template>
311
312<!--
313 * comment for enum values
314-->
315<xsl:template match="enum/const/desc">
316 <xsl:apply-templates select="." mode="begin_brief"/>
317 <xsl:apply-templates select="." mode="middle"/>
318 <xsl:text>&#x0A;*/&#x0A;</xsl:text>
319</xsl:template>
320
321<!--
322 * comment for result codes
323-->
324<xsl:template match="result/desc">
325 <xsl:apply-templates select="." mode="begin_brief"/>
326 <xsl:apply-templates select="." mode="middle"/>
327 <xsl:text>&#x0A;*/&#x0A;</xsl:text>
328</xsl:template>
329
330<!--
331 * ignore descGroups by default (processed in /idl)
332-->
333<xsl:template match="descGroup"/>
334
335<!--
336// templates
337/////////////////////////////////////////////////////////////////////////////
338-->
339
340
341<!--
342 * header
343-->
344<xsl:template match="/idl">
345/*
346 * DO NOT EDIT! This is a generated file.
347 *
348 * Doxygen IDL definition for VirtualBox Main API (COM interfaces)
349 * generated from XIDL (XML interface definition).
350 *
351 * Source : src/VBox/Main/idl/VirtualBox.xidl
352 * Generator : src/VBox/Main/idl/doxygen.xsl
353 *
354 * This IDL is generated using some generic OMG IDL-like syntax SOLELY
355 * for the purpose of generating the documentation using Doxygen and
356 * is not syntactically valid.
357 *
358 * DO NOT USE THIS HEADER IN ANY OTHER WAY!
359 */
360
361 <!-- general description -->
362 <xsl:text>/** @mainpage &#x0A;</xsl:text>
363 <xsl:apply-templates select="desc" mode="middle"/>
364 <xsl:text>&#x0A;*/&#x0A;</xsl:text>
365
366 <!-- group (module) definitions -->
367 <xsl:for-each select="//descGroup">
368 <xsl:if test="@id and (@title or desc)">
369 <xsl:value-of select="concat('/** @defgroup ',@id,' ',@title)"/>
370 <xsl:apply-templates select="desc" mode="middle"/>
371 <xsl:text>&#x0A;*/&#x0A;</xsl:text>
372 </xsl:if>
373 </xsl:for-each>
374
375 <!-- everything else -->
376 <xsl:apply-templates select="*[not(self::desc)]"/>
377
378</xsl:template>
379
380
381<!--
382 * accept all <if>s
383-->
384<xsl:template match="if">
385 <xsl:apply-templates/>
386</xsl:template>
387
388
389<!--
390 * cpp_quote (ignore)
391-->
392<xsl:template match="cpp">
393</xsl:template>
394
395
396<!--
397 * #ifdef statement (@if attribute)
398-->
399<xsl:template match="@if" mode="begin">
400 <xsl:text>#if </xsl:text>
401 <xsl:value-of select="."/>
402 <xsl:text>&#x0A;</xsl:text>
403</xsl:template>
404<xsl:template match="@if" mode="end">
405 <xsl:text>#endif&#x0A;</xsl:text>
406</xsl:template>
407
408
409<!--
410 * libraries
411-->
412<xsl:template match="library">
413 <!-- result codes -->
414 <xsl:for-each select="result">
415 <xsl:apply-templates select="."/>
416 </xsl:for-each>
417 <!-- all enums go first -->
418 <xsl:apply-templates select="enum | if/enum"/>
419 <!-- everything else but result codes and enums -->
420 <xsl:apply-templates select="*[not(self::result or self::enum) and
421 not(self::if[result] or self::if[enum])]"/>
422</xsl:template>
423
424
425<!--
426 * result codes
427-->
428<xsl:template match="result">
429 <xsl:apply-templates select="@if" mode="begin"/>
430 <xsl:apply-templates select="desc"/>
431 <xsl:value-of select="concat('const HRESULT ',@name,' = ',@value,';')"/>
432 <xsl:text>&#x0A;</xsl:text>
433 <xsl:apply-templates select="@if" mode="end"/>
434</xsl:template>
435
436
437<!--
438 * interfaces
439-->
440<xsl:template match="interface">
441 <xsl:apply-templates select="desc"/>
442 <xsl:text>interface </xsl:text>
443 <xsl:value-of select="@name"/>
444 <xsl:text> : </xsl:text>
445 <xsl:value-of select="@extends"/>
446 <xsl:text>&#x0A;{&#x0A;</xsl:text>
447 <!-- attributes (properties) -->
448 <xsl:apply-templates select="attribute"/>
449 <!-- methods -->
450 <xsl:apply-templates select="method"/>
451 <!-- 'if' enclosed elements, unsorted -->
452 <xsl:apply-templates select="if"/>
453 <!-- -->
454 <xsl:text>}; /* interface </xsl:text>
455 <xsl:value-of select="@name"/>
456 <xsl:text> */&#x0A;&#x0A;</xsl:text>
457</xsl:template>
458
459
460<!--
461 * attributes
462-->
463<xsl:template match="interface//attribute | collection//attribute">
464 <xsl:if test="@array">
465 <xsl:message terminate="yes">
466 <xsl:value-of select="concat(../../@name,'::',../@name,'::',@name,': ')"/>
467 <xsl:text>'array' attributes are not supported, use 'safearray="yes"' instead.</xsl:text>
468 </xsl:message>
469 </xsl:if>
470 <xsl:apply-templates select="@if" mode="begin"/>
471 <xsl:apply-templates select="desc"/>
472 <xsl:text> </xsl:text>
473 <xsl:if test="@readonly='yes'">
474 <xsl:text>readonly </xsl:text>
475 </xsl:if>
476 <xsl:text>attribute </xsl:text>
477 <xsl:apply-templates select="@type"/>
478 <xsl:text> </xsl:text>
479 <xsl:value-of select="@name"/>
480 <xsl:text>;&#x0A;</xsl:text>
481 <xsl:apply-templates select="@if" mode="end"/>
482 <xsl:text>&#x0A;</xsl:text>
483</xsl:template>
484
485<!--
486 * methods
487-->
488<xsl:template match="interface//method | collection//method">
489 <xsl:apply-templates select="@if" mode="begin"/>
490 <xsl:apply-templates select="desc"/>
491 <xsl:text> void </xsl:text>
492 <xsl:value-of select="@name"/>
493 <xsl:if test="param">
494 <xsl:text> (&#x0A;</xsl:text>
495 <xsl:for-each select="param [position() != last()]">
496 <xsl:text> </xsl:text>
497 <xsl:apply-templates select="."/>
498 <xsl:text>,&#x0A;</xsl:text>
499 </xsl:for-each>
500 <xsl:text> </xsl:text>
501 <xsl:apply-templates select="param [last()]"/>
502 <xsl:text>&#x0A; );&#x0A;</xsl:text>
503 </xsl:if>
504 <xsl:if test="not(param)">
505 <xsl:text>();&#x0A;</xsl:text>
506 </xsl:if>
507 <xsl:apply-templates select="@if" mode="end"/>
508 <xsl:text>&#x0A;</xsl:text>
509</xsl:template>
510
511
512<!--
513 * co-classes
514-->
515<xsl:template match="module/class">
516 <!-- class and contract id: later -->
517 <!-- CLSID_xxx declarations for XPCOM, for compatibility with Win32: later -->
518</xsl:template>
519
520
521<!--
522 * enumerators
523-->
524<xsl:template match="enumerator">
525 <xsl:text>interface </xsl:text>
526 <xsl:value-of select="@name"/>
527 <xsl:text> : $unknown&#x0A;{&#x0A;</xsl:text>
528 <!-- HasMore -->
529 <xsl:text> void hasMore ([retval] out boolean more);&#x0A;&#x0A;</xsl:text>
530 <!-- GetNext -->
531 <xsl:text> void getNext ([retval] out </xsl:text>
532 <xsl:apply-templates select="@type"/>
533 <xsl:text> next);&#x0A;&#x0A;</xsl:text>
534 <!-- -->
535 <xsl:text>}; /* interface </xsl:text>
536 <xsl:value-of select="@name"/>
537 <xsl:text> */&#x0A;&#x0A;</xsl:text>
538</xsl:template>
539
540
541<!--
542 * collections
543-->
544<xsl:template match="collection">
545 <xsl:if test="not(@readonly='yes')">
546 <xsl:message terminate="yes">
547 <xsl:value-of select="concat(@name,': ')"/>
548 <xsl:text>non-readonly collections are not currently supported</xsl:text>
549 </xsl:message>
550 </xsl:if>
551 <xsl:text>interface </xsl:text>
552 <xsl:value-of select="@name"/>
553 <xsl:text> : $unknown&#x0A;{&#x0A;</xsl:text>
554 <!-- Count -->
555 <xsl:text> readonly attribute unsigned long count;&#x0A;&#x0A;</xsl:text>
556 <!-- GetItemAt -->
557 <xsl:text> void getItemAt (in unsigned long index, [retval] out </xsl:text>
558 <xsl:apply-templates select="@type"/>
559 <xsl:text> item);&#x0A;&#x0A;</xsl:text>
560 <!-- Enumerate -->
561 <xsl:text> void enumerate ([retval] out </xsl:text>
562 <xsl:apply-templates select="@enumerator"/>
563 <xsl:text> enumerator);&#x0A;&#x0A;</xsl:text>
564 <!-- other extra attributes (properties) -->
565 <xsl:apply-templates select="attribute"/>
566 <!-- other extra methods -->
567 <xsl:apply-templates select="method"/>
568 <!-- 'if' enclosed elements, unsorted -->
569 <xsl:apply-templates select="if"/>
570 <!-- -->
571 <xsl:text>}; /* interface </xsl:text>
572 <xsl:value-of select="@name"/>
573 <xsl:text> */&#x0A;&#x0A;</xsl:text>
574</xsl:template>
575
576
577<!--
578 * enums
579-->
580<xsl:template match="enum">
581 <xsl:apply-templates select="desc"/>
582 <xsl:text>enum </xsl:text>
583 <xsl:value-of select="@name"/>
584 <xsl:text>&#x0A;{&#x0A;</xsl:text>
585 <xsl:for-each select="const">
586 <xsl:apply-templates select="desc"/>
587 <xsl:text> </xsl:text>
588 <xsl:value-of select="@name"/> = <xsl:value-of select="@value"/>
589 <xsl:text>,&#x0A;</xsl:text>
590 </xsl:for-each>
591 <xsl:text>};&#x0A;&#x0A;</xsl:text>
592</xsl:template>
593
594
595<!--
596 * method parameters
597-->
598<xsl:template match="method/param">
599 <xsl:if test="@array">
600 <xsl:if test="@dir='return'">
601 <xsl:message terminate="yes">
602 <xsl:value-of select="concat(../../@name,'::',../@name,'::',@name,': ')"/>
603 <xsl:text>return 'array' parameters are not supported, use 'safearray="yes"' instead.</xsl:text>
604 </xsl:message>
605 </xsl:if>
606 <xsl:text>[array, </xsl:text>
607 <xsl:choose>
608 <xsl:when test="../param[@name=current()/@array]">
609 <xsl:if test="../param[@name=current()/@array]/@dir != @dir">
610 <xsl:message terminate="yes">
611 <xsl:value-of select="concat(../../@name,'::',../@name,': ')"/>
612 <xsl:value-of select="concat(@name,' and ',../param[@name=current()/@array]/@name)"/>
613 <xsl:text> must have the same direction</xsl:text>
614 </xsl:message>
615 </xsl:if>
616 <xsl:text>size_is(</xsl:text>
617 <xsl:if test="@dir='out'">
618 <xsl:text>, </xsl:text>
619 </xsl:if>
620 <xsl:if test="../param[@name=current()/@array]/@dir='out'">
621 <xsl:text>*</xsl:text>
622 </xsl:if>
623 <xsl:value-of select="@array"/>
624 <xsl:text>)</xsl:text>
625 </xsl:when>
626 <xsl:otherwise>
627 <xsl:message terminate="yes">
628 <xsl:value-of select="concat(../../@name,'::',../@name,'::',@name,': ')"/>
629 <xsl:text>array attribute refers to non-existent param: </xsl:text>
630 <xsl:value-of select="@array"/>
631 </xsl:message>
632 </xsl:otherwise>
633 </xsl:choose>
634 <xsl:text>] </xsl:text>
635 </xsl:if>
636 <xsl:choose>
637 <xsl:when test="@dir='in'">in </xsl:when>
638 <xsl:when test="@dir='out'">out </xsl:when>
639 <xsl:when test="@dir='return'">[retval] out </xsl:when>
640 <xsl:otherwise>in</xsl:otherwise>
641 </xsl:choose>
642 <xsl:apply-templates select="@type"/>
643 <xsl:text> </xsl:text>
644 <xsl:value-of select="@name"/>
645</xsl:template>
646
647
648<!--
649 * attribute/parameter type conversion
650-->
651<xsl:template match="
652 attribute/@type | param/@type |
653 enumerator/@type | collection/@type | collection/@enumerator
654">
655 <xsl:variable name="self_target" select="current()/ancestor::if/@target"/>
656
657 <xsl:if test="../@array and ../@safearray='yes'">
658 <xsl:message terminate="yes">
659 <xsl:value-of select="concat(../../../@name,'::',../../@name,'::',../@name,': ')"/>
660 <xsl:text>either 'array' or 'safearray="yes"' attribute is allowed, but not both!</xsl:text>
661 </xsl:message>
662 </xsl:if>
663
664 <xsl:choose>
665 <!-- modifiers (ignored for 'enumeration' attributes)-->
666 <xsl:when test="name(current())='type' and ../@mod">
667 <xsl:choose>
668 <xsl:when test="../@mod='ptr'">
669 <xsl:choose>
670 <!-- standard types -->
671 <!--xsl:when test=".='result'">??</xsl:when-->
672 <xsl:when test=".='boolean'">booleanPtr</xsl:when>
673 <xsl:when test=".='octet'">octetPtr</xsl:when>
674 <xsl:when test=".='short'">shortPtr</xsl:when>
675 <xsl:when test=".='unsigned short'">ushortPtr</xsl:when>
676 <xsl:when test=".='long'">longPtr</xsl:when>
677 <xsl:when test=".='long long'">llongPtr</xsl:when>
678 <xsl:when test=".='unsigned long'">ulongPtr</xsl:when>
679 <xsl:when test=".='unsigned long long'">ullongPtr</xsl:when>
680 <xsl:when test=".='char'">charPtr</xsl:when>
681 <!--xsl:when test=".='string'">??</xsl:when-->
682 <xsl:when test=".='wchar'">wcharPtr</xsl:when>
683 <!--xsl:when test=".='wstring'">??</xsl:when-->
684 <xsl:otherwise>
685 <xsl:message terminate="yes">
686 <xsl:value-of select="concat(../../../@name,'::',../../@name,'::',../@name,': ')"/>
687 <xsl:text>attribute 'mod=</xsl:text>
688 <xsl:value-of select="concat('&quot;',../@mod,'&quot;')"/>
689 <xsl:text>' cannot be used with type </xsl:text>
690 <xsl:value-of select="concat('&quot;',current(),'&quot;!')"/>
691 </xsl:message>
692 </xsl:otherwise>
693 </xsl:choose>
694 </xsl:when>
695 <xsl:otherwise>
696 <xsl:message terminate="yes">
697 <xsl:value-of select="concat(../../../@name,'::',../../@name,'::',../@name,': ')"/>
698 <xsl:value-of select="concat('value &quot;',../@mod,'&quot; ')"/>
699 <xsl:text>of attribute 'mod' is invalid!</xsl:text>
700 </xsl:message>
701 </xsl:otherwise>
702 </xsl:choose>
703 </xsl:when>
704 <!-- no modifiers -->
705 <xsl:otherwise>
706 <xsl:choose>
707 <!-- standard types -->
708 <xsl:when test=".='result'">result</xsl:when>
709 <xsl:when test=".='boolean'">boolean</xsl:when>
710 <xsl:when test=".='octet'">octet</xsl:when>
711 <xsl:when test=".='short'">short</xsl:when>
712 <xsl:when test=".='unsigned short'">unsigned short</xsl:when>
713 <xsl:when test=".='long'">long</xsl:when>
714 <xsl:when test=".='long long'">long long</xsl:when>
715 <xsl:when test=".='unsigned long'">unsigned long</xsl:when>
716 <xsl:when test=".='unsigned long long'">unsigned long long</xsl:when>
717 <xsl:when test=".='char'">char</xsl:when>
718 <xsl:when test=".='wchar'">wchar</xsl:when>
719 <xsl:when test=".='string'">string</xsl:when>
720 <xsl:when test=".='wstring'">wstring</xsl:when>
721 <!-- UUID type -->
722 <xsl:when test=".='uuid'">uuid</xsl:when>
723 <!-- system interface types -->
724 <xsl:when test=".='$unknown'">$unknown</xsl:when>
725 <xsl:otherwise>
726 <xsl:choose>
727 <!-- enum types -->
728 <xsl:when test="
729 (ancestor::library/enum[@name=current()]) or
730 (ancestor::library/if[@target=$self_target]/enum[@name=current()])
731 ">
732 <xsl:value-of select="."/>
733 </xsl:when>
734 <!-- custom interface types -->
735 <xsl:when test="
736 (name(current())='enumerator' and
737 ((ancestor::library/enumerator[@name=current()]) or
738 (ancestor::library/if[@target=$self_target]/enumerator[@name=current()]))
739 ) or
740 ((ancestor::library/interface[@name=current()]) or
741 (ancestor::library/if[@target=$self_target]/interface[@name=current()])
742 ) or
743 ((ancestor::library/collection[@name=current()]) or
744 (ancestor::library/if[@target=$self_target]/collection[@name=current()])
745 )
746 ">
747 <xsl:value-of select="."/>
748 </xsl:when>
749 <!-- other types -->
750 <xsl:otherwise>
751 <xsl:message terminate="yes">
752 <xsl:text>Unknown parameter type: </xsl:text>
753 <xsl:value-of select="."/>
754 </xsl:message>
755 </xsl:otherwise>
756 </xsl:choose>
757 </xsl:otherwise>
758 </xsl:choose>
759 </xsl:otherwise>
760 </xsl:choose>
761 <xsl:if test="../@safearray='yes'">
762 <xsl:text>[]</xsl:text>
763 </xsl:if>
764</xsl:template>
765
766</xsl:stylesheet>
767
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