KWayland

display.h
1 /*
2  SPDX-FileCopyrightText: 2014 Martin Gräßlin <[email protected]>
3  SPDX-FileCopyrightText: 2018 David Edmundson <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
6 */
7 #ifndef WAYLAND_SERVER_DISPLAY_H
8 #define WAYLAND_SERVER_DISPLAY_H
9 
10 #include <QList>
11 #include <QObject>
12 
13 #include <KWayland/Server/kwaylandserver_export.h>
14 
15 #include "clientconnection.h"
16 
17 struct wl_client;
18 struct wl_display;
19 struct wl_event_loop;
20 
21 namespace KWayland
22 {
36 namespace Server
37 {
38 
39 class CompositorInterface;
40 class DataDeviceManagerInterface;
41 class DpmsManagerInterface;
42 class IdleInterface;
44 class RemoteAccessManagerInterface;
45 class IdleInhibitManagerInterface;
46 class FakeInputInterface;
47 class OutputInterface;
48 class OutputDeviceInterface;
49 class OutputConfigurationInterface;
50 class OutputManagementInterface;
51 class PlasmaShellInterface;
52 class PlasmaWindowManagementInterface;
53 class QtSurfaceExtensionInterface;
54 class SeatInterface;
55 class ShadowManagerInterface;
56 class BlurManagerInterface;
57 class ContrastManagerInterface;
58 class ServerSideDecorationManagerInterface;
59 class SlideManagerInterface;
60 class ShellInterface;
61 class SubCompositorInterface;
62 enum class TextInputInterfaceVersion;
63 class TextInputManagerInterface;
64 class XdgShellV5Interface;
65 enum class XdgShellInterfaceVersion;
66 class XdgShellInterface;
68 class RelativePointerManagerInterface;
70 class PointerGesturesInterface;
72 class PointerConstraintsInterface;
73 class XdgForeignInterface;
74 class AppMenuManagerInterface;
75 class ServerSideDecorationPaletteManagerInterface;
76 class PlasmaVirtualDesktopManagementInterface;
77 class XdgOutputManagerInterface;
78 class XdgDecorationManagerInterface;
79 class EglStreamControllerInterface;
80 class KeyStateInterface;
81 class LinuxDmabufUnstableV1Interface;
82 class TabletManagerInterface;
83 
89 class KWAYLANDSERVER_EXPORT Display : public QObject
90 {
91  Q_OBJECT
92  Q_PROPERTY(QString socketName READ socketName WRITE setSocketName NOTIFY socketNameChanged)
93  Q_PROPERTY(bool automaticSocketNaming READ automaticSocketNaming WRITE setAutomaticSocketNaming NOTIFY automaticSocketNamingChanged)
94  Q_PROPERTY(bool running READ isRunning NOTIFY runningChanged)
95 public:
96  explicit Display(QObject *parent = nullptr);
97  virtual ~Display();
98 
103  void setSocketName(const QString &name);
104  QString socketName() const;
105 
112  void setAutomaticSocketNaming(bool automaticSocketNaming);
113  bool automaticSocketNaming() const;
114 
115  quint32 serial();
116  quint32 nextSerial();
117 
123  enum class StartMode {
124  ConnectToSocket,
125  ConnectClientsOnly
126  };
127  void start(StartMode mode = StartMode::ConnectToSocket);
128  void terminate();
137  void startLoop();
145  void dispatchEvents(int msecTimeout = -1);
146 
158  ClientConnection *createClient(int fd);
159 
160  operator wl_display*();
161  operator wl_display*() const;
162  bool isRunning() const;
163 
164  OutputInterface *createOutput(QObject *parent = nullptr);
165  void removeOutput(OutputInterface *output);
166  QList<OutputInterface*> outputs() const;
167 
168  OutputDeviceInterface *createOutputDevice(QObject *parent = nullptr);
169  void removeOutputDevice(OutputDeviceInterface *output);
170  QList<OutputDeviceInterface*> outputDevices() const;
171 
172  CompositorInterface *createCompositor(QObject *parent = nullptr);
173  void createShm();
174  ShellInterface *createShell(QObject *parent = nullptr);
175  SeatInterface *createSeat(QObject *parent = nullptr);
180  QVector<SeatInterface*> seats() const;
181  SubCompositorInterface *createSubCompositor(QObject *parent = nullptr);
182  DataDeviceManagerInterface *createDataDeviceManager(QObject *parent = nullptr);
183  OutputManagementInterface *createOutputManagement(QObject *parent = nullptr);
184  PlasmaShellInterface *createPlasmaShell(QObject *parent = nullptr);
185  PlasmaWindowManagementInterface *createPlasmaWindowManagement(QObject *parent = nullptr);
186  QtSurfaceExtensionInterface *createQtSurfaceExtension(QObject *parent = nullptr);
187  IdleInterface *createIdle(QObject *parent = nullptr);
188  RemoteAccessManagerInterface *createRemoteAccessManager(QObject *parent = nullptr);
189  FakeInputInterface *createFakeInput(QObject *parent = nullptr);
190  ShadowManagerInterface *createShadowManager(QObject *parent = nullptr);
191  BlurManagerInterface *createBlurManager(QObject *parent = nullptr);
192  ContrastManagerInterface *createContrastManager(QObject *parent = nullptr);
193  SlideManagerInterface *createSlideManager(QObject *parent = nullptr);
194  DpmsManagerInterface *createDpmsManager(QObject *parent = nullptr);
195 
197  KeyStateInterface *createKeyStateInterface(QObject *parent = nullptr);
198 
202  ServerSideDecorationManagerInterface *createServerSideDecorationManager(QObject *parent = nullptr);
208  TextInputManagerInterface *createTextInputManager(const TextInputInterfaceVersion &version, QObject *parent = nullptr);
209 
215  XdgShellInterface *createXdgShell(const XdgShellInterfaceVersion &version, QObject *parent = nullptr);
216 
223  RelativePointerManagerInterface *createRelativePointerManager(const RelativePointerInterfaceVersion &version, QObject *parent = nullptr);
224 
231  PointerGesturesInterface *createPointerGestures(const PointerGesturesInterfaceVersion &version, QObject *parent = nullptr);
232 
239  PointerConstraintsInterface *createPointerConstraints(const PointerConstraintsInterfaceVersion &version, QObject *parent = nullptr);
240 
247  XdgForeignInterface *createXdgForeignInterface(QObject *parent = nullptr);
248 
255  IdleInhibitManagerInterface *createIdleInhibitManager(const IdleInhibitManagerInterfaceVersion &version, QObject *parent = nullptr);
256 
263  AppMenuManagerInterface *createAppMenuManagerInterface(QObject *parent = nullptr);
264 
271  ServerSideDecorationPaletteManagerInterface *createServerSideDecorationPaletteManager(QObject *parent = nullptr);
272 
278  LinuxDmabufUnstableV1Interface *createLinuxDmabufInterface(QObject *parent = nullptr);
279 
286  XdgOutputManagerInterface *createXdgOutputManager(QObject *parent = nullptr);
287 
288 
295  PlasmaVirtualDesktopManagementInterface *createPlasmaVirtualDesktopManagement(QObject *parent = nullptr);
296 
304  XdgDecorationManagerInterface *createXdgDecorationManager(XdgShellInterface *shellInterface, QObject *parent = nullptr);
305 
312  EglStreamControllerInterface *createEglStreamControllerInterface(QObject *parent = nullptr);
313 
319  TabletManagerInterface *createTabletManagerInterface(QObject *parent = nullptr);
320 
327  ClientConnection *getConnection(wl_client *client);
328  QVector<ClientConnection*> connections() const;
329 
339  void setEglDisplay(void *display);
345  void *eglDisplay() const;
346 
347 Q_SIGNALS:
348  void socketNameChanged(const QString&);
349  void automaticSocketNamingChanged(bool);
350  void runningChanged(bool);
351  void aboutToTerminate();
352  void clientConnected(KWayland::Server::ClientConnection*);
353  void clientDisconnected(KWayland::Server::ClientConnection*);
354 
355 private:
356  class Private;
358 };
359 
360 }
361 }
362 
363 #endif
StartMode
How to setup the server connection.
Definition: display.h:123
Global for the org_kde_plasma_shell interface.
PointerConstraintsInterfaceVersion
Enum describing the interface versions the PointerConstraintsInterface can support.
Represents the global zpw_linux_dmabuf_v1 interface.
Global for server side Display Power Management Signaling interface.
The IdleInhibitorManagerInterface is used by clients to inhibit idle on a SurfaceInterface.
Manager to create ServerSideDecorationInterface.
Represents the Global for wl_data_device_manager interface.
PointerGesturesInterfaceVersion
Enum describing the interface versions the PointerGesturesInterface can support.
Represents the Global for the wl_eglstream_controller interface.
Global for the wl_output interface.
TextInputInterfaceVersion
Enum describing the different InterfaceVersion encapsulated in this implementation.
Represents a Seat on the Wayland Display.
The XdgDecorationManagerInterface class.
XdgShellInterfaceVersion
Enum describing the different InterfaceVersion encapsulated in this implementation.
Class holding the Wayland server display loop.
Definition: display.h:89
Represents the Global for org_kde_kwin_contrast_manager interface.
Represents the Global for org_kde_kwin_blur_manager interface.
Represents the Global for wl_compositor interface.
Manager object to create relative pointer interfaces.
Represent the Global for the interface.
Wrapper for the org_kde_plasma_virtual_desktop_management interface.
Represents an output device, the difference to Output is that this output can be disabled, so not currently used to display content.
Global representing the org_kde_kwin_idle interface.
This class encapsulates the server side logic of the XdgForeign protocol.
Global for the wl_shell interface.
Convenient Class which represents a wl_client.
Manager object for the PointerGestures.
Provides the DBus service name and object path to a AppMenu DBus interface.
Allows a client to specify a preferred palette to use for server-side window decorations.
IdleInhibitManagerInterfaceVersion
Enum describing the interface versions the IdleInhibitManagerInterface can support.
Manager object to create pointer constraints.
Represents the Global for org_kde_kwin_fake_input interface.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat Aug 8 2020 22:48:55 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.