1// Copyright (C) 2016 LG Electronics Inc, author: <mikko.levonmaa@lge.com>
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QWAYLANDSHM_H
5#define QWAYLANDSHM_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QImage>
19#include <QList>
20
21#include <QtWaylandClient/qtwaylandclientglobal.h>
22#include <QtWaylandClient/private/qwayland-wayland.h>
23#include <QtCore/private/qglobal_p.h>
24
25QT_BEGIN_NAMESPACE
26
27namespace QtWaylandClient {
28
29class QWaylandDisplay;
30
31class Q_WAYLANDCLIENT_EXPORT QWaylandShm : public QtWayland::wl_shm
32{
33
34public:
35
36 QWaylandShm(QWaylandDisplay *display, int version, uint32_t id);
37 ~QWaylandShm() override;
38
39 bool formatSupported(wl_shm_format format) const;
40 bool formatSupported(QImage::Format format) const;
41
42 static wl_shm_format formatFrom(QImage::Format format);
43 static QImage::Format formatFrom(wl_shm_format format);
44
45protected:
46 void shm_format(uint32_t format) override;
47
48private:
49 QList<uint32_t> m_formats;
50
51};
52
53}
54
55QT_END_NAMESPACE
56
57#endif
58
59

source code of qtwayland/src/client/qwaylandshm_p.h