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