Bug 1794292 - [ANGLE] cherry-pick init-gl-point-size. r=gfx-reviewers,bradwerth
[gecko.git] / widget / windows / nsAppShell.h
blobe9bc87a3666b9bd885c376aa475e2e61fb2c4080
1 /* -*- Mode: c++; tab-width: 2; indent-tabs-mode: nil; -*- */
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/. */
6 #ifndef nsAppShell_h__
7 #define nsAppShell_h__
9 #include "nsBaseAppShell.h"
10 #include <windows.h>
11 #include <vector>
12 #include "mozilla/TimeStamp.h"
13 #include "mozilla/Mutex.h"
15 // The maximum time we allow before forcing a native event callback.
16 // In seconds.
17 #define NATIVE_EVENT_STARVATION_LIMIT 1
19 /**
20 * Native Win32 Application shell wrapper
22 class nsAppShell : public nsBaseAppShell {
23 public:
24 nsAppShell()
25 : mEventWnd(nullptr),
26 mNativeCallbackPending(false),
27 mLastNativeEventScheduledMutex(
28 "nsAppShell::mLastNativeEventScheduledMutex") {}
29 typedef mozilla::TimeStamp TimeStamp;
30 typedef mozilla::Mutex Mutex;
32 nsresult Init();
33 void DoProcessMoreGeckoEvents();
35 static UINT GetTaskbarButtonCreatedMessage();
37 NS_IMETHOD AfterProcessNextEvent(nsIThreadInternal* thread,
38 bool eventWasProcessed) final;
40 protected:
41 NS_IMETHOD Run() override;
42 NS_IMETHOD Exit() override;
43 NS_IMETHOD Observe(nsISupports* aSubject, const char* aTopic,
44 const char16_t* aData) override;
46 virtual void ScheduleNativeEventCallback();
47 virtual bool ProcessNextNativeEvent(bool mayWait);
48 virtual ~nsAppShell();
50 static LRESULT CALLBACK EventWindowProc(HWND, UINT, WPARAM, LPARAM);
52 protected:
53 HWND mEventWnd;
54 bool mNativeCallbackPending;
56 Mutex mLastNativeEventScheduledMutex MOZ_UNANNOTATED;
57 TimeStamp mLastNativeEventScheduled;
58 std::vector<MSG> mMsgsToRepost;
60 private:
61 wchar_t mTimezoneName[128];
64 #endif // nsAppShell_h__