screencast_interface.h 1.67 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/*
    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 <QRect>
#include <QScopedPointer>
#include <QSharedPointer>
#include <functional>
#include <KWaylandServer/kwaylandserver_export.h>
15
#include <wayland-server.h>
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73

struct wl_resource;

namespace KWaylandServer
{

class Display;
class OutputInterface;
class Screencast;
class ScreencastSourcePrivate;
class ScreencastInterfacePrivate;
class ScreencastStreamInterfacePrivate;
class ScreencastStreamInterface;

class KWAYLANDSERVER_EXPORT ScreencastStreamInterface : public QObject
{
    Q_OBJECT
public:
    ~ScreencastStreamInterface() override;

    void sendCreated(quint32 nodeid);
    void sendFailed(const QString &error);
    void sendClosed();

Q_SIGNALS:
    void finished();

private:
    friend class ScreencastInterfacePrivate;
    explicit ScreencastStreamInterface(QObject *parent);
    QScopedPointer<ScreencastStreamInterfacePrivate> d;
};

class KWAYLANDSERVER_EXPORT ScreencastInterface : public QObject
{
    Q_OBJECT
public:
    virtual ~ScreencastInterface();

    enum CursorMode {
        Hidden = 1,
        Embedded = 2,
        Metadata = 4,
    };
    Q_ENUM(CursorMode);


Q_SIGNALS:
    void outputScreencastRequested(ScreencastStreamInterface* stream, ::wl_resource *output, CursorMode mode);
    void windowScreencastRequested(ScreencastStreamInterface* stream, const QString &winid, CursorMode mode);

private:
    explicit ScreencastInterface(Display *display, QObject *parent = nullptr);
    friend class Display;
    QScopedPointer<ScreencastInterfacePrivate> d;
};

}