1 : /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 : *
3 : * ***** BEGIN LICENSE BLOCK *****
4 : * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 : *
6 : * The contents of this file are subject to the Mozilla Public License Version
7 : * 1.1 (the "License"); you may not use this file except in compliance with
8 : * the License. You may obtain a copy of the License at
9 : * http://www.mozilla.org/MPL/
10 : *
11 : * Software distributed under the License is distributed on an "AS IS" basis,
12 : * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 : * for the specific language governing rights and limitations under the
14 : * License.
15 : *
16 : * The Original Code is Mozilla Communicator client code, released
17 : * March 31, 1998.
18 : *
19 : * The Initial Developer of the Original Code is
20 : * Netscape Communications Corporation.
21 : * Portions created by the Initial Developer are Copyright (C) 1998
22 : * the Initial Developer. All Rights Reserved.
23 : *
24 : * Contributor(s):
25 : * John Bandhauer <jband@netscape.com>
26 : *
27 : * Alternatively, the contents of this file may be used under the terms of
28 : * either of the GNU General Public License Version 2 or later (the "GPL"),
29 : * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
30 : * in which case the provisions of the GPL or the LGPL are applicable instead
31 : * of those above. If you wish to allow use of your version of this file only
32 : * under the terms of either the GPL or the LGPL, and not to allow others to
33 : * use your version of this file under the terms of the MPL, indicate your
34 : * decision by deleting the provisions above and replace them with the notice
35 : * and other provisions required by the GPL or the LGPL. If you do not delete
36 : * the provisions above, a recipient may use your version of this file under
37 : * the terms of any one of the MPL, the GPL or the LGPL.
38 : *
39 : * ***** END LICENSE BLOCK ***** */
40 :
41 : /* module registration and factory code. */
42 :
43 : #include "nsCOMPtr.h"
44 : #include "nsIModule.h"
45 : #include "mozilla/ModuleUtils.h"
46 : #include "nsCRT.h"
47 : #include "nsIClassInfoImpl.h"
48 : #include "xpctest_private.h"
49 :
50 : #define NS_XPCTESTOBJECTREADONLY_CID \
51 : { 0x492609a7, 0x2582, 0x436b, \
52 : { 0xb0, 0xef, 0x92, 0xe2, 0x9b, 0xb9, 0xe1, 0x43 } }
53 :
54 : #define NS_XPCTESTOBJECTREADWRITE_CID \
55 : { 0x8f37f760, 0x3686, 0x4dbb, \
56 : { 0xb1, 0x21, 0x96, 0x93, 0xba, 0x81, 0x3f, 0x8f } }
57 :
58 : #define NS_XPCTESTPARAMS_CID \
59 : { 0x1f11076a, 0x0fa2, 0x4f07, \
60 : { 0xb4, 0x7a, 0xa1, 0x54, 0x31, 0xf2, 0xce, 0xf7 } }
61 :
62 2 : NS_GENERIC_FACTORY_CONSTRUCTOR(xpcTestObjectReadOnly)
63 2 : NS_GENERIC_FACTORY_CONSTRUCTOR(xpcTestObjectReadWrite)
64 2 : NS_GENERIC_FACTORY_CONSTRUCTOR(nsXPCTestParams)
65 : NS_DEFINE_NAMED_CID(NS_XPCTESTOBJECTREADONLY_CID);
66 : NS_DEFINE_NAMED_CID(NS_XPCTESTOBJECTREADWRITE_CID);
67 : NS_DEFINE_NAMED_CID(NS_XPCTESTPARAMS_CID);
68 :
69 : static const mozilla::Module::CIDEntry kXPCTestCIDs[] = {
70 : { &kNS_XPCTESTOBJECTREADONLY_CID, false, NULL, xpcTestObjectReadOnlyConstructor },
71 : { &kNS_XPCTESTOBJECTREADWRITE_CID, false, NULL, xpcTestObjectReadWriteConstructor },
72 : { &kNS_XPCTESTPARAMS_CID, false, NULL, nsXPCTestParamsConstructor },
73 : { NULL }
74 : };
75 :
76 : static const mozilla::Module::ContractIDEntry kXPCTestContracts[] = {
77 : { "@mozilla.org/js/xpc/test/native/ObjectReadOnly;1", &kNS_XPCTESTOBJECTREADONLY_CID },
78 : { "@mozilla.org/js/xpc/test/native/ObjectReadWrite;1", &kNS_XPCTESTOBJECTREADWRITE_CID },
79 : { "@mozilla.org/js/xpc/test/native/Params;1", &kNS_XPCTESTPARAMS_CID },
80 : { NULL }
81 : };
82 :
83 : static const mozilla::Module kXPCTestModule = {
84 : mozilla::Module::kVersion,
85 : kXPCTestCIDs,
86 : kXPCTestContracts
87 : };
88 :
89 : NSMODULE_DEFN(xpconnect_test) = &kXPCTestModule;
|