diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
commit | 2aa4a82499d4becd2284cdb482213d541b8804dd (patch) | |
tree | b80bf8bf13c3766139fbacc530efd0dd9d54394c /widget/uikit/nsWidgetFactory.mm | |
parent | Initial commit. (diff) | |
download | firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.tar.xz firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.zip |
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'widget/uikit/nsWidgetFactory.mm')
-rw-r--r-- | widget/uikit/nsWidgetFactory.mm | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/widget/uikit/nsWidgetFactory.mm b/widget/uikit/nsWidgetFactory.mm new file mode 100644 index 0000000000..bdf1beceeb --- /dev/null +++ b/widget/uikit/nsWidgetFactory.mm @@ -0,0 +1,49 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.h" +#include "mozilla/ModuleUtils.h" + +#include "nsWidgetsCID.h" + +#include "nsAppShell.h" +#include "nsAppShellSingleton.h" +#include "nsLookAndFeel.h" +#include "nsScreenManager.h" + +NS_GENERIC_FACTORY_CONSTRUCTOR(UIKitScreenManager) + +#include "GfxInfo.h" +namespace mozilla { +namespace widget { +// This constructor should really be shared with all platforms. +NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(GfxInfo, Init) +} +} + +NS_DEFINE_NAMED_CID(NS_APPSHELL_CID); +NS_DEFINE_NAMED_CID(NS_SCREENMANAGER_CID); +NS_DEFINE_NAMED_CID(NS_GFXINFO_CID); + +static const mozilla::Module::CIDEntry kWidgetCIDs[] = { + {&kNS_APPSHELL_CID, false, nullptr, nsAppShellConstructor}, + {&kNS_SCREENMANAGER_CID, false, nullptr, UIKitScreenManagerConstructor}, + {&kNS_GFXINFO_CID, false, nullptr, mozilla::widget::GfxInfoConstructor}, + {nullptr}}; + +static const mozilla::Module::ContractIDEntry kWidgetContracts[] = { + {"@mozilla.org/widget/appshell/uikit;1", &kNS_APPSHELL_CID}, + {"@mozilla.org/gfx/screenmanager;1", &kNS_SCREENMANAGER_CID}, + {"@mozilla.org/gfx/info;1", &kNS_GFXINFO_CID}, + {nullptr}}; + +static void nsWidgetUIKitModuleDtor() { + nsLookAndFeel::Shutdown(); + nsAppShellShutdown(); +} + +extern const mozilla::Module kWidgetModule = { + mozilla::Module::kVersion, kWidgetCIDs, kWidgetContracts, nullptr, nullptr, nsAppShellInit, + nsWidgetUIKitModuleDtor}; |