Changeset View
Changeset View
Standalone View
Standalone View
src/waylandintegration_p.h
Show All 19 Lines | |||||
20 | 20 | | |||
21 | #ifndef XDG_DESKTOP_PORTAL_KDE_WAYLAND_INTEGRATION_P_H | 21 | #ifndef XDG_DESKTOP_PORTAL_KDE_WAYLAND_INTEGRATION_P_H | ||
22 | #define XDG_DESKTOP_PORTAL_KDE_WAYLAND_INTEGRATION_P_H | 22 | #define XDG_DESKTOP_PORTAL_KDE_WAYLAND_INTEGRATION_P_H | ||
23 | 23 | | |||
24 | #include "waylandintegration.h" | 24 | #include "waylandintegration.h" | ||
25 | 25 | | |||
26 | #include <QDateTime> | 26 | #include <QDateTime> | ||
27 | #include <QMap> | 27 | #include <QMap> | ||
28 | 28 | #include <QVector> | |||
29 | #if HAVE_PIPEWIRE_SUPPORT | | |||
30 | class ScreenCastStream; | | |||
31 | #endif | | |||
32 | 29 | | |||
33 | namespace KWayland { | 30 | namespace KWayland { | ||
34 | namespace Client { | 31 | namespace Client { | ||
35 | class ConnectionThread; | 32 | class ConnectionThread; | ||
36 | class EventQueue; | 33 | class EventQueue; | ||
37 | class Registry; | 34 | class Registry; | ||
38 | class PlasmaWindow; | 35 | class PlasmaWindow; | ||
39 | class PlasmaWindowManagement; | 36 | class PlasmaWindowManagement; | ||
40 | #if HAVE_PIPEWIRE_SUPPORT | 37 | #if HAVE_PIPEWIRE_SUPPORT | ||
41 | class FakeInput; | 38 | class FakeInput; | ||
42 | class RemoteBuffer; | 39 | class RemoteBuffer; | ||
43 | class Output; | 40 | class Output; | ||
44 | class RemoteAccessManager; | 41 | class Screencasting; | ||
45 | #endif | 42 | #endif | ||
46 | } | 43 | } | ||
47 | } | 44 | } | ||
48 | 45 | | |||
49 | namespace WaylandIntegration | 46 | namespace WaylandIntegration | ||
50 | { | 47 | { | ||
51 | 48 | | |||
52 | class WaylandIntegrationPrivate : public WaylandIntegration::WaylandIntegration | 49 | class WaylandIntegrationPrivate : public WaylandIntegration::WaylandIntegration | ||
Show All 16 Lines | 63 | private: | |||
69 | QThread *m_thread = nullptr; | 66 | QThread *m_thread = nullptr; | ||
70 | KWayland::Client::ConnectionThread *m_connection = nullptr; | 67 | KWayland::Client::ConnectionThread *m_connection = nullptr; | ||
71 | KWayland::Client::EventQueue *m_queue = nullptr; | 68 | KWayland::Client::EventQueue *m_queue = nullptr; | ||
72 | KWayland::Client::Registry *m_registry = nullptr; | 69 | KWayland::Client::Registry *m_registry = nullptr; | ||
73 | KWayland::Client::PlasmaWindowManagement *m_windowManagement = nullptr; | 70 | KWayland::Client::PlasmaWindowManagement *m_windowManagement = nullptr; | ||
74 | 71 | | |||
75 | #if HAVE_PIPEWIRE_SUPPORT | 72 | #if HAVE_PIPEWIRE_SUPPORT | ||
76 | public: | 73 | public: | ||
77 | typedef struct { | 74 | struct Stream { | ||
78 | uint nodeId; | 75 | uint nodeId; | ||
79 | QVariantMap map; | 76 | QVariantMap map; | ||
80 | } Stream; | 77 | | ||
81 | typedef QList<Stream> Streams; | 78 | void close(); | ||
79 | }; | ||||
80 | typedef QVector<Stream> Streams; | ||||
82 | 81 | | |||
83 | void authenticate(); | 82 | void authenticate(); | ||
84 | 83 | | |||
85 | void initDrm(); | 84 | void initDrm(); | ||
86 | void initEGL(); | 85 | void initEGL(); | ||
87 | 86 | | |||
88 | bool isEGLInitialized() const; | 87 | bool isEGLInitialized() const; | ||
89 | bool isStreamingEnabled() const; | 88 | bool isStreamingEnabled() const; | ||
90 | 89 | | |||
91 | void bindOutput(int outputName, int outputVersion); | | |||
92 | void startStreamingInput(); | 90 | void startStreamingInput(); | ||
93 | bool startStreaming(quint32 outputName); | 91 | | ||
94 | void stopStreaming(); | 92 | bool startStreaming(const KWayland::Client::ScreencastingSource &source); | ||
93 | void stopStreaming(uint32_t nodeid); | ||||
94 | void stopAllStreaming(); | ||||
95 | 95 | | |||
96 | void requestPointerButtonPress(quint32 linuxButton); | 96 | void requestPointerButtonPress(quint32 linuxButton); | ||
97 | void requestPointerButtonRelease(quint32 linuxButton); | 97 | void requestPointerButtonRelease(quint32 linuxButton); | ||
98 | void requestPointerMotion(const QSizeF &delta); | 98 | void requestPointerMotion(const QSizeF &delta); | ||
99 | void requestPointerMotionAbsolute(const QPointF &pos); | 99 | void requestPointerMotionAbsolute(const QPointF &pos); | ||
100 | void requestPointerAxisDiscrete(Qt::Orientation axis, qreal delta); | 100 | void requestPointerAxisDiscrete(Qt::Orientation axis, qreal delta); | ||
101 | void requestKeyboardKeycode(int keycode, bool state); | 101 | void requestKeyboardKeycode(int keycode, bool state); | ||
102 | 102 | | |||
103 | EGLStruct egl(); | 103 | EGLStruct egl(); | ||
104 | QVector<KWayland::Client::ScreencastingSource> videoStreamingSources(); | ||||
104 | QMap<quint32, WaylandOutput> screens(); | 105 | QMap<quint32, WaylandOutput> screens(); | ||
105 | QVariant streams(); | 106 | QVariant streams(); | ||
106 | 107 | | |||
107 | protected Q_SLOTS: | 108 | protected Q_SLOTS: | ||
108 | void addOutput(quint32 name, quint32 version); | 109 | void addOutput(quint32 name, quint32 version); | ||
109 | void removeOutput(quint32 name); | 110 | void removeOutput(quint32 name); | ||
110 | void processBuffer(const KWayland::Client::RemoteBuffer *rbuf); | | |||
111 | 111 | | |||
112 | private: | 112 | private: | ||
113 | bool m_eglInitialized = false; | 113 | bool m_eglInitialized = false; | ||
114 | bool m_streamingEnabled = false; | | |||
115 | bool m_streamInput = false; | 114 | bool m_streamInput = false; | ||
116 | bool m_waylandAuthenticationRequested = false; | 115 | bool m_waylandAuthenticationRequested = false; | ||
117 | 116 | | |||
118 | quint32 m_output; | 117 | quint32 m_output; | ||
119 | QDateTime m_lastFrameTime; | 118 | QDateTime m_lastFrameTime; | ||
120 | ScreenCastStream *m_stream = nullptr; | 119 | QVector<Stream> m_streams; | ||
121 | 120 | | |||
122 | QPoint m_streamedScreenPosition; | 121 | QPoint m_streamedScreenPosition; | ||
123 | 122 | | |||
124 | QMap<quint32, WaylandOutput> m_outputMap; | 123 | QMap<quint32, WaylandOutput> m_outputMap; | ||
125 | QList<KWayland::Client::Output*> m_bindOutputs; | | |||
126 | 124 | | |||
127 | KWayland::Client::FakeInput *m_fakeInput = nullptr; | 125 | KWayland::Client::FakeInput *m_fakeInput = nullptr; | ||
128 | KWayland::Client::RemoteAccessManager *m_remoteAccessManager = nullptr; | 126 | KWayland::Client::Screencasting *m_screencasting = nullptr; | ||
jgrulich: Shouldn't we rename this variable so it reflects the interface it uses? | |||||
129 | 127 | | |||
130 | qint32 m_drmFd = 0; // for GBM buffer mmap | 128 | qint32 m_drmFd = 0; // for GBM buffer mmap | ||
131 | gbm_device *m_gbmDevice = nullptr; // for passed GBM buffer retrieval | 129 | gbm_device *m_gbmDevice = nullptr; // for passed GBM buffer retrieval | ||
132 | 130 | | |||
133 | EGLStruct m_egl; | 131 | EGLStruct m_egl; | ||
134 | #endif | 132 | #endif | ||
135 | }; | 133 | }; | ||
136 | 134 | | |||
137 | } | 135 | } | ||
138 | 136 | | |||
139 | #endif // XDG_DESKTOP_PORTAL_KDE_WAYLAND_INTEGRATION_P_H | 137 | #endif // XDG_DESKTOP_PORTAL_KDE_WAYLAND_INTEGRATION_P_H | ||
140 | 138 | | |||
141 | 139 | |
Shouldn't we rename this variable so it reflects the interface it uses?