KWayland

buffer_interface.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_SERVER_BUFFER_INTERFACE_H
7 #define WAYLAND_SERVER_BUFFER_INTERFACE_H
8 
9 #include <QImage>
10 #include <QObject>
11 
12 #include <KWayland/Server/kwaylandserver_export.h>
13 
14 struct wl_resource;
15 struct wl_shm_buffer;
16 
17 namespace KWayland
18 {
19 namespace Server
20 {
21 class SurfaceInterface;
22 class LinuxDmabufBuffer;
23 
51 class KWAYLANDSERVER_EXPORT BufferInterface : public QObject
52 {
53  Q_OBJECT
54 public:
55  virtual ~BufferInterface();
65  void ref();
76  void unref();
83  bool isReferenced() const;
84 
88  SurfaceInterface *surface() const;
92  wl_shm_buffer *shmBuffer();
96  LinuxDmabufBuffer *linuxDmabufBuffer();
100  wl_resource *resource() const;
101 
122  QImage data();
123 
134  QSize size() const;
141  void setSize(const QSize &size);
142 
155  bool hasAlphaChannel() const;
156 
157  static BufferInterface *get(wl_resource *r);
158 
159 Q_SIGNALS:
160  void aboutToBeDestroyed(KWayland::Server::BufferInterface*);
165  void sizeChanged();
166 
167 private:
168  friend class SurfaceInterface;
169  explicit BufferInterface(wl_resource *resource, SurfaceInterface *parent);
170  class Private;
172 };
173 
174 }
175 }
176 
177 Q_DECLARE_METATYPE(KWayland::Server::BufferInterface*)
178 
179 #endif
Resource representing a wl_surface.
Reference counted representation of a Wayland buffer on Server side.
The base class for linux-dmabuf buffers.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Thu Dec 3 2020 22:51:03 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.