|
1 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 /** |
|
7 * Root idl declarations to be used by all. |
|
8 */ |
|
9 |
|
10 %{C++ |
|
11 |
|
12 #include "nscore.h" |
|
13 typedef int64_t PRTime; |
|
14 |
|
15 /* |
|
16 * Forward declarations for new string types |
|
17 */ |
|
18 class nsAString; |
|
19 class nsACString; |
|
20 |
|
21 /* |
|
22 * Start commenting out the C++ versions of the below in the output header |
|
23 */ |
|
24 #if 0 |
|
25 %} |
|
26 |
|
27 typedef boolean bool ; |
|
28 typedef octet uint8_t ; |
|
29 typedef unsigned short uint16_t ; |
|
30 typedef unsigned short char16_t; |
|
31 typedef unsigned long uint32_t ; |
|
32 typedef unsigned long long uint64_t ; |
|
33 typedef long long PRTime ; |
|
34 typedef short int16_t ; |
|
35 typedef long int32_t ; |
|
36 typedef long long int64_t ; |
|
37 |
|
38 typedef unsigned long nsrefcnt ; |
|
39 typedef unsigned long nsresult ; |
|
40 |
|
41 // XXX need this built into xpidl compiler so that it's really size_t or size_t |
|
42 // and it's scriptable: |
|
43 typedef unsigned long size_t; |
|
44 |
|
45 [ptr] native voidPtr(void); |
|
46 [ptr] native charPtr(char); |
|
47 [ptr] native unicharPtr(char16_t); |
|
48 |
|
49 [ref, nsid] native nsIDRef(nsID); |
|
50 [ref, nsid] native nsIIDRef(nsIID); |
|
51 [ref, nsid] native nsCIDRef(nsCID); |
|
52 |
|
53 [ptr, nsid] native nsIDPtr(nsID); |
|
54 [ptr, nsid] native nsIIDPtr(nsIID); |
|
55 [ptr, nsid] native nsCIDPtr(nsCID); |
|
56 |
|
57 // NOTE: Be careful in using the following 3 types. The *Ref and *Ptr variants |
|
58 // are more commonly used (and better supported). Those variants require |
|
59 // nsMemory alloc'd copies when used as 'out' params while these types do not. |
|
60 // However, currently these types can not be used for 'in' params. And, methods |
|
61 // that use them as 'out' params *must* be declared [notxpcom] (with an explicit |
|
62 // return type of nsresult). This makes such methods implicitly not scriptable. |
|
63 // Use of these types in methods without a [notxpcom] declaration will cause |
|
64 // the xpidl compiler to raise an error. |
|
65 // See: http://bugzilla.mozilla.org/show_bug.cgi?id=93792 |
|
66 |
|
67 [nsid] native nsIID(nsIID); |
|
68 [nsid] native nsID(nsID); |
|
69 [nsid] native nsCID(nsCID); |
|
70 |
|
71 [ptr] native nsQIResult(void); |
|
72 |
|
73 [ref, domstring] native DOMString(ignored); |
|
74 [ref, domstring] native DOMStringRef(ignored); |
|
75 [ptr, domstring] native DOMStringPtr(ignored); |
|
76 |
|
77 [ref, utf8string] native AUTF8String(ignored); |
|
78 [ref, utf8string] native AUTF8StringRef(ignored); |
|
79 [ptr, utf8string] native AUTF8StringPtr(ignored); |
|
80 |
|
81 [ref, cstring] native ACString(ignored); |
|
82 [ref, cstring] native ACStringRef(ignored); |
|
83 [ptr, cstring] native ACStringPtr(ignored); |
|
84 |
|
85 [ref, astring] native AString(ignored); |
|
86 [ref, astring] native AStringRef(ignored); |
|
87 [ptr, astring] native AStringPtr(ignored); |
|
88 |
|
89 [ref, jsval] native jsval(jsval); |
|
90 native jsid(jsid); |
|
91 |
|
92 %{C++ |
|
93 /* |
|
94 * End commenting out the C++ versions of the above in the output header |
|
95 */ |
|
96 #endif |
|
97 %} |