KWayland

server_decoration.h
1 /*
2  SPDX-FileCopyrightText: 2015 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 KWAYLAND_CLIENT_SERVER_DECORATION_H
7 #define KWAYLAND_CLIENT_SERVER_DECORATION_H
8 
9 #include <QObject>
10 
11 #include <KWayland/Client/kwaylandclient_export.h>
12 
13 struct org_kde_kwin_server_decoration_manager;
14 struct org_kde_kwin_server_decoration;
15 struct wl_surface;
16 
17 namespace KWayland
18 {
19 namespace Client
20 {
21 
22 class EventQueue;
23 class Surface;
24 class ServerSideDecoration;
25 
50 class KWAYLANDCLIENT_EXPORT ServerSideDecorationManager : public QObject
51 {
52  Q_OBJECT
53 public:
60  explicit ServerSideDecorationManager(QObject *parent = nullptr);
61  virtual ~ServerSideDecorationManager();
62 
68  void setup(org_kde_kwin_server_decoration_manager *serversidedecorationmanager);
72  bool isValid() const;
78  void release();
95  void destroy();
96 
100  void setEventQueue(EventQueue *queue);
104  EventQueue *eventQueue();
105 
106  ServerSideDecoration *create(Surface *surface, QObject *parent = nullptr);
107  ServerSideDecoration *create(wl_surface *surface, QObject *parent = nullptr);
108 
109  operator org_kde_kwin_server_decoration_manager*();
110  operator org_kde_kwin_server_decoration_manager*() const;
111 
112 Q_SIGNALS:
119  void removed();
120 
121 private:
122  class Private;
124 };
125 
134 class KWAYLANDCLIENT_EXPORT ServerSideDecoration : public QObject
135 {
136  Q_OBJECT
137 public:
138  virtual ~ServerSideDecoration();
139 
145  void setup(org_kde_kwin_server_decoration *serversidedecoration);
149  bool isValid() const;
155  void release();
170  void destroy();
171 
175  enum class Mode {
179  None,
183  Client,
187  Server,
188  };
189 
198  void requestMode(Mode mode);
199 
207  Mode mode() const;
208 
214  Mode defaultMode() const;
215 
216  operator org_kde_kwin_server_decoration*();
217  operator org_kde_kwin_server_decoration*() const;
218 
219 Q_SIGNALS:
225  void modeChanged();
226 
227 private:
228  friend class ServerSideDecorationManager;
229  explicit ServerSideDecoration(QObject *parent = nullptr);
230  class Private;
232 };
233 
234 
235 }
236 }
237 
239 
240 #endif
Wrapper class for wl_event_queue interface.
Definition: event_queue.h:55
Wrapper for the wl_surface interface.
Definition: surface.h:44
Wrapper for the org_kde_kwin_server_decoration_manager interface.
Mode
Decoration mode used for the Surface.
Describing how a Surface should be decorated.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Aug 7 2020 22:48:19 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.