2019-05-20 08:10:30 +02:00
|
|
|
/* This file is part of the KDE project
|
2024-08-08 01:08:31 +02:00
|
|
|
SPDX-FileCopyrightText: 2018 Oleg Chernovskiy <kanedias@xaker.ru>
|
|
|
|
|
SPDX-FileCopyrightText: 2018-2020 Jan Grulich <jgrulich@redhat.com>
|
2019-05-20 08:10:30 +02:00
|
|
|
|
2024-08-08 01:08:31 +02:00
|
|
|
SPDX-License-Identifier: GPL-3.0-or-later
|
2019-05-20 08:10:30 +02:00
|
|
|
*/
|
|
|
|
|
#ifndef KRFB_FRAMEBUFFER_XCB_XCB_FRAMEBUFFER_H
|
|
|
|
|
#define KRFB_FRAMEBUFFER_XCB_XCB_FRAMEBUFFER_H
|
|
|
|
|
|
|
|
|
|
#include "framebuffer.h"
|
|
|
|
|
#include <QWidget>
|
|
|
|
|
#include <QVariantMap>
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief The PWFrameBuffer class - framebuffer implementation based on XDG Desktop Portal ScreenCast interface.
|
|
|
|
|
* The design relies heavily on a presence of XDG D-Bus service and PipeWire daemon.
|
|
|
|
|
*
|
|
|
|
|
* @author Oleg Chernovskiy <kanedias@xaker.ru>
|
|
|
|
|
*/
|
|
|
|
|
class PWFrameBuffer: public FrameBuffer
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
2021-07-09 08:53:04 +02:00
|
|
|
using Stream = struct {
|
2019-05-20 08:10:30 +02:00
|
|
|
uint nodeId;
|
|
|
|
|
QVariantMap map;
|
2021-07-09 08:53:04 +02:00
|
|
|
};
|
|
|
|
|
using Streams = QList<Stream>;
|
2019-05-20 08:10:30 +02:00
|
|
|
|
2022-08-03 22:00:16 +02:00
|
|
|
PWFrameBuffer(QObject *parent = nullptr);
|
2019-05-20 08:10:30 +02:00
|
|
|
virtual ~PWFrameBuffer() override;
|
|
|
|
|
|
2021-10-14 16:02:04 +02:00
|
|
|
void initDBus();
|
|
|
|
|
void startVirtualMonitor(const QString &name, const QSize &resolution, qreal dpr);
|
|
|
|
|
|
2019-05-20 08:10:30 +02:00
|
|
|
int depth() override;
|
|
|
|
|
int height() override;
|
|
|
|
|
int width() override;
|
|
|
|
|
int paddedWidth() override;
|
|
|
|
|
void getServerFormat(rfbPixelFormat &format) override;
|
|
|
|
|
void startMonitor() override;
|
|
|
|
|
void stopMonitor() override;
|
2021-10-29 17:31:53 +02:00
|
|
|
QPoint cursorPosition() override;
|
2019-05-20 08:10:30 +02:00
|
|
|
|
|
|
|
|
QVariant customProperty(const QString &property) const override;
|
|
|
|
|
|
|
|
|
|
bool isValid() const;
|
|
|
|
|
|
|
|
|
|
private Q_SLOTS:
|
2022-12-12 15:39:33 +01:00
|
|
|
void handleXdpSessionCreated(quint32 code, const QVariantMap &results);
|
|
|
|
|
void handleXdpDevicesSelected(quint32 code, const QVariantMap &results);
|
|
|
|
|
void handleXdpSourcesSelected(quint32 code, const QVariantMap &results);
|
|
|
|
|
void handleXdpRemoteDesktopStarted(quint32 code, const QVariantMap &results);
|
2019-05-20 08:10:30 +02:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
class Private;
|
|
|
|
|
const QScopedPointer<Private> d;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|