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 | namespace KWayland | ||||
18 | { | ||||
19 | namespace Server | ||||
20 | { | ||||
21 | | ||||
22 | class Display; | ||||
23 | class OutputInterface; | ||||
24 | class Screencasting; | ||||
25 | class ScreencastingSourcePrivate; | ||||
26 | class ScreencastingInterfacePrivate; | ||||
27 | | ||||
28 | class KWAYLANDSERVER_EXPORT ScreencastingSource | ||||
29 | { | ||||
30 | Q_GADGET | ||||
31 | public: | ||||
32 | ScreencastingSource(); | ||||
33 | ScreencastingSource(const QString &description, const QString &iconName, bool isOutput, const QRect &geometry, std::function<void(const ScreencastingSource &, wl_resource *)>); | ||||
34 | ScreencastingSource(const ScreencastingSource& other); | ||||
35 | virtual ~ScreencastingSource(); | ||||
36 | | ||||
37 | quint32 sourceId() const; | ||||
38 | QString iconName() const; | ||||
39 | QString description() const; | ||||
40 | bool isOutput() const; | ||||
41 | QRect geometry() const; | ||||
42 | void call(wl_resource *r); | ||||
43 | | ||||
44 | bool operator!=(const ScreencastingSource &other) const; | ||||
45 | | ||||
46 | private: | ||||
47 | friend ScreencastingInterfacePrivate; | ||||
48 | QSharedPointer<ScreencastingSourcePrivate> d; | ||||
49 | }; | ||||
50 | | ||||
51 | class KWAYLANDSERVER_EXPORT ScreencastingInterface : public QObject | ||||
52 | { | ||||
53 | Q_OBJECT | ||||
54 | public: | ||||
55 | virtual ~ScreencastingInterface(); | ||||
56 | | ||||
57 | void addSource(const ScreencastingSource &source); | ||||
58 | void removeSource(const ScreencastingSource &source); | ||||
59 | | ||||
60 | void sendCreated(wl_resource *resource, quint32 nodeid, quint32 sourceid); | ||||
61 | void sendFailed(wl_resource *resource, quint32 sourceid, const QString &error); | ||||
62 | void sendClosed(wl_resource *resource, quint32 nodeid); | ||||
63 | | ||||
64 | Q_SIGNALS: | ||||
65 | void stop(quint32 nodeid); | ||||
66 | | ||||
67 | private: | ||||
68 | explicit ScreencastingInterface(Display *display, QObject *parent = nullptr); | ||||
69 | friend class Display; | ||||
70 | QScopedPointer<ScreencastingInterfacePrivate> d; | ||||
71 | }; | ||||
72 | | ||||
73 | } | ||||
74 | } |