Changeset View
Changeset View
Standalone View
Standalone View
src/server/screencasting_interface.h
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | SPDX-FileCopyrightText: 2016 Oleg Chernovskiy <kanedias@xaker.ru> | ||||
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 <QObject> | ||||
10 | #include <QRect> | ||||
11 | #include <QScopedPointer> | ||||
12 | #include <QSharedPointer> | ||||
13 | #include <functional> | ||||
14 | #include <KWayland/Server/kwaylandserver_export.h> | ||||
15 | #include <wayland-server.h> | ||||
16 | | ||||
17 | struct wl_resource; | ||||
18 | | ||||
19 | namespace KWayland | ||||
20 | { | ||||
21 | namespace Server | ||||
22 | { | ||||
23 | | ||||
24 | class Display; | ||||
25 | class OutputInterface; | ||||
26 | class Screencasting; | ||||
27 | class ScreencastingSourcePrivate; | ||||
28 | class ScreencastingInterfacePrivate; | ||||
29 | class ScreencastingStreamInterfacePrivate; | ||||
30 | class ScreencastingStreamInterface; | ||||
31 | | ||||
32 | class KWAYLANDSERVER_EXPORT ScreencastingSource | ||||
33 | { | ||||
34 | Q_GADGET | ||||
35 | public: | ||||
36 | ScreencastingSource(); | ||||
37 | ScreencastingSource(const QString &description, const QString &iconName, bool isOutput, const QRect &geometry, const QSize &size, std::function<void(ScreencastingStreamInterface *)>); | ||||
38 | ScreencastingSource(const ScreencastingSource& other); | ||||
39 | virtual ~ScreencastingSource(); | ||||
40 | | ||||
41 | quint32 sourceId() const; | ||||
42 | QString iconName() const; | ||||
43 | QString description() const; | ||||
44 | bool isOutput() const; | ||||
45 | QRect geometry() const; | ||||
46 | QSize size() const; | ||||
47 | void call(ScreencastingStreamInterface *stream); | ||||
48 | | ||||
49 | bool operator!=(const ScreencastingSource &other) const; | ||||
50 | | ||||
51 | private: | ||||
52 | friend ScreencastingInterfacePrivate; | ||||
53 | QSharedPointer<ScreencastingSourcePrivate> d; | ||||
54 | }; | ||||
55 | | ||||
56 | class KWAYLANDSERVER_EXPORT ScreencastingStreamInterface : public QObject | ||||
57 | { | ||||
58 | Q_OBJECT | ||||
59 | public: | ||||
60 | ~ScreencastingStreamInterface() override; | ||||
61 | | ||||
62 | void sendCreated(quint32 nodeid); | ||||
63 | void sendFailed(const QString &error); | ||||
64 | void sendClosed(); | ||||
65 | | ||||
66 | Q_SIGNALS: | ||||
67 | void stop(); | ||||
68 | | ||||
69 | private: | ||||
70 | friend class ScreencastingInterfacePrivate; | ||||
71 | explicit ScreencastingStreamInterface(QObject *parent = nullptr); | ||||
72 | QScopedPointer<ScreencastingStreamInterfacePrivate> d; | ||||
73 | }; | ||||
74 | | ||||
75 | class KWAYLANDSERVER_EXPORT ScreencastingInterface : public QObject | ||||
76 | { | ||||
77 | Q_OBJECT | ||||
78 | public: | ||||
79 | virtual ~ScreencastingInterface(); | ||||
80 | | ||||
81 | void addSource(const ScreencastingSource &source); | ||||
82 | void removeSource(const ScreencastingSource &source); | ||||
83 | | ||||
84 | Q_SIGNALS: | ||||
85 | void destroyingClient(void* client); | ||||
86 | | ||||
87 | private: | ||||
88 | explicit ScreencastingInterface(Display *display, QObject *parent = nullptr); | ||||
89 | friend class Display; | ||||
90 | QScopedPointer<ScreencastingInterfacePrivate> d; | ||||
91 | }; | ||||
92 | | ||||
93 | } | ||||
94 | } |