1 | <?xml version="1.0"?>
|
---|
2 | <!-- $Id: xpidl.xsl 39869 2008-11-25 13:37:40Z dmik $ -->
|
---|
3 |
|
---|
4 | <!--
|
---|
5 | * A template to generate a XPCOM IDL compatible interface definition file
|
---|
6 | * from the generic interface definition expressed in XML.
|
---|
7 |
|
---|
8 | Copyright (C) 2008-2010 Oracle Corporation
|
---|
9 |
|
---|
10 | This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
11 | available from http://www.virtualbox.org. This file is free software;
|
---|
12 | you can redistribute it and/or modify it under the terms of the GNU
|
---|
13 | General Public License (GPL) as published by the Free Software
|
---|
14 | Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
15 | VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
16 | hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
17 | -->
|
---|
18 |
|
---|
19 | <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
---|
20 | <xsl:output method="text"/>
|
---|
21 |
|
---|
22 | <xsl:strip-space elements="*"/>
|
---|
23 |
|
---|
24 |
|
---|
25 | <!--
|
---|
26 | // helper definitions
|
---|
27 | /////////////////////////////////////////////////////////////////////////////
|
---|
28 | -->
|
---|
29 |
|
---|
30 | <!--
|
---|
31 | * capitalizes the first letter
|
---|
32 | -->
|
---|
33 | <xsl:template name="capitalize">
|
---|
34 | <xsl:param name="str" select="."/>
|
---|
35 | <xsl:value-of select="
|
---|
36 | concat(
|
---|
37 | translate(substring($str,1,1),'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ'),
|
---|
38 | substring($str,2)
|
---|
39 | )
|
---|
40 | "/>
|
---|
41 | </xsl:template>
|
---|
42 |
|
---|
43 | <!--
|
---|
44 | * uncapitalizes the first letter only if the second one is not capital
|
---|
45 | * otherwise leaves the string unchanged
|
---|
46 | -->
|
---|
47 | <xsl:template name="uncapitalize">
|
---|
48 | <xsl:param name="str" select="."/>
|
---|
49 | <xsl:choose>
|
---|
50 | <xsl:when test="not(contains('ABCDEFGHIJKLMNOPQRSTUVWXYZ', substring($str,2,1)))">
|
---|
51 | <xsl:value-of select="
|
---|
52 | concat(
|
---|
53 | translate(substring($str,1,1),'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz'),
|
---|
54 | substring($str,2)
|
---|
55 | )
|
---|
56 | "/>
|
---|
57 | </xsl:when>
|
---|
58 | <xsl:otherwise>
|
---|
59 | <xsl:value-of select="string($str)"/>
|
---|
60 | </xsl:otherwise>
|
---|
61 | </xsl:choose>
|
---|
62 | </xsl:template>
|
---|
63 |
|
---|
64 | <!--
|
---|
65 | * translates the string to uppercase
|
---|
66 | -->
|
---|
67 | <xsl:template name="uppercase">
|
---|
68 | <xsl:param name="str" select="."/>
|
---|
69 | <xsl:value-of select="
|
---|
70 | translate($str,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')
|
---|
71 | "/>
|
---|
72 | </xsl:template>
|
---|
73 |
|
---|
74 |
|
---|
75 | <!--
|
---|
76 | * translates the string to lowercase
|
---|
77 | -->
|
---|
78 | <xsl:template name="lowercase">
|
---|
79 | <xsl:param name="str" select="."/>
|
---|
80 | <xsl:value-of select="
|
---|
81 | translate($str,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')
|
---|
82 | "/>
|
---|
83 | </xsl:template>
|
---|
84 |
|
---|
85 |
|
---|
86 | <!--
|
---|
87 | // templates
|
---|
88 | /////////////////////////////////////////////////////////////////////////////
|
---|
89 | -->
|
---|
90 |
|
---|
91 |
|
---|
92 | <!--
|
---|
93 | * not explicitly matched elements and attributes
|
---|
94 | -->
|
---|
95 | <xsl:template match="*"/>
|
---|
96 |
|
---|
97 |
|
---|
98 | <!--
|
---|
99 | * header
|
---|
100 | -->
|
---|
101 | <xsl:template match="/idl">
|
---|
102 | <xsl:text>
|
---|
103 | /*
|
---|
104 | * DO NOT EDIT! This is a generated file.
|
---|
105 | *
|
---|
106 | * XPCOM IDL (XPIDL) definition for VirtualBox Main API (COM interfaces)
|
---|
107 | * generated from XIDL (XML interface definition).
|
---|
108 | *
|
---|
109 | * Source : src/VBox/Main/idl/VirtualBox.xidl
|
---|
110 | * Generator : src/VBox/Main/idl/xpcidl.xsl
|
---|
111 | *
|
---|
112 | * This file contains portions from the following Mozilla XPCOM files:
|
---|
113 | * xpcom/include/xpcom/nsID.h
|
---|
114 | * xpcom/include/nsIException.h
|
---|
115 | * xpcom/include/nsprpub/prtypes.h
|
---|
116 | * xpcom/include/xpcom/nsISupportsBase.h
|
---|
117 | *
|
---|
118 | * These files were originally triple-licensed (MPL/GPL2/LGPL2.1). Sun
|
---|
119 | * elects to distribute this derived work under the LGPL2.1 only.
|
---|
120 | */
|
---|
121 |
|
---|
122 | /*
|
---|
123 | * Copyright (C) 2008-2010 Oracle Corporation
|
---|
124 | *
|
---|
125 | * This file is part of a free software library; you can redistribute
|
---|
126 | * it and/or modify it under the terms of the GNU Lesser General
|
---|
127 | * Public License version 2.1 as published by the Free Software
|
---|
128 | * Foundation and shipped in the "COPYING" file with this library.
|
---|
129 | * The library is distributed in the hope that it will be useful,
|
---|
130 | * but WITHOUT ANY WARRANTY of any kind.
|
---|
131 | *
|
---|
132 | * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if
|
---|
133 | * any license choice other than GPL or LGPL is available it will
|
---|
134 | * apply instead, Oracle elects to use only the Lesser General Public
|
---|
135 | * License version 2.1 (LGPLv2) at this time for any software where
|
---|
136 | * a choice of LGPL license versions is made available with the
|
---|
137 | * language indicating that LGPLv2 or any later version may be used,
|
---|
138 | * or where a choice of which version of the LGPL is applied is
|
---|
139 | * otherwise unspecified.
|
---|
140 | */
|
---|
141 |
|
---|
142 | #ifndef ___VirtualBox_CXPCOM_h
|
---|
143 | #define ___VirtualBox_CXPCOM_h
|
---|
144 |
|
---|
145 | #ifdef __cplusplus
|
---|
146 | # include "VirtualBox_XPCOM.h"
|
---|
147 | #else /* !__cplusplus */
|
---|
148 |
|
---|
149 | #include <stddef.h>
|
---|
150 | #include "wchar.h"
|
---|
151 |
|
---|
152 | #if defined(WIN32)
|
---|
153 |
|
---|
154 | #define PR_EXPORT(__type) extern __declspec(dllexport) __type
|
---|
155 | #define PR_EXPORT_DATA(__type) extern __declspec(dllexport) __type
|
---|
156 | #define PR_IMPORT(__type) __declspec(dllimport) __type
|
---|
157 | #define PR_IMPORT_DATA(__type) __declspec(dllimport) __type
|
---|
158 |
|
---|
159 | #define PR_EXTERN(__type) extern __declspec(dllexport) __type
|
---|
160 | #define PR_IMPLEMENT(__type) __declspec(dllexport) __type
|
---|
161 | #define PR_EXTERN_DATA(__type) extern __declspec(dllexport) __type
|
---|
162 | #define PR_IMPLEMENT_DATA(__type) __declspec(dllexport) __type
|
---|
163 |
|
---|
164 | #define PR_CALLBACK
|
---|
165 | #define PR_CALLBACK_DECL
|
---|
166 | #define PR_STATIC_CALLBACK(__x) static __x
|
---|
167 |
|
---|
168 | #elif defined(XP_BEOS)
|
---|
169 |
|
---|
170 | #define PR_EXPORT(__type) extern __declspec(dllexport) __type
|
---|
171 | #define PR_EXPORT_DATA(__type) extern __declspec(dllexport) __type
|
---|
172 | #define PR_IMPORT(__type) extern __declspec(dllexport) __type
|
---|
173 | #define PR_IMPORT_DATA(__type) extern __declspec(dllexport) __type
|
---|
174 |
|
---|
175 | #define PR_EXTERN(__type) extern __declspec(dllexport) __type
|
---|
176 | #define PR_IMPLEMENT(__type) __declspec(dllexport) __type
|
---|
177 | #define PR_EXTERN_DATA(__type) extern __declspec(dllexport) __type
|
---|
178 | #define PR_IMPLEMENT_DATA(__type) __declspec(dllexport) __type
|
---|
179 |
|
---|
180 | #define PR_CALLBACK
|
---|
181 | #define PR_CALLBACK_DECL
|
---|
182 | #define PR_STATIC_CALLBACK(__x) static __x
|
---|
183 |
|
---|
184 | #elif defined(WIN16)
|
---|
185 |
|
---|
186 | #define PR_CALLBACK_DECL __cdecl
|
---|
187 |
|
---|
188 | #if defined(_WINDLL)
|
---|
189 | #define PR_EXPORT(__type) extern __type _cdecl _export _loadds
|
---|
190 | #define PR_IMPORT(__type) extern __type _cdecl _export _loadds
|
---|
191 | #define PR_EXPORT_DATA(__type) extern __type _export
|
---|
192 | #define PR_IMPORT_DATA(__type) extern __type _export
|
---|
193 |
|
---|
194 | #define PR_EXTERN(__type) extern __type _cdecl _export _loadds
|
---|
195 | #define PR_IMPLEMENT(__type) __type _cdecl _export _loadds
|
---|
196 | #define PR_EXTERN_DATA(__type) extern __type _export
|
---|
197 | #define PR_IMPLEMENT_DATA(__type) __type _export
|
---|
198 |
|
---|
199 | #define PR_CALLBACK __cdecl __loadds
|
---|
200 | #define PR_STATIC_CALLBACK(__x) static __x PR_CALLBACK
|
---|
201 |
|
---|
202 | #else /* this must be .EXE */
|
---|
203 | #define PR_EXPORT(__type) extern __type _cdecl _export
|
---|
204 | #define PR_IMPORT(__type) extern __type _cdecl _export
|
---|
205 | #define PR_EXPORT_DATA(__type) extern __type _export
|
---|
206 | #define PR_IMPORT_DATA(__type) extern __type _export
|
---|
207 |
|
---|
208 | #define PR_EXTERN(__type) extern __type _cdecl _export
|
---|
209 | #define PR_IMPLEMENT(__type) __type _cdecl _export
|
---|
210 | #define PR_EXTERN_DATA(__type) extern __type _export
|
---|
211 | #define PR_IMPLEMENT_DATA(__type) __type _export
|
---|
212 |
|
---|
213 | #define PR_CALLBACK __cdecl __loadds
|
---|
214 | #define PR_STATIC_CALLBACK(__x) __x PR_CALLBACK
|
---|
215 | #endif /* _WINDLL */
|
---|
216 |
|
---|
217 | #elif defined(XP_MAC)
|
---|
218 |
|
---|
219 | #define PR_EXPORT(__type) extern __declspec(export) __type
|
---|
220 | #define PR_EXPORT_DATA(__type) extern __declspec(export) __type
|
---|
221 | #define PR_IMPORT(__type) extern __declspec(export) __type
|
---|
222 | #define PR_IMPORT_DATA(__type) extern __declspec(export) __type
|
---|
223 |
|
---|
224 | #define PR_EXTERN(__type) extern __declspec(export) __type
|
---|
225 | #define PR_IMPLEMENT(__type) __declspec(export) __type
|
---|
226 | #define PR_EXTERN_DATA(__type) extern __declspec(export) __type
|
---|
227 | #define PR_IMPLEMENT_DATA(__type) __declspec(export) __type
|
---|
228 |
|
---|
229 | #define PR_CALLBACK
|
---|
230 | #define PR_CALLBACK_DECL
|
---|
231 | #define PR_STATIC_CALLBACK(__x) static __x
|
---|
232 |
|
---|
233 | #elif defined(XP_OS2) && defined(__declspec)
|
---|
234 |
|
---|
235 | #define PR_EXPORT(__type) extern __declspec(dllexport) __type
|
---|
236 | #define PR_EXPORT_DATA(__type) extern __declspec(dllexport) __type
|
---|
237 | #define PR_IMPORT(__type) __declspec(dllimport) __type
|
---|
238 | #define PR_IMPORT_DATA(__type) __declspec(dllimport) __type
|
---|
239 |
|
---|
240 | #define PR_EXTERN(__type) extern __declspec(dllexport) __type
|
---|
241 | #define PR_IMPLEMENT(__type) __declspec(dllexport) __type
|
---|
242 | #define PR_EXTERN_DATA(__type) extern __declspec(dllexport) __type
|
---|
243 | #define PR_IMPLEMENT_DATA(__type) __declspec(dllexport) __type
|
---|
244 |
|
---|
245 | #define PR_CALLBACK
|
---|
246 | #define PR_CALLBACK_DECL
|
---|
247 | #define PR_STATIC_CALLBACK(__x) static __x
|
---|
248 |
|
---|
249 | #elif defined(XP_OS2_VACPP)
|
---|
250 |
|
---|
251 | #define PR_EXPORT(__type) extern __type
|
---|
252 | #define PR_EXPORT_DATA(__type) extern __type
|
---|
253 | #define PR_IMPORT(__type) extern __type
|
---|
254 | #define PR_IMPORT_DATA(__type) extern __type
|
---|
255 |
|
---|
256 | #define PR_EXTERN(__type) extern __type
|
---|
257 | #define PR_IMPLEMENT(__type) __type
|
---|
258 | #define PR_EXTERN_DATA(__type) extern __type
|
---|
259 | #define PR_IMPLEMENT_DATA(__type) __type
|
---|
260 | #define PR_CALLBACK _Optlink
|
---|
261 | #define PR_CALLBACK_DECL
|
---|
262 | #define PR_STATIC_CALLBACK(__x) static __x PR_CALLBACK
|
---|
263 |
|
---|
264 | #else /* Unix */
|
---|
265 |
|
---|
266 | # ifdef VBOX_HAVE_VISIBILITY_HIDDEN
|
---|
267 | # define PR_EXPORT(__type) __attribute__((visibility("default"))) extern __type
|
---|
268 | # define PR_EXPORT_DATA(__type) __attribute__((visibility("default"))) extern __type
|
---|
269 | # define PR_IMPORT(__type) extern __type
|
---|
270 | # define PR_IMPORT_DATA(__type) extern __type
|
---|
271 | # define PR_EXTERN(__type) __attribute__((visibility("default"))) extern __type
|
---|
272 | # define PR_IMPLEMENT(__type) __attribute__((visibility("default"))) __type
|
---|
273 | # define PR_EXTERN_DATA(__type) __attribute__((visibility("default"))) extern __type
|
---|
274 | # define PR_IMPLEMENT_DATA(__type) __attribute__((visibility("default"))) __type
|
---|
275 | # define PR_CALLBACK
|
---|
276 | # define PR_CALLBACK_DECL
|
---|
277 | # define PR_STATIC_CALLBACK(__x) static __x
|
---|
278 | # else
|
---|
279 | # define PR_EXPORT(__type) extern __type
|
---|
280 | # define PR_EXPORT_DATA(__type) extern __type
|
---|
281 | # define PR_IMPORT(__type) extern __type
|
---|
282 | # define PR_IMPORT_DATA(__type) extern __type
|
---|
283 | # define PR_EXTERN(__type) extern __type
|
---|
284 | # define PR_IMPLEMENT(__type) __type
|
---|
285 | # define PR_EXTERN_DATA(__type) extern __type
|
---|
286 | # define PR_IMPLEMENT_DATA(__type) __type
|
---|
287 | # define PR_CALLBACK
|
---|
288 | # define PR_CALLBACK_DECL
|
---|
289 | # define PR_STATIC_CALLBACK(__x) static __x
|
---|
290 | # endif
|
---|
291 | #endif
|
---|
292 |
|
---|
293 | #if defined(_NSPR_BUILD_)
|
---|
294 | #define NSPR_API(__type) PR_EXPORT(__type)
|
---|
295 | #define NSPR_DATA_API(__type) PR_EXPORT_DATA(__type)
|
---|
296 | #else
|
---|
297 | #define NSPR_API(__type) PR_IMPORT(__type)
|
---|
298 | #define NSPR_DATA_API(__type) PR_IMPORT_DATA(__type)
|
---|
299 | #endif
|
---|
300 |
|
---|
301 | typedef unsigned char PRUint8;
|
---|
302 | #if (defined(HPUX) && defined(__cplusplus) \
|
---|
303 | && !defined(__GNUC__) && __cplusplus < 199707L) \
|
---|
304 | || (defined(SCO) && defined(__cplusplus) \
|
---|
305 | && !defined(__GNUC__) && __cplusplus == 1L)
|
---|
306 | typedef char PRInt8;
|
---|
307 | #else
|
---|
308 | typedef signed char PRInt8;
|
---|
309 | #endif
|
---|
310 |
|
---|
311 | #define PR_INT8_MAX 127
|
---|
312 | #define PR_INT8_MIN (-128)
|
---|
313 | #define PR_UINT8_MAX 255U
|
---|
314 |
|
---|
315 | typedef unsigned short PRUint16;
|
---|
316 | typedef short PRInt16;
|
---|
317 |
|
---|
318 | #define PR_INT16_MAX 32767
|
---|
319 | #define PR_INT16_MIN (-32768)
|
---|
320 | #define PR_UINT16_MAX 65535U
|
---|
321 |
|
---|
322 | typedef unsigned int PRUint32;
|
---|
323 | typedef int PRInt32;
|
---|
324 | #define PR_INT32(x) x
|
---|
325 | #define PR_UINT32(x) x ## U
|
---|
326 |
|
---|
327 | #define PR_INT32_MAX PR_INT32(2147483647)
|
---|
328 | #define PR_INT32_MIN (-PR_INT32_MAX - 1)
|
---|
329 | #define PR_UINT32_MAX PR_UINT32(4294967295)
|
---|
330 |
|
---|
331 | typedef long PRInt64;
|
---|
332 | typedef unsigned long PRUint64;
|
---|
333 | typedef int PRIntn;
|
---|
334 | typedef unsigned int PRUintn;
|
---|
335 |
|
---|
336 | typedef double PRFloat64;
|
---|
337 | typedef size_t PRSize;
|
---|
338 |
|
---|
339 | typedef ptrdiff_t PRPtrdiff;
|
---|
340 |
|
---|
341 | typedef unsigned long PRUptrdiff;
|
---|
342 |
|
---|
343 | typedef PRIntn PRBool;
|
---|
344 |
|
---|
345 | #define PR_TRUE 1
|
---|
346 | #define PR_FALSE 0
|
---|
347 |
|
---|
348 | typedef PRUint8 PRPackedBool;
|
---|
349 |
|
---|
350 | /*
|
---|
351 | ** Status code used by some routines that have a single point of failure or
|
---|
352 | ** special status return.
|
---|
353 | */
|
---|
354 | typedef enum { PR_FAILURE = -1, PR_SUCCESS = 0 } PRStatus;
|
---|
355 |
|
---|
356 | #ifndef __PRUNICHAR__
|
---|
357 | #define __PRUNICHAR__
|
---|
358 | #if defined(WIN32) || defined(XP_MAC)
|
---|
359 | typedef wchar_t PRUnichar;
|
---|
360 | #else
|
---|
361 | typedef PRUint16 PRUnichar;
|
---|
362 | #endif
|
---|
363 | #endif
|
---|
364 |
|
---|
365 | typedef long PRWord;
|
---|
366 | typedef unsigned long PRUword;
|
---|
367 |
|
---|
368 | #define nsnull 0
|
---|
369 | typedef PRUint32 nsresult;
|
---|
370 |
|
---|
371 | #if defined(__GNUC__) && (__GNUC__ > 2)
|
---|
372 | #define NS_LIKELY(x) (__builtin_expect((x), 1))
|
---|
373 | #define NS_UNLIKELY(x) (__builtin_expect((x), 0))
|
---|
374 | #else
|
---|
375 | #define NS_LIKELY(x) (x)
|
---|
376 | #define NS_UNLIKELY(x) (x)
|
---|
377 | #endif
|
---|
378 |
|
---|
379 | #define NS_FAILED(_nsresult) (NS_UNLIKELY((_nsresult) & 0x80000000))
|
---|
380 | #define NS_SUCCEEDED(_nsresult) (NS_LIKELY(!((_nsresult) & 0x80000000)))
|
---|
381 |
|
---|
382 | #ifdef VBOX_WITH_XPCOM_NAMESPACE_CLEANUP
|
---|
383 | # define PR_IntervalNow VBoxNsprPR_IntervalNow
|
---|
384 | # define PR_TicksPerSecond VBoxNsprPR_TicksPerSecond
|
---|
385 | # define PR_SecondsToInterval VBoxNsprPR_SecondsToInterval
|
---|
386 | # define PR_MillisecondsToInterval VBoxNsprPR_MillisecondsToInterval
|
---|
387 | # define PR_MicrosecondsToInterval VBoxNsprPR_MicrosecondsToInterval
|
---|
388 | # define PR_IntervalToSeconds VBoxNsprPR_IntervalToSeconds
|
---|
389 | # define PR_IntervalToMilliseconds VBoxNsprPR_IntervalToMilliseconds
|
---|
390 | # define PR_IntervalToMicroseconds VBoxNsprPR_IntervalToMicroseconds
|
---|
391 | # define PR_EnterMonitor VBoxNsprPR_EnterMonitor
|
---|
392 | # define PR_ExitMonitor VBoxNsprPR_ExitMonitor
|
---|
393 | # define PR_Notify VBoxNsprPR_Notify
|
---|
394 | # define PR_NotifyAll VBoxNsprPR_NotifyAll
|
---|
395 | # define PR_Wait VBoxNsprPR_Wait
|
---|
396 | # define PR_NewMonitor VBoxNsprPR_NewMonitor
|
---|
397 | # define PR_DestroyMonitor VBoxNsprPR_DestroyMonitor
|
---|
398 | #endif /* VBOX_WITH_XPCOM_NAMESPACE_CLEANUP */
|
---|
399 |
|
---|
400 | typedef PRUint32 PRIntervalTime;
|
---|
401 |
|
---|
402 | #define PR_INTERVAL_MIN 1000UL
|
---|
403 | #define PR_INTERVAL_MAX 100000UL
|
---|
404 | #define PR_INTERVAL_NO_WAIT 0UL
|
---|
405 | #define PR_INTERVAL_NO_TIMEOUT 0xffffffffUL
|
---|
406 |
|
---|
407 | NSPR_API(PRIntervalTime) PR_IntervalNow(void);
|
---|
408 | NSPR_API(PRUint32) PR_TicksPerSecond(void);
|
---|
409 | NSPR_API(PRIntervalTime) PR_SecondsToInterval(PRUint32 seconds);
|
---|
410 | NSPR_API(PRIntervalTime) PR_MillisecondsToInterval(PRUint32 milli);
|
---|
411 | NSPR_API(PRIntervalTime) PR_MicrosecondsToInterval(PRUint32 micro);
|
---|
412 | NSPR_API(PRUint32) PR_IntervalToSeconds(PRIntervalTime ticks);
|
---|
413 | NSPR_API(PRUint32) PR_IntervalToMilliseconds(PRIntervalTime ticks);
|
---|
414 | NSPR_API(PRUint32) PR_IntervalToMicroseconds(PRIntervalTime ticks);
|
---|
415 |
|
---|
416 | typedef struct PRMonitor PRMonitor;
|
---|
417 |
|
---|
418 | NSPR_API(PRMonitor*) PR_NewMonitor(void);
|
---|
419 | NSPR_API(void) PR_DestroyMonitor(PRMonitor *mon);
|
---|
420 | NSPR_API(void) PR_EnterMonitor(PRMonitor *mon);
|
---|
421 | NSPR_API(PRStatus) PR_ExitMonitor(PRMonitor *mon);
|
---|
422 | NSPR_API(PRStatus) PR_Wait(PRMonitor *mon, PRIntervalTime ticks);
|
---|
423 | NSPR_API(PRStatus) PR_Notify(PRMonitor *mon);
|
---|
424 | NSPR_API(PRStatus) PR_NotifyAll(PRMonitor *mon);
|
---|
425 |
|
---|
426 | #ifdef VBOX_WITH_XPCOM_NAMESPACE_CLEANUP
|
---|
427 | # define PR_CreateThread VBoxNsprPR_CreateThread
|
---|
428 | # define PR_JoinThread VBoxNsprPR_JoinThread
|
---|
429 | # define PR_Sleep VBoxNsprPR_Sleep
|
---|
430 | # define PR_GetCurrentThread VBoxNsprPR_GetCurrentThread
|
---|
431 | # define PR_GetThreadState VBoxNsprPR_GetThreadState
|
---|
432 | # define PR_SetThreadPrivate VBoxNsprPR_SetThreadPrivate
|
---|
433 | # define PR_GetThreadPrivate VBoxNsprPR_GetThreadPrivate
|
---|
434 | # define PR_NewThreadPrivateIndex VBoxNsprPR_NewThreadPrivateIndex
|
---|
435 | # define PR_GetThreadPriority VBoxNsprPR_GetThreadPriority
|
---|
436 | # define PR_SetThreadPriority VBoxNsprPR_SetThreadPriority
|
---|
437 | # define PR_Interrupt VBoxNsprPR_Interrupt
|
---|
438 | # define PR_ClearInterrupt VBoxNsprPR_ClearInterrupt
|
---|
439 | # define PR_BlockInterrupt VBoxNsprPR_BlockInterrupt
|
---|
440 | # define PR_UnblockInterrupt VBoxNsprPR_UnblockInterrupt
|
---|
441 | # define PR_GetThreadScope VBoxNsprPR_GetThreadScope
|
---|
442 | # define PR_GetThreadType VBoxNsprPR_GetThreadType
|
---|
443 | #endif /* VBOX_WITH_XPCOM_NAMESPACE_CLEANUP */
|
---|
444 |
|
---|
445 | typedef struct PRThread PRThread;
|
---|
446 | typedef struct PRThreadStack PRThreadStack;
|
---|
447 |
|
---|
448 | typedef enum PRThreadType {
|
---|
449 | PR_USER_THREAD,
|
---|
450 | PR_SYSTEM_THREAD
|
---|
451 | } PRThreadType;
|
---|
452 |
|
---|
453 | typedef enum PRThreadScope {
|
---|
454 | PR_LOCAL_THREAD,
|
---|
455 | PR_GLOBAL_THREAD,
|
---|
456 | PR_GLOBAL_BOUND_THREAD
|
---|
457 | } PRThreadScope;
|
---|
458 |
|
---|
459 | typedef enum PRThreadState {
|
---|
460 | PR_JOINABLE_THREAD,
|
---|
461 | PR_UNJOINABLE_THREAD
|
---|
462 | } PRThreadState;
|
---|
463 |
|
---|
464 | typedef enum PRThreadPriority
|
---|
465 | {
|
---|
466 | PR_PRIORITY_FIRST = 0, /* just a placeholder */
|
---|
467 | PR_PRIORITY_LOW = 0, /* the lowest possible priority */
|
---|
468 | PR_PRIORITY_NORMAL = 1, /* most common expected priority */
|
---|
469 | PR_PRIORITY_HIGH = 2, /* slightly more aggressive scheduling */
|
---|
470 | PR_PRIORITY_URGENT = 3, /* it does little good to have more than one */
|
---|
471 | PR_PRIORITY_LAST = 3 /* this is just a placeholder */
|
---|
472 | } PRThreadPriority;
|
---|
473 |
|
---|
474 | NSPR_API(PRThread*) PR_CreateThread(PRThreadType type,
|
---|
475 | void (PR_CALLBACK *start)(void *arg),
|
---|
476 | void *arg,
|
---|
477 | PRThreadPriority priority,
|
---|
478 | PRThreadScope scope,
|
---|
479 | PRThreadState state,
|
---|
480 | PRUint32 stackSize);
|
---|
481 | NSPR_API(PRStatus) PR_JoinThread(PRThread *thread);
|
---|
482 | NSPR_API(PRThread*) PR_GetCurrentThread(void);
|
---|
483 | #ifndef NO_NSPR_10_SUPPORT
|
---|
484 | #define PR_CurrentThread() PR_GetCurrentThread() /* for nspr1.0 compat. */
|
---|
485 | #endif /* NO_NSPR_10_SUPPORT */
|
---|
486 | NSPR_API(PRThreadPriority) PR_GetThreadPriority(const PRThread *thread);
|
---|
487 | NSPR_API(void) PR_SetThreadPriority(PRThread *thread, PRThreadPriority priority);
|
---|
488 |
|
---|
489 | typedef void (PR_CALLBACK *PRThreadPrivateDTOR)(void *priv);
|
---|
490 |
|
---|
491 | NSPR_API(PRStatus) PR_NewThreadPrivateIndex(
|
---|
492 | PRUintn *newIndex, PRThreadPrivateDTOR destructor);
|
---|
493 | NSPR_API(PRStatus) PR_SetThreadPrivate(PRUintn tpdIndex, void *priv);
|
---|
494 | NSPR_API(void*) PR_GetThreadPrivate(PRUintn tpdIndex);
|
---|
495 | NSPR_API(PRStatus) PR_Interrupt(PRThread *thread);
|
---|
496 | NSPR_API(void) PR_ClearInterrupt(void);
|
---|
497 | NSPR_API(void) PR_BlockInterrupt(void);
|
---|
498 | NSPR_API(void) PR_UnblockInterrupt(void);
|
---|
499 | NSPR_API(PRStatus) PR_Sleep(PRIntervalTime ticks);
|
---|
500 | NSPR_API(PRThreadScope) PR_GetThreadScope(const PRThread *thread);
|
---|
501 | NSPR_API(PRThreadType) PR_GetThreadType(const PRThread *thread);
|
---|
502 | NSPR_API(PRThreadState) PR_GetThreadState(const PRThread *thread);
|
---|
503 |
|
---|
504 | #ifdef VBOX_WITH_XPCOM_NAMESPACE_CLEANUP
|
---|
505 | # define PR_DestroyLock VBoxNsprPR_DestroyLock
|
---|
506 | # define PR_Lock VBoxNsprPR_Lock
|
---|
507 | # define PR_NewLock VBoxNsprPR_NewLock
|
---|
508 | # define PR_Unlock VBoxNsprPR_Unlock
|
---|
509 | #endif /* VBOX_WITH_XPCOM_NAMESPACE_CLEANUP */
|
---|
510 |
|
---|
511 | typedef struct PRLock PRLock;
|
---|
512 |
|
---|
513 | NSPR_API(PRLock*) PR_NewLock(void);
|
---|
514 | NSPR_API(void) PR_DestroyLock(PRLock *lock);
|
---|
515 | NSPR_API(void) PR_Lock(PRLock *lock);
|
---|
516 | NSPR_API(PRStatus) PR_Unlock(PRLock *lock);
|
---|
517 |
|
---|
518 | #ifdef VBOX_WITH_XPCOM_NAMESPACE_CLEANUP
|
---|
519 | # define PR_NewCondVar VBoxNsprPR_NewCondVar
|
---|
520 | # define PR_DestroyCondVar VBoxNsprPR_DestroyCondVar
|
---|
521 | # define PR_WaitCondVar VBoxNsprPR_WaitCondVar
|
---|
522 | # define PR_NotifyCondVar VBoxNsprPR_NotifyCondVar
|
---|
523 | # define PR_NotifyAllCondVar VBoxNsprPR_NotifyAllCondVar
|
---|
524 | #endif /* VBOX_WITH_XPCOM_NAMESPACE_CLEANUP */
|
---|
525 |
|
---|
526 | typedef struct PRCondVar PRCondVar;
|
---|
527 |
|
---|
528 | NSPR_API(PRCondVar*) PR_NewCondVar(PRLock *lock);
|
---|
529 | NSPR_API(void) PR_DestroyCondVar(PRCondVar *cvar);
|
---|
530 | NSPR_API(PRStatus) PR_WaitCondVar(PRCondVar *cvar, PRIntervalTime timeout);
|
---|
531 | NSPR_API(PRStatus) PR_NotifyCondVar(PRCondVar *cvar);
|
---|
532 | NSPR_API(PRStatus) PR_NotifyAllCondVar(PRCondVar *cvar);
|
---|
533 |
|
---|
534 | typedef struct PRCListStr PRCList;
|
---|
535 |
|
---|
536 | struct PRCListStr {
|
---|
537 | PRCList *next;
|
---|
538 | PRCList *prev;
|
---|
539 | };
|
---|
540 |
|
---|
541 | #ifdef VBOX_WITH_XPCOM_NAMESPACE_CLEANUP
|
---|
542 | # define PL_DestroyEvent VBoxNsplPL_DestroyEvent
|
---|
543 | # define PL_HandleEvent VBoxNsplPL_HandleEvent
|
---|
544 | # define PL_InitEvent VBoxNsplPL_InitEvent
|
---|
545 | # define PL_CreateEventQueue VBoxNsplPL_CreateEventQueue
|
---|
546 | # define PL_CreateMonitoredEventQueue VBoxNsplPL_CreateMonitoredEventQueue
|
---|
547 | # define PL_CreateNativeEventQueue VBoxNsplPL_CreateNativeEventQueue
|
---|
548 | # define PL_DequeueEvent VBoxNsplPL_DequeueEvent
|
---|
549 | # define PL_DestroyEventQueue VBoxNsplPL_DestroyEventQueue
|
---|
550 | # define PL_EventAvailable VBoxNsplPL_EventAvailable
|
---|
551 | # define PL_EventLoop VBoxNsplPL_EventLoop
|
---|
552 | # define PL_GetEvent VBoxNsplPL_GetEvent
|
---|
553 | # define PL_GetEventOwner VBoxNsplPL_GetEventOwner
|
---|
554 | # define PL_GetEventQueueMonitor VBoxNsplPL_GetEventQueueMonitor
|
---|
555 | # define PL_GetEventQueueSelectFD VBoxNsplPL_GetEventQueueSelectFD
|
---|
556 | # define PL_MapEvents VBoxNsplPL_MapEvents
|
---|
557 | # define PL_PostEvent VBoxNsplPL_PostEvent
|
---|
558 | # define PL_PostSynchronousEvent VBoxNsplPL_PostSynchronousEvent
|
---|
559 | # define PL_ProcessEventsBeforeID VBoxNsplPL_ProcessEventsBeforeID
|
---|
560 | # define PL_ProcessPendingEvents VBoxNsplPL_ProcessPendingEvents
|
---|
561 | # define PL_RegisterEventIDFunc VBoxNsplPL_RegisterEventIDFunc
|
---|
562 | # define PL_RevokeEvents VBoxNsplPL_RevokeEvents
|
---|
563 | # define PL_UnregisterEventIDFunc VBoxNsplPL_UnregisterEventIDFunc
|
---|
564 | # define PL_WaitForEvent VBoxNsplPL_WaitForEvent
|
---|
565 | # define PL_IsQueueNative VBoxNsplPL_IsQueueNative
|
---|
566 | # define PL_IsQueueOnCurrentThread VBoxNsplPL_IsQueueOnCurrentThread
|
---|
567 | # define PL_FavorPerformanceHint VBoxNsplPL_FavorPerformanceHint
|
---|
568 | #endif /* VBOX_WITH_XPCOM_NAMESPACE_CLEANUP */
|
---|
569 |
|
---|
570 | typedef struct PLEvent PLEvent;
|
---|
571 | typedef struct PLEventQueue PLEventQueue;
|
---|
572 |
|
---|
573 | PR_EXTERN(PLEventQueue*)
|
---|
574 | PL_CreateEventQueue(const char* name, PRThread* handlerThread);
|
---|
575 | PR_EXTERN(PLEventQueue *)
|
---|
576 | PL_CreateNativeEventQueue(
|
---|
577 | const char *name,
|
---|
578 | PRThread *handlerThread
|
---|
579 | );
|
---|
580 | PR_EXTERN(PLEventQueue *)
|
---|
581 | PL_CreateMonitoredEventQueue(
|
---|
582 | const char *name,
|
---|
583 | PRThread *handlerThread
|
---|
584 | );
|
---|
585 | PR_EXTERN(void)
|
---|
586 | PL_DestroyEventQueue(PLEventQueue* self);
|
---|
587 | PR_EXTERN(PRMonitor*)
|
---|
588 | PL_GetEventQueueMonitor(PLEventQueue* self);
|
---|
589 |
|
---|
590 | #define PL_ENTER_EVENT_QUEUE_MONITOR(queue) \
|
---|
591 | PR_EnterMonitor(PL_GetEventQueueMonitor(queue))
|
---|
592 |
|
---|
593 | #define PL_EXIT_EVENT_QUEUE_MONITOR(queue) \
|
---|
594 | PR_ExitMonitor(PL_GetEventQueueMonitor(queue))
|
---|
595 |
|
---|
596 | PR_EXTERN(PRStatus) PL_PostEvent(PLEventQueue* self, PLEvent* event);
|
---|
597 | PR_EXTERN(void*) PL_PostSynchronousEvent(PLEventQueue* self, PLEvent* event);
|
---|
598 | PR_EXTERN(PLEvent*) PL_GetEvent(PLEventQueue* self);
|
---|
599 | PR_EXTERN(PRBool) PL_EventAvailable(PLEventQueue* self);
|
---|
600 |
|
---|
601 | typedef void (PR_CALLBACK *PLEventFunProc)(PLEvent* event, void* data, PLEventQueue* queue);
|
---|
602 |
|
---|
603 | PR_EXTERN(void) PL_MapEvents(PLEventQueue* self, PLEventFunProc fun, void* data);
|
---|
604 | PR_EXTERN(void) PL_RevokeEvents(PLEventQueue* self, void* owner);
|
---|
605 | PR_EXTERN(void) PL_ProcessPendingEvents(PLEventQueue* self);
|
---|
606 | PR_EXTERN(PLEvent*) PL_WaitForEvent(PLEventQueue* self);
|
---|
607 | PR_EXTERN(void) PL_EventLoop(PLEventQueue* self);
|
---|
608 | PR_EXTERN(PRInt32) PL_GetEventQueueSelectFD(PLEventQueue* self);
|
---|
609 | PR_EXTERN(PRBool) PL_IsQueueOnCurrentThread( PLEventQueue *queue );
|
---|
610 | PR_EXTERN(PRBool) PL_IsQueueNative(PLEventQueue *queue);
|
---|
611 |
|
---|
612 | typedef void* (PR_CALLBACK *PLHandleEventProc)(PLEvent* self);
|
---|
613 | typedef void (PR_CALLBACK *PLDestroyEventProc)(PLEvent* self);
|
---|
614 | PR_EXTERN(void)
|
---|
615 | PL_InitEvent(PLEvent* self, void* owner,
|
---|
616 | PLHandleEventProc handler,
|
---|
617 | PLDestroyEventProc destructor);
|
---|
618 | PR_EXTERN(void*) PL_GetEventOwner(PLEvent* self);
|
---|
619 | PR_EXTERN(void) PL_HandleEvent(PLEvent* self);
|
---|
620 | PR_EXTERN(void) PL_DestroyEvent(PLEvent* self);
|
---|
621 | PR_EXTERN(void) PL_DequeueEvent(PLEvent* self, PLEventQueue* queue);
|
---|
622 | PR_EXTERN(void) PL_FavorPerformanceHint(PRBool favorPerformanceOverEventStarvation, PRUint32 starvationDelay);
|
---|
623 |
|
---|
624 | struct PLEvent {
|
---|
625 | PRCList link;
|
---|
626 | PLHandleEventProc handler;
|
---|
627 | PLDestroyEventProc destructor;
|
---|
628 | void* owner;
|
---|
629 | void* synchronousResult;
|
---|
630 | PRLock* lock;
|
---|
631 | PRCondVar* condVar;
|
---|
632 | PRBool handled;
|
---|
633 | #ifdef PL_POST_TIMINGS
|
---|
634 | PRIntervalTime postTime;
|
---|
635 | #endif
|
---|
636 | #ifdef XP_UNIX
|
---|
637 | unsigned long id;
|
---|
638 | #endif /* XP_UNIX */
|
---|
639 | /* other fields follow... */
|
---|
640 | };
|
---|
641 |
|
---|
642 | #if defined(XP_WIN) || defined(XP_OS2)
|
---|
643 |
|
---|
644 | PR_EXTERN(HWND)
|
---|
645 | PL_GetNativeEventReceiverWindow(
|
---|
646 | PLEventQueue *eqp
|
---|
647 | );
|
---|
648 | #endif /* XP_WIN || XP_OS2 */
|
---|
649 |
|
---|
650 | #ifdef XP_UNIX
|
---|
651 |
|
---|
652 | PR_EXTERN(PRInt32)
|
---|
653 | PL_ProcessEventsBeforeID(PLEventQueue *aSelf, unsigned long aID);
|
---|
654 |
|
---|
655 | typedef unsigned long (PR_CALLBACK *PLGetEventIDFunc)(void *aClosure);
|
---|
656 |
|
---|
657 | PR_EXTERN(void)
|
---|
658 | PL_RegisterEventIDFunc(PLEventQueue *aSelf, PLGetEventIDFunc aFunc,
|
---|
659 | void *aClosure);
|
---|
660 | PR_EXTERN(void) PL_UnregisterEventIDFunc(PLEventQueue *aSelf);
|
---|
661 |
|
---|
662 | #endif /* XP_UNIX */
|
---|
663 |
|
---|
664 | /* Standard "it worked" return value */
|
---|
665 | #define NS_OK 0
|
---|
666 |
|
---|
667 | #define NS_ERROR_BASE ((nsresult) 0xC1F30000)
|
---|
668 |
|
---|
669 | /* Returned when an instance is not initialized */
|
---|
670 | #define NS_ERROR_NOT_INITIALIZED (NS_ERROR_BASE + 1)
|
---|
671 |
|
---|
672 | /* Returned when an instance is already initialized */
|
---|
673 | #define NS_ERROR_ALREADY_INITIALIZED (NS_ERROR_BASE + 2)
|
---|
674 |
|
---|
675 | /* Returned by a not implemented function */
|
---|
676 | #define NS_ERROR_NOT_IMPLEMENTED ((nsresult) 0x80004001L)
|
---|
677 |
|
---|
678 | /* Returned when a given interface is not supported. */
|
---|
679 | #define NS_NOINTERFACE ((nsresult) 0x80004002L)
|
---|
680 | #define NS_ERROR_NO_INTERFACE NS_NOINTERFACE
|
---|
681 |
|
---|
682 | #define NS_ERROR_INVALID_POINTER ((nsresult) 0x80004003L)
|
---|
683 | #define NS_ERROR_NULL_POINTER NS_ERROR_INVALID_POINTER
|
---|
684 |
|
---|
685 | /* Returned when a function aborts */
|
---|
686 | #define NS_ERROR_ABORT ((nsresult) 0x80004004L)
|
---|
687 |
|
---|
688 | /* Returned when a function fails */
|
---|
689 | #define NS_ERROR_FAILURE ((nsresult) 0x80004005L)
|
---|
690 |
|
---|
691 | /* Returned when an unexpected error occurs */
|
---|
692 | #define NS_ERROR_UNEXPECTED ((nsresult) 0x8000ffffL)
|
---|
693 |
|
---|
694 | /* Returned when a memory allocation fails */
|
---|
695 | #define NS_ERROR_OUT_OF_MEMORY ((nsresult) 0x8007000eL)
|
---|
696 |
|
---|
697 | /* Returned when an illegal value is passed */
|
---|
698 | #define NS_ERROR_ILLEGAL_VALUE ((nsresult) 0x80070057L)
|
---|
699 | #define NS_ERROR_INVALID_ARG NS_ERROR_ILLEGAL_VALUE
|
---|
700 |
|
---|
701 | /* Returned when a class doesn't allow aggregation */
|
---|
702 | #define NS_ERROR_NO_AGGREGATION ((nsresult) 0x80040110L)
|
---|
703 |
|
---|
704 | /* Returned when an operation can't complete due to an unavailable resource */
|
---|
705 | #define NS_ERROR_NOT_AVAILABLE ((nsresult) 0x80040111L)
|
---|
706 |
|
---|
707 | /* Returned when a class is not registered */
|
---|
708 | #define NS_ERROR_FACTORY_NOT_REGISTERED ((nsresult) 0x80040154L)
|
---|
709 |
|
---|
710 | /* Returned when a class cannot be registered, but may be tried again later */
|
---|
711 | #define NS_ERROR_FACTORY_REGISTER_AGAIN ((nsresult) 0x80040155L)
|
---|
712 |
|
---|
713 | /* Returned when a dynamically loaded factory couldn't be found */
|
---|
714 | #define NS_ERROR_FACTORY_NOT_LOADED ((nsresult) 0x800401f8L)
|
---|
715 |
|
---|
716 | /* Returned when a factory doesn't support signatures */
|
---|
717 | #define NS_ERROR_FACTORY_NO_SIGNATURE_SUPPORT \
|
---|
718 | (NS_ERROR_BASE + 0x101)
|
---|
719 |
|
---|
720 | /* Returned when a factory already is registered */
|
---|
721 | #define NS_ERROR_FACTORY_EXISTS (NS_ERROR_BASE + 0x100)
|
---|
722 |
|
---|
723 |
|
---|
724 | /**
|
---|
725 | * An "interface id" which can be used to uniquely identify a given
|
---|
726 | * interface.
|
---|
727 | * A "unique identifier". This is modeled after OSF DCE UUIDs.
|
---|
728 | */
|
---|
729 |
|
---|
730 | struct nsID {
|
---|
731 | PRUint32 m0;
|
---|
732 | PRUint16 m1;
|
---|
733 | PRUint16 m2;
|
---|
734 | PRUint8 m3[8];
|
---|
735 | };
|
---|
736 |
|
---|
737 | typedef struct nsID nsID;
|
---|
738 | typedef nsID nsIID;
|
---|
739 |
|
---|
740 | struct nsISupports; /* forward declaration */
|
---|
741 | struct nsIStackFrame; /* forward declaration */
|
---|
742 | struct nsIException; /* forward declaration */
|
---|
743 | typedef struct nsISupports nsISupports; /* forward declaration */
|
---|
744 | typedef struct nsIStackFrame nsIStackFrame; /* forward declaration */
|
---|
745 | typedef struct nsIException nsIException; /* forward declaration */
|
---|
746 |
|
---|
747 | /**
|
---|
748 | * IID for the nsISupports interface
|
---|
749 | * {00000000-0000-0000-c000-000000000046}
|
---|
750 | *
|
---|
751 | * To maintain binary compatibility with COM's IUnknown, we define the IID
|
---|
752 | * of nsISupports to be the same as that of COM's IUnknown.
|
---|
753 | */
|
---|
754 | #define NS_ISUPPORTS_IID \
|
---|
755 | { 0x00000000, 0x0000, 0x0000, \
|
---|
756 | {0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} }
|
---|
757 |
|
---|
758 | /**
|
---|
759 | * Reference count values
|
---|
760 | *
|
---|
761 | * This is the return type for AddRef() and Release() in nsISupports.
|
---|
762 | * IUnknown of COM returns an unsigned long from equivalent functions.
|
---|
763 | * The following ifdef exists to maintain binary compatibility with
|
---|
764 | * IUnknown.
|
---|
765 | */
|
---|
766 |
|
---|
767 | /**
|
---|
768 | * Basic component object model interface. Objects which implement
|
---|
769 | * this interface support runtime interface discovery (QueryInterface)
|
---|
770 | * and a reference counted memory model (AddRef/Release). This is
|
---|
771 | * modelled after the win32 IUnknown API.
|
---|
772 | */
|
---|
773 | struct nsISupports_vtbl {
|
---|
774 |
|
---|
775 | /**
|
---|
776 | * @name Methods
|
---|
777 | */
|
---|
778 |
|
---|
779 | /**
|
---|
780 | * A run time mechanism for interface discovery.
|
---|
781 | * @param aIID [in] A requested interface IID
|
---|
782 | * @param aInstancePtr [out] A pointer to an interface pointer to
|
---|
783 | * receive the result.
|
---|
784 | * @return NS_OK if the interface is supported by the associated
|
---|
785 | * instance, NS_NOINTERFACE if it is not.
|
---|
786 | * NS_ERROR_INVALID_POINTER if aInstancePtr is NULL.
|
---|
787 | */
|
---|
788 | nsresult (*QueryInterface)(nsISupports *pThis, const nsID *iid, void **resultp);
|
---|
789 | /**
|
---|
790 | * Increases the reference count for this interface.
|
---|
791 | * The associated instance will not be deleted unless
|
---|
792 | * the reference count is returned to zero.
|
---|
793 | *
|
---|
794 | * @return The resulting reference count.
|
---|
795 | */
|
---|
796 | nsresult (*AddRef)(nsISupports *pThis);
|
---|
797 |
|
---|
798 | /**
|
---|
799 | * Decreases the reference count for this interface.
|
---|
800 | * Generally, if the reference count returns to zero,
|
---|
801 | * the associated instance is deleted.
|
---|
802 | *
|
---|
803 | * @return The resulting reference count.
|
---|
804 | */
|
---|
805 | nsresult (*Release)(nsISupports *pThis);
|
---|
806 |
|
---|
807 | };
|
---|
808 |
|
---|
809 | struct nsISupports {
|
---|
810 | struct nsISupports_vtbl *vtbl;
|
---|
811 | };
|
---|
812 |
|
---|
813 | /* starting interface: nsIException */
|
---|
814 | #define NS_IEXCEPTION_IID_STR "f3a8d3b4-c424-4edc-8bf6-8974c983ba78"
|
---|
815 |
|
---|
816 | #define NS_IEXCEPTION_IID \
|
---|
817 | {0xf3a8d3b4, 0xc424, 0x4edc, \
|
---|
818 | { 0x8b, 0xf6, 0x89, 0x74, 0xc9, 0x83, 0xba, 0x78 }}
|
---|
819 |
|
---|
820 | struct nsIException_vtbl {
|
---|
821 |
|
---|
822 | /* Methods from the Class nsISupports */
|
---|
823 | struct nsISupports_vtbl nsisupports;
|
---|
824 |
|
---|
825 | /* readonly attribute string message; */
|
---|
826 | nsresult (*GetMessage)(nsIException *pThis, PRUnichar * *aMessage);
|
---|
827 |
|
---|
828 | /* readonly attribute nsresult (*result; */
|
---|
829 | nsresult (*GetResult)(nsIException *pThis, nsresult *aResult);
|
---|
830 |
|
---|
831 | /* readonly attribute string name; */
|
---|
832 | nsresult (*GetName)(nsIException *pThis, PRUnichar * *aName);
|
---|
833 |
|
---|
834 | /* readonly attribute string filename; */
|
---|
835 | nsresult (*GetFilename)(nsIException *pThis, PRUnichar * *aFilename);
|
---|
836 |
|
---|
837 | /* readonly attribute PRUint32 lineNumber; */
|
---|
838 | nsresult (*GetLineNumber)(nsIException *pThis, PRUint32 *aLineNumber);
|
---|
839 |
|
---|
840 | /* readonly attribute PRUint32 columnNumber; */
|
---|
841 | nsresult (*GetColumnNumber)(nsIException *pThis, PRUint32 *aColumnNumber);
|
---|
842 |
|
---|
843 | /* readonly attribute nsIStackFrame location; */
|
---|
844 | nsresult (*GetLocation)(nsIException *pThis, nsIStackFrame * *aLocation);
|
---|
845 |
|
---|
846 | /* readonly attribute nsIException inner; */
|
---|
847 | nsresult (*GetInner)(nsIException *pThis, nsIException * *aInner);
|
---|
848 |
|
---|
849 | /* readonly attribute nsISupports data; */
|
---|
850 | nsresult (*GetData)(nsIException *pThis, nsISupports * *aData);
|
---|
851 |
|
---|
852 | /* string toString (); */
|
---|
853 | nsresult (*ToString)(nsIException *pThis, PRUnichar **_retval);
|
---|
854 | };
|
---|
855 |
|
---|
856 | struct nsIException {
|
---|
857 | struct nsIException_vtbl *vtbl;
|
---|
858 | };
|
---|
859 |
|
---|
860 | /* starting interface: nsIStackFrame */
|
---|
861 | #define NS_ISTACKFRAME_IID_STR "91d82105-7c62-4f8b-9779-154277c0ee90"
|
---|
862 |
|
---|
863 | #define NS_ISTACKFRAME_IID \
|
---|
864 | {0x91d82105, 0x7c62, 0x4f8b, \
|
---|
865 | { 0x97, 0x79, 0x15, 0x42, 0x77, 0xc0, 0xee, 0x90 }}
|
---|
866 |
|
---|
867 | struct nsIStackFrame_vtbl {
|
---|
868 |
|
---|
869 | /* Methods from the Class nsISupports */
|
---|
870 | struct nsISupports_vtbl nsisupports;
|
---|
871 |
|
---|
872 | /* readonly attribute PRUint32 language; */
|
---|
873 | nsresult (*GetLanguage)(nsIStackFrame *pThis, PRUint32 *aLanguage);
|
---|
874 |
|
---|
875 | /* readonly attribute string languageName; */
|
---|
876 | nsresult (*GetLanguageName)(nsIStackFrame *pThis, PRUnichar * *aLanguageName);
|
---|
877 |
|
---|
878 | /* readonly attribute string filename; */
|
---|
879 | nsresult (*GetFilename)(nsIStackFrame *pThis, PRUnichar * *aFilename);
|
---|
880 |
|
---|
881 | /* readonly attribute string name; */
|
---|
882 | nsresult (*GetName)(nsIStackFrame *pThis, PRUnichar * *aName);
|
---|
883 |
|
---|
884 | /* readonly attribute PRInt32 lineNumber; */
|
---|
885 | nsresult (*GetLineNumber)(nsIStackFrame *pThis, PRInt32 *aLineNumber);
|
---|
886 |
|
---|
887 | /* readonly attribute string sourceLine; */
|
---|
888 | nsresult (*GetSourceLine)(nsIStackFrame *pThis, PRUnichar * *aSourceLine);
|
---|
889 |
|
---|
890 | /* readonly attribute nsIStackFrame caller; */
|
---|
891 | nsresult (*GetCaller)(nsIStackFrame *pThis, nsIStackFrame * *aCaller);
|
---|
892 |
|
---|
893 | /* string toString (); */
|
---|
894 | nsresult (*ToString)(nsIStackFrame *pThis, PRUnichar **_retval);
|
---|
895 | };
|
---|
896 |
|
---|
897 | struct nsIStackFrame {
|
---|
898 | struct nsIStackFrame_vtbl *vtbl;
|
---|
899 | };
|
---|
900 |
|
---|
901 | /* starting interface: nsIEventTarget */
|
---|
902 | #define NS_IEVENTTARGET_IID_STR "ea99ad5b-cc67-4efb-97c9-2ef620a59f2a"
|
---|
903 |
|
---|
904 | #define NS_IEVENTTARGET_IID \
|
---|
905 | {0xea99ad5b, 0xcc67, 0x4efb, \
|
---|
906 | { 0x97, 0xc9, 0x2e, 0xf6, 0x20, 0xa5, 0x9f, 0x2a }}
|
---|
907 |
|
---|
908 | struct nsIEventTarget;
|
---|
909 | typedef struct nsIEventTarget nsIEventTarget;
|
---|
910 |
|
---|
911 | struct nsIEventTarget_vtbl {
|
---|
912 |
|
---|
913 | struct nsISupports_vtbl nsisupports;
|
---|
914 |
|
---|
915 | nsresult (*PostEvent)(nsIEventTarget *pThis, PLEvent * aEvent);
|
---|
916 |
|
---|
917 | nsresult (*IsOnCurrentThread)(nsIEventTarget *pThis, PRBool *_retval);
|
---|
918 |
|
---|
919 | };
|
---|
920 |
|
---|
921 | struct nsIEventTarget {
|
---|
922 | struct nsIEventTarget_vtbl *vtbl;
|
---|
923 | };
|
---|
924 |
|
---|
925 | /* starting interface: nsIEventQueue */
|
---|
926 | #define NS_IEVENTQUEUE_IID_STR "176afb41-00a4-11d3-9f2a-00400553eef0"
|
---|
927 |
|
---|
928 | #define NS_IEVENTQUEUE_IID \
|
---|
929 | {0x176afb41, 0x00a4, 0x11d3, \
|
---|
930 | { 0x9f, 0x2a, 0x00, 0x40, 0x05, 0x53, 0xee, 0xf0 }}
|
---|
931 |
|
---|
932 | struct nsIEventQueue;
|
---|
933 | typedef struct nsIEventQueue nsIEventQueue;
|
---|
934 |
|
---|
935 | struct nsIEventQueue_vtbl {
|
---|
936 |
|
---|
937 | struct nsIEventTarget_vtbl nsieventtarget;
|
---|
938 |
|
---|
939 | nsresult (*InitEvent)(nsIEventQueue *pThis, PLEvent * aEvent, void * owner, PLHandleEventProc handler, PLDestroyEventProc destructor);
|
---|
940 |
|
---|
941 | nsresult (*PostSynchronousEvent)(nsIEventQueue *pThis, PLEvent * aEvent, void * *aResult);
|
---|
942 |
|
---|
943 | nsresult (*PendingEvents)(nsIEventQueue *pThis, PRBool *_retval);
|
---|
944 |
|
---|
945 | nsresult (*ProcessPendingEvents)(nsIEventQueue *pThis);
|
---|
946 |
|
---|
947 | nsresult (*EventLoop)(nsIEventQueue *pThis);
|
---|
948 |
|
---|
949 | nsresult (*EventAvailable)(nsIEventQueue *pThis, PRBool *aResult);
|
---|
950 |
|
---|
951 | nsresult (*GetEvent)(nsIEventQueue *pThis, PLEvent * *_retval);
|
---|
952 |
|
---|
953 | nsresult (*HandleEvent)(nsIEventQueue *pThis, PLEvent * aEvent);
|
---|
954 |
|
---|
955 | nsresult (*WaitForEvent)(nsIEventQueue *pThis, PLEvent * *_retval);
|
---|
956 |
|
---|
957 | PRInt32 (*GetEventQueueSelectFD)(nsIEventQueue *pThis);
|
---|
958 |
|
---|
959 | nsresult (*Init)(nsIEventQueue *pThis, PRBool aNative);
|
---|
960 |
|
---|
961 | nsresult (*InitFromPRThread)(nsIEventQueue *pThis, PRThread * thread, PRBool aNative);
|
---|
962 |
|
---|
963 | nsresult (*InitFromPLQueue)(nsIEventQueue *pThis, PLEventQueue * aQueue);
|
---|
964 |
|
---|
965 | nsresult (*EnterMonitor)(nsIEventQueue *pThis);
|
---|
966 |
|
---|
967 | nsresult (*ExitMonitor)(nsIEventQueue *pThis);
|
---|
968 |
|
---|
969 | nsresult (*RevokeEvents)(nsIEventQueue *pThis, void * owner);
|
---|
970 |
|
---|
971 | nsresult (*GetPLEventQueue)(nsIEventQueue *pThis, PLEventQueue * *_retval);
|
---|
972 |
|
---|
973 | nsresult (*IsQueueNative)(nsIEventQueue *pThis, PRBool *_retval);
|
---|
974 |
|
---|
975 | nsresult (*StopAcceptingEvents)(nsIEventQueue *pThis);
|
---|
976 |
|
---|
977 | };
|
---|
978 |
|
---|
979 | struct nsIEventQueue {
|
---|
980 | struct nsIEventQueue_vtbl *vtbl;
|
---|
981 | };
|
---|
982 |
|
---|
983 | </xsl:text>
|
---|
984 | <xsl:apply-templates/>
|
---|
985 | <xsl:text>
|
---|
986 | #endif /* !__cplusplus */
|
---|
987 |
|
---|
988 | #ifdef IN_VBOXXPCOMC
|
---|
989 | # define VBOXXPCOMC_DECL(type) PR_EXPORT(type)
|
---|
990 | #else
|
---|
991 | # define VBOXXPCOMC_DECL(type) PR_IMPORT(type)
|
---|
992 | #endif
|
---|
993 |
|
---|
994 | #ifdef __cplusplus
|
---|
995 | extern "C" {
|
---|
996 | #endif
|
---|
997 |
|
---|
998 |
|
---|
999 | /**
|
---|
1000 | * Function table for dynamic linking.
|
---|
1001 | * Use VBoxGetFunctions() to obtain the pointer to it.
|
---|
1002 | */
|
---|
1003 | typedef struct VBOXXPCOMC
|
---|
1004 | {
|
---|
1005 | /** The size of the structure. */
|
---|
1006 | unsigned cb;
|
---|
1007 | /** The structure version. */
|
---|
1008 | unsigned uVersion;
|
---|
1009 |
|
---|
1010 | unsigned int (*pfnGetVersion)(void);
|
---|
1011 |
|
---|
1012 | void (*pfnComInitialize)(const char *pszVirtualBoxIID,
|
---|
1013 | IVirtualBox **ppVirtualBox,
|
---|
1014 | const char *pszSessionIID,
|
---|
1015 | ISession **ppSession);
|
---|
1016 | void (*pfnComUninitialize)(void);
|
---|
1017 |
|
---|
1018 | void (*pfnComUnallocMem)(void *pv);
|
---|
1019 | void (*pfnUtf16Free)(PRUnichar *pwszString);
|
---|
1020 | void (*pfnUtf8Free)(char *pszString);
|
---|
1021 |
|
---|
1022 | int (*pfnUtf16ToUtf8)(const PRUnichar *pwszString, char **ppszString);
|
---|
1023 | int (*pfnUtf8ToUtf16)(const char *pszString, PRUnichar **ppwszString);
|
---|
1024 |
|
---|
1025 | void (*pfnGetEventQueue)(nsIEventQueue **eventQueue);
|
---|
1026 |
|
---|
1027 | /** Tail version, same as uVersion. */
|
---|
1028 | unsigned uEndVersion;
|
---|
1029 | } VBOXXPCOMC;
|
---|
1030 | /** Pointer to a const VBoxXPCOMC function table. */
|
---|
1031 | typedef VBOXXPCOMC const *PCVBOXXPCOM;
|
---|
1032 |
|
---|
1033 | /** The current interface version.
|
---|
1034 | * For use with VBoxGetXPCOMCFunctions and to be found in
|
---|
1035 | * VBOXXPCOMC::uVersion. */
|
---|
1036 | #define VBOX_XPCOMC_VERSION 0x00020000U
|
---|
1037 |
|
---|
1038 | VBOXXPCOMC_DECL(PCVBOXXPCOM) VBoxGetXPCOMCFunctions(unsigned uVersion);
|
---|
1039 | /** Typedef for VBoxGetXPCOMCFunctions. */
|
---|
1040 | typedef PCVBOXXPCOM (*PFNVBOXGETXPCOMCFUNCTIONS)(unsigned uVersion);
|
---|
1041 |
|
---|
1042 | /** The symbol name of VBoxGetXPCOMCFunctions. */
|
---|
1043 | #if defined(__OS2__)
|
---|
1044 | # define VBOX_GET_XPCOMC_FUNCTIONS_SYMBOL_NAME "_VBoxGetXPCOMCFunctions"
|
---|
1045 | #else
|
---|
1046 | # define VBOX_GET_XPCOMC_FUNCTIONS_SYMBOL_NAME "VBoxGetXPCOMCFunctions"
|
---|
1047 | #endif
|
---|
1048 |
|
---|
1049 |
|
---|
1050 | #ifdef __cplusplus
|
---|
1051 | }
|
---|
1052 | #endif
|
---|
1053 |
|
---|
1054 | #endif /* !___VirtualBox_CXPCOM_h */
|
---|
1055 | </xsl:text>
|
---|
1056 | </xsl:template>
|
---|
1057 |
|
---|
1058 | <!--
|
---|
1059 | * ignore all |if|s except those for XPIDL target
|
---|
1060 | <xsl:template match="if">
|
---|
1061 | <xsl:if test="@target='xpidl'">
|
---|
1062 | <xsl:apply-templates/>
|
---|
1063 | </xsl:if>
|
---|
1064 | </xsl:template>
|
---|
1065 | <xsl:template match="if" mode="forward">
|
---|
1066 | <xsl:if test="@target='xpidl'">
|
---|
1067 | <xsl:apply-templates mode="forward"/>
|
---|
1068 | </xsl:if>
|
---|
1069 | </xsl:template>
|
---|
1070 | <xsl:template match="if" mode="forwarder">
|
---|
1071 | <xsl:if test="@target='midl'">
|
---|
1072 | <xsl:apply-templates mode="forwarder"/>
|
---|
1073 | </xsl:if>
|
---|
1074 | </xsl:template>
|
---|
1075 |
|
---|
1076 | -->
|
---|
1077 |
|
---|
1078 | <!--
|
---|
1079 | * cpp_quote
|
---|
1080 | <xsl:template match="cpp">
|
---|
1081 | <xsl:if test="text()">
|
---|
1082 | <xsl:text>%{C++</xsl:text>
|
---|
1083 | <xsl:value-of select="text()"/>
|
---|
1084 | <xsl:text>
%}

</xsl:text>
|
---|
1085 | </xsl:if>
|
---|
1086 | <xsl:if test="not(text()) and @line">
|
---|
1087 | <xsl:text>%{C++
</xsl:text>
|
---|
1088 | <xsl:value-of select="@line"/>
|
---|
1089 | <xsl:text>
%}

</xsl:text>
|
---|
1090 | </xsl:if>
|
---|
1091 | </xsl:template>
|
---|
1092 | -->
|
---|
1093 |
|
---|
1094 |
|
---|
1095 | <!--
|
---|
1096 | * #if statement (@if attribute)
|
---|
1097 | * @note
|
---|
1098 | * xpidl doesn't support any preprocessor defines other than #include
|
---|
1099 | * (it just ignores them), so the generated IDL will most likely be
|
---|
1100 | * invalid. So for now we forbid using @if attributes
|
---|
1101 | -->
|
---|
1102 | <xsl:template match="@if" mode="begin">
|
---|
1103 | <xsl:message terminate="yes">
|
---|
1104 | @if attributes are not currently allowed because xpidl lacks
|
---|
1105 | support for #ifdef and stuff.
|
---|
1106 | </xsl:message>
|
---|
1107 | <xsl:text>#if </xsl:text>
|
---|
1108 | <xsl:value-of select="."/>
|
---|
1109 | <xsl:text>
</xsl:text>
|
---|
1110 | </xsl:template>
|
---|
1111 | <xsl:template match="@if" mode="end">
|
---|
1112 | <xsl:text>#endif
</xsl:text>
|
---|
1113 | </xsl:template>
|
---|
1114 |
|
---|
1115 |
|
---|
1116 | <!--
|
---|
1117 | * libraries
|
---|
1118 | -->
|
---|
1119 | <xsl:template match="library">
|
---|
1120 | <!-- result codes -->
|
---|
1121 | <xsl:text>
</xsl:text>
|
---|
1122 | <xsl:for-each select="result">
|
---|
1123 | <xsl:apply-templates select="."/>
|
---|
1124 | </xsl:for-each>
|
---|
1125 | <xsl:text>

</xsl:text>
|
---|
1126 | <!-- forward declarations -->
|
---|
1127 | <xsl:apply-templates select="if | interface" mode="forward"/>
|
---|
1128 | <xsl:text>
</xsl:text>
|
---|
1129 | <!-- typedef'ing the struct declarations -->
|
---|
1130 | <xsl:apply-templates select="if | interface" mode="typedef"/>
|
---|
1131 | <xsl:text>
</xsl:text>
|
---|
1132 | <!-- all enums go first -->
|
---|
1133 | <xsl:apply-templates select="enum | if/enum"/>
|
---|
1134 | <!-- everything else but result codes and enums -->
|
---|
1135 | <xsl:apply-templates select="*[not(self::result or self::enum) and
|
---|
1136 | not(self::if[result] or self::if[enum])]"/>
|
---|
1137 | <!-- -->
|
---|
1138 | </xsl:template>
|
---|
1139 |
|
---|
1140 |
|
---|
1141 | <!--
|
---|
1142 | * result codes
|
---|
1143 | -->
|
---|
1144 | <xsl:template match="result">
|
---|
1145 | <xsl:value-of select="concat('#define ',@name,' ',@value)"/>
|
---|
1146 | <xsl:text>
</xsl:text>
|
---|
1147 | </xsl:template>
|
---|
1148 |
|
---|
1149 |
|
---|
1150 | <!--
|
---|
1151 | * forward declarations
|
---|
1152 | -->
|
---|
1153 | <xsl:template match="interface" mode="forward">
|
---|
1154 | <xsl:text>struct </xsl:text>
|
---|
1155 | <xsl:value-of select="@name"/>
|
---|
1156 | <xsl:text>;
</xsl:text>
|
---|
1157 | </xsl:template>
|
---|
1158 |
|
---|
1159 |
|
---|
1160 | <!--
|
---|
1161 | * typedef'ing the struct declarations
|
---|
1162 | -->
|
---|
1163 | <xsl:template match="interface" mode="typedef">
|
---|
1164 | <xsl:text>typedef struct </xsl:text>
|
---|
1165 | <xsl:value-of select="@name"/>
|
---|
1166 | <xsl:text> </xsl:text>
|
---|
1167 | <xsl:value-of select="@name"/>
|
---|
1168 | <xsl:text>;
</xsl:text>
|
---|
1169 | </xsl:template>
|
---|
1170 |
|
---|
1171 |
|
---|
1172 | <!--
|
---|
1173 | * interfaces
|
---|
1174 | -->
|
---|
1175 | <xsl:template match="interface">
|
---|
1176 | <xsl:text>/* Start of struct </xsl:text>
|
---|
1177 | <xsl:value-of select="@name"/>
|
---|
1178 | <xsl:text> Declaration */
</xsl:text>
|
---|
1179 | <xsl:text>#define </xsl:text>
|
---|
1180 | <xsl:call-template name="uppercase">
|
---|
1181 | <xsl:with-param name="str" select="@name"/>
|
---|
1182 | </xsl:call-template>
|
---|
1183 | <xsl:value-of select="concat('_IID_STR "',@uuid,'"')"/>
|
---|
1184 | <xsl:text>
</xsl:text>
|
---|
1185 | <xsl:text>#define </xsl:text>
|
---|
1186 | <xsl:call-template name="uppercase">
|
---|
1187 | <xsl:with-param name="str" select="@name"/>
|
---|
1188 | </xsl:call-template>
|
---|
1189 | <xsl:text>_IID { \
</xsl:text>
|
---|
1190 | <xsl:text> 0x</xsl:text><xsl:value-of select="substring(@uuid,1,8)"/>
|
---|
1191 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,10,4)"/>
|
---|
1192 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,15,4)"/>
|
---|
1193 | <xsl:text>, \
 </xsl:text>
