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.widgets.desktopwidget; 15 extern(C++): 16 17 import qt.config; 18 import qt.core.point; 19 import qt.core.rect; 20 import qt.gui.event; 21 import qt.helpers; 22 import qt.widgets.widget; 23 24 /+ class QApplication; +/ 25 extern(C++, class) struct QDesktopWidgetPrivate; 26 27 class /+ Q_WIDGETS_EXPORT +/ QDesktopWidget : QWidget 28 { 29 mixin(Q_OBJECT); 30 /+ #if QT_DEPRECATED_SINCE(5, 11) 31 Q_PROPERTY(bool virtualDesktop READ isVirtualDesktop) 32 Q_PROPERTY(int screenCount READ screenCount NOTIFY screenCountChanged) 33 Q_PROPERTY(int primaryScreen READ primaryScreen NOTIFY primaryScreenChanged) 34 #endif +/ 35 public: 36 this(); 37 ~this(); 38 39 final int screenNumber(const(QWidget) widget = null) const; 40 final const(QRect) screenGeometry(const(QWidget) widget) const; 41 final const(QRect) availableGeometry(const(QWidget) widget) const; 42 43 /+ #if QT_DEPRECATED_SINCE(5, 11) +/ 44 /+ QT_DEPRECATED_X("Use QScreen::virtualSiblings() of primary screen") +/ final bool isVirtualDesktop() const; 45 46 /+ QT_DEPRECATED_X("Use QGuiApplication::screens()") +/ final int numScreens() const; 47 /+ QT_DEPRECATED_X("Use QGuiApplication::screens()") +/ pragma(inline, true) final int screenCount() const 48 { 49 /+ QT_WARNING_PUSH 50 QT_WARNING_DISABLE_DEPRECATED +/ 51 return numScreens(); 52 /+ QT_WARNING_POP +/ 53 } 54 /+ QT_DEPRECATED_X("Use QGuiApplication::primaryScreen()") +/ final int primaryScreen() const; 55 56 /+ QT_DEPRECATED_X("Use QGuiApplication::screenAt()") +/ final int screenNumber(ref const(QPoint) ) const; 57 58 /+ QT_DEPRECATED_X("Use QScreen") +/ final QWidget screen(int screen = -1); 59 60 mixin(mangleWindows("?screenGeometry@QDesktopWidget@@QEBA?BVQRect@@H@Z", q{ 61 /+ QT_DEPRECATED_X("Use QGuiApplication::screens()") +/ final const(QRect) screenGeometry(int screen = -1) const; 62 })); 63 /+ QT_DEPRECATED_X("Use QGuiApplication::screenAt()") +/ final const(QRect) screenGeometry(ref const(QPoint) point) const 64 { 65 /+ QT_WARNING_PUSH 66 QT_WARNING_DISABLE_DEPRECATED +/ 67 return screenGeometry(screenNumber(point)); 68 /+ QT_WARNING_POP +/ 69 } 70 71 mixin(mangleWindows("?availableGeometry@QDesktopWidget@@QEBA?BVQRect@@H@Z", q{ 72 /+ QT_DEPRECATED_X("Use QGuiApplication::screens()") +/ final const(QRect) availableGeometry(int screen = -1) const; 73 })); 74 /+ QT_DEPRECATED_X("Use QGuiApplication::screenAt()") +/ final const(QRect) availableGeometry(ref const(QPoint) point) const 75 { 76 /+ QT_WARNING_PUSH 77 QT_WARNING_DISABLE_DEPRECATED +/ 78 return availableGeometry(screenNumber(point)); 79 /+ QT_WARNING_POP +/ 80 } 81 82 /+ Q_SIGNALS +/public: 83 /+ QT_DEPRECATED_X("Use QScreen::geometryChanged()") +/ @QSignal final void resized(int); 84 /+ QT_DEPRECATED_X("Use QScreen::availableGeometryChanged()") +/ @QSignal final void workAreaResized(int); 85 /+ QT_DEPRECATED_X("Use QGuiApplication::screenAdded/Removed()") +/ @QSignal final void screenCountChanged(int); 86 /+ QT_DEPRECATED_X("Use QGuiApplication::primaryScreenChanged()") +/ @QSignal final void primaryScreenChanged(); 87 /+ #endif +/ 88 89 protected: 90 override void resizeEvent(QResizeEvent e); 91 92 private: 93 /+ Q_DISABLE_COPY(QDesktopWidget) +/ 94 /+ Q_DECLARE_PRIVATE(QDesktopWidget) +/ 95 /+ Q_PRIVATE_SLOT(d_func(), void _q_updateScreens()) 96 Q_PRIVATE_SLOT(d_func(), void _q_availableGeometryChanged()) +/ 97 98 /+ friend class QApplication; +/ 99 /+ friend class QApplicationPrivate; +/ 100 } 101 102 /+ #if QT_DEPRECATED_SINCE(5, 11) 103 #endif +/ 104