KWaylandServer

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 <KWaylandServer/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 KWaylandServer
22 {
37 class ClientConnection;
38 class DisplayPrivate;
39 class OutputInterface;
40 class OutputDeviceInterface;
41 class SeatInterface;
42 
48 class KWAYLANDSERVER_EXPORT Display : public QObject
49 {
50  Q_OBJECT
51  Q_PROPERTY(bool running READ isRunning NOTIFY runningChanged)
52 public:
53  explicit Display(QObject *parent = nullptr);
54  virtual ~Display();
55 
64  bool addSocketFileDescriptor(int fileDescriptor);
76  bool addSocketName(const QString &name = QString());
77 
81  QStringList socketNames() const;
82 
83  quint32 serial();
84  quint32 nextSerial();
85 
90  bool start();
91  void dispatchEvents();
92 
104  ClientConnection *createClient(int fd);
105 
106  operator wl_display*();
107  operator wl_display*() const;
108  bool isRunning() const;
109 
110  void createShm();
115  QVector<SeatInterface*> seats() const;
116  QList<OutputDeviceInterface *> outputDevices() const;
117  QList<OutputInterface *> outputs() const;
118 
125  ClientConnection *getConnection(wl_client *client);
126  QVector<ClientConnection*> connections() const;
127 
137  void setEglDisplay(void *display);
143  void *eglDisplay() const;
144 
145 private Q_SLOTS:
146  void flush();
147 
148 Q_SIGNALS:
149  void socketNamesChanged();
150  void runningChanged(bool);
151  void clientConnected(KWaylandServer::ClientConnection*);
152  void clientDisconnected(KWaylandServer::ClientConnection*);
153 
154 private:
155  friend class DisplayPrivate;
157 };
158 
159 }
160 
161 #endif
Class holding the Wayland server display loop.
Definition: display.h:48
Convenient Class which represents a wl_client.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Jan 19 2021 23:11:10 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.