dock/src/xwindowinterface.h
2021-08-16 08:58:33 +08:00

68 lines
1.9 KiB
C++

/*
* Copyright (C) 2021 CutefishOS Team.
*
* Author: rekols <revenmartin@gmail.com>
*
* This program 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 3 of the License, or
* any later version.
*
* This program 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
#include "applicationitem.h"
#include "docksettings.h"
#include <QObject>
// KLIB
#include <KWindowInfo>
#include <KWindowEffects>
class XWindowInterface : public QObject
{
Q_OBJECT
public:
static XWindowInterface *instance();
explicit XWindowInterface(QObject *parent = nullptr);
void enableBlurBehind(QWindow *view, bool enable = true, const QRegion &region = QRegion());
WId activeWindow();
void minimizeWindow(WId win);
void closeWindow(WId id);
void forceActiveWindow(WId win);
QMap<QString, QVariant> requestInfo(quint64 wid);
QString requestWindowClass(quint64 wid);
bool isAcceptableWindow(quint64 wid);
void setViewStruts(QWindow *view, DockSettings::Direction direction, const QRect &rect, bool compositing = false);
void clearViewStruts(QWindow *view);
void startInitWindows();
QString desktopFilePath(quint64 wid);
void setIconGeometry(quint64 wid, const QRect &rect);
signals:
void windowAdded(quint64 wid);
void windowRemoved(quint64 wid);
void activeChanged(quint64 wid);
private:
void onWindowadded(quint64 wid);
};
#endif // XWINDOWINTERFACE_H