2021-04-04 14:11:13 +00:00
|
|
|
/*
|
|
|
|
SPDX-FileCopyrightText: 2021 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
|
|
|
|
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2022-04-14 12:33:28 +00:00
|
|
|
#include "output.h"
|
2021-04-04 14:11:13 +00:00
|
|
|
|
|
|
|
#include <KWaylandServer/output_interface.h>
|
2021-05-02 15:45:50 +00:00
|
|
|
#include <KWaylandServer/utils.h>
|
2022-03-23 10:13:38 +00:00
|
|
|
#include <KWaylandServer/xdgoutput_v1_interface.h>
|
2021-04-04 14:11:13 +00:00
|
|
|
|
2022-04-14 08:32:51 +00:00
|
|
|
#include <QTimer>
|
|
|
|
|
2021-04-04 14:11:13 +00:00
|
|
|
namespace KWin
|
|
|
|
{
|
|
|
|
|
|
|
|
class WaylandOutput : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2022-04-14 12:33:28 +00:00
|
|
|
explicit WaylandOutput(Output *output, QObject *parent = nullptr);
|
2021-04-04 14:11:13 +00:00
|
|
|
|
|
|
|
KWaylandServer::OutputInterface *waylandOutput() const;
|
|
|
|
|
|
|
|
private Q_SLOTS:
|
|
|
|
void handleDpmsModeChanged();
|
|
|
|
void handleDpmsModeRequested(KWaylandServer::OutputInterface::DpmsMode dpmsMode);
|
|
|
|
|
|
|
|
void update();
|
|
|
|
void scheduleUpdate();
|
|
|
|
|
|
|
|
private:
|
2022-04-14 12:33:28 +00:00
|
|
|
Output *m_platformOutput;
|
2021-04-04 14:11:13 +00:00
|
|
|
QTimer m_updateTimer;
|
2021-05-02 15:45:50 +00:00
|
|
|
KWaylandServer::ScopedGlobalPointer<KWaylandServer::OutputInterface> m_waylandOutput;
|
2021-04-04 14:11:13 +00:00
|
|
|
KWaylandServer::XdgOutputV1Interface *m_xdgOutputV1;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace KWin
|