1998-05-21 02:02:14 +04:00
|
|
|
/* -*- Mode: c++; tab-width: 2; indent-tabs-mode: nil; -*- */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* 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/. */
|
1998-05-21 02:02:14 +04:00
|
|
|
|
|
|
|
#ifndef nsAppShell_h__
|
|
|
|
#define nsAppShell_h__
|
|
|
|
|
2006-05-10 21:30:15 +04:00
|
|
|
#include "nsBaseAppShell.h"
|
|
|
|
#include <windows.h>
|
2011-08-09 18:48:10 +04:00
|
|
|
#include "mozilla/TimeStamp.h"
|
1998-05-21 02:02:14 +04:00
|
|
|
|
2013-02-12 01:56:59 +04:00
|
|
|
// The maximum time we allow before forcing a native event callback.
|
|
|
|
// In seconds.
|
|
|
|
#define NATIVE_EVENT_STARVATION_LIMIT 1
|
2012-11-02 15:54:44 +04:00
|
|
|
|
1998-05-21 02:02:14 +04:00
|
|
|
/**
|
|
|
|
* Native Win32 Application shell wrapper
|
|
|
|
*/
|
2006-05-10 21:30:15 +04:00
|
|
|
class nsAppShell : public nsBaseAppShell
|
1998-05-21 02:02:14 +04:00
|
|
|
{
|
2006-05-10 21:30:15 +04:00
|
|
|
public:
|
2010-11-29 19:25:16 +03:00
|
|
|
nsAppShell() :
|
|
|
|
mEventWnd(NULL),
|
2011-10-02 06:16:19 +04:00
|
|
|
mNativeCallbackPending(false)
|
2010-11-29 19:25:16 +03:00
|
|
|
{}
|
2011-08-09 18:48:10 +04:00
|
|
|
typedef mozilla::TimeStamp TimeStamp;
|
2006-05-10 21:30:15 +04:00
|
|
|
|
|
|
|
nsresult Init();
|
2010-11-29 19:25:16 +03:00
|
|
|
void DoProcessMoreGeckoEvents();
|
2006-05-10 21:30:15 +04:00
|
|
|
|
2009-10-06 06:26:54 +04:00
|
|
|
static UINT GetTaskbarButtonCreatedMessage();
|
|
|
|
|
2006-05-10 21:30:15 +04:00
|
|
|
protected:
|
2009-12-18 08:54:02 +03:00
|
|
|
NS_IMETHOD Run();
|
2012-11-02 15:54:44 +04:00
|
|
|
NS_IMETHOD Exit();
|
2006-05-10 21:30:15 +04:00
|
|
|
virtual void ScheduleNativeEventCallback();
|
2011-09-29 10:19:26 +04:00
|
|
|
virtual bool ProcessNextNativeEvent(bool mayWait);
|
2006-05-10 21:30:15 +04:00
|
|
|
virtual ~nsAppShell();
|
1998-05-21 02:02:14 +04:00
|
|
|
|
2006-05-10 21:30:15 +04:00
|
|
|
static LRESULT CALLBACK EventWindowProc(HWND, UINT, WPARAM, LPARAM);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
HWND mEventWnd;
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mNativeCallbackPending;
|
2011-08-09 18:48:10 +04:00
|
|
|
TimeStamp mLastNativeEventScheduled;
|
1998-05-21 02:02:14 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // nsAppShell_h__
|