|
---|
1194 | <xsl:text>{ 0x</xsl:text><xsl:value-of select="substring(@uuid,20,2)"/>
|
---|
1195 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,22,2)"/>
|
---|
1196 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,25,2)"/>
|
---|
1197 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,27,2)"/>
|
---|
1198 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,29,2)"/>
|
---|
1199 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,31,2)"/>
|
---|
1200 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,33,2)"/>
|
---|
1201 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,35,2)"/>
|
---|
1202 | <xsl:text> } \
}
</xsl:text>
|
---|
1203 | <xsl:text>struct </xsl:text>
|
---|
1204 | <xsl:value-of select="@name"/>
|
---|
1205 | <xsl:text>_vtbl
{
</xsl:text>
|
---|
1206 | <xsl:text> </xsl:text>
|
---|
1207 | <xsl:choose>
|
---|
1208 | <xsl:when test="@extends='$unknown'">struct nsISupports_vtbl nsisupports;</xsl:when>
|
---|
1209 | <xsl:when test="@extends='$dispatched'">struct nsISupports_vtbl nsisupports;</xsl:when>
|
---|
1210 | <xsl:when test="@extends='$errorinfo'">struct nsIException_vtbl nsiexception;</xsl:when>
|
---|
1211 | <xsl:otherwise>
|
---|
1212 | <xsl:text>struct </xsl:text>
|
---|
1213 | <xsl:value-of select="@extends"/>
|
---|
1214 | <xsl:text>_vtbl </xsl:text>
|
---|
1215 | <xsl:call-template name="lowercase">
|
---|
1216 | <xsl:with-param name="str" select="@extends"/>
|
---|
1217 | </xsl:call-template>
|
---|
1218 | <xsl:text>;</xsl:text>
|
---|
1219 | </xsl:otherwise>
|
---|
1220 | </xsl:choose>
|
---|
1221 | <xsl:text>

</xsl:text>
|
---|
1222 | <!-- attributes (properties) -->
|
---|
1223 | <xsl:apply-templates select="attribute"/>
|
---|
1224 | <!-- methods -->
|
---|
1225 | <xsl:apply-templates select="method"/>
|
---|
1226 | <!-- 'if' enclosed elements, unsorted -->
|
---|
1227 | <xsl:apply-templates select="if"/>
|
---|
1228 | <!-- -->
|
---|
1229 | <xsl:text>};</xsl:text>
|
---|
1230 | <xsl:text>

