File indexing completed on 2025-01-19 13:55:26
0001 /* 0002 * Copyright 2019 Michail Vourlakos <mvourlakos@gmail.com> 0003 * 0004 * This file is part of Latte-Dock 0005 * 0006 * Latte-Dock is free software; you can redistribute it and/or 0007 * modify it under the terms of the GNU General Public License as 0008 * published by the Free Software Foundation; either version 2 of 0009 * the License, or (at your option) any later version. 0010 * 0011 * Latte-Dock is distributed in the hope that it will be useful, 0012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0014 * GNU General Public License for more details. 0015 * 0016 * You should have received a copy of the GNU General Public License 0017 * along with this program. If not, see <http://www.gnu.org/licenses/>. 0018 */ 0019 0020 #ifndef SCHEMESTRACKER_H 0021 #define SCHEMESTRACKER_H 0022 0023 // local 0024 #include "../windowinfowrap.h" 0025 0026 // Qt 0027 #include <QObject> 0028 0029 0030 namespace Latte { 0031 namespace WindowSystem { 0032 class AbstractWindowInterface; 0033 class SchemeColors; 0034 } 0035 } 0036 0037 namespace Latte { 0038 namespace WindowSystem { 0039 namespace Tracker { 0040 0041 class Schemes : public QObject { 0042 Q_OBJECT 0043 0044 public: 0045 Schemes(AbstractWindowInterface *parent); 0046 ~Schemes() override; 0047 0048 SchemeColors *schemeForWindow(WindowId wId); 0049 void setColorSchemeForWindow(WindowId wId, QString scheme); 0050 0051 signals: 0052 void colorSchemeChanged(const WindowId &wid); 0053 0054 private slots: 0055 void updateDefaultScheme(); 0056 0057 private: 0058 void init(); 0059 0060 private: 0061 AbstractWindowInterface *m_wm; 0062 0063 //! scheme file and its loaded colors 0064 QMap<QString, Latte::WindowSystem::SchemeColors *> m_schemes; 0065 0066 //! window id and its corresponding scheme file 0067 QMap<WindowId, QString> m_windowScheme; 0068 }; 0069 0070 } 0071 } 0072 } 0073 0074 #endif