michael@0: /* -*- Mode: c++; tab-width: 2; indent-tabs-mode: nil; -*- */ 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: #ifndef nsAppShell_h__ michael@0: #define nsAppShell_h__ michael@0: michael@0: #include "nsBaseAppShell.h" michael@0: #include michael@0: #include "mozilla/TimeStamp.h" michael@0: #include "mozilla/Mutex.h" michael@0: michael@0: // The maximum time we allow before forcing a native event callback. michael@0: // In seconds. michael@0: #define NATIVE_EVENT_STARVATION_LIMIT 1 michael@0: michael@0: /** michael@0: * Native Win32 Application shell wrapper michael@0: */ michael@0: class nsAppShell : public nsBaseAppShell michael@0: { michael@0: public: michael@0: nsAppShell() : michael@0: mEventWnd(nullptr), michael@0: mNativeCallbackPending(false), michael@0: mLastNativeEventScheduledMutex("nsAppShell::mLastNativeEventScheduledMutex") michael@0: {} michael@0: typedef mozilla::TimeStamp TimeStamp; michael@0: typedef mozilla::Mutex Mutex; michael@0: michael@0: nsresult Init(); michael@0: void DoProcessMoreGeckoEvents(); michael@0: michael@0: static UINT GetTaskbarButtonCreatedMessage(); michael@0: michael@0: protected: michael@0: NS_IMETHOD Run(); michael@0: NS_IMETHOD Exit(); michael@0: virtual void ScheduleNativeEventCallback(); michael@0: virtual bool ProcessNextNativeEvent(bool mayWait); michael@0: virtual ~nsAppShell(); michael@0: michael@0: static LRESULT CALLBACK EventWindowProc(HWND, UINT, WPARAM, LPARAM); michael@0: michael@0: protected: michael@0: HWND mEventWnd; michael@0: bool mNativeCallbackPending; michael@0: michael@0: Mutex mLastNativeEventScheduledMutex; michael@0: TimeStamp mLastNativeEventScheduled; michael@0: }; michael@0: michael@0: #endif // nsAppShell_h__