VirtualBox

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

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

Main/Docs: Don't show internal notes. Prepend enum name to the enum value (to isolate the scope for doxygen too).

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

© 2023 Oracle
ContactPrivacy policyTerms of Use