1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include <QGuiApplication>
11 #include "nsScreenQt.h"
12 #include "nsXULAppAPI.h"
14 nsScreenQt::nsScreenQt(int aScreen
)
17 // nothing else to do. I guess we could cache a bunch of information
18 // here, but we want to ask the device at runtime in case anything
22 nsScreenQt::~nsScreenQt()
27 nsScreenQt::GetId(uint32_t* aId
)
34 nsScreenQt::GetRect(int32_t *outLeft
,int32_t *outTop
,
35 int32_t *outWidth
,int32_t *outHeight
)
37 QRect r
= QGuiApplication::screens()[mScreen
]->geometry();
41 *outWidth
= r
.width();
42 *outHeight
= r
.height();
48 nsScreenQt::GetAvailRect(int32_t *outLeft
,int32_t *outTop
,
49 int32_t *outWidth
,int32_t *outHeight
)
51 QRect r
= QGuiApplication::screens()[mScreen
]->geometry();
55 *outWidth
= r
.width();
56 *outHeight
= r
.height();
62 nsScreenQt::GetPixelDepth(int32_t *aPixelDepth
)
65 *aPixelDepth
= QGuiApplication::primaryScreen()->depth();
70 nsScreenQt::GetColorDepth(int32_t *aColorDepth
)
73 return GetPixelDepth(aColorDepth
);