36class Q_WAYLANDCOMPOSITOR_EXPORT
QWaylandXdgShell :
public QWaylandShellTemplate<QWaylandXdgShell>
39 Q_DECLARE_PRIVATE(QWaylandXdgShell)
41 explicit QWaylandXdgShell();
42 explicit QWaylandXdgShell(QWaylandCompositor *compositor);
44 void initialize() override;
46 static const struct wl_interface *interface();
47 static QByteArray interfaceName();
50 uint ping(QWaylandClient *client);
53 void xdgSurfaceCreated(QWaylandXdgSurface *xdgSurface);
54 void toplevelCreated(QWaylandXdgToplevel *toplevel, QWaylandXdgSurface *xdgSurface);
55 void popupCreated(QWaylandXdgPopup *popup, QWaylandXdgSurface *xdgSurface);
56 void pong(uint serial);
59 void handleSeatChanged(QWaylandSeat *newSeat, QWaylandSeat *oldSeat);
60 void handleFocusChanged(QWaylandSurface *newSurface, QWaylandSurface *oldSurface);
63class Q_WAYLANDCOMPOSITOR_EXPORT
QWaylandXdgSurface :
public QWaylandShellSurfaceTemplate<QWaylandXdgSurface>
66 Q_DECLARE_PRIVATE(QWaylandXdgSurface)
67#if QT_CONFIG(wayland_compositor_quick)
68 Q_WAYLAND_COMPOSITOR_DECLARE_QUICK_CHILDREN(QWaylandXdgSurface)
70 Q_PROPERTY(QWaylandXdgShell *shell READ shell NOTIFY shellChanged)
71 Q_PROPERTY(QWaylandSurface *surface READ surface NOTIFY surfaceChanged)
72 Q_PROPERTY(QWaylandXdgToplevel *toplevel READ toplevel NOTIFY toplevelCreated)
73 Q_PROPERTY(QWaylandXdgPopup *popup READ popup NOTIFY popupCreated)
74 Q_PROPERTY(QRect windowGeometry READ windowGeometry NOTIFY windowGeometryChanged)
75 Q_MOC_INCLUDE(
"qwaylandsurface.h")
78 explicit QWaylandXdgSurface();
79 explicit QWaylandXdgSurface(QWaylandXdgShell* xdgShell, QWaylandSurface *surface,
const QWaylandResource &resource);
81 Q_INVOKABLE
void initialize(QWaylandXdgShell* xdgShell, QWaylandSurface *surface,
const QWaylandResource &resource);
83 Qt::WindowType windowType()
const override;
85 QWaylandXdgShell *shell()
const;
86 QWaylandSurface *surface()
const;
87 QWaylandXdgToplevel *toplevel()
const;
88 QWaylandXdgPopup *popup()
const;
89 QRect windowGeometry()
const;
91 static const struct wl_interface *interface();
92 static QByteArray interfaceName();
93 static QWaylandXdgSurface *fromResource(::wl_resource *resource);
95#if QT_CONFIG(wayland_compositor_quick)
96 QWaylandQuickShellIntegration *createIntegration(QWaylandQuickShellSurfaceItem *item) override;
101 void surfaceChanged();
102 void toplevelCreated();
104 void windowGeometryChanged();
107 void initialize() override;
110 void handleSurfaceSizeChanged();
111 void handleBufferScaleChanged();
117 Q_DECLARE_PRIVATE(QWaylandXdgToplevel)
118 Q_PROPERTY(QWaylandXdgSurface *xdgSurface READ xdgSurface CONSTANT)
119 Q_PROPERTY(QWaylandXdgToplevel *parentToplevel READ parentToplevel NOTIFY parentToplevelChanged)
120 Q_PROPERTY(QString title READ title NOTIFY titleChanged)
121 Q_PROPERTY(QString appId READ appId NOTIFY appIdChanged)
122 Q_PROPERTY(QSize maxSize READ maxSize NOTIFY maxSizeChanged)
123 Q_PROPERTY(QSize minSize READ minSize NOTIFY minSizeChanged)
124 Q_PROPERTY(QList<
int> states READ statesAsInts NOTIFY statesChanged)
125 Q_PROPERTY(
bool maximized READ maximized NOTIFY maximizedChanged)
126 Q_PROPERTY(
bool fullscreen READ fullscreen NOTIFY fullscreenChanged)
127 Q_PROPERTY(
bool resizing READ resizing NOTIFY resizingChanged)
128 Q_PROPERTY(
bool activated READ activated NOTIFY activatedChanged)
129 Q_PROPERTY(
bool modal READ isModal NOTIFY modalChanged FINAL REVISION(6,8))
130 Q_PROPERTY(
enum DecorationMode decorationMode READ decorationMode NOTIFY decorationModeChanged)
141 enum DecorationMode {
142 ClientSideDecoration = 1,
143 ServerSideDecoration = 2,
145 Q_ENUM(DecorationMode)
147 explicit QWaylandXdgToplevel(QWaylandXdgSurface *xdgSurface, QWaylandResource &resource);
148 ~QWaylandXdgToplevel() override;
150 QWaylandXdgSurface *xdgSurface()
const;
151 QWaylandXdgToplevel *parentToplevel()
const;
153 QString title()
const;
154 QString appId()
const;
155 QSize maxSize()
const;
156 QSize minSize()
const;
157 QList<QWaylandXdgToplevel::State> states()
const;
158 bool maximized()
const;
159 bool fullscreen()
const;
160 bool resizing()
const;
161 bool activated()
const;
162 DecorationMode decorationMode()
const;
164 Q_INVOKABLE QSize sizeForResize(
const QSizeF &size,
const QPointF &delta, Qt::Edges edges)
const;
165 uint sendConfigure(
const QSize &size,
const QList<State> &states);
166 Q_INVOKABLE uint sendConfigure(
const QSize &size,
const QList<
int> &states);
167 Q_INVOKABLE
void sendClose();
168 Q_INVOKABLE uint sendMaximized(
const QSize &size);
169 Q_INVOKABLE uint sendUnmaximized(
const QSize &size = QSize(0, 0));
170 Q_INVOKABLE uint sendFullscreen(
const QSize &size);
171 Q_INVOKABLE uint sendResizing(
const QSize &maxSize);
173 static QWaylandSurfaceRole *role();
174 static QWaylandXdgToplevel *fromResource(::wl_resource *resource);
176 bool isModal()
const;
179 void parentToplevelChanged();
182 void maxSizeChanged();
183 void minSizeChanged();
184 void startMove(QWaylandSeat *seat);
185 void startResize(QWaylandSeat *seat, Qt::Edges edges);
186 void statesChanged();
187 void maximizedChanged();
188 void fullscreenChanged();
189 void resizingChanged();
190 void activatedChanged();
192 void showWindowMenu(QWaylandSeat *seat,
const QPoint &localSurfacePosition);
194 void unsetMaximized();
195 void setFullscreen(QWaylandOutput *output);
196 void unsetFullscreen();
199 void decorationModeChanged();
201 Q_REVISION(6, 8)
void modalChanged();
204 QList<
int> statesAsInts()
const;
205 void setModal(
bool newModal);
206 friend class QWaylandXdgDialogV1;
212 Q_DECLARE_PRIVATE(QWaylandXdgPopup)
213 Q_PROPERTY(QWaylandXdgSurface *xdgSurface READ xdgSurface CONSTANT)
214 Q_PROPERTY(QWaylandXdgSurface *parentXdgSurface READ parentXdgSurface CONSTANT)
215 Q_PROPERTY(QRect configuredGeometry READ configuredGeometry NOTIFY configuredGeometryChanged)
218 Q_PROPERTY(QRect anchorRect READ anchorRect CONSTANT)
219 Q_PROPERTY(Qt::Edges anchorEdges READ anchorEdges CONSTANT)
220 Q_PROPERTY(Qt::Edges gravityEdges READ gravityEdges CONSTANT)
221 Q_PROPERTY(Qt::Orientations slideConstraints READ slideConstraints CONSTANT)
222 Q_PROPERTY(Qt::Orientations flipConstraints READ flipConstraints CONSTANT)
223 Q_PROPERTY(Qt::Orientations resizeConstraints READ resizeConstraints CONSTANT)
224 Q_PROPERTY(QPoint offset READ offset CONSTANT)
225 Q_PROPERTY(QSize positionerSize READ positionerSize CONSTANT)
226 Q_PROPERTY(QPoint unconstrainedPosition READ unconstrainedPosition CONSTANT)
228 QWaylandXdgSurface *xdgSurface()
const;
229 QWaylandXdgSurface *parentXdgSurface()
const;
230 QRect configuredGeometry()
const;
233 QRect anchorRect()
const;
234 Qt::Edges anchorEdges()
const ;
235 Qt::Edges gravityEdges()
const ;
236 Qt::Orientations slideConstraints()
const;
237 Qt::Orientations flipConstraints()
const;
238 Qt::Orientations resizeConstraints()
const;
239 QPoint offset()
const;
240 QSize positionerSize()
const;
241 QPoint unconstrainedPosition()
const;
243 Q_INVOKABLE uint sendConfigure(
const QRect &geometry);
244 Q_REVISION(1, 14) Q_INVOKABLE
void sendPopupDone();
246 static QWaylandSurfaceRole *role();
249 void configuredGeometryChanged();
252 explicit QWaylandXdgPopup(QWaylandXdgSurface *xdgSurface, QWaylandXdgSurface *parentXdgSurface,
253 QWaylandXdgPositioner *positioner, QWaylandResource &resource);
254 friend class QWaylandXdgSurfacePrivate;