KWin
Loading...
Searching...
No Matches
display.h
Go to the documentation of this file.
1/*
2 SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
3 SPDX-FileCopyrightText: 2018 David Edmundson <davidedmundson@kde.org>
4
5 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
6*/
7#pragma once
8
9#include "kwin_export.h"
10
11#include <QList>
12#include <QObject>
13
14struct wl_client;
15struct wl_display;
16struct wl_resource;
17
18namespace KWin
19{
20
21class ClientConnection;
22class DisplayPrivate;
23class OutputInterface;
24class OutputDeviceV2Interface;
25class SeatInterface;
26class GraphicsBuffer;
27
33class KWIN_EXPORT Display : public QObject
34{
35 Q_OBJECT
36 Q_PROPERTY(bool running READ isRunning NOTIFY runningChanged)
37public:
38 explicit Display(QObject *parent = nullptr);
39 virtual ~Display();
40
50 bool addSocketFileDescriptor(int fileDescriptor, const QString &socketName = QString());
62 bool addSocketName(const QString &name = QString());
63
67 QStringList socketNames() const;
68
69 quint32 serial();
70 quint32 nextSerial();
71
76 bool start();
77 void dispatchEvents();
78
90 ClientConnection *createClient(int fd);
91
92 operator wl_display *();
93 operator wl_display *() const;
94 bool isRunning() const;
95
96 void createShm();
100 QList<SeatInterface *> seats() const;
101 QList<OutputDeviceV2Interface *> outputDevices() const;
102 QList<OutputInterface *> outputs() const;
103 QList<OutputInterface *> outputsIntersecting(const QRect &rect) const;
104 OutputInterface *largestIntersectingOutput(const QRect &rect) const;
105
112 ClientConnection *getConnection(wl_client *client);
113 QList<ClientConnection *> connections() const;
114
118 static GraphicsBuffer *bufferForResource(wl_resource *resource);
119
120private Q_SLOTS:
121 void flush();
122
123Q_SIGNALS:
125 void runningChanged(bool);
128
129private:
130 friend class DisplayPrivate;
131 std::unique_ptr<DisplayPrivate> d;
132};
133
134}
Convenient Class which represents a wl_client.
Class holding the Wayland server display loop.
Definition display.h:34
void clientConnected(KWin::ClientConnection *)
void clientDisconnected(KWin::ClientConnection *)
void runningChanged(bool)
void socketNamesChanged()
struct _XDisplay Display