diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2012-01-20 11:34:09 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-20 14:17:41 +0100 |
commit | fc366046b42e4aa9f10efa81b978c89cfb7206a2 (patch) | |
tree | a25f5077c49c1b265e8785a1fa57d744ac0a9f2c /src/plugins/platforms/windows/qwindowsscreen.h | |
parent | 688d463f4ad4ebe62533d416c956d3a30ccfc0a6 (diff) |
Windows: Work on QPlatformScreen implementation.
Implement virtual desktops (which is the default for
EnumDisplayMonitors) and change notifications.
Change-Id: Id24a1b6d9766903901ddf1ded8e9933aa03589d4
Reviewed-by: Oliver Wolff <oliver.wolff@nokia.com>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowsscreen.h')
-rw-r--r-- | src/plugins/platforms/windows/qwindowsscreen.h | 43 |
1 files changed, 36 insertions, 7 deletions
diff --git a/src/plugins/platforms/windows/qwindowsscreen.h b/src/plugins/platforms/windows/qwindowsscreen.h index a7b9ba7fcc..bf81087e39 100644 --- a/src/plugins/platforms/windows/qwindowsscreen.h +++ b/src/plugins/platforms/windows/qwindowsscreen.h @@ -52,6 +52,12 @@ QT_BEGIN_NAMESPACE struct QWindowsScreenData { + enum Flags + { + PrimaryScreen = 0x1, + VirtualDesktop = 0x2 + }; + QWindowsScreenData(); QRect geometry; @@ -60,8 +66,9 @@ struct QWindowsScreenData QSizeF physicalSizeMM; int depth; QImage::Format format; - bool primary; + unsigned flags; QString name; + Qt::ScreenOrientation orientation; }; class QWindowsScreen : public QPlatformScreen @@ -78,7 +85,8 @@ public: virtual QSizeF physicalSize() const { return m_data.physicalSizeMM; } virtual QDpi logicalDpi() const { return m_data.dpi; } virtual QString name() const { return m_data.name; } - + virtual Qt::ScreenOrientation primaryOrientation() { return m_data.orientation; } + virtual QList<QPlatformScreen *> virtualSiblings() const; virtual QWindow *topLevelAt(const QPoint &point) const { return QWindowsScreen::findTopLevelAt(point, CWP_SKIPINVISIBLE); } @@ -86,18 +94,39 @@ public: static QWindow *windowAt(const QPoint &point, unsigned flags = CWP_SKIPINVISIBLE); static QWindow *windowUnderMouse(unsigned flags = CWP_SKIPINVISIBLE); - static QList<QPlatformScreen *> screens(); - virtual QPixmap grabWindow(WId window, int x, int y, int width, int height) const; - const QWindowsCursor &cursor() const { return m_cursor; } - QWindowsCursor &cursor() { return m_cursor; } + inline void handleChanges(const QWindowsScreenData &newData); + + const QWindowsCursor &cursor() const { return m_cursor; } + QWindowsCursor &cursor() { return m_cursor; } + + const QWindowsScreenData &data() const { return m_data; } private: - const QWindowsScreenData m_data; + QWindowsScreenData m_data; QWindowsCursor m_cursor; }; +class QWindowsScreenManager +{ +public: + typedef QList<QWindowsScreen *> WindowsScreenList; + + QWindowsScreenManager(); + ~QWindowsScreenManager(); + + void handleScreenChanges(); + bool handleDisplayChange(WPARAM wParam, LPARAM lParam); + const WindowsScreenList &screens() const { return m_screens; } + +private: + WindowsScreenList m_screens; + int m_lastDepth; + WORD m_lastHorizontalResolution; + WORD m_lastVerticalResolution; +}; + QT_END_NAMESPACE #endif // QWINDOWSSCREEN_H |