File indexing completed on 2024-05-19 05:32:34
0001 /* 0002 SPDX-FileCopyrightText: 2015 Martin Gräßlin <mgraesslin@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL 0005 */ 0006 #pragma once 0007 0008 #include "kwin_export.h" 0009 0010 #include <QObject> 0011 0012 #include <memory> 0013 0014 namespace KWin 0015 { 0016 class Display; 0017 class DpmsManagerInterfacePrivate; 0018 0019 /** 0020 * @brief Global for server side Display Power Management Signaling interface. 0021 * 0022 * A DpmsManagerInterface allows a client to query the DPMS state 0023 * on a given OutputInterface and request changes to it. 0024 * Server-side the interaction happens only via the OutputInterface, 0025 * for clients the Dpms class provides the API. 0026 * This global implements org_kde_kwin_dpms_manager. 0027 * 0028 * To create a DpmsManagerInterface use: 0029 * @code 0030 * auto manager = display->createDpmsManager(); 0031 * manager->create(); 0032 * @endcode 0033 * 0034 * To interact with Dpms use one needs to mark it as enabled and set the 0035 * proper mode on the OutputInterface. 0036 * @code 0037 * // We have our OutputInterface called output. 0038 * output->setDpmsSupported(true); 0039 * output->setDpmsMode(Output::DpmsMode::On); 0040 * @endcode 0041 * 0042 * To connect to Dpms change requests use: 0043 * @code 0044 * connect(output, &Output::DpmsModeRequested, 0045 * [] (Output::DpmsMode requestedMode) { qDebug() << "Mode change requested"; }); 0046 * @endcode 0047 * 0048 * @see Display 0049 * @see OutputInterface 0050 */ 0051 class KWIN_EXPORT DpmsManagerInterface : public QObject 0052 { 0053 Q_OBJECT 0054 0055 public: 0056 explicit DpmsManagerInterface(Display *display, QObject *parent = nullptr); 0057 ~DpmsManagerInterface() override; 0058 0059 private: 0060 std::unique_ptr<DpmsManagerInterfacePrivate> d; 0061 }; 0062 0063 }