/* KWin - the KDE window manager This file is part of the KDE project. SPDX-FileCopyrightText: 2015 Martin Gräßlin SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef KWIN_VIRTUAL_BACKEND_H #define KWIN_VIRTUAL_BACKEND_H #include "platform.h" #include #include #include class QTemporaryDir; namespace KWin { class VirtualOutput; class KWIN_EXPORT VirtualBackend : public Platform { Q_OBJECT Q_INTERFACES(KWin::Platform) Q_PLUGIN_METADATA(IID "org.kde.kwin.Platform" FILE "virtual.json") public: VirtualBackend(QObject *parent = nullptr); ~VirtualBackend() override; void init() override; bool saveFrames() const { return !m_screenshotDir.isNull(); } QString screenshotDirPath() const; QPainterBackend* createQPainterBackend() override; OpenGLBackend *createOpenGLBackend() override; Q_INVOKABLE void setVirtualOutputs(int count, QVector geometries = QVector(), QVector scales = QVector()); Outputs outputs() const override; Outputs enabledOutputs() const override; QVector supportedCompositors() const override { if (selectedCompositor() != NoCompositing) { return {selectedCompositor()}; } return QVector{OpenGLCompositing, QPainterCompositing}; } void enableOutput(VirtualOutput *output, bool enable); Q_INVOKABLE void removeOutput(AbstractOutput *output); Q_SIGNALS: void virtualOutputsSet(bool countChanged); private: QVector m_outputs; QVector m_outputsEnabled; QScopedPointer m_screenshotDir; }; } #endif