1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/xpcom/base/nsrootidl.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,97 @@ 1.4 +/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +/** 1.10 + * Root idl declarations to be used by all. 1.11 + */ 1.12 + 1.13 +%{C++ 1.14 + 1.15 +#include "nscore.h" 1.16 +typedef int64_t PRTime; 1.17 + 1.18 +/* 1.19 + * Forward declarations for new string types 1.20 + */ 1.21 +class nsAString; 1.22 +class nsACString; 1.23 + 1.24 +/* 1.25 + * Start commenting out the C++ versions of the below in the output header 1.26 + */ 1.27 +#if 0 1.28 +%} 1.29 + 1.30 +typedef boolean bool ; 1.31 +typedef octet uint8_t ; 1.32 +typedef unsigned short uint16_t ; 1.33 +typedef unsigned short char16_t; 1.34 +typedef unsigned long uint32_t ; 1.35 +typedef unsigned long long uint64_t ; 1.36 +typedef long long PRTime ; 1.37 +typedef short int16_t ; 1.38 +typedef long int32_t ; 1.39 +typedef long long int64_t ; 1.40 + 1.41 +typedef unsigned long nsrefcnt ; 1.42 +typedef unsigned long nsresult ; 1.43 + 1.44 +// XXX need this built into xpidl compiler so that it's really size_t or size_t 1.45 +// and it's scriptable: 1.46 +typedef unsigned long size_t; 1.47 + 1.48 +[ptr] native voidPtr(void); 1.49 +[ptr] native charPtr(char); 1.50 +[ptr] native unicharPtr(char16_t); 1.51 + 1.52 +[ref, nsid] native nsIDRef(nsID); 1.53 +[ref, nsid] native nsIIDRef(nsIID); 1.54 +[ref, nsid] native nsCIDRef(nsCID); 1.55 + 1.56 +[ptr, nsid] native nsIDPtr(nsID); 1.57 +[ptr, nsid] native nsIIDPtr(nsIID); 1.58 +[ptr, nsid] native nsCIDPtr(nsCID); 1.59 + 1.60 +// NOTE: Be careful in using the following 3 types. The *Ref and *Ptr variants 1.61 +// are more commonly used (and better supported). Those variants require 1.62 +// nsMemory alloc'd copies when used as 'out' params while these types do not. 1.63 +// However, currently these types can not be used for 'in' params. And, methods 1.64 +// that use them as 'out' params *must* be declared [notxpcom] (with an explicit 1.65 +// return type of nsresult). This makes such methods implicitly not scriptable. 1.66 +// Use of these types in methods without a [notxpcom] declaration will cause 1.67 +// the xpidl compiler to raise an error. 1.68 +// See: http://bugzilla.mozilla.org/show_bug.cgi?id=93792 1.69 + 1.70 +[nsid] native nsIID(nsIID); 1.71 +[nsid] native nsID(nsID); 1.72 +[nsid] native nsCID(nsCID); 1.73 + 1.74 +[ptr] native nsQIResult(void); 1.75 + 1.76 +[ref, domstring] native DOMString(ignored); 1.77 +[ref, domstring] native DOMStringRef(ignored); 1.78 +[ptr, domstring] native DOMStringPtr(ignored); 1.79 + 1.80 +[ref, utf8string] native AUTF8String(ignored); 1.81 +[ref, utf8string] native AUTF8StringRef(ignored); 1.82 +[ptr, utf8string] native AUTF8StringPtr(ignored); 1.83 + 1.84 +[ref, cstring] native ACString(ignored); 1.85 +[ref, cstring] native ACStringRef(ignored); 1.86 +[ptr, cstring] native ACStringPtr(ignored); 1.87 + 1.88 +[ref, astring] native AString(ignored); 1.89 +[ref, astring] native AStringRef(ignored); 1.90 +[ptr, astring] native AStringPtr(ignored); 1.91 + 1.92 +[ref, jsval] native jsval(jsval); 1.93 + native jsid(jsid); 1.94 + 1.95 +%{C++ 1.96 +/* 1.97 + * End commenting out the C++ versions of the above in the output header 1.98 + */ 1.99 +#endif 1.100 +%}