Changeset View
Changeset View
Standalone View
Standalone View
src/screencasting.h
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | SPDX-FileCopyrightText: 2020 Aleix Pol Gonzalez <aleixpol@kde.org> | ||||
3 | | ||||
4 | SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL | ||||
5 | */ | ||||
6 | | ||||
7 | #pragma once | ||||
8 | | ||||
9 | #include <QVector> | ||||
10 | #include <QObject> | ||||
11 | #include <QSharedPointer> | ||||
12 | #include <optional> | ||||
13 | | ||||
14 | #include "registry.h" | ||||
15 | #include <KWayland/Client/kwaylandclient_export.h> | ||||
16 | | ||||
17 | struct zkde_screencast_unstable_v1; | ||||
18 | | ||||
19 | namespace KWayland | ||||
20 | { | ||||
21 | namespace Client | ||||
22 | { | ||||
23 | class ScreencastingPrivate; | ||||
24 | class ScreencastingSourcePrivate; | ||||
25 | class ScreencastingStreamPrivate; | ||||
26 | class ScreencastingStream : public QObject | ||||
27 | { | ||||
28 | Q_OBJECT | ||||
29 | public: | ||||
30 | ScreencastingStream(QObject* parent); | ||||
31 | ~ScreencastingStream() override; | ||||
32 | | ||||
33 | void close(); | ||||
34 | | ||||
35 | Q_SIGNALS: | ||||
36 | void created(quint32 nodeid, const QSize &resolution); | ||||
37 | void failed(const QString &error); | ||||
38 | void closed(); | ||||
39 | | ||||
40 | private: | ||||
41 | friend class Screencasting; | ||||
42 | QScopedPointer<ScreencastingStreamPrivate> d; | ||||
43 | }; | ||||
44 | | ||||
45 | class Screencasting : public QObject | ||||
46 | { | ||||
47 | Q_OBJECT | ||||
48 | public: | ||||
49 | explicit Screencasting(QObject *parent = nullptr); | ||||
50 | explicit Screencasting(Registry *registry, int id, int version, QObject *parent = nullptr); | ||||
51 | ~Screencasting() override; | ||||
52 | | ||||
53 | ScreencastingStream* createOutputStream(KWayland::Client::Output* output); | ||||
54 | ScreencastingStream* createWindowStream(quint32 window); | ||||
55 | | ||||
56 | void setup(zkde_screencast_unstable_v1* screencasting); | ||||
57 | void destroy(); | ||||
58 | | ||||
59 | Q_SIGNALS: | ||||
60 | void initialized(); | ||||
61 | void removed(); | ||||
62 | void sourcesChanged(); | ||||
63 | | ||||
64 | private: | ||||
65 | QScopedPointer<ScreencastingPrivate> d; | ||||
66 | }; | ||||
67 | | ||||
68 | } | ||||
69 | } |