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