</xsl:text>
|
---|
1231 | <xsl:text>struct </xsl:text>
|
---|
1232 | <xsl:value-of select="@name"/>
|
---|
1233 | <xsl:text>
{
 struct </xsl:text>
|
---|
1234 | <xsl:value-of select="@name"/>
|
---|
1235 | <xsl:text>_vtbl *vtbl;
};
</xsl:text>
|
---|
1236 | <xsl:text>/* End of struct </xsl:text>
|
---|
1237 | <xsl:value-of select="@name"/>
|
---|
1238 | <xsl:text> Declaration */


</xsl:text>
|
---|
1239 | </xsl:template>
|
---|
1240 |
|
---|
1241 |
|
---|
1242 | <!--
|
---|
1243 | * attributes
|
---|
1244 | -->
|
---|
1245 | <xsl:template match="interface//attribute">
|
---|
1246 | <xsl:apply-templates select="@if" mode="begin"/>
|
---|
1247 | <xsl:if test="@mod='ptr'">
|
---|
1248 | <!-- attributes using native types must be non-scriptable
|
---|
1249 | <xsl:text> [noscript]
</xsl:text>-->
|
---|
1250 | </xsl:if>
|
---|
1251 | <xsl:choose>
|
---|
1252 | <!-- safearray pseudo attribute -->
|
---|
1253 | <xsl:when test="@safearray='yes'">
|
---|
1254 | <!-- getter -->
|
---|
1255 | <xsl:text> nsresult (*Get</xsl:text>
|
---|
1256 | <xsl:call-template name="capitalize">
|
---|
1257 | <xsl:with-param name="str" select="@name"/>
|
---|
1258 | </xsl:call-template>
|
---|
1259 | <xsl:text>)(</xsl:text>
|
---|
1260 | <xsl:value-of select="../@name" />
|
---|
1261 | <xsl:text> *pThis, </xsl:text>
|
---|
1262 | <!-- array size -->
|
---|
1263 | <xsl:text>PRUint32 *</xsl:text>
|
---|
1264 | <xsl:value-of select="@name"/>
|
---|
1265 | <xsl:text>Size, </xsl:text>
|
---|
1266 | <!-- array pointer -->
|
---|
1267 | <xsl:apply-templates select="@type" mode="forwarder"/>
|
---|
1268 | <xsl:text> **</xsl:text>
|
---|
1269 | <xsl:value-of select="@name"/>
|
---|
1270 | <xsl:text>);
</xsl:text>
|
---|
1271 | <!-- setter -->
|
---|
1272 | <xsl:if test="not(@readonly='yes')">
|
---|
1273 | <xsl:text> nsresult set</xsl:text>
|
---|
1274 | <xsl:call-template name="capitalize">
|
---|
1275 | <xsl:with-param name="str" select="@name"/>
|
---|
1276 | </xsl:call-template>
|
---|
1277 | <xsl:text> (
</xsl:text>
|
---|
1278 | <!-- array size -->
|
---|
1279 | <xsl:text> in unsigned long </xsl:text>
|
---|
1280 | <xsl:value-of select="@name"/>
|
---|
1281 | <xsl:text>Size,
</xsl:text>
|
---|
1282 | <!-- array pointer -->
|
---|
1283 | <xsl:text> [array, size_is(</xsl:text>
|
---|
1284 | <xsl:value-of select="@name"/>
|
---|
1285 | <xsl:text>Size)] in </xsl:text>
|
---|
1286 | <xsl:apply-templates select="@type" mode="forwarder"/>
|
---|
1287 | <xsl:text> </xsl:text>
|
---|
1288 | <xsl:value-of select="@name"/>
|
---|
1289 | <xsl:text>
 );
