2017-01-02 17:05:30 -05:00
/*
* Copyright 2016 Smith AR < audoban @ openmailbox . org >
* 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 XWINDOWINTERFACE_H
2016-12-25 09:25:27 +02:00
# define XWINDOWINTERFACE_H
2018-12-02 02:05:52 +02:00
// local
2016-12-29 00:37:53 -05:00
# include "abstractwindowinterface.h"
2017-02-24 21:40:47 -05:00
# include "windowinfowrap.h"
2016-12-29 00:37:53 -05:00
2018-12-02 02:05:52 +02:00
// Qt
2016-12-25 09:25:27 +02:00
# include <QObject>
2018-12-02 02:05:52 +02:00
// KDE
2016-12-25 09:25:27 +02:00
# include <KWindowInfo>
2017-02-24 21:40:47 -05:00
# include <KWindowEffects>
2016-12-25 09:25:27 +02:00
2019-06-01 01:20:54 +03:00
2016-12-28 22:27:55 -05:00
namespace Latte {
2019-05-11 15:43:10 +03:00
namespace WindowSystem {
2016-12-25 09:25:27 +02:00
2018-07-03 22:15:45 +03:00
class XWindowInterface : public AbstractWindowInterface
{
2016-12-25 09:25:27 +02:00
Q_OBJECT
2017-01-16 14:07:49 -05:00
2016-12-25 09:25:27 +02:00
public :
2017-02-24 21:40:47 -05:00
explicit XWindowInterface ( QObject * parent = nullptr ) ;
~ XWindowInterface ( ) override ;
2017-01-16 14:07:49 -05:00
2018-12-06 16:09:42 +02:00
void setViewExtraFlags ( QWindow & view ) override ;
void setViewStruts ( QWindow & view , const QRect & rect
2017-06-15 16:56:55 -05:00
, Plasma : : Types : : Location location ) override ;
2018-01-21 11:53:15 +02:00
void setWindowOnActivities ( QWindow & window , const QStringList & activities ) override ;
2017-03-23 00:03:45 -05:00
2018-12-06 16:09:42 +02:00
void removeViewStruts ( QWindow & view ) const override ;
2017-01-16 14:07:49 -05:00
2017-06-08 17:10:49 -05:00
WindowId activeWindow ( ) const override ;
WindowInfoWrap requestInfo ( WindowId wid ) const override ;
2017-01-02 01:04:10 -05:00
WindowInfoWrap requestInfoActive ( ) const override ;
2017-01-16 14:07:49 -05:00
2018-01-26 19:46:02 +02:00
void setKeepAbove ( const QDialog & dialog , bool above = true ) const override ;
2017-02-24 21:40:47 -05:00
void skipTaskBar ( const QDialog & dialog ) const override ;
2017-06-15 16:56:55 -05:00
void slideWindow ( QWindow & view , Slide location ) const override ;
void enableBlurBehind ( QWindow & view ) const override ;
2017-01-16 14:07:49 -05:00
2019-01-14 18:47:49 +02:00
void releaseMouseEventFor ( WindowId wid ) const override ;
2019-06-02 01:07:47 +03:00
2019-04-01 23:50:25 +03:00
void requestActivate ( WindowId wid ) const override ;
2019-06-02 01:07:47 +03:00
void requestClose ( WindowId wid ) const override ;
2018-10-28 21:10:08 +02:00
void requestMoveWindow ( WindowId wid , QPoint from ) const override ;
2019-06-02 01:57:03 +03:00
void requestToggleIsOnAllDesktops ( WindowId wid ) const override ;
2019-06-02 01:07:47 +03:00
void requestToggleKeepAbove ( WindowId wid ) const override ;
void requestToggleMinimized ( WindowId wid ) const override ;
void requestToggleMaximized ( WindowId wid ) const override ;
2018-10-28 21:10:08 +02:00
bool windowCanBeDragged ( WindowId wid ) const override ;
2019-06-02 01:07:47 +03:00
2019-05-27 18:56:24 +03:00
QIcon iconFor ( WindowId wid ) const override ;
2019-06-01 01:20:54 +03:00
WindowId winIdFor ( QString appId , QRect geometry ) const override ;
AppData appDataFor ( WindowId wid ) const override ;
2018-10-28 10:03:22 +02:00
2018-03-28 20:39:52 +03:00
void setEdgeStateFor ( QWindow * view , bool active ) const override ;
2019-06-10 17:30:25 +03:00
void switchToNextVirtualDesktop ( ) const override ;
void switchToPreviousVirtualDesktop ( ) const override ;
2016-12-25 09:25:27 +02:00
private :
2019-06-01 03:44:42 +03:00
bool hasScreenGeometry ( const KWindowInfo & winfo ) const ;
2019-06-01 02:33:44 +03:00
bool isValidWindow ( WindowId wid ) const ;
2017-01-02 01:04:10 -05:00
bool isValidWindow ( const KWindowInfo & winfo ) const ;
2016-12-28 22:27:55 -05:00
void windowChangedProxy ( WId wid , NET : : Properties prop1 , NET : : Properties2 prop2 ) ;
2017-01-16 14:07:49 -05:00
2019-06-01 01:20:54 +03:00
QUrl windowUrl ( WindowId wid ) const ;
private :
2019-06-01 03:44:42 +03:00
WindowId m_desktopId { - 1 } ;
2016-12-25 09:25:27 +02:00
} ;
2019-05-11 15:43:10 +03:00
}
2016-12-25 09:25:27 +02:00
}
2016-12-28 22:27:55 -05:00
# endif // XWINDOWINTERFACE_H
2016-12-25 09:25:27 +02:00