1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "nsAppShell.h"
9 #include "nsWidgetsCID.h"
12 #include "nsComponentManagerUtils.h"
16 #include "nsUXThemeData.h"
18 // unknwn.h is needed to build with WIN32_LEAN_AND_MEAN
21 using namespace mozilla::widget
;
23 nsToolkit
* nsToolkit::gToolkit
= nullptr;
24 HINSTANCE
nsToolkit::mDllInstance
= 0;
26 //-------------------------------------------------------------------------
30 //-------------------------------------------------------------------------
31 nsToolkit::nsToolkit() {
32 MOZ_COUNT_CTOR(nsToolkit
);
34 #if defined(MOZ_STATIC_COMPONENT_LIBS)
35 nsToolkit::Startup(GetModuleHandle(nullptr));
39 //-------------------------------------------------------------------------
43 //-------------------------------------------------------------------------
44 nsToolkit::~nsToolkit() { MOZ_COUNT_DTOR(nsToolkit
); }
46 void nsToolkit::Startup(HMODULE hModule
) {
47 nsToolkit::mDllInstance
= hModule
;
48 WinUtils::Initialize();
51 void nsToolkit::Shutdown() {
56 //-------------------------------------------------------------------------
58 // Return the nsToolkit for the current thread. If a toolkit does not
59 // yet exist, then one will be created...
61 //-------------------------------------------------------------------------
63 nsToolkit
* nsToolkit::GetToolkit() {
65 gToolkit
= new nsToolkit();