</xsl:text>
|
---|
1290 | </xsl:if>
|
---|
1291 | </xsl:when>
|
---|
1292 | <!-- normal attribute -->
|
---|
1293 | <xsl:otherwise>
|
---|
1294 | <xsl:text> </xsl:text>
|
---|
1295 | <xsl:if test="@readonly='yes'">
|
---|
1296 | <xsl:text>nsresult (*Get</xsl:text>
|
---|
1297 | <xsl:call-template name="capitalize">
|
---|
1298 | <xsl:with-param name="str" select="@name"/>
|
---|
1299 | </xsl:call-template>
|
---|
1300 | <xsl:text>)(</xsl:text>
|
---|
1301 | <xsl:value-of select="../@name" />
|
---|
1302 | <xsl:text> *pThis, </xsl:text>
|
---|
1303 | <xsl:apply-templates select="@type" mode="forwarder"/>
|
---|
1304 | <xsl:text> *</xsl:text>
|
---|
1305 | <xsl:value-of select="@name"/>
|
---|
1306 | <xsl:text>);
</xsl:text>
|
---|
1307 | </xsl:if>
|
---|
1308 | <xsl:choose>
|
---|
1309 | <xsl:when test="@readonly='yes'">
|
---|
1310 | </xsl:when>
|
---|
1311 | <xsl:otherwise>
|
---|
1312 | <xsl:text>nsresult (*Get</xsl:text>
|
---|
1313 | <xsl:call-template name="capitalize">
|
---|
1314 | <xsl:with-param name="str" select="@name"/>
|
---|
1315 | </xsl:call-template>
|
---|
1316 | <xsl:text>)(</xsl:text>
|
---|
1317 | <xsl:value-of select="../@name" />
|
---|
1318 | <xsl:text> *pThis, </xsl:text>
|
---|
1319 | <xsl:apply-templates select="@type" mode="forwarder"/>
|
---|
1320 | <xsl:text> *</xsl:text>
|
---|
1321 | <xsl:value-of select="@name"/>
|
---|
1322 | <xsl:text>);
 </xsl:text>
