1 /****************************************************************************
2 **
3 ** DQt - D bindings for the Qt Toolkit
4 **
5 ** GNU Lesser General Public License Usage
6 ** This file may be used under the terms of the GNU Lesser
7 ** General Public License version 3 as published by the Free Software
8 ** Foundation and appearing in the file LICENSE.LGPL3 included in the
9 ** packaging of this file. Please review the following information to
10 ** ensure the GNU Lesser General Public License version 3 requirements
11 ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
12 **
13 ****************************************************************************/
14 module qt.gui.screen;
15 extern(C++):
16 
17 import qt.config;
18 import qt.core.global;
19 import qt.core.list;
20 import qt.core.namespace;
21 import qt.core.object;
22 import qt.core.point;
23 import qt.core.rect;
24 import qt.core.size;
25 import qt.core.string;
26 import qt.gui.pixmap;
27 import qt.gui.transform;
28 import qt.gui.windowdefs;
29 import qt.helpers;
30 
31 extern(C++, class) struct QPlatformScreen;
32 extern(C++, class) struct QScreenPrivate;
33 /+ class QWindow;
34 class QRect;
35 class QPixmap;
36 #ifndef QT_NO_DEBUG_STREAM
37 class QDebug;
38 #endif +/
39 
40 class /+ Q_GUI_EXPORT +/ QScreen : QObject
41 {
42     mixin(Q_OBJECT);
43     /+ Q_DECLARE_PRIVATE(QScreen) +/
44 
45     /+ Q_PROPERTY(QString name READ name CONSTANT)
46     Q_PROPERTY(QString manufacturer READ manufacturer CONSTANT)
47     Q_PROPERTY(QString model READ model CONSTANT)
48     Q_PROPERTY(QString serialNumber READ serialNumber CONSTANT)
49     Q_PROPERTY(int depth READ depth CONSTANT)
50     Q_PROPERTY(QSize size READ size NOTIFY geometryChanged)
51     Q_PROPERTY(QSize availableSize READ availableSize NOTIFY availableGeometryChanged)
52     Q_PROPERTY(QSize virtualSize READ virtualSize NOTIFY virtualGeometryChanged)
53     Q_PROPERTY(QSize availableVirtualSize READ availableVirtualSize NOTIFY virtualGeometryChanged)
54     Q_PROPERTY(QRect geometry READ geometry NOTIFY geometryChanged)
55     Q_PROPERTY(QRect availableGeometry READ availableGeometry NOTIFY availableGeometryChanged)
56     Q_PROPERTY(QRect virtualGeometry READ virtualGeometry NOTIFY virtualGeometryChanged)
57     Q_PROPERTY(QRect availableVirtualGeometry READ availableVirtualGeometry NOTIFY virtualGeometryChanged)
58     Q_PROPERTY(QSizeF physicalSize READ physicalSize NOTIFY physicalSizeChanged)
59     Q_PROPERTY(qreal physicalDotsPerInchX READ physicalDotsPerInchX NOTIFY physicalDotsPerInchChanged)
60     Q_PROPERTY(qreal physicalDotsPerInchY READ physicalDotsPerInchY NOTIFY physicalDotsPerInchChanged)
61     Q_PROPERTY(qreal physicalDotsPerInch READ physicalDotsPerInch NOTIFY physicalDotsPerInchChanged)
62     Q_PROPERTY(qreal logicalDotsPerInchX READ logicalDotsPerInchX NOTIFY logicalDotsPerInchChanged)
63     Q_PROPERTY(qreal logicalDotsPerInchY READ logicalDotsPerInchY NOTIFY logicalDotsPerInchChanged)
64     Q_PROPERTY(qreal logicalDotsPerInch READ logicalDotsPerInch NOTIFY logicalDotsPerInchChanged)
65     Q_PROPERTY(qreal devicePixelRatio READ devicePixelRatio NOTIFY physicalDotsPerInchChanged)
66     Q_PROPERTY(Qt::ScreenOrientation primaryOrientation READ primaryOrientation NOTIFY primaryOrientationChanged)
67     Q_PROPERTY(Qt::ScreenOrientation orientation READ orientation NOTIFY orientationChanged)
68     Q_PROPERTY(Qt::ScreenOrientation nativeOrientation READ nativeOrientation)
69     Q_PROPERTY(qreal refreshRate READ refreshRate NOTIFY refreshRateChanged) +/
70 
71 public:
72     ~this();
73     final QPlatformScreen* handle() const;
74 
75     final QString name() const;
76 
77     final QString manufacturer() const;
78     final QString model() const;
79     final QString serialNumber() const;
80 
81     final int depth() const;
82 
83     final QSize size() const;
84     final QRect geometry() const;
85 
86     final QSizeF physicalSize() const;
87 
88     final qreal physicalDotsPerInchX() const;
89     final qreal physicalDotsPerInchY() const;
90     final qreal physicalDotsPerInch() const;
91 
92     final qreal logicalDotsPerInchX() const;
93     final qreal logicalDotsPerInchY() const;
94     final qreal logicalDotsPerInch() const;
95 
96     final qreal devicePixelRatio() const;
97 
98     final QSize availableSize() const;
99     final QRect availableGeometry() const;
100 
101     final QList!(QScreen) virtualSiblings() const;
102     final QScreen virtualSiblingAt(QPoint point);
103 
104     final QSize virtualSize() const;
105     final QRect virtualGeometry() const;
106 
107     final QSize availableVirtualSize() const;
108     final QRect availableVirtualGeometry() const;
109 
110     final /+ Qt:: +/qt.core.namespace.ScreenOrientation primaryOrientation() const;
111     final /+ Qt:: +/qt.core.namespace.ScreenOrientation orientation() const;
112     final /+ Qt:: +/qt.core.namespace.ScreenOrientation nativeOrientation() const;
113 
114     final /+ Qt:: +/qt.core.namespace.ScreenOrientations orientationUpdateMask() const;
115     final void setOrientationUpdateMask(/+ Qt:: +/qt.core.namespace.ScreenOrientations mask);
116 
117     final int angleBetween(/+ Qt:: +/qt.core.namespace.ScreenOrientation a, /+ Qt:: +/qt.core.namespace.ScreenOrientation b) const;
118     final QTransform transformBetween(/+ Qt:: +/qt.core.namespace.ScreenOrientation a, /+ Qt:: +/qt.core.namespace.ScreenOrientation b, ref const(QRect) target) const;
119     final QRect mapBetween(/+ Qt:: +/qt.core.namespace.ScreenOrientation a, /+ Qt:: +/qt.core.namespace.ScreenOrientation b, ref const(QRect) rect) const;
120 
121     final bool isPortrait(/+ Qt:: +/qt.core.namespace.ScreenOrientation orientation) const;
122     final bool isLandscape(/+ Qt:: +/qt.core.namespace.ScreenOrientation orientation) const;
123 
124     final QPixmap grabWindow(WId window, int x = 0, int y = 0, int w = -1, int h = -1);
125 
126     final qreal refreshRate() const;
127 
128 /+ Q_SIGNALS +/public:
129     @QSignal final void geometryChanged(ref const(QRect) geometry);
130     @QSignal final void availableGeometryChanged(ref const(QRect) geometry);
131     @QSignal final void physicalSizeChanged(ref const(QSizeF) size);
132     @QSignal final void physicalDotsPerInchChanged(qreal dpi);
133     @QSignal final void logicalDotsPerInchChanged(qreal dpi);
134     @QSignal final void virtualGeometryChanged(ref const(QRect) rect);
135     @QSignal final void primaryOrientationChanged(/+ Qt:: +/qt.core.namespace.ScreenOrientation orientation);
136     @QSignal final void orientationChanged(/+ Qt:: +/qt.core.namespace.ScreenOrientation orientation);
137     @QSignal final void refreshRateChanged(qreal refreshRate);
138 
139 private:
140     /+ explicit +/this(QPlatformScreen* screen);
141 
142     /+ Q_DISABLE_COPY(QScreen) +/
143     /+ friend class QGuiApplicationPrivate; +/
144     /+ friend class QPlatformIntegration; +/
145     /+ friend class QPlatformScreen; +/
146     /+ friend class QHighDpiScaling; +/
147     /+ friend class QWindowSystemInterface; +/
148 }
149 
150 /+ #ifndef QT_NO_DEBUG_STREAM
151 Q_GUI_EXPORT QDebug operator<<(QDebug, const QScreen *);
152 #endif +/
153