KWayland

shm_pool.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_SHM_POOL_H
7 #define WAYLAND_SHM_POOL_H
8 
9 #include <QObject>
10 
11 #include "buffer.h"
12 #include <KWayland/Client/kwaylandclient_export.h>
13 
14 class QImage;
15 class QSize;
16 
17 struct wl_shm;
18 
19 namespace KWayland
20 {
21 namespace Client
22 {
23 
24 class EventQueue;
25 
116 class KWAYLANDCLIENT_EXPORT ShmPool : public QObject
117 {
118  Q_OBJECT
119 public:
120  explicit ShmPool(QObject *parent = nullptr);
121  virtual ~ShmPool();
126  bool isValid() const;
133  void setup(wl_shm *shm);
141  void release();
158  void destroy();
159 
163  void setEventQueue(EventQueue *queue);
167  EventQueue *eventQueue();
168 
183  Buffer::Ptr createBuffer(const QImage &image);
198  Buffer::Ptr createBuffer(const QSize &size, int32_t stride, const void *src, Buffer::Format format = Buffer::Format::ARGB32);
199  void *poolAddress() const;
213  Buffer::Ptr getBuffer(const QSize &size, int32_t stride, Buffer::Format format = Buffer::Format::ARGB32);
214  wl_shm *shm();
215 Q_SIGNALS:
220  void poolResized();
221 
230  void removed();
231 
232 private:
233  class Private;
235 };
236 
237 }
238 }
239 
240 #endif
Wrapper class for wl_shm interface.
Definition: shm_pool.h:116
Wrapper class for wl_event_queue interface.
Definition: event_queue.h:55
Format
All image formats supported by the implementation.
Definition: buffer.h:37
32-bit ARGB format, can be used for QImage::Format_ARGB32 and QImage::Format_ARGB32_Premultiplied ...
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat Jul 4 2020 22:50:29 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.