[16406] | 1 | <?xml version="1.0"?>
|
---|
[32404] | 2 | <!-- $Id: capiidl.xsl 98108 2023-01-17 23:40:56Z vboxsync $ -->
|
---|
[16406] | 3 |
|
---|
| 4 | <!--
|
---|
[50183] | 5 | * A template to generate a C header file for all relevant XPCOM interfaces
|
---|
| 6 | * provided or needed for calling the VirtualBox API. The header file also
|
---|
| 7 | * works on Windows, by using the C bindings header created by the MS COM IDL
|
---|
| 8 | * compiler (which simultaneously supports C and C++, unlike XPCOM).
|
---|
[96308] | 9 | -->
|
---|
| 10 | <!--
|
---|
[98103] | 11 | Copyright (C) 2008-2023 Oracle and/or its affiliates.
|
---|
[16406] | 12 |
|
---|
[96407] | 13 | This file is part of VirtualBox base platform packages, as
|
---|
| 14 | available from https://www.virtualbox.org.
|
---|
| 15 |
|
---|
| 16 | This program is free software; you can redistribute it and/or
|
---|
| 17 | modify it under the terms of the GNU General Public License
|
---|
| 18 | as published by the Free Software Foundation, in version 3 of the
|
---|
| 19 | License.
|
---|
| 20 |
|
---|
| 21 | This program is distributed in the hope that it will be useful, but
|
---|
| 22 | WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 23 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
| 24 | General Public License for more details.
|
---|
| 25 |
|
---|
| 26 | You should have received a copy of the GNU General Public License
|
---|
| 27 | along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
| 28 |
|
---|
| 29 | SPDX-License-Identifier: GPL-3.0-only
|
---|
[16406] | 30 | -->
|
---|
| 31 |
|
---|
| 32 | <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
---|
| 33 | <xsl:output method="text"/>
|
---|
| 34 |
|
---|
| 35 | <xsl:strip-space elements="*"/>
|
---|
| 36 |
|
---|
| 37 |
|
---|
[53938] | 38 | <xsl:include href="../idl/typemap-shared.inc.xsl"/>
|
---|
| 39 |
|
---|
[16406] | 40 | <!--
|
---|
[53938] | 41 | // Keys for more efficiently looking up of types.
|
---|
[16406] | 42 | /////////////////////////////////////////////////////////////////////////////
|
---|
| 43 | -->
|
---|
| 44 |
|
---|
[53938] | 45 | <xsl:key name="G_keyInterfacesByName" match="//interface[@name]" use="@name"/>
|
---|
[16406] | 46 |
|
---|
| 47 |
|
---|
| 48 | <!--
|
---|
| 49 | // templates
|
---|
| 50 | /////////////////////////////////////////////////////////////////////////////
|
---|
| 51 | -->
|
---|
| 52 |
|
---|
| 53 |
|
---|
| 54 | <!--
|
---|
| 55 | * not explicitly matched elements and attributes
|
---|
| 56 | -->
|
---|
| 57 | <xsl:template match="*"/>
|
---|
| 58 |
|
---|
| 59 |
|
---|
| 60 | <!--
|
---|
| 61 | * header
|
---|
| 62 | -->
|
---|
| 63 | <xsl:template match="/idl">
|
---|
[50183] | 64 | <xsl:text>/*
|
---|
[16406] | 65 | * DO NOT EDIT! This is a generated file.
|
---|
| 66 | *
|
---|
[50183] | 67 | * Header file which provides C declarations for VirtualBox Main API
|
---|
| 68 | * (COM interfaces), generated from XIDL (XML interface definition).
|
---|
| 69 | * On Windows (which uses COM instead of XPCOM) the native C support
|
---|
| 70 | * is used, and most of this file is not used.
|
---|
[16406] | 71 | *
|
---|
| 72 | * Source : src/VBox/Main/idl/VirtualBox.xidl
|
---|
[50183] | 73 | * Generator : src/VBox/Main/cbinding/capiidl.xsl
|
---|
[17749] | 74 | *
|
---|
| 75 | * This file contains portions from the following Mozilla XPCOM files:
|
---|
| 76 | * xpcom/include/xpcom/nsID.h
|
---|
| 77 | * xpcom/include/nsIException.h
|
---|
| 78 | * xpcom/include/nsprpub/prtypes.h
|
---|
| 79 | * xpcom/include/xpcom/nsISupportsBase.h
|
---|
| 80 | *
|
---|
[39885] | 81 | * These files were originally triple-licensed (MPL/GPL2/LGPL2.1). Oracle
|
---|
[18184] | 82 | * elects to distribute this derived work under the LGPL2.1 only.
|
---|
| 83 | */
|
---|
| 84 |
|
---|
| 85 | /*
|
---|
[98108] | 86 | * Copyright (C) 2008-2023 Oracle and/or its affiliates.
|
---|
[17749] | 87 | *
|
---|
[18202] | 88 | * This file is part of a free software library; you can redistribute
|
---|
| 89 | * it and/or modify it under the terms of the GNU Lesser General
|
---|
| 90 | * Public License version 2.1 as published by the Free Software
|
---|
[96237] | 91 | * Foundation and shipped in the "COPYING.LIB" file with this library.
|
---|
[18374] | 92 | * The library is distributed in the hope that it will be useful,
|
---|
| 93 | * but WITHOUT ANY WARRANTY of any kind.
|
---|
[17749] | 94 | *
|
---|
[29177] | 95 | * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if
|
---|
[18202] | 96 | * any license choice other than GPL or LGPL is available it will
|
---|
[29177] | 97 | * apply instead, Oracle elects to use only the Lesser General Public
|
---|
[18202] | 98 | * License version 2.1 (LGPLv2) at this time for any software where
|
---|
| 99 | * a choice of LGPL license versions is made available with the
|
---|
| 100 | * language indicating that LGPLv2 or any later version may be used,
|
---|
| 101 | * or where a choice of which version of the LGPL is applied is
|
---|
| 102 | * otherwise unspecified.
|
---|
[96417] | 103 | *
|
---|
| 104 | * SPDX-License-Identifier: LGPL-2.1-only
|
---|
[16406] | 105 | */
|
---|
| 106 |
|
---|
[50183] | 107 | #ifndef ___VirtualBox_CAPI_h
|
---|
| 108 | #define ___VirtualBox_CAPI_h
|
---|
[17304] | 109 |
|
---|
[50183] | 110 | #ifdef _WIN32
|
---|
[85121] | 111 | # ifdef _MSC_VER
|
---|
| 112 | # pragma warning(push)
|
---|
| 113 | # pragma warning(disable:4668 4255) /* -Wall and windows.h */
|
---|
| 114 | # if _MSC_VER >= 1800 /*RT_MSC_VER_VC120*/
|
---|
| 115 | # pragma warning(disable:4005) /* sdk/v7.1/include/sal_supp.h(57) : warning C4005: '__useHeader' : macro redefinition */
|
---|
| 116 | # endif
|
---|
| 117 | # ifdef __cplusplus
|
---|
| 118 | # if _MSC_VER >= 1900 /*RT_MSC_VER_VC140*/
|
---|
| 119 | # pragma warning(disable:5039) /* winbase.h(13179): warning C5039: 'TpSetCallbackCleanupGroup': pointer or reference to potentially throwing function passed to 'extern "C"' function under -EHc. Undefined behavior may occur if this function throws an exception. */
|
---|
| 120 | # endif
|
---|
| 121 | # endif
|
---|
[66832] | 122 | # endif
|
---|
[50183] | 123 | # undef COBJMACROS
|
---|
| 124 | # define COBJMACROS
|
---|
| 125 | # include "Windows.h"
|
---|
[62770] | 126 | # pragma warning(pop)
|
---|
[50183] | 127 | #endif /* _WIN32 */
|
---|
| 128 |
|
---|
| 129 | #ifdef WIN32
|
---|
| 130 | # ifdef IN_VBOXCAPI
|
---|
| 131 | # define VBOXCAPI_DECL(type) extern __declspec(dllexport) type
|
---|
| 132 | # else /* !IN_VBOXCAPI */
|
---|
| 133 | # define VBOXCAPI_DECL(type) __declspec(dllimport) type
|
---|
| 134 | # endif /* !IN_VBOXCAPI */
|
---|
| 135 | #endif /* WIN32 */
|
---|
| 136 |
|
---|
[17304] | 137 | #ifdef __cplusplus
|
---|
[50183] | 138 | /* The C++ treatment in this file is not meant for SDK users, it only exists
|
---|
| 139 | * so that this file can be used to produce the VBoxCAPI shared library which
|
---|
| 140 | * has to use C++ as it does all the conversion magic. */
|
---|
| 141 | # ifdef IN_VBOXCAPI
|
---|
| 142 | # include "VBox/com/VirtualBox.h"
|
---|
| 143 | # ifndef WIN32
|
---|
| 144 | # include "nsIEventQueue.h"
|
---|
| 145 | # endif /* !WIN32 */
|
---|
| 146 | # else /* !IN_VBOXCAPI */
|
---|
| 147 | # error Do not include this header file from C++ code
|
---|
| 148 | # endif /* !IN_VBOXCAPI */
|
---|
| 149 | #endif /* __cplusplus */
|
---|
[17304] | 150 |
|
---|
[50183] | 151 | #ifdef __GNUC__
|
---|
| 152 | # define VBOX_EXTERN_CONST(type, name) extern const type name __attribute__((nocommon))
|
---|
| 153 | #else /* !__GNUC__ */
|
---|
| 154 | # define VBOX_EXTERN_CONST(type, name) extern const type name
|
---|
| 155 | #endif /* !__GNUC__ */
|
---|
| 156 |
|
---|
| 157 | /* Treat WIN32 completely separately, as on Windows VirtualBox uses COM, not
|
---|
| 158 | * XPCOM like on all other platforms. While the code below would also compile
|
---|
| 159 | * on Windows, we need to switch to the native C support provided by the header
|
---|
| 160 | * files produced by the COM IDL compiler. */
|
---|
| 161 | #ifdef WIN32
|
---|
| 162 | # include "ObjBase.h"
|
---|
| 163 | # include "oaidl.h"
|
---|
| 164 | # include "VirtualBox.h"
|
---|
| 165 |
|
---|
[50187] | 166 | #ifndef __cplusplus
|
---|
| 167 | /* Skip this in the C++ case as there's already a definition for CBSTR. */
|
---|
[50183] | 168 | typedef const BSTR CBSTR;
|
---|
[50187] | 169 | #endif /* !__cplusplus */
|
---|
[50183] | 170 |
|
---|
[50188] | 171 | #define VBOX_WINAPI WINAPI
|
---|
| 172 |
|
---|
[50183] | 173 | #define ComSafeArrayAsInParam(f) (f)
|
---|
| 174 | #define ComSafeArrayAsOutParam(f) (&(f))
|
---|
[52793] | 175 | #define ComSafeArrayAsOutTypeParam(f,t) (&(f))
|
---|
[50187] | 176 | #define ComSafeArrayAsOutIfaceParam(f,t) (&(f))
|
---|
[50183] | 177 |
|
---|
| 178 | #else /* !WIN32 */
|
---|
| 179 |
|
---|
[17304] | 180 | #include <stddef.h>
|
---|
[16406] | 181 | #include "wchar.h"
|
---|
| 182 |
|
---|
[50183] | 183 | #ifdef IN_VBOXCAPI
|
---|
| 184 | # define VBOXCAPI_DECL(type) PR_EXPORT(type)
|
---|
| 185 | #else /* !IN_VBOXCAPI */
|
---|
| 186 | # define VBOXCAPI_DECL(type) PR_IMPORT(type)
|
---|
| 187 | #endif /* !IN_VBOXCAPI */
|
---|
| 188 |
|
---|
| 189 | #ifndef __cplusplus
|
---|
| 190 |
|
---|
[17304] | 191 | #if defined(WIN32)
|
---|
| 192 |
|
---|
| 193 | #define PR_EXPORT(__type) extern __declspec(dllexport) __type
|
---|
| 194 | #define PR_EXPORT_DATA(__type) extern __declspec(dllexport) __type
|
---|
| 195 | #define PR_IMPORT(__type) __declspec(dllimport) __type
|
---|
| 196 | #define PR_IMPORT_DATA(__type) __declspec(dllimport) __type
|
---|
| 197 |
|
---|
| 198 | #define PR_EXTERN(__type) extern __declspec(dllexport) __type
|
---|
| 199 | #define PR_IMPLEMENT(__type) __declspec(dllexport) __type
|
---|
| 200 | #define PR_EXTERN_DATA(__type) extern __declspec(dllexport) __type
|
---|
| 201 | #define PR_IMPLEMENT_DATA(__type) __declspec(dllexport) __type
|
---|
| 202 |
|
---|
| 203 | #define PR_CALLBACK
|
---|
| 204 | #define PR_CALLBACK_DECL
|
---|
| 205 | #define PR_STATIC_CALLBACK(__x) static __x
|
---|
| 206 |
|
---|
| 207 | #elif defined(XP_BEOS)
|
---|
| 208 |
|
---|
| 209 | #define PR_EXPORT(__type) extern __declspec(dllexport) __type
|
---|
| 210 | #define PR_EXPORT_DATA(__type) extern __declspec(dllexport) __type
|
---|
| 211 | #define PR_IMPORT(__type) extern __declspec(dllexport) __type
|
---|
| 212 | #define PR_IMPORT_DATA(__type) extern __declspec(dllexport) __type
|
---|
| 213 |
|
---|
| 214 | #define PR_EXTERN(__type) extern __declspec(dllexport) __type
|
---|
| 215 | #define PR_IMPLEMENT(__type) __declspec(dllexport) __type
|
---|
| 216 | #define PR_EXTERN_DATA(__type) extern __declspec(dllexport) __type
|
---|
| 217 | #define PR_IMPLEMENT_DATA(__type) __declspec(dllexport) __type
|
---|
| 218 |
|
---|
| 219 | #define PR_CALLBACK
|
---|
| 220 | #define PR_CALLBACK_DECL
|
---|
| 221 | #define PR_STATIC_CALLBACK(__x) static __x
|
---|
| 222 |
|
---|
| 223 | #elif defined(WIN16)
|
---|
| 224 |
|
---|
| 225 | #define PR_CALLBACK_DECL __cdecl
|
---|
| 226 |
|
---|
| 227 | #if defined(_WINDLL)
|
---|
| 228 | #define PR_EXPORT(__type) extern __type _cdecl _export _loadds
|
---|
| 229 | #define PR_IMPORT(__type) extern __type _cdecl _export _loadds
|
---|
| 230 | #define PR_EXPORT_DATA(__type) extern __type _export
|
---|
| 231 | #define PR_IMPORT_DATA(__type) extern __type _export
|
---|
| 232 |
|
---|
| 233 | #define PR_EXTERN(__type) extern __type _cdecl _export _loadds
|
---|
| 234 | #define PR_IMPLEMENT(__type) __type _cdecl _export _loadds
|
---|
| 235 | #define PR_EXTERN_DATA(__type) extern __type _export
|
---|
| 236 | #define PR_IMPLEMENT_DATA(__type) __type _export
|
---|
| 237 |
|
---|
| 238 | #define PR_CALLBACK __cdecl __loadds
|
---|
| 239 | #define PR_STATIC_CALLBACK(__x) static __x PR_CALLBACK
|
---|
| 240 |
|
---|
| 241 | #else /* this must be .EXE */
|
---|
| 242 | #define PR_EXPORT(__type) extern __type _cdecl _export
|
---|
| 243 | #define PR_IMPORT(__type) extern __type _cdecl _export
|
---|
| 244 | #define PR_EXPORT_DATA(__type) extern __type _export
|
---|
| 245 | #define PR_IMPORT_DATA(__type) extern __type _export
|
---|
| 246 |
|
---|
| 247 | #define PR_EXTERN(__type) extern __type _cdecl _export
|
---|
| 248 | #define PR_IMPLEMENT(__type) __type _cdecl _export
|
---|
| 249 | #define PR_EXTERN_DATA(__type) extern __type _export
|
---|
| 250 | #define PR_IMPLEMENT_DATA(__type) __type _export
|
---|
| 251 |
|
---|
| 252 | #define PR_CALLBACK __cdecl __loadds
|
---|
| 253 | #define PR_STATIC_CALLBACK(__x) __x PR_CALLBACK
|
---|
| 254 | #endif /* _WINDLL */
|
---|
| 255 |
|
---|
| 256 | #elif defined(XP_MAC)
|
---|
| 257 |
|
---|
| 258 | #define PR_EXPORT(__type) extern __declspec(export) __type
|
---|
| 259 | #define PR_EXPORT_DATA(__type) extern __declspec(export) __type
|
---|
| 260 | #define PR_IMPORT(__type) extern __declspec(export) __type
|
---|
| 261 | #define PR_IMPORT_DATA(__type) extern __declspec(export) __type
|
---|
| 262 |
|
---|
| 263 | #define PR_EXTERN(__type) extern __declspec(export) __type
|
---|
| 264 | #define PR_IMPLEMENT(__type) __declspec(export) __type
|
---|
| 265 | #define PR_EXTERN_DATA(__type) extern __declspec(export) __type
|
---|
| 266 | #define PR_IMPLEMENT_DATA(__type) __declspec(export) __type
|
---|
| 267 |
|
---|
| 268 | #define PR_CALLBACK
|
---|
| 269 | #define PR_CALLBACK_DECL
|
---|
| 270 | #define PR_STATIC_CALLBACK(__x) static __x
|
---|
| 271 |
|
---|
| 272 | #elif defined(XP_OS2) && defined(__declspec)
|
---|
| 273 |
|
---|
| 274 | #define PR_EXPORT(__type) extern __declspec(dllexport) __type
|
---|
| 275 | #define PR_EXPORT_DATA(__type) extern __declspec(dllexport) __type
|
---|
| 276 | #define PR_IMPORT(__type) __declspec(dllimport) __type
|
---|
| 277 | #define PR_IMPORT_DATA(__type) __declspec(dllimport) __type
|
---|
| 278 |
|
---|
| 279 | #define PR_EXTERN(__type) extern __declspec(dllexport) __type
|
---|
| 280 | #define PR_IMPLEMENT(__type) __declspec(dllexport) __type
|
---|
| 281 | #define PR_EXTERN_DATA(__type) extern __declspec(dllexport) __type
|
---|
| 282 | #define PR_IMPLEMENT_DATA(__type) __declspec(dllexport) __type
|
---|
| 283 |
|
---|
| 284 | #define PR_CALLBACK
|
---|
| 285 | #define PR_CALLBACK_DECL
|
---|
| 286 | #define PR_STATIC_CALLBACK(__x) static __x
|
---|
| 287 |
|
---|
| 288 | #elif defined(XP_OS2_VACPP)
|
---|
| 289 |
|
---|
| 290 | #define PR_EXPORT(__type) extern __type
|
---|
| 291 | #define PR_EXPORT_DATA(__type) extern __type
|
---|
| 292 | #define PR_IMPORT(__type) extern __type
|
---|
| 293 | #define PR_IMPORT_DATA(__type) extern __type
|
---|
| 294 |
|
---|
| 295 | #define PR_EXTERN(__type) extern __type
|
---|
| 296 | #define PR_IMPLEMENT(__type) __type
|
---|
| 297 | #define PR_EXTERN_DATA(__type) extern __type
|
---|
| 298 | #define PR_IMPLEMENT_DATA(__type) __type
|
---|
| 299 | #define PR_CALLBACK _Optlink
|
---|
| 300 | #define PR_CALLBACK_DECL
|
---|
| 301 | #define PR_STATIC_CALLBACK(__x) static __x PR_CALLBACK
|
---|
| 302 |
|
---|
| 303 | #else /* Unix */
|
---|
| 304 |
|
---|
| 305 | # ifdef VBOX_HAVE_VISIBILITY_HIDDEN
|
---|
| 306 | # define PR_EXPORT(__type) __attribute__((visibility("default"))) extern __type
|
---|
| 307 | # define PR_EXPORT_DATA(__type) __attribute__((visibility("default"))) extern __type
|
---|
| 308 | # define PR_IMPORT(__type) extern __type
|
---|
| 309 | # define PR_IMPORT_DATA(__type) extern __type
|
---|
| 310 | # define PR_EXTERN(__type) __attribute__((visibility("default"))) extern __type
|
---|
| 311 | # define PR_IMPLEMENT(__type) __attribute__((visibility("default"))) __type
|
---|
| 312 | # define PR_EXTERN_DATA(__type) __attribute__((visibility("default"))) extern __type
|
---|
| 313 | # define PR_IMPLEMENT_DATA(__type) __attribute__((visibility("default"))) __type
|
---|
| 314 | # define PR_CALLBACK
|
---|
| 315 | # define PR_CALLBACK_DECL
|
---|
| 316 | # define PR_STATIC_CALLBACK(__x) static __x
|
---|
| 317 | # else
|
---|
| 318 | # define PR_EXPORT(__type) extern __type
|
---|
| 319 | # define PR_EXPORT_DATA(__type) extern __type
|
---|
| 320 | # define PR_IMPORT(__type) extern __type
|
---|
| 321 | # define PR_IMPORT_DATA(__type) extern __type
|
---|
| 322 | # define PR_EXTERN(__type) extern __type
|
---|
| 323 | # define PR_IMPLEMENT(__type) __type
|
---|
| 324 | # define PR_EXTERN_DATA(__type) extern __type
|
---|
| 325 | # define PR_IMPLEMENT_DATA(__type) __type
|
---|
| 326 | # define PR_CALLBACK
|
---|
| 327 | # define PR_CALLBACK_DECL
|
---|
| 328 | # define PR_STATIC_CALLBACK(__x) static __x
|
---|
| 329 | # endif
|
---|
| 330 | #endif
|
---|
| 331 |
|
---|
| 332 | #if defined(_NSPR_BUILD_)
|
---|
| 333 | #define NSPR_API(__type) PR_EXPORT(__type)
|
---|
| 334 | #define NSPR_DATA_API(__type) PR_EXPORT_DATA(__type)
|
---|
| 335 | #else
|
---|
| 336 | #define NSPR_API(__type) PR_IMPORT(__type)
|
---|
| 337 | #define NSPR_DATA_API(__type) PR_IMPORT_DATA(__type)
|
---|
| 338 | #endif
|
---|
| 339 |
|
---|
| 340 | typedef unsigned char PRUint8;
|
---|
| 341 | #if (defined(HPUX) && defined(__cplusplus) \
|
---|
| 342 | && !defined(__GNUC__) && __cplusplus < 199707L) \
|
---|
| 343 | || (defined(SCO) && defined(__cplusplus) \
|
---|
| 344 | && !defined(__GNUC__) && __cplusplus == 1L)
|
---|
| 345 | typedef char PRInt8;
|
---|
| 346 | #else
|
---|
| 347 | typedef signed char PRInt8;
|
---|
| 348 | #endif
|
---|
| 349 |
|
---|
| 350 | #define PR_INT8_MAX 127
|
---|
| 351 | #define PR_INT8_MIN (-128)
|
---|
| 352 | #define PR_UINT8_MAX 255U
|
---|
| 353 |
|
---|
| 354 | typedef unsigned short PRUint16;
|
---|
| 355 | typedef short PRInt16;
|
---|
| 356 |
|
---|
| 357 | #define PR_INT16_MAX 32767
|
---|
| 358 | #define PR_INT16_MIN (-32768)
|
---|
| 359 | #define PR_UINT16_MAX 65535U
|
---|
| 360 |
|
---|
| 361 | typedef unsigned int PRUint32;
|
---|
| 362 | typedef int PRInt32;
|
---|
| 363 | #define PR_INT32(x) x
|
---|
| 364 | #define PR_UINT32(x) x ## U
|
---|
| 365 |
|
---|
| 366 | #define PR_INT32_MAX PR_INT32(2147483647)
|
---|
| 367 | #define PR_INT32_MIN (-PR_INT32_MAX - 1)
|
---|
| 368 | #define PR_UINT32_MAX PR_UINT32(4294967295)
|
---|
| 369 |
|
---|
| 370 | typedef long PRInt64;
|
---|
| 371 | typedef unsigned long PRUint64;
|
---|
| 372 | typedef int PRIntn;
|
---|
| 373 | typedef unsigned int PRUintn;
|
---|
| 374 |
|
---|
| 375 | typedef double PRFloat64;
|
---|
| 376 | typedef size_t PRSize;
|
---|
| 377 |
|
---|
| 378 | typedef ptrdiff_t PRPtrdiff;
|
---|
| 379 |
|
---|
| 380 | typedef unsigned long PRUptrdiff;
|
---|
| 381 |
|
---|
| 382 | typedef PRIntn PRBool;
|
---|
| 383 |
|
---|
| 384 | #define PR_TRUE 1
|
---|
| 385 | #define PR_FALSE 0
|
---|
| 386 |
|
---|
| 387 | typedef PRUint8 PRPackedBool;
|
---|
| 388 |
|
---|
| 389 | /*
|
---|
[17338] | 390 | ** Status code used by some routines that have a single point of failure or
|
---|
[17304] | 391 | ** special status return.
|
---|
| 392 | */
|
---|
| 393 | typedef enum { PR_FAILURE = -1, PR_SUCCESS = 0 } PRStatus;
|
---|
| 394 |
|
---|
| 395 | #ifndef __PRUNICHAR__
|
---|
| 396 | #define __PRUNICHAR__
|
---|
| 397 | #if defined(WIN32) || defined(XP_MAC)
|
---|
| 398 | typedef wchar_t PRUnichar;
|
---|
| 399 | #else
|
---|
| 400 | typedef PRUint16 PRUnichar;
|
---|
| 401 | #endif
|
---|
[50183] | 402 | typedef PRUnichar *BSTR;
|
---|
| 403 | typedef const PRUnichar *CBSTR;
|
---|
[17304] | 404 | #endif
|
---|
| 405 |
|
---|
| 406 | typedef long PRWord;
|
---|
| 407 | typedef unsigned long PRUword;
|
---|
| 408 |
|
---|
[16406] | 409 | #define nsnull 0
|
---|
| 410 | typedef PRUint32 nsresult;
|
---|
| 411 |
|
---|
| 412 | #if defined(__GNUC__) && (__GNUC__ > 2)
|
---|
| 413 | #define NS_LIKELY(x) (__builtin_expect((x), 1))
|
---|
| 414 | #define NS_UNLIKELY(x) (__builtin_expect((x), 0))
|
---|
| 415 | #else
|
---|
| 416 | #define NS_LIKELY(x) (x)
|
---|
| 417 | #define NS_UNLIKELY(x) (x)
|
---|
| 418 | #endif
|
---|
| 419 |
|
---|
| 420 | #define NS_FAILED(_nsresult) (NS_UNLIKELY((_nsresult) & 0x80000000))
|
---|
| 421 | #define NS_SUCCEEDED(_nsresult) (NS_LIKELY(!((_nsresult) & 0x80000000)))
|
---|
| 422 |
|
---|
[18998] | 423 | #ifdef VBOX_WITH_XPCOM_NAMESPACE_CLEANUP
|
---|
| 424 | # define PR_IntervalNow VBoxNsprPR_IntervalNow
|
---|
| 425 | # define PR_TicksPerSecond VBoxNsprPR_TicksPerSecond
|
---|
| 426 | # define PR_SecondsToInterval VBoxNsprPR_SecondsToInterval
|
---|
| 427 | # define PR_MillisecondsToInterval VBoxNsprPR_MillisecondsToInterval
|
---|
| 428 | # define PR_MicrosecondsToInterval VBoxNsprPR_MicrosecondsToInterval
|
---|
| 429 | # define PR_IntervalToSeconds VBoxNsprPR_IntervalToSeconds
|
---|
| 430 | # define PR_IntervalToMilliseconds VBoxNsprPR_IntervalToMilliseconds
|
---|
| 431 | # define PR_IntervalToMicroseconds VBoxNsprPR_IntervalToMicroseconds
|
---|
| 432 | # define PR_EnterMonitor VBoxNsprPR_EnterMonitor
|
---|
| 433 | # define PR_ExitMonitor VBoxNsprPR_ExitMonitor
|
---|
| 434 | # define PR_Notify VBoxNsprPR_Notify
|
---|
| 435 | # define PR_NotifyAll VBoxNsprPR_NotifyAll
|
---|
| 436 | # define PR_Wait VBoxNsprPR_Wait
|
---|
| 437 | # define PR_NewMonitor VBoxNsprPR_NewMonitor
|
---|
| 438 | # define PR_DestroyMonitor VBoxNsprPR_DestroyMonitor
|
---|
| 439 | #endif /* VBOX_WITH_XPCOM_NAMESPACE_CLEANUP */
|
---|
| 440 |
|
---|
| 441 | typedef PRUint32 PRIntervalTime;
|
---|
| 442 |
|
---|
| 443 | #define PR_INTERVAL_MIN 1000UL
|
---|
| 444 | #define PR_INTERVAL_MAX 100000UL
|
---|
| 445 | #define PR_INTERVAL_NO_WAIT 0UL
|
---|
| 446 | #define PR_INTERVAL_NO_TIMEOUT 0xffffffffUL
|
---|
| 447 |
|
---|
| 448 | NSPR_API(PRIntervalTime) PR_IntervalNow(void);
|
---|
| 449 | NSPR_API(PRUint32) PR_TicksPerSecond(void);
|
---|
| 450 | NSPR_API(PRIntervalTime) PR_SecondsToInterval(PRUint32 seconds);
|
---|
| 451 | NSPR_API(PRIntervalTime) PR_MillisecondsToInterval(PRUint32 milli);
|
---|
| 452 | NSPR_API(PRIntervalTime) PR_MicrosecondsToInterval(PRUint32 micro);
|
---|
| 453 | NSPR_API(PRUint32) PR_IntervalToSeconds(PRIntervalTime ticks);
|
---|
| 454 | NSPR_API(PRUint32) PR_IntervalToMilliseconds(PRIntervalTime ticks);
|
---|
| 455 | NSPR_API(PRUint32) PR_IntervalToMicroseconds(PRIntervalTime ticks);
|
---|
| 456 |
|
---|
| 457 | typedef struct PRMonitor PRMonitor;
|
---|
| 458 |
|
---|
| 459 | NSPR_API(PRMonitor*) PR_NewMonitor(void);
|
---|
| 460 | NSPR_API(void) PR_DestroyMonitor(PRMonitor *mon);
|
---|
| 461 | NSPR_API(void) PR_EnterMonitor(PRMonitor *mon);
|
---|
| 462 | NSPR_API(PRStatus) PR_ExitMonitor(PRMonitor *mon);
|
---|
| 463 | NSPR_API(PRStatus) PR_Wait(PRMonitor *mon, PRIntervalTime ticks);
|
---|
| 464 | NSPR_API(PRStatus) PR_Notify(PRMonitor *mon);
|
---|
| 465 | NSPR_API(PRStatus) PR_NotifyAll(PRMonitor *mon);
|
---|
| 466 |
|
---|
| 467 | #ifdef VBOX_WITH_XPCOM_NAMESPACE_CLEANUP
|
---|
| 468 | # define PR_CreateThread VBoxNsprPR_CreateThread
|
---|
| 469 | # define PR_JoinThread VBoxNsprPR_JoinThread
|
---|
| 470 | # define PR_Sleep VBoxNsprPR_Sleep
|
---|
| 471 | # define PR_GetCurrentThread VBoxNsprPR_GetCurrentThread
|
---|
| 472 | # define PR_GetThreadState VBoxNsprPR_GetThreadState
|
---|
| 473 | # define PR_SetThreadPrivate VBoxNsprPR_SetThreadPrivate
|
---|
| 474 | # define PR_GetThreadPrivate VBoxNsprPR_GetThreadPrivate
|
---|
| 475 | # define PR_NewThreadPrivateIndex VBoxNsprPR_NewThreadPrivateIndex
|
---|
| 476 | # define PR_GetThreadPriority VBoxNsprPR_GetThreadPriority
|
---|
| 477 | # define PR_SetThreadPriority VBoxNsprPR_SetThreadPriority
|
---|
| 478 | # define PR_Interrupt VBoxNsprPR_Interrupt
|
---|
| 479 | # define PR_ClearInterrupt VBoxNsprPR_ClearInterrupt
|
---|
| 480 | # define PR_BlockInterrupt VBoxNsprPR_BlockInterrupt
|
---|
| 481 | # define PR_UnblockInterrupt VBoxNsprPR_UnblockInterrupt
|
---|
| 482 | # define PR_GetThreadScope VBoxNsprPR_GetThreadScope
|
---|
| 483 | # define PR_GetThreadType VBoxNsprPR_GetThreadType
|
---|
| 484 | #endif /* VBOX_WITH_XPCOM_NAMESPACE_CLEANUP */
|
---|
| 485 |
|
---|
| 486 | typedef struct PRThread PRThread;
|
---|
| 487 | typedef struct PRThreadStack PRThreadStack;
|
---|
| 488 |
|
---|
| 489 | typedef enum PRThreadType {
|
---|
| 490 | PR_USER_THREAD,
|
---|
| 491 | PR_SYSTEM_THREAD
|
---|
| 492 | } PRThreadType;
|
---|
| 493 |
|
---|
| 494 | typedef enum PRThreadScope {
|
---|
| 495 | PR_LOCAL_THREAD,
|
---|
| 496 | PR_GLOBAL_THREAD,
|
---|
| 497 | PR_GLOBAL_BOUND_THREAD
|
---|
| 498 | } PRThreadScope;
|
---|
| 499 |
|
---|
| 500 | typedef enum PRThreadState {
|
---|
| 501 | PR_JOINABLE_THREAD,
|
---|
| 502 | PR_UNJOINABLE_THREAD
|
---|
| 503 | } PRThreadState;
|
---|
| 504 |
|
---|
| 505 | typedef enum PRThreadPriority
|
---|
| 506 | {
|
---|
| 507 | PR_PRIORITY_FIRST = 0, /* just a placeholder */
|
---|
| 508 | PR_PRIORITY_LOW = 0, /* the lowest possible priority */
|
---|
| 509 | PR_PRIORITY_NORMAL = 1, /* most common expected priority */
|
---|
| 510 | PR_PRIORITY_HIGH = 2, /* slightly more aggressive scheduling */
|
---|
| 511 | PR_PRIORITY_URGENT = 3, /* it does little good to have more than one */
|
---|
| 512 | PR_PRIORITY_LAST = 3 /* this is just a placeholder */
|
---|
| 513 | } PRThreadPriority;
|
---|
| 514 |
|
---|
| 515 | NSPR_API(PRThread*) PR_CreateThread(PRThreadType type,
|
---|
| 516 | void (PR_CALLBACK *start)(void *arg),
|
---|
| 517 | void *arg,
|
---|
| 518 | PRThreadPriority priority,
|
---|
| 519 | PRThreadScope scope,
|
---|
| 520 | PRThreadState state,
|
---|
| 521 | PRUint32 stackSize);
|
---|
| 522 | NSPR_API(PRStatus) PR_JoinThread(PRThread *thread);
|
---|
| 523 | NSPR_API(PRThread*) PR_GetCurrentThread(void);
|
---|
| 524 | #ifndef NO_NSPR_10_SUPPORT
|
---|
| 525 | #define PR_CurrentThread() PR_GetCurrentThread() /* for nspr1.0 compat. */
|
---|
| 526 | #endif /* NO_NSPR_10_SUPPORT */
|
---|
| 527 | NSPR_API(PRThreadPriority) PR_GetThreadPriority(const PRThread *thread);
|
---|
| 528 | NSPR_API(void) PR_SetThreadPriority(PRThread *thread, PRThreadPriority priority);
|
---|
| 529 |
|
---|
| 530 | typedef void (PR_CALLBACK *PRThreadPrivateDTOR)(void *priv);
|
---|
| 531 |
|
---|
| 532 | NSPR_API(PRStatus) PR_NewThreadPrivateIndex(
|
---|
| 533 | PRUintn *newIndex, PRThreadPrivateDTOR destructor);
|
---|
| 534 | NSPR_API(PRStatus) PR_SetThreadPrivate(PRUintn tpdIndex, void *priv);
|
---|
| 535 | NSPR_API(void*) PR_GetThreadPrivate(PRUintn tpdIndex);
|
---|
| 536 | NSPR_API(PRStatus) PR_Interrupt(PRThread *thread);
|
---|
| 537 | NSPR_API(void) PR_ClearInterrupt(void);
|
---|
| 538 | NSPR_API(void) PR_BlockInterrupt(void);
|
---|
| 539 | NSPR_API(void) PR_UnblockInterrupt(void);
|
---|
| 540 | NSPR_API(PRStatus) PR_Sleep(PRIntervalTime ticks);
|
---|
| 541 | NSPR_API(PRThreadScope) PR_GetThreadScope(const PRThread *thread);
|
---|
| 542 | NSPR_API(PRThreadType) PR_GetThreadType(const PRThread *thread);
|
---|
| 543 | NSPR_API(PRThreadState) PR_GetThreadState(const PRThread *thread);
|
---|
| 544 |
|
---|
| 545 | #ifdef VBOX_WITH_XPCOM_NAMESPACE_CLEANUP
|
---|
| 546 | # define PR_DestroyLock VBoxNsprPR_DestroyLock
|
---|
| 547 | # define PR_Lock VBoxNsprPR_Lock
|
---|
| 548 | # define PR_NewLock VBoxNsprPR_NewLock
|
---|
| 549 | # define PR_Unlock VBoxNsprPR_Unlock
|
---|
| 550 | #endif /* VBOX_WITH_XPCOM_NAMESPACE_CLEANUP */
|
---|
| 551 |
|
---|
| 552 | typedef struct PRLock PRLock;
|
---|
| 553 |
|
---|
| 554 | NSPR_API(PRLock*) PR_NewLock(void);
|
---|
| 555 | NSPR_API(void) PR_DestroyLock(PRLock *lock);
|
---|
| 556 | NSPR_API(void) PR_Lock(PRLock *lock);
|
---|
| 557 | NSPR_API(PRStatus) PR_Unlock(PRLock *lock);
|
---|
| 558 |
|
---|
| 559 | #ifdef VBOX_WITH_XPCOM_NAMESPACE_CLEANUP
|
---|
| 560 | # define PR_NewCondVar VBoxNsprPR_NewCondVar
|
---|
| 561 | # define PR_DestroyCondVar VBoxNsprPR_DestroyCondVar
|
---|
| 562 | # define PR_WaitCondVar VBoxNsprPR_WaitCondVar
|
---|
| 563 | # define PR_NotifyCondVar VBoxNsprPR_NotifyCondVar
|
---|
| 564 | # define PR_NotifyAllCondVar VBoxNsprPR_NotifyAllCondVar
|
---|
| 565 | #endif /* VBOX_WITH_XPCOM_NAMESPACE_CLEANUP */
|
---|
| 566 |
|
---|
| 567 | typedef struct PRCondVar PRCondVar;
|
---|
| 568 |
|
---|
| 569 | NSPR_API(PRCondVar*) PR_NewCondVar(PRLock *lock);
|
---|
| 570 | NSPR_API(void) PR_DestroyCondVar(PRCondVar *cvar);
|
---|
| 571 | NSPR_API(PRStatus) PR_WaitCondVar(PRCondVar *cvar, PRIntervalTime timeout);
|
---|
| 572 | NSPR_API(PRStatus) PR_NotifyCondVar(PRCondVar *cvar);
|
---|
| 573 | NSPR_API(PRStatus) PR_NotifyAllCondVar(PRCondVar *cvar);
|
---|
| 574 |
|
---|
| 575 | typedef struct PRCListStr PRCList;
|
---|
| 576 |
|
---|
| 577 | struct PRCListStr {
|
---|
[19138] | 578 | PRCList *next;
|
---|
| 579 | PRCList *prev;
|
---|
[18998] | 580 | };
|
---|
| 581 |
|
---|
| 582 | #ifdef VBOX_WITH_XPCOM_NAMESPACE_CLEANUP
|
---|
| 583 | # define PL_DestroyEvent VBoxNsplPL_DestroyEvent
|
---|
| 584 | # define PL_HandleEvent VBoxNsplPL_HandleEvent
|
---|
| 585 | # define PL_InitEvent VBoxNsplPL_InitEvent
|
---|
| 586 | # define PL_CreateEventQueue VBoxNsplPL_CreateEventQueue
|
---|
| 587 | # define PL_CreateMonitoredEventQueue VBoxNsplPL_CreateMonitoredEventQueue
|
---|
| 588 | # define PL_CreateNativeEventQueue VBoxNsplPL_CreateNativeEventQueue
|
---|
| 589 | # define PL_DequeueEvent VBoxNsplPL_DequeueEvent
|
---|
| 590 | # define PL_DestroyEventQueue VBoxNsplPL_DestroyEventQueue
|
---|
| 591 | # define PL_EventAvailable VBoxNsplPL_EventAvailable
|
---|
| 592 | # define PL_EventLoop VBoxNsplPL_EventLoop
|
---|
| 593 | # define PL_GetEvent VBoxNsplPL_GetEvent
|
---|
| 594 | # define PL_GetEventOwner VBoxNsplPL_GetEventOwner
|
---|
| 595 | # define PL_GetEventQueueMonitor VBoxNsplPL_GetEventQueueMonitor
|
---|
| 596 | # define PL_GetEventQueueSelectFD VBoxNsplPL_GetEventQueueSelectFD
|
---|
| 597 | # define PL_MapEvents VBoxNsplPL_MapEvents
|
---|
| 598 | # define PL_PostEvent VBoxNsplPL_PostEvent
|
---|
| 599 | # define PL_PostSynchronousEvent VBoxNsplPL_PostSynchronousEvent
|
---|
| 600 | # define PL_ProcessEventsBeforeID VBoxNsplPL_ProcessEventsBeforeID
|
---|
| 601 | # define PL_ProcessPendingEvents VBoxNsplPL_ProcessPendingEvents
|
---|
| 602 | # define PL_RegisterEventIDFunc VBoxNsplPL_RegisterEventIDFunc
|
---|
| 603 | # define PL_RevokeEvents VBoxNsplPL_RevokeEvents
|
---|
| 604 | # define PL_UnregisterEventIDFunc VBoxNsplPL_UnregisterEventIDFunc
|
---|
| 605 | # define PL_WaitForEvent VBoxNsplPL_WaitForEvent
|
---|
| 606 | # define PL_IsQueueNative VBoxNsplPL_IsQueueNative
|
---|
| 607 | # define PL_IsQueueOnCurrentThread VBoxNsplPL_IsQueueOnCurrentThread
|
---|
| 608 | # define PL_FavorPerformanceHint VBoxNsplPL_FavorPerformanceHint
|
---|
| 609 | #endif /* VBOX_WITH_XPCOM_NAMESPACE_CLEANUP */
|
---|
| 610 |
|
---|
| 611 | typedef struct PLEvent PLEvent;
|
---|
| 612 | typedef struct PLEventQueue PLEventQueue;
|
---|
| 613 |
|
---|
| 614 | PR_EXTERN(PLEventQueue*)
|
---|
| 615 | PL_CreateEventQueue(const char* name, PRThread* handlerThread);
|
---|
[19055] | 616 | PR_EXTERN(PLEventQueue *)
|
---|
[18998] | 617 | PL_CreateNativeEventQueue(
|
---|
[19055] | 618 | const char *name,
|
---|
[18998] | 619 | PRThread *handlerThread
|
---|
| 620 | );
|
---|
[19055] | 621 | PR_EXTERN(PLEventQueue *)
|
---|
[18998] | 622 | PL_CreateMonitoredEventQueue(
|
---|
| 623 | const char *name,
|
---|
| 624 | PRThread *handlerThread
|
---|
| 625 | );
|
---|
| 626 | PR_EXTERN(void)
|
---|
| 627 | PL_DestroyEventQueue(PLEventQueue* self);
|
---|
| 628 | PR_EXTERN(PRMonitor*)
|
---|
| 629 | PL_GetEventQueueMonitor(PLEventQueue* self);
|
---|
| 630 |
|
---|
[19138] | 631 | #define PL_ENTER_EVENT_QUEUE_MONITOR(queue) \
|
---|
| 632 | PR_EnterMonitor(PL_GetEventQueueMonitor(queue))
|
---|
[18998] | 633 |
|
---|
[19138] | 634 | #define PL_EXIT_EVENT_QUEUE_MONITOR(queue) \
|
---|
| 635 | PR_ExitMonitor(PL_GetEventQueueMonitor(queue))
|
---|
[18998] | 636 |
|
---|
| 637 | PR_EXTERN(PRStatus) PL_PostEvent(PLEventQueue* self, PLEvent* event);
|
---|
| 638 | PR_EXTERN(void*) PL_PostSynchronousEvent(PLEventQueue* self, PLEvent* event);
|
---|
| 639 | PR_EXTERN(PLEvent*) PL_GetEvent(PLEventQueue* self);
|
---|
| 640 | PR_EXTERN(PRBool) PL_EventAvailable(PLEventQueue* self);
|
---|
| 641 |
|
---|
| 642 | typedef void (PR_CALLBACK *PLEventFunProc)(PLEvent* event, void* data, PLEventQueue* queue);
|
---|
| 643 |
|
---|
| 644 | PR_EXTERN(void) PL_MapEvents(PLEventQueue* self, PLEventFunProc fun, void* data);
|
---|
| 645 | PR_EXTERN(void) PL_RevokeEvents(PLEventQueue* self, void* owner);
|
---|
| 646 | PR_EXTERN(void) PL_ProcessPendingEvents(PLEventQueue* self);
|
---|
| 647 | PR_EXTERN(PLEvent*) PL_WaitForEvent(PLEventQueue* self);
|
---|
| 648 | PR_EXTERN(void) PL_EventLoop(PLEventQueue* self);
|
---|
| 649 | PR_EXTERN(PRInt32) PL_GetEventQueueSelectFD(PLEventQueue* self);
|
---|
| 650 | PR_EXTERN(PRBool) PL_IsQueueOnCurrentThread( PLEventQueue *queue );
|
---|
| 651 | PR_EXTERN(PRBool) PL_IsQueueNative(PLEventQueue *queue);
|
---|
| 652 |
|
---|
| 653 | typedef void* (PR_CALLBACK *PLHandleEventProc)(PLEvent* self);
|
---|
| 654 | typedef void (PR_CALLBACK *PLDestroyEventProc)(PLEvent* self);
|
---|
| 655 | PR_EXTERN(void)
|
---|
| 656 | PL_InitEvent(PLEvent* self, void* owner,
|
---|
[19138] | 657 | PLHandleEventProc handler,
|
---|
| 658 | PLDestroyEventProc destructor);
|
---|
[18998] | 659 | PR_EXTERN(void*) PL_GetEventOwner(PLEvent* self);
|
---|
| 660 | PR_EXTERN(void) PL_HandleEvent(PLEvent* self);
|
---|
| 661 | PR_EXTERN(void) PL_DestroyEvent(PLEvent* self);
|
---|
| 662 | PR_EXTERN(void) PL_DequeueEvent(PLEvent* self, PLEventQueue* queue);
|
---|
| 663 | PR_EXTERN(void) PL_FavorPerformanceHint(PRBool favorPerformanceOverEventStarvation, PRUint32 starvationDelay);
|
---|
| 664 |
|
---|
| 665 | struct PLEvent {
|
---|
[19138] | 666 | PRCList link;
|
---|
| 667 | PLHandleEventProc handler;
|
---|
| 668 | PLDestroyEventProc destructor;
|
---|
| 669 | void* owner;
|
---|
| 670 | void* synchronousResult;
|
---|
[18998] | 671 | PRLock* lock;
|
---|
| 672 | PRCondVar* condVar;
|
---|
| 673 | PRBool handled;
|
---|
| 674 | #ifdef PL_POST_TIMINGS
|
---|
| 675 | PRIntervalTime postTime;
|
---|
| 676 | #endif
|
---|
| 677 | #ifdef XP_UNIX
|
---|
| 678 | unsigned long id;
|
---|
| 679 | #endif /* XP_UNIX */
|
---|
| 680 | /* other fields follow... */
|
---|
| 681 | };
|
---|
| 682 |
|
---|
| 683 | #if defined(XP_WIN) || defined(XP_OS2)
|
---|
| 684 |
|
---|
[19063] | 685 | PR_EXTERN(HWND)
|
---|
[19055] | 686 | PL_GetNativeEventReceiverWindow(
|
---|
| 687 | PLEventQueue *eqp
|
---|
[18998] | 688 | );
|
---|
| 689 | #endif /* XP_WIN || XP_OS2 */
|
---|
| 690 |
|
---|
| 691 | #ifdef XP_UNIX
|
---|
| 692 |
|
---|
| 693 | PR_EXTERN(PRInt32)
|
---|
| 694 | PL_ProcessEventsBeforeID(PLEventQueue *aSelf, unsigned long aID);
|
---|
| 695 |
|
---|
| 696 | typedef unsigned long (PR_CALLBACK *PLGetEventIDFunc)(void *aClosure);
|
---|
| 697 |
|
---|
| 698 | PR_EXTERN(void)
|
---|
| 699 | PL_RegisterEventIDFunc(PLEventQueue *aSelf, PLGetEventIDFunc aFunc,
|
---|
| 700 | void *aClosure);
|
---|
| 701 | PR_EXTERN(void) PL_UnregisterEventIDFunc(PLEventQueue *aSelf);
|
---|
| 702 |
|
---|
| 703 | #endif /* XP_UNIX */
|
---|
| 704 |
|
---|
[19694] | 705 | /* Standard "it worked" return value */
|
---|
| 706 | #define NS_OK 0
|
---|
[18998] | 707 |
|
---|
[19694] | 708 | #define NS_ERROR_BASE ((nsresult) 0xC1F30000)
|
---|
[18998] | 709 |
|
---|
[19694] | 710 | /* Returned when an instance is not initialized */
|
---|
| 711 | #define NS_ERROR_NOT_INITIALIZED (NS_ERROR_BASE + 1)
|
---|
| 712 |
|
---|
| 713 | /* Returned when an instance is already initialized */
|
---|
| 714 | #define NS_ERROR_ALREADY_INITIALIZED (NS_ERROR_BASE + 2)
|
---|
| 715 |
|
---|
| 716 | /* Returned by a not implemented function */
|
---|
| 717 | #define NS_ERROR_NOT_IMPLEMENTED ((nsresult) 0x80004001L)
|
---|
| 718 |
|
---|
| 719 | /* Returned when a given interface is not supported. */
|
---|
| 720 | #define NS_NOINTERFACE ((nsresult) 0x80004002L)
|
---|
| 721 | #define NS_ERROR_NO_INTERFACE NS_NOINTERFACE
|
---|
| 722 |
|
---|
| 723 | #define NS_ERROR_INVALID_POINTER ((nsresult) 0x80004003L)
|
---|
| 724 | #define NS_ERROR_NULL_POINTER NS_ERROR_INVALID_POINTER
|
---|
| 725 |
|
---|
| 726 | /* Returned when a function aborts */
|
---|
| 727 | #define NS_ERROR_ABORT ((nsresult) 0x80004004L)
|
---|
| 728 |
|
---|
| 729 | /* Returned when a function fails */
|
---|
| 730 | #define NS_ERROR_FAILURE ((nsresult) 0x80004005L)
|
---|
| 731 |
|
---|
| 732 | /* Returned when an unexpected error occurs */
|
---|
| 733 | #define NS_ERROR_UNEXPECTED ((nsresult) 0x8000ffffL)
|
---|
| 734 |
|
---|
| 735 | /* Returned when a memory allocation fails */
|
---|
| 736 | #define NS_ERROR_OUT_OF_MEMORY ((nsresult) 0x8007000eL)
|
---|
| 737 |
|
---|
| 738 | /* Returned when an illegal value is passed */
|
---|
| 739 | #define NS_ERROR_ILLEGAL_VALUE ((nsresult) 0x80070057L)
|
---|
| 740 | #define NS_ERROR_INVALID_ARG NS_ERROR_ILLEGAL_VALUE
|
---|
| 741 |
|
---|
| 742 | /* Returned when a class doesn't allow aggregation */
|
---|
| 743 | #define NS_ERROR_NO_AGGREGATION ((nsresult) 0x80040110L)
|
---|
| 744 |
|
---|
| 745 | /* Returned when an operation can't complete due to an unavailable resource */
|
---|
| 746 | #define NS_ERROR_NOT_AVAILABLE ((nsresult) 0x80040111L)
|
---|
| 747 |
|
---|
| 748 | /* Returned when a class is not registered */
|
---|
| 749 | #define NS_ERROR_FACTORY_NOT_REGISTERED ((nsresult) 0x80040154L)
|
---|
| 750 |
|
---|
| 751 | /* Returned when a class cannot be registered, but may be tried again later */
|
---|
| 752 | #define NS_ERROR_FACTORY_REGISTER_AGAIN ((nsresult) 0x80040155L)
|
---|
| 753 |
|
---|
| 754 | /* Returned when a dynamically loaded factory couldn't be found */
|
---|
| 755 | #define NS_ERROR_FACTORY_NOT_LOADED ((nsresult) 0x800401f8L)
|
---|
| 756 |
|
---|
| 757 | /* Returned when a factory doesn't support signatures */
|
---|
| 758 | #define NS_ERROR_FACTORY_NO_SIGNATURE_SUPPORT \
|
---|
| 759 | (NS_ERROR_BASE + 0x101)
|
---|
| 760 |
|
---|
| 761 | /* Returned when a factory already is registered */
|
---|
| 762 | #define NS_ERROR_FACTORY_EXISTS (NS_ERROR_BASE + 0x100)
|
---|
| 763 |
|
---|
[16406] | 764 | /**
|
---|
| 765 | * An "interface id" which can be used to uniquely identify a given
|
---|
| 766 | * interface.
|
---|
| 767 | * A "unique identifier". This is modeled after OSF DCE UUIDs.
|
---|
| 768 | */
|
---|
| 769 |
|
---|
| 770 | struct nsID {
|
---|
[50183] | 771 | PRUint32 m0;
|
---|
| 772 | PRUint16 m1;
|
---|
| 773 | PRUint16 m2;
|
---|
| 774 | PRUint8 m3[8];
|
---|
[16406] | 775 | };
|
---|
| 776 |
|
---|
| 777 | typedef struct nsID nsID;
|
---|
| 778 | typedef nsID nsIID;
|
---|
[50183] | 779 | typedef nsID nsCID;
|
---|
[16406] | 780 |
|
---|
[50183] | 781 | #endif /* __cplusplus */
|
---|
| 782 |
|
---|
[50188] | 783 | #define VBOX_WINAPI
|
---|
[50183] | 784 |
|
---|
| 785 | /* Various COM types defined by their XPCOM equivalent */
|
---|
| 786 | typedef PRInt64 LONG64;
|
---|
| 787 | typedef PRInt32 LONG;
|
---|
| 788 | typedef PRInt32 DWORD;
|
---|
| 789 | typedef PRInt16 SHORT;
|
---|
| 790 | typedef PRUint64 ULONG64;
|
---|
| 791 | typedef PRUint32 ULONG;
|
---|
| 792 | typedef PRUint16 USHORT;
|
---|
| 793 |
|
---|
| 794 | typedef PRBool BOOL;
|
---|
| 795 |
|
---|
| 796 | #ifndef FALSE
|
---|
| 797 | #define FALSE 0
|
---|
| 798 | #define TRUE 1
|
---|
| 799 | #endif
|
---|
| 800 |
|
---|
| 801 | #define HRESULT nsresult
|
---|
| 802 | #define SUCCEEDED NS_SUCCEEDED
|
---|
| 803 | #define FAILED NS_FAILED
|
---|
| 804 |
|
---|
| 805 | /* OLE error codes */
|
---|
| 806 | #define S_OK ((nsresult)NS_OK)
|
---|
| 807 | #define E_UNEXPECTED NS_ERROR_UNEXPECTED
|
---|
| 808 | #define E_NOTIMPL NS_ERROR_NOT_IMPLEMENTED
|
---|
| 809 | #define E_OUTOFMEMORY NS_ERROR_OUT_OF_MEMORY
|
---|
| 810 | #define E_INVALIDARG NS_ERROR_INVALID_ARG
|
---|
| 811 | #define E_NOINTERFACE NS_ERROR_NO_INTERFACE
|
---|
| 812 | #define E_POINTER NS_ERROR_NULL_POINTER
|
---|
| 813 | #define E_ABORT NS_ERROR_ABORT
|
---|
| 814 | #define E_FAIL NS_ERROR_FAILURE
|
---|
| 815 | /* Note: a better analog for E_ACCESSDENIED would probably be
|
---|
| 816 | * NS_ERROR_NOT_AVAILABLE, but we want binary compatibility for now. */
|
---|
| 817 | #define E_ACCESSDENIED ((nsresult)0x80070005L)
|
---|
| 818 |
|
---|
| 819 | /* Basic vartype for COM compatibility. */
|
---|
| 820 | typedef enum VARTYPE
|
---|
| 821 | {
|
---|
| 822 | VT_I2 = 2,
|
---|
| 823 | VT_I4 = 3,
|
---|
| 824 | VT_BSTR = 8,
|
---|
| 825 | VT_DISPATCH = 9,
|
---|
| 826 | VT_BOOL = 11,
|
---|
| 827 | VT_UNKNOWN = 13,
|
---|
| 828 | VT_I1 = 16,
|
---|
| 829 | VT_UI1 = 17,
|
---|
| 830 | VT_UI2 = 18,
|
---|
| 831 | VT_UI4 = 19,
|
---|
| 832 | VT_I8 = 20,
|
---|
| 833 | VT_UI8 = 21,
|
---|
| 834 | VT_HRESULT = 25
|
---|
| 835 | } VARTYPE;
|
---|
| 836 |
|
---|
| 837 | /* Basic safearray type for COM compatibility. */
|
---|
| 838 | typedef struct SAFEARRAY
|
---|
| 839 | {
|
---|
| 840 | void *pv;
|
---|
| 841 | ULONG c;
|
---|
| 842 | } SAFEARRAY;
|
---|
| 843 |
|
---|
[58223] | 844 | #define ComSafeArrayAsInParam(f) ((f) ? (f)->c : 0), ((f) ? (f)->pv : NULL)
|
---|
[50183] | 845 | #define ComSafeArrayAsOutParam(f) (&((f)->c)), (&((f)->pv))
|
---|
[52793] | 846 | #define ComSafeArrayAsOutTypeParam(f,t) (&((f)->c)), (t**)(&((f)->pv))
|
---|
[50183] | 847 | #define ComSafeArrayAsOutIfaceParam(f,t) (&((f)->c)), (t**)(&((f)->pv))
|
---|
| 848 |
|
---|
| 849 | /* Glossing over differences between COM and XPCOM */
|
---|
| 850 | #define IErrorInfo nsIException
|
---|
| 851 | #define IUnknown nsISupports
|
---|
| 852 | #define IDispatch nsISupports
|
---|
| 853 |
|
---|
[50254] | 854 | /* Make things as COM compatible as possible */
|
---|
| 855 | #define interface struct
|
---|
| 856 | #ifdef CONST_VTABLE
|
---|
| 857 | # define CONST_VTBL const
|
---|
| 858 | #else /* !CONST_VTABLE */
|
---|
| 859 | # define CONST_VTBL
|
---|
| 860 | #endif /* !CONST_VTABLE */
|
---|
| 861 |
|
---|
[50183] | 862 | #ifndef __cplusplus
|
---|
| 863 |
|
---|
[50254] | 864 | /** @todo this first batch of forward declarations (and the corresponding ones
|
---|
| 865 | * generated for each interface) are 100% redundant, remove eventually. */
|
---|
| 866 | interface nsISupports; /* forward declaration */
|
---|
| 867 | interface nsIException; /* forward declaration */
|
---|
| 868 | interface nsIStackFrame; /* forward declaration */
|
---|
| 869 | interface nsIEventTarget;/* forward declaration */
|
---|
| 870 | interface nsIEventQueue; /* forward declaration */
|
---|
[16406] | 871 |
|
---|
[50254] | 872 | typedef interface nsISupports nsISupports; /* forward declaration */
|
---|
| 873 | typedef interface nsIException nsIException; /* forward declaration */
|
---|
| 874 | typedef interface nsIStackFrame nsIStackFrame; /* forward declaration */
|
---|
| 875 | typedef interface nsIEventTarget nsIEventTarget;/* forward declaration */
|
---|
| 876 | typedef interface nsIEventQueue nsIEventQueue; /* forward declaration */
|
---|
| 877 |
|
---|
[50183] | 878 | /* starting interface: nsISupports */
|
---|
| 879 | #define NS_ISUPPORTS_IID_STR "00000000-0000-0000-c000-000000000046"
|
---|
[16406] | 880 |
|
---|
[50183] | 881 | #define NS_ISUPPORTS_IID \
|
---|
| 882 | { 0x00000000, 0x0000, 0x0000, \
|
---|
| 883 | {0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} }
|
---|
| 884 |
|
---|
[16406] | 885 | /**
|
---|
| 886 | * Reference count values
|
---|
| 887 | *
|
---|
| 888 | * This is the return type for AddRef() and Release() in nsISupports.
|
---|
| 889 | * IUnknown of COM returns an unsigned long from equivalent functions.
|
---|
| 890 | * The following ifdef exists to maintain binary compatibility with
|
---|
| 891 | * IUnknown.
|
---|
| 892 | */
|
---|
[50183] | 893 | #if defined(XP_WIN) && PR_BYTES_PER_LONG == 4
|
---|
| 894 | typedef unsigned long nsrefcnt;
|
---|
| 895 | #else
|
---|
| 896 | typedef PRUint32 nsrefcnt;
|
---|
| 897 | #endif
|
---|
[16406] | 898 |
|
---|
| 899 | /**
|
---|
| 900 | * Basic component object model interface. Objects which implement
|
---|
| 901 | * this interface support runtime interface discovery (QueryInterface)
|
---|
| 902 | * and a reference counted memory model (AddRef/Release). This is
|
---|
| 903 | * modelled after the win32 IUnknown API.
|
---|
| 904 | */
|
---|
[50183] | 905 | #ifndef VBOX_WITH_GLUE
|
---|
| 906 | struct nsISupports_vtbl
|
---|
| 907 | {
|
---|
| 908 | nsresult (*QueryInterface)(nsISupports *pThis, const nsID *iid, void **resultp);
|
---|
| 909 | nsrefcnt (*AddRef)(nsISupports *pThis);
|
---|
| 910 | nsrefcnt (*Release)(nsISupports *pThis);
|
---|
[16406] | 911 | };
|
---|
[50183] | 912 | #else /* !VBOX_WITH_GLUE */
|
---|
| 913 | struct nsISupportsVtbl
|
---|
| 914 | {
|
---|
| 915 | nsresult (*QueryInterface)(nsISupports *pThis, const nsID *iid, void **resultp);
|
---|
| 916 | nsrefcnt (*AddRef)(nsISupports *pThis);
|
---|
| 917 | nsrefcnt (*Release)(nsISupports *pThis);
|
---|
| 918 | };
|
---|
| 919 | #define nsISupports_QueryInterface(p, iid, resultp) ((p)->lpVtbl->QueryInterface(p, iid, resultp))
|
---|
| 920 | #define nsISupports_AddRef(p) ((p)->lpVtbl->AddRef(p))
|
---|
| 921 | #define nsISupports_Release(p) ((p)->lpVtbl->Release(p))
|
---|
| 922 | #define IUnknown_QueryInterface(p, iid, resultp) ((p)->lpVtbl->QueryInterface(p, iid, resultp))
|
---|
| 923 | #define IUnknown_AddRef(p) ((p)->lpVtbl->AddRef(p))
|
---|
| 924 | #define IUnknown_Release(p) ((p)->lpVtbl->Release(p))
|
---|
| 925 | #define IDispatch_QueryInterface(p, iid, resultp) ((p)->lpVtbl->QueryInterface(p, iid, resultp))
|
---|
| 926 | #define IDispatch_AddRef(p) ((p)->lpVtbl->AddRef(p))
|
---|
| 927 | #define IDispatch_Release(p) ((p)->lpVtbl->Release(p))
|
---|
| 928 | #endif /* !VBOX_WITH_GLUE */
|
---|
[16406] | 929 |
|
---|
[50254] | 930 | interface nsISupports
|
---|
[50183] | 931 | {
|
---|
| 932 | #ifndef VBOX_WITH_GLUE
|
---|
[16406] | 933 | struct nsISupports_vtbl *vtbl;
|
---|
[50183] | 934 | #else /* !VBOX_WITH_GLUE */
|
---|
[50254] | 935 | CONST_VTBL struct nsISupportsVtbl *lpVtbl;
|
---|
[50183] | 936 | #endif /* !VBOX_WITH_GLUE */
|
---|
[16406] | 937 | };
|
---|
| 938 |
|
---|
| 939 | /* starting interface: nsIException */
|
---|
| 940 | #define NS_IEXCEPTION_IID_STR "f3a8d3b4-c424-4edc-8bf6-8974c983ba78"
|
---|
| 941 |
|
---|
| 942 | #define NS_IEXCEPTION_IID \
|
---|
[50183] | 943 | {0xf3a8d3b4, 0xc424, 0x4edc, \
|
---|
| 944 | { 0x8b, 0xf6, 0x89, 0x74, 0xc9, 0x83, 0xba, 0x78 }}
|
---|
[16406] | 945 |
|
---|
[50183] | 946 | #ifndef VBOX_WITH_GLUE
|
---|
| 947 | struct nsIException_vtbl
|
---|
| 948 | {
|
---|
| 949 | /* Methods from the interface nsISupports */
|
---|
| 950 | struct nsISupports_vtbl nsisupports;
|
---|
[16406] | 951 |
|
---|
[50183] | 952 | nsresult (*GetMessage)(nsIException *pThis, PRUnichar * *aMessage);
|
---|
| 953 | nsresult (*GetResult)(nsIException *pThis, nsresult *aResult);
|
---|
| 954 | nsresult (*GetName)(nsIException *pThis, PRUnichar * *aName);
|
---|
| 955 | nsresult (*GetFilename)(nsIException *pThis, PRUnichar * *aFilename);
|
---|
| 956 | nsresult (*GetLineNumber)(nsIException *pThis, PRUint32 *aLineNumber);
|
---|
| 957 | nsresult (*GetColumnNumber)(nsIException *pThis, PRUint32 *aColumnNumber);
|
---|
| 958 | nsresult (*GetLocation)(nsIException *pThis, nsIStackFrame * *aLocation);
|
---|
| 959 | nsresult (*GetInner)(nsIException *pThis, nsIException * *aInner);
|
---|
| 960 | nsresult (*GetData)(nsIException *pThis, nsISupports * *aData);
|
---|
| 961 | nsresult (*ToString)(nsIException *pThis, PRUnichar **_retval);
|
---|
| 962 | };
|
---|
| 963 | #else /* !VBOX_WITH_GLUE */
|
---|
| 964 | struct nsIExceptionVtbl
|
---|
| 965 | {
|
---|
| 966 | nsresult (*QueryInterface)(nsIException *pThis, const nsID *iid, void **resultp);
|
---|
| 967 | nsrefcnt (*AddRef)(nsIException *pThis);
|
---|
| 968 | nsrefcnt (*Release)(nsIException *pThis);
|
---|
[16406] | 969 |
|
---|
[50183] | 970 | nsresult (*GetMessage)(nsIException *pThis, PRUnichar * *aMessage);
|
---|
| 971 | nsresult (*GetResult)(nsIException *pThis, nsresult *aResult);
|
---|
| 972 | nsresult (*GetName)(nsIException *pThis, PRUnichar * *aName);
|
---|
| 973 | nsresult (*GetFilename)(nsIException *pThis, PRUnichar * *aFilename);
|
---|
| 974 | nsresult (*GetLineNumber)(nsIException *pThis, PRUint32 *aLineNumber);
|
---|
| 975 | nsresult (*GetColumnNumber)(nsIException *pThis, PRUint32 *aColumnNumber);
|
---|
| 976 | nsresult (*GetLocation)(nsIException *pThis, nsIStackFrame * *aLocation);
|
---|
| 977 | nsresult (*GetInner)(nsIException *pThis, nsIException * *aInner);
|
---|
| 978 | nsresult (*GetData)(nsIException *pThis, nsISupports * *aData);
|
---|
| 979 | nsresult (*ToString)(nsIException *pThis, PRUnichar **_retval);
|
---|
[16406] | 980 | };
|
---|
[50183] | 981 | #define nsIException_QueryInterface(p, iid, resultp) ((p)->lpVtbl->QueryInterface(p, iid, resultp))
|
---|
| 982 | #define nsIException_AddRef(p) ((p)->lpVtbl->AddRef(p))
|
---|
| 983 | #define nsIException_Release(p) ((p)->lpVtbl->Release(p))
|
---|
| 984 | #define nsIException_get_Message(p, aMessage) ((p)->lpVtbl->GetMessage(p, aMessage))
|
---|
| 985 | #define nsIException_GetMessage(p, aMessage) ((p)->lpVtbl->GetMessage(p, aMessage))
|
---|
| 986 | #define nsIException_get_Result(p, aResult) ((p)->lpVtbl->GetResult(p, aResult))
|
---|
| 987 | #define nsIException_GetResult(p, aResult) ((p)->lpVtbl->GetResult(p, aResult))
|
---|
| 988 | #define nsIException_get_Name(p, aName) ((p)->lpVtbl->GetName(p, aName))
|
---|
| 989 | #define nsIException_GetName(p, aName) ((p)->lpVtbl->GetName(p, aName))
|
---|
| 990 | #define nsIException_get_Filename(p, aFilename) ((p)->lpVtbl->GetFilename(p, aFilename))
|
---|
| 991 | #define nsIException_GetFilename(p, aFilename) ((p)->lpVtbl->GetFilename(p, aFilename))
|
---|
| 992 | #define nsIException_get_LineNumber(p, aLineNumber) ((p)->lpVtbl->GetLineNumber(p, aLineNumber))
|
---|
| 993 | #define nsIException_GetLineNumber(p, aLineNumber) ((p)->lpVtbl->GetLineNumber(p, aLineNumber))
|
---|
| 994 | #define nsIException_get_ColumnNumber(p, aColumnNumber) ((p)->lpVtbl->GetColumnNumber(p, aColumnNumber))
|
---|
| 995 | #define nsIException_GetColumnNumber(p, aColumnNumber) ((p)->lpVtbl->GetColumnNumber(p, aColumnNumber))
|
---|
| 996 | #define nsIException_get_Inner(p, aInner) ((p)->lpVtbl->GetInner(p, aInner))
|
---|
| 997 | #define nsIException_GetInner(p, aInner) ((p)->lpVtbl->GetInner(p, aInner))
|
---|
| 998 | #define nsIException_get_Data(p, aData) ((p)->lpVtbl->GetData(p, aData))
|
---|
| 999 | #define nsIException_GetData(p, aData) ((p)->lpVtbl->GetData(p, aData))
|
---|
| 1000 | #define nsIException_ToString(p, retval) ((p)->lpVtbl->ToString(p, retval))
|
---|
| 1001 | #define IErrorInfo_QueryInterface(p, iid, resultp) ((p)->lpVtbl->QueryInterface(p, iid, resultp))
|
---|
| 1002 | #define IErrorInfo_AddRef(p) ((p)->lpVtbl->AddRef(p))
|
---|
| 1003 | #define IErrorInfo_Release(p) ((p)->lpVtbl->Release(p))
|
---|
| 1004 | #define IErrorInfo_get_Message(p, aMessage) ((p)->lpVtbl->GetMessage(p, aMessage))
|
---|
| 1005 | #define IErrorInfo_GetMessage(p, aMessage) ((p)->lpVtbl->GetMessage(p, aMessage))
|
---|
| 1006 | #define IErrorInfo_get_Result(p, aResult) ((p)->lpVtbl->GetResult(p, aResult))
|
---|
| 1007 | #define IErrorInfo_GetResult(p, aResult) ((p)->lpVtbl->GetResult(p, aResult))
|
---|
| 1008 | #define IErrorInfo_get_Name(p, aName) ((p)->lpVtbl->GetName(p, aName))
|
---|
| 1009 | #define IErrorInfo_GetName(p, aName) ((p)->lpVtbl->GetName(p, aName))
|
---|
| 1010 | #define IErrorInfo_get_Filename(p, aFilename) ((p)->lpVtbl->GetFilename(p, aFilename))
|
---|
| 1011 | #define IErrorInfo_GetFilename(p, aFilename) ((p)->lpVtbl->GetFilename(p, aFilename))
|
---|
| 1012 | #define IErrorInfo_get_LineNumber(p, aLineNumber) ((p)->lpVtbl->GetLineNumber(p, aLineNumber))
|
---|
| 1013 | #define IErrorInfo_GetLineNumber(p, aLineNumber) ((p)->lpVtbl->GetLineNumber(p, aLineNumber))
|
---|
| 1014 | #define IErrorInfo_get_ColumnNumber(p, aColumnNumber) ((p)->lpVtbl->GetColumnNumber(p, aColumnNumber))
|
---|
| 1015 | #define IErrorInfo_GetColumnNumber(p, aColumnNumber) ((p)->lpVtbl->GetColumnNumber(p, aColumnNumber))
|
---|
| 1016 | #define IErrorInfo_get_Inner(p, aInner) ((p)->lpVtbl->GetInner(p, aInner))
|
---|
| 1017 | #define IErrorInfo_GetInner(p, aInner) ((p)->lpVtbl->GetInner(p, aInner))
|
---|
| 1018 | #define IErrorInfo_get_Data(p, aData) ((p)->lpVtbl->GetData(p, aData))
|
---|
| 1019 | #define IErrorInfo_GetData(p, aData) ((p)->lpVtbl->GetData(p, aData))
|
---|
| 1020 | #define IErrorInfo_ToString(p, retval) ((p)->lpVtbl->ToString(p, retval))
|
---|
| 1021 | #endif /* !VBOX_WITH_GLUE */
|
---|
[16406] | 1022 |
|
---|
[50254] | 1023 | interface nsIException
|
---|
[50183] | 1024 | {
|
---|
| 1025 | #ifndef VBOX_WITH_GLUE
|
---|
[16406] | 1026 | struct nsIException_vtbl *vtbl;
|
---|
[50183] | 1027 | #else /* !VBOX_WITH_GLUE */
|
---|
[50254] | 1028 | CONST_VTBL struct nsIExceptionVtbl *lpVtbl;
|
---|
[50183] | 1029 | #endif /* !VBOX_WITH_GLUE */
|
---|
[16406] | 1030 | };
|
---|
| 1031 |
|
---|
| 1032 | /* starting interface: nsIStackFrame */
|
---|
| 1033 | #define NS_ISTACKFRAME_IID_STR "91d82105-7c62-4f8b-9779-154277c0ee90"
|
---|
| 1034 |
|
---|
| 1035 | #define NS_ISTACKFRAME_IID \
|
---|
[50183] | 1036 | {0x91d82105, 0x7c62, 0x4f8b, \
|
---|
| 1037 | { 0x97, 0x79, 0x15, 0x42, 0x77, 0xc0, 0xee, 0x90 }}
|
---|
[16406] | 1038 |
|
---|
[50183] | 1039 | #ifndef VBOX_WITH_GLUE
|
---|
| 1040 | struct nsIStackFrame_vtbl
|
---|
| 1041 | {
|
---|
| 1042 | /* Methods from the interface nsISupports */
|
---|
| 1043 | struct nsISupports_vtbl nsisupports;
|
---|
[16406] | 1044 |
|
---|
[50183] | 1045 | nsresult (*GetLanguage)(nsIStackFrame *pThis, PRUint32 *aLanguage);
|
---|
| 1046 | nsresult (*GetLanguageName)(nsIStackFrame *pThis, PRUnichar * *aLanguageName);
|
---|
| 1047 | nsresult (*GetFilename)(nsIStackFrame *pThis, PRUnichar * *aFilename);
|
---|
| 1048 | nsresult (*GetName)(nsIStackFrame *pThis, PRUnichar * *aName);
|
---|
| 1049 | nsresult (*GetLineNumber)(nsIStackFrame *pThis, PRInt32 *aLineNumber);
|
---|
| 1050 | nsresult (*GetSourceLine)(nsIStackFrame *pThis, PRUnichar * *aSourceLine);
|
---|
| 1051 | nsresult (*GetCaller)(nsIStackFrame *pThis, nsIStackFrame * *aCaller);
|
---|
| 1052 | nsresult (*ToString)(nsIStackFrame *pThis, PRUnichar **_retval);
|
---|
| 1053 | };
|
---|
| 1054 | #else /* !VBOX_WITH_GLUE */
|
---|
| 1055 | struct nsIStackFrameVtbl
|
---|
| 1056 | {
|
---|
| 1057 | nsresult (*QueryInterface)(nsIStackFrame *pThis, const nsID *iid, void **resultp);
|
---|
| 1058 | nsrefcnt (*AddRef)(nsIStackFrame *pThis);
|
---|
| 1059 | nsrefcnt (*Release)(nsIStackFrame *pThis);
|
---|
[16406] | 1060 |
|
---|
[50183] | 1061 | nsresult (*GetLanguage)(nsIStackFrame *pThis, PRUint32 *aLanguage);
|
---|
| 1062 | nsresult (*GetLanguageName)(nsIStackFrame *pThis, PRUnichar * *aLanguageName);
|
---|
| 1063 | nsresult (*GetFilename)(nsIStackFrame *pThis, PRUnichar * *aFilename);
|
---|
| 1064 | nsresult (*GetName)(nsIStackFrame *pThis, PRUnichar * *aName);
|
---|
| 1065 | nsresult (*GetLineNumber)(nsIStackFrame *pThis, PRInt32 *aLineNumber);
|
---|
| 1066 | nsresult (*GetSourceLine)(nsIStackFrame *pThis, PRUnichar * *aSourceLine);
|
---|
| 1067 | nsresult (*GetCaller)(nsIStackFrame *pThis, nsIStackFrame * *aCaller);
|
---|
| 1068 | nsresult (*ToString)(nsIStackFrame *pThis, PRUnichar **_retval);
|
---|
[16406] | 1069 | };
|
---|
[50183] | 1070 | #define nsIStackFrame_QueryInterface(p, iid, resultp) ((p)->lpVtbl->QueryInterface(p, iid, resultp))
|
---|
| 1071 | #define nsIStackFrame_AddRef(p) ((p)->lpVtbl->AddRef(p))
|
---|
| 1072 | #define nsIStackFrame_Release(p) ((p)->lpVtbl->Release(p))
|
---|
| 1073 | #define nsIStackFrame_get_Language(p, aLanguage) ((p)->lpVtbl->GetLanguge(p, aLanguage))
|
---|
| 1074 | #define nsIStackFrame_GetLanguage(p, aLanguage) ((p)->lpVtbl->GetLanguge(p, aLanguage))
|
---|
| 1075 | #define nsIStackFrame_get_LanguageName(p, aLanguageName) ((p)->lpVtbl->GetLanguageName(p, aLanguageName))
|
---|
| 1076 | #define nsIStackFrame_GetLanguageName(p, aLanguageName) ((p)->lpVtbl->GetLanguageName(p, aLanguageName))
|
---|
| 1077 | #define nsIStackFrame_get_Filename(p, aFilename) ((p)->lpVtbl->GetFilename(p, aFilename))
|
---|
| 1078 | #define nsIStackFrame_GetFilename(p, aFilename) ((p)->lpVtbl->GetFilename(p, aFilename))
|
---|
| 1079 | #define nsIStackFrame_get_Name(p, aName) ((p)->lpVtbl->GetName(p, aName))
|
---|
| 1080 | #define nsIStackFrame_GetName(p, aName) ((p)->lpVtbl->GetName(p, aName))
|
---|
| 1081 | #define nsIStackFrame_get_LineNumber(p, aLineNumber) ((p)->lpVtbl->GetLineNumber(p, aLineNumber))
|
---|
| 1082 | #define nsIStackFrame_GetLineNumber(p, aLineNumber) ((p)->lpVtbl->GetLineNumber(p, aLineNumber))
|
---|
| 1083 | #define nsIStackFrame_get_SourceLine(p, aSourceLine) ((p)->lpVtbl->GetSourceLine(p, aSourceLine))
|
---|
| 1084 | #define nsIStackFrame_GetSourceLine(p, aSourceLine) ((p)->lpVtbl->GetSourceLine(p, aSourceLine))
|
---|
| 1085 | #define nsIStackFrame_get_Caller(p, aCaller) ((p)->lpVtbl->GetCaller(p, aCaller))
|
---|
| 1086 | #define nsIStackFrame_GetCaller(p, aCaller) ((p)->lpVtbl->GetCaller(p, aCaller))
|
---|
| 1087 | #define nsIStackFrame_ToString(p, retval) ((p)->lpVtbl->ToString(p, retval))
|
---|
| 1088 | #endif /* !VBOX_WITH_GLUE */
|
---|
[16406] | 1089 |
|
---|
[50254] | 1090 | interface nsIStackFrame
|
---|
[50183] | 1091 | {
|
---|
| 1092 | #ifndef VBOX_WITH_GLUE
|
---|
[16406] | 1093 | struct nsIStackFrame_vtbl *vtbl;
|
---|
[50183] | 1094 | #else /* !VBOX_WITH_GLUE */
|
---|
[50254] | 1095 | CONST_VTBL struct nsIStackFrameVtbl *lpVtbl;
|
---|
[50183] | 1096 | #endif /* !VBOX_WITH_GLUE */
|
---|
[16406] | 1097 | };
|
---|
| 1098 |
|
---|
[18998] | 1099 | /* starting interface: nsIEventTarget */
|
---|
| 1100 | #define NS_IEVENTTARGET_IID_STR "ea99ad5b-cc67-4efb-97c9-2ef620a59f2a"
|
---|
| 1101 |
|
---|
| 1102 | #define NS_IEVENTTARGET_IID \
|
---|
[50183] | 1103 | {0xea99ad5b, 0xcc67, 0x4efb, \
|
---|
| 1104 | { 0x97, 0xc9, 0x2e, 0xf6, 0x20, 0xa5, 0x9f, 0x2a }}
|
---|
[18998] | 1105 |
|
---|
[50183] | 1106 | #ifndef VBOX_WITH_GLUE
|
---|
| 1107 | struct nsIEventTarget_vtbl
|
---|
| 1108 | {
|
---|
[18998] | 1109 | struct nsISupports_vtbl nsisupports;
|
---|
| 1110 |
|
---|
| 1111 | nsresult (*PostEvent)(nsIEventTarget *pThis, PLEvent * aEvent);
|
---|
[50183] | 1112 | nsresult (*IsOnCurrentThread)(nsIEventTarget *pThis, PRBool *_retval);
|
---|
| 1113 | };
|
---|
| 1114 | #else /* !VBOX_WITH_GLUE */
|
---|
| 1115 | struct nsIEventTargetVtbl
|
---|
| 1116 | {
|
---|
| 1117 | nsresult (*QueryInterface)(nsIEventTarget *pThis, const nsID *iid, void **resultp);
|
---|
| 1118 | nsrefcnt (*AddRef)(nsIEventTarget *pThis);
|
---|
| 1119 | nsrefcnt (*Release)(nsIEventTarget *pThis);
|
---|
[18998] | 1120 |
|
---|
[50183] | 1121 | nsresult (*PostEvent)(nsIEventTarget *pThis, PLEvent * aEvent);
|
---|
[18998] | 1122 | nsresult (*IsOnCurrentThread)(nsIEventTarget *pThis, PRBool *_retval);
|
---|
| 1123 | };
|
---|
[50183] | 1124 | #define nsIEventTarget_QueryInterface(p, iid, resultp) ((p)->lpVtbl->QueryInterface(p, iid, resultp))
|
---|
| 1125 | #define nsIEventTarget_AddRef(p) ((p)->lpVtbl->AddRef(p))
|
---|
| 1126 | #define nsIEventTarget_Release(p) ((p)->lpVtbl->Release(p))
|
---|
| 1127 | #define nsIEventTarget_PostEvent(p, aEvent) ((p)->lpVtbl->PostEvent(p, aEvent))
|
---|
| 1128 | #define nsIEventTarget_IsOnCurrentThread(p, retval) ((p)->lpVtbl->IsOnCurrentThread(p, retval))
|
---|
| 1129 | #endif /* !VBOX_WITH_GLUE */
|
---|
[18998] | 1130 |
|
---|
[50254] | 1131 | interface nsIEventTarget
|
---|
[50183] | 1132 | {
|
---|
| 1133 | #ifndef VBOX_WITH_GLUE
|
---|
[18998] | 1134 | struct nsIEventTarget_vtbl *vtbl;
|
---|
[50183] | 1135 | #else /* !VBOX_WITH_GLUE */
|
---|
[50254] | 1136 | CONST_VTBL struct nsIEventTargetVtbl *lpVtbl;
|
---|
[50183] | 1137 | #endif /* !VBOX_WITH_GLUE */
|
---|
[18998] | 1138 | };
|
---|
| 1139 |
|
---|
| 1140 | /* starting interface: nsIEventQueue */
|
---|
| 1141 | #define NS_IEVENTQUEUE_IID_STR "176afb41-00a4-11d3-9f2a-00400553eef0"
|
---|
| 1142 |
|
---|
| 1143 | #define NS_IEVENTQUEUE_IID \
|
---|
| 1144 | {0x176afb41, 0x00a4, 0x11d3, \
|
---|
| 1145 | { 0x9f, 0x2a, 0x00, 0x40, 0x05, 0x53, 0xee, 0xf0 }}
|
---|
| 1146 |
|
---|
[50183] | 1147 | #ifndef VBOX_WITH_GLUE
|
---|
| 1148 | struct nsIEventQueue_vtbl
|
---|
| 1149 | {
|
---|
[18998] | 1150 | struct nsIEventTarget_vtbl nsieventtarget;
|
---|
| 1151 |
|
---|
| 1152 | nsresult (*InitEvent)(nsIEventQueue *pThis, PLEvent * aEvent, void * owner, PLHandleEventProc handler, PLDestroyEventProc destructor);
|
---|
[50183] | 1153 | nsresult (*PostSynchronousEvent)(nsIEventQueue *pThis, PLEvent * aEvent, void * *aResult);
|
---|
| 1154 | nsresult (*PendingEvents)(nsIEventQueue *pThis, PRBool *_retval);
|
---|
| 1155 | nsresult (*ProcessPendingEvents)(nsIEventQueue *pThis);
|
---|
| 1156 | nsresult (*EventLoop)(nsIEventQueue *pThis);
|
---|
| 1157 | nsresult (*EventAvailable)(nsIEventQueue *pThis, PRBool *aResult);
|
---|
| 1158 | nsresult (*GetEvent)(nsIEventQueue *pThis, PLEvent * *_retval);
|
---|
| 1159 | nsresult (*HandleEvent)(nsIEventQueue *pThis, PLEvent * aEvent);
|
---|
| 1160 | nsresult (*WaitForEvent)(nsIEventQueue *pThis, PLEvent * *_retval);
|
---|
| 1161 | PRInt32 (*GetEventQueueSelectFD)(nsIEventQueue *pThis);
|
---|
| 1162 | nsresult (*Init)(nsIEventQueue *pThis, PRBool aNative);
|
---|
| 1163 | nsresult (*InitFromPRThread)(nsIEventQueue *pThis, PRThread * thread, PRBool aNative);
|
---|
| 1164 | nsresult (*InitFromPLQueue)(nsIEventQueue *pThis, PLEventQueue * aQueue);
|
---|
| 1165 | nsresult (*EnterMonitor)(nsIEventQueue *pThis);
|
---|
| 1166 | nsresult (*ExitMonitor)(nsIEventQueue *pThis);
|
---|
| 1167 | nsresult (*RevokeEvents)(nsIEventQueue *pThis, void * owner);
|
---|
| 1168 | nsresult (*GetPLEventQueue)(nsIEventQueue *pThis, PLEventQueue * *_retval);
|
---|
| 1169 | nsresult (*IsQueueNative)(nsIEventQueue *pThis, PRBool *_retval);
|
---|
| 1170 | nsresult (*StopAcceptingEvents)(nsIEventQueue *pThis);
|
---|
| 1171 | };
|
---|
| 1172 | #else /* !VBOX_WITH_GLUE */
|
---|
| 1173 | struct nsIEventQueueVtbl
|
---|
| 1174 | {
|
---|
| 1175 | nsresult (*QueryInterface)(nsIEventQueue *pThis, const nsID *iid, void **resultp);
|
---|
| 1176 | nsrefcnt (*AddRef)(nsIEventQueue *pThis);
|
---|
| 1177 | nsrefcnt (*Release)(nsIEventQueue *pThis);
|
---|
[18998] | 1178 |
|
---|
[50183] | 1179 | nsresult (*PostEvent)(nsIEventQueue *pThis, PLEvent * aEvent);
|
---|
| 1180 | nsresult (*IsOnCurrentThread)(nsIEventQueue *pThis, PRBool *_retval);
|
---|
| 1181 |
|
---|
| 1182 | nsresult (*InitEvent)(nsIEventQueue *pThis, PLEvent * aEvent, void * owner, PLHandleEventProc handler, PLDestroyEventProc destructor);
|
---|
[18998] | 1183 | nsresult (*PostSynchronousEvent)(nsIEventQueue *pThis, PLEvent * aEvent, void * *aResult);
|
---|
| 1184 | nsresult (*PendingEvents)(nsIEventQueue *pThis, PRBool *_retval);
|
---|
| 1185 | nsresult (*ProcessPendingEvents)(nsIEventQueue *pThis);
|
---|
| 1186 | nsresult (*EventLoop)(nsIEventQueue *pThis);
|
---|
| 1187 | nsresult (*EventAvailable)(nsIEventQueue *pThis, PRBool *aResult);
|
---|
| 1188 | nsresult (*GetEvent)(nsIEventQueue *pThis, PLEvent * *_retval);
|
---|
| 1189 | nsresult (*HandleEvent)(nsIEventQueue *pThis, PLEvent * aEvent);
|
---|
| 1190 | nsresult (*WaitForEvent)(nsIEventQueue *pThis, PLEvent * *_retval);
|
---|
| 1191 | PRInt32 (*GetEventQueueSelectFD)(nsIEventQueue *pThis);
|
---|
| 1192 | nsresult (*Init)(nsIEventQueue *pThis, PRBool aNative);
|
---|
| 1193 | nsresult (*InitFromPRThread)(nsIEventQueue *pThis, PRThread * thread, PRBool aNative);
|
---|
| 1194 | nsresult (*InitFromPLQueue)(nsIEventQueue *pThis, PLEventQueue * aQueue);
|
---|
| 1195 | nsresult (*EnterMonitor)(nsIEventQueue *pThis);
|
---|
| 1196 | nsresult (*ExitMonitor)(nsIEventQueue *pThis);
|
---|
| 1197 | nsresult (*RevokeEvents)(nsIEventQueue *pThis, void * owner);
|
---|
| 1198 | nsresult (*GetPLEventQueue)(nsIEventQueue *pThis, PLEventQueue * *_retval);
|
---|
| 1199 | nsresult (*IsQueueNative)(nsIEventQueue *pThis, PRBool *_retval);
|
---|
| 1200 | nsresult (*StopAcceptingEvents)(nsIEventQueue *pThis);
|
---|
| 1201 | };
|
---|
[50183] | 1202 | #define nsIEventQueue_QueryInterface(p, iid, resultp) ((p)->lpVtbl->QueryInterface(p, iid, resultp))
|
---|
| 1203 | #define nsIEventQueue_AddRef(p) ((p)->lpVtbl->AddRef(p))
|
---|
| 1204 | #define nsIEventQueue_Release(p) ((p)->lpVtbl->Release(p))
|
---|
| 1205 | #define nsIEventQueue_PostEvent(p, aEvent) ((p)->lpVtbl->PostEvent(p, aEvent))
|
---|
| 1206 | #define nsIEventQueue_IsOnCurrentThread(p, retval) ((p)->lpVtbl->IsOnCurrentThread(p, retval))
|
---|
| 1207 | #define nsIEventQueue_InitEvent(p, aEvent, owner, handler, destructor) ((p)->lpVtbl->InitEvent(p, aEvent, owner, handler, destructor))
|
---|
| 1208 | #define nsIEventQueue_PostSynchronousEvent(p, aEvent, aResult) ((p)->lpVtbl->PostSynchronousEvent(p, aEvent, aResult))
|
---|
| 1209 | #define nsIEventQueue_ProcessPendingEvents(p) ((p)->lpVtbl->ProcessPendingEvents(p))
|
---|
| 1210 | #define nsIEventQueue_EventLoop(p) ((p)->lpVtbl->EventLoop(p))
|
---|
| 1211 | #define nsIEventQueue_EventAvailable(p, aResult) ((p)->lpVtbl->EventAvailable(p, aResult))
|
---|
| 1212 | #define nsIEventQueue_get_Event(p, aEvent) ((p)->lpVtbl->GetEvent(p, aEvent))
|
---|
| 1213 | #define nsIEventQueue_GetEvent(p, aEvent) ((p)->lpVtbl->GetEvent(p, aEvent))
|
---|
| 1214 | #define nsIEventQueue_HandleEvent(p, aEvent) ((p)->lpVtbl->HandleEvent(p, aEvent))
|
---|
| 1215 | #define nsIEventQueue_WaitForEvent(p, aEvent) ((p)->lpVtbl->WaitForEvent(p, aEvent))
|
---|
| 1216 | #define nsIEventQueue_GetEventQueueSelectFD(p) ((p)->lpVtbl->GetEventQueueSelectFD(p))
|
---|
| 1217 | #define nsIEventQueue_Init(p, aNative) ((p)->lpVtbl->Init(p, aNative))
|
---|
| 1218 | #define nsIEventQueue_InitFromPLQueue(p, aQueue) ((p)->lpVtbl->InitFromPLQueue(p, aQueue))
|
---|
| 1219 | #define nsIEventQueue_EnterMonitor(p) ((p)->lpVtbl->EnterMonitor(p))
|
---|
| 1220 | #define nsIEventQueue_ExitMonitor(p) ((p)->lpVtbl->ExitMonitor(p))
|
---|
| 1221 | #define nsIEventQueue_RevokeEvents(p, owner) ((p)->lpVtbl->RevokeEvents(p, owner))
|
---|
| 1222 | #define nsIEventQueue_GetPLEventQueue(p, retval) ((p)->lpVtbl->GetPLEventQueue(p, retval))
|
---|
| 1223 | #define nsIEventQueue_IsQueueNative(p, retval) ((p)->lpVtbl->IsQueueNative(p, retval))
|
---|
| 1224 | #define nsIEventQueue_StopAcceptingEvents(p) ((p)->lpVtbl->StopAcceptingEvents(p))
|
---|
| 1225 | #endif /* !VBOX_WITH_GLUE */
|
---|
[18998] | 1226 |
|
---|
[50254] | 1227 | interface nsIEventQueue
|
---|
[50183] | 1228 | {
|
---|
| 1229 | #ifndef VBOX_WITH_GLUE
|
---|
[18998] | 1230 | struct nsIEventQueue_vtbl *vtbl;
|
---|
[50183] | 1231 | #else /* !VBOX_WITH_GLUE */
|
---|
[50254] | 1232 | CONST_VTBL struct nsIEventQueueVtbl *lpVtbl;
|
---|
[50183] | 1233 | #endif /* !VBOX_WITH_GLUE */
|
---|
[18998] | 1234 | };
|
---|
[16406] | 1235 | </xsl:text>
|
---|
[53938] | 1236 | <xsl:call-template name="xsltprocNewlineOutputHack"/>
|
---|
[16406] | 1237 | <xsl:apply-templates/>
|
---|
[50183] | 1238 | <xsl:text>
|
---|
[17304] | 1239 |
|
---|
[50183] | 1240 | #endif /* __cplusplus */
|
---|
[17304] | 1241 |
|
---|
[50183] | 1242 | #endif /* !WIN32 */
|
---|
| 1243 |
|
---|
[17304] | 1244 | #ifdef __cplusplus
|
---|
[50183] | 1245 | extern "C"
|
---|
| 1246 | {
|
---|
| 1247 | #endif /* __cplusplus */
|
---|
[17304] | 1248 |
|
---|
| 1249 |
|
---|
| 1250 | /**
|
---|
| 1251 | * Function table for dynamic linking.
|
---|
[50183] | 1252 | * Use VBoxGetCAPIFunctions() to obtain the pointer to it.
|
---|
[17304] | 1253 | */
|
---|
[50183] | 1254 | typedef struct VBOXCAPI
|
---|
[17304] | 1255 | {
|
---|
| 1256 | /** The size of the structure. */
|
---|
| 1257 | unsigned cb;
|
---|
| 1258 | /** The structure version. */
|
---|
| 1259 | unsigned uVersion;
|
---|
[17837] | 1260 |
|
---|
[49539] | 1261 | /** Gets the VirtualBox version, major * 1000000 + minor * 1000 + patch. */
|
---|
[17837] | 1262 | unsigned int (*pfnGetVersion)(void);
|
---|
| 1263 |
|
---|
[49539] | 1264 | /** Gets the VirtualBox API version, major * 1000 + minor, e.g. 4003. */
|
---|
| 1265 | unsigned int (*pfnGetAPIVersion)(void);
|
---|
| 1266 |
|
---|
| 1267 | /**
|
---|
| 1268 | * New and preferred way to initialize the C bindings for an API client.
|
---|
| 1269 | *
|
---|
| 1270 | * This way is much more flexible, as it can easily handle multiple
|
---|
| 1271 | * sessions (important with more complicated API clients, including
|
---|
| 1272 | * multithreaded ones), and even VBoxSVC crashes can be detected and
|
---|
| 1273 | * processed appropriately by listening for events from the associated
|
---|
| 1274 | * event source in VirtualBoxClient. It is completely up to the client
|
---|
| 1275 | * to decide what to do (terminate or continue after getting new
|
---|
| 1276 | * object references to server-side objects). Must be called in the
|
---|
| 1277 | * primary thread of the client, later API use can be done in any
|
---|
| 1278 | * thread.
|
---|
| 1279 | *
|
---|
| 1280 | * Note that the returned reference is owned by the caller, and thus it's
|
---|
| 1281 | * the caller's responsibility to handle the reference count appropriately.
|
---|
| 1282 | *
|
---|
| 1283 | * @param pszVirtualBoxClientIID pass IVIRTUALBOXCLIENT_IID_STR
|
---|
| 1284 | * @param ppVirtualBoxClient output parameter for VirtualBoxClient
|
---|
[50183] | 1285 | * reference, handled as usual with COM/XPCOM.
|
---|
| 1286 | * @returns COM/XPCOM error code
|
---|
[49539] | 1287 | */
|
---|
[50183] | 1288 | HRESULT (*pfnClientInitialize)(const char *pszVirtualBoxClientIID,
|
---|
| 1289 | IVirtualBoxClient **ppVirtualBoxClient);
|
---|
[49539] | 1290 | /**
|
---|
[50183] | 1291 | * Initialize the use of the C bindings in a non-primary thread.
|
---|
| 1292 | *
|
---|
| 1293 | * Must be called on any newly created thread which wants to use the
|
---|
| 1294 | * VirtualBox API.
|
---|
| 1295 | *
|
---|
| 1296 | * @returns COM/XPCOM error code
|
---|
| 1297 | */
|
---|
| 1298 | HRESULT (*pfnClientThreadInitialize)(void);
|
---|
| 1299 | /**
|
---|
| 1300 | * Uninitialize the use of the C bindings in a non-primary thread.
|
---|
| 1301 | *
|
---|
| 1302 | * Should be called before terminating the thread which initialized the
|
---|
| 1303 | * C bindings using pfnClientThreadInitialize.
|
---|
| 1304 | *
|
---|
| 1305 | * @returns COM/XPCOM error code
|
---|
| 1306 | */
|
---|
| 1307 | HRESULT (*pfnClientThreadUninitialize)(void);
|
---|
| 1308 | /**
|
---|
[49539] | 1309 | * Uninitialize the C bindings for an API client.
|
---|
| 1310 | *
|
---|
| 1311 | * Should be called when the API client is about to terminate and does
|
---|
| 1312 | * not want to use the C bindings any more. It will invalidate all
|
---|
| 1313 | * object references. It is possible, however, to change one's mind,
|
---|
| 1314 | * and call pfnClientInitialize again to continue using the API, as long
|
---|
| 1315 | * as none of the object references from before the re-initialization
|
---|
| 1316 | * are used. Must be called from the primary thread of the client.
|
---|
| 1317 | */
|
---|
| 1318 | void (*pfnClientUninitialize)(void);
|
---|
| 1319 |
|
---|
| 1320 | /**
|
---|
| 1321 | * Deprecated way to initialize the C bindings and getting important
|
---|
| 1322 | * object references. Kept for backwards compatibility.
|
---|
| 1323 | *
|
---|
| 1324 | * If any returned reference is NULL then the initialization failed.
|
---|
| 1325 | * Note that the returned references are owned by the C bindings. The
|
---|
| 1326 | * number of calls to Release in the client code must match the number
|
---|
| 1327 | * of calls to AddRef, and additionally at no point in time there can
|
---|
| 1328 | * be more Release calls than AddRef calls.
|
---|
| 1329 | *
|
---|
| 1330 | * @param pszVirtualBoxIID pass IVIRTUALBOX_IID_STR
|
---|
| 1331 | * @param ppVirtualBox output parameter for VirtualBox reference,
|
---|
| 1332 | * owned by C bindings
|
---|
| 1333 | * @param pszSessionIID pass ISESSION_IID_STR
|
---|
| 1334 | * @param ppSession output parameter for Session reference,
|
---|
| 1335 | * owned by C bindings
|
---|
| 1336 | */
|
---|
[50930] | 1337 | void (*pfnComInitialize)(const char *pszVirtualBoxIID,
|
---|
| 1338 | IVirtualBox **ppVirtualBox,
|
---|
| 1339 | const char *pszSessionIID,
|
---|
| 1340 | ISession **ppSession);
|
---|
[49539] | 1341 | /**
|
---|
| 1342 | * Deprecated way to uninitialize the C bindings for an API client.
|
---|
| 1343 | * Kept for backwards compatibility and must be used if the C bindings
|
---|
| 1344 | * were initialized using pfnComInitialize. */
|
---|
[19081] | 1345 | void (*pfnComUninitialize)(void);
|
---|
[17304] | 1346 |
|
---|
[49539] | 1347 | /**
|
---|
[50183] | 1348 | * Free string managed by COM/XPCOM.
|
---|
[49539] | 1349 | *
|
---|
[50183] | 1350 | * @param pwsz pointer to string to be freed
|
---|
[49539] | 1351 | */
|
---|
[50930] | 1352 | void (*pfnComUnallocString)(BSTR pwsz);
|
---|
[50183] | 1353 | #ifndef WIN32
|
---|
| 1354 | /** Legacy function, was always for freeing strings only. */
|
---|
| 1355 | #define pfnComUnallocMem(pv) pfnComUnallocString((BSTR)(pv))
|
---|
| 1356 | #endif /* !WIN32 */
|
---|
[17304] | 1357 |
|
---|
[49539] | 1358 | /**
|
---|
| 1359 | * Convert string from UTF-16 encoding to UTF-8 encoding.
|
---|
| 1360 | *
|
---|
| 1361 | * @param pwszString input string
|
---|
| 1362 | * @param ppszString output string
|
---|
| 1363 | * @returns IPRT status code
|
---|
| 1364 | */
|
---|
[50930] | 1365 | int (*pfnUtf16ToUtf8)(CBSTR pwszString, char **ppszString);
|
---|
[49539] | 1366 | /**
|
---|
| 1367 | * Convert string from UTF-8 encoding to UTF-16 encoding.
|
---|
| 1368 | *
|
---|
| 1369 | * @param pszString input string
|
---|
| 1370 | * @param ppwszString output string
|
---|
| 1371 | * @returns IPRT status code
|
---|
| 1372 | */
|
---|
[50930] | 1373 | int (*pfnUtf8ToUtf16)(const char *pszString, BSTR *ppwszString);
|
---|
[49539] | 1374 | /**
|
---|
| 1375 | * Free memory returned by pfnUtf16ToUtf8. Do not use for anything else.
|
---|
| 1376 | *
|
---|
| 1377 | * @param pszString string to be freed.
|
---|
| 1378 | */
|
---|
[50930] | 1379 | void (*pfnUtf8Free)(char *pszString);
|
---|
[49539] | 1380 | /**
|
---|
| 1381 | * Free memory returned by pfnUtf8ToUtf16. Do not use for anything else.
|
---|
| 1382 | *
|
---|
| 1383 | * @param pwszString string to be freed.
|
---|
| 1384 | */
|
---|
[50930] | 1385 | void (*pfnUtf16Free)(BSTR pwszString);
|
---|
[17304] | 1386 |
|
---|
[49539] | 1387 | /**
|
---|
[50183] | 1388 | * Create a safearray (used for passing arrays to COM/XPCOM)
|
---|
[49539] | 1389 | *
|
---|
[50183] | 1390 | * Must be freed by pfnSafeArrayDestroy.
|
---|
| 1391 | *
|
---|
| 1392 | * @param vt variant type, defines the size of the elements
|
---|
| 1393 | * @param lLbound lower bound of the index, should be 0
|
---|
| 1394 | * @param cElements number of elements
|
---|
| 1395 | * @returns pointer to safearray
|
---|
| 1396 | */
|
---|
| 1397 | SAFEARRAY *(*pfnSafeArrayCreateVector)(VARTYPE vt, LONG lLbound, ULONG cElements);
|
---|
| 1398 | /**
|
---|
| 1399 | * Pre-allocate a safearray to be used by an out safearray parameter
|
---|
| 1400 | *
|
---|
| 1401 | * Must be freed by pfnSafeArrayDestroy.
|
---|
| 1402 | *
|
---|
| 1403 | * @returns pointer to safearray (system dependent, may be NULL if
|
---|
| 1404 | * there is no need to pre-allocate a safearray)
|
---|
| 1405 | */
|
---|
| 1406 | SAFEARRAY *(*pfnSafeArrayOutParamAlloc)(void);
|
---|
| 1407 | /**
|
---|
| 1408 | * Copy a C array into a safearray (for passing as an input parameter)
|
---|
| 1409 | *
|
---|
| 1410 | * @param psa pointer to already created safearray.
|
---|
| 1411 | * @param pv pointer to memory block to copy into safearray.
|
---|
| 1412 | * @param cb number of bytes to copy.
|
---|
| 1413 | * @returns COM/XPCOM error code
|
---|
| 1414 | */
|
---|
| 1415 | HRESULT (*pfnSafeArrayCopyInParamHelper)(SAFEARRAY *psa, const void *pv, ULONG cb);
|
---|
| 1416 | /**
|
---|
| 1417 | * Copy a safearray into a C array (for getting an output parameter)
|
---|
| 1418 | *
|
---|
| 1419 | * @param ppv output pointer to newly created array, which has to
|
---|
[50930] | 1420 | * be freed with pfnArrayOutFree.
|
---|
[50183] | 1421 | * @param pcb number of bytes in the output buffer.
|
---|
| 1422 | * @param vt variant type, defines the size of the elements
|
---|
| 1423 | * @param psa pointer to safearray for getting the data
|
---|
| 1424 | * @returns COM/XPCOM error code
|
---|
| 1425 | */
|
---|
| 1426 | HRESULT (*pfnSafeArrayCopyOutParamHelper)(void **ppv, ULONG *pcb, VARTYPE vt, SAFEARRAY *psa);
|
---|
| 1427 | /**
|
---|
| 1428 | * Copy a safearray into a C array (special variant for interface pointers)
|
---|
| 1429 | *
|
---|
| 1430 | * @param ppaObj output pointer to newly created array, which has
|
---|
[50930] | 1431 | * to be freed with pfnArrayOutFree. Note that it's the caller's
|
---|
[50183] | 1432 | * responsibility to call Release() on each non-NULL interface
|
---|
| 1433 | * pointer before freeing.
|
---|
| 1434 | * @param pcObj number of pointers in the output buffer.
|
---|
| 1435 | * @param psa pointer to safearray for getting the data
|
---|
| 1436 | * @returns COM/XPCOM error code
|
---|
| 1437 | */
|
---|
| 1438 | HRESULT (*pfnSafeArrayCopyOutIfaceParamHelper)(IUnknown ***ppaObj, ULONG *pcObj, SAFEARRAY *psa);
|
---|
| 1439 | /**
|
---|
| 1440 | * Free a safearray
|
---|
| 1441 | *
|
---|
[50930] | 1442 | * @param psa pointer to safearray
|
---|
[50183] | 1443 | * @returns COM/XPCOM error code
|
---|
| 1444 | */
|
---|
| 1445 | HRESULT (*pfnSafeArrayDestroy)(SAFEARRAY *psa);
|
---|
[50930] | 1446 | /**
|
---|
| 1447 | * Free an out array created by pfnSafeArrayCopyOutParamHelper or
|
---|
| 1448 | * pdnSafeArrayCopyOutIfaceParamHelper.
|
---|
| 1449 | *
|
---|
| 1450 | * @param psa pointer to memory block
|
---|
| 1451 | * @returns COM/XPCOM error code
|
---|
| 1452 | */
|
---|
| 1453 | HRESULT (*pfnArrayOutFree)(void *pv);
|
---|
[50183] | 1454 |
|
---|
| 1455 | #ifndef WIN32
|
---|
| 1456 | /**
|
---|
| 1457 | * Get XPCOM event queue. Deprecated!
|
---|
| 1458 | *
|
---|
[49539] | 1459 | * @param ppEventQueue output parameter for nsIEventQueue reference,
|
---|
| 1460 | * owned by C bindings.
|
---|
| 1461 | */
|
---|
[50930] | 1462 | void (*pfnGetEventQueue)(nsIEventQueue **ppEventQueue);
|
---|
[50183] | 1463 | #endif /* !WIN32 */
|
---|
[18998] | 1464 |
|
---|
[49539] | 1465 | /**
|
---|
[50183] | 1466 | * Get current COM/XPCOM exception.
|
---|
[49539] | 1467 | *
|
---|
[50183] | 1468 | * @param ppException output parameter for exception info reference,
|
---|
[49539] | 1469 | * may be @c NULL if no exception object has been created by
|
---|
[50183] | 1470 | * a previous COM/XPCOM call.
|
---|
| 1471 | * @returns COM/XPCOM error code
|
---|
[49539] | 1472 | */
|
---|
[50183] | 1473 | HRESULT (*pfnGetException)(IErrorInfo **ppException);
|
---|
[49539] | 1474 | /**
|
---|
[50183] | 1475 | * Clears current COM/XPCOM exception.
|
---|
[49539] | 1476 | *
|
---|
[50183] | 1477 | * @returns COM/XPCOM error code
|
---|
[49539] | 1478 | */
|
---|
[50183] | 1479 | HRESULT (*pfnClearException)(void);
|
---|
[49539] | 1480 |
|
---|
[50183] | 1481 | /**
|
---|
| 1482 | * Process the event queue for a given amount of time.
|
---|
| 1483 | *
|
---|
| 1484 | * Must be called on the primary thread. Typical timeouts are from 200 to
|
---|
| 1485 | * 5000 msecs, to allow for checking a volatile variable if the event queue
|
---|
| 1486 | * processing should be terminated (,
|
---|
| 1487 | * or 0 if only the pending events should be processed, without waiting.
|
---|
| 1488 | *
|
---|
| 1489 | * @param iTimeoutMS how long to process the event queue, -1 means
|
---|
| 1490 | * infinitely long
|
---|
| 1491 | * @returns status code
|
---|
| 1492 | * @retval 0 if at least one event has been processed
|
---|
| 1493 | * @retval 1 if any signal interrupted the native system call (or returned
|
---|
| 1494 | * otherwise)
|
---|
| 1495 | * @retval 2 if the event queue was explicitly interrupted
|
---|
| 1496 | * @retval 3 if the timeout expired
|
---|
| 1497 | * @retval 4 if the function was called from the wrong thread
|
---|
| 1498 | * @retval 5 for all other (unexpected) errors
|
---|
| 1499 | */
|
---|
| 1500 | int (*pfnProcessEventQueue)(LONG64 iTimeoutMS);
|
---|
| 1501 | /**
|
---|
| 1502 | * Interrupt event queue processing.
|
---|
| 1503 | *
|
---|
| 1504 | * Can be called on any thread. Note that this function is not async-signal
|
---|
| 1505 | * safe, so never use it in such a context, instead use a volatile global
|
---|
| 1506 | * variable and a sensible timeout.
|
---|
| 1507 | * @returns 0 if successful, 1 otherwise.
|
---|
| 1508 | */
|
---|
| 1509 | int (*pfnInterruptEventQueueProcessing)(void);
|
---|
| 1510 |
|
---|
[54027] | 1511 | /**
|
---|
| 1512 | * Clear memory used by a UTF-8 string. Must be zero terminated.
|
---|
| 1513 | * Can be used for any UTF-8 or ASCII/ANSI string.
|
---|
| 1514 | *
|
---|
| 1515 | * @param pszString input/output string
|
---|
| 1516 | */
|
---|
| 1517 | void (*pfnUtf8Clear)(char *pszString);
|
---|
| 1518 | /**
|
---|
| 1519 | * Clear memory used by a UTF-16 string. Must be zero terminated.
|
---|
| 1520 | * Can be used for any UTF-16 or UCS-2 string.
|
---|
| 1521 | *
|
---|
| 1522 | * @param pwszString input/output string
|
---|
| 1523 | */
|
---|
| 1524 | void (*pfnUtf16Clear)(BSTR pwszString);
|
---|
| 1525 |
|
---|
| 1526 | /** Tail version, same as uVersion.
|
---|
| 1527 | *
|
---|
| 1528 | * This should only be accessed if for some reason an API client needs
|
---|
| 1529 | * exactly the version it requested, or if cb is used to calculate the
|
---|
| 1530 | * address of this field. It may move as the structure before this is
|
---|
| 1531 | * allowed to grow as long as all the data from earlier minor versions
|
---|
| 1532 | * remains at the same place.
|
---|
| 1533 | */
|
---|
[17304] | 1534 | unsigned uEndVersion;
|
---|
[50183] | 1535 | } VBOXCAPI;
|
---|
| 1536 | /** Pointer to a const VBOXCAPI function table. */
|
---|
| 1537 | typedef VBOXCAPI const *PCVBOXCAPI;
|
---|
| 1538 | #ifndef WIN32
|
---|
| 1539 | /** Backwards compatibility: Pointer to a const VBOXCAPI function table.
|
---|
| 1540 | * Use PCVBOXCAPI instead. */
|
---|
| 1541 | typedef VBOXCAPI const *PCVBOXXPCOM;
|
---|
| 1542 | #endif /* !WIN32 */
|
---|
[17304] | 1543 |
|
---|
[50183] | 1544 | #ifndef WIN32
|
---|
| 1545 | /** Backwards compatibility: make sure old code using VBOXXPCOMC still compiles.
|
---|
| 1546 | * Use VBOXCAPI instead. */
|
---|
| 1547 | #define VBOXXPCOMC VBOXCAPI
|
---|
| 1548 | #endif /* !WIN32 */
|
---|
| 1549 |
|
---|
[54027] | 1550 | /** Extract the C API style major version.
|
---|
| 1551 | * Useful for comparing the interface version in VBOXCAPI::uVersion. */
|
---|
| 1552 | #define VBOX_CAPI_MAJOR(x) (((x) & 0xffff0000U) >> 16)
|
---|
| 1553 |
|
---|
| 1554 | /** Extract the C API style major version.
|
---|
| 1555 | * Useful for comparing the interface version in VBOXCAPI::uVersion. */
|
---|
| 1556 | #define VBOX_CAPI_MINOR(x) ((x) & 0x0000ffffU)
|
---|
| 1557 |
|
---|
[17304] | 1558 | /** The current interface version.
|
---|
[50183] | 1559 | * For use with VBoxGetCAPIFunctions and to be found in VBOXCAPI::uVersion. */
|
---|
[54027] | 1560 | #define VBOX_CAPI_VERSION 0x00040001U
|
---|
[17304] | 1561 |
|
---|
[50183] | 1562 | #ifndef WIN32
|
---|
| 1563 | /** Backwards compatibility: The current interface version.
|
---|
| 1564 | * Use VBOX_CAPI_VERSION instead. */
|
---|
| 1565 | #define VBOX_XPCOMC_VERSION VBOX_CAPI_VERSION
|
---|
| 1566 | #endif /* !WIN32 */
|
---|
[17304] | 1567 |
|
---|
[50183] | 1568 | /** VBoxGetCAPIFunctions. */
|
---|
| 1569 | VBOXCAPI_DECL(PCVBOXCAPI) VBoxGetCAPIFunctions(unsigned uVersion);
|
---|
| 1570 | #ifndef WIN32
|
---|
| 1571 | /** Backwards compatibility: VBoxGetXPCOMCFunctions.
|
---|
| 1572 | * Use VBoxGetCAPIFunctions instead. */
|
---|
| 1573 | VBOXCAPI_DECL(PCVBOXCAPI) VBoxGetXPCOMCFunctions(unsigned uVersion);
|
---|
| 1574 | #endif /* !WIN32 */
|
---|
[17304] | 1575 |
|
---|
[50183] | 1576 | /** Typedef for VBoxGetCAPIFunctions. */
|
---|
| 1577 | typedef PCVBOXCAPI (*PFNVBOXGETCAPIFUNCTIONS)(unsigned uVersion);
|
---|
| 1578 | #ifndef WIN32
|
---|
| 1579 | /** Backwards compatibility: Typedef for VBoxGetXPCOMCFunctions.
|
---|
| 1580 | * Use PFNVBOXGETCAPIFUNCTIONS instead. */
|
---|
| 1581 | typedef PCVBOXCAPI (*PFNVBOXGETXPCOMCFUNCTIONS)(unsigned uVersion);
|
---|
| 1582 | #endif /* !WIN32 */
|
---|
[17304] | 1583 |
|
---|
[50183] | 1584 | /** The symbol name of VBoxGetCAPIFunctions. */
|
---|
| 1585 | #ifdef __OS2__
|
---|
| 1586 | # define VBOX_GET_CAPI_FUNCTIONS_SYMBOL_NAME "_VBoxGetCAPIFunctions"
|
---|
| 1587 | #else /* !__OS2__ */
|
---|
| 1588 | # define VBOX_GET_CAPI_FUNCTIONS_SYMBOL_NAME "VBoxGetCAPIFunctions"
|
---|
| 1589 | #endif /* !__OS2__ */
|
---|
| 1590 | #ifndef WIN32
|
---|
| 1591 | /** Backwards compatibility: The symbol name of VBoxGetXPCOMCFunctions.
|
---|
| 1592 | * Use VBOX_GET_CAPI_FUNCTIONS_SYMBOL_NAME instead. */
|
---|
| 1593 | # ifdef __OS2__
|
---|
| 1594 | # define VBOX_GET_XPCOMC_FUNCTIONS_SYMBOL_NAME "_VBoxGetXPCOMCFunctions"
|
---|
| 1595 | # else /* !__OS2__ */
|
---|
| 1596 | # define VBOX_GET_XPCOMC_FUNCTIONS_SYMBOL_NAME "VBoxGetXPCOMCFunctions"
|
---|
| 1597 | # endif /* !__OS2__ */
|
---|
| 1598 | #endif /* !WIN32 */
|
---|
| 1599 |
|
---|
| 1600 |
|
---|
[17304] | 1601 | #ifdef __cplusplus
|
---|
| 1602 | }
|
---|
[50183] | 1603 | #endif /* __cplusplus */
|
---|
[17304] | 1604 |
|
---|
[50183] | 1605 | #endif /* !___VirtualBox_CAPI_h */
|
---|
[17304] | 1606 | </xsl:text>
|
---|
[16406] | 1607 | </xsl:template>
|
---|
| 1608 |
|
---|
| 1609 | <!--
|
---|
| 1610 | * ignore all |if|s except those for XPIDL target
|
---|
[50183] | 1611 | -->
|
---|
[16406] | 1612 | <xsl:template match="if">
|
---|
| 1613 | <xsl:if test="@target='xpidl'">
|
---|
| 1614 | <xsl:apply-templates/>
|
---|
| 1615 | </xsl:if>
|
---|
| 1616 | </xsl:template>
|
---|
| 1617 | <xsl:template match="if" mode="forward">
|
---|
| 1618 | <xsl:if test="@target='xpidl'">
|
---|
| 1619 | <xsl:apply-templates mode="forward"/>
|
---|
| 1620 | </xsl:if>
|
---|
| 1621 | </xsl:template>
|
---|
| 1622 | <xsl:template match="if" mode="forwarder">
|
---|
| 1623 | <xsl:if test="@target='midl'">
|
---|
| 1624 | <xsl:apply-templates mode="forwarder"/>
|
---|
| 1625 | </xsl:if>
|
---|
| 1626 | </xsl:template>
|
---|
| 1627 |
|
---|
| 1628 |
|
---|
| 1629 | <!--
|
---|
| 1630 | * libraries
|
---|
| 1631 | -->
|
---|
[66274] | 1632 | <xsl:template match="idl/library">
|
---|
[16406] | 1633 | <!-- result codes -->
|
---|
[53938] | 1634 | <xsl:call-template name="xsltprocNewlineOutputHack"/>
|
---|
[66274] | 1635 | <xsl:for-each select="application/result">
|
---|
[16406] | 1636 | <xsl:apply-templates select="."/>
|
---|
| 1637 | </xsl:for-each>
|
---|
[53938] | 1638 | <xsl:call-template name="xsltprocNewlineOutputHack"/>
|
---|
| 1639 | <xsl:call-template name="xsltprocNewlineOutputHack"/>
|
---|
[16406] | 1640 | <!-- forward declarations -->
|
---|
[66274] | 1641 | <xsl:apply-templates select="application/interface | application/if/interface" mode="forward"/>
|
---|
[53938] | 1642 | <xsl:call-template name="xsltprocNewlineOutputHack"/>
|
---|
[16406] | 1643 | <!-- typedef'ing the struct declarations -->
|
---|
[66274] | 1644 | <xsl:apply-templates select="application/interface | application/if/interface" mode="typedef"/>
|
---|
[53938] | 1645 | <xsl:call-template name="xsltprocNewlineOutputHack"/>
|
---|
[16406] | 1646 | <!-- all enums go first -->
|
---|
[66274] | 1647 | <xsl:apply-templates select="application/enum | application/if/enum"/>
|
---|
[69377] | 1648 | <!-- everything else but result codes and enums
|
---|
[16406] | 1649 | <xsl:apply-templates select="*[not(self::result or self::enum) and
|
---|
[66274] | 1650 | not(self::if[result] or self::if[enum])]"/> -->
|
---|
| 1651 | <!-- the modules (i.e. everything else) -->
|
---|
| 1652 | <xsl:apply-templates select="application/interface | application/if[interface]
|
---|
| 1653 | | application/module | application/if[module]"/>
|
---|
[16406] | 1654 | <!-- -->
|
---|
| 1655 | </xsl:template>
|
---|
| 1656 |
|
---|
| 1657 |
|
---|
| 1658 | <!--
|
---|
| 1659 | * result codes
|
---|
| 1660 | -->
|
---|
| 1661 | <xsl:template match="result">
|
---|
[61958] | 1662 | <xsl:value-of select="concat('#define ',@name,' ((HRESULT)',@value, ')')"/>
|
---|
[16406] | 1663 | <xsl:text>
</xsl:text>
|
---|
| 1664 | </xsl:template>
|
---|
| 1665 |
|
---|
| 1666 |
|
---|
| 1667 | <!--
|
---|
| 1668 | * forward declarations
|
---|
| 1669 | -->
|
---|
[23223] | 1670 | <xsl:template match="interface" mode="forward">
|
---|
[50183] | 1671 | <xsl:if test="not(@internal='yes')">
|
---|
[50254] | 1672 | <xsl:text>interface </xsl:text>
|
---|
[50183] | 1673 | <xsl:value-of select="@name"/>
|
---|
| 1674 | <xsl:text>;
</xsl:text>
|
---|
| 1675 | </xsl:if>
|
---|
[16406] | 1676 | </xsl:template>
|
---|
| 1677 |
|
---|
| 1678 |
|
---|
| 1679 | <!--
|
---|
| 1680 | * typedef'ing the struct declarations
|
---|
| 1681 | -->
|
---|
[23223] | 1682 | <xsl:template match="interface" mode="typedef">
|
---|
[50183] | 1683 | <xsl:if test="not(@internal='yes')">
|
---|
[50254] | 1684 | <xsl:text>typedef interface </xsl:text>
|
---|
[50183] | 1685 | <xsl:value-of select="@name"/>
|
---|
| 1686 | <xsl:text> </xsl:text>
|
---|
| 1687 | <xsl:value-of select="@name"/>
|
---|
| 1688 | <xsl:text>;
</xsl:text>
|
---|
| 1689 | </xsl:if>
|
---|
[16406] | 1690 | </xsl:template>
|
---|
| 1691 |
|
---|
| 1692 |
|
---|
| 1693 | <!--
|
---|
[50183] | 1694 | * COBJMACRO style convenience macros for calling methods
|
---|
[16406] | 1695 | -->
|
---|
[50183] | 1696 | <xsl:template match="interface" mode="cobjmacro">
|
---|
| 1697 | <xsl:param name="iface"/>
|
---|
| 1698 |
|
---|
| 1699 | <xsl:variable name="extends" select="@extends"/>
|
---|
[16406] | 1700 | <xsl:choose>
|
---|
[50183] | 1701 | <xsl:when test="$extends='$unknown'">
|
---|
| 1702 | <xsl:text>#define </xsl:text>
|
---|
| 1703 | <xsl:value-of select="$iface"/>
|
---|
| 1704 | <xsl:text>_QueryInterface(p, iid, resultp) ((p)->lpVtbl->QueryInterface(p, iid, resultp))
</xsl:text>
|
---|
| 1705 | <xsl:text>#define </xsl:text>
|
---|
| 1706 | <xsl:value-of select="$iface"/>
|
---|
| 1707 | <xsl:text>_AddRef(p) ((p)->lpVtbl->AddRef(p))
</xsl:text>
|
---|
| 1708 | <xsl:text>#define </xsl:text>
|
---|
| 1709 | <xsl:value-of select="$iface"/>
|
---|
| 1710 | <xsl:text>_Release(p) ((p)->lpVtbl->Release(p))
</xsl:text>
|
---|
| 1711 | </xsl:when>
|
---|
| 1712 | <xsl:when test="$extends='$errorinfo'">
|
---|
| 1713 | <xsl:text>#define </xsl:text>
|
---|
| 1714 | <xsl:value-of select="$iface"/>
|
---|
| 1715 | <xsl:text>_QueryInterface(p, iid, resultp) ((p)->lpVtbl->QueryInterface(p, iid, resultp))
</xsl:text>
|
---|
| 1716 | <xsl:text>#define </xsl:text>
|
---|
| 1717 | <xsl:value-of select="$iface"/>
|
---|
| 1718 | <xsl:text>_AddRef(p) ((p)->lpVtbl->AddRef(p))
</xsl:text>
|
---|
| 1719 | <xsl:text>#define </xsl:text>
|
---|
| 1720 | <xsl:value-of select="$iface"/>
|
---|
| 1721 | <xsl:text>_Release(p) ((p)->lpVtbl->Release(p))
</xsl:text>
|
---|
| 1722 | <xsl:text>#define </xsl:text>
|
---|
| 1723 | <xsl:value-of select="$iface"/>
|
---|
| 1724 | <xsl:text>_get_Message(p, aMessage) ((p)->lpVtbl->GetMessage(p, aMessage))
</xsl:text>
|
---|
| 1725 | <xsl:text>#define </xsl:text>
|
---|
| 1726 | <xsl:value-of select="$iface"/>
|
---|
| 1727 | <xsl:text>_GetMessage(p, aMessage) ((p)->lpVtbl->GetMessage(p, aMessage))
</xsl:text>
|
---|
| 1728 | <xsl:text>#define </xsl:text>
|
---|
| 1729 | <xsl:value-of select="$iface"/>
|
---|
| 1730 | <xsl:text>_get_Result(p, aResult) ((p)->lpVtbl->GetResult(p, aResult))
</xsl:text>
|
---|
| 1731 | <xsl:text>#define </xsl:text>
|
---|
| 1732 | <xsl:value-of select="$iface"/>
|
---|
| 1733 | <xsl:text>_GetResult(p, aResult) ((p)->lpVtbl->GetResult(p, aResult))
</xsl:text>
|
---|
| 1734 | <xsl:text>#define </xsl:text>
|
---|
| 1735 | <xsl:value-of select="$iface"/>
|
---|
| 1736 | <xsl:text>_get_Name(p, aName) ((p)->lpVtbl->GetName(p, aName))
</xsl:text>
|
---|
| 1737 | <xsl:text>#define </xsl:text>
|
---|
| 1738 | <xsl:value-of select="$iface"/>
|
---|
| 1739 | <xsl:text>_GetName(p, aName) ((p)->lpVtbl->GetName(p, aName))
</xsl:text>
|
---|
| 1740 | <xsl:text>#define </xsl:text>
|
---|
| 1741 | <xsl:value-of select="$iface"/>
|
---|
| 1742 | <xsl:text>_get_Filename(p, aFilename) ((p)->lpVtbl->GetFilename(p, aFilename))
</xsl:text>
|
---|
| 1743 | <xsl:text>#define </xsl:text>
|
---|
| 1744 | <xsl:value-of select="$iface"/>
|
---|
| 1745 | <xsl:text>_GetFilename(p, aFilename) ((p)->lpVtbl->GetFilename(p, aFilename))
</xsl:text>
|
---|
| 1746 | <xsl:text>#define </xsl:text>
|
---|
| 1747 | <xsl:value-of select="$iface"/>
|
---|
| 1748 | <xsl:text>_get_LineNumber(p, aLineNumber) ((p)->lpVtbl->GetLineNumber(p, aLineNumber))
</xsl:text>
|
---|
| 1749 | <xsl:text>#define </xsl:text>
|
---|
| 1750 | <xsl:value-of select="$iface"/>
|
---|
| 1751 | <xsl:text>_GetLineNumber(p, aLineNumber) ((p)->lpVtbl->GetLineNumber(p, aLineNumber))
</xsl:text>
|
---|
| 1752 | <xsl:text>#define </xsl:text>
|
---|
| 1753 | <xsl:value-of select="$iface"/>
|
---|
| 1754 | <xsl:text>_get_ColumnNumber(p, aColumnNumber) ((p)->lpVtbl->GetColumnNumber(p, aColumnNumber))
</xsl:text>
|
---|
| 1755 | <xsl:text>#define </xsl:text>
|
---|
| 1756 | <xsl:value-of select="$iface"/>
|
---|
| 1757 | <xsl:text>_GetColumnNumber(p, aColumnNumber) ((p)->lpVtbl->GetColumnNumber(p, aColumnNumber))
</xsl:text>
|
---|
| 1758 | <xsl:text>#define </xsl:text>
|
---|
| 1759 | <xsl:value-of select="$iface"/>
|
---|
| 1760 | <xsl:text>_get_Location(p, aLocation) ((p)->lpVtbl->GetLocation(p, aLocation))
</xsl:text>
|
---|
| 1761 | <xsl:text>#define </xsl:text>
|
---|
| 1762 | <xsl:value-of select="$iface"/>
|
---|
| 1763 | <xsl:text>_GetLocation(p, aLocation) ((p)->lpVtbl->GetLocation(p, aLocation))
</xsl:text>
|
---|
| 1764 | <xsl:text>#define </xsl:text>
|
---|
| 1765 | <xsl:value-of select="$iface"/>
|
---|
| 1766 | <xsl:text>_get_Inner(p, aInner) ((p)->lpVtbl->GetInner(p, aInner))
</xsl:text>
|
---|
| 1767 | <xsl:text>#define </xsl:text>
|
---|
| 1768 | <xsl:value-of select="$iface"/>
|
---|
| 1769 | <xsl:text>_GetInner(p, aInner) ((p)->lpVtbl->GetInner(p, aInner))
</xsl:text>
|
---|
| 1770 | <xsl:text>#define </xsl:text>
|
---|
| 1771 | <xsl:value-of select="$iface"/>
|
---|
| 1772 | <xsl:text>_get_Data(p, aData) ((p)->lpVtbl->GetData(p, aData))
</xsl:text>
|
---|
| 1773 | <xsl:text>#define </xsl:text>
|
---|
| 1774 | <xsl:value-of select="$iface"/>
|
---|
| 1775 | <xsl:text>_GetData(p, aData) ((p)->lpVtbl->GetData(p, aData))
</xsl:text>
|
---|
| 1776 | <xsl:text>#define </xsl:text>
|
---|
| 1777 | <xsl:value-of select="$iface"/>
|
---|
| 1778 | <xsl:text>_ToString(p, retval) ((p)->lpVtbl->ToString(p, retval))
</xsl:text>
|
---|
| 1779 | </xsl:when>
|
---|
[16406] | 1780 | <xsl:otherwise>
|
---|
[53938] | 1781 | <xsl:apply-templates select="key('G_keyInterfacesByName', $extends)" mode="cobjmacro">
|
---|
[50183] | 1782 | <xsl:with-param name="iface" select="$iface"/>
|
---|
| 1783 | </xsl:apply-templates>
|
---|
[16406] | 1784 | </xsl:otherwise>
|
---|
| 1785 | </xsl:choose>
|
---|
| 1786 | <!-- attributes (properties) -->
|
---|
[50183] | 1787 | <xsl:apply-templates select="attribute | if/attribute" mode="cobjmacro">
|
---|
| 1788 | <xsl:with-param name="iface" select="$iface"/>
|
---|
| 1789 | </xsl:apply-templates>
|
---|
[16406] | 1790 | <!-- methods -->
|
---|
[50183] | 1791 | <xsl:apply-templates select="method | if/method" mode="cobjmacro">
|
---|
| 1792 | <xsl:with-param name="iface" select="$iface"/>
|
---|
| 1793 | </xsl:apply-templates>
|
---|
[16406] | 1794 | </xsl:template>
|
---|
| 1795 |
|
---|
| 1796 |
|
---|
| 1797 | <!--
|
---|
[50183] | 1798 | * emit flat vtable, compatible with COM
|
---|
| 1799 | -->
|
---|
| 1800 | <xsl:template match="interface" mode="vtab_flat">
|
---|
| 1801 | <xsl:param name="iface"/>
|
---|
| 1802 |
|
---|
[56396] | 1803 | <xsl:variable name="name" select="@name"/>
|
---|
[50183] | 1804 | <xsl:variable name="extends" select="@extends"/>
|
---|
| 1805 | <xsl:choose>
|
---|
| 1806 | <xsl:when test="$extends='$unknown'">
|
---|
| 1807 | <xsl:text> nsresult (*QueryInterface)(</xsl:text>
|
---|
| 1808 | <xsl:value-of select="$iface"/>
|
---|
| 1809 | <xsl:text> *pThis, const nsID *iid, void **resultp);
</xsl:text>
|
---|
| 1810 | <xsl:text> nsrefcnt (*AddRef)(</xsl:text>
|
---|
| 1811 | <xsl:value-of select="$iface"/>
|
---|
| 1812 | <xsl:text> *pThis);
</xsl:text>
|
---|
| 1813 | <xsl:text> nsrefcnt (*Release)(</xsl:text>
|
---|
| 1814 | <xsl:value-of select="$iface"/>
|
---|
| 1815 | <xsl:text> *pThis);
</xsl:text>
|
---|
| 1816 | </xsl:when>
|
---|
| 1817 | <xsl:when test="$extends='$errorinfo'">
|
---|
| 1818 | <xsl:text> nsresult (*QueryInterface)(</xsl:text>
|
---|
| 1819 | <xsl:value-of select="$iface"/>
|
---|
| 1820 | <xsl:text> *pThis, const nsID *iid, void **resultp);
</xsl:text>
|
---|
| 1821 | <xsl:text> nsrefcnt (*AddRef)(</xsl:text>
|
---|
| 1822 | <xsl:value-of select="$iface"/>
|
---|
| 1823 | <xsl:text> *pThis);
</xsl:text>
|
---|
| 1824 | <xsl:text> nsrefcnt (*Release)(</xsl:text>
|
---|
| 1825 | <xsl:value-of select="$iface"/>
|
---|
| 1826 | <xsl:text> *pThis);
</xsl:text>
|
---|
| 1827 | <xsl:text> nsresult (*GetMessage)(</xsl:text>
|
---|
| 1828 | <xsl:value-of select="$iface"/>
|
---|
| 1829 | <xsl:text> *pThis, PRUnichar * *aMessage);
</xsl:text>
|
---|
| 1830 | <xsl:text> nsresult (*GetResult)(</xsl:text>
|
---|
| 1831 | <xsl:value-of select="$iface"/>
|
---|
| 1832 | <xsl:text> *pThis, nsresult *aResult);
</xsl:text>
|
---|
| 1833 | <xsl:text> nsresult (*GetName)(</xsl:text>
|
---|
| 1834 | <xsl:value-of select="$iface"/>
|
---|
| 1835 | <xsl:text>*pThis, PRUnichar * *aName);
</xsl:text>
|
---|
| 1836 | <xsl:text> nsresult (*GetFilename)(</xsl:text>
|
---|
| 1837 | <xsl:value-of select="$iface"/>
|
---|
| 1838 | <xsl:text> *pThis, PRUnichar * *aFilename);
</xsl:text>
|
---|
| 1839 | <xsl:text> nsresult (*GetLineNumber)(</xsl:text>
|
---|
| 1840 | <xsl:value-of select="$iface"/>
|
---|
| 1841 | <xsl:text> *pThis, PRUint32 *aLineNumber);
</xsl:text>
|
---|
| 1842 | <xsl:text> nsresult (*GetColumnNumber)(</xsl:text>
|
---|
| 1843 | <xsl:value-of select="$iface"/>
|
---|
| 1844 | <xsl:text> *pThis, PRUint32 *aColumnNumber);
</xsl:text>
|
---|
| 1845 | <xsl:text> nsresult (*GetLocation)(</xsl:text>
|
---|
| 1846 | <xsl:value-of select="$iface"/>
|
---|
| 1847 | <xsl:text> *pThis, nsIStackFrame * *aLocation);
</xsl:text>
|
---|
| 1848 | <xsl:text> nsresult (*GetInner)(</xsl:text>
|
---|
| 1849 | <xsl:value-of select="$iface"/>
|
---|
| 1850 | <xsl:text> *pThis, nsIException * *aInner);
</xsl:text>
|
---|
| 1851 | <xsl:text> nsresult (*GetData)(</xsl:text>
|
---|
| 1852 | <xsl:value-of select="$iface"/>
|
---|
| 1853 | <xsl:text> *pThis, nsISupports * *aData);
</xsl:text>
|
---|
| 1854 | <xsl:text> nsresult (*ToString)(</xsl:text>
|
---|
| 1855 | <xsl:value-of select="$iface"/>
|
---|
| 1856 | <xsl:text> *pThis, PRUnichar **_retval);
</xsl:text>
|
---|
| 1857 | </xsl:when>
|
---|
| 1858 | <xsl:otherwise>
|
---|
[53938] | 1859 | <xsl:apply-templates select="key('G_keyInterfacesByName', $extends)" mode="vtab_flat">
|
---|
[50183] | 1860 | <xsl:with-param name="iface" select="$iface"/>
|
---|
| 1861 | </xsl:apply-templates>
|
---|
| 1862 | </xsl:otherwise>
|
---|
| 1863 | </xsl:choose>
|
---|
| 1864 | <!-- attributes (properties) -->
|
---|
| 1865 | <xsl:apply-templates select="attribute | if/attribute">
|
---|
| 1866 | <xsl:with-param name="iface" select="$iface"/>
|
---|
| 1867 | </xsl:apply-templates>
|
---|
[56396] | 1868 | <xsl:variable name="reservedAttributes" select="@reservedAttributes"/>
|
---|
| 1869 | <xsl:if test="$reservedAttributes > 0">
|
---|
| 1870 | <!-- tricky way to do a "for" loop without recursion -->
|
---|
| 1871 | <xsl:for-each select="(//*)[position() <= $reservedAttributes]">
|
---|
| 1872 | <xsl:text> nsresult (*GetInternalAndReservedAttribute</xsl:text>
|
---|
| 1873 | <xsl:value-of select="concat(position(), $name)"/>
|
---|
| 1874 | <xsl:text>)(</xsl:text>
|
---|
| 1875 | <xsl:value-of select="$iface"/>
|
---|
[56679] | 1876 | <xsl:text> *pThis, PRUint32 *reserved);

