1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef nsScreenManager_h_
7 #define nsScreenManager_h_
9 #include "nsBaseScreen.h"
10 #include "nsIScreenManager.h"
16 class UIKitScreen
: public nsBaseScreen
{
18 explicit UIKitScreen(UIScreen
* screen
);
21 NS_IMETHOD
GetId(uint32_t* outId
) override
{
26 NS_IMETHOD
GetRect(int32_t* aLeft
, int32_t* aTop
, int32_t* aWidth
,
27 int32_t* aHeight
) override
;
28 NS_IMETHOD
GetAvailRect(int32_t* aLeft
, int32_t* aTop
, int32_t* aWidth
,
29 int32_t* aHeight
) override
;
30 NS_IMETHOD
GetRectDisplayPix(int32_t* aLeft
, int32_t* aTop
, int32_t* aWidth
,
31 int32_t* aHeight
) override
;
32 NS_IMETHOD
GetAvailRectDisplayPix(int32_t* aLeft
, int32_t* aTop
,
33 int32_t* aWidth
, int32_t* aHeight
) override
;
34 NS_IMETHOD
GetPixelDepth(int32_t* aPixelDepth
) override
;
35 NS_IMETHOD
GetColorDepth(int32_t* aColorDepth
) override
;
36 NS_IMETHOD
GetContentsScaleFactor(double* aContentsScaleFactor
) override
;
37 NS_IMETHOD
GetDefaultCSSScaleFactor(double* aScaleFactor
) override
{
38 return GetContentsScaleFactor(aScaleFactor
);
45 class UIKitScreenManager
: public nsIScreenManager
{
51 NS_DECL_NSISCREENMANAGER
53 static LayoutDeviceIntRect
GetBounds();
56 virtual ~UIKitScreenManager() {}
57 // TODO: support >1 screen, iPad supports external displays
58 nsCOMPtr
<nsIScreen
> mScreen
;
61 #endif // nsScreenManager_h_