|
---|
1323 | <xsl:text>nsresult (*Set</xsl:text>
|
---|
1324 | <xsl:call-template name="capitalize">
|
---|
1325 | <xsl:with-param name="str" select="@name"/>
|
---|
1326 | </xsl:call-template>
|
---|
1327 | <xsl:text>)(</xsl:text>
|
---|
1328 | <xsl:value-of select="../@name" />
|
---|
1329 | <xsl:text> *pThis, </xsl:text>
|
---|
1330 | <xsl:apply-templates select="@type" mode="forwarder"/>
|
---|
1331 | <xsl:text> </xsl:text>
|
---|
1332 | <xsl:value-of select="@name"/>
|
---|
1333 | <xsl:text>);
</xsl:text>
|
---|
1334 | </xsl:otherwise>
|
---|
1335 | </xsl:choose>
|
---|
1336 | </xsl:otherwise>
|
---|
1337 | </xsl:choose>
|
---|
1338 | <xsl:apply-templates select="@if" mode="end"/>
|
---|
1339 | <xsl:text>
</xsl:text>
|
---|
1340 | </xsl:template>
|
---|
1341 |
|
---|
1342 | <xsl:template match="interface//attribute" mode="forwarder">
|
---|
1343 |
|
---|
1344 | <xsl:variable name="parent" select="ancestor::interface"/>
|
---|
1345 |
|
---|
1346 | <xsl:apply-templates select="@if" mode="begin"/>
|
---|
1347 |
|
---|
1348 | <!-- getter: COM_FORWARD_Interface_GETTER_Name_TO(smth) -->
|
---|
1349 | <xsl:text>#define COM_FORWARD_</xsl:text>
|
---|
1350 | <xsl:value-of select="$parent/@name"/>
|
---|
1351 | <xsl:text>_GETTER_</xsl:text>
|
---|
1352 | <xsl:call-template name="capitalize">
|
---|
1353 | <xsl:with-param name="str" select="@name"/>
|
---|
1354 | </xsl:call-template>
|
---|
1355 | <xsl:text>_TO(smth) NS_IMETHOD Get</xsl:text>
|
---|
1356 | <xsl:call-template name="capitalize">
|
---|
1357 | <xsl:with-param name="str" select="@name"/>
|
---|
1358 | </xsl:call-template>
|
---|
1359 | <xsl:text> (</xsl:text>
|
---|
1360 | <xsl:if test="@safearray='yes'">
|
---|
1361 | <xsl:text>PRUint32 * a</xsl:text>
|
---|
1362 | <xsl:call-template name="capitalize">
|
---|
1363 | <xsl:with-param name="str" select="@name"/>
|
---|
1364 | </xsl:call-template>
|
---|
1365 | <xsl:text>Size, </xsl:text>
|
---|
1366 | </xsl:if>
|
---|
1367 | <xsl:apply-templates select="@type" mode="forwarder"/>
|
---|
1368 | <xsl:if test="@safearray='yes'">
|
---|
1369 | <xsl:text> *</xsl:text>
|
---|
1370 | </xsl:if>
|
---|
1371 | <xsl:text> * a</xsl:text>
|
---|
1372 | <xsl:call-template name="capitalize">
|
---|
1373 | <xsl:with-param name="str" select="@name"/>
|
---|
1374 | </xsl:call-template>
|
---|
1375 | <xsl:text>) { return smth Get</xsl:text>
|
---|
1376 | <xsl:call-template name="capitalize">
|
---|
1377 | <xsl:with-param name="str" select="@name"/>
|
---|
1378 | </xsl:call-template>
|
---|
1379 | <xsl:text> (</xsl:text>
|
---|
1380 | <xsl:if test="@safearray='yes'">
|
---|
1381 | <xsl:text>a</xsl:text>
|
---|
1382 | <xsl:call-template name="capitalize">
|
---|
1383 | <xsl:with-param name="str" select="@name"/>
|
---|
1384 | </xsl:call-template>
|
---|
1385 | <xsl:text>Size, </xsl:text>
|
---|
1386 | </xsl:if>
|
---|
1387 | <xsl:text>a</xsl:text>
|
---|
1388 | <xsl:call-template name="capitalize">
|
---|
1389 | <xsl:with-param name="str" select="@name"/>
|
---|
1390 | </xsl:call-template>
|
---|
1391 | <xsl:text>); }
</xsl:text>
|
---|
1392 | <!-- getter: COM_FORWARD_Interface_GETTER_Name_TO_OBJ(obj) -->
|
---|
1393 | <xsl:text>#define COM_FORWARD_</xsl:text>
|
---|
1394 | <xsl:value-of select="$parent/@name"/>
|
---|
1395 | <xsl:text>_GETTER_</xsl:text>
|
---|
1396 | <xsl:call-template name="capitalize">
|
---|
1397 | <xsl:with-param name="str" select="@name"/>
|
---|
1398 | </xsl:call-template>
|
---|
1399 | <xsl:text>_TO_OBJ(obj) COM_FORWARD_</xsl:text>
|
---|
1400 | <xsl:value-of select="$parent/@name"/>
|
---|
1401 | <xsl:text>_GETTER_</xsl:text>
|
---|
1402 | <xsl:call-template name="capitalize">
|
---|
1403 | <xsl:with-param name="str" select="@name"/>
|
---|
1404 | </xsl:call-template>
|
---|
1405 | <xsl:text>_TO ((obj)->)
</xsl:text>
|
---|
1406 | <!-- getter: COM_FORWARD_Interface_GETTER_Name_TO_BASE(base) -->
|
---|
1407 | <xsl:text>#define COM_FORWARD_</xsl:text>
|
---|
1408 | <xsl:value-of select="$parent/@name"/>
|
---|
1409 | <xsl:text>_GETTER_</xsl:text>
|
---|
1410 | <xsl:call-template name="capitalize">
|
---|
1411 | <xsl:with-param name="str" select="@name"/>
|
---|
1412 | </xsl:call-template>
|
---|
1413 | <xsl:text>_TO_BASE(base) COM_FORWARD_</xsl:text>
|
---|
1414 | <xsl:value-of select="$parent/@name"/>
|
---|
1415 | <xsl:text>_GETTER_</xsl:text>
|
---|
1416 | <xsl:call-template name="capitalize">
|
---|
1417 | <xsl:with-param name="str" select="@name"/>
|
---|
1418 | </xsl:call-template>
|
---|
1419 | <xsl:text>_TO (base::)
</xsl:text>
|
---|
1420 | <!-- -->
|
---|
1421 | <xsl:if test="not(@readonly='yes')">
|
---|
1422 | <!-- setter: COM_FORWARD_Interface_SETTER_Name_TO(smth) -->
|
---|
1423 | <xsl:text>#define COM_FORWARD_</xsl:text>
|
---|
1424 | <xsl:value-of select="$parent/@name"/>
|
---|
1425 | <xsl:text>_SETTER_</xsl:text>
|
---|
1426 | <xsl:call-template name="capitalize">
|
---|
1427 | <xsl:with-param name="str" select="@name"/>
|
---|
1428 | </xsl:call-template>
|
---|
1429 | <xsl:text>_TO(smth) NS_IMETHOD Set</xsl:text>
|
---|
1430 | <xsl:call-template name="capitalize">
|
---|
1431 | <xsl:with-param name="str" select="@name"/>
|
---|
1432 | </xsl:call-template>
|
---|
1433 | <xsl:text> (</xsl:text>
|
---|
1434 | <xsl:if test="@safearray='yes'">
|
---|
1435 | <xsl:text>PRUint32 a</xsl:text>
|
---|
1436 | <xsl:call-template name="capitalize">
|
---|
1437 | <xsl:with-param name="str" select="@name"/>
|
---|
1438 | </xsl:call-template>
|
---|
1439 | <xsl:text>Size, </xsl:text>
|
---|
1440 | </xsl:if>
|
---|
1441 | <xsl:if test="not(@safearray='yes') and (@type='string' or @type='wstring')">
|
---|
1442 | <xsl:text>const </xsl:text>
|
---|
1443 | </xsl:if>
|
---|
1444 | <xsl:apply-templates select="@type" mode="forwarder"/>
|
---|
1445 | <xsl:if test="@safearray='yes'">
|
---|
1446 | <xsl:text> *</xsl:text>
|
---|
1447 | </xsl:if>
|
---|
1448 | <xsl:text> a</xsl:text>
|
---|
1449 | <xsl:call-template name="capitalize">
|
---|
1450 | <xsl:with-param name="str" select="@name"/>
|
---|
1451 | </xsl:call-template>
|
---|
1452 | <xsl:text>) { return smth Set</xsl:text>
|
---|
1453 | <xsl:call-template name="capitalize">
|
---|
1454 | <xsl:with-param name="str" select="@name"/>
|
---|
1455 | </xsl:call-template>
|
---|
1456 | <xsl:text> (a</xsl:text>
|
---|
1457 | <xsl:call-template name="capitalize">
|
---|
1458 | <xsl:with-param name="str" select="@name"/>
|
---|
1459 | </xsl:call-template>
|
---|
1460 | <xsl:text>); }
</xsl:text>
|
---|
1461 | <!-- setter: COM_FORWARD_Interface_SETTER_Name_TO_OBJ(obj) -->
|
---|
1462 | <xsl:text>#define COM_FORWARD_</xsl:text>
|
---|
1463 | <xsl:value-of select="$parent/@name"/>
|
---|
1464 | <xsl:text>_SETTER_</xsl:text>
|
---|
1465 | <xsl:call-template name="capitalize">
|
---|
1466 | <xsl:with-param name="str" select="@name"/>
|
---|
1467 | </xsl:call-template>
|
---|
1468 | <xsl:text>_TO_OBJ(obj) COM_FORWARD_</xsl:text>
|
---|
1469 | <xsl:value-of select="$parent/@name"/>
|
---|
1470 | <xsl:text>_SETTER_</xsl:text>
|
---|
1471 | <xsl:call-template name="capitalize">
|
---|
1472 | <xsl:with-param name="str" select="@name"/>
|
---|
1473 | </xsl:call-template>
|
---|
1474 | <xsl:text>_TO ((obj)->)
</xsl:text>
|
---|
1475 | <!-- setter: COM_FORWARD_Interface_SETTER_Name_TO_BASE(base) -->
|
---|
1476 | <xsl:text>#define COM_FORWARD_</xsl:text>
|
---|
1477 | <xsl:value-of select="$parent/@name"/>
|
---|
1478 | <xsl:text>_SETTER_</xsl:text>
|
---|
1479 | <xsl:call-template name="capitalize">
|
---|
1480 | <xsl:with-param name="str" select="@name"/>
|
---|
1481 | </xsl:call-template>
|
---|
1482 | <xsl:text>_TO_BASE(base) COM_FORWARD_</xsl:text>
|
---|
1483 | <xsl:value-of select="$parent/@name"/>
|
---|
1484 | <xsl:text>_SETTER_</xsl:text>
|
---|
1485 | <xsl:call-template name="capitalize">
|
---|
1486 | <xsl:with-param name="str" select="@name"/>
|
---|
1487 | </xsl:call-template>
|
---|
1488 | <xsl:text>_TO (base::)
</xsl:text>
|
---|
1489 | </xsl:if>
|
---|
1490 |
|
---|
1491 | <xsl:apply-templates select="@if" mode="end"/>
|
---|
1492 |
|
---|
1493 | </xsl:template>
|
---|
1494 |
|
---|
1495 |
|
---|
1496 | <!--
|
---|
1497 | * methods
|
---|
1498 | -->
|
---|
1499 | <xsl:template match="interface//method">
|
---|
1500 | <xsl:apply-templates select="@if" mode="begin"/>
|
---|
1501 | <xsl:if test="param/@mod='ptr'">
|
---|
1502 | <!-- methods using native types must be non-scriptable
|
---|
1503 | <xsl:text> [noscript]
</xsl:text>-->
|
---|
1504 | </xsl:if>
|
---|
1505 | <xsl:text> nsresult (*</xsl:text>
|
---|
1506 | <xsl:call-template name="capitalize">
|
---|
1507 | <xsl:with-param name="str" select="@name"/>
|
---|
1508 | </xsl:call-template>
|
---|
1509 | <xsl:if test="param">
|
---|
1510 | <xsl:text>)(
</xsl:text>
|
---|
1511 | <xsl:text> </xsl:text>
|
---|
1512 | <xsl:value-of select="../@name" />
|
---|
1513 | <xsl:text> *pThis,
</xsl:text>
|
---|
1514 | <xsl:for-each select="param [position() != last()]">
|
---|
1515 | <xsl:text> </xsl:text>
|
---|
1516 | <xsl:apply-templates select="."/>
|
---|
1517 | <xsl:text>,
</xsl:text>
|
---|
1518 | </xsl:for-each>
|
---|
1519 | <xsl:text> </xsl:text>
|
---|
1520 | <xsl:apply-templates select="param [last()]"/>
|
---|
1521 | <xsl:text>
 );
