KWayland

shell.h
1 /*
2  SPDX-FileCopyrightText: 2014 Martin Gräßlin <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5 */
6 #ifndef WAYLAND_SHELL_H
7 #define WAYLAND_SHELL_H
8 
9 #include <QObject>
10 #include <QPoint>
11 #include <QSize>
12 #include <QWindow>
13 
14 #include <KWayland/Client/kwaylandclient_export.h>
15 
16 struct wl_surface;
17 struct wl_shell;
18 struct wl_shell_surface;
19 
20 namespace KWayland
21 {
22 namespace Client
23 {
24 class EventQueue;
25 class ShellSurface;
26 class Output;
27 class Seat;
28 class Surface;
29 
55 class KWAYLANDCLIENT_EXPORT Shell : public QObject
56 {
57  Q_OBJECT
58 public:
59  explicit Shell(QObject *parent = nullptr);
60  virtual ~Shell();
61 
65  bool isValid() const;
74  void release();
94  void destroy();
100  void setup(wl_shell *shell);
101 
105  void setEventQueue(EventQueue *queue);
109  EventQueue *eventQueue();
110 
118  ShellSurface *createSurface(wl_surface *surface, QObject *parent = nullptr);
126  ShellSurface *createSurface(Surface *surface, QObject *parent = nullptr);
127 
128  operator wl_shell*();
129  operator wl_shell*() const;
130 
131 Q_SIGNALS:
135  void interfaceAboutToBeReleased();
139  void interfaceAboutToBeDestroyed();
140 
149  void removed();
150 
151 private:
152  class Private;
154 };
155 
166 class KWAYLANDCLIENT_EXPORT ShellSurface : public QObject
167 {
168  Q_OBJECT
172  Q_PROPERTY(QSize size READ size WRITE setSize NOTIFY sizeChanged)
173 public:
174  explicit ShellSurface(QObject *parent);
175  virtual ~ShellSurface();
176 
185  void release();
200  void destroy();
206  void setup(wl_shell_surface *surface);
207  QSize size() const;
208  void setSize(const QSize &size);
209 
213  void setFullscreen(Output *output = nullptr);
214  void setMaximized(Output *output = nullptr);
215  void setToplevel();
221  enum class TransientFlag {
222  Default = 0x0,
223  NoFocus = 0x1
224  };
225  Q_DECLARE_FLAGS(TransientFlags, TransientFlag)
234  void setTransient(Surface *parent, const QPoint &offset = QPoint(), TransientFlags flags = TransientFlag::Default);
235 
254  void setTransientPopup(Surface *parent, Seat *grabbedSeat, quint32 grabSerial, const QPoint &offset = QPoint(), TransientFlags flags = TransientFlag::Default);
255 
256  bool isValid() const;
257 
265  void requestMove(Seat *seat, quint32 serial);
266 
275  void requestResize(Seat *seat, quint32 serial, Qt::Edges edges);
276 
285  void setTitle(const QString &title);
286 
296  void setWindowClass(const QByteArray &windowClass);
297 
307  static ShellSurface *fromWindow(QWindow *window);
308 
319  static ShellSurface *fromQtWinId(WId wid);
320 
325  static ShellSurface *get(wl_shell_surface *native);
326 
327  operator wl_shell_surface*();
328  operator wl_shell_surface*() const;
329 
330 Q_SIGNALS:
335  void pinged();
336  void sizeChanged(const QSize &);
337 
345  void popupDone();
346 
347 private:
348  class Private;
350 };
351 
352 }
353 }
354 
357 
358 #endif
typedef Edges
Wrapper class for wl_event_queue interface.
Definition: event_queue.h:55
Wrapper for the wl_seat interface.
Definition: seat.h:52
Wrapper for the wl_output interface.
Definition: output.h:55
Wrapper for the wl_surface interface.
Definition: surface.h:44
TransientFlag
Flags which can be passed to a transient surface.
Definition: shell.h:221
Wrapper for the wl_shell_surface interface.
Definition: shell.h:166
Wrapper for the wl_shell interface.
Definition: shell.h:55
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Sep 21 2020 22:50:48 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.