2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07: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/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#ifndef nsScreenManagerWin_h___
|
|
|
|
#define nsScreenManagerWin_h___
|
|
|
|
|
|
|
|
#include "nsIScreenManager.h"
|
|
|
|
|
|
|
|
#include <windows.h>
|
|
|
|
#include "nsCOMPtr.h"
|
2009-02-22 17:05:24 -08:00
|
|
|
#include "nsTArray.h"
|
2012-06-14 11:28:06 -07:00
|
|
|
#include "mozilla/Attributes.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
class nsIScreen;
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------
|
|
|
|
|
2009-03-10 19:26:03 -07:00
|
|
|
class ScreenListItem
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ScreenListItem ( HMONITOR inMon, nsIScreen* inScreen )
|
|
|
|
: mMon(inMon), mScreen(inScreen) { } ;
|
|
|
|
|
|
|
|
HMONITOR mMon;
|
|
|
|
nsCOMPtr<nsIScreen> mScreen;
|
|
|
|
};
|
|
|
|
|
2012-06-14 11:28:06 -07:00
|
|
|
class nsScreenManagerWin MOZ_FINAL : public nsIScreenManager
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsScreenManagerWin ( );
|
|
|
|
~nsScreenManagerWin();
|
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSISCREENMANAGER
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
2012-01-04 23:52:22 -08:00
|
|
|
nsIScreen* CreateNewScreenObject ( HMONITOR inScreen ) ;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-08-22 08:56:38 -07:00
|
|
|
uint32_t mNumberOfScreens;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// cache the screens to avoid the memory allocations
|
2009-03-10 19:26:03 -07:00
|
|
|
nsAutoTArray<ScreenListItem, 8> mScreenList;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // nsScreenManagerWin_h___
|