michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 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: #pragma once michael@0: michael@0: #include "nsBaseAppShell.h" michael@0: #include michael@0: #include "nsWindowsHelpers.h" michael@0: #include "nsIObserver.h" michael@0: michael@0: class MetroAppShell : public nsBaseAppShell michael@0: { michael@0: public: michael@0: NS_DECL_NSIOBSERVER michael@0: michael@0: MetroAppShell() : michael@0: mEventWnd(nullptr), michael@0: mPowerRequestCount(0) michael@0: { michael@0: } michael@0: michael@0: nsresult Init(); michael@0: void DoProcessMoreGeckoEvents(); michael@0: void NativeCallback(); michael@0: michael@0: static LRESULT CALLBACK EventWindowProc(HWND, UINT, WPARAM, LPARAM); michael@0: static bool ProcessOneNativeEventIfPresent(); michael@0: static void MarkEventQueueForPurge(); michael@0: static void InputEventsDispatched(); michael@0: michael@0: protected: michael@0: NS_IMETHOD Run(); michael@0: michael@0: virtual void ScheduleNativeEventCallback(); michael@0: virtual bool ProcessNextNativeEvent(bool mayWait); michael@0: static void DispatchAllGeckoEvents(); michael@0: virtual ~MetroAppShell(); michael@0: michael@0: HWND mEventWnd; michael@0: nsAutoHandle mPowerRequest; michael@0: ULONG mPowerRequestCount; michael@0: };