xpcom/base/nsrootidl.idl

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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/. */
     6 /**
     7  * Root idl declarations to be used by all.
     8  */
    10 %{C++
    12 #include "nscore.h"
    13 typedef int64_t PRTime;
    15 /*
    16  * Forward declarations for new string types
    17  */
    18 class nsAString;
    19 class nsACString;
    21 /* 
    22  * Start commenting out the C++ versions of the below in the output header
    23  */
    24 #if 0
    25 %}
    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  ;
    38 typedef unsigned long       nsrefcnt ;
    39 typedef unsigned long       nsresult ;
    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;
    45 [ptr]         native voidPtr(void);
    46 [ptr]         native charPtr(char);
    47 [ptr]         native unicharPtr(char16_t);
    49 [ref, nsid]   native nsIDRef(nsID);
    50 [ref, nsid]   native nsIIDRef(nsIID);
    51 [ref, nsid]   native nsCIDRef(nsCID);
    53 [ptr, nsid]   native nsIDPtr(nsID);
    54 [ptr, nsid]   native nsIIDPtr(nsIID);
    55 [ptr, nsid]   native nsCIDPtr(nsCID);
    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
    67 [nsid]        native nsIID(nsIID);
    68 [nsid]        native nsID(nsID);
    69 [nsid]        native nsCID(nsCID);
    71 [ptr]         native nsQIResult(void);
    73 [ref, domstring] native DOMString(ignored);
    74 [ref, domstring] native DOMStringRef(ignored);
    75 [ptr, domstring] native DOMStringPtr(ignored);
    77 [ref, utf8string] native AUTF8String(ignored);
    78 [ref, utf8string] native AUTF8StringRef(ignored);
    79 [ptr, utf8string] native AUTF8StringPtr(ignored);
    81 [ref, cstring] native ACString(ignored);
    82 [ref, cstring] native ACStringRef(ignored);
    83 [ptr, cstring] native ACStringPtr(ignored);
    85 [ref, astring] native AString(ignored);
    86 [ref, astring] native AStringRef(ignored);
    87 [ptr, astring] native AStringPtr(ignored);
    89 [ref, jsval]  native jsval(jsval);
    90               native jsid(jsid);
    92 %{C++
    93 /* 
    94  * End commenting out the C++ versions of the above in the output header
    95  */
    96 #endif
    97 %}

mercurial