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.
66 lines
1.6 KiB
66 lines
1.6 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 |
|
*/ |
|
#ifndef KWIN_VIRTUAL_BACKEND_H |
|
#define KWIN_VIRTUAL_BACKEND_H |
|
#include "platform.h" |
|
|
|
#include <kwin_export.h> |
|
|
|
#include <QObject> |
|
#include <QRect> |
|
|
|
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; |
|
|
|
Screens *createScreens(QObject *parent = nullptr) override; |
|
QPainterBackend* createQPainterBackend() override; |
|
OpenGLBackend *createOpenGLBackend() override; |
|
|
|
Q_INVOKABLE void setVirtualOutputs(int count, QVector<QRect> geometries = QVector<QRect>(), QVector<int> scales = QVector<int>()); |
|
|
|
Outputs outputs() const override; |
|
Outputs enabledOutputs() const override; |
|
|
|
QVector<CompositingType> supportedCompositors() const override { |
|
if (selectedCompositor() != NoCompositing) { |
|
return {selectedCompositor()}; |
|
} |
|
return QVector<CompositingType>{OpenGLCompositing, QPainterCompositing}; |
|
} |
|
|
|
Q_SIGNALS: |
|
void virtualOutputsSet(bool countChanged); |
|
|
|
private: |
|
QVector<VirtualOutput*> m_outputs; |
|
QScopedPointer<QTemporaryDir> m_screenshotDir; |
|
}; |
|
|
|
} |
|
|
|
#endif
|
|
|