1 : /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 : /* ***** BEGIN LICENSE BLOCK *****
3 : * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 : *
5 : * The contents of this file are subject to the Mozilla Public License Version
6 : * 1.1 (the "License"); you may not use this file except in compliance with
7 : * the License. You may obtain a copy of the License at
8 : * http://www.mozilla.org/MPL/
9 : *
10 : * Software distributed under the License is distributed on an "AS IS" basis,
11 : * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 : * for the specific language governing rights and limitations under the
13 : * License.
14 : *
15 : * The Original Code is the Mozilla GNOME integration code.
16 : *
17 : * The Initial Developer of the Original Code is
18 : * IBM Corporation.
19 : * Portions created by the Initial Developer are Copyright (C) 2004
20 : * the Initial Developer. All Rights Reserved.
21 : *
22 : * Contributor(s):
23 : * Brian Ryner <bryner@brianryner.com>
24 : *
25 : * Alternatively, the contents of this file may be used under the terms of
26 : * either the GNU General Public License Version 2 or later (the "GPL"), or
27 : * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 : * in which case the provisions of the GPL or the LGPL are applicable instead
29 : * of those above. If you wish to allow use of your version of this file only
30 : * under the terms of either the GPL or the LGPL, and not to allow others to
31 : * use your version of this file under the terms of the MPL, indicate your
32 : * decision by deleting the provisions above and replace them with the notice
33 : * and other provisions required by the GPL or the LGPL. If you do not delete
34 : * the provisions above, a recipient may use your version of this file under
35 : * the terms of any one of the MPL, the GPL or the LGPL.
36 : *
37 : * ***** END LICENSE BLOCK ***** */
38 :
39 : #include "nsToolkitCompsCID.h"
40 : #include "mozilla/ModuleUtils.h"
41 :
42 : #include <glib-object.h>
43 :
44 : #ifdef MOZ_ENABLE_GCONF
45 : #include "nsGConfService.h"
46 544 : NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGConfService, Init)
47 : #endif
48 : #ifdef MOZ_ENABLE_GNOMEVFS
49 : #include "nsGnomeVFSService.h"
50 58 : NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGnomeVFSService, Init)
51 : #endif
52 : #ifdef MOZ_ENABLE_GIO
53 : #include "nsGIOService.h"
54 : #include "nsGSettingsService.h"
55 : NS_GENERIC_FACTORY_CONSTRUCTOR(nsGIOService)
56 : NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGSettingsService, Init)
57 : #endif
58 : #ifdef MOZ_ENABLE_LIBNOTIFY
59 : #include "nsAlertsService.h"
60 0 : NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsAlertsService, Init)
61 : #endif
62 :
63 : #ifdef MOZ_ENABLE_GCONF
64 : NS_DEFINE_NAMED_CID(NS_GCONFSERVICE_CID);
65 : #endif
66 : #ifdef MOZ_ENABLE_GNOMEVFS
67 : NS_DEFINE_NAMED_CID(NS_GNOMEVFSSERVICE_CID);
68 : #endif
69 : #ifdef MOZ_ENABLE_GIO
70 : NS_DEFINE_NAMED_CID(NS_GIOSERVICE_CID);
71 : NS_DEFINE_NAMED_CID(NS_GSETTINGSSERVICE_CID);
72 : #endif
73 : #ifdef MOZ_ENABLE_LIBNOTIFY
74 : NS_DEFINE_NAMED_CID(NS_SYSTEMALERTSSERVICE_CID);
75 : #endif
76 :
77 :
78 : static const mozilla::Module::CIDEntry kGnomeCIDs[] = {
79 : #ifdef MOZ_ENABLE_GCONF
80 : { &kNS_GCONFSERVICE_CID, false, NULL, nsGConfServiceConstructor },
81 : #endif
82 : #ifdef MOZ_ENABLE_GNOMEVFS
83 : { &kNS_GNOMEVFSSERVICE_CID, false, NULL, nsGnomeVFSServiceConstructor },
84 : #endif
85 : #ifdef MOZ_ENABLE_GIO
86 : { &kNS_GIOSERVICE_CID, false, NULL, nsGIOServiceConstructor },
87 : { &kNS_GSETTINGSSERVICE_CID, false, NULL, nsGSettingsServiceConstructor },
88 : #endif
89 : #ifdef MOZ_ENABLE_LIBNOTIFY
90 : { &kNS_SYSTEMALERTSSERVICE_CID, false, NULL, nsAlertsServiceConstructor },
91 : #endif
92 : { NULL }
93 : };
94 :
95 : static const mozilla::Module::ContractIDEntry kGnomeContracts[] = {
96 : #ifdef MOZ_ENABLE_GCONF
97 : { NS_GCONFSERVICE_CONTRACTID, &kNS_GCONFSERVICE_CID },
98 : #endif
99 : #ifdef MOZ_ENABLE_GNOMEVFS
100 : { NS_GNOMEVFSSERVICE_CONTRACTID, &kNS_GNOMEVFSSERVICE_CID },
101 : #endif
102 : #ifdef MOZ_ENABLE_GIO
103 : { NS_GIOSERVICE_CONTRACTID, &kNS_GIOSERVICE_CID },
104 : { NS_GSETTINGSSERVICE_CONTRACTID, &kNS_GSETTINGSSERVICE_CID },
105 : #endif
106 : #ifdef MOZ_ENABLE_LIBNOTIFY
107 : { NS_SYSTEMALERTSERVICE_CONTRACTID, &kNS_SYSTEMALERTSSERVICE_CID },
108 : #endif
109 : { NULL }
110 : };
111 :
112 : static nsresult
113 279 : InitGType ()
114 : {
115 279 : g_type_init();
116 279 : return NS_OK;
117 : }
118 :
119 : static const mozilla::Module kGnomeModule = {
120 : mozilla::Module::kVersion,
121 : kGnomeCIDs,
122 : kGnomeContracts,
123 : NULL,
124 : NULL,
125 : InitGType
126 : };
127 :
128 : NSMODULE_DEFN(mozgnome) = &kGnomeModule;
|