The main reason why we have factory methods is that up to some point, kwayland had its own signal to indicate when globals have to be removed. Now that all globals add destroy listeners for the wl_display object, we don't have that signal. Most factory methods are equivalent to doing new T(display). Besides adding unnecessary boilerplate code, another reason to get rid of the factory methods is to reduce the amount of merge conflicts. If several persons work on implementing wayland protocols at the same time, sooner or later someone will have to resolve merge conflicts in Display.
49 lines
1.1 KiB
C++
49 lines
1.1 KiB
C++
/*
|
|
SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
|
|
SPDX-FileCopyrightText: 2018 David Edmundson <davidedmundson@kde.org>
|
|
|
|
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <wayland-server-core.h>
|
|
|
|
#include <QList>
|
|
#include <QSocketNotifier>
|
|
#include <QString>
|
|
#include <QVector>
|
|
|
|
#include <EGL/egl.h>
|
|
|
|
namespace KWaylandServer
|
|
{
|
|
|
|
class ClientConnection;
|
|
class Display;
|
|
class OutputInterface;
|
|
class OutputDeviceInterface;
|
|
class SeatInterface;
|
|
|
|
class DisplayPrivate
|
|
{
|
|
public:
|
|
static DisplayPrivate *get(Display *display);
|
|
DisplayPrivate(Display *q);
|
|
|
|
void registerSocketName(const QString &socketName);
|
|
|
|
Display *q;
|
|
QSocketNotifier *socketNotifier = nullptr;
|
|
wl_display *display = nullptr;
|
|
wl_event_loop *loop = nullptr;
|
|
bool running = false;
|
|
QList<OutputInterface *> outputs;
|
|
QList<OutputDeviceInterface *> outputdevices;
|
|
QVector<SeatInterface *> seats;
|
|
QVector<ClientConnection *> clients;
|
|
QStringList socketNames;
|
|
EGLDisplay eglDisplay = EGL_NO_DISPLAY;
|
|
};
|
|
|
|
} // namespace KWaylandServer
|