</xsl:text>
|
---|
1522 | </xsl:if>
|
---|
1523 | <xsl:if test="not(param)">
|
---|
1524 | <xsl:text>)(</xsl:text>
|
---|
1525 | <xsl:value-of select="../@name" />
|
---|
1526 | <xsl:text> *pThis );
</xsl:text>
|
---|
1527 | </xsl:if>
|
---|
1528 | <xsl:apply-templates select="@if" mode="end"/>
|
---|
1529 | <xsl:text>
</xsl:text>
|
---|
1530 | </xsl:template>
|
---|
1531 |
|
---|
1532 | <xsl:template match="interface//method" mode="forwarder">
|
---|
1533 |
|
---|
1534 | <xsl:variable name="parent" select="ancestor::interface"/>
|
---|
1535 |
|
---|
1536 | <xsl:apply-templates select="@if" mode="begin"/>
|
---|
1537 |
|
---|
1538 | <xsl:text>#define COM_FORWARD_</xsl:text>
|
---|
1539 | <xsl:value-of select="$parent/@name"/>
|
---|
1540 | <xsl:text>_</xsl:text>
|
---|
1541 | <xsl:call-template name="capitalize">
|
---|
1542 | <xsl:with-param name="str" select="@name"/>
|
---|
1543 | </xsl:call-template>
|
---|
1544 | <xsl:text>_TO(smth) NS_IMETHOD </xsl:text>
|
---|
1545 | <xsl:call-template name="capitalize">
|
---|
1546 | <xsl:with-param name="str" select="@name"/>
|
---|
1547 | </xsl:call-template>
|
---|
1548 | <xsl:choose>
|
---|
1549 | <xsl:when test="param">
|
---|
1550 | <xsl:text> (</xsl:text>
|
---|
1551 | <xsl:for-each select="param [position() != last()]">
|
---|
1552 | <xsl:apply-templates select="." mode="forwarder"/>
|
---|
1553 | <xsl:text>, </xsl:text>
|
---|
1554 | </xsl:for-each>
|
---|
1555 | <xsl:apply-templates select="param [last()]" mode="forwarder"/>
|
---|
1556 | <xsl:text>) { return smth </xsl:text>
|
---|
1557 | <xsl:call-template name="capitalize">
|
---|
1558 | <xsl:with-param name="str" select="@name"/>
|
---|
1559 | </xsl:call-template>
|
---|
1560 | <xsl:text> (</xsl:text>
|
---|
1561 | <xsl:for-each select="param [position() != last()]">
|
---|
1562 | <xsl:if test="@safearray='yes'">
|
---|
1563 | <xsl:text>a</xsl:text>
|
---|
1564 | <xsl:call-template name="capitalize">
|
---|
1565 | <xsl:with-param name="str" select="@name"/>
|
---|
1566 | </xsl:call-template>
|
---|
1567 | <xsl:text>Size+++, </xsl:text>
|
---|
1568 | </xsl:if>
|
---|
1569 | <xsl:text>a</xsl:text>
|
---|
1570 | <xsl:call-template name="capitalize">
|
---|
1571 | <xsl:with-param name="str" select="@name"/>
|
---|
1572 | </xsl:call-template>
|
---|
1573 | <xsl:text>, </xsl:text>
|
---|
1574 | </xsl:for-each>
|
---|
1575 | <xsl:if test="param [last()]/@safearray='yes'">
|
---|
1576 | <xsl:text>a</xsl:text>
|
---|
1577 | <xsl:call-template name="capitalize">
|
---|
1578 | <xsl:with-param name="str" select="param [last()]/@name"/>
|
---|
1579 | </xsl:call-template>
|
---|
1580 | <xsl:text>Size, </xsl:text>
|
---|
1581 | </xsl:if>
|
---|
1582 | <xsl:text>a</xsl:text>
|
---|
1583 | <xsl:call-template name="capitalize">
|
---|
1584 | <xsl:with-param name="str" select="param [last()]/@name"/>
|
---|
1585 | </xsl:call-template>
|
---|
1586 | <xsl:text>); }</xsl:text>
|
---|
1587 | </xsl:when>
|
---|
1588 | <xsl:otherwise test="not(param)">
|
---|
1589 | <xsl:text>() { return smth </xsl:text>
|
---|
1590 | <xsl:call-template name="capitalize">
|
---|
1591 | <xsl:with-param name="str" select="@name"/>
|
---|
1592 | </xsl:call-template>
|
---|
1593 | <xsl:text>(); }</xsl:text>
|
---|
1594 | </xsl:otherwise>
|
---|
1595 | </xsl:choose>
|
---|
1596 | <xsl:text>
</xsl:text>
|
---|
1597 | <!-- COM_FORWARD_Interface_Method_TO_OBJ(obj) -->
|
---|
1598 | <xsl:text>#define COM_FORWARD_</xsl:text>
|
---|
1599 | <xsl:value-of select="$parent/@name"/>
|
---|
1600 | <xsl:text>_</xsl:text>
|
---|
1601 | <xsl:call-template name="capitalize">
|
---|
1602 | <xsl:with-param name="str" select="@name"/>
|
---|
1603 | </xsl:call-template>
|
---|
1604 | <xsl:text>_TO_OBJ(obj) COM_FORWARD_</xsl:text>
|
---|
1605 | <xsl:value-of select="$parent/@name"/>
|
---|
1606 | <xsl:text>_</xsl:text>
|
---|
1607 | <xsl:call-template name="capitalize">
|
---|
1608 | <xsl:with-param name="str" select="@name"/>
|
---|
1609 | </xsl:call-template>
|
---|
1610 | <xsl:text>_TO ((obj)->)
</xsl:text>
|
---|
1611 | <!-- COM_FORWARD_Interface_Method_TO_BASE(base) -->
|
---|
1612 | <xsl:text>#define COM_FORWARD_</xsl:text>
|
---|
1613 | <xsl:value-of select="$parent/@name"/>
|
---|
1614 | <xsl:text>_</xsl:text>
|
---|
1615 | <xsl:call-template name="capitalize">
|
---|
1616 | <xsl:with-param name="str" select="@name"/>
|
---|
1617 | </xsl:call-template>
|
---|
1618 | <xsl:text>_TO_BASE(base) COM_FORWARD_</xsl:text>
|
---|
1619 | <xsl:value-of select="$parent/@name"/>
|
---|
1620 | <xsl:text>_</xsl:text>
|
---|
1621 | <xsl:call-template name="capitalize">
|
---|
1622 | <xsl:with-param name="str" select="@name"/>
|
---|
1623 | </xsl:call-template>
|
---|
1624 | <xsl:text>_TO (base::)
</xsl:text>
|
---|
1625 |
|
---|
1626 | <xsl:apply-templates select="@if" mode="end"/>
|
---|
1627 |
|
---|
1628 | </xsl:template>
|
---|
1629 |
|
---|
1630 |
|
---|
1631 | <!--
|
---|
1632 | * modules
|
---|
1633 | -->
|
---|
1634 | <xsl:template match="module">
|
---|
1635 | <xsl:apply-templates select="class"/>
|
---|
1636 | </xsl:template>
|
---|
1637 |
|
---|
1638 |
|
---|
1639 | <!--
|
---|
1640 | * co-classes
|
---|
1641 | -->
|
---|
1642 | <xsl:template match="module/class">
|
---|
1643 | <!-- class and contract id -->
|
---|
1644 | <xsl:text>
</xsl:text>
|
---|
1645 | <xsl:text>#define NS_</xsl:text>
|
---|
1646 | <xsl:call-template name="uppercase">
|
---|
1647 | <xsl:with-param name="str" select="@name"/>
|
---|
1648 | </xsl:call-template>
|
---|
1649 | <xsl:text>_CID { \
</xsl:text>
|
---|
1650 | <xsl:text> 0x</xsl:text><xsl:value-of select="substring(@uuid,1,8)"/>
|
---|
1651 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,10,4)"/>
|
---|
1652 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,15,4)"/>
|
---|
1653 | <xsl:text>, \
 </xsl:text>
