File indexing completed on 2024-12-01 05:02:30

0001 /*
0002     SPDX-FileCopyrightText: 2019 Michail Vourlakos <mvourlakos@gmail.com>
0003     SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 #ifndef SCHEMESTRACKER_H
0007 #define SCHEMESTRACKER_H
0008 
0009 // local
0010 #include "../windowinfowrap.h"
0011 
0012 // Qt
0013 #include <QObject>
0014 
0015 
0016 namespace Latte {
0017 namespace WindowSystem {
0018 class AbstractWindowInterface;
0019 class SchemeColors;
0020 }
0021 }
0022 
0023 namespace Latte {
0024 namespace WindowSystem {
0025 namespace Tracker {
0026 
0027 class Schemes : public QObject {
0028     Q_OBJECT
0029 
0030 public:
0031     Schemes(AbstractWindowInterface *parent);
0032     ~Schemes() override;
0033 
0034     SchemeColors *schemeForWindow(WindowId wId);
0035     void setColorSchemeForWindow(WindowId wId, QString scheme);
0036 
0037     SchemeColors *schemeForFile(const QString &scheme);
0038 
0039 signals:
0040     void colorSchemeChanged(const WindowId &wid);
0041     void defaultSchemeChanged();
0042 
0043 private slots:
0044     void updateDefaultScheme();
0045 
0046 private:
0047     void init();
0048 
0049 private:
0050      AbstractWindowInterface *m_wm;
0051 
0052      //! scheme file and its loaded colors
0053      QMap<QString, Latte::WindowSystem::SchemeColors *> m_schemes;
0054 
0055      //! window id and its corresponding scheme file
0056      QMap<WindowId, QString> m_windowScheme;
0057 };
0058 
0059 }
0060 }
0061 }
0062 
0063 #endif