1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-01-19 06:03:42 +03:00
latte-dock/app/wm/xwindowinterface.h

103 lines
3.2 KiB
C
Raw Normal View History

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
#define XWINDOWINTERFACE_H
2018-12-02 02:05:52 +02:00
// local
2016-12-29 00:37:53 -05:00
#include "abstractwindowinterface.h"
#include "windowinfowrap.h"
2016-12-29 00:37:53 -05:00
2018-12-02 02:05:52 +02:00
// Qt
#include <QObject>
2018-12-02 02:05:52 +02:00
// KDE
#include <KWindowInfo>
#include <KWindowEffects>
2016-12-28 22:27:55 -05:00
namespace Latte {
2019-05-11 15:43:10 +03:00
namespace WindowSystem {
2018-07-03 22:15:45 +03:00
class XWindowInterface : public AbstractWindowInterface
{
Q_OBJECT
2017-01-16 14:07:49 -05:00
public:
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
, Plasma::Types::Location location) override;
void setWindowOnActivities(QWindow &window, const QStringList &activities) override;
2018-12-06 16:09:42 +02:00
void removeViewStruts(QWindow &view) const override;
2017-01-16 14:07:49 -05:00
WindowId activeWindow() const override;
WindowInfoWrap requestInfo(WindowId wid) const override;
WindowInfoWrap requestInfoActive() const override;
2017-01-16 14:07:49 -05:00
void setKeepAbove(const QDialog &dialog, bool above = true) const override;
void skipTaskBar(const QDialog &dialog) const override;
void slideWindow(QWindow &view, Slide location) const override;
void enableBlurBehind(QWindow &view) const override;
2017-01-16 14:07:49 -05:00
void releaseMouseEventFor(WindowId wid) const override;
2019-06-02 01:07:47 +03:00
void requestActivate(WindowId wid) const override;
2019-06-02 01:07:47 +03:00
void requestClose(WindowId wid) const override;
void requestMoveWindow(WindowId wid, QPoint from) const override;
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;
bool windowCanBeDragged(WindowId wid) const override;
2019-06-02 01:07:47 +03:00
QIcon iconFor(WindowId wid) const override;
WindowId winIdFor(QString appId, QRect geometry) const override;
AppData appDataFor(WindowId wid) const override;
void setEdgeStateFor(QWindow *view, bool active) const override;
void switchToNextVirtualDesktop() const override;
void switchToPreviousVirtualDesktop() const override;
private:
bool hasScreenGeometry(const KWindowInfo &winfo) const;
bool isValidWindow(WindowId wid) const;
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
QUrl windowUrl(WindowId wid) const;
private:
WindowId m_desktopId{-1};
};
2019-05-11 15:43:10 +03:00
}
}
2016-12-28 22:27:55 -05:00
#endif // XWINDOWINTERFACE_H