File indexing completed on 2024-05-05 05:30:25
0001 /* 0002 SPDX-FileCopyrightText: 2012 Alejandro Fiestas Olivares <afiestas@kde.org> 0003 SPDX-FileCopyrightText: 2018 Roman Gilg <subdiff@gmail.com> 0004 0005 SPDX-License-Identifier: GPL-2.0-or-later 0006 */ 0007 #pragma once 0008 0009 #include "../common/globals.h" 0010 #include "../common/osdaction.h" 0011 #include "config-X11.h" 0012 0013 #include <kscreen/config.h> 0014 0015 #include <kdedmodule.h> 0016 0017 #include <QVariant> 0018 0019 #include <memory> 0020 0021 class Config; 0022 class OrgKdeKscreenOsdServiceInterface; 0023 0024 namespace KScreen 0025 { 0026 class OsdManager; 0027 } 0028 0029 class QTimer; 0030 0031 class KScreenDaemon : public KDEDModule 0032 { 0033 Q_OBJECT 0034 Q_CLASSINFO("D-Bus Interface", "org.kde.KScreen") 0035 0036 public: 0037 KScreenDaemon(QObject *parent, const QList<QVariant> &); 0038 ~KScreenDaemon() override; 0039 0040 private: 0041 Q_INVOKABLE void getInitialConfig(); 0042 void init(); 0043 0044 void applyConfig(); 0045 void applyKnownConfig(); 0046 void applyIdealConfig(); 0047 void configChanged(); 0048 void saveCurrentConfig(); 0049 #if HAVE_X11 0050 void alignX11TouchScreen(); 0051 #endif 0052 void lidClosedChanged(bool lidIsClosed); 0053 void disableLidOutput(); 0054 void setMonitorForChanges(bool enabled); 0055 0056 void outputConnectedChanged(); 0057 void showOSD(); 0058 0059 void doApplyConfig(const KScreen::ConfigPtr &config); 0060 void doApplyConfig(std::unique_ptr<Config> config); 0061 void refreshConfig(); 0062 0063 void monitorConnectedChange(); 0064 void disableOutput(const KScreen::OutputPtr &output); 0065 0066 std::unique_ptr<Config> m_monitoredConfig; 0067 bool m_monitoring; 0068 bool m_configDirty = true; 0069 QTimer *m_changeCompressor; 0070 QTimer *m_saveTimer; 0071 QTimer *m_lidClosedTimer; 0072 OrgKdeKscreenOsdServiceInterface *m_osdServiceInterface; 0073 0074 bool m_startingUp = true; 0075 0076 private Q_SLOTS: 0077 void outputAddedSlot(const KScreen::OutputPtr &output); 0078 };