1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/widget/windows/nsAppShell.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,54 @@ 1.4 +/* -*- Mode: c++; tab-width: 2; indent-tabs-mode: nil; -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#ifndef nsAppShell_h__ 1.10 +#define nsAppShell_h__ 1.11 + 1.12 +#include "nsBaseAppShell.h" 1.13 +#include <windows.h> 1.14 +#include "mozilla/TimeStamp.h" 1.15 +#include "mozilla/Mutex.h" 1.16 + 1.17 +// The maximum time we allow before forcing a native event callback. 1.18 +// In seconds. 1.19 +#define NATIVE_EVENT_STARVATION_LIMIT 1 1.20 + 1.21 +/** 1.22 + * Native Win32 Application shell wrapper 1.23 + */ 1.24 +class nsAppShell : public nsBaseAppShell 1.25 +{ 1.26 +public: 1.27 + nsAppShell() : 1.28 + mEventWnd(nullptr), 1.29 + mNativeCallbackPending(false), 1.30 + mLastNativeEventScheduledMutex("nsAppShell::mLastNativeEventScheduledMutex") 1.31 + {} 1.32 + typedef mozilla::TimeStamp TimeStamp; 1.33 + typedef mozilla::Mutex Mutex; 1.34 + 1.35 + nsresult Init(); 1.36 + void DoProcessMoreGeckoEvents(); 1.37 + 1.38 + static UINT GetTaskbarButtonCreatedMessage(); 1.39 + 1.40 +protected: 1.41 + NS_IMETHOD Run(); 1.42 + NS_IMETHOD Exit(); 1.43 + virtual void ScheduleNativeEventCallback(); 1.44 + virtual bool ProcessNextNativeEvent(bool mayWait); 1.45 + virtual ~nsAppShell(); 1.46 + 1.47 + static LRESULT CALLBACK EventWindowProc(HWND, UINT, WPARAM, LPARAM); 1.48 + 1.49 +protected: 1.50 + HWND mEventWnd; 1.51 + bool mNativeCallbackPending; 1.52 + 1.53 + Mutex mLastNativeEventScheduledMutex; 1.54 + TimeStamp mLastNativeEventScheduled; 1.55 +}; 1.56 + 1.57 +#endif // nsAppShell_h__