</xsl:text>
|
---|
[56396] | 1877 | </xsl:for-each>
|
---|
| 1878 | </xsl:if>
|
---|
[50183] | 1879 | <!-- methods -->
|
---|
| 1880 | <xsl:apply-templates select="method | if/method">
|
---|
| 1881 | <xsl:with-param name="iface" select="$iface"/>
|
---|
| 1882 | </xsl:apply-templates>
|
---|
[56396] | 1883 | <xsl:variable name="reservedMethods" select="@reservedMethods"/>
|
---|
| 1884 | <xsl:if test="$reservedMethods > 0">
|
---|
| 1885 | <!-- tricky way to do a "for" loop without recursion -->
|
---|
| 1886 | <xsl:for-each select="(//*)[position() <= $reservedMethods]">
|
---|
| 1887 | <xsl:text> nsresult (*InternalAndReservedMethod</xsl:text>
|
---|
| 1888 | <xsl:value-of select="concat(position(), $name)"/>
|
---|
| 1889 | <xsl:text>)(</xsl:text>
|
---|
| 1890 | <xsl:value-of select="$iface"/>
|
---|
| 1891 | <xsl:text> *pThis);

</xsl:text>
|
---|
| 1892 | </xsl:for-each>
|
---|
| 1893 | </xsl:if>
|
---|
[50183] | 1894 | </xsl:template>
|
---|
| 1895 |
|
---|
| 1896 |
|
---|
| 1897 | <!--
|
---|
| 1898 | * interfaces
|
---|
| 1899 | -->
|
---|
| 1900 | <xsl:template match="interface">
|
---|
| 1901 | <xsl:if test="not(@internal='yes')">
|
---|
[56679] | 1902 | <xsl:variable name="name" select="@name"/>
|
---|
[50183] | 1903 | <xsl:text>/* Start of struct </xsl:text>
|
---|
[56679] | 1904 | <xsl:value-of select="$name"/>
|
---|
[50183] | 1905 | <xsl:text> declaration */
</xsl:text>
|
---|
| 1906 | <xsl:text>#define </xsl:text>
|
---|
[53938] | 1907 | <xsl:call-template name="string-to-upper">
|
---|
[56679] | 1908 | <xsl:with-param name="str" select="$name"/>
|
---|
[50183] | 1909 | </xsl:call-template>
|
---|
| 1910 | <xsl:value-of select="concat('_IID_STR "',@uuid,'"')"/>
|
---|
| 1911 | <xsl:text>
</xsl:text>
|
---|
| 1912 | <xsl:text>#define </xsl:text>
|
---|
[53938] | 1913 | <xsl:call-template name="string-to-upper">
|
---|
[56679] | 1914 | <xsl:with-param name="str" select="$name"/>
|
---|
[50183] | 1915 | </xsl:call-template>
|
---|
| 1916 | <xsl:text>_IID { \
</xsl:text>
|
---|
| 1917 | <xsl:text> 0x</xsl:text><xsl:value-of select="substring(@uuid,1,8)"/>
|
---|
| 1918 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,10,4)"/>
|
---|
| 1919 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,15,4)"/>
|
---|
| 1920 | <xsl:text>, \
 </xsl:text>
