File indexing completed on 2024-04-28 16:49:28

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 WINDOWSALLSCREENSTRACKER_H
0021 #define WINDOWSALLSCREENSTRACKER_H
0022 
0023 // local
0024 #include "../../wm/abstractwindowinterface.h"
0025 
0026 // Qt
0027 #include <QObject>
0028 
0029 namespace Latte{
0030 class View;
0031 
0032 namespace ViewPart {
0033 class WindowsTracker;
0034 }
0035 
0036 namespace WindowSystem {
0037 class AbstractWindowInterface;
0038 class SchemeColors;
0039 namespace Tracker {
0040 class LastActiveWindow;
0041 }
0042 }
0043 }
0044 
0045 namespace Latte {
0046 namespace ViewPart {
0047 namespace TrackerPart {
0048 
0049 class AllScreensTracker : public QObject {
0050     Q_OBJECT
0051     Q_PROPERTY(bool activeWindowMaximized READ activeWindowMaximized NOTIFY activeWindowMaximizedChanged)
0052     Q_PROPERTY(bool existsWindowActive READ existsWindowActive NOTIFY existsWindowActiveChanged)
0053     Q_PROPERTY(bool existsWindowMaximized READ existsWindowMaximized NOTIFY existsWindowMaximizedChanged)
0054     Q_PROPERTY(Latte::WindowSystem::SchemeColors *activeWindowScheme READ activeWindowScheme NOTIFY activeWindowSchemeChanged)
0055 
0056     Q_PROPERTY(Latte::WindowSystem::Tracker::LastActiveWindow *lastActiveWindow READ lastActiveWindow NOTIFY lastActiveWindowChanged)
0057 
0058 public:
0059     explicit AllScreensTracker(WindowsTracker *parent);
0060     virtual ~AllScreensTracker();
0061 
0062     bool activeWindowMaximized() const;
0063     bool existsWindowActive() const;
0064     bool existsWindowMaximized() const;
0065 
0066     WindowSystem::SchemeColors *activeWindowScheme() const;
0067 
0068     WindowSystem::Tracker::LastActiveWindow *lastActiveWindow();
0069 
0070 public slots:
0071     Q_INVOKABLE void requestMoveLastWindow(int localX, int localY);
0072 
0073 signals:
0074     void activeWindowMaximizedChanged();
0075     void existsWindowActiveChanged();
0076     void existsWindowMaximizedChanged();
0077     void activeWindowSchemeChanged();
0078 
0079     void lastActiveWindowChanged();
0080 
0081 private slots:
0082     void initSignalsForInformation();
0083 
0084 private:
0085     void init();
0086 
0087 private:
0088     Latte::WindowSystem::Tracker::LastActiveWindow *m_currentLastActiveWindow{nullptr};
0089 
0090     Latte::View *m_latteView{nullptr};
0091     WindowSystem::AbstractWindowInterface *m_wm{nullptr};
0092 };
0093 
0094 }
0095 }
0096 }
0097 
0098 #endif