1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/toolkit/system/gnome/nsGnomeModule.cpp Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,81 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 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 +#include "nsToolkitCompsCID.h" 1.10 +#include "mozilla/ModuleUtils.h" 1.11 + 1.12 +#include <glib-object.h> 1.13 + 1.14 +#ifdef MOZ_ENABLE_GCONF 1.15 +#include "nsGConfService.h" 1.16 +NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGConfService, Init) 1.17 +#endif 1.18 +#ifdef MOZ_ENABLE_GNOMEVFS 1.19 +#include "nsGnomeVFSService.h" 1.20 +NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGnomeVFSService, Init) 1.21 +#endif 1.22 +#ifdef MOZ_ENABLE_GIO 1.23 +#include "nsGIOService.h" 1.24 +#include "nsGSettingsService.h" 1.25 +NS_GENERIC_FACTORY_CONSTRUCTOR(nsGIOService) 1.26 +NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGSettingsService, Init) 1.27 +#endif 1.28 + 1.29 +#ifdef MOZ_ENABLE_GCONF 1.30 +NS_DEFINE_NAMED_CID(NS_GCONFSERVICE_CID); 1.31 +#endif 1.32 +#ifdef MOZ_ENABLE_GNOMEVFS 1.33 +NS_DEFINE_NAMED_CID(NS_GNOMEVFSSERVICE_CID); 1.34 +#endif 1.35 +#ifdef MOZ_ENABLE_GIO 1.36 +NS_DEFINE_NAMED_CID(NS_GIOSERVICE_CID); 1.37 +NS_DEFINE_NAMED_CID(NS_GSETTINGSSERVICE_CID); 1.38 +#endif 1.39 + 1.40 +static const mozilla::Module::CIDEntry kGnomeCIDs[] = { 1.41 +#ifdef MOZ_ENABLE_GCONF 1.42 + { &kNS_GCONFSERVICE_CID, false, nullptr, nsGConfServiceConstructor }, 1.43 +#endif 1.44 +#ifdef MOZ_ENABLE_GNOMEVFS 1.45 + { &kNS_GNOMEVFSSERVICE_CID, false, nullptr, nsGnomeVFSServiceConstructor }, 1.46 +#endif 1.47 +#ifdef MOZ_ENABLE_GIO 1.48 + { &kNS_GIOSERVICE_CID, false, nullptr, nsGIOServiceConstructor }, 1.49 + { &kNS_GSETTINGSSERVICE_CID, false, nullptr, nsGSettingsServiceConstructor }, 1.50 +#endif 1.51 + { nullptr } 1.52 +}; 1.53 + 1.54 +static const mozilla::Module::ContractIDEntry kGnomeContracts[] = { 1.55 +#ifdef MOZ_ENABLE_GCONF 1.56 + { NS_GCONFSERVICE_CONTRACTID, &kNS_GCONFSERVICE_CID }, 1.57 +#endif 1.58 +#ifdef MOZ_ENABLE_GNOMEVFS 1.59 + { NS_GNOMEVFSSERVICE_CONTRACTID, &kNS_GNOMEVFSSERVICE_CID }, 1.60 +#endif 1.61 +#ifdef MOZ_ENABLE_GIO 1.62 + { NS_GIOSERVICE_CONTRACTID, &kNS_GIOSERVICE_CID }, 1.63 + { NS_GSETTINGSSERVICE_CONTRACTID, &kNS_GSETTINGSSERVICE_CID }, 1.64 +#endif 1.65 + { nullptr } 1.66 +}; 1.67 + 1.68 +static nsresult 1.69 +InitGType () 1.70 +{ 1.71 + g_type_init(); 1.72 + return NS_OK; 1.73 +} 1.74 + 1.75 +static const mozilla::Module kGnomeModule = { 1.76 + mozilla::Module::kVersion, 1.77 + kGnomeCIDs, 1.78 + kGnomeContracts, 1.79 + nullptr, 1.80 + nullptr, 1.81 + InitGType 1.82 +}; 1.83 + 1.84 +NSMODULE_DEFN(mozgnome) = &kGnomeModule;