1
0
mirror of https://invent.kde.org/network/krfb synced 2024-07-05 09:28:35 +00:00
krfb/framebuffers/pipewire/screencasting.h
Aleix Pol 4707bde236 Introduce krfb-virtualmonitor
It implements a KWin protocol that is oriented towards serving a virtual
display specifically.
It requests KWin a stream that will act as a monitor that we can feed
into remote clients.
2021-10-29 14:05:34 +00:00

79 lines
1.8 KiB
C++

/*
SPDX-FileCopyrightText: 2020 Aleix Pol Gonzalez <aleixpol@kde.org>
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#pragma once
#include <QObject>
#include <QSharedPointer>
#include <QVector>
#include <optional>
struct zkde_screencast_unstable_v1;
namespace KWayland
{
namespace Client
{
class PlasmaWindow;
class Registry;
class Output;
}
}
class ScreencastingPrivate;
class ScreencastingSourcePrivate;
class ScreencastingStreamPrivate;
class ScreencastingStream : public QObject
{
Q_OBJECT
public:
ScreencastingStream(QObject *parent);
~ScreencastingStream() override;
quint32 nodeId() const;
Q_SIGNALS:
void created(quint32 nodeid);
void failed(const QString &error);
void closed();
private:
friend class Screencasting;
QScopedPointer<ScreencastingStreamPrivate> d;
};
class Screencasting : public QObject
{
Q_OBJECT
public:
explicit Screencasting(QObject *parent = nullptr);
explicit Screencasting(KWayland::Client::Registry *registry, int id, int version, QObject *parent = nullptr);
~Screencasting() override;
enum CursorMode {
Hidden = 1,
Embedded = 2,
Metadata = 4,
};
Q_ENUM(CursorMode);
ScreencastingStream *createOutputStream(KWayland::Client::Output *output, CursorMode mode);
ScreencastingStream *createWindowStream(KWayland::Client::PlasmaWindow *window, CursorMode mode);
ScreencastingStream *createWindowStream(const QString &uuid, CursorMode mode);
ScreencastingStream *createVirtualMonitorStream(const QString &name, const QSize &resolution, qreal dpr, CursorMode mode);
void setup(zkde_screencast_unstable_v1 *screencasting);
void destroy();
Q_SIGNALS:
void initialized();
void removed();
void sourcesChanged();
private:
QScopedPointer<ScreencastingPrivate> d;
};