summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowsscreen.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/windows/qwindowsscreen.h')
-rw-r--r--src/plugins/platforms/windows/qwindowsscreen.h43
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