michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "mozilla/ModuleUtils.h" michael@0: michael@0: #include "nsCOMPtr.h" michael@0: #include "nsWidgetsCID.h" michael@0: #include "nsAppShell.h" michael@0: #include "AndroidBridge.h" michael@0: michael@0: #include "nsWindow.h" michael@0: #include "nsLookAndFeel.h" michael@0: #include "nsAppShellSingleton.h" michael@0: #include "nsScreenManagerAndroid.h" michael@0: michael@0: #include "nsIdleServiceAndroid.h" michael@0: #include "nsClipboard.h" michael@0: #include "nsClipboardHelper.h" michael@0: #include "nsTransferable.h" michael@0: #include "nsPrintOptionsAndroid.h" michael@0: #include "nsPrintSession.h" michael@0: #include "nsDeviceContextAndroid.h" michael@0: #include "nsHTMLFormatConverter.h" michael@0: #include "nsIMEPicker.h" michael@0: #include "nsXULAppAPI.h" michael@0: michael@0: NS_GENERIC_FACTORY_CONSTRUCTOR(nsWindow) michael@0: NS_GENERIC_FACTORY_CONSTRUCTOR(nsScreenManagerAndroid) michael@0: NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIdleServiceAndroid, nsIdleServiceAndroid::GetInstance) michael@0: NS_GENERIC_FACTORY_CONSTRUCTOR(nsTransferable) michael@0: NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboard) michael@0: NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboardHelper) michael@0: NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrintOptionsAndroid, Init) michael@0: NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrintSession, Init) michael@0: NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceContextSpecAndroid) michael@0: NS_GENERIC_FACTORY_CONSTRUCTOR(nsHTMLFormatConverter) michael@0: NS_GENERIC_FACTORY_CONSTRUCTOR(nsIMEPicker) michael@0: NS_GENERIC_FACTORY_CONSTRUCTOR(nsAndroidBridge) michael@0: michael@0: #include "GfxInfo.h" michael@0: namespace mozilla { michael@0: namespace widget { michael@0: // This constructor should really be shared with all platforms. michael@0: NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(GfxInfo, Init) michael@0: } michael@0: } michael@0: michael@0: NS_DEFINE_NAMED_CID(NS_APPSHELL_CID); michael@0: NS_DEFINE_NAMED_CID(NS_WINDOW_CID); michael@0: NS_DEFINE_NAMED_CID(NS_CHILD_CID); michael@0: NS_DEFINE_NAMED_CID(NS_SCREENMANAGER_CID); michael@0: NS_DEFINE_NAMED_CID(NS_IDLE_SERVICE_CID); michael@0: NS_DEFINE_NAMED_CID(NS_TRANSFERABLE_CID); michael@0: NS_DEFINE_NAMED_CID(NS_CLIPBOARD_CID); michael@0: NS_DEFINE_NAMED_CID(NS_CLIPBOARDHELPER_CID); michael@0: NS_DEFINE_NAMED_CID(NS_PRINTSETTINGSSERVICE_CID); michael@0: NS_DEFINE_NAMED_CID(NS_PRINTSESSION_CID); michael@0: NS_DEFINE_NAMED_CID(NS_DEVICE_CONTEXT_SPEC_CID); michael@0: NS_DEFINE_NAMED_CID(NS_HTMLFORMATCONVERTER_CID); michael@0: NS_DEFINE_NAMED_CID(NS_IMEPICKER_CID); michael@0: NS_DEFINE_NAMED_CID(NS_GFXINFO_CID); michael@0: NS_DEFINE_NAMED_CID(NS_ANDROIDBRIDGE_CID); michael@0: michael@0: static const mozilla::Module::CIDEntry kWidgetCIDs[] = { michael@0: { &kNS_WINDOW_CID, false, nullptr, nsWindowConstructor }, michael@0: { &kNS_CHILD_CID, false, nullptr, nsWindowConstructor }, michael@0: { &kNS_APPSHELL_CID, false, nullptr, nsAppShellConstructor }, michael@0: { &kNS_SCREENMANAGER_CID, false, nullptr, nsScreenManagerAndroidConstructor }, michael@0: { &kNS_IDLE_SERVICE_CID, false, nullptr, nsIdleServiceAndroidConstructor }, michael@0: { &kNS_TRANSFERABLE_CID, false, nullptr, nsTransferableConstructor }, michael@0: { &kNS_CLIPBOARD_CID, false, nullptr, nsClipboardConstructor }, michael@0: { &kNS_CLIPBOARDHELPER_CID, false, nullptr, nsClipboardHelperConstructor }, michael@0: { &kNS_PRINTSETTINGSSERVICE_CID, false, nullptr, nsPrintOptionsAndroidConstructor }, michael@0: { &kNS_PRINTSESSION_CID, false, nullptr, nsPrintSessionConstructor }, michael@0: { &kNS_DEVICE_CONTEXT_SPEC_CID, false, nullptr, nsDeviceContextSpecAndroidConstructor }, michael@0: { &kNS_HTMLFORMATCONVERTER_CID, false, nullptr, nsHTMLFormatConverterConstructor }, michael@0: { &kNS_IMEPICKER_CID, false, nullptr, nsIMEPickerConstructor }, michael@0: { &kNS_GFXINFO_CID, false, nullptr, mozilla::widget::GfxInfoConstructor }, michael@0: { &kNS_ANDROIDBRIDGE_CID, false, nullptr, nsAndroidBridgeConstructor }, michael@0: { nullptr } michael@0: }; michael@0: michael@0: static const mozilla::Module::ContractIDEntry kWidgetContracts[] = { michael@0: { "@mozilla.org/widgets/window/android;1", &kNS_WINDOW_CID }, michael@0: { "@mozilla.org/widgets/child_window/android;1", &kNS_CHILD_CID }, michael@0: { "@mozilla.org/widget/appshell/android;1", &kNS_APPSHELL_CID }, michael@0: { "@mozilla.org/gfx/screenmanager;1", &kNS_SCREENMANAGER_CID }, michael@0: { "@mozilla.org/widget/idleservice;1", &kNS_IDLE_SERVICE_CID }, michael@0: { "@mozilla.org/widget/transferable;1", &kNS_TRANSFERABLE_CID }, michael@0: { "@mozilla.org/widget/clipboard;1", &kNS_CLIPBOARD_CID }, michael@0: { "@mozilla.org/widget/clipboardhelper;1", &kNS_CLIPBOARDHELPER_CID }, michael@0: { "@mozilla.org/gfx/printsettings-service;1", &kNS_PRINTSETTINGSSERVICE_CID }, michael@0: { "@mozilla.org/gfx/printsession;1", &kNS_PRINTSESSION_CID }, michael@0: { "@mozilla.org/gfx/devicecontextspec;1", &kNS_DEVICE_CONTEXT_SPEC_CID }, michael@0: { "@mozilla.org/widget/htmlformatconverter;1", &kNS_HTMLFORMATCONVERTER_CID }, michael@0: { "@mozilla.org/imepicker;1", &kNS_IMEPICKER_CID }, michael@0: { "@mozilla.org/gfx/info;1", &kNS_GFXINFO_CID }, michael@0: { "@mozilla.org/android/bridge;1", &kNS_ANDROIDBRIDGE_CID }, michael@0: { nullptr } michael@0: }; michael@0: michael@0: static void michael@0: nsWidgetAndroidModuleDtor() michael@0: { michael@0: nsLookAndFeel::Shutdown(); michael@0: nsAppShellShutdown(); michael@0: } michael@0: michael@0: static const mozilla::Module kWidgetModule = { michael@0: mozilla::Module::kVersion, michael@0: kWidgetCIDs, michael@0: kWidgetContracts, michael@0: nullptr, michael@0: nullptr, michael@0: nsAppShellInit, michael@0: nsWidgetAndroidModuleDtor michael@0: }; michael@0: michael@0: NSMODULE_DEFN(nsWidgetAndroidModule) = &kWidgetModule;