|
---|
1654 | <xsl:text>{ 0x</xsl:text><xsl:value-of select="substring(@uuid,20,2)"/>
|
---|
1655 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,22,2)"/>
|
---|
1656 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,25,2)"/>
|
---|
1657 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,27,2)"/>
|
---|
1658 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,29,2)"/>
|
---|
1659 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,31,2)"/>
|
---|
1660 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,33,2)"/>
|
---|
1661 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,35,2)"/>
|
---|
1662 | <xsl:text> } \
}
</xsl:text>
|
---|
1663 | <xsl:text>#define NS_</xsl:text>
|
---|
1664 | <xsl:call-template name="uppercase">
|
---|
1665 | <xsl:with-param name="str" select="@name"/>
|
---|
1666 | </xsl:call-template>
|
---|
1667 | <!-- Contract ID -->
|
---|
1668 | <xsl:text>_CONTRACTID "@</xsl:text>
|
---|
1669 | <xsl:value-of select="@namespace"/>
|
---|
1670 | <xsl:text>/</xsl:text>
|
---|
1671 | <xsl:value-of select="@name"/>
|
---|
1672 | <xsl:text>;1"
</xsl:text>
|
---|
1673 | <!-- CLSID_xxx declarations for XPCOM, for compatibility with Win32 -->
|
---|
1674 | <xsl:text>/* for compatibility with Win32 */
</xsl:text>
|
---|
1675 | <xsl:text>#define CLSID_</xsl:text>
|
---|
1676 | <xsl:value-of select="@name"/>
|
---|
1677 | <xsl:text> (nsCID) NS_</xsl:text>
|
---|
1678 | <xsl:call-template name="uppercase">
|
---|
1679 | <xsl:with-param name="str" select="@name"/>
|
---|
1680 | </xsl:call-template>
|
---|
1681 | <xsl:text>_CID
</xsl:text>
|
---|
1682 | <xsl:text>

</xsl:text>
|
---|
1683 | </xsl:template>
|
---|
1684 |
|
---|
1685 |
|
---|
1686 | <!--
|
---|
1687 | * enums
|
---|
1688 | -->
|
---|
1689 | <xsl:template match="enum">
|
---|
1690 | <xsl:text>/* Start of enum </xsl:text>
|
---|
1691 | <xsl:value-of select="@name"/>
|
---|
1692 | <xsl:text> Declaration */
</xsl:text>
|
---|
1693 | <xsl:text>#define </xsl:text>
|
---|
1694 | <xsl:call-template name="uppercase">
|
---|
1695 | <xsl:with-param name="str" select="@name"/>
|
---|
1696 | </xsl:call-template>
|
---|
1697 | <xsl:value-of select="concat('_IID_STR "',@uuid,'"')"/>
|
---|
1698 | <xsl:text>
</xsl:text>
|
---|
1699 | <xsl:text>#define </xsl:text>
|
---|
1700 | <xsl:call-template name="uppercase">
|
---|
1701 | <xsl:with-param name="str" select="@name"/>
|
---|
1702 | </xsl:call-template>
|
---|
1703 | <xsl:text>_IID { \
</xsl:text>
|
---|
1704 | <xsl:text> 0x</xsl:text><xsl:value-of select="substring(@uuid,1,8)"/>
|
---|
1705 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,10,4)"/>
|
---|
1706 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,15,4)"/>
|
---|
1707 | <xsl:text>, \
 </xsl:text>
|
---|
1708 | <xsl:text>{ 0x</xsl:text><xsl:value-of select="substring(@uuid,20,2)"/>
|
---|
1709 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,22,2)"/>
|
---|
1710 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,25,2)"/>
|
---|
1711 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,27,2)"/>
|
---|
1712 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,29,2)"/>
|
---|
1713 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,31,2)"/>
|
---|
1714 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,33,2)"/>
|
---|
1715 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,35,2)"/>
|
---|
1716 | <xsl:text> } \
}
</xsl:text>
|
---|
1717 | <xsl:text>enum </xsl:text>
|
---|
1718 | <xsl:value-of select="@name"/>
|
---|
1719 | <xsl:text>
{
</xsl:text>
|
---|
1720 | <xsl:variable name="this" select="."/>
|
---|
1721 | <xsl:for-each select="const">
|
---|
1722 | <xsl:text> </xsl:text>
|
---|
1723 | <xsl:value-of select="$this/@name"/>
|
---|
1724 | <xsl:text>_</xsl:text>
|
---|
1725 | <xsl:value-of select="@name"/> = <xsl:value-of select="@value"/>
|
---|
1726 | <xsl:if test="position() != last()">
|
---|
1727 | <xsl:text>,</xsl:text>
|
---|
1728 | </xsl:if>
|
---|
1729 | <xsl:text>
</xsl:text>
|
---|
1730 | </xsl:for-each>
|
---|
1731 | <xsl:text>};
</xsl:text>
|
---|
1732 | <xsl:text>/* End of enum </xsl:text>
|
---|
1733 | <xsl:value-of select="@name"/>
|
---|
1734 | <xsl:text> Declaration */


