nsISupportsImpl.h
上传用户:goldcmy89
上传日期:2017-12-03
资源大小:2246k
文件大小:67k
源码类别:

PlugIns编程

开发平台:

Visual C++

  1. /* ***** BEGIN LICENSE BLOCK *****
  2.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  3.  *
  4.  * The contents of this file are subject to the Mozilla Public License Version
  5.  * 1.1 (the "License"); you may not use this file except in compliance with
  6.  * the License. You may obtain a copy of the License at
  7.  * http://www.mozilla.org/MPL/
  8.  *
  9.  * Software distributed under the License is distributed on an "AS IS" basis,
  10.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  11.  * for the specific language governing rights and limitations under the
  12.  * License.
  13.  *
  14.  * The Original Code is XPCOM.
  15.  *
  16.  * The Initial Developer of the Original Code is Netscape Communications Corp.
  17.  * Portions created by the Initial Developer are Copyright (C) 2001
  18.  * the Initial Developer. All Rights Reserved.
  19.  *
  20.  * Contributor(s):
  21.  *
  22.  * Alternatively, the contents of this file may be used under the terms of
  23.  * either the GNU General Public License Version 2 or later (the "GPL"), or
  24.  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  25.  * in which case the provisions of the GPL or the LGPL are applicable instead
  26.  * of those above. If you wish to allow use of your version of this file only
  27.  * under the terms of either the GPL or the LGPL, and not to allow others to
  28.  * use your version of this file under the terms of the MPL, indicate your
  29.  * decision by deleting the provisions above and replace them with the notice
  30.  * and other provisions required by the GPL or the LGPL. If you do not delete
  31.  * the provisions above, a recipient may use your version of this file under
  32.  * the terms of any one of the MPL, the GPL or the LGPL.
  33.  *
  34.  * ***** END LICENSE BLOCK ***** */
  35. #ifndef nsISupportsImpl_h__
  36. #define nsISupportsImpl_h__
  37. #ifndef nscore_h___
  38. #include "nscore.h"
  39. #endif
  40. #ifndef nsISupportsBase_h__
  41. #include "nsISupportsBase.h"
  42. #endif
  43. #if defined(XPCOM_GLUE) && !defined(XPCOM_GLUE_USE_NSPR)
  44. // If we're being linked as standalone glue, we don't want a dynamic dependency
  45. // on NSPR libs, so we skip the debug thread-safety checks, and we cannot use
  46. // the THREADSAFE_ISUPPORTS macros.
  47. #define XPCOM_GLUE_AVOID_NSPR
  48. #endif
  49. #if !defined(XPCOM_GLUE_AVOID_NSPR)
  50. #include "prthread.h" /* needed for thread-safety checks */
  51. #include "pratom.h"   /* needed for PR_AtomicIncrement and PR_AtomicDecrement */
  52. #endif
  53. #include "nsDebug.h"
  54. #include "nsTraceRefcnt.h" 
  55. ////////////////////////////////////////////////////////////////////////////////
  56. // Macros to help detect thread-safety:
  57. #if defined(NS_DEBUG) && !defined(XPCOM_GLUE_AVOID_NSPR)
  58. class nsAutoOwningThread {
  59. public:
  60.     nsAutoOwningThread() { mThread = PR_GetCurrentThread(); }
  61.     void *GetThread() const { return mThread; }
  62. private:
  63.     void *mThread;
  64. };
  65. #define NS_DECL_OWNINGTHREAD            nsAutoOwningThread _mOwningThread;
  66. #define NS_ASSERT_OWNINGTHREAD(_class) 
  67.   NS_CheckThreadSafe(_mOwningThread.GetThread(), #_class " not thread-safe")
  68. #else // !NS_DEBUG
  69. #define NS_DECL_OWNINGTHREAD            /* nothing */
  70. #define NS_ASSERT_OWNINGTHREAD(_class)  ((void)0)
  71. #endif // NS_DEBUG
  72. class nsAutoRefCnt {
  73.  public:
  74.     nsAutoRefCnt() : mValue(0) {}
  75.     nsAutoRefCnt(nsrefcnt aValue) : mValue(aValue) {}
  76.     // only support prefix increment/decrement
  77.     nsrefcnt operator++() { return ++mValue; }
  78.     nsrefcnt operator--() { return --mValue; }
  79.     
  80.     nsrefcnt operator=(nsrefcnt aValue) { return (mValue = aValue); }
  81.     operator nsrefcnt() const { return mValue; }
  82.     nsrefcnt get() const { return mValue; }
  83.  private:
  84.     // do not define these to enforce the faster prefix notation
  85.     nsrefcnt operator++(int);
  86.     nsrefcnt operator--(int);
  87.     nsrefcnt mValue;
  88. };
  89. ///////////////////////////////////////////////////////////////////////////////
  90. /**
  91.  * Declare the reference count variable and the implementations of the
  92.  * AddRef and QueryInterface methods.
  93.  */
  94. #define NS_DECL_ISUPPORTS                                                     
  95. public:                                                                       
  96.   NS_IMETHOD QueryInterface(REFNSIID aIID,                                    
  97.                             void** aInstancePtr);                             
  98.   NS_IMETHOD_(nsrefcnt) AddRef(void);                                         
  99.   NS_IMETHOD_(nsrefcnt) Release(void);                                        
  100. protected:                                                                    
  101.   nsAutoRefCnt mRefCnt;                                                       
  102.   NS_DECL_OWNINGTHREAD                                                        
  103. public:
  104. ///////////////////////////////////////////////////////////////////////////////
  105. /**
  106.  * Previously used to initialize the reference count, but no longer needed.
  107.  *
  108.  * DEPRECATED.
  109.  */
  110. #define NS_INIT_ISUPPORTS() ((void)0)
  111. /**
  112.  * Use this macro to implement the AddRef method for a given <i>_class</i>
  113.  * @param _class The name of the class implementing the method
  114.  */
  115. #define NS_IMPL_ADDREF(_class)                                                
  116. NS_IMETHODIMP_(nsrefcnt) _class::AddRef(void)                                 
  117. {                                                                             
  118.   NS_PRECONDITION(PRInt32(mRefCnt) >= 0, "illegal refcnt");                   
  119.   NS_ASSERT_OWNINGTHREAD(_class);                                             
  120.   ++mRefCnt;                                                                  
  121.   NS_LOG_ADDREF(this, mRefCnt, #_class, sizeof(*this));                       
  122.   return mRefCnt;                                                             
  123. }
  124. /**
  125.  * Use this macro to implement the AddRef method for a given <i>_class</i>
  126.  * implemented as a wholly owned aggregated object intended to implement
  127.  * interface(s) for its owner
  128.  * @param _class The name of the class implementing the method
  129.  * @param _aggregator the owning/containing object
  130.  */
  131. #define NS_IMPL_ADDREF_USING_AGGREGATOR(_class, _aggregator)                  
  132. NS_IMETHODIMP_(nsrefcnt) _class::AddRef(void)                                 
  133. {                                                                             
  134.   NS_PRECONDITION(_aggregator, "null aggregator");                            
  135.   return (_aggregator)->AddRef();                                             
  136. }
  137. /**
  138.  * Use this macro to implement the Release method for a given
  139.  * <i>_class</i>.
  140.  * @param _class The name of the class implementing the method
  141.  * @param _destroy A statement that is executed when the object's
  142.  *   refcount drops to zero.
  143.  *
  144.  * For example,
  145.  *
  146.  *   NS_IMPL_RELEASE_WITH_DESTROY(Foo, Destroy(this))
  147.  *
  148.  * will cause
  149.  *
  150.  *   Destroy(this);
  151.  *
  152.  * to be invoked when the object's refcount drops to zero. This
  153.  * allows for arbitrary teardown activity to occur (e.g., deallocation
  154.  * of object allocated with placement new).
  155.  */
  156. #define NS_IMPL_RELEASE_WITH_DESTROY(_class, _destroy)                        
  157. NS_IMETHODIMP_(nsrefcnt) _class::Release(void)                                
  158. {                                                                             
  159.   NS_PRECONDITION(0 != mRefCnt, "dup release");                               
  160.   NS_ASSERT_OWNINGTHREAD(_class);                                             
  161.   --mRefCnt;                                                                  
  162.   NS_LOG_RELEASE(this, mRefCnt, #_class);                                     
  163.   if (mRefCnt == 0) {                                                         
  164.     mRefCnt = 1; /* stabilize */                                              
  165.     _destroy;                                                                 
  166.     return 0;                                                                 
  167.   }                                                                           
  168.   return mRefCnt;                                                             
  169. }
  170. /**
  171.  * Use this macro to implement the Release method for a given <i>_class</i>
  172.  * @param _class The name of the class implementing the method
  173.  *
  174.  * A note on the 'stabilization' of the refcnt to one. At that point,
  175.  * the object's refcount will have gone to zero. The object's
  176.  * destructor may trigger code that attempts to QueryInterface() and
  177.  * Release() 'this' again. Doing so will temporarily increment and
  178.  * decrement the refcount. (Only a logic error would make one try to
  179.  * keep a permanent hold on 'this'.)  To prevent re-entering the
  180.  * destructor, we make sure that no balanced refcounting can return
  181.  * the refcount to |0|.
  182.  */
  183. #define NS_IMPL_RELEASE(_class) 
  184.   NS_IMPL_RELEASE_WITH_DESTROY(_class, NS_DELETEXPCOM(this))
  185. /**
  186.  * Use this macro to implement the Release method for a given <i>_class</i>
  187.  * implemented as a wholly owned aggregated object intended to implement
  188.  * interface(s) for its owner
  189.  * @param _class The name of the class implementing the method
  190.  * @param _aggregator the owning/containing object
  191.  */
  192. #define NS_IMPL_RELEASE_USING_AGGREGATOR(_class, _aggregator)                 
  193. NS_IMETHODIMP_(nsrefcnt) _class::Release(void)                                
  194. {                                                                             
  195.   NS_PRECONDITION(_aggregator, "null aggregator");                            
  196.   return (_aggregator)->Release();                                            
  197. }
  198. ///////////////////////////////////////////////////////////////////////////////
  199. /*
  200.  * Some convenience macros for implementing QueryInterface
  201.  */
  202. /**
  203.  * This implements query interface with two assumptions: First, the
  204.  * class in question implements nsISupports and its own interface and
  205.  * nothing else. Second, the implementation of the class's primary
  206.  * inheritance chain leads to its own interface.
  207.  *
  208.  * @param _class The name of the class implementing the method
  209.  * @param _classiiddef The name of the #define symbol that defines the IID
  210.  * for the class (e.g. NS_ISUPPORTS_IID)
  211.  */
  212. #define NS_IMPL_QUERY_HEAD(_class)                                            
  213. NS_IMETHODIMP _class::QueryInterface(REFNSIID aIID, void** aInstancePtr)      
  214. {                                                                             
  215.   NS_ASSERTION(aInstancePtr,                                                  
  216.                "QueryInterface requires a non-NULL destination!");            
  217.   nsISupports* foundInterface;
  218. #define NS_IMPL_QUERY_BODY(_interface)                                        
  219.   if ( aIID.Equals(NS_GET_IID(_interface)) )                                  
  220.     foundInterface = NS_STATIC_CAST(_interface*, this);                       
  221.   else
  222. #define NS_IMPL_QUERY_BODY_CONDITIONAL(_interface, condition)                 
  223.   if ( (condition) && aIID.Equals(NS_GET_IID(_interface)))                    
  224.     foundInterface = NS_STATIC_CAST(_interface*, this);                       
  225.   else
  226. #define NS_IMPL_QUERY_BODY_AMBIGUOUS(_interface, _implClass)                  
  227.   if ( aIID.Equals(NS_GET_IID(_interface)) )                                  
  228.     foundInterface = NS_STATIC_CAST(_interface*,                              
  229.                                     NS_STATIC_CAST(_implClass*, this));       
  230.   else
  231. #define NS_IMPL_QUERY_BODY_AGGREGATED(_interface, _aggregate)                 
  232.   if ( aIID.Equals(NS_GET_IID(_interface)) )                                  
  233.     foundInterface = NS_STATIC_CAST(_interface*, _aggregate);                 
  234.   else
  235. #define NS_IMPL_QUERY_TAIL_GUTS                                               
  236.     foundInterface = 0;                                                       
  237.   nsresult status;                                                            
  238.   if ( !foundInterface )                                                      
  239.     status = NS_NOINTERFACE;                                                  
  240.   else                                                                        
  241.     {                                                                         
  242.       NS_ADDREF(foundInterface);                                              
  243.       status = NS_OK;                                                         
  244.     }                                                                         
  245.   *aInstancePtr = foundInterface;                                             
  246.   return status;                                                              
  247. }
  248. #define NS_IMPL_QUERY_TAIL_INHERITING(_baseclass)                             
  249.     foundInterface = 0;                                                       
  250.   nsresult status;                                                            
  251.   if ( !foundInterface )                                                      
  252.     status = _baseclass::QueryInterface(aIID, (void**)&foundInterface);       
  253.   else                                                                        
  254.     {                                                                         
  255.       NS_ADDREF(foundInterface);                                              
  256.       status = NS_OK;                                                         
  257.     }                                                                         
  258.   *aInstancePtr = foundInterface;                                             
  259.   return status;                                                              
  260. }
  261. #define NS_IMPL_QUERY_TAIL_USING_AGGREGATOR(_aggregator)                      
  262.     foundInterface = 0;                                                       
  263.   nsresult status;                                                            
  264.   if ( !foundInterface ) {                                                    
  265.     NS_ASSERTION(_aggregator, "null aggregator");                             
  266.     status = _aggregator->QueryInterface(aIID, (void**)&foundInterface);      
  267.   } else                                                                      
  268.     {                                                                         
  269.       NS_ADDREF(foundInterface);                                              
  270.       status = NS_OK;                                                         
  271.     }                                                                         
  272.   *aInstancePtr = foundInterface;                                             
  273.   return status;                                                              
  274. }
  275. #define NS_IMPL_QUERY_TAIL(_supports_interface)                               
  276.   NS_IMPL_QUERY_BODY_AMBIGUOUS(nsISupports, _supports_interface)              
  277.   NS_IMPL_QUERY_TAIL_GUTS
  278.   /*
  279.     This is the new scheme.  Using this notation now will allow us to switch to
  280.     a table driven mechanism when it's ready.  Note the difference between this
  281.     and the (currently) underlying NS_IMPL_QUERY_INTERFACE mechanism.  You must
  282.     explicitly mention |nsISupports| when using the interface maps.
  283.   */
  284. #define NS_INTERFACE_MAP_BEGIN(_implClass)      NS_IMPL_QUERY_HEAD(_implClass)
  285. #define NS_INTERFACE_MAP_ENTRY(_interface)      NS_IMPL_QUERY_BODY(_interface)
  286. #define NS_INTERFACE_MAP_ENTRY_CONDITIONAL(_interface, condition)             
  287.   NS_IMPL_QUERY_BODY_CONDITIONAL(_interface, condition)
  288. #define NS_INTERFACE_MAP_ENTRY_AGGREGATED(_interface,_aggregate)              
  289.   NS_IMPL_QUERY_BODY_AGGREGATED(_interface,_aggregate)
  290. #define NS_INTERFACE_MAP_END                    NS_IMPL_QUERY_TAIL_GUTS
  291. #define NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(_interface, _implClass)              
  292.   NS_IMPL_QUERY_BODY_AMBIGUOUS(_interface, _implClass)
  293. #define NS_INTERFACE_MAP_END_INHERITING(_baseClass)                           
  294.   NS_IMPL_QUERY_TAIL_INHERITING(_baseClass)
  295. #define NS_INTERFACE_MAP_END_AGGREGATED(_aggregator)                          
  296.   NS_IMPL_QUERY_TAIL_USING_AGGREGATOR(_aggregator)
  297. #define NS_IMPL_QUERY_INTERFACE0(_class)                                      
  298.   NS_INTERFACE_MAP_BEGIN(_class)                                              
  299.     NS_INTERFACE_MAP_ENTRY(nsISupports)                                       
  300.   NS_INTERFACE_MAP_END
  301. #define NS_IMPL_QUERY_INTERFACE1(_class, _i1)                                 
  302.   NS_INTERFACE_MAP_BEGIN(_class)                                              
  303.     NS_INTERFACE_MAP_ENTRY(_i1)                                               
  304.     NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, _i1)                        
  305.   NS_INTERFACE_MAP_END
  306. #define NS_IMPL_QUERY_INTERFACE2(_class, _i1, _i2)                            
  307.   NS_INTERFACE_MAP_BEGIN(_class)                                              
  308.     NS_INTERFACE_MAP_ENTRY(_i1)                                               
  309.     NS_INTERFACE_MAP_ENTRY(_i2)                                               
  310.     NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, _i1)                        
  311.   NS_INTERFACE_MAP_END
  312. #define NS_IMPL_QUERY_INTERFACE3(_class, _i1, _i2, _i3)                       
  313.   NS_INTERFACE_MAP_BEGIN(_class)                                              
  314.     NS_INTERFACE_MAP_ENTRY(_i1)                                               
  315.     NS_INTERFACE_MAP_ENTRY(_i2)                                               
  316.     NS_INTERFACE_MAP_ENTRY(_i3)                                               
  317.     NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, _i1)                        
  318.   NS_INTERFACE_MAP_END
  319. #define NS_IMPL_QUERY_INTERFACE4(_class, _i1, _i2, _i3, _i4)                  
  320.   NS_INTERFACE_MAP_BEGIN(_class)                                              
  321.     NS_INTERFACE_MAP_ENTRY(_i1)                                               
  322.     NS_INTERFACE_MAP_ENTRY(_i2)                                               
  323.     NS_INTERFACE_MAP_ENTRY(_i3)                                               
  324.     NS_INTERFACE_MAP_ENTRY(_i4)                                               
  325.     NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, _i1)                        
  326.   NS_INTERFACE_MAP_END
  327. #define NS_IMPL_QUERY_INTERFACE5(_class, _i1, _i2, _i3, _i4, _i5)             
  328.   NS_INTERFACE_MAP_BEGIN(_class)                                              
  329.     NS_INTERFACE_MAP_ENTRY(_i1)                                               
  330.     NS_INTERFACE_MAP_ENTRY(_i2)                                               
  331.     NS_INTERFACE_MAP_ENTRY(_i3)                                               
  332.     NS_INTERFACE_MAP_ENTRY(_i4)                                               
  333.     NS_INTERFACE_MAP_ENTRY(_i5)                                               
  334.     NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, _i1)                        
  335.   NS_INTERFACE_MAP_END
  336. #define NS_IMPL_QUERY_INTERFACE6(_class, _i1, _i2, _i3, _i4, _i5, _i6)        
  337.   NS_INTERFACE_MAP_BEGIN(_class)                                              
  338.     NS_INTERFACE_MAP_ENTRY(_i1)                                               
  339.     NS_INTERFACE_MAP_ENTRY(_i2)                                               
  340.     NS_INTERFACE_MAP_ENTRY(_i3)                                               
  341.     NS_INTERFACE_MAP_ENTRY(_i4)                                               
  342.     NS_INTERFACE_MAP_ENTRY(_i5)                                               
  343.     NS_INTERFACE_MAP_ENTRY(_i6)                                               
  344.     NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, _i1)                        
  345.   NS_INTERFACE_MAP_END
  346. #define NS_IMPL_QUERY_INTERFACE7(_class, _i1, _i2, _i3, _i4, _i5, _i6, _i7)   
  347.   NS_INTERFACE_MAP_BEGIN(_class)                                              
  348.     NS_INTERFACE_MAP_ENTRY(_i1)                                               
  349.     NS_INTERFACE_MAP_ENTRY(_i2)                                               
  350.     NS_INTERFACE_MAP_ENTRY(_i3)                                               
  351.     NS_INTERFACE_MAP_ENTRY(_i4)                                               
  352.     NS_INTERFACE_MAP_ENTRY(_i5)                                               
  353.     NS_INTERFACE_MAP_ENTRY(_i6)                                               
  354.     NS_INTERFACE_MAP_ENTRY(_i7)                                               
  355.     NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, _i1)                        
  356.   NS_INTERFACE_MAP_END
  357. #define NS_IMPL_QUERY_INTERFACE8(_class, _i1, _i2, _i3, _i4, _i5, _i6,        
  358.                                  _i7, _i8)                                    
  359.   NS_INTERFACE_MAP_BEGIN(_class)                                              
  360.     NS_INTERFACE_MAP_ENTRY(_i1)                                               
  361.     NS_INTERFACE_MAP_ENTRY(_i2)                                               
  362.     NS_INTERFACE_MAP_ENTRY(_i3)                                               
  363.     NS_INTERFACE_MAP_ENTRY(_i4)                                               
  364.     NS_INTERFACE_MAP_ENTRY(_i5)                                               
  365.     NS_INTERFACE_MAP_ENTRY(_i6)                                               
  366.     NS_INTERFACE_MAP_ENTRY(_i7)                                               
  367.     NS_INTERFACE_MAP_ENTRY(_i8)                                               
  368.     NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, _i1)                        
  369.   NS_INTERFACE_MAP_END
  370. #define NS_IMPL_QUERY_INTERFACE9(_class, _i1, _i2, _i3, _i4, _i5, _i6,        
  371.                                  _i7, _i8, _i9)                               
  372.   NS_INTERFACE_MAP_BEGIN(_class)                                              
  373.     NS_INTERFACE_MAP_ENTRY(_i1)                                               
  374.     NS_INTERFACE_MAP_ENTRY(_i2)                                               
  375.     NS_INTERFACE_MAP_ENTRY(_i3)                                               
  376.     NS_INTERFACE_MAP_ENTRY(_i4)                                               
  377.     NS_INTERFACE_MAP_ENTRY(_i5)                                               
  378.     NS_INTERFACE_MAP_ENTRY(_i6)                                               
  379.     NS_INTERFACE_MAP_ENTRY(_i7)                                               
  380.     NS_INTERFACE_MAP_ENTRY(_i8)                                               
  381.     NS_INTERFACE_MAP_ENTRY(_i9)                                               
  382.     NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, _i1)                        
  383.   NS_INTERFACE_MAP_END
  384. #define NS_IMPL_QUERY_INTERFACE10(_class, _i1, _i2, _i3, _i4, _i5, _i6,       
  385.                                   _i7, _i8, _i9, _i10)                        
  386.   NS_INTERFACE_MAP_BEGIN(_class)                                              
  387.     NS_INTERFACE_MAP_ENTRY(_i1)                                               
  388.     NS_INTERFACE_MAP_ENTRY(_i2)                                               
  389.     NS_INTERFACE_MAP_ENTRY(_i3)                                               
  390.     NS_INTERFACE_MAP_ENTRY(_i4)                                               
  391.     NS_INTERFACE_MAP_ENTRY(_i5)                                               
  392.     NS_INTERFACE_MAP_ENTRY(_i6)                                               
  393.     NS_INTERFACE_MAP_ENTRY(_i7)                                               
  394.     NS_INTERFACE_MAP_ENTRY(_i8)                                               
  395.     NS_INTERFACE_MAP_ENTRY(_i9)                                               
  396.     NS_INTERFACE_MAP_ENTRY(_i10)                                              
  397.     NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, _i1)                        
  398.   NS_INTERFACE_MAP_END
  399. #define NS_IMPL_QUERY_INTERFACE11(_class, _i1, _i2, _i3, _i4, _i5, _i6,       
  400.                                   _i7, _i8, _i9, _i10, _i11)                  
  401.   NS_INTERFACE_MAP_BEGIN(_class)                                              
  402.     NS_INTERFACE_MAP_ENTRY(_i1)                                               
  403.     NS_INTERFACE_MAP_ENTRY(_i2)                                               
  404.     NS_INTERFACE_MAP_ENTRY(_i3)                                               
  405.     NS_INTERFACE_MAP_ENTRY(_i4)                                               
  406.     NS_INTERFACE_MAP_ENTRY(_i5)                                               
  407.     NS_INTERFACE_MAP_ENTRY(_i6)                                               
  408.     NS_INTERFACE_MAP_ENTRY(_i7)                                               
  409.     NS_INTERFACE_MAP_ENTRY(_i8)                                               
  410.     NS_INTERFACE_MAP_ENTRY(_i9)                                               
  411.     NS_INTERFACE_MAP_ENTRY(_i10)                                              
  412.     NS_INTERFACE_MAP_ENTRY(_i11)                                              
  413.     NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, _i1)                        
  414.   NS_INTERFACE_MAP_END
  415. #define NS_IMPL_THREADSAFE_QUERY_INTERFACE0  NS_IMPL_QUERY_INTERFACE0
  416. #define NS_IMPL_THREADSAFE_QUERY_INTERFACE1  NS_IMPL_QUERY_INTERFACE1
  417. #define NS_IMPL_THREADSAFE_QUERY_INTERFACE2  NS_IMPL_QUERY_INTERFACE2
  418. #define NS_IMPL_THREADSAFE_QUERY_INTERFACE3  NS_IMPL_QUERY_INTERFACE3
  419. #define NS_IMPL_THREADSAFE_QUERY_INTERFACE4  NS_IMPL_QUERY_INTERFACE4
  420. #define NS_IMPL_THREADSAFE_QUERY_INTERFACE5  NS_IMPL_QUERY_INTERFACE5
  421. #define NS_IMPL_THREADSAFE_QUERY_INTERFACE6  NS_IMPL_QUERY_INTERFACE6
  422. #define NS_IMPL_THREADSAFE_QUERY_INTERFACE7  NS_IMPL_QUERY_INTERFACE7
  423. #define NS_IMPL_THREADSAFE_QUERY_INTERFACE8  NS_IMPL_QUERY_INTERFACE8
  424. #define NS_IMPL_THREADSAFE_QUERY_INTERFACE9  NS_IMPL_QUERY_INTERFACE9
  425. #define NS_IMPL_THREADSAFE_QUERY_INTERFACE10  NS_IMPL_QUERY_INTERFACE10
  426. #define NS_IMPL_THREADSAFE_QUERY_INTERFACE11  NS_IMPL_QUERY_INTERFACE11
  427. /**
  428.  * Declare that you're going to inherit from something that already
  429.  * implements nsISupports, but also implements an additional interface, thus
  430.  * causing an ambiguity. In this case you don't need another mRefCnt, you
  431.  * just need to forward the definitions to the appropriate superclass. E.g.
  432.  *
  433.  * class Bar : public Foo, public nsIBar {  // both provide nsISupports
  434.  * public:
  435.  *   NS_DECL_ISUPPORTS_INHERITED
  436.  *   ...other nsIBar and Bar methods...
  437.  * };
  438.  */
  439. #define NS_DECL_ISUPPORTS_INHERITED                                           
  440. public:                                                                       
  441.   NS_IMETHOD QueryInterface(REFNSIID aIID,                                    
  442.                             void** aInstancePtr);                             
  443.   NS_IMETHOD_(nsrefcnt) AddRef(void);                                         
  444.   NS_IMETHOD_(nsrefcnt) Release(void);                                        
  445. /**
  446.  * These macros can be used in conjunction with NS_DECL_ISUPPORTS_INHERITED
  447.  * to implement the nsISupports methods, forwarding the invocations to a
  448.  * superclass that already implements nsISupports.
  449.  *
  450.  * Note that I didn't make these inlined because they're virtual methods.
  451.  */
  452. #define NS_IMPL_ADDREF_INHERITED(Class, Super)                                
  453. NS_IMETHODIMP_(nsrefcnt) Class::AddRef(void)                                  
  454. {                                                                             
  455.   return Super::AddRef();                                                     
  456. }                                                                             
  457. #define NS_IMPL_RELEASE_INHERITED(Class, Super)                               
  458. NS_IMETHODIMP_(nsrefcnt) Class::Release(void)                                 
  459. {                                                                             
  460.   return Super::Release();                                                    
  461. }                                                                             
  462. #define NS_IMPL_QUERY_INTERFACE_INHERITED0(Class, Super)                      
  463.   NS_IMPL_QUERY_HEAD(Class)                                                   
  464.   NS_IMPL_QUERY_TAIL_INHERITING(Super)                                        
  465. #define NS_IMPL_QUERY_INTERFACE_INHERITED1(Class, Super, i1)                  
  466.   NS_IMPL_QUERY_HEAD(Class)                                                   
  467.   NS_IMPL_QUERY_BODY(i1)                                                      
  468.   NS_IMPL_QUERY_TAIL_INHERITING(Super)                                        
  469. #define NS_IMPL_QUERY_INTERFACE_INHERITED2(Class, Super, i1, i2)              
  470.   NS_IMPL_QUERY_HEAD(Class)                                                   
  471.   NS_IMPL_QUERY_BODY(i1)                                                      
  472.   NS_IMPL_QUERY_BODY(i2)                                                      
  473.   NS_IMPL_QUERY_TAIL_INHERITING(Super)                                        
  474. #define NS_IMPL_QUERY_INTERFACE_INHERITED3(Class, Super, i1, i2, i3)          
  475.   NS_IMPL_QUERY_HEAD(Class)                                                   
  476.   NS_IMPL_QUERY_BODY(i1)                                                      
  477.   NS_IMPL_QUERY_BODY(i2)                                                      
  478.   NS_IMPL_QUERY_BODY(i3)                                                      
  479.   NS_IMPL_QUERY_TAIL_INHERITING(Super)                                        
  480. #define NS_IMPL_QUERY_INTERFACE_INHERITED4(Class, Super, i1, i2, i3, i4)      
  481.   NS_IMPL_QUERY_HEAD(Class)                                                   
  482.   NS_IMPL_QUERY_BODY(i1)                                                      
  483.   NS_IMPL_QUERY_BODY(i2)                                                      
  484.   NS_IMPL_QUERY_BODY(i3)                                                      
  485.   NS_IMPL_QUERY_BODY(i4)                                                      
  486.   NS_IMPL_QUERY_TAIL_INHERITING(Super)                                        
  487. #define NS_IMPL_QUERY_INTERFACE_INHERITED5(Class,Super,i1,i2,i3,i4,i5)        
  488.   NS_IMPL_QUERY_HEAD(Class)                                                   
  489.   NS_IMPL_QUERY_BODY(i1)                                                      
  490.   NS_IMPL_QUERY_BODY(i2)                                                      
  491.   NS_IMPL_QUERY_BODY(i3)                                                      
  492.   NS_IMPL_QUERY_BODY(i4)                                                      
  493.   NS_IMPL_QUERY_BODY(i5)                                                      
  494.   NS_IMPL_QUERY_TAIL_INHERITING(Super)                                        
  495. #define NS_IMPL_QUERY_INTERFACE_INHERITED6(Class,Super,i1,i2,i3,i4,i5,i6)     
  496.   NS_IMPL_QUERY_HEAD(Class)                                                   
  497.   NS_IMPL_QUERY_BODY(i1)                                                      
  498.   NS_IMPL_QUERY_BODY(i2)                                                      
  499.   NS_IMPL_QUERY_BODY(i3)                                                      
  500.   NS_IMPL_QUERY_BODY(i4)                                                      
  501.   NS_IMPL_QUERY_BODY(i5)                                                      
  502.   NS_IMPL_QUERY_BODY(i6)                                                      
  503.   NS_IMPL_QUERY_TAIL_INHERITING(Super)                                        
  504. /**
  505.  * Convenience macros for implementing all nsISupports methods for
  506.  * a simple class.
  507.  * @param _class The name of the class implementing the method
  508.  * @param _classiiddef The name of the #define symbol that defines the IID
  509.  * for the class (e.g. NS_ISUPPORTS_IID)
  510.  */
  511. #define NS_IMPL_ISUPPORTS0(_class)                                            
  512.   NS_IMPL_ADDREF(_class)                                                      
  513.   NS_IMPL_RELEASE(_class)                                                     
  514.   NS_IMPL_QUERY_INTERFACE0(_class)
  515. #define NS_IMPL_ISUPPORTS1(_class, _interface)                                
  516.   NS_IMPL_ADDREF(_class)                                                      
  517.   NS_IMPL_RELEASE(_class)                                                     
  518.   NS_IMPL_QUERY_INTERFACE1(_class, _interface)
  519. #define NS_IMPL_ISUPPORTS2(_class, _i1, _i2)                                  
  520.   NS_IMPL_ADDREF(_class)                                                      
  521.   NS_IMPL_RELEASE(_class)                                                     
  522.   NS_IMPL_QUERY_INTERFACE2(_class, _i1, _i2)
  523. #define NS_IMPL_ISUPPORTS3(_class, _i1, _i2, _i3)                             
  524.   NS_IMPL_ADDREF(_class)                                                      
  525.   NS_IMPL_RELEASE(_class)                                                     
  526.   NS_IMPL_QUERY_INTERFACE3(_class, _i1, _i2, _i3)
  527. #define NS_IMPL_ISUPPORTS4(_class, _i1, _i2, _i3, _i4)                        
  528.   NS_IMPL_ADDREF(_class)                                                      
  529.   NS_IMPL_RELEASE(_class)                                                     
  530.   NS_IMPL_QUERY_INTERFACE4(_class, _i1, _i2, _i3, _i4)
  531. #define NS_IMPL_ISUPPORTS5(_class, _i1, _i2, _i3, _i4, _i5)                   
  532.   NS_IMPL_ADDREF(_class)                                                      
  533.   NS_IMPL_RELEASE(_class)                                                     
  534.   NS_IMPL_QUERY_INTERFACE5(_class, _i1, _i2, _i3, _i4, _i5)
  535. #define NS_IMPL_ISUPPORTS6(_class, _i1, _i2, _i3, _i4, _i5, _i6)              
  536.   NS_IMPL_ADDREF(_class)                                                      
  537.   NS_IMPL_RELEASE(_class)                                                     
  538.   NS_IMPL_QUERY_INTERFACE6(_class, _i1, _i2, _i3, _i4, _i5, _i6)
  539. #define NS_IMPL_ISUPPORTS7(_class, _i1, _i2, _i3, _i4, _i5, _i6, _i7)         
  540.   NS_IMPL_ADDREF(_class)                                                      
  541.   NS_IMPL_RELEASE(_class)                                                     
  542.   NS_IMPL_QUERY_INTERFACE7(_class, _i1, _i2, _i3, _i4, _i5, _i6, _i7)
  543. #define NS_IMPL_ISUPPORTS8(_class, _i1, _i2, _i3, _i4, _i5, _i6, _i7, _i8)    
  544.   NS_IMPL_ADDREF(_class)                                                      
  545.   NS_IMPL_RELEASE(_class)                                                     
  546.   NS_IMPL_QUERY_INTERFACE8(_class, _i1, _i2, _i3, _i4, _i5, _i6, _i7, _i8)
  547. #define NS_IMPL_ISUPPORTS9(_class, _i1, _i2, _i3, _i4, _i5, _i6, _i7, _i8,    
  548.                            _i9)                                               
  549.   NS_IMPL_ADDREF(_class)                                                      
  550.   NS_IMPL_RELEASE(_class)                                                     
  551.   NS_IMPL_QUERY_INTERFACE9(_class, _i1, _i2, _i3, _i4, _i5, _i6, _i7, _i8, _i9)
  552. #define NS_IMPL_ISUPPORTS10(_class, _i1, _i2, _i3, _i4, _i5, _i6, _i7, _i8,   
  553.                             _i9, _i10)                                        
  554.   NS_IMPL_ADDREF(_class)                                                      
  555.   NS_IMPL_RELEASE(_class)                                                     
  556.   NS_IMPL_QUERY_INTERFACE10(_class, _i1, _i2, _i3, _i4, _i5, _i6, _i7, _i8,   
  557.                             _i9, _i10)
  558. #define NS_IMPL_ISUPPORTS11(_class, _i1, _i2, _i3, _i4, _i5, _i6, _i7, _i8,   
  559.                             _i9, _i10, _i11)                                  
  560.   NS_IMPL_ADDREF(_class)                                                      
  561.   NS_IMPL_RELEASE(_class)                                                     
  562.   NS_IMPL_QUERY_INTERFACE11(_class, _i1, _i2, _i3, _i4, _i5, _i6, _i7, _i8,   
  563.                             _i9, _i10, _i11)
  564. #define NS_IMPL_ISUPPORTS_INHERITED0(Class, Super)                            
  565.     NS_IMPL_QUERY_INTERFACE_INHERITED0(Class, Super)                          
  566.     NS_IMPL_ADDREF_INHERITED(Class, Super)                                    
  567.     NS_IMPL_RELEASE_INHERITED(Class, Super)                                   
  568. #define NS_IMPL_ISUPPORTS_INHERITED1(Class, Super, i1)                        
  569.     NS_IMPL_QUERY_INTERFACE_INHERITED1(Class, Super, i1)                      
  570.     NS_IMPL_ADDREF_INHERITED(Class, Super)                                    
  571.     NS_IMPL_RELEASE_INHERITED(Class, Super)                                   
  572. #define NS_IMPL_ISUPPORTS_INHERITED2(Class, Super, i1, i2)                    
  573.     NS_IMPL_QUERY_INTERFACE_INHERITED2(Class, Super, i1, i2)                  
  574.     NS_IMPL_ADDREF_INHERITED(Class, Super)                                    
  575.     NS_IMPL_RELEASE_INHERITED(Class, Super)                                   
  576. #define NS_IMPL_ISUPPORTS_INHERITED3(Class, Super, i1, i2, i3)                
  577.     NS_IMPL_QUERY_INTERFACE_INHERITED3(Class, Super, i1, i2, i3)              
  578.     NS_IMPL_ADDREF_INHERITED(Class, Super)                                    
  579.     NS_IMPL_RELEASE_INHERITED(Class, Super)                                   
  580. #define NS_IMPL_ISUPPORTS_INHERITED4(Class, Super, i1, i2, i3, i4)            
  581.     NS_IMPL_QUERY_INTERFACE_INHERITED4(Class, Super, i1, i2, i3, i4)          
  582.     NS_IMPL_ADDREF_INHERITED(Class, Super)                                    
  583.     NS_IMPL_RELEASE_INHERITED(Class, Super)                                   
  584. #define NS_IMPL_ISUPPORTS_INHERITED5(Class, Super, i1, i2, i3, i4, i5)        
  585.     NS_IMPL_QUERY_INTERFACE_INHERITED5(Class, Super, i1, i2, i3, i4, i5)      
  586.     NS_IMPL_ADDREF_INHERITED(Class, Super)                                    
  587.     NS_IMPL_RELEASE_INHERITED(Class, Super)                                   
  588. #define NS_IMPL_ISUPPORTS_INHERITED6(Class, Super, i1, i2, i3, i4, i5, i6)    
  589.     NS_IMPL_QUERY_INTERFACE_INHERITED6(Class, Super, i1, i2, i3, i4, i5, i6)  
  590.     NS_IMPL_ADDREF_INHERITED(Class, Super)                                    
  591.     NS_IMPL_RELEASE_INHERITED(Class, Super)                                   
  592. ///////////////////////////////////////////////////////////////////////////////
  593. /**
  594.  *
  595.  * Threadsafe implementations of the ISupports convenience macros.
  596.  *
  597.  * @note  These are not available when linking against the standalone glue,
  598.  *        because the implementation requires PR_ symbols.
  599.  */
  600. #if !defined(XPCOM_GLUE_AVOID_NSPR)
  601. /**
  602.  * Use this macro to implement the AddRef method for a given <i>_class</i>
  603.  * @param _class The name of the class implementing the method
  604.  */
  605. #define NS_IMPL_THREADSAFE_ADDREF(_class)                                     
  606. NS_IMETHODIMP_(nsrefcnt) _class::AddRef(void)                                 
  607. {                                                                             
  608.   NS_PRECONDITION(PRInt32(mRefCnt) >= 0, "illegal refcnt");                   
  609.   nsrefcnt count;                                                             
  610.   count = PR_AtomicIncrement((PRInt32*)&mRefCnt);                             
  611.   NS_LOG_ADDREF(this, count, #_class, sizeof(*this));                         
  612.   return count;                                                               
  613. }
  614. /**
  615.  * Use this macro to implement the Release method for a given <i>_class</i>
  616.  * @param _class The name of the class implementing the method
  617.  */
  618. #define NS_IMPL_THREADSAFE_RELEASE(_class)                                    
  619. NS_IMETHODIMP_(nsrefcnt) _class::Release(void)                                
  620. {                                                                             
  621.   nsrefcnt count;                                                             
  622.   NS_PRECONDITION(0 != mRefCnt, "dup release");                               
  623.   count = PR_AtomicDecrement((PRInt32 *)&mRefCnt);                            
  624.   NS_LOG_RELEASE(this, count, #_class);                                       
  625.   if (0 == count) {                                                           
  626.     mRefCnt = 1; /* stabilize */                                              
  627.     /* enable this to find non-threadsafe destructors: */                     
  628.     /* NS_ASSERT_OWNINGTHREAD(_class); */                                     
  629.     NS_DELETEXPCOM(this);                                                     
  630.     return 0;                                                                 
  631.   }                                                                           
  632.   return count;                                                               
  633. }
  634. #else // XPCOM_GLUE_AVOID_NSPR
  635. #define NS_IMPL_THREADSAFE_ADDREF(_class)                                     
  636.   THREADSAFE_ISUPPORTS_NOT_AVAILABLE_IN_STANDALONE_GLUE;
  637. #define NS_IMPL_THREADSAFE_RELEASE(_class)                                    
  638.   THREADSAFE_ISUPPORTS_NOT_AVAILABLE_IN_STANDALONE_GLUE;
  639. #endif
  640. #define NS_IMPL_THREADSAFE_ISUPPORTS0(_class)                                 
  641.   NS_IMPL_THREADSAFE_ADDREF(_class)                                           
  642.   NS_IMPL_THREADSAFE_RELEASE(_class)                                          
  643.   NS_IMPL_THREADSAFE_QUERY_INTERFACE0(_class)
  644. #define NS_IMPL_THREADSAFE_ISUPPORTS1(_class, _interface)                     
  645.   NS_IMPL_THREADSAFE_ADDREF(_class)                                           
  646.   NS_IMPL_THREADSAFE_RELEASE(_class)                                          
  647.   NS_IMPL_THREADSAFE_QUERY_INTERFACE1(_class, _interface)
  648. #define NS_IMPL_THREADSAFE_ISUPPORTS2(_class, _i1, _i2)                       
  649.   NS_IMPL_THREADSAFE_ADDREF(_class)                                           
  650.   NS_IMPL_THREADSAFE_RELEASE(_class)                                          
  651.   NS_IMPL_THREADSAFE_QUERY_INTERFACE2(_class, _i1, _i2)
  652. #define NS_IMPL_THREADSAFE_ISUPPORTS3(_class, _i1, _i2, _i3)                  
  653.   NS_IMPL_THREADSAFE_ADDREF(_class)                                           
  654.   NS_IMPL_THREADSAFE_RELEASE(_class)                                          
  655.   NS_IMPL_THREADSAFE_QUERY_INTERFACE3(_class, _i1, _i2, _i3)
  656. #define NS_IMPL_THREADSAFE_ISUPPORTS4(_class, _i1, _i2, _i3, _i4)             
  657.   NS_IMPL_THREADSAFE_ADDREF(_class)                                           
  658.   NS_IMPL_THREADSAFE_RELEASE(_class)                                          
  659.   NS_IMPL_THREADSAFE_QUERY_INTERFACE4(_class, _i1, _i2, _i3, _i4)
  660. #define NS_IMPL_THREADSAFE_ISUPPORTS5(_class, _i1, _i2, _i3, _i4, _i5)        
  661.   NS_IMPL_THREADSAFE_ADDREF(_class)                                           
  662.   NS_IMPL_THREADSAFE_RELEASE(_class)                                          
  663.   NS_IMPL_THREADSAFE_QUERY_INTERFACE5(_class, _i1, _i2, _i3, _i4, _i5)
  664. #define NS_IMPL_THREADSAFE_ISUPPORTS6(_class, _i1, _i2, _i3, _i4, _i5, _i6)   
  665.   NS_IMPL_THREADSAFE_ADDREF(_class)                                           
  666.   NS_IMPL_THREADSAFE_RELEASE(_class)                                          
  667.   NS_IMPL_THREADSAFE_QUERY_INTERFACE6(_class, _i1, _i2, _i3, _i4, _i5, _i6)
  668. #define NS_IMPL_THREADSAFE_ISUPPORTS7(_class, _i1, _i2, _i3, _i4, _i5, _i6,   
  669.                                       _i7)                                    
  670.   NS_IMPL_THREADSAFE_ADDREF(_class)                                           
  671.   NS_IMPL_THREADSAFE_RELEASE(_class)                                          
  672.   NS_IMPL_THREADSAFE_QUERY_INTERFACE7(_class, _i1, _i2, _i3, _i4, _i5, _i6,   
  673.                                       _i7)
  674. #define NS_IMPL_THREADSAFE_ISUPPORTS8(_class, _i1, _i2, _i3, _i4, _i5, _i6,   
  675.                                       _i7, _i8)                               
  676.   NS_IMPL_THREADSAFE_ADDREF(_class)                                           
  677.   NS_IMPL_THREADSAFE_RELEASE(_class)                                          
  678.   NS_IMPL_THREADSAFE_QUERY_INTERFACE8(_class, _i1, _i2, _i3, _i4, _i5, _i6,   
  679.                                       _i7, _i8)
  680. #define NS_IMPL_THREADSAFE_ISUPPORTS9(_class, _i1, _i2, _i3, _i4, _i5, _i6,   
  681.                                       _i7, _i8, _i9)                          
  682.   NS_IMPL_THREADSAFE_ADDREF(_class)                                           
  683.   NS_IMPL_THREADSAFE_RELEASE(_class)                                          
  684.   NS_IMPL_THREADSAFE_QUERY_INTERFACE9(_class, _i1, _i2, _i3, _i4, _i5, _i6,   
  685.                                       _i7, _i8, _i9)
  686. #define NS_IMPL_THREADSAFE_ISUPPORTS10(_class, _i1, _i2, _i3, _i4, _i5, _i6,  
  687.                                        _i7, _i8, _i9, _i10)                   
  688.   NS_IMPL_THREADSAFE_ADDREF(_class)                                           
  689.   NS_IMPL_THREADSAFE_RELEASE(_class)                                          
  690.   NS_IMPL_THREADSAFE_QUERY_INTERFACE10(_class, _i1, _i2, _i3, _i4, _i5, _i6,  
  691.                                        _i7, _i8, _i9, _i10)
  692. #define NS_IMPL_THREADSAFE_ISUPPORTS11(_class, _i1, _i2, _i3, _i4, _i5, _i6,  
  693.                                        _i7, _i8, _i9, _i10, _i11)             
  694.   NS_IMPL_THREADSAFE_ADDREF(_class)                                           
  695.   NS_IMPL_THREADSAFE_RELEASE(_class)                                          
  696.   NS_IMPL_THREADSAFE_QUERY_INTERFACE11(_class, _i1, _i2, _i3, _i4, _i5, _i6,  
  697.                                        _i7, _i8, _i9, _i10, _i11)
  698. ///////////////////////////////////////////////////////////////////////////////
  699. // Macros for implementing nsIClassInfo-related stuff.
  700. ///////////////////////////////////////////////////////////////////////////////
  701. // include here instead of at the top because it requires the nsISupport decl
  702. #include "nsIClassInfo.h"
  703. #define NS_CLASSINFO_NAME(_class) _class##_classInfoGlobal
  704. #define NS_CI_INTERFACE_GETTER_NAME(_class) _class##_GetInterfacesHelper
  705. #define NS_DECL_CI_INTERFACE_GETTER(_class)                                   
  706.   extern NS_IMETHODIMP NS_CI_INTERFACE_GETTER_NAME(_class)(PRUint32 *,        
  707.                                                            nsIID ***);
  708. #define NS_DECL_CLASSINFO(_class)                                             
  709.   NS_DECL_CI_INTERFACE_GETTER(_class)                                         
  710.   nsIClassInfo *NS_CLASSINFO_NAME(_class);
  711. #define NS_IMPL_QUERY_CLASSINFO(_class)                                       
  712.   if ( aIID.Equals(NS_GET_IID(nsIClassInfo)) ) {                              
  713.     extern nsIClassInfo *NS_CLASSINFO_NAME(_class);                           
  714.     foundInterface = NS_STATIC_CAST(nsIClassInfo*, NS_CLASSINFO_NAME(_class));
  715.   } else
  716. #define NS_CLASSINFO_HELPER_BEGIN(_class, _c)                                 
  717. NS_IMETHODIMP                                                                 
  718. NS_CI_INTERFACE_GETTER_NAME(_class)(PRUint32 *count, nsIID ***array)          
  719. {                                                                             
  720.     *count = _c;                                                              
  721.     *array = (nsIID **)nsMemory::Alloc(sizeof (nsIID *) * _c);
  722. #define NS_CLASSINFO_HELPER_ENTRY(_i, _interface)                             
  723.     (*array)[_i] = (nsIID *)nsMemory::Clone(&NS_GET_IID(_interface),          
  724.                                             sizeof(nsIID));
  725. #define NS_CLASSINFO_HELPER_END                                               
  726.     return NS_OK;                                                             
  727. }
  728. #define NS_IMPL_CI_INTERFACE_GETTER1(_class, _interface)                      
  729.    NS_CLASSINFO_HELPER_BEGIN(_class, 1)                                       
  730.      NS_CLASSINFO_HELPER_ENTRY(0, _interface)                                 
  731.    NS_CLASSINFO_HELPER_END
  732. #define NS_IMPL_QUERY_INTERFACE1_CI(_class, _i1)                              
  733.   NS_INTERFACE_MAP_BEGIN(_class)                                              
  734.     NS_INTERFACE_MAP_ENTRY(_i1)                                               
  735.     NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, _i1)                        
  736.     NS_IMPL_QUERY_CLASSINFO(_class)                                           
  737.   NS_INTERFACE_MAP_END
  738. #define NS_IMPL_ISUPPORTS1_CI(_class, _interface)                             
  739.   NS_IMPL_ADDREF(_class)                                                      
  740.   NS_IMPL_RELEASE(_class)                                                     
  741.   NS_IMPL_QUERY_INTERFACE1_CI(_class, _interface)                             
  742.   NS_IMPL_CI_INTERFACE_GETTER1(_class, _interface)
  743. #define NS_IMPL_CI_INTERFACE_GETTER2(_class, _i1, _i2)                        
  744.    NS_CLASSINFO_HELPER_BEGIN(_class, 2)                                       
  745.      NS_CLASSINFO_HELPER_ENTRY(0, _i1)                                        
  746.      NS_CLASSINFO_HELPER_ENTRY(1, _i2)                                        
  747.    NS_CLASSINFO_HELPER_END
  748. #define NS_IMPL_QUERY_INTERFACE2_CI(_class, _i1, _i2)                         
  749.   NS_INTERFACE_MAP_BEGIN(_class)                                              
  750.     NS_INTERFACE_MAP_ENTRY(_i1)                                               
  751.     NS_INTERFACE_MAP_ENTRY(_i2)                                               
  752.     NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, _i1)                        
  753.     NS_IMPL_QUERY_CLASSINFO(_class)                                           
  754.   NS_INTERFACE_MAP_END
  755. #define NS_IMPL_ISUPPORTS2_CI(_class, _i1, _i2)                               
  756.   NS_IMPL_ADDREF(_class)                                                      
  757.   NS_IMPL_RELEASE(_class)                                                     
  758.   NS_IMPL_QUERY_INTERFACE2_CI(_class, _i1, _i2)                               
  759.   NS_IMPL_CI_INTERFACE_GETTER2(_class, _i1, _i2)
  760. #define NS_IMPL_CI_INTERFACE_GETTER3(_class, _i1, _i2, _i3)                   
  761.    NS_CLASSINFO_HELPER_BEGIN(_class, 3)                                       
  762.      NS_CLASSINFO_HELPER_ENTRY(0, _i1)                                        
  763.      NS_CLASSINFO_HELPER_ENTRY(1, _i2)                                        
  764.      NS_CLASSINFO_HELPER_ENTRY(2, _i3)                                        
  765.    NS_CLASSINFO_HELPER_END
  766. #define NS_IMPL_QUERY_INTERFACE3_CI(_class, _i1, _i2, _i3)                    
  767.   NS_INTERFACE_MAP_BEGIN(_class)                                              
  768.     NS_INTERFACE_MAP_ENTRY(_i1)                                               
  769.     NS_INTERFACE_MAP_ENTRY(_i2)                                               
  770.     NS_INTERFACE_MAP_ENTRY(_i3)                                               
  771.     NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, _i1)                        
  772.     NS_IMPL_QUERY_CLASSINFO(_class)                                           
  773.   NS_INTERFACE_MAP_END
  774. #define NS_IMPL_ISUPPORTS3_CI(_class, _i1, _i2, _i3)                          
  775.   NS_IMPL_ADDREF(_class)                                                      
  776.   NS_IMPL_RELEASE(_class)                                                     
  777.   NS_IMPL_QUERY_INTERFACE3_CI(_class, _i1, _i2, _i3)                          
  778.   NS_IMPL_CI_INTERFACE_GETTER3(_class, _i1, _i2, _i3)
  779. #define NS_IMPL_CI_INTERFACE_GETTER4(_class, _i1, _i2, _i3, _i4)              
  780.    NS_CLASSINFO_HELPER_BEGIN(_class, 4)                                       
  781.      NS_CLASSINFO_HELPER_ENTRY(0, _i1)                                        
  782.      NS_CLASSINFO_HELPER_ENTRY(1, _i2)                                        
  783.      NS_CLASSINFO_HELPER_ENTRY(2, _i3)                                        
  784.      NS_CLASSINFO_HELPER_ENTRY(3, _i4)                                        
  785.    NS_CLASSINFO_HELPER_END
  786. #define NS_IMPL_QUERY_INTERFACE4_CI(_class, _i1, _i2, _i3, _i4)               
  787.   NS_INTERFACE_MAP_BEGIN(_class)                                              
  788.     NS_INTERFACE_MAP_ENTRY(_i1)                                               
  789.     NS_INTERFACE_MAP_ENTRY(_i2)                                               
  790.     NS_INTERFACE_MAP_ENTRY(_i3)                                               
  791.     NS_INTERFACE_MAP_ENTRY(_i4)                                               
  792.     NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, _i1)                        
  793.     NS_IMPL_QUERY_CLASSINFO(_class)                                           
  794.   NS_INTERFACE_MAP_END
  795. #define NS_IMPL_ISUPPORTS4_CI(_class, _i1, _i2, _i3, _i4)                     
  796.   NS_IMPL_ADDREF(_class)                                                      
  797.   NS_IMPL_RELEASE(_class)                                                     
  798.   NS_IMPL_QUERY_INTERFACE4_CI(_class, _i1, _i2, _i3, _i4)                     
  799.   NS_IMPL_CI_INTERFACE_GETTER4(_class, _i1, _i2, _i3, _i4)
  800. #define NS_IMPL_CI_INTERFACE_GETTER5(_class, _i1, _i2, _i3, _i4, _i5)         
  801.    NS_CLASSINFO_HELPER_BEGIN(_class, 5)                                       
  802.      NS_CLASSINFO_HELPER_ENTRY(0, _i1)                                        
  803.      NS_CLASSINFO_HELPER_ENTRY(1, _i2)                                        
  804.      NS_CLASSINFO_HELPER_ENTRY(2, _i3)                                        
  805.      NS_CLASSINFO_HELPER_ENTRY(3, _i4)                                        
  806.      NS_CLASSINFO_HELPER_ENTRY(4, _i5)                                        
  807.    NS_CLASSINFO_HELPER_END
  808. #define NS_IMPL_QUERY_INTERFACE5_CI(_class, _i1, _i2, _i3, _i4, _i5)          
  809.   NS_INTERFACE_MAP_BEGIN(_class)                                              
  810.     NS_INTERFACE_MAP_ENTRY(_i1)                                               
  811.     NS_INTERFACE_MAP_ENTRY(_i2)                                               
  812.     NS_INTERFACE_MAP_ENTRY(_i3)                                               
  813.     NS_INTERFACE_MAP_ENTRY(_i4)                                               
  814.     NS_INTERFACE_MAP_ENTRY(_i5)                                               
  815.     NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, _i1)                        
  816.     NS_IMPL_QUERY_CLASSINFO(_class)                                           
  817.   NS_INTERFACE_MAP_END
  818. #define NS_IMPL_ISUPPORTS5_CI(_class, _i1, _i2, _i3, _i4, _i5)                
  819.   NS_IMPL_ADDREF(_class)                                                      
  820.   NS_IMPL_RELEASE(_class)                                                     
  821.   NS_IMPL_QUERY_INTERFACE5_CI(_class, _i1, _i2, _i3, _i4, _i5)                
  822.   NS_IMPL_CI_INTERFACE_GETTER5(_class, _i1, _i2, _i3, _i4, _i5)
  823. #define NS_IMPL_CI_INTERFACE_GETTER6(_class, _i1, _i2, _i3, _i4, _i5, _i6)    
  824.    NS_CLASSINFO_HELPER_BEGIN(_class, 6)                                       
  825.      NS_CLASSINFO_HELPER_ENTRY(0, _i1)                                        
  826.      NS_CLASSINFO_HELPER_ENTRY(1, _i2)                                        
  827.      NS_CLASSINFO_HELPER_ENTRY(2, _i3)                                        
  828.      NS_CLASSINFO_HELPER_ENTRY(3, _i4)                                        
  829.      NS_CLASSINFO_HELPER_ENTRY(4, _i5)                                        
  830.      NS_CLASSINFO_HELPER_ENTRY(5, _i6)                                        
  831.    NS_CLASSINFO_HELPER_END
  832. #define NS_IMPL_QUERY_INTERFACE6_CI(_class, _i1, _i2, _i3, _i4, _i5, _i6)     
  833.   NS_INTERFACE_MAP_BEGIN(_class)                                              
  834.     NS_INTERFACE_MAP_ENTRY(_i1)                                               
  835.     NS_INTERFACE_MAP_ENTRY(_i2)                                               
  836.     NS_INTERFACE_MAP_ENTRY(_i3)                                               
  837.     NS_INTERFACE_MAP_ENTRY(_i4)                                               
  838.     NS_INTERFACE_MAP_ENTRY(_i5)                                               
  839.     NS_INTERFACE_MAP_ENTRY(_i6)                                               
  840.     NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, _i1)                        
  841.     NS_IMPL_QUERY_CLASSINFO(_class)                                           
  842.   NS_INTERFACE_MAP_END
  843. #define NS_IMPL_ISUPPORTS6_CI(_class, _i1, _i2, _i3, _i4, _i5, _i6)           
  844.   NS_IMPL_ADDREF(_class)                                                      
  845.   NS_IMPL_RELEASE(_class)                                                     
  846.   NS_IMPL_QUERY_INTERFACE6_CI(_class, _i1, _i2, _i3, _i4, _i5, _i6)           
  847.   NS_IMPL_CI_INTERFACE_GETTER6(_class, _i1, _i2, _i3, _i4, _i5, _i6)
  848. #define NS_IMPL_CI_INTERFACE_GETTER7(_class, _i1, _i2, _i3, _i4, _i5, _i6,    
  849.                                      _i7)                                     
  850.    NS_CLASSINFO_HELPER_BEGIN(_class, 7)                                       
  851.      NS_CLASSINFO_HELPER_ENTRY(0, _i1)                                        
  852.      NS_CLASSINFO_HELPER_ENTRY(1, _i2)                                        
  853.      NS_CLASSINFO_HELPER_ENTRY(2, _i3)                                        
  854.      NS_CLASSINFO_HELPER_ENTRY(3, _i4)                                        
  855.      NS_CLASSINFO_HELPER_ENTRY(4, _i5)                                        
  856.      NS_CLASSINFO_HELPER_ENTRY(5, _i6)                                        
  857.      NS_CLASSINFO_HELPER_ENTRY(6, _i7)                                        
  858.    NS_CLASSINFO_HELPER_END
  859. #define NS_IMPL_QUERY_INTERFACE7_CI(_class, _i1, _i2, _i3, _i4, _i5, _i6,     
  860.                                     _i7)                                      
  861.   NS_INTERFACE_MAP_BEGIN(_class)                                              
  862.     NS_INTERFACE_MAP_ENTRY(_i1)                                               
  863.     NS_INTERFACE_MAP_ENTRY(_i2)                                               
  864.     NS_INTERFACE_MAP_ENTRY(_i3)                                               
  865.     NS_INTERFACE_MAP_ENTRY(_i4)                                               
  866.     NS_INTERFACE_MAP_ENTRY(_i5)                                               
  867.     NS_INTERFACE_MAP_ENTRY(_i6)                                               
  868.     NS_INTERFACE_MAP_ENTRY(_i7)                                               
  869.     NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, _i1)                        
  870.     NS_IMPL_QUERY_CLASSINFO(_class)                                           
  871.   NS_INTERFACE_MAP_END
  872. #define NS_IMPL_ISUPPORTS7_CI(_class, _i1, _i2, _i3, _i4, _i5, _i6, _i7)      
  873.   NS_IMPL_ADDREF(_class)                                                      
  874.   NS_IMPL_RELEASE(_class)                                                     
  875.   NS_IMPL_QUERY_INTERFACE7_CI(_class, _i1, _i2, _i3, _i4, _i5, _i6, _i7)      
  876.   NS_IMPL_CI_INTERFACE_GETTER7(_class, _i1, _i2, _i3, _i4, _i5, _i6, _i7)
  877. #define NS_IMPL_CI_INTERFACE_GETTER8(_class, _i1, _i2, _i3, _i4, _i5, _i6,    
  878.                                      _i7, _i8)                                
  879.    NS_CLASSINFO_HELPER_BEGIN(_class, 8)                                       
  880.      NS_CLASSINFO_HELPER_ENTRY(0, _i1)                                        
  881.      NS_CLASSINFO_HELPER_ENTRY(1, _i2)                                        
  882.      NS_CLASSINFO_HELPER_ENTRY(2, _i3)                                        
  883.      NS_CLASSINFO_HELPER_ENTRY(3, _i4)                                        
  884.      NS_CLASSINFO_HELPER_ENTRY(4, _i5)                                        
  885.      NS_CLASSINFO_HELPER_ENTRY(5, _i6)                                        
  886.      NS_CLASSINFO_HELPER_ENTRY(6, _i7)                                        
  887.      NS_CLASSINFO_HELPER_ENTRY(7, _i8)                                        
  888.    NS_CLASSINFO_HELPER_END
  889. #define NS_IMPL_QUERY_INTERFACE8_CI(_class, _i1, _i2, _i3, _i4, _i5, _i6,     
  890.                                     _i7, _i8)                                 
  891.   NS_INTERFACE_MAP_BEGIN(_class)                                              
  892.     NS_INTERFACE_MAP_ENTRY(_i1)                                               
  893.     NS_INTERFACE_MAP_ENTRY(_i2)                                               
  894.     NS_INTERFACE_MAP_ENTRY(_i3)                                               
  895.     NS_INTERFACE_MAP_ENTRY(_i4)                                               
  896.     NS_INTERFACE_MAP_ENTRY(_i5)                                               
  897.     NS_INTERFACE_MAP_ENTRY(_i6)                                               
  898.     NS_INTERFACE_MAP_ENTRY(_i7)                                               
  899.     NS_INTERFACE_MAP_ENTRY(_i8)                                               
  900.     NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, _i1)                        
  901.     NS_IMPL_QUERY_CLASSINFO(_class)                                           
  902.   NS_INTERFACE_MAP_END
  903. #define NS_IMPL_ISUPPORTS8_CI(_class, _i1, _i2, _i3, _i4, _i5, _i6, _i7, _i8) 
  904.   NS_IMPL_ADDREF(_class)                                                      
  905.   NS_IMPL_RELEASE(_class)                                                     
  906.   NS_IMPL_QUERY_INTERFACE8_CI(_class, _i1, _i2, _i3, _i4, _i5, _i6, _i7, _i8) 
  907.   NS_IMPL_CI_INTERFACE_GETTER8(_class, _i1, _i2, _i3, _i4, _i5, _i6, _i7, _i8)
  908. #define NS_IMPL_CI_INTERFACE_GETTER9(_class, _i1, _i2, _i3, _i4, _i5, _i6,    
  909.                                      _i7, _i8, _i9)                           
  910.    NS_CLASSINFO_HELPER_BEGIN(_class, 9)                                       
  911.      NS_CLASSINFO_HELPER_ENTRY(0, _i1)                                        
  912.      NS_CLASSINFO_HELPER_ENTRY(1, _i2)                                        
  913.      NS_CLASSINFO_HELPER_ENTRY(2, _i3)                                        
  914.      NS_CLASSINFO_HELPER_ENTRY(3, _i4)                                        
  915.      NS_CLASSINFO_HELPER_ENTRY(4, _i5)                                        
  916.      NS_CLASSINFO_HELPER_ENTRY(5, _i6)                                        
  917.      NS_CLASSINFO_HELPER_ENTRY(6, _i7)                                        
  918.      NS_CLASSINFO_HELPER_ENTRY(7, _i8)                                        
  919.      NS_CLASSINFO_HELPER_ENTRY(8, _i9)                                        
  920.    NS_CLASSINFO_HELPER_END
  921. #define NS_IMPL_QUERY_INTERFACE9_CI(_class, _i1, _i2, _i3, _i4, _i5, _i6,     
  922.                                     _i7, _i8, _i9)                            
  923.   NS_INTERFACE_MAP_BEGIN(_class)                                              
  924.     NS_INTERFACE_MAP_ENTRY(_i1)                                               
  925.     NS_INTERFACE_MAP_ENTRY(_i2)                                               
  926.     NS_INTERFACE_MAP_ENTRY(_i3)                                               
  927.     NS_INTERFACE_MAP_ENTRY(_i4)                                               
  928.     NS_INTERFACE_MAP_ENTRY(_i5)                                               
  929.     NS_INTERFACE_MAP_ENTRY(_i6)                                               
  930.     NS_INTERFACE_MAP_ENTRY(_i7)                                               
  931.     NS_INTERFACE_MAP_ENTRY(_i8)                                               
  932.     NS_INTERFACE_MAP_ENTRY(_i9)                                               
  933.     NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, _i1)                        
  934.     NS_IMPL_QUERY_CLASSINFO(_class)                                           
  935.   NS_INTERFACE_MAP_END
  936. #define NS_IMPL_ISUPPORTS9_CI(_class, _i1, _i2, _i3, _i4, _i5, _i6, _i7,      
  937.                               _i8, _i9)                                       
  938.   NS_IMPL_ADDREF(_class)                                                      
  939.   NS_IMPL_RELEASE(_class)                                                     
  940.   NS_IMPL_QUERY_INTERFACE9_CI(_class, _i1, _i2, _i3, _i4, _i5, _i6, _i7,      
  941.                               _i8, _i9)                                       
  942.   NS_IMPL_CI_INTERFACE_GETTER9(_class, _i1, _i2, _i3, _i4, _i5, _i6, _i7,     
  943.                                _i8, _i9)
  944. #define NS_IMPL_CI_INTERFACE_GETTER10(_class, _i1, _i2, _i3, _i4, _i5, _i6,   
  945.                                       _i7, _i8, _i9, _i10)                    
  946.    NS_CLASSINFO_HELPER_BEGIN(_class, 10)                                      
  947.      NS_CLASSINFO_HELPER_ENTRY(0, _i1)                                        
  948.      NS_CLASSINFO_HELPER_ENTRY(1, _i2)                                        
  949.      NS_CLASSINFO_HELPER_ENTRY(2, _i3)                                        
  950.      NS_CLASSINFO_HELPER_ENTRY(3, _i4)                                        
  951.      NS_CLASSINFO_HELPER_ENTRY(4, _i5)                                        
  952.      NS_CLASSINFO_HELPER_ENTRY(5, _i6)                                        
  953.      NS_CLASSINFO_HELPER_ENTRY(6, _i7)                                        
  954.      NS_CLASSINFO_HELPER_ENTRY(7, _i8)                                        
  955.      NS_CLASSINFO_HELPER_ENTRY(8, _i9)                                        
  956.      NS_CLASSINFO_HELPER_ENTRY(9, _i10)                                       
  957.    NS_CLASSINFO_HELPER_END
  958. #define NS_IMPL_CI_INTERFACE_GETTER11(_class, _i1, _i2, _i3, _i4, _i5, _i6,   
  959.                                       _i7, _i8, _i9, _i10, _i11)              
  960.    NS_CLASSINFO_HELPER_BEGIN(_class, 11)                                      
  961.      NS_CLASSINFO_HELPER_ENTRY(0, _i1)                                        
  962.      NS_CLASSINFO_HELPER_ENTRY(1, _i2)                                        
  963.      NS_CLASSINFO_HELPER_ENTRY(2, _i3)                                        
  964.      NS_CLASSINFO_HELPER_ENTRY(3, _i4)                                        
  965.      NS_CLASSINFO_HELPER_ENTRY(4, _i5)                                        
  966.      NS_CLASSINFO_HELPER_ENTRY(5, _i6)                                        
  967.      NS_CLASSINFO_HELPER_ENTRY(6, _i7)                                        
  968.      NS_CLASSINFO_HELPER_ENTRY(7, _i8)                                        
  969.      NS_CLASSINFO_HELPER_ENTRY(8, _i9)                                        
  970.      NS_CLASSINFO_HELPER_ENTRY(9, _i10)                                       
  971.      NS_CLASSINFO_HELPER_ENTRY(10, _i11)                                      
  972.    NS_CLASSINFO_HELPER_END
  973. #define NS_IMPL_QUERY_INTERFACE10_CI(_class, _i1, _i2, _i3, _i4, _i5, _i6,    
  974.                                      _i7, _i8, _i9, _i10)                     
  975.   NS_INTERFACE_MAP_BEGIN(_class)                                              
  976.     NS_INTERFACE_MAP_ENTRY(_i1)                                               
  977.     NS_INTERFACE_MAP_ENTRY(_i2)                                               
  978.     NS_INTERFACE_MAP_ENTRY(_i3)                                               
  979.     NS_INTERFACE_MAP_ENTRY(_i4)                                               
  980.     NS_INTERFACE_MAP_ENTRY(_i5)                                               
  981.     NS_INTERFACE_MAP_ENTRY(_i6)                                               
  982.     NS_INTERFACE_MAP_ENTRY(_i7)                                               
  983.     NS_INTERFACE_MAP_ENTRY(_i8)                                               
  984.     NS_INTERFACE_MAP_ENTRY(_i9)                                               
  985.     NS_INTERFACE_MAP_ENTRY(_i10)                                              
  986.     NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, _i1)                        
  987.     NS_IMPL_QUERY_CLASSINFO(_class)                                           
  988.   NS_INTERFACE_MAP_END
  989. #define NS_IMPL_QUERY_INTERFACE11_CI(_class, _i1, _i2, _i3, _i4, _i5, _i6,    
  990.                                      _i7, _i8, _i9, _i10, _i11)               
  991.   NS_INTERFACE_MAP_BEGIN(_class)                                              
  992.     NS_INTERFACE_MAP_ENTRY(_i1)                                               
  993.     NS_INTERFACE_MAP_ENTRY(_i2)                                               
  994.     NS_INTERFACE_MAP_ENTRY(_i3)                                               
  995.     NS_INTERFACE_MAP_ENTRY(_i4)                                               
  996.     NS_INTERFACE_MAP_ENTRY(_i5)                                               
  997.     NS_INTERFACE_MAP_ENTRY(_i6)                                               
  998.     NS_INTERFACE_MAP_ENTRY(_i7)                                               
  999.     NS_INTERFACE_MAP_ENTRY(_i8)                                               
  1000.     NS_INTERFACE_MAP_ENTRY(_i9)                                               
  1001.     NS_INTERFACE_MAP_ENTRY(_i10)                                              
  1002.     NS_INTERFACE_MAP_ENTRY(_i11)                                              
  1003.     NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, _i1)                        
  1004.     NS_IMPL_QUERY_CLASSINFO(_class)                                           
  1005.   NS_INTERFACE_MAP_END
  1006. #define NS_IMPL_ISUPPORTS10_CI(_class, _i1, _i2, _i3, _i4, _i5, _i6, _i7,     
  1007.                                _i8, _i9, _i10)                                
  1008.   NS_IMPL_ADDREF(_class)                                                      
  1009.   NS_IMPL_RELEASE(_class)                                                     
  1010.   NS_IMPL_QUERY_INTERFACE10_CI(_class, _i1, _i2, _i3, _i4, _i5, _i6, _i7,     
  1011.                                _i8, _i9, _i10)                                
  1012.   NS_IMPL_CI_INTERFACE_GETTER10(_class, _i1, _i2, _i3, _i4, _i5, _i6, _i7,    
  1013.                                 _i8, _i9, _i10)
  1014. #define NS_IMPL_ISUPPORTS11_CI(_class, _i1, _i2, _i3, _i4, _i5, _i6, _i7,     
  1015.                                _i8, _i9, _i10, _i11)                          
  1016.   NS_IMPL_ADDREF(_class)                                                      
  1017.   NS_IMPL_RELEASE(_class)                                                     
  1018.   NS_IMPL_QUERY_INTERFACE11_CI(_class, _i1, _i2, _i3, _i4, _i5, _i6, _i7,     
  1019.                                _i8, _i9, _i10, _i11)                          
  1020.   NS_IMPL_CI_INTERFACE_GETTER11(_class, _i1, _i2, _i3, _i4, _i5, _i6, _i7,    
  1021.                                 _i8, _i9, _i10, _i11)
  1022. #define NS_INTERFACE_MAP_END_THREADSAFE NS_IMPL_QUERY_TAIL_GUTS
  1023. #endif