Changeset View
Changeset View
Standalone View
Standalone View
wayland_server.h
Show All 17 Lines | |||||
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | *********************************************************************/ | 19 | *********************************************************************/ | ||
20 | #ifndef KWIN_WAYLAND_SERVER_H | 20 | #ifndef KWIN_WAYLAND_SERVER_H | ||
21 | #define KWIN_WAYLAND_SERVER_H | 21 | #define KWIN_WAYLAND_SERVER_H | ||
22 | 22 | | |||
23 | #include <kwinglobals.h> | 23 | #include <kwinglobals.h> | ||
24 | 24 | | |||
25 | #include <QObject> | 25 | #include <QObject> | ||
26 | #include <QPointer> | | |||
27 | 26 | | |||
28 | class QThread; | 27 | class QThread; | ||
29 | class QProcess; | 28 | class QProcess; | ||
30 | class QWindow; | 29 | class QWindow; | ||
31 | 30 | | |||
32 | namespace KWayland | 31 | namespace KWayland | ||
33 | { | 32 | { | ||
34 | namespace Client | 33 | namespace Client | ||
▲ Show 20 Lines • Show All 110 Lines • ▼ Show 20 Line(s) | 81 | public: | |||
145 | void destroyXWaylandConnection(); | 144 | void destroyXWaylandConnection(); | ||
146 | 145 | | |||
147 | /** | 146 | /** | ||
148 | * @returns file descriptor to the input method server's socket. | 147 | * @returns file descriptor to the input method server's socket. | ||
149 | **/ | 148 | **/ | ||
150 | int createInputMethodConnection(); | 149 | int createInputMethodConnection(); | ||
151 | void destroyInputMethodConnection(); | 150 | void destroyInputMethodConnection(); | ||
152 | 151 | | |||
153 | int createXclipboardSyncConnection(); | | |||
154 | | ||||
155 | /** | 152 | /** | ||
156 | * @returns true if screen is locked. | 153 | * @returns true if screen is locked. | ||
157 | **/ | 154 | **/ | ||
158 | bool isScreenLocked() const; | 155 | bool isScreenLocked() const; | ||
159 | /** | 156 | /** | ||
160 | * @returns whether integration with KScreenLocker is available. | 157 | * @returns whether integration with KScreenLocker is available. | ||
161 | **/ | 158 | **/ | ||
162 | bool hasScreenLockerIntegration() const; | 159 | bool hasScreenLockerIntegration() const; | ||
Show All 13 Lines | 172 | KWayland::Server::ClientConnection *inputMethodConnection() const { | |||
176 | return m_inputMethodServerConnection; | 173 | return m_inputMethodServerConnection; | ||
177 | } | 174 | } | ||
178 | KWayland::Server::ClientConnection *internalConnection() const { | 175 | KWayland::Server::ClientConnection *internalConnection() const { | ||
179 | return m_internalConnection.server; | 176 | return m_internalConnection.server; | ||
180 | } | 177 | } | ||
181 | KWayland::Server::ClientConnection *screenLockerClientConnection() const { | 178 | KWayland::Server::ClientConnection *screenLockerClientConnection() const { | ||
182 | return m_screenLockerClientConnection; | 179 | return m_screenLockerClientConnection; | ||
183 | } | 180 | } | ||
184 | QPointer<KWayland::Server::DataDeviceInterface> xclipboardSyncDataDevice() const { | | |||
185 | return m_xclipbaordSync.ddi; | | |||
186 | } | | |||
187 | KWayland::Client::Seat *internalSeat() { | 181 | KWayland::Client::Seat *internalSeat() { | ||
188 | return m_internalConnection.seat; | 182 | return m_internalConnection.seat; | ||
189 | } | 183 | } | ||
190 | KWayland::Client::DataDeviceManager *internalDataDeviceManager() { | 184 | KWayland::Client::DataDeviceManager *internalDataDeviceManager() { | ||
191 | return m_internalConnection.ddm; | 185 | return m_internalConnection.ddm; | ||
192 | } | 186 | } | ||
193 | KWayland::Client::ShmPool *internalShmPool() { | 187 | KWayland::Client::ShmPool *internalShmPool() { | ||
194 | return m_internalConnection.shm; | 188 | return m_internalConnection.shm; | ||
Show All 29 Lines | |||||
224 | void simulateUserActivity(); | 218 | void simulateUserActivity(); | ||
225 | 219 | | |||
226 | Q_SIGNALS: | 220 | Q_SIGNALS: | ||
227 | void shellClientAdded(KWin::ShellClient*); | 221 | void shellClientAdded(KWin::ShellClient*); | ||
228 | void shellClientRemoved(KWin::ShellClient*); | 222 | void shellClientRemoved(KWin::ShellClient*); | ||
229 | void terminatingInternalClientConnection(); | 223 | void terminatingInternalClientConnection(); | ||
230 | void initialized(); | 224 | void initialized(); | ||
231 | void foreignTransientChanged(KWayland::Server::SurfaceInterface *child); | 225 | void foreignTransientChanged(KWayland::Server::SurfaceInterface *child); | ||
232 | void xclipboardSyncDataDeviceCreated(); | | |||
233 | 226 | | |||
234 | private: | 227 | private: | ||
235 | void setupX11ClipboardSync(); | | |||
236 | void shellClientShown(Toplevel *t); | 228 | void shellClientShown(Toplevel *t); | ||
237 | void initOutputs(); | 229 | void initOutputs(); | ||
238 | void syncOutputsToWayland(); | 230 | void syncOutputsToWayland(); | ||
239 | quint16 createClientId(KWayland::Server::ClientConnection *c); | 231 | quint16 createClientId(KWayland::Server::ClientConnection *c); | ||
240 | void destroyInternalConnection(); | 232 | void destroyInternalConnection(); | ||
241 | void configurationChangeRequested(KWayland::Server::OutputConfigurationInterface *config); | 233 | void configurationChangeRequested(KWayland::Server::OutputConfigurationInterface *config); | ||
242 | template <class T> | 234 | template <class T> | ||
243 | void createSurface(T *surface); | 235 | void createSurface(T *surface); | ||
Show All 28 Lines | 261 | struct { | |||
272 | QThread *clientThread = nullptr; | 264 | QThread *clientThread = nullptr; | ||
273 | KWayland::Client::Registry *registry = nullptr; | 265 | KWayland::Client::Registry *registry = nullptr; | ||
274 | KWayland::Client::Seat *seat = nullptr; | 266 | KWayland::Client::Seat *seat = nullptr; | ||
275 | KWayland::Client::DataDeviceManager *ddm = nullptr; | 267 | KWayland::Client::DataDeviceManager *ddm = nullptr; | ||
276 | KWayland::Client::ShmPool *shm = nullptr; | 268 | KWayland::Client::ShmPool *shm = nullptr; | ||
277 | bool interfacesAnnounced = false; | 269 | bool interfacesAnnounced = false; | ||
278 | 270 | | |||
279 | } m_internalConnection; | 271 | } m_internalConnection; | ||
280 | struct { | | |||
281 | QProcess *process = nullptr; | | |||
282 | KWayland::Server::ClientConnection *client = nullptr; | | |||
283 | QPointer<KWayland::Server::DataDeviceInterface> ddi; | | |||
284 | } m_xclipbaordSync; | | |||
285 | KWayland::Server::XdgForeignInterface *m_XdgForeign = nullptr; | 272 | KWayland::Server::XdgForeignInterface *m_XdgForeign = nullptr; | ||
286 | QList<ShellClient*> m_clients; | 273 | QList<ShellClient*> m_clients; | ||
287 | QList<ShellClient*> m_internalClients; | 274 | QList<ShellClient*> m_internalClients; | ||
288 | QHash<KWayland::Server::ClientConnection*, quint16> m_clientIds; | 275 | QHash<KWayland::Server::ClientConnection*, quint16> m_clientIds; | ||
289 | InitalizationFlags m_initFlags; | 276 | InitalizationFlags m_initFlags; | ||
290 | QVector<KWayland::Server::PlasmaShellSurfaceInterface*> m_plasmaShellSurfaces; | 277 | QVector<KWayland::Server::PlasmaShellSurfaceInterface*> m_plasmaShellSurfaces; | ||
291 | KWIN_SINGLETON(WaylandServer) | 278 | KWIN_SINGLETON(WaylandServer) | ||
292 | }; | 279 | }; | ||
Show All 10 Lines |