2017-04-25 17:48:36 +03: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 WAYLANDINTERFACE_H
# define WAYLANDINTERFACE_H
# include "abstractwindowinterface.h"
# include "windowinfowrap.h"
# include <QObject>
# include <KWindowInfo>
# include <KWindowEffects>
2017-06-11 00:33:46 +03:00
# include <QSignalMapper>
# include <KWayland/Client/registry.h>
# include <KWayland/Client/connection_thread.h>
# include <KWayland/Client/plasmawindowmanagement.h>
# include <KWayland/Client/plasmashell.h>
# include <KWayland/Client/surface.h>
2017-04-25 17:48:36 +03:00
namespace Latte {
class WaylandInterface : public AbstractWindowInterface {
Q_OBJECT
public :
explicit WaylandInterface ( QObject * parent = nullptr ) ;
~ WaylandInterface ( ) override ;
2017-06-16 00:56:55 +03:00
void setDockExtraFlags ( QWindow & view ) override ;
void setDockStruts ( QWindow & view , const QRect & dockRect
, Plasma : : Types : : Location location ) override ;
2017-04-25 17:48:36 +03:00
2017-06-16 00:56:55 +03:00
void removeDockStruts ( QWindow & view ) const override ;
2017-04-25 17:48:36 +03:00
2017-06-09 01:10:49 +03:00
WindowId activeWindow ( ) const override ;
WindowInfoWrap requestInfo ( WindowId wid ) const override ;
2017-04-25 17:48:36 +03:00
WindowInfoWrap requestInfoActive ( ) const override ;
2017-06-09 01:10:49 +03:00
bool isOnCurrentDesktop ( WindowId wid ) const override ;
2017-06-21 03:06:04 +03:00
bool isOnCurrentActivity ( WindowId wid ) const override ;
2017-06-09 01:10:49 +03:00
const std : : list < WindowId > & windows ( ) const override ;
2017-04-25 17:48:36 +03:00
void skipTaskBar ( const QDialog & dialog ) const override ;
2017-06-16 00:56:55 +03:00
void slideWindow ( QWindow & view , Slide location ) const override ;
void enableBlurBehind ( QWindow & view ) const override ;
2017-04-25 17:48:36 +03:00
private :
2017-06-11 00:33:46 +03:00
void init ( ) ;
inline bool isValidWindow ( const KWayland : : Client : : PlasmaWindow * w ) const ;
void windowCreatedProxy ( KWayland : : Client : : PlasmaWindow * w ) ;
2017-04-25 17:48:36 +03:00
2017-06-11 00:33:46 +03:00
QSignalMapper * mapper { nullptr } ;
KWayland : : Client : : Registry * m_registry { nullptr } ;
KWayland : : Client : : ConnectionThread * m_connection { nullptr } ;
KWayland : : Client : : PlasmaWindowManagement * m_wm { nullptr } ;
KWayland : : Client : : PlasmaShell * m_plasmaShell { nullptr } ;
2017-04-25 17:48:36 +03:00
} ;
}
# endif // WAYLANDINTERFACE_H