KWin
Loading...
Searching...
No Matches
virtual_backend.h
Go to the documentation of this file.
1/*
2 KWin - the KDE window manager
3 This file is part of the KDE project.
4
5 SPDX-FileCopyrightText: 2015 Martin Gräßlin <mgraesslin@kde.org>
6
7 SPDX-License-Identifier: GPL-2.0-or-later
8*/
9#pragma once
10
11#include "core/outputbackend.h"
13
14#include <QRect>
15
16struct gbm_device;
17
18namespace KWin
19{
20class VirtualBackend;
21class VirtualOutput;
22
23class KWIN_EXPORT VirtualBackend : public OutputBackend
24{
25 Q_OBJECT
26
27public:
28 VirtualBackend(QObject *parent = nullptr);
29 ~VirtualBackend() override;
30
31 bool initialize() override;
32
33 std::unique_ptr<QPainterBackend> createQPainterBackend() override;
34 std::unique_ptr<OpenGLBackend> createOpenGLBackend() override;
35
37 {
38 QRect geometry;
39 double scale = 1;
40 bool internal = false;
41 };
42 Output *addOutput(const OutputInfo &info);
43 void setVirtualOutputs(const QList<OutputInfo> &infos);
44
45 Outputs outputs() const override;
46
47 QList<CompositingType> supportedCompositors() const override;
48
49 void setEglDisplay(std::unique_ptr<EglDisplay> &&display);
50 EglDisplay *sceneEglDisplayObject() const override;
51
52 gbm_device *gbmDevice() const;
53
54Q_SIGNALS:
55 void virtualOutputsSet(bool countChanged);
56
57private:
58 VirtualOutput *createOutput(const OutputInfo &info);
59
60 QList<VirtualOutput *> m_outputs;
61 std::unique_ptr<EglDisplay> m_display;
62 FileDescriptor m_drmFileDescriptor;
63 gbm_device *m_gbmDevice = nullptr;
64};
65
66} // namespace KWin
void virtualOutputsSet(bool countChanged)