Changeset View
Changeset View
Standalone View
Standalone View
src/waylandintegration.h
Show All 20 Lines | |||||
21 | #ifndef XDG_DESKTOP_PORTAL_KDE_WAYLAND_INTEGRATION_H | 21 | #ifndef XDG_DESKTOP_PORTAL_KDE_WAYLAND_INTEGRATION_H | ||
22 | #define XDG_DESKTOP_PORTAL_KDE_WAYLAND_INTEGRATION_H | 22 | #define XDG_DESKTOP_PORTAL_KDE_WAYLAND_INTEGRATION_H | ||
23 | 23 | | |||
24 | #include <QObject> | 24 | #include <QObject> | ||
25 | #include <QPoint> | 25 | #include <QPoint> | ||
26 | #include <QSize> | 26 | #include <QSize> | ||
27 | #include <QVariant> | 27 | #include <QVariant> | ||
28 | 28 | | |||
29 | #if HAVE_PIPEWIRE_SUPPORT | | |||
30 | #include <gbm.h> | | |||
31 | #include <epoxy/egl.h> | | |||
32 | #include <epoxy/gl.h> | | |||
33 | #endif | | |||
34 | | ||||
35 | namespace KWayland { | 29 | namespace KWayland { | ||
36 | namespace Client { | 30 | namespace Client { | ||
37 | class PlasmaWindowManagement; | 31 | class PlasmaWindowManagement; | ||
32 | class ScreencastingSource; | ||||
38 | } | 33 | } | ||
39 | } | 34 | } | ||
40 | 35 | | |||
41 | namespace WaylandIntegration | 36 | namespace WaylandIntegration | ||
42 | { | 37 | { | ||
43 | #if HAVE_PIPEWIRE_SUPPORT | | |||
44 | struct EGLStruct { | | |||
45 | QList<QByteArray> extensions; | | |||
46 | EGLDisplay display = EGL_NO_DISPLAY; | | |||
47 | EGLContext context = EGL_NO_CONTEXT; | | |||
48 | }; | | |||
49 | 38 | | |||
50 | class WaylandOutput | 39 | class WaylandOutput | ||
51 | { | 40 | { | ||
52 | public: | 41 | public: | ||
53 | enum OutputType { | 42 | enum OutputType { | ||
54 | Laptop, | 43 | Laptop, | ||
55 | Monitor, | 44 | Monitor, | ||
56 | Television | 45 | Television | ||
Show All 25 Lines | 68 | private: | |||
82 | QPoint m_globalPosition; | 71 | QPoint m_globalPosition; | ||
83 | QSize m_resolution; | 72 | QSize m_resolution; | ||
84 | OutputType m_outputType; | 73 | OutputType m_outputType; | ||
85 | 74 | | |||
86 | // Needed for later output binding | 75 | // Needed for later output binding | ||
87 | int m_waylandOutputName; | 76 | int m_waylandOutputName; | ||
88 | int m_waylandOutputVersion; | 77 | int m_waylandOutputVersion; | ||
89 | }; | 78 | }; | ||
90 | #endif | | |||
91 | 79 | | |||
92 | class WaylandIntegration : public QObject | 80 | class WaylandIntegration : public QObject | ||
93 | { | 81 | { | ||
94 | Q_OBJECT | 82 | Q_OBJECT | ||
95 | Q_SIGNALS: | 83 | Q_SIGNALS: | ||
96 | #if HAVE_PIPEWIRE_SUPPORT | | |||
97 | void newBuffer(uint8_t *screenData); | 84 | void newBuffer(uint8_t *screenData); | ||
98 | #endif | | |||
99 | void plasmaWindowManagementInitialized(); | 85 | void plasmaWindowManagementInitialized(); | ||
100 | }; | 86 | }; | ||
101 | 87 | | |||
102 | #if HAVE_PIPEWIRE_SUPPORT | | |||
103 | const char * formatGLError(GLenum err); | | |||
104 | | ||||
105 | void authenticate(); | 88 | void authenticate(); | ||
106 | 89 | | |||
107 | bool isEGLInitialized(); | | |||
108 | bool isStreamingEnabled(); | 90 | bool isStreamingEnabled(); | ||
109 | 91 | | |||
110 | void startStreamingInput(); | 92 | void startStreamingInput(); | ||
111 | bool startStreaming(quint32 outputName); | 93 | bool startStreaming(const KWayland::Client::ScreencastingSource &source); | ||
112 | void stopStreaming(); | 94 | void stopAllStreaming(); | ||
113 | 95 | | |||
114 | void requestPointerButtonPress(quint32 linuxButton); | 96 | void requestPointerButtonPress(quint32 linuxButton); | ||
115 | void requestPointerButtonRelease(quint32 linuxButton); | 97 | void requestPointerButtonRelease(quint32 linuxButton); | ||
116 | void requestPointerMotion(const QSizeF &delta); | 98 | void requestPointerMotion(const QSizeF &delta); | ||
117 | void requestPointerMotionAbsolute(const QPointF &pos); | 99 | void requestPointerMotionAbsolute(const QPointF &pos); | ||
118 | void requestPointerAxisDiscrete(Qt::Orientation axis, qreal delta); | 100 | void requestPointerAxisDiscrete(Qt::Orientation axis, qreal delta); | ||
119 | 101 | | |||
120 | void requestKeyboardKeycode(int keycode, bool state); | 102 | void requestKeyboardKeycode(int keycode, bool state); | ||
121 | 103 | | |||
122 | EGLStruct egl(); | | |||
123 | QMap<quint32, WaylandOutput> screens(); | 104 | QMap<quint32, WaylandOutput> screens(); | ||
105 | QVector<KWayland::Client::ScreencastingSource> screencastingSources(); | ||||
124 | QVariant streams(); | 106 | QVariant streams(); | ||
125 | #endif | 107 | | ||
126 | void init(); | 108 | void init(); | ||
127 | 109 | | |||
128 | KWayland::Client::PlasmaWindowManagement *plasmaWindowManagement(); | 110 | KWayland::Client::PlasmaWindowManagement *plasmaWindowManagement(); | ||
129 | 111 | | |||
130 | WaylandIntegration *waylandIntegration(); | 112 | WaylandIntegration *waylandIntegration(); | ||
131 | } | 113 | } | ||
132 | 114 | | |||
133 | #endif // XDG_DESKTOP_PORTAL_KDE_WAYLAND_INTEGRATION_H | 115 | #endif // XDG_DESKTOP_PORTAL_KDE_WAYLAND_INTEGRATION_H | ||
134 | 116 | | |||
135 | 117 | |