1 | // Copyright (C) 2016 The Qt Company Ltd. |
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #ifndef QSCREEN_P_H |
5 | #define QSCREEN_P_H |
6 | |
7 | // |
8 | // W A R N I N G |
9 | // ------------- |
10 | // |
11 | // This file is not part of the Qt API. It exists purely as an |
12 | // implementation detail. This header file may change from version to |
13 | // version without notice, or even be removed. |
14 | // |
15 | // We mean it. |
16 | // |
17 | |
18 | #include <QtGui/private/qtguiglobal_p.h> |
19 | #include <QtGui/qscreen.h> |
20 | #include <qpa/qplatformscreen.h> |
21 | #include "qhighdpiscaling_p.h" |
22 | |
23 | #include <QtCore/private/qobject_p.h> |
24 | |
25 | QT_BEGIN_NAMESPACE |
26 | |
27 | struct QScreenData |
28 | { |
29 | QPlatformScreen *platformScreen = nullptr; |
30 | |
31 | Qt::ScreenOrientation orientation = Qt::PrimaryOrientation; |
32 | Qt::ScreenOrientation primaryOrientation = Qt::LandscapeOrientation; |
33 | QRect geometry; |
34 | QRect availableGeometry; |
35 | QDpi logicalDpi = {96, 96}; |
36 | qreal refreshRate = 60; |
37 | }; |
38 | |
39 | class QScreenPrivate : public QObjectPrivate, public QScreenData |
40 | { |
41 | Q_DECLARE_PUBLIC(QScreen) |
42 | public: |
43 | void updateGeometry(); |
44 | void updatePrimaryOrientation(); |
45 | |
46 | class UpdateEmitter |
47 | { |
48 | public: |
49 | explicit UpdateEmitter(QScreen *screen); |
50 | ~UpdateEmitter(); |
51 | UpdateEmitter(UpdateEmitter&&) noexcept = default; |
52 | private: |
53 | Q_DISABLE_COPY(UpdateEmitter) |
54 | QScreenData initialState; |
55 | }; |
56 | }; |
57 | |
58 | QT_END_NAMESPACE |
59 | |
60 | #endif // QSCREEN_P_H |
61 | |