|
---|
| 1921 | <xsl:text>{ 0x</xsl:text><xsl:value-of select="substring(@uuid,20,2)"/>
|
---|
| 1922 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,22,2)"/>
|
---|
| 1923 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,25,2)"/>
|
---|
| 1924 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,27,2)"/>
|
---|
| 1925 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,29,2)"/>
|
---|
| 1926 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,31,2)"/>
|
---|
| 1927 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,33,2)"/>
|
---|
| 1928 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,35,2)"/>
|
---|
| 1929 | <xsl:text> } \
}
</xsl:text>
|
---|
| 1930 | <xsl:text>/* COM compatibility */
</xsl:text>
|
---|
| 1931 | <xsl:text>VBOX_EXTERN_CONST(nsIID, IID_</xsl:text>
|
---|
[56679] | 1932 | <xsl:value-of select="$name"/>
|
---|
[50183] | 1933 | <xsl:text>);
</xsl:text>
|
---|
| 1934 | <xsl:text>#ifndef VBOX_WITH_GLUE
</xsl:text>
|
---|
| 1935 | <xsl:text>struct </xsl:text>
|
---|
[56679] | 1936 | <xsl:value-of select="$name"/>
|
---|
[50183] | 1937 | <xsl:text>_vtbl
{
</xsl:text>
|
---|
| 1938 | <xsl:text> </xsl:text>
|
---|
| 1939 | <xsl:choose>
|
---|
| 1940 | <xsl:when test="@extends='$unknown'">struct nsISupports_vtbl nsisupports;</xsl:when>
|
---|
| 1941 | <xsl:when test="@extends='$errorinfo'">struct nsIException_vtbl nsiexception;</xsl:when>
|
---|
| 1942 | <xsl:otherwise>
|
---|
| 1943 | <xsl:text>struct </xsl:text>
|
---|
| 1944 | <xsl:value-of select="@extends"/>
|
---|
| 1945 | <xsl:text>_vtbl </xsl:text>
|
---|
[53938] | 1946 | <xsl:call-template name="string-to-lower">
|
---|
[50183] | 1947 | <xsl:with-param name="str" select="@extends"/>
|
---|
| 1948 | </xsl:call-template>
|
---|
| 1949 | <xsl:text>;</xsl:text>
|
---|
| 1950 | </xsl:otherwise>
|
---|
| 1951 | </xsl:choose>
|
---|
| 1952 | <xsl:text>

</xsl:text>
|
---|
| 1953 | <!-- attributes (properties) -->
|
---|
| 1954 | <xsl:apply-templates select="attribute | if/attribute"/>
|
---|
[56679] | 1955 | <xsl:variable name="reservedAttributes" select="@reservedAttributes"/>
|
---|
| 1956 | <xsl:if test="$reservedAttributes > 0">
|
---|
| 1957 | <!-- tricky way to do a "for" loop without recursion -->
|
---|
| 1958 | <xsl:for-each select="(//*)[position() <= $reservedAttributes]">
|
---|
| 1959 | <xsl:text> nsresult (*GetInternalAndReservedAttribute</xsl:text>
|
---|
| 1960 | <xsl:value-of select="concat(position(), $name)"/>
|
---|
| 1961 | <xsl:text>)(</xsl:text>
|
---|
| 1962 | <xsl:value-of select="$name"/>
|
---|
| 1963 | <xsl:text> *pThis, PRUint32 *reserved);

</xsl:text>
|
---|
| 1964 | </xsl:for-each>
|
---|
| 1965 | </xsl:if>
|
---|
[50183] | 1966 | <!-- methods -->
|
---|
| 1967 | <xsl:apply-templates select="method | if/method"/>
|
---|
[56679] | 1968 | <xsl:variable name="reservedMethods" select="@reservedMethods"/>
|
---|
| 1969 | <xsl:if test="$reservedMethods > 0">
|
---|
| 1970 | <!-- tricky way to do a "for" loop without recursion -->
|
---|
| 1971 | <xsl:for-each select="(//*)[position() <= $reservedMethods]">
|
---|
| 1972 | <xsl:text> nsresult (*InternalAndReservedMethod</xsl:text>
|
---|
| 1973 | <xsl:value-of select="concat(position(), $name)"/>
|
---|
| 1974 | <xsl:text>)(</xsl:text>
|
---|
| 1975 | <xsl:value-of select="$name"/>
|
---|
| 1976 | <xsl:text> *pThis);

</xsl:text>
|
---|
| 1977 | </xsl:for-each>
|
---|
| 1978 | </xsl:if>
|
---|
[50183] | 1979 | <!-- -->
|
---|
| 1980 | <xsl:text>};
</xsl:text>
|
---|
| 1981 | <xsl:text>#else /* VBOX_WITH_GLUE */
</xsl:text>
|
---|
| 1982 | <xsl:text>struct </xsl:text>
|
---|
[56679] | 1983 | <xsl:value-of select="$name"/>
|
---|
[50183] | 1984 | <xsl:text>Vtbl
{
</xsl:text>
|
---|
| 1985 | <xsl:apply-templates select="." mode="vtab_flat">
|
---|
[56679] | 1986 | <xsl:with-param name="iface" select="$name"/>
|
---|
[50183] | 1987 | </xsl:apply-templates>
|
---|
| 1988 | <xsl:text>};
</xsl:text>
|
---|
| 1989 | <xsl:apply-templates select="." mode="cobjmacro">
|
---|
[56679] | 1990 | <xsl:with-param name="iface" select="$name"/>
|
---|
[50183] | 1991 | </xsl:apply-templates>
|
---|
| 1992 | <!-- -->
|
---|
| 1993 | <xsl:text>#endif /* VBOX_WITH_GLUE */
</xsl:text>
|
---|
| 1994 | <xsl:text>
</xsl:text>
|
---|
[50254] | 1995 | <xsl:text>interface </xsl:text>
|
---|
[56679] | 1996 | <xsl:value-of select="$name"/>
|
---|
[50183] | 1997 | <xsl:text>
{
</xsl:text>
|
---|
| 1998 | <xsl:text>#ifndef VBOX_WITH_GLUE
</xsl:text>
|
---|
| 1999 | <xsl:text> struct </xsl:text>
|
---|
[56679] | 2000 | <xsl:value-of select="$name"/>
|
---|
[50183] | 2001 | <xsl:text>_vtbl *vtbl;
</xsl:text>
|
---|
| 2002 | <xsl:text>#else /* VBOX_WITH_GLUE */
</xsl:text>
|
---|
[50254] | 2003 | <xsl:text> CONST_VTBL struct </xsl:text>
|
---|
[56679] | 2004 | <xsl:value-of select="$name"/>
|
---|
[50183] | 2005 | <xsl:text>Vtbl *lpVtbl;
</xsl:text>
|
---|
| 2006 | <xsl:text>#endif /* VBOX_WITH_GLUE */
</xsl:text>
|
---|
| 2007 | <xsl:text>};
</xsl:text>
|
---|
| 2008 | <xsl:text>/* End of struct </xsl:text>
|
---|
[56679] | 2009 | <xsl:value-of select="$name"/>
|
---|
[53938] | 2010 | <xsl:text> declaration */

