26class Q_WAYLANDCOMPOSITOR_EXPORT
QWaylandQtShell :
public QWaylandCompositorExtensionTemplate<QWaylandQtShell>
29 Q_DECLARE_PRIVATE(QWaylandQtShell)
33 QWaylandQtShell(QWaylandCompositor *compositor);
35 void initialize() override;
37 static const struct wl_interface *interface();
38 static QByteArray interfaceName();
40 void registerChrome(QWaylandQtShellChrome *chrome);
41 void unregisterChrome(QWaylandQtShellChrome *chrome);
44 void chromeActivated();
45 void chromeDeactivated();
48 void qtShellSurfaceRequested(QWaylandSurface *surface,
const QWaylandResource &resource);
49 void qtShellSurfaceCreated(QWaylandQtShellSurface *qtShellSurface);
52 bool moveChromeToFront(QWaylandQtShellChrome *chrome);
65 QML_NAMED_ELEMENT(QtShellSurface)
66 QML_ADDED_IN_VERSION(1, 0)
67 Q_DECLARE_PRIVATE(QWaylandQtShellSurface)
68 Q_WAYLAND_COMPOSITOR_DECLARE_QUICK_CHILDREN(QWaylandQtShellSurface)
69 Q_PROPERTY(QWaylandSurface *surface READ surface NOTIFY surfaceChanged)
70 Q_PROPERTY(uint windowFlags READ windowFlags NOTIFY windowFlagsChanged)
71 Q_PROPERTY(uint windowState READ windowState NOTIFY windowStateChanged)
72 Q_PROPERTY(QString windowTitle READ windowTitle READ windowTitle NOTIFY windowTitleChanged)
73 Q_PROPERTY(QRect windowGeometry READ windowGeometry NOTIFY windowGeometryChanged)
74 Q_PROPERTY(QPoint windowPosition READ windowPosition WRITE setWindowPosition NOTIFY windowGeometryChanged)
75 Q_PROPERTY(
bool positionAutomatic READ positionAutomatic NOTIFY positionAutomaticChanged)
76 Q_PROPERTY(QSize minimumSize READ minimumSize NOTIFY minimumSizeChanged)
77 Q_PROPERTY(QSize maximumSize READ maximumSize NOTIFY maximumSizeChanged)
78 Q_PROPERTY(
int frameMarginLeft READ frameMarginLeft WRITE setFrameMarginLeft NOTIFY frameMarginChanged)
79 Q_PROPERTY(
int frameMarginRight READ frameMarginRight WRITE setFrameMarginRight NOTIFY frameMarginChanged)
80 Q_PROPERTY(
int frameMarginTop READ frameMarginTop WRITE setFrameMarginTop NOTIFY frameMarginChanged)
81 Q_PROPERTY(
int frameMarginBottom READ frameMarginBottom WRITE setFrameMarginBottom NOTIFY frameMarginChanged)
82 Q_PROPERTY(
bool active READ active WRITE setActive NOTIFY activeChanged)
83 Q_PROPERTY(CapabilityFlags capabilities READ capabilities WRITE setCapabilities NOTIFY capabilitiesChanged)
84 Q_MOC_INCLUDE(
"qwaylandsurface.h")
92 Q_DECLARE_FLAGS(CapabilityFlags, CapabilityFlag)
93 Q_ENUM(CapabilityFlag)
95 QWaylandQtShellSurface();
96 QWaylandQtShellSurface(QWaylandQtShell *application, QWaylandSurface *surface,
const QWaylandResource &resource);
98 void initialize(QWaylandQtShell *qtShell, QWaylandSurface *surface,
99 const QWaylandResource &resource);
101 QWaylandSurface *surface()
const;
103 static const wl_interface *interface();
104 static QByteArray interfaceName();
105 static QWaylandSurfaceRole *role();
106 static QWaylandQtShellSurface *fromResource(::wl_resource *resource);
108 QRect windowGeometry()
const;
110 void setWindowPosition(
const QPoint &position);
111 QPoint windowPosition()
const;
113 Q_INVOKABLE
void requestWindowGeometry(uint windowState,
const QRect &windowGeometry);
115 QSize minimumSize()
const;
116 QSize maximumSize()
const;
118 void setFrameMargins(
const QMargins &margins);
120 int frameMarginLeft()
const;
121 void setFrameMarginLeft(
int left);
123 int frameMarginRight()
const;
124 void setFrameMarginRight(
int right);
126 int frameMarginTop()
const;
127 void setFrameMarginTop(
int top);
129 int frameMarginBottom()
const;
130 void setFrameMarginBottom(
int bottom);
132 bool positionAutomatic()
const;
135 void setActive(
bool active);
137 QString windowTitle()
const;
139 uint windowFlags()
const;
141 Q_INVOKABLE
void sendClose();
143 uint windowState()
const;
144 void setWindowState(uint windowState);
145#if QT_CONFIG(wayland_compositor_quick)
146 QWaylandQuickShellIntegration *createIntegration(QWaylandQuickShellSurfaceItem *item) override;
149 CapabilityFlags capabilities()
const;
150 void setCapabilities(CapabilityFlags capabilities);
153 void surfaceChanged();
154 void windowFlagsChanged();
155 void windowStateChanged();
156 void windowGeometryChanged();
157 void minimumSizeChanged();
158 void maximumSizeChanged();
159 void positionAutomaticChanged();
161 void startResize(Qt::Edges edges);
162 void windowTitleChanged();
163 void frameMarginChanged();
164 void raiseRequested();
165 void lowerRequested();
166 void activeChanged();
167 void capabilitiesChanged();
170 void surfaceCommitted();
173 friend class QWaylandQtShellChrome;
175 void initialize() override;
177 QWaylandQtShell *shell()
const;