kwin/src/wayland/dpms_interface.h

64 lines
1.7 KiB
C
Raw Normal View History

/*
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
*/
2021-03-10 16:08:30 +00:00
#pragma once
#include <QObject>
2020-04-29 14:56:38 +00:00
#include <KWaylandServer/kwaylandserver_export.h>
2020-04-29 14:56:38 +00:00
namespace KWaylandServer
{
class Display;
2020-07-24 22:06:57 +00:00
class DpmsManagerInterfacePrivate;
/**
* @brief Global for server side Display Power Management Signaling interface.
*
* A DpmsManagerInterface allows a client to query the DPMS state
* on a given OutputInterface and request changes to it.
* Server-side the interaction happens only via the OutputInterface,
* for clients the Dpms class provides the API.
* This global implements org_kde_kwin_dpms_manager.
*
* To create a DpmsManagerInterface use:
* @code
* auto manager = display->createDpmsManager();
* manager->create();
* @endcode
*
* To interact with Dpms use one needs to mark it as enabled and set the
* proper mode on the OutputInterface.
* @code
* // We have our OutputInterface called output.
* output->setDpmsSupported(true);
* output->setDpmsMode(OutputInterface::DpmsMode::On);
* @endcode
*
* To connect to Dpms change requests use:
* @code
* connect(output, &OutputInterface::dpmsModeRequested,
2020-04-29 14:56:38 +00:00
* [] (KWaylandServer::OutputInterface::DpmsMode requestedMode) { qDebug() << "Mode change requested"; });
* @endcode
*
* @see Display
* @see OutputInterface
2015-09-10 11:36:42 +00:00
* @since 5.5
**/
2020-07-24 22:06:57 +00:00
class KWAYLANDSERVER_EXPORT DpmsManagerInterface : public QObject
{
Q_OBJECT
public:
explicit DpmsManagerInterface(Display *display, QObject *parent = nullptr);
2020-07-24 22:06:57 +00:00
~DpmsManagerInterface() override;
private:
2020-07-24 22:06:57 +00:00
QScopedPointer<DpmsManagerInterfacePrivate> d;
};
}