KWayland

buffer.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_BUFFER_H
7 #define WAYLAND_BUFFER_H
8 
9 #include <QSize>
10 #include <QScopedPointer>
11 #include <QWeakPointer>
12 
13 #include <KWayland/Client/kwaylandclient_export.h>
14 
15 struct wl_buffer;
16 
17 namespace KWayland
18 {
19 namespace Client
20 {
21 
22 class ShmPool;
23 
31 class KWAYLANDCLIENT_EXPORT Buffer
32 {
33 public:
37  enum class Format {
38  ARGB32,
39  RGB32
40  };
41 
42  ~Buffer();
46  void copy(const void *src);
53  void setReleased(bool released);
66  void setUsed(bool used);
67 
68  wl_buffer *buffer() const;
72  QSize size() const;
76  int32_t stride() const;
80  bool isReleased() const;
84  bool isUsed() const;
88  uchar *address();
92  Format format() const;
93 
94  operator wl_buffer*();
95  operator wl_buffer*() const;
96 
97  typedef QWeakPointer<Buffer> Ptr;
98 
103  static quint32 getId(wl_buffer *b);
104 
105 private:
106  friend class ShmPool;
107  explicit Buffer(ShmPool *parent, wl_buffer *buffer, const QSize &size, int32_t stride, size_t offset, Format format);
108  class Private;
110 };
111 
112 }
113 }
114 
115 #endif
Wrapper class for wl_shm interface.
Definition: shm_pool.h:116
Wrapper class for wl_buffer interface.
Definition: buffer.h:31
Format
All image formats supported by the implementation.
Definition: buffer.h:37
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sun Aug 2 2020 22:49:06 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.