</xsl:text>
|
---|
1735 | </xsl:template>
|
---|
1736 |
|
---|
1737 |
|
---|
1738 | <!--
|
---|
1739 | * method parameters
|
---|
1740 | -->
|
---|
1741 | <xsl:template match="method/param">
|
---|
1742 | <xsl:choose>
|
---|
1743 | <!-- safearray parameters -->
|
---|
1744 | <xsl:when test="@safearray='yes'">
|
---|
1745 | <!-- array size -->
|
---|
1746 | <xsl:choose>
|
---|
1747 | <xsl:when test="@dir='in'">
|
---|
1748 | <xsl:text>PRUint32 </xsl:text>
|
---|
1749 | <xsl:value-of select="@name"/>
|
---|
1750 | <xsl:text>Size,
</xsl:text>
|
---|
1751 | </xsl:when>
|
---|
1752 | <xsl:when test="@dir='out'">
|
---|
1753 | <xsl:text>PRUint32 *</xsl:text>
|
---|
1754 | <xsl:value-of select="@name"/>
|
---|
1755 | <xsl:text>Size,
</xsl:text>
|
---|
1756 | </xsl:when>
|
---|
1757 | <xsl:when test="@dir='return'">
|
---|
1758 | <xsl:text>PRUint32 *</xsl:text>
|
---|
1759 | <xsl:value-of select="@name"/>
|
---|
1760 | <xsl:text>Size,
</xsl:text>
|
---|
1761 | </xsl:when>
|
---|
1762 | <xsl:otherwise>
|
---|
1763 | <xsl:text>PRUint32 </xsl:text>
|
---|
1764 | <xsl:value-of select="@name"/>
|
---|
1765 | <xsl:text>Size,
</xsl:text>
|
---|
1766 | </xsl:otherwise>
|
---|
1767 | </xsl:choose>
|
---|
1768 | <!-- array pointer -->
|
---|
1769 | <xsl:text> </xsl:text>
|
---|
1770 | <xsl:choose>
|
---|
1771 | <xsl:when test="@dir='in'">
|
---|
1772 | <xsl:apply-templates select="@type" mode="forwarder"/>
|
---|
1773 | <xsl:text>*</xsl:text>
|
---|
1774 | </xsl:when>
|
---|
1775 | <xsl:when test="@dir='out'">
|
---|
1776 | <xsl:apply-templates select="@type" mode="forwarder"/>
|
---|
1777 | <xsl:if test="@type='wstring'">
|
---|
1778 | <xsl:text>*</xsl:text>
|
---|
1779 | </xsl:if>
|
---|
1780 | <xsl:text>*</xsl:text>
|
---|
1781 | </xsl:when>
|
---|
1782 | <xsl:when test="@dir='return'">
|
---|
1783 | <xsl:apply-templates select="@type" mode="forwarder"/>
|
---|
1784 | <xsl:text>**</xsl:text>
|
---|
1785 | </xsl:when>
|
---|
1786 | <xsl:otherwise>
|
---|
1787 | <xsl:apply-templates select="@type" mode="forwarder"/>
|
---|
1788 | <xsl:text>*</xsl:text>
|
---|
1789 | </xsl:otherwise>
|
---|
1790 | </xsl:choose>
|
---|
1791 | <xsl:text> </xsl:text>
|
---|
1792 | <xsl:value-of select="@name"/>
|
---|
1793 | </xsl:when>
|
---|
1794 | <!-- normal and array parameters -->
|
---|
1795 | <xsl:otherwise>
|
---|
1796 | <xsl:choose>
|
---|
1797 | <xsl:when test="@dir='in'">
|
---|
1798 | <xsl:apply-templates select="@type" mode="forwarder"/>
|
---|
1799 | <xsl:text></xsl:text>
|
---|
1800 | </xsl:when>
|
---|
1801 | <xsl:when test="@dir='out'">
|
---|
1802 | <xsl:apply-templates select="@type" mode="forwarder"/>
|
---|
1803 | <xsl:text> *</xsl:text>
|
---|
1804 | </xsl:when>
|
---|
1805 | <xsl:when test="@dir='return'">
|
---|
1806 | <xsl:apply-templates select="@type" mode="forwarder"/>
|
---|
1807 | <xsl:text> *</xsl:text>
|
---|
1808 | </xsl:when>
|
---|
1809 | <xsl:otherwise>
|
---|
1810 | <xsl:apply-templates select="@type" mode="forwarder"/>
|
---|
1811 | <xsl:text></xsl:text>
|
---|
1812 | </xsl:otherwise>
|
---|
1813 | </xsl:choose>
|
---|
1814 | <xsl:text> </xsl:text>
|
---|
1815 | <xsl:value-of select="@name"/>
|
---|
1816 | </xsl:otherwise>
|
---|
1817 | </xsl:choose>
|
---|
1818 | </xsl:template>
|
---|
1819 |
|
---|
1820 | <xsl:template match="method/param" mode="forwarder">
|
---|
1821 | <xsl:if test="@safearray='yes'">
|
---|
1822 | <xsl:text>PRUint32</xsl:text>
|
---|
1823 | <xsl:if test="@dir='out' or @dir='return'">
|
---|
1824 | <xsl:text> *</xsl:text>
|
---|
1825 | </xsl:if>
|
---|
1826 | <xsl:text> a</xsl:text>
|
---|
1827 | <xsl:call-template name="capitalize">
|
---|
1828 | <xsl:with-param name="str" select="@name"/>
|
---|
1829 | </xsl:call-template>
|
---|
1830 | <xsl:text>Size, </xsl:text>
|
---|
1831 | </xsl:if>
|
---|
1832 | <xsl:apply-templates select="@type" mode="forwarder"/>
|
---|
1833 | <xsl:if test="@dir='out' or @dir='return'">
|
---|
1834 | <xsl:text> *</xsl:text>
|
---|
1835 | </xsl:if>
|
---|
1836 | <xsl:if test="@safearray='yes'">
|
---|
1837 | <xsl:text> *</xsl:text>
|
---|
1838 | </xsl:if>
|
---|
1839 | <xsl:text> a</xsl:text>
|
---|
1840 | <xsl:call-template name="capitalize">
|
---|
1841 | <xsl:with-param name="str" select="@name"/>
|
---|
1842 | </xsl:call-template>
|
---|
1843 | </xsl:template>
|
---|
1844 |
|
---|
1845 |
|
---|
1846 | <!--
|
---|
1847 | * attribute/parameter type conversion
|
---|
1848 | -->
|
---|
1849 | <xsl:template match="attribute/@type | param/@type">
|
---|
1850 | <xsl:variable name="self_target" select="current()/ancestor::if/@target"/>
|
---|
1851 |
|
---|
1852 | <xsl:choose>
|
---|
1853 | <!-- modifiers (ignored for 'enumeration' attributes)-->
|
---|
1854 | <xsl:when test="name(current())='type' and ../@mod">
|
---|
1855 | <xsl:choose>
|
---|
1856 | <xsl:when test="../@mod='ptr'">
|
---|
1857 | <xsl:choose>
|
---|
1858 | <!-- standard types -->
|
---|
1859 | <!--xsl:when test=".='result'">??</xsl:when-->
|
---|
1860 | <xsl:when test=".='boolean'">booleanPtr</xsl:when>
|
---|
1861 | <xsl:when test=".='octet'">octetPtr</xsl:when>
|
---|
1862 | <xsl:when test=".='short'">shortPtr</xsl:when>
|
---|
1863 | <xsl:when test=".='unsigned short'">ushortPtr</xsl:when>
|
---|
1864 | <xsl:when test=".='long'">longPtr</xsl:when>
|
---|
1865 | <xsl:when test=".='long long'">llongPtr</xsl:when>
|
---|
1866 | <xsl:when test=".='unsigned long'">ulongPtr</xsl:when>
|
---|
1867 | <xsl:when test=".='unsigned long long'">ullongPtr</xsl:when>
|
---|
1868 | <xsl:otherwise>
|
---|
1869 | <xsl:message terminate="yes">
|
---|
1870 | <xsl:value-of select="concat(../../../@name,'::',../../@name,'::',../@name,': ')"/>
|
---|
1871 | <xsl:text>attribute 'mod=</xsl:text>
|
---|
1872 | <xsl:value-of select="concat('"',../@mod,'"')"/>
|
---|
1873 | <xsl:text>' cannot be used with type </xsl:text>
|
---|
1874 | <xsl:value-of select="concat('"',current(),'"!')"/>
|
---|
1875 | </xsl:message>
|
---|
1876 | </xsl:otherwise>
|
---|
1877 | </xsl:choose>
|
---|
1878 | </xsl:when>
|
---|
1879 | <xsl:when test="../@mod='string'">
|
---|
1880 | <xsl:choose>
|
---|
1881 | <!-- standard types -->
|
---|
1882 | <!--xsl:when test=".='result'">??</xsl:when-->
|
---|
1883 | <xsl:when test=".='uuid'">wstring</xsl:when>
|
---|
1884 | <xsl:otherwise>
|
---|
1885 | <xsl:message terminate="yes">
|
---|
1886 | <xsl:value-of select="concat(../../../@name,'::',../../@name,'::',../@name,': ')"/>
|
---|
1887 | <xsl:text>attribute 'mod=</xsl:text>
|
---|
1888 | <xsl:value-of select="concat('"',../@mod,'"')"/>
|
---|
1889 | <xsl:text>' cannot be used with type </xsl:text>
|
---|
1890 | <xsl:value-of select="concat('"',current(),'"!')"/>
|
---|
1891 | </xsl:message>
|
---|
1892 | </xsl:otherwise>
|
---|
1893 | </xsl:choose>
|
---|
1894 | </xsl:when>
|
---|
1895 | <xsl:otherwise>
|
---|
1896 | <xsl:message terminate="yes">
|
---|
1897 | <xsl:value-of select="concat(../../../@name,'::',../../@name,'::',../@name,': ')"/>
|
---|
1898 | <xsl:value-of select="concat('value "',../@mod,'" ')"/>
|
---|
1899 | <xsl:text>of attribute 'mod' is invalid!</xsl:text>
|
---|
1900 | </xsl:message>
|
---|
1901 | </xsl:otherwise>
|
---|
1902 | </xsl:choose>
|
---|
1903 | </xsl:when>
|
---|
1904 | <!-- no modifiers -->
|
---|
1905 | <xsl:otherwise>
|
---|
1906 | <xsl:choose>
|
---|
1907 | <!-- standard types -->
|
---|
1908 | <xsl:when test=".='result'">nsresult</xsl:when>
|
---|
1909 | <xsl:when test=".='boolean'">boolean</xsl:when>
|
---|
1910 | <xsl:when test=".='octet'">octet</xsl:when>
|
---|
1911 | <xsl:when test=".='short'">short</xsl:when>
|
---|
1912 | <xsl:when test=".='unsigned short'">unsigned short</xsl:when>
|
---|
1913 | <xsl:when test=".='long'">long</xsl:when>
|
---|
1914 | <xsl:when test=".='long long'">long long</xsl:when>
|
---|
1915 | <xsl:when test=".='unsigned long'">unsigned long</xsl:when>
|
---|
1916 | <xsl:when test=".='unsigned long long'">unsigned long long</xsl:when>
|
---|
1917 | <xsl:when test=".='char'">char</xsl:when>
|
---|
1918 | <xsl:when test=".='wchar'">wchar</xsl:when>
|
---|
1919 | <xsl:when test=".='string'">string</xsl:when>
|
---|
1920 | <xsl:when test=".='wstring'">wstring</xsl:when>
|
---|
1921 | <!-- UUID type -->
|
---|
1922 | <xsl:when test=".='uuid'">
|
---|
1923 | <xsl:choose>
|
---|
1924 | <xsl:when test="name(..)='attribute'">
|
---|
1925 | <xsl:choose>
|
---|
1926 | <xsl:when test="../@readonly='yes'">
|
---|
1927 | <xsl:text>nsIDPtr</xsl:text>
|
---|
1928 | </xsl:when>
|
---|
1929 | <xsl:otherwise>
|
---|
1930 | <xsl:message terminate="yes">
|
---|
1931 | <xsl:value-of select="../@name"/>
|
---|
1932 | <xsl:text>: Non-readonly uuid attributes are not supported!</xsl:text>
|
---|
1933 | </xsl:message>
|
---|
1934 | </xsl:otherwise>
|
---|
1935 | </xsl:choose>
|
---|
1936 | </xsl:when>
|
---|
1937 | <xsl:when test="name(..)='param'">
|
---|
1938 | <xsl:choose>
|
---|
1939 | <xsl:when test="../@dir='in' and not(../@safearray='yes')">
|
---|
1940 | <xsl:text>nsIDRef</xsl:text>
|
---|
1941 | </xsl:when>
|
---|
1942 | <xsl:otherwise>
|
---|
1943 | <xsl:text>nsIDPtr</xsl:text>
|
---|
1944 | </xsl:otherwise>
|
---|
1945 | </xsl:choose>
|
---|
1946 | </xsl:when>
|
---|
1947 | </xsl:choose>
|
---|
1948 | </xsl:when>
|
---|
1949 | <!-- system interface types -->
|
---|
1950 | <xsl:when test=".='$unknown'">nsISupports</xsl:when>
|
---|
1951 | <xsl:otherwise>
|
---|
1952 | <xsl:choose>
|
---|
1953 | <!-- enum types -->
|
---|
1954 | <xsl:when test="
|
---|
1955 | (ancestor::library/enum[@name=current()]) or
|
---|
1956 | (ancestor::library/if[@target=$self_target]/enum[@name=current()])
|
---|
1957 | ">
|
---|
1958 | <xsl:text>PRUint32</xsl:text>
|
---|
1959 | </xsl:when>
|
---|
1960 | <!-- custom interface types -->
|
---|
1961 | <xsl:when test="
|
---|
1962 | (name(current())='enumerator' and
|
---|
1963 | ((ancestor::library/enumerator[@name=current()]) or
|
---|
1964 | (ancestor::library/if[@target=$self_target]/enumerator[@name=current()]))
|
---|
1965 | ) or
|
---|
1966 | ((ancestor::library/interface[@name=current()]) or
|
---|
1967 | (ancestor::library/if[@target=$self_target]/interface[@name=current()])
|
---|
1968 | )
|
---|
1969 | ">
|
---|
1970 | <xsl:value-of select="."/>
|
---|
1971 | </xsl:when>
|
---|
1972 | <!-- other types -->
|
---|
1973 | <xsl:otherwise>
|
---|
1974 | <xsl:message terminate="yes">
|
---|
1975 | <xsl:text>Unknown parameter type: </xsl:text>
|
---|
1976 | <xsl:value-of select="."/>
|
---|
1977 | </xsl:message>
|
---|
1978 | </xsl:otherwise>
|
---|
1979 | </xsl:choose>
|
---|
1980 | </xsl:otherwise>
|
---|
1981 | </xsl:choose>
|
---|
1982 | </xsl:otherwise>
|
---|
1983 | </xsl:choose>
|
---|
1984 | </xsl:template>
|
---|
1985 |
|
---|
1986 | <xsl:template match="attribute/@type | param/@type" mode="forwarder">
|
---|
1987 |
|
---|
1988 | <xsl:variable name="self_target" select="current()/ancestor::if/@target"/>
|
---|
1989 |
|
---|
1990 | <xsl:choose>
|
---|
1991 | <!-- modifiers (ignored for 'enumeration' attributes)-->
|
---|
1992 | <xsl:when test="name(current())='type' and ../@mod">
|
---|
1993 | <xsl:choose>
|
---|
1994 | <xsl:when test="../@mod='ptr'">
|
---|
1995 | <xsl:choose>
|
---|
1996 | <!-- standard types -->
|
---|
1997 | <!--xsl:when test=".='result'">??</xsl:when-->
|
---|
1998 | <xsl:when test=".='boolean'">PRBool *</xsl:when>
|
---|
1999 | <xsl:when test=".='octet'">PRUint8 *</xsl:when>
|
---|
2000 | <xsl:when test=".='short'">PRInt16 *</xsl:when>
|
---|
2001 | <xsl:when test=".='unsigned short'">PRUint16 *</xsl:when>
|
---|
2002 | <xsl:when test=".='long'">PRInt32 *</xsl:when>
|
---|
2003 | <xsl:when test=".='long long'">PRInt64 *</xsl:when>
|
---|
2004 | <xsl:when test=".='unsigned long'">PRUint32 *</xsl:when>
|
---|
2005 | <xsl:when test=".='unsigned long long'">PRUint64 *</xsl:when>
|
---|
2006 | <xsl:otherwise>
|
---|
2007 | <xsl:message terminate="yes">
|
---|
2008 | <xsl:value-of select="concat(../../../@name,'::',../../@name,'::',../@name,': ')"/>
|
---|
2009 | <xsl:text>attribute 'mod=</xsl:text>
|
---|
2010 | <xsl:value-of select="concat('"',../@mod,'"')"/>
|
---|
2011 | <xsl:text>' cannot be used with type </xsl:text>
|
---|
2012 | <xsl:value-of select="concat('"',current(),'"!')"/>
|
---|
2013 | </xsl:message>
|
---|
2014 | </xsl:otherwise>
|
---|
2015 | </xsl:choose>
|
---|
2016 | </xsl:when>
|
---|
2017 | <xsl:when test="../@mod='string'">
|
---|
2018 | <xsl:choose>
|
---|
2019 | <!-- standard types -->
|
---|
2020 | <!--xsl:when test=".='result'">??</xsl:when-->
|
---|
2021 | <xsl:when test=".='uuid'">PRUnichar *</xsl:when>
|
---|
2022 | <xsl:otherwise>
|
---|
2023 | <xsl:message terminate="yes">
|
---|
2024 | <xsl:value-of select="concat(../../../@name,'::',../../@name,'::',../@name,': ')"/>
|
---|
2025 | <xsl:text>attribute 'mod=</xsl:text>
|
---|
2026 | <xsl:value-of select="concat('"',../@mod,'"')"/>
|
---|
2027 | <xsl:text>' cannot be used with type </xsl:text>
|
---|
2028 | <xsl:value-of select="concat('"',current(),'"!')"/>
|
---|
2029 | </xsl:message>
|
---|
2030 | </xsl:otherwise>
|
---|
2031 | </xsl:choose>
|
---|
2032 | </xsl:when>
|
---|
2033 | </xsl:choose>
|
---|
2034 | </xsl:when>
|
---|
2035 | <!-- no modifiers -->
|
---|
2036 | <xsl:otherwise>
|
---|
2037 | <xsl:choose>
|
---|
2038 | <!-- standard types -->
|
---|
2039 | <xsl:when test=".='result'">nsresult</xsl:when>
|
---|
2040 | <xsl:when test=".='boolean'">PRBool</xsl:when>
|
---|
2041 | <xsl:when test=".='octet'">PRUint8</xsl:when>
|
---|
2042 | <xsl:when test=".='short'">PRInt16</xsl:when>
|
---|
2043 | <xsl:when test=".='unsigned short'">PRUint16</xsl:when>
|
---|
2044 | <xsl:when test=".='long'">PRInt32</xsl:when>
|
---|
2045 | <xsl:when test=".='long long'">PRInt64</xsl:when>
|
---|
2046 | <xsl:when test=".='unsigned long'">PRUint32</xsl:when>
|
---|
2047 | <xsl:when test=".='unsigned long long'">PRUint64</xsl:when>
|
---|
2048 | <xsl:when test=".='char'">char</xsl:when>
|
---|
2049 | <xsl:when test=".='wchar'">PRUnichar</xsl:when>
|
---|
2050 | <!-- string types -->
|
---|
2051 | <xsl:when test=".='string'">char *</xsl:when>
|
---|
2052 | <xsl:when test=".='wstring'">PRUnichar *</xsl:when>
|
---|
2053 | <!-- UUID type -->
|
---|
2054 | <xsl:when test=".='uuid'">
|
---|
2055 | <xsl:choose>
|
---|
2056 | <xsl:when test="name(..)='attribute'">
|
---|
2057 | <xsl:choose>
|
---|
2058 | <xsl:when test="../@readonly='yes'">
|
---|
2059 | <xsl:text>nsID *</xsl:text>
|
---|
2060 | </xsl:when>
|
---|
2061 | </xsl:choose>
|
---|
2062 | </xsl:when>
|
---|
2063 | <xsl:when test="name(..)='param'">
|
---|
2064 | <xsl:choose>
|
---|
2065 | <xsl:when test="../@dir='in' and not(../@safearray='yes')">
|
---|
2066 | <xsl:text>const nsID *</xsl:text>
|
---|
2067 | </xsl:when>
|
---|
2068 | <xsl:otherwise>
|
---|
2069 | <xsl:text>nsID *</xsl:text>
|
---|
2070 | </xsl:otherwise>
|
---|
2071 | </xsl:choose>
|
---|
2072 | </xsl:when>
|
---|
2073 | </xsl:choose>
|
---|
2074 | </xsl:when>
|
---|
2075 | <!-- system interface types -->
|
---|
2076 | <xsl:when test=".='$unknown'">nsISupports *</xsl:when>
|
---|
2077 | <xsl:otherwise>
|
---|
2078 | <xsl:choose>
|
---|
2079 | <!-- enum types -->
|
---|
2080 | <xsl:when test="
|
---|
2081 | (ancestor::library/enum[@name=current()]) or
|
---|
2082 | (ancestor::library/if[@target=$self_target]/enum[@name=current()])
|
---|
2083 | ">
|
---|
2084 | <xsl:text>PRUint32</xsl:text>
|
---|
2085 | </xsl:when>
|
---|
2086 | <!-- custom interface types -->
|
---|
2087 | <xsl:when test="
|
---|
2088 | (name(current())='enumerator' and
|
---|
2089 | ((ancestor::library/enumerator[@name=current()]) or
|
---|
2090 | (ancestor::library/if[@target=$self_target]/enumerator[@name=current()]))
|
---|
2091 | ) or
|
---|
2092 | ((ancestor::library/interface[@name=current()]) or
|
---|
2093 | (ancestor::library/if[@target=$self_target]/interface[@name=current()])
|
---|
2094 | )
|
---|
2095 | ">
|
---|
2096 | <xsl:value-of select="."/>
|
---|
2097 | <xsl:text> *</xsl:text>
|
---|
2098 | </xsl:when>
|
---|
2099 | <!-- other types -->
|
---|
2100 | </xsl:choose>
|
---|
2101 | </xsl:otherwise>
|
---|
2102 | </xsl:choose>
|
---|
2103 | </xsl:otherwise>
|
---|
2104 | </xsl:choose>
|
---|
2105 | </xsl:template>
|
---|
2106 |
|
---|
2107 | </xsl:stylesheet>
|
---|
2108 |
|
---|