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