widget/windows/winrt/MetroAppShell.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/widget/windows/winrt/MetroAppShell.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,44 @@
     1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     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 +#pragma once
    1.10 +
    1.11 +#include "nsBaseAppShell.h"
    1.12 +#include <windows.h>
    1.13 +#include "nsWindowsHelpers.h"
    1.14 +#include "nsIObserver.h"
    1.15 +
    1.16 +class MetroAppShell : public nsBaseAppShell
    1.17 +{
    1.18 +public:
    1.19 +  NS_DECL_NSIOBSERVER
    1.20 +
    1.21 +  MetroAppShell() :
    1.22 +    mEventWnd(nullptr),
    1.23 +    mPowerRequestCount(0)
    1.24 +  {
    1.25 +  }
    1.26 +
    1.27 +  nsresult Init();
    1.28 +  void DoProcessMoreGeckoEvents();
    1.29 +  void NativeCallback();
    1.30 +
    1.31 +  static LRESULT CALLBACK EventWindowProc(HWND, UINT, WPARAM, LPARAM);
    1.32 +  static bool ProcessOneNativeEventIfPresent();
    1.33 +  static void MarkEventQueueForPurge();
    1.34 +  static void InputEventsDispatched();
    1.35 +
    1.36 +protected:
    1.37 +  NS_IMETHOD Run();
    1.38 +
    1.39 +  virtual void ScheduleNativeEventCallback();
    1.40 +  virtual bool ProcessNextNativeEvent(bool mayWait);
    1.41 +  static void DispatchAllGeckoEvents();
    1.42 +  virtual ~MetroAppShell();
    1.43 +
    1.44 +  HWND mEventWnd;
    1.45 +  nsAutoHandle mPowerRequest;
    1.46 +  ULONG mPowerRequestCount;
    1.47 +};

mercurial