KWayland

connection_thread.h
1 /*
2  SPDX-FileCopyrightText: 2014 Martin Gräßlin <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5 */
6 #ifndef WAYLAND_CONNECTION_THREAD_H
7 #define WAYLAND_CONNECTION_THREAD_H
8 
9 #include <QObject>
10 #include <QVector>
11 
12 #include <KWayland/Client/kwaylandclient_export.h>
13 
14 struct wl_display;
15 
16 namespace KWayland
17 {
41 namespace Client
42 {
43 
107 class KWAYLANDCLIENT_EXPORT ConnectionThread : public QObject
108 {
109  Q_OBJECT
110 public:
111  explicit ConnectionThread(QObject *parent = nullptr);
112  virtual ~ConnectionThread();
113 
131  static ConnectionThread *fromApplication(QObject *parent = nullptr);
132 
138  wl_display *display();
142  QString socketName() const;
153  void setSocketName(const QString &socketName);
162  void setSocketFd(int fd);
163 
170  void roundtrip();
171 
178  bool hasError() const;
179 
186  int errorCode() const;
187 
192  static QVector<ConnectionThread*> connections();
193 
194 public Q_SLOTS:
203  void initConnection();
204 
209  void flush();
210 
211 Q_SIGNALS:
217  void connected();
221  void failed();
225  void eventsRead();
230  void connectionDied();
240  void errorOccurred();
241 protected:
242  /*
243  * Creates a connection thread from an existing wl_display object
244  * @see ConnectionThread::fromApplication
245  */
246  explicit ConnectionThread(wl_display *display, QObject *parent);
247 
248 private Q_SLOTS:
252  void doInitConnection();
253 
254 private:
255  class Private;
257 };
258 }
259 }
260 
261 
262 #endif
Creates and manages the connection to a Wayland server.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Jul 10 2020 22:48:32 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.