KWayland

shadow.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_SHADOW_H
7 #define KWAYLAND_SHADOW_H
8 
9 #include "buffer.h"
10 
11 #include <QObject>
12 #include <QPoint>
13 #include <QSize>
14 
15 #include <KWayland/Client/kwaylandclient_export.h>
16 
17 struct wl_buffer;
18 struct org_kde_kwin_shadow;
19 struct org_kde_kwin_shadow_manager;
20 
21 class QMarginsF;
22 class QWindow;
23 
24 namespace KWayland
25 {
26 namespace Client
27 {
28 
29 class EventQueue;
30 class Shadow;
31 class Surface;
32 
57 class KWAYLANDCLIENT_EXPORT ShadowManager : public QObject
58 {
59  Q_OBJECT
60 public:
67  explicit ShadowManager(QObject *parent = nullptr);
68  virtual ~ShadowManager();
69 
73  bool isValid() const;
79  void setup(org_kde_kwin_shadow_manager *compositor);
85  void release();
100  void destroy();
101 
105  void setEventQueue(EventQueue *queue);
109  EventQueue *eventQueue();
110 
116  Shadow *createShadow(Surface *surface, QObject *parent = nullptr);
117  void removeShadow(Surface *surface);
118 
119  operator org_kde_kwin_shadow_manager*();
120  operator org_kde_kwin_shadow_manager*() const;
121 
122 Q_SIGNALS:
131  void removed();
132 
133 private:
134  class Private;
136 };
137 
151 class KWAYLANDCLIENT_EXPORT Shadow : public QObject
152 {
153  Q_OBJECT
154 public:
155  virtual ~Shadow();
156 
162  void setup(org_kde_kwin_shadow *shadow);
168  void release();
185  void destroy();
189  bool isValid() const;
190 
191  void commit();
192  void attachLeft(wl_buffer *buffer);
193  void attachLeft(Buffer *buffer);
194  void attachLeft(Buffer::Ptr buffer);
195  void attachTopLeft(wl_buffer *buffer);
196  void attachTopLeft(Buffer *buffer);
197  void attachTopLeft(Buffer::Ptr buffer);
198  void attachTop(wl_buffer *buffer);
199  void attachTop(Buffer *buffer);
200  void attachTop(Buffer::Ptr buffer);
201  void attachTopRight(wl_buffer *buffer);
202  void attachTopRight(Buffer *buffer);
203  void attachTopRight(Buffer::Ptr buffer);
204  void attachRight(wl_buffer *buffer);
205  void attachRight(Buffer *buffer);
206  void attachRight(Buffer::Ptr buffer);
207  void attachBottomRight(wl_buffer *buffer);
208  void attachBottomRight(Buffer *buffer);
209  void attachBottomRight(Buffer::Ptr buffer);
210  void attachBottom(wl_buffer *buffer);
211  void attachBottom(Buffer *buffer);
212  void attachBottom(Buffer::Ptr buffer);
213  void attachBottomLeft(wl_buffer *buffer);
214  void attachBottomLeft(Buffer *buffer);
215  void attachBottomLeft(Buffer::Ptr buffer);
216  void setOffsets(const QMarginsF &margins);
217 
218  operator org_kde_kwin_shadow*();
219  operator org_kde_kwin_shadow*() const;
220 
221 private:
222  friend class ShadowManager;
223  explicit Shadow(QObject *parent = nullptr);
224  class Private;
226 };
227 
228 }
229 }
230 
231 #endif
232 
Wrapper class for wl_event_queue interface.
Definition: event_queue.h:55
Wrapper class for wl_buffer interface.
Definition: buffer.h:31
Wrapper for the org_kde_kwin_shadow interface.
Definition: shadow.h:151
Wrapper for the wl_surface interface.
Definition: surface.h:44
Wrapper for the org_kde_kwin_shadow_manager interface.
Definition: shadow.h:57
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sun May 31 2020 23:09:46 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.