</xsl:text>
|
---|
| 2011 | <xsl:call-template name="xsltprocNewlineOutputHack"/>
|
---|
[50183] | 2012 | </xsl:if>
|
---|
| 2013 | </xsl:template>
|
---|
| 2014 |
|
---|
| 2015 |
|
---|
| 2016 | <!--
|
---|
[16406] | 2017 | * attributes
|
---|
| 2018 | -->
|
---|
[50183] | 2019 | <xsl:template match="attribute">
|
---|
| 2020 | <xsl:param name="iface" select="ancestor::interface/@name"/>
|
---|
| 2021 |
|
---|
[16406] | 2022 | <xsl:choose>
|
---|
| 2023 | <!-- safearray pseudo attribute -->
|
---|
| 2024 | <xsl:when test="@safearray='yes'">
|
---|
| 2025 | <!-- getter -->
|
---|
| 2026 | <xsl:text> nsresult (*Get</xsl:text>
|
---|
| 2027 | <xsl:call-template name="capitalize">
|
---|
| 2028 | <xsl:with-param name="str" select="@name"/>
|
---|
| 2029 | </xsl:call-template>
|
---|
| 2030 | <xsl:text>)(</xsl:text>
|
---|
[50183] | 2031 | <xsl:value-of select="$iface" />
|
---|
[18821] | 2032 | <xsl:text> *pThis, </xsl:text>
|
---|
[16406] | 2033 | <!-- array size -->
|
---|
| 2034 | <xsl:text>PRUint32 *</xsl:text>
|
---|
| 2035 | <xsl:value-of select="@name"/>
|
---|
| 2036 | <xsl:text>Size, </xsl:text>
|
---|
| 2037 | <!-- array pointer -->
|
---|
| 2038 | <xsl:apply-templates select="@type" mode="forwarder"/>
|
---|
| 2039 | <xsl:text> **</xsl:text>
|
---|
| 2040 | <xsl:value-of select="@name"/>
|
---|
| 2041 | <xsl:text>);
</xsl:text>
|
---|
| 2042 | <!-- setter -->
|
---|
| 2043 | <xsl:if test="not(@readonly='yes')">
|
---|
[42131] | 2044 | <xsl:text> nsresult (*Set</xsl:text>
|
---|
[16406] | 2045 | <xsl:call-template name="capitalize">
|
---|
| 2046 | <xsl:with-param name="str" select="@name"/>
|
---|
| 2047 | </xsl:call-template>
|
---|
[42131] | 2048 | <xsl:text>)(</xsl:text>
|
---|
[50183] | 2049 | <xsl:value-of select="$iface" />
|
---|
[42131] | 2050 | <xsl:text> *pThis, </xsl:text>
|
---|
[16406] | 2051 | <!-- array size -->
|
---|
[42131] | 2052 | <xsl:text>PRUint32 </xsl:text>
|
---|
[16406] | 2053 | <xsl:value-of select="@name"/>
|
---|
[42131] | 2054 | <xsl:text>Size, </xsl:text>
|
---|
[16406] | 2055 | <!-- array pointer -->
|
---|
| 2056 | <xsl:apply-templates select="@type" mode="forwarder"/>
|
---|
[42131] | 2057 | <xsl:text> *</xsl:text>
|
---|
[16406] | 2058 | <xsl:value-of select="@name"/>
|
---|
[42131] | 2059 | <xsl:text>);
</xsl:text>
|
---|
[16406] | 2060 | </xsl:if>
|
---|
| 2061 | </xsl:when>
|
---|
| 2062 | <!-- normal attribute -->
|
---|
| 2063 | <xsl:otherwise>
|
---|
| 2064 | <xsl:text> </xsl:text>
|
---|
| 2065 | <xsl:if test="@readonly='yes'">
|
---|
| 2066 | <xsl:text>nsresult (*Get</xsl:text>
|
---|
| 2067 | <xsl:call-template name="capitalize">
|
---|
| 2068 | <xsl:with-param name="str" select="@name"/>
|
---|
| 2069 | </xsl:call-template>
|
---|
| 2070 | <xsl:text>)(</xsl:text>
|
---|
[50183] | 2071 | <xsl:value-of select="$iface" />
|
---|
[18821] | 2072 | <xsl:text> *pThis, </xsl:text>
|
---|
[16406] | 2073 | <xsl:apply-templates select="@type" mode="forwarder"/>
|
---|
| 2074 | <xsl:text> *</xsl:text>
|
---|
| 2075 | <xsl:value-of select="@name"/>
|
---|
| 2076 | <xsl:text>);
</xsl:text>
|
---|
| 2077 | </xsl:if>
|
---|
| 2078 | <xsl:choose>
|
---|
| 2079 | <xsl:when test="@readonly='yes'">
|
---|
| 2080 | </xsl:when>
|
---|
| 2081 | <xsl:otherwise>
|
---|
| 2082 | <xsl:text>nsresult (*Get</xsl:text>
|
---|
| 2083 | <xsl:call-template name="capitalize">
|
---|
| 2084 | <xsl:with-param name="str" select="@name"/>
|
---|
| 2085 | </xsl:call-template>
|
---|
| 2086 | <xsl:text>)(</xsl:text>
|
---|
[50183] | 2087 | <xsl:value-of select="$iface" />
|
---|
[18821] | 2088 | <xsl:text> *pThis, </xsl:text>
|
---|
[16406] | 2089 | <xsl:apply-templates select="@type" mode="forwarder"/>
|
---|
| 2090 | <xsl:text> *</xsl:text>
|
---|
| 2091 | <xsl:value-of select="@name"/>
|
---|
| 2092 | <xsl:text>);
 </xsl:text>
|
---|
| 2093 | <xsl:text>nsresult (*Set</xsl:text>
|
---|
| 2094 | <xsl:call-template name="capitalize">
|
---|
| 2095 | <xsl:with-param name="str" select="@name"/>
|
---|
| 2096 | </xsl:call-template>
|
---|
| 2097 | <xsl:text>)(</xsl:text>
|
---|
[50183] | 2098 | <xsl:value-of select="$iface" />
|
---|
[18821] | 2099 | <xsl:text> *pThis, </xsl:text>
|
---|
[16406] | 2100 | <xsl:apply-templates select="@type" mode="forwarder"/>
|
---|
| 2101 | <xsl:text> </xsl:text>
|
---|
| 2102 | <xsl:value-of select="@name"/>
|
---|
| 2103 | <xsl:text>);
</xsl:text>
|
---|
| 2104 | </xsl:otherwise>
|
---|
| 2105 | </xsl:choose>
|
---|
| 2106 | </xsl:otherwise>
|
---|
| 2107 | </xsl:choose>
|
---|
| 2108 | <xsl:text>
</xsl:text>
|
---|
| 2109 | </xsl:template>
|
---|
| 2110 |
|
---|
[50183] | 2111 | <xsl:template match="attribute" mode="cobjmacro">
|
---|
| 2112 | <xsl:param name="iface"/>
|
---|
[16406] | 2113 |
|
---|
[50183] | 2114 | <!-- getter (COM compatible) -->
|
---|
| 2115 | <xsl:text>#define </xsl:text>
|
---|
| 2116 | <xsl:value-of select="concat($iface, '_get_')"/>
|
---|
[16406] | 2117 | <xsl:call-template name="capitalize">
|
---|
| 2118 | <xsl:with-param name="str" select="@name"/>
|
---|
| 2119 | </xsl:call-template>
|
---|
[50183] | 2120 | <xsl:text>(p, a</xsl:text>
|
---|
[16406] | 2121 | <xsl:call-template name="capitalize">
|
---|
| 2122 | <xsl:with-param name="str" select="@name"/>
|
---|
| 2123 | </xsl:call-template>
|
---|
[50183] | 2124 | <xsl:text>) ((p)->lpVtbl->Get</xsl:text>
|
---|
[16406] | 2125 | <xsl:call-template name="capitalize">
|
---|
| 2126 | <xsl:with-param name="str" select="@name"/>
|
---|
| 2127 | </xsl:call-template>
|
---|
[50183] | 2128 | <xsl:text>(p, a</xsl:text>
|
---|
[16406] | 2129 | <xsl:call-template name="capitalize">
|
---|
| 2130 | <xsl:with-param name="str" select="@name"/>
|
---|
| 2131 | </xsl:call-template>
|
---|
[50183] | 2132 | <xsl:text>))
</xsl:text>
|
---|
| 2133 |
|
---|
| 2134 | <!-- getter (XPCOM compatible) -->
|
---|
| 2135 | <xsl:text>#define </xsl:text>
|
---|
| 2136 | <xsl:value-of select="concat($iface, '_Get')"/>
|
---|
[16406] | 2137 | <xsl:call-template name="capitalize">
|
---|
| 2138 | <xsl:with-param name="str" select="@name"/>
|
---|
| 2139 | </xsl:call-template>
|
---|
[50183] | 2140 | <xsl:text>(p, a</xsl:text>
|
---|
[16406] | 2141 | <xsl:call-template name="capitalize">
|
---|
| 2142 | <xsl:with-param name="str" select="@name"/>
|
---|
| 2143 | </xsl:call-template>
|
---|
[50183] | 2144 | <xsl:text>) ((p)->lpVtbl->Get</xsl:text>
|
---|
[16406] | 2145 | <xsl:call-template name="capitalize">
|
---|
| 2146 | <xsl:with-param name="str" select="@name"/>
|
---|
| 2147 | </xsl:call-template>
|
---|
[50183] | 2148 | <xsl:text>(p, a</xsl:text>
|
---|
[16406] | 2149 | <xsl:call-template name="capitalize">
|
---|
| 2150 | <xsl:with-param name="str" select="@name"/>
|
---|
| 2151 | </xsl:call-template>
|
---|
[50183] | 2152 | <xsl:text>))
</xsl:text>
|
---|
| 2153 |
|
---|
[16406] | 2154 | <xsl:if test="not(@readonly='yes')">
|
---|
[50183] | 2155 | <!-- setter (COM compatible) -->
|
---|
| 2156 | <xsl:text>#define </xsl:text>
|
---|
[52787] | 2157 | <xsl:value-of select="concat($iface, '_put_')"/>
|
---|
[16406] | 2158 | <xsl:call-template name="capitalize">
|
---|
| 2159 | <xsl:with-param name="str" select="@name"/>
|
---|
| 2160 | </xsl:call-template>
|
---|
[50183] | 2161 | <xsl:text>(p, a</xsl:text>
|
---|
[16406] | 2162 | <xsl:call-template name="capitalize">
|
---|
| 2163 | <xsl:with-param name="str" select="@name"/>
|
---|
| 2164 | </xsl:call-template>
|
---|
[50183] | 2165 | <xsl:text>) ((p)->lpVtbl->Set</xsl:text>
|
---|
[16406] | 2166 | <xsl:call-template name="capitalize">
|
---|
| 2167 | <xsl:with-param name="str" select="@name"/>
|
---|
| 2168 | </xsl:call-template>
|
---|
[50183] | 2169 | <xsl:text>(p, a</xsl:text>
|
---|
[16406] | 2170 | <xsl:call-template name="capitalize">
|
---|
| 2171 | <xsl:with-param name="str" select="@name"/>
|
---|
| 2172 | </xsl:call-template>
|
---|
[50183] | 2173 | <xsl:text>))
</xsl:text>
|
---|
| 2174 |
|
---|
| 2175 | <!-- setter (XPCOM compatible) -->
|
---|
| 2176 | <xsl:text>#define </xsl:text>
|
---|
| 2177 | <xsl:value-of select="concat($iface, '_Set')"/>
|
---|
[16406] | 2178 | <xsl:call-template name="capitalize">
|
---|
| 2179 | <xsl:with-param name="str" select="@name"/>
|
---|
| 2180 | </xsl:call-template>
|
---|
[50183] | 2181 | <xsl:text>(p, a</xsl:text>
|
---|
[16406] | 2182 | <xsl:call-template name="capitalize">
|
---|
| 2183 | <xsl:with-param name="str" select="@name"/>
|
---|
| 2184 | </xsl:call-template>
|
---|
[50183] | 2185 | <xsl:text>) ((p)->lpVtbl->Set</xsl:text>
|
---|
[16406] | 2186 | <xsl:call-template name="capitalize">
|
---|
| 2187 | <xsl:with-param name="str" select="@name"/>
|
---|
| 2188 | </xsl:call-template>
|
---|
[50183] | 2189 | <xsl:text>(p, a</xsl:text>
|
---|
[16406] | 2190 | <xsl:call-template name="capitalize">
|
---|
| 2191 | <xsl:with-param name="str" select="@name"/>
|
---|
| 2192 | </xsl:call-template>
|
---|
[50183] | 2193 | <xsl:text>))
</xsl:text>
|
---|
| 2194 |
|
---|
[16406] | 2195 | </xsl:if>
|
---|
| 2196 | </xsl:template>
|
---|
| 2197 |
|
---|
| 2198 | <!--
|
---|
| 2199 | * methods
|
---|
| 2200 | -->
|
---|
[50183] | 2201 | <xsl:template match="method">
|
---|
| 2202 | <xsl:param name="iface" select="ancestor::interface/@name"/>
|
---|
| 2203 |
|
---|
[16406] | 2204 | <xsl:if test="param/@mod='ptr'">
|
---|
| 2205 | <!-- methods using native types must be non-scriptable
|
---|
| 2206 | <xsl:text> [noscript]
</xsl:text>-->
|
---|
| 2207 | </xsl:if>
|
---|
| 2208 | <xsl:text> nsresult (*</xsl:text>
|
---|
| 2209 | <xsl:call-template name="capitalize">
|
---|
| 2210 | <xsl:with-param name="str" select="@name"/>
|
---|
| 2211 | </xsl:call-template>
|
---|
| 2212 | <xsl:if test="param">
|
---|
| 2213 | <xsl:text>)(
</xsl:text>
|
---|
| 2214 | <xsl:text> </xsl:text>
|
---|
[50183] | 2215 | <xsl:value-of select="$iface" />
|
---|
[18821] | 2216 | <xsl:text> *pThis,
</xsl:text>
|
---|
[16406] | 2217 | <xsl:for-each select="param [position() != last()]">
|
---|
| 2218 | <xsl:text> </xsl:text>
|
---|
| 2219 | <xsl:apply-templates select="."/>
|
---|
| 2220 | <xsl:text>,
</xsl:text>
|
---|
| 2221 | </xsl:for-each>
|
---|
| 2222 | <xsl:text> </xsl:text>
|
---|
| 2223 | <xsl:apply-templates select="param [last()]"/>
|
---|
| 2224 | <xsl:text>
 );
</xsl:text>
|
---|
| 2225 | </xsl:if>
|
---|
| 2226 | <xsl:if test="not(param)">
|
---|
| 2227 | <xsl:text>)(</xsl:text>
|
---|
[50183] | 2228 | <xsl:value-of select="$iface" />
|
---|
[18821] | 2229 | <xsl:text> *pThis );
</xsl:text>
|
---|
[16406] | 2230 | </xsl:if>
|
---|
| 2231 | <xsl:text>
</xsl:text>
|
---|
| 2232 | </xsl:template>
|
---|
| 2233 |
|
---|
[50183] | 2234 | <xsl:template match="method" mode="cobjmacro">
|
---|
| 2235 | <xsl:param name="iface"/>
|
---|
[16406] | 2236 |
|
---|
[50183] | 2237 | <xsl:text>#define </xsl:text>
|
---|
| 2238 | <xsl:value-of select="concat($iface, '_')"/>
|
---|
[16406] | 2239 | <xsl:call-template name="capitalize">
|
---|
| 2240 | <xsl:with-param name="str" select="@name"/>
|
---|
| 2241 | </xsl:call-template>
|
---|
[50183] | 2242 | <xsl:text>(p</xsl:text>
|
---|
| 2243 | <xsl:for-each select="param">
|
---|
| 2244 | <xsl:text>, a</xsl:text>
|
---|
| 2245 | <xsl:call-template name="capitalize">
|
---|
| 2246 | <xsl:with-param name="str" select="@name"/>
|
---|
| 2247 | </xsl:call-template>
|
---|
| 2248 | </xsl:for-each>
|
---|
| 2249 | <xsl:text>) ((p)->lpVtbl-></xsl:text>
|
---|
[16406] | 2250 | <xsl:call-template name="capitalize">
|
---|
| 2251 | <xsl:with-param name="str" select="@name"/>
|
---|
| 2252 | </xsl:call-template>
|
---|
[50183] | 2253 | <xsl:text>(p</xsl:text>
|
---|
| 2254 | <xsl:for-each select="param">
|
---|
| 2255 | <xsl:text>, a</xsl:text>
|
---|
| 2256 | <xsl:call-template name="capitalize">
|
---|
| 2257 | <xsl:with-param name="str" select="@name"/>
|
---|
| 2258 | </xsl:call-template>
|
---|
| 2259 | </xsl:for-each>
|
---|
| 2260 | <xsl:text>))
</xsl:text>
|
---|
[16406] | 2261 | </xsl:template>
|
---|
| 2262 |
|
---|
| 2263 |
|
---|
| 2264 | <!--
|
---|
| 2265 | * modules
|
---|
| 2266 | -->
|
---|
| 2267 | <xsl:template match="module">
|
---|
| 2268 | <xsl:apply-templates select="class"/>
|
---|
| 2269 | </xsl:template>
|
---|
| 2270 |
|
---|
| 2271 |
|
---|
| 2272 | <!--
|
---|
| 2273 | * co-classes
|
---|
| 2274 | -->
|
---|
| 2275 | <xsl:template match="module/class">
|
---|
| 2276 | <!-- class and contract id -->
|
---|
| 2277 | <xsl:text>
</xsl:text>
|
---|
| 2278 | <xsl:text>#define NS_</xsl:text>
|
---|
[53938] | 2279 | <xsl:call-template name="string-to-upper">
|
---|
[16406] | 2280 | <xsl:with-param name="str" select="@name"/>
|
---|
| 2281 | </xsl:call-template>
|
---|
| 2282 | <xsl:text>_CID { \
</xsl:text>
|
---|
| 2283 | <xsl:text> 0x</xsl:text><xsl:value-of select="substring(@uuid,1,8)"/>
|
---|
| 2284 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,10,4)"/>
|
---|
| 2285 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,15,4)"/>
|
---|
| 2286 | <xsl:text>, \
 </xsl:text>
|
---|
| 2287 | <xsl:text>{ 0x</xsl:text><xsl:value-of select="substring(@uuid,20,2)"/>
|
---|
| 2288 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,22,2)"/>
|
---|
| 2289 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,25,2)"/>
|
---|
| 2290 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,27,2)"/>
|
---|
| 2291 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,29,2)"/>
|
---|
| 2292 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,31,2)"/>
|
---|
| 2293 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,33,2)"/>
|
---|
| 2294 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,35,2)"/>
|
---|
| 2295 | <xsl:text> } \
}
</xsl:text>
|
---|
| 2296 | <xsl:text>#define NS_</xsl:text>
|
---|
[53938] | 2297 | <xsl:call-template name="string-to-upper">
|
---|
[16406] | 2298 | <xsl:with-param name="str" select="@name"/>
|
---|
| 2299 | </xsl:call-template>
|
---|
| 2300 | <!-- Contract ID -->
|
---|
| 2301 | <xsl:text>_CONTRACTID "@</xsl:text>
|
---|
| 2302 | <xsl:value-of select="@namespace"/>
|
---|
| 2303 | <xsl:text>/</xsl:text>
|
---|
| 2304 | <xsl:value-of select="@name"/>
|
---|
| 2305 | <xsl:text>;1"
</xsl:text>
|
---|
| 2306 | <!-- CLSID_xxx declarations for XPCOM, for compatibility with Win32 -->
|
---|
[50183] | 2307 | <xsl:text>/* COM compatibility */
</xsl:text>
|
---|
| 2308 | <xsl:text>VBOX_EXTERN_CONST(nsCID, CLSID_</xsl:text>
|
---|
[16406] | 2309 | <xsl:value-of select="@name"/>
|
---|
[50183] | 2310 | <xsl:text>);
</xsl:text>
|
---|
[16406] | 2311 | <xsl:text>

</xsl:text>
|
---|
| 2312 | </xsl:template>
|
---|
| 2313 |
|
---|
| 2314 |
|
---|
| 2315 | <!--
|
---|
| 2316 | * enums
|
---|
| 2317 | -->
|
---|
| 2318 | <xsl:template match="enum">
|
---|
| 2319 | <xsl:text>/* Start of enum </xsl:text>
|
---|
| 2320 | <xsl:value-of select="@name"/>
|
---|
[50183] | 2321 | <xsl:text> declaration */
</xsl:text>
|
---|
[16406] | 2322 | <xsl:text>#define </xsl:text>
|
---|
[53938] | 2323 | <xsl:call-template name="string-to-upper">
|
---|
[16406] | 2324 | <xsl:with-param name="str" select="@name"/>
|
---|
| 2325 | </xsl:call-template>
|
---|
| 2326 | <xsl:value-of select="concat('_IID_STR "',@uuid,'"')"/>
|
---|
| 2327 | <xsl:text>
</xsl:text>
|
---|
| 2328 | <xsl:text>#define </xsl:text>
|
---|
[53938] | 2329 | <xsl:call-template name="string-to-upper">
|
---|
[16406] | 2330 | <xsl:with-param name="str" select="@name"/>
|
---|
| 2331 | </xsl:call-template>
|
---|
| 2332 | <xsl:text>_IID { \
</xsl:text>
|
---|
| 2333 | <xsl:text> 0x</xsl:text><xsl:value-of select="substring(@uuid,1,8)"/>
|
---|
| 2334 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,10,4)"/>
|
---|
| 2335 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,15,4)"/>
|
---|
| 2336 | <xsl:text>, \
 </xsl:text>
|
---|
| 2337 | <xsl:text>{ 0x</xsl:text><xsl:value-of select="substring(@uuid,20,2)"/>
|
---|
| 2338 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,22,2)"/>
|
---|
| 2339 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,25,2)"/>
|
---|
| 2340 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,27,2)"/>
|
---|
| 2341 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,29,2)"/>
|
---|
| 2342 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,31,2)"/>
|
---|
| 2343 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,33,2)"/>
|
---|
| 2344 | <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,35,2)"/>
|
---|
| 2345 | <xsl:text> } \
}
</xsl:text>
|
---|
[52848] | 2346 | <xsl:text>typedef enum </xsl:text>
|
---|
[16406] | 2347 | <xsl:value-of select="@name"/>
|
---|
| 2348 | <xsl:text>
{
</xsl:text>
|
---|
| 2349 | <xsl:variable name="this" select="."/>
|
---|
| 2350 | <xsl:for-each select="const">
|
---|
| 2351 | <xsl:text> </xsl:text>
|
---|
| 2352 | <xsl:value-of select="$this/@name"/>
|
---|
| 2353 | <xsl:text>_</xsl:text>
|
---|
| 2354 | <xsl:value-of select="@name"/> = <xsl:value-of select="@value"/>
|
---|
| 2355 | <xsl:if test="position() != last()">
|
---|
| 2356 | <xsl:text>,</xsl:text>
|
---|
| 2357 | </xsl:if>
|
---|
| 2358 | <xsl:text>
</xsl:text>
|
---|
| 2359 | </xsl:for-each>
|
---|
[52848] | 2360 | <xsl:text>} </xsl:text>
|
---|
| 2361 | <xsl:value-of select="@name"/>
|
---|
| 2362 | <xsl:text>;
</xsl:text>
|
---|
[16406] | 2363 | <xsl:text>/* End of enum </xsl:text>
|
---|
| 2364 | <xsl:value-of select="@name"/>
|
---|
[50183] | 2365 | <xsl:text> declaration */
|
---|
| 2366 | #define </xsl:text>
|
---|
| 2367 | <xsl:value-of select="concat(@name, '_T PRUint32


')"/>
|
---|
[16406] | 2368 | </xsl:template>
|
---|
| 2369 |
|
---|
| 2370 |
|
---|
| 2371 | <!--
|
---|
| 2372 | * method parameters
|
---|
| 2373 | -->
|
---|
| 2374 | <xsl:template match="method/param">
|
---|
| 2375 | <xsl:choose>
|
---|
| 2376 | <!-- safearray parameters -->
|
---|
| 2377 | <xsl:when test="@safearray='yes'">
|
---|
| 2378 | <!-- array size -->
|
---|
| 2379 | <xsl:choose>
|
---|
| 2380 | <xsl:when test="@dir='in'">
|
---|
| 2381 | <xsl:text>PRUint32 </xsl:text>
|
---|
| 2382 | <xsl:value-of select="@name"/>
|
---|
| 2383 | <xsl:text>Size,
</xsl:text>
|
---|
| 2384 | </xsl:when>
|
---|
| 2385 | <xsl:when test="@dir='out'">
|
---|
| 2386 | <xsl:text>PRUint32 *</xsl:text>
|
---|
| 2387 | <xsl:value-of select="@name"/>
|
---|
| 2388 | <xsl:text>Size,
</xsl:text>
|
---|
| 2389 | </xsl:when>
|
---|
| 2390 | <xsl:when test="@dir='return'">
|
---|
| 2391 | <xsl:text>PRUint32 *</xsl:text>
|
---|
| 2392 | <xsl:value-of select="@name"/>
|
---|
| 2393 | <xsl:text>Size,
</xsl:text>
|
---|
| 2394 | </xsl:when>
|
---|
| 2395 | <xsl:otherwise>
|
---|
| 2396 | <xsl:text>PRUint32 </xsl:text>
|
---|
| 2397 | <xsl:value-of select="@name"/>
|
---|
| 2398 | <xsl:text>Size,
</xsl:text>
|
---|
| 2399 | </xsl:otherwise>
|
---|
| 2400 | </xsl:choose>
|
---|
| 2401 | <!-- array pointer -->
|
---|
| 2402 | <xsl:text> </xsl:text>
|
---|
| 2403 | <xsl:choose>
|
---|
| 2404 | <xsl:when test="@dir='in'">
|
---|
| 2405 | <xsl:apply-templates select="@type" mode="forwarder"/>
|
---|
| 2406 | <xsl:text>*</xsl:text>
|
---|
| 2407 | </xsl:when>
|
---|
| 2408 | <xsl:when test="@dir='out'">
|
---|
| 2409 | <xsl:apply-templates select="@type" mode="forwarder"/>
|
---|
[49702] | 2410 | <xsl:text>**</xsl:text>
|
---|
[16406] | 2411 | </xsl:when>
|
---|
| 2412 | <xsl:when test="@dir='return'">
|
---|
| 2413 | <xsl:apply-templates select="@type" mode="forwarder"/>
|
---|
| 2414 | <xsl:text>**</xsl:text>
|
---|
| 2415 | </xsl:when>
|
---|
| 2416 | <xsl:otherwise>
|
---|
| 2417 | <xsl:apply-templates select="@type" mode="forwarder"/>
|
---|
| 2418 | <xsl:text>*</xsl:text>
|
---|
| 2419 | </xsl:otherwise>
|
---|
| 2420 | </xsl:choose>
|
---|
| 2421 | <xsl:text> </xsl:text>
|
---|
| 2422 | <xsl:value-of select="@name"/>
|
---|
| 2423 | </xsl:when>
|
---|
| 2424 | <!-- normal and array parameters -->
|
---|
| 2425 | <xsl:otherwise>
|
---|
| 2426 | <xsl:choose>
|
---|
| 2427 | <xsl:when test="@dir='in'">
|
---|
| 2428 | <xsl:apply-templates select="@type" mode="forwarder"/>
|
---|
| 2429 | <xsl:text></xsl:text>
|
---|
| 2430 | </xsl:when>
|
---|
| 2431 | <xsl:when test="@dir='out'">
|
---|
| 2432 | <xsl:apply-templates select="@type" mode="forwarder"/>
|
---|
| 2433 | <xsl:text> *</xsl:text>
|
---|
| 2434 | </xsl:when>
|
---|
| 2435 | <xsl:when test="@dir='return'">
|
---|
| 2436 | <xsl:apply-templates select="@type" mode="forwarder"/>
|
---|
| 2437 | <xsl:text> *</xsl:text>
|
---|
| 2438 | </xsl:when>
|
---|
| 2439 | <xsl:otherwise>
|
---|
| 2440 | <xsl:apply-templates select="@type" mode="forwarder"/>
|
---|
| 2441 | <xsl:text></xsl:text>
|
---|
| 2442 | </xsl:otherwise>
|
---|
| 2443 | </xsl:choose>
|
---|
| 2444 | <xsl:text> </xsl:text>
|
---|
| 2445 | <xsl:value-of select="@name"/>
|
---|
| 2446 | </xsl:otherwise>
|
---|
| 2447 | </xsl:choose>
|
---|
| 2448 | </xsl:template>
|
---|
| 2449 |
|
---|
| 2450 | <xsl:template match="method/param" mode="forwarder">
|
---|
| 2451 | <xsl:if test="@safearray='yes'">
|
---|
| 2452 | <xsl:text>PRUint32</xsl:text>
|
---|
| 2453 | <xsl:if test="@dir='out' or @dir='return'">
|
---|
| 2454 | <xsl:text> *</xsl:text>
|
---|
| 2455 | </xsl:if>
|
---|
| 2456 | <xsl:text> a</xsl:text>
|
---|
| 2457 | <xsl:call-template name="capitalize">
|
---|
| 2458 | <xsl:with-param name="str" select="@name"/>
|
---|
| 2459 | </xsl:call-template>
|
---|
| 2460 | <xsl:text>Size, </xsl:text>
|
---|
| 2461 | </xsl:if>
|
---|
| 2462 | <xsl:apply-templates select="@type" mode="forwarder"/>
|
---|
| 2463 | <xsl:if test="@dir='out' or @dir='return'">
|
---|
| 2464 | <xsl:text> *</xsl:text>
|
---|
| 2465 | </xsl:if>
|
---|
| 2466 | <xsl:if test="@safearray='yes'">
|
---|
| 2467 | <xsl:text> *</xsl:text>
|
---|
| 2468 | </xsl:if>
|
---|
| 2469 | <xsl:text> a</xsl:text>
|
---|
| 2470 | <xsl:call-template name="capitalize">
|
---|
| 2471 | <xsl:with-param name="str" select="@name"/>
|
---|
| 2472 | </xsl:call-template>
|
---|
| 2473 | </xsl:template>
|
---|
| 2474 |
|
---|
| 2475 |
|
---|
| 2476 | <!--
|
---|
| 2477 | * attribute/parameter type conversion
|
---|
| 2478 | -->
|
---|
[23223] | 2479 | <xsl:template match="attribute/@type | param/@type">
|
---|
[16406] | 2480 | <xsl:variable name="self_target" select="current()/ancestor::if/@target"/>
|
---|
| 2481 |
|
---|
| 2482 | <xsl:choose>
|
---|
[66274] | 2483 | <!-- modifiers -->
|
---|
[16406] | 2484 | <xsl:when test="name(current())='type' and ../@mod">
|
---|
| 2485 | <xsl:choose>
|
---|
| 2486 | <xsl:when test="../@mod='ptr'">
|
---|
| 2487 | <xsl:choose>
|
---|
| 2488 | <!-- standard types -->
|
---|
| 2489 | <!--xsl:when test=".='result'">??</xsl:when-->
|
---|
| 2490 | <xsl:when test=".='boolean'">booleanPtr</xsl:when>
|
---|
| 2491 | <xsl:when test=".='octet'">octetPtr</xsl:when>
|
---|
| 2492 | <xsl:when test=".='short'">shortPtr</xsl:when>
|
---|
| 2493 | <xsl:when test=".='unsigned short'">ushortPtr</xsl:when>
|
---|
| 2494 | <xsl:when test=".='long'">longPtr</xsl:when>
|
---|
| 2495 | <xsl:when test=".='long long'">llongPtr</xsl:when>
|
---|
| 2496 | <xsl:when test=".='unsigned long'">ulongPtr</xsl:when>
|
---|
| 2497 | <xsl:when test=".='unsigned long long'">ullongPtr</xsl:when>
|
---|
| 2498 | <xsl:otherwise>
|
---|
| 2499 | <xsl:message terminate="yes">
|
---|
| 2500 | <xsl:value-of select="concat(../../../@name,'::',../../@name,'::',../@name,': ')"/>
|
---|
| 2501 | <xsl:text>attribute 'mod=</xsl:text>
|
---|
| 2502 | <xsl:value-of select="concat('"',../@mod,'"')"/>
|
---|
| 2503 | <xsl:text>' cannot be used with type </xsl:text>
|
---|
| 2504 | <xsl:value-of select="concat('"',current(),'"!')"/>
|
---|
| 2505 | </xsl:message>
|
---|
| 2506 | </xsl:otherwise>
|
---|
| 2507 | </xsl:choose>
|
---|
| 2508 | </xsl:when>
|
---|
[23223] | 2509 | <xsl:when test="../@mod='string'">
|
---|
| 2510 | <xsl:choose>
|
---|
| 2511 | <!-- standard types -->
|
---|
| 2512 | <!--xsl:when test=".='result'">??</xsl:when-->
|
---|
| 2513 | <xsl:when test=".='uuid'">wstring</xsl:when>
|
---|
| 2514 | <xsl:otherwise>
|
---|
| 2515 | <xsl:message terminate="yes">
|
---|
| 2516 | <xsl:value-of select="concat(../../../@name,'::',../../@name,'::',../@name,': ')"/>
|
---|
| 2517 | <xsl:text>attribute 'mod=</xsl:text>
|
---|
| 2518 | <xsl:value-of select="concat('"',../@mod,'"')"/>
|
---|
| 2519 | <xsl:text>' cannot be used with type </xsl:text>
|
---|
| 2520 | <xsl:value-of select="concat('"',current(),'"!')"/>
|
---|
| 2521 | </xsl:message>
|
---|
| 2522 | </xsl:otherwise>
|
---|
| 2523 | </xsl:choose>
|
---|
| 2524 | </xsl:when>
|
---|
[16406] | 2525 | <xsl:otherwise>
|
---|
| 2526 | <xsl:message terminate="yes">
|
---|
| 2527 | <xsl:value-of select="concat(../../../@name,'::',../../@name,'::',../@name,': ')"/>
|
---|
| 2528 | <xsl:value-of select="concat('value "',../@mod,'" ')"/>
|
---|
| 2529 | <xsl:text>of attribute 'mod' is invalid!</xsl:text>
|
---|
| 2530 | </xsl:message>
|
---|
| 2531 | </xsl:otherwise>
|
---|
| 2532 | </xsl:choose>
|
---|
| 2533 | </xsl:when>
|
---|
| 2534 | <!-- no modifiers -->
|
---|
| 2535 | <xsl:otherwise>
|
---|
| 2536 | <xsl:choose>
|
---|
| 2537 | <!-- standard types -->
|
---|
| 2538 | <xsl:when test=".='result'">nsresult</xsl:when>
|
---|
| 2539 | <xsl:when test=".='boolean'">boolean</xsl:when>
|
---|
| 2540 | <xsl:when test=".='octet'">octet</xsl:when>
|
---|
| 2541 | <xsl:when test=".='short'">short</xsl:when>
|
---|
| 2542 | <xsl:when test=".='unsigned short'">unsigned short</xsl:when>
|
---|
| 2543 | <xsl:when test=".='long'">long</xsl:when>
|
---|
| 2544 | <xsl:when test=".='long long'">long long</xsl:when>
|
---|
| 2545 | <xsl:when test=".='unsigned long'">unsigned long</xsl:when>
|
---|
| 2546 | <xsl:when test=".='unsigned long long'">unsigned long long</xsl:when>
|
---|
| 2547 | <xsl:when test=".='char'">char</xsl:when>
|
---|
| 2548 | <xsl:when test=".='wchar'">wchar</xsl:when>
|
---|
| 2549 | <xsl:when test=".='string'">string</xsl:when>
|
---|
| 2550 | <xsl:when test=".='wstring'">wstring</xsl:when>
|
---|
| 2551 | <!-- UUID type -->
|
---|
| 2552 | <xsl:when test=".='uuid'">
|
---|
| 2553 | <xsl:choose>
|
---|
| 2554 | <xsl:when test="name(..)='attribute'">
|
---|
| 2555 | <xsl:choose>
|
---|
| 2556 | <xsl:when test="../@readonly='yes'">
|
---|
| 2557 | <xsl:text>nsIDPtr</xsl:text>
|
---|
| 2558 | </xsl:when>
|
---|
| 2559 | <xsl:otherwise>
|
---|
| 2560 | <xsl:message terminate="yes">
|
---|
| 2561 | <xsl:value-of select="../@name"/>
|
---|
| 2562 | <xsl:text>: Non-readonly uuid attributes are not supported!</xsl:text>
|
---|
| 2563 | </xsl:message>
|
---|
| 2564 | </xsl:otherwise>
|
---|
| 2565 | </xsl:choose>
|
---|
| 2566 | </xsl:when>
|
---|
| 2567 | <xsl:when test="name(..)='param'">
|
---|
| 2568 | <xsl:choose>
|
---|
| 2569 | <xsl:when test="../@dir='in' and not(../@safearray='yes')">
|
---|
| 2570 | <xsl:text>nsIDRef</xsl:text>
|
---|
| 2571 | </xsl:when>
|
---|
| 2572 | <xsl:otherwise>
|
---|
| 2573 | <xsl:text>nsIDPtr</xsl:text>
|
---|
| 2574 | </xsl:otherwise>
|
---|
| 2575 | </xsl:choose>
|
---|
| 2576 | </xsl:when>
|
---|
| 2577 | </xsl:choose>
|
---|
| 2578 | </xsl:when>
|
---|
| 2579 | <!-- system interface types -->
|
---|
| 2580 | <xsl:when test=".='$unknown'">nsISupports</xsl:when>
|
---|
| 2581 | <xsl:otherwise>
|
---|
| 2582 | <xsl:choose>
|
---|
| 2583 | <!-- enum types -->
|
---|
| 2584 | <xsl:when test="
|
---|
[66274] | 2585 | (ancestor::library/application/enum[@name=current()]) or
|
---|
| 2586 | (ancestor::library/application/if[@target=$self_target]/enum[@name=current()])
|
---|
[16406] | 2587 | ">
|
---|
| 2588 | <xsl:text>PRUint32</xsl:text>
|
---|
| 2589 | </xsl:when>
|
---|
| 2590 | <!-- custom interface types -->
|
---|
| 2591 | <xsl:when test="
|
---|
[66274] | 2592 | (ancestor::library/application/interface[@name=current()]) or
|
---|
| 2593 | (ancestor::library/application/if[@target=$self_target]/interface[@name=current()])
|
---|
[16406] | 2594 | ">
|
---|
| 2595 | <xsl:value-of select="."/>
|
---|
| 2596 | </xsl:when>
|
---|
| 2597 | <!-- other types -->
|
---|
| 2598 | <xsl:otherwise>
|
---|
| 2599 | <xsl:message terminate="yes">
|
---|
| 2600 | <xsl:text>Unknown parameter type: </xsl:text>
|
---|
| 2601 | <xsl:value-of select="."/>
|
---|
| 2602 | </xsl:message>
|
---|
| 2603 | </xsl:otherwise>
|
---|
| 2604 | </xsl:choose>
|
---|
| 2605 | </xsl:otherwise>
|
---|
| 2606 | </xsl:choose>
|
---|
| 2607 | </xsl:otherwise>
|
---|
| 2608 | </xsl:choose>
|
---|
| 2609 | </xsl:template>
|
---|
| 2610 |
|
---|
[23223] | 2611 | <xsl:template match="attribute/@type | param/@type" mode="forwarder">
|
---|
[16406] | 2612 |
|
---|
| 2613 | <xsl:variable name="self_target" select="current()/ancestor::if/@target"/>
|
---|
| 2614 |
|
---|
| 2615 | <xsl:choose>
|
---|
[66274] | 2616 | <!-- modifiers -->
|
---|
[16406] | 2617 | <xsl:when test="name(current())='type' and ../@mod">
|
---|
| 2618 | <xsl:choose>
|
---|
| 2619 | <xsl:when test="../@mod='ptr'">
|
---|
| 2620 | <xsl:choose>
|
---|
| 2621 | <!-- standard types -->
|
---|
| 2622 | <!--xsl:when test=".='result'">??</xsl:when-->
|
---|
| 2623 | <xsl:when test=".='boolean'">PRBool *</xsl:when>
|
---|
| 2624 | <xsl:when test=".='octet'">PRUint8 *</xsl:when>
|
---|
| 2625 | <xsl:when test=".='short'">PRInt16 *</xsl:when>
|
---|
| 2626 | <xsl:when test=".='unsigned short'">PRUint16 *</xsl:when>
|
---|
| 2627 | <xsl:when test=".='long'">PRInt32 *</xsl:when>
|
---|
| 2628 | <xsl:when test=".='long long'">PRInt64 *</xsl:when>
|
---|
| 2629 | <xsl:when test=".='unsigned long'">PRUint32 *</xsl:when>
|
---|
| 2630 | <xsl:when test=".='unsigned long long'">PRUint64 *</xsl:when>
|
---|
[23223] | 2631 | <xsl:otherwise>
|
---|
| 2632 | <xsl:message terminate="yes">
|
---|
| 2633 | <xsl:value-of select="concat(../../../@name,'::',../../@name,'::',../@name,': ')"/>
|
---|
| 2634 | <xsl:text>attribute 'mod=</xsl:text>
|
---|
| 2635 | <xsl:value-of select="concat('"',../@mod,'"')"/>
|
---|
| 2636 | <xsl:text>' cannot be used with type </xsl:text>
|
---|
| 2637 | <xsl:value-of select="concat('"',current(),'"!')"/>
|
---|
| 2638 | </xsl:message>
|
---|
| 2639 | </xsl:otherwise>
|
---|
[16406] | 2640 | </xsl:choose>
|
---|
| 2641 | </xsl:when>
|
---|
[23223] | 2642 | <xsl:when test="../@mod='string'">
|
---|
| 2643 | <xsl:choose>
|
---|
| 2644 | <!-- standard types -->
|
---|
| 2645 | <!--xsl:when test=".='result'">??</xsl:when-->
|
---|
| 2646 | <xsl:when test=".='uuid'">PRUnichar *</xsl:when>
|
---|
| 2647 | <xsl:otherwise>
|
---|
| 2648 | <xsl:message terminate="yes">
|
---|
| 2649 | <xsl:value-of select="concat(../../../@name,'::',../../@name,'::',../@name,': ')"/>
|
---|
| 2650 | <xsl:text>attribute 'mod=</xsl:text>
|
---|
| 2651 | <xsl:value-of select="concat('"',../@mod,'"')"/>
|
---|
| 2652 | <xsl:text>' cannot be used with type </xsl:text>
|
---|
| 2653 | <xsl:value-of select="concat('"',current(),'"!')"/>
|
---|
| 2654 | </xsl:message>
|
---|
| 2655 | </xsl:otherwise>
|
---|
| 2656 | </xsl:choose>
|
---|
| 2657 | </xsl:when>
|
---|
[16406] | 2658 | </xsl:choose>
|
---|
| 2659 | </xsl:when>
|
---|
| 2660 | <!-- no modifiers -->
|
---|
| 2661 | <xsl:otherwise>
|
---|
| 2662 | <xsl:choose>
|
---|
| 2663 | <!-- standard types -->
|
---|
| 2664 | <xsl:when test=".='result'">nsresult</xsl:when>
|
---|
| 2665 | <xsl:when test=".='boolean'">PRBool</xsl:when>
|
---|
| 2666 | <xsl:when test=".='octet'">PRUint8</xsl:when>
|
---|
| 2667 | <xsl:when test=".='short'">PRInt16</xsl:when>
|
---|
| 2668 | <xsl:when test=".='unsigned short'">PRUint16</xsl:when>
|
---|
| 2669 | <xsl:when test=".='long'">PRInt32</xsl:when>
|
---|
| 2670 | <xsl:when test=".='long long'">PRInt64</xsl:when>
|
---|
| 2671 | <xsl:when test=".='unsigned long'">PRUint32</xsl:when>
|
---|
| 2672 | <xsl:when test=".='unsigned long long'">PRUint64</xsl:when>
|
---|
| 2673 | <xsl:when test=".='char'">char</xsl:when>
|
---|
| 2674 | <xsl:when test=".='wchar'">PRUnichar</xsl:when>
|
---|
| 2675 | <!-- string types -->
|
---|
| 2676 | <xsl:when test=".='string'">char *</xsl:when>
|
---|
| 2677 | <xsl:when test=".='wstring'">PRUnichar *</xsl:when>
|
---|
| 2678 | <!-- UUID type -->
|
---|
| 2679 | <xsl:when test=".='uuid'">
|
---|
| 2680 | <xsl:choose>
|
---|
| 2681 | <xsl:when test="name(..)='attribute'">
|
---|
| 2682 | <xsl:choose>
|
---|
| 2683 | <xsl:when test="../@readonly='yes'">
|
---|
| 2684 | <xsl:text>nsID *</xsl:text>
|
---|
| 2685 | </xsl:when>
|
---|
| 2686 | </xsl:choose>
|
---|
| 2687 | </xsl:when>
|
---|
| 2688 | <xsl:when test="name(..)='param'">
|
---|
| 2689 | <xsl:choose>
|
---|
| 2690 | <xsl:when test="../@dir='in' and not(../@safearray='yes')">
|
---|
| 2691 | <xsl:text>const nsID *</xsl:text>
|
---|
| 2692 | </xsl:when>
|
---|
| 2693 | <xsl:otherwise>
|
---|
| 2694 | <xsl:text>nsID *</xsl:text>
|
---|
| 2695 | </xsl:otherwise>
|
---|
| 2696 | </xsl:choose>
|
---|
| 2697 | </xsl:when>
|
---|
| 2698 | </xsl:choose>
|
---|
| 2699 | </xsl:when>
|
---|
| 2700 | <!-- system interface types -->
|
---|
| 2701 | <xsl:when test=".='$unknown'">nsISupports *</xsl:when>
|
---|
| 2702 | <xsl:otherwise>
|
---|
| 2703 | <xsl:choose>
|
---|
| 2704 | <!-- enum types -->
|
---|
| 2705 | <xsl:when test="
|
---|
[66274] | 2706 | (ancestor::library/application/enum[@name=current()]) or
|
---|
| 2707 | (ancestor::library/application/if[@target=$self_target]/enum[@name=current()])
|
---|
[16406] | 2708 | ">
|
---|
| 2709 | <xsl:text>PRUint32</xsl:text>
|
---|
| 2710 | </xsl:when>
|
---|
| 2711 | <!-- custom interface types -->
|
---|
| 2712 | <xsl:when test="
|
---|
[66274] | 2713 | (ancestor::library/application/interface[@name=current()]) or
|
---|
| 2714 | (ancestor::library/application/if[@target=$self_target]/interface[@name=current()])
|
---|
[16406] | 2715 | ">
|
---|
| 2716 | <xsl:value-of select="."/>
|
---|
| 2717 | <xsl:text> *</xsl:text>
|
---|
| 2718 | </xsl:when>
|
---|
| 2719 | <!-- other types -->
|
---|
| 2720 | </xsl:choose>
|
---|
| 2721 | </xsl:otherwise>
|
---|
| 2722 | </xsl:choose>
|
---|
| 2723 | </xsl:otherwise>
|
---|
| 2724 | </xsl:choose>
|
---|
| 2725 | </xsl:template>
|
---|
| 2726 |
|
---|
| 2727 |
|
---|
[66274] | 2728 | <xsl:template match="application[@uuid='ec0e78e8-fa43-43e8-ac0a-02c784c4a4fa']//module/class" />
|
---|
| 2729 |
|
---|
| 2730 | <xsl:template match="application[@uuid='ec0e78e8-fa43-43e8-ac0a-02c784c4a4fa']/if//interface
|
---|
| 2731 | | application[@uuid='ec0e78e8-fa43-43e8-ac0a-02c784c4a4fa']//interface" />
|
---|
| 2732 |
|
---|
| 2733 | <xsl:template match="application[@uuid='ec0e78e8-fa43-43e8-ac0a-02c784c4a4fa']//interface" mode="forward" />
|
---|
| 2734 |
|
---|
| 2735 |
|
---|
[69377] | 2736 | </xsl:stylesheet>
|
---|