Remove dpms_interface_p.h

Its contents can be put in the corresponding cpp file as DpmsInterface
is not needed elsewhere but the cpp file.
This commit is contained in:
Vlad Zahorodnii 2022-08-26 12:14:12 +03:00
parent a5ac7cf0ae
commit 1baa267127
3 changed files with 39 additions and 52 deletions

View file

@ -3,19 +3,50 @@
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#include "dpms_interface.h"
#include "display.h"
#include "dpms_interface_p.h"
#include "output_interface.h"
#include <QPointer>
#include <qwayland-server-dpms.h>
using namespace KWin;
namespace KWaylandServer
{
static const quint32 s_version = 1;
DpmsManagerInterfacePrivate::DpmsManagerInterfacePrivate(DpmsManagerInterface *_q, Display *display)
class DpmsManagerInterfacePrivate : public QtWaylandServer::org_kde_kwin_dpms_manager
{
public:
DpmsManagerInterfacePrivate(Display *d);
protected:
void org_kde_kwin_dpms_manager_get(Resource *resource, uint32_t id, wl_resource *output) override;
};
class DpmsInterface : public QObject, QtWaylandServer::org_kde_kwin_dpms
{
Q_OBJECT
public:
explicit DpmsInterface(OutputInterface *output, wl_resource *resource);
void sendSupported();
void sendMode();
void sendDone();
QPointer<OutputInterface> m_output;
protected:
void org_kde_kwin_dpms_destroy_resource(Resource *resource) override;
void org_kde_kwin_dpms_set(Resource *resource, uint32_t mode) override;
void org_kde_kwin_dpms_release(Resource *resource) override;
};
DpmsManagerInterfacePrivate::DpmsManagerInterfacePrivate(Display *display)
: QtWaylandServer::org_kde_kwin_dpms_manager(*display, s_version)
, q(_q)
{
}
@ -34,7 +65,7 @@ void DpmsManagerInterfacePrivate::org_kde_kwin_dpms_manager_get(Resource *resour
DpmsManagerInterface::DpmsManagerInterface(Display *display, QObject *parent)
: QObject(parent)
, d(new DpmsManagerInterfacePrivate(this, display))
, d(new DpmsManagerInterfacePrivate(display))
{
}
@ -136,3 +167,5 @@ void DpmsInterface::sendDone()
}
}
#include "dpms_interface.moc"

View file

@ -9,6 +9,8 @@
#include <QObject>
#include <memory>
namespace KWaylandServer
{
class Display;

View file

@ -1,48 +0,0 @@
/*
SPDX-FileCopyrightText: 2015 Martin Gräßlin <mgraesslin@kde.org>
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#pragma once
#include "dpms_interface.h"
#include <QPointer>
#include <qwayland-server-dpms.h>
namespace KWaylandServer
{
class OutputInterface;
class DpmsManagerInterfacePrivate : public QtWaylandServer::org_kde_kwin_dpms_manager
{
public:
DpmsManagerInterfacePrivate(DpmsManagerInterface *q, Display *d);
DpmsManagerInterface *q;
protected:
void org_kde_kwin_dpms_manager_get(Resource *resource, uint32_t id, wl_resource *output) override;
};
class DpmsInterface : public QObject, QtWaylandServer::org_kde_kwin_dpms
{
Q_OBJECT
public:
explicit DpmsInterface(OutputInterface *output, wl_resource *resource);
void sendSupported();
void sendMode();
void sendDone();
QPointer<OutputInterface> m_output;
protected:
void org_kde_kwin_dpms_destroy_resource(Resource *resource) override;
void org_kde_kwin_dpms_set(Resource *resource, uint32_t mode) override;
void org_kde_kwin_dpms_release(Resource *resource) override;
};
}