2014-07-22 11:11:19 +00:00
|
|
|
/********************************************************************
|
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
|
|
|
|
|
|
|
Copyright (C) 2014 Martin Gräßlin <mgraesslin@kde.org>
|
|
|
|
|
|
|
|
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 2 of the License, or
|
|
|
|
(at your option) 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 KWIN_DECORATED_CLIENT_H
|
|
|
|
#define KWIN_DECORATED_CLIENT_H
|
2016-05-11 11:33:03 +00:00
|
|
|
#include "options.h"
|
2014-07-22 11:11:19 +00:00
|
|
|
|
|
|
|
#include <KDecoration2/Private/DecoratedClientPrivate>
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
|
|
|
namespace KWin
|
|
|
|
{
|
|
|
|
|
2015-12-03 16:12:25 +00:00
|
|
|
class AbstractClient;
|
2014-07-22 11:11:19 +00:00
|
|
|
|
|
|
|
namespace Decoration
|
|
|
|
{
|
|
|
|
|
|
|
|
class Renderer;
|
|
|
|
|
|
|
|
class DecoratedClientImpl : public QObject, public KDecoration2::DecoratedClientPrivate
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2015-12-03 16:29:06 +00:00
|
|
|
explicit DecoratedClientImpl(AbstractClient *client, KDecoration2::DecoratedClient *decoratedClient, KDecoration2::Decoration *decoration);
|
2014-07-22 11:11:19 +00:00
|
|
|
virtual ~DecoratedClientImpl();
|
|
|
|
QString caption() const override;
|
|
|
|
WId decorationId() const override;
|
|
|
|
int desktop() const override;
|
|
|
|
int height() const override;
|
|
|
|
QIcon icon() const override;
|
|
|
|
bool isActive() const override;
|
|
|
|
bool isCloseable() const override;
|
|
|
|
bool isKeepAbove() const override;
|
|
|
|
bool isKeepBelow() const override;
|
2014-10-23 08:56:43 +00:00
|
|
|
bool isMaximizeable() const override;
|
2014-07-22 11:11:19 +00:00
|
|
|
bool isMaximized() const override;
|
|
|
|
bool isMaximizedHorizontally() const override;
|
|
|
|
bool isMaximizedVertically() const override;
|
2014-10-23 08:56:43 +00:00
|
|
|
bool isMinimizeable() const override;
|
2014-07-22 11:11:19 +00:00
|
|
|
bool isModal() const override;
|
2014-10-23 08:56:43 +00:00
|
|
|
bool isMoveable() const override;
|
2014-07-22 11:11:19 +00:00
|
|
|
bool isOnAllDesktops() const override;
|
2014-10-23 08:56:43 +00:00
|
|
|
bool isResizeable() const override;
|
2014-07-22 11:11:19 +00:00
|
|
|
bool isShadeable() const override;
|
|
|
|
bool isShaded() const override;
|
|
|
|
QPalette palette() const override;
|
2015-03-31 13:26:42 +00:00
|
|
|
QColor color(KDecoration2::ColorGroup group, KDecoration2::ColorRole role) const override;
|
2014-07-22 11:11:19 +00:00
|
|
|
bool providesContextHelp() const override;
|
|
|
|
int width() const override;
|
|
|
|
WId windowId() const override;
|
|
|
|
|
2014-11-11 13:33:31 +00:00
|
|
|
Qt::Edges adjacentScreenEdges() const override;
|
2014-07-25 09:20:34 +00:00
|
|
|
|
2014-07-22 11:11:19 +00:00
|
|
|
void requestClose() override;
|
|
|
|
void requestContextHelp() override;
|
2014-11-11 08:53:54 +00:00
|
|
|
void requestToggleMaximization(Qt::MouseButtons buttons) override;
|
2014-07-22 11:11:19 +00:00
|
|
|
void requestMinimize() override;
|
|
|
|
void requestShowWindowMenu() override;
|
|
|
|
void requestToggleKeepAbove() override;
|
|
|
|
void requestToggleKeepBelow() override;
|
|
|
|
void requestToggleOnAllDesktops() override;
|
|
|
|
void requestToggleShade() override;
|
|
|
|
|
2015-12-03 16:12:25 +00:00
|
|
|
AbstractClient *client() {
|
2014-07-22 11:11:19 +00:00
|
|
|
return m_client;
|
|
|
|
}
|
|
|
|
Renderer *renderer() {
|
|
|
|
return m_renderer;
|
|
|
|
}
|
2014-07-25 05:14:21 +00:00
|
|
|
void destroyRenderer();
|
2014-07-22 11:11:19 +00:00
|
|
|
KDecoration2::DecoratedClient *decoratedClient() {
|
|
|
|
return KDecoration2::DecoratedClientPrivate::client();
|
|
|
|
}
|
|
|
|
|
2016-01-07 22:12:40 +00:00
|
|
|
void signalShadeChange();
|
|
|
|
|
2016-05-11 11:33:03 +00:00
|
|
|
private Q_SLOTS:
|
|
|
|
void delayedRequestToggleMaximization(Options::WindowOperation operation);
|
|
|
|
|
2014-07-22 11:11:19 +00:00
|
|
|
private:
|
|
|
|
void createRenderer();
|
2015-12-03 16:12:25 +00:00
|
|
|
AbstractClient *m_client;
|
2014-07-22 11:11:19 +00:00
|
|
|
Renderer *m_renderer;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|