File indexing completed on 2024-04-14 05:24:27

0001 /*
0002     SPDX-FileCopyrightText: 2018 Michail Vourlakos <mvourlakos@gmail.com>
0003     SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 #ifndef PLASMASCREENPOOL_H
0007 #define PLASMASCREENPOOL_H
0008 
0009 // Qt
0010 #include <QHash>
0011 #include <QMap>
0012 #include <QObject>
0013 
0014 // KDE
0015 #include <KConfigGroup>
0016 #include <KSharedConfig>
0017 
0018 class PrimaryOutputWatcher;
0019 
0020 namespace Latte {
0021 namespace PlasmaExtended {
0022 
0023 class ScreenPool: public QObject
0024 {
0025     Q_OBJECT
0026 
0027 public:
0028     ScreenPool(QObject *parent = nullptr);
0029     ~ScreenPool() override;
0030 
0031     int id(const QString &connector) const;
0032     QString connector(int id) const;
0033 
0034 signals:
0035     void idsChanged();
0036 
0037 private slots:
0038     void load();
0039     void insertScreenMapping(int id, const QString &connector);
0040 
0041 private:
0042     QHash<int, QString> m_screens;
0043 
0044     //order is important
0045     QMap<int, QString> m_connectorForId;
0046     QHash<QString, int> m_idForConnector;
0047 
0048     KSharedConfig::Ptr m_plasmarcConfig;
0049     KConfigGroup m_screensGroup;
0050 
0051     PrimaryOutputWatcher *m_primaryWatcher;
0052 };
0053 
0054 }
0055 }
0056 
0057 
0058 #endif