You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
1.3 KiB
61 lines
1.3 KiB
/* |
|
KWin - the KDE window manager |
|
This file is part of the KDE project. |
|
|
|
SPDX-FileCopyrightText: 2015 Martin Gräßlin <mgraesslin@kde.org> |
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later |
|
*/ |
|
#pragma once |
|
|
|
#include "core/outputbackend.h" |
|
|
|
#include <kwin_export.h> |
|
|
|
#include <QObject> |
|
#include <QRect> |
|
|
|
class QTemporaryDir; |
|
|
|
namespace KWin |
|
{ |
|
class VirtualBackend; |
|
class VirtualOutput; |
|
|
|
class KWIN_EXPORT VirtualBackend : public OutputBackend |
|
{ |
|
Q_OBJECT |
|
|
|
public: |
|
VirtualBackend(QObject *parent = nullptr); |
|
~VirtualBackend() override; |
|
|
|
bool initialize() override; |
|
|
|
bool saveFrames() const |
|
{ |
|
return m_screenshotDir != nullptr; |
|
} |
|
QString screenshotDirPath() const; |
|
|
|
std::unique_ptr<QPainterBackend> createQPainterBackend() override; |
|
std::unique_ptr<OpenGLBackend> createOpenGLBackend() override; |
|
|
|
Q_INVOKABLE void setVirtualOutputs(const QVector<QRect> &geometries, QVector<int> scales = QVector<int>()); |
|
|
|
Outputs outputs() const override; |
|
|
|
QVector<CompositingType> supportedCompositors() const override |
|
{ |
|
return QVector<CompositingType>{OpenGLCompositing, QPainterCompositing}; |
|
} |
|
|
|
Q_SIGNALS: |
|
void virtualOutputsSet(bool countChanged); |
|
|
|
private: |
|
QVector<VirtualOutput *> m_outputs; |
|
std::unique_ptr<QTemporaryDir> m_screenshotDir; |
|
}; |
|
|
|
} // namespace KWin
|
|
|