2019-06-08 17:36:14 +03:00
/*
* Copyright 2019 Michail Vourlakos < mvourlakos @ gmail . com >
*
* This file is part of Latte - Dock
*
* Latte - Dock is free software ; you can redistribute it and / or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation ; either version 2 of
* the License , or ( at your option ) any later version .
*
* Latte - Dock is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
* along with this program . If not , see < http : //www.gnu.org/licenses/>.
*/
# ifndef WINDOWSCURRENTSCREENTRACKER_H
# define WINDOWSCURRENTSCREENTRACKER_H
// local
# include "../../wm/abstractwindowinterface.h"
// Qt
# include <QObject>
namespace Latte {
class View ;
namespace ViewPart {
class WindowsTracker ;
}
namespace WindowSystem {
class AbstractWindowInterface ;
class SchemeColors ;
namespace Tracker {
class LastActiveWindow ;
}
}
}
namespace Latte {
namespace ViewPart {
namespace TrackerPart {
class CurrentScreenTracker : public QObject {
Q_OBJECT
Q_PROPERTY ( bool activeWindowMaximized READ activeWindowMaximized NOTIFY activeWindowMaximizedChanged )
Q_PROPERTY ( bool activeWindowTouching READ activeWindowTouching NOTIFY activeWindowTouchingChanged )
2020-05-17 11:42:09 +03:00
Q_PROPERTY ( bool activeWindowTouchingEdge READ activeWindowTouchingEdge NOTIFY activeWindowTouchingEdgeChanged )
2019-06-08 17:36:14 +03:00
Q_PROPERTY ( bool existsWindowActive READ existsWindowActive NOTIFY existsWindowActiveChanged )
Q_PROPERTY ( bool existsWindowMaximized READ existsWindowMaximized NOTIFY existsWindowMaximizedChanged )
Q_PROPERTY ( bool existsWindowTouching READ existsWindowTouching NOTIFY existsWindowTouchingChanged )
2020-05-17 11:42:09 +03:00
Q_PROPERTY ( bool existsWindowTouchingEdge READ existsWindowTouchingEdge NOTIFY existsWindowTouchingEdgeChanged )
2019-08-01 23:56:09 +03:00
Q_PROPERTY ( bool isTouchingBusyVerticalView READ isTouchingBusyVerticalView NOTIFY isTouchingBusyVerticalViewChanged )
2019-06-08 17:36:14 +03:00
Q_PROPERTY ( Latte : : WindowSystem : : SchemeColors * activeWindowScheme READ activeWindowScheme NOTIFY activeWindowSchemeChanged )
Q_PROPERTY ( Latte : : WindowSystem : : SchemeColors * touchingWindowScheme READ touchingWindowScheme NOTIFY touchingWindowSchemeChanged )
Q_PROPERTY ( Latte : : WindowSystem : : Tracker : : LastActiveWindow * lastActiveWindow READ lastActiveWindow NOTIFY lastActiveWindowChanged )
public :
explicit CurrentScreenTracker ( WindowsTracker * parent ) ;
virtual ~ CurrentScreenTracker ( ) ;
bool activeWindowMaximized ( ) const ;
bool activeWindowTouching ( ) const ;
2020-05-17 11:42:09 +03:00
bool activeWindowTouchingEdge ( ) const ;
2019-06-08 17:36:14 +03:00
bool existsWindowActive ( ) const ;
bool existsWindowMaximized ( ) const ;
bool existsWindowTouching ( ) const ;
2020-05-17 11:42:09 +03:00
bool existsWindowTouchingEdge ( ) const ;
2019-06-08 17:36:14 +03:00
2019-08-01 23:56:09 +03:00
bool isTouchingBusyVerticalView ( ) const ;
2019-06-08 17:36:14 +03:00
WindowSystem : : SchemeColors * activeWindowScheme ( ) const ;
WindowSystem : : SchemeColors * touchingWindowScheme ( ) const ;
WindowSystem : : Tracker : : LastActiveWindow * lastActiveWindow ( ) ;
public slots :
Q_INVOKABLE void requestMoveLastWindow ( int localX , int localY ) ;
signals :
void activeWindowMaximizedChanged ( ) ;
void activeWindowTouchingChanged ( ) ;
2020-05-17 11:42:09 +03:00
void activeWindowTouchingEdgeChanged ( ) ;
2019-06-08 17:36:14 +03:00
void existsWindowActiveChanged ( ) ;
void existsWindowMaximizedChanged ( ) ;
void existsWindowTouchingChanged ( ) ;
2020-05-17 11:42:09 +03:00
void existsWindowTouchingEdgeChanged ( ) ;
2019-08-01 23:56:09 +03:00
void isTouchingBusyVerticalViewChanged ( ) ;
2019-06-08 17:36:14 +03:00
void activeWindowSchemeChanged ( ) ;
void touchingWindowSchemeChanged ( ) ;
void lastActiveWindowChanged ( ) ;
private slots :
void initSignalsForInformation ( ) ;
private :
void init ( ) ;
2019-06-09 02:51:00 +03:00
private :
2019-06-08 17:36:14 +03:00
Latte : : View * m_latteView { nullptr } ;
WindowSystem : : AbstractWindowInterface * m_wm { nullptr } ;
} ;
}
}
}
# endif