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: #include michael@0: #include michael@0: #include michael@0: #include michael@0: #include michael@0: michael@0: #include "nsScreenQt.h" michael@0: #include "nsXULAppAPI.h" michael@0: michael@0: nsScreenQt::nsScreenQt(int aScreen) michael@0: : mScreen(aScreen) michael@0: { michael@0: // nothing else to do. I guess we could cache a bunch of information michael@0: // here, but we want to ask the device at runtime in case anything michael@0: // has changed. michael@0: } michael@0: michael@0: nsScreenQt::~nsScreenQt() michael@0: { michael@0: } michael@0: michael@0: NS_IMETHODIMP michael@0: nsScreenQt::GetRect(int32_t *outLeft,int32_t *outTop, michael@0: int32_t *outWidth,int32_t *outHeight) michael@0: { michael@0: QRect r = QGuiApplication::screens()[mScreen]->geometry(); michael@0: michael@0: *outTop = r.x(); michael@0: *outLeft = r.y(); michael@0: *outWidth = r.width(); michael@0: *outHeight = r.height(); michael@0: michael@0: return NS_OK; michael@0: } michael@0: michael@0: NS_IMETHODIMP michael@0: nsScreenQt::GetAvailRect(int32_t *outLeft,int32_t *outTop, michael@0: int32_t *outWidth,int32_t *outHeight) michael@0: { michael@0: QRect r = QGuiApplication::screens()[mScreen]->geometry(); michael@0: michael@0: *outTop = r.x(); michael@0: *outLeft = r.y(); michael@0: *outWidth = r.width(); michael@0: *outHeight = r.height(); michael@0: michael@0: return NS_OK; michael@0: } michael@0: michael@0: NS_IMETHODIMP michael@0: nsScreenQt::GetPixelDepth(int32_t *aPixelDepth) michael@0: { michael@0: // ############# michael@0: *aPixelDepth = QGuiApplication::primaryScreen()->depth(); michael@0: return NS_OK; michael@0: } michael@0: michael@0: NS_IMETHODIMP michael@0: nsScreenQt::GetColorDepth(int32_t *aColorDepth) michael@0: { michael@0: // ############### michael@0: return GetPixelDepth(aColorDepth); michael@0: }