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