kwin/effects/sheet/sheet.h
Vlad Zahorodnii 1fb9f6f13a Switch to SPDX license markers
The main advantage of SPDX license identifiers over the traditional
license headers is that it's more difficult to overlook inappropriate
licenses for kwin, for example GPL 3. We also don't have to copy a
lot of boilerplate text.

In order to create this change, I ran licensedigger -r -c from the
toplevel source directory.
2020-08-07 19:57:56 +00:00

74 lines
1.7 KiB
C++

/********************************************************************
KWin - the KDE window manager
This file is part of the KDE project.
SPDX-FileCopyrightText: 2007 Philip Falkner <philip.falkner@gmail.com>
SPDX-FileCopyrightText: 2009 Martin Gräßlin <mgraesslin@kde.org>
SPDX-FileCopyrightText: 2018 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*********************************************************************/
#ifndef KWIN_SHEET_H
#define KWIN_SHEET_H
// kwineffects
#include <kwineffects.h>
namespace KWin
{
class SheetEffect : public Effect
{
Q_OBJECT
Q_PROPERTY(int duration READ duration)
public:
SheetEffect();
void reconfigure(ReconfigureFlags flags) override;
void prePaintScreen(ScreenPrePaintData &data, int time) override;
void prePaintWindow(EffectWindow *w, WindowPrePaintData &data, int time) override;
void paintWindow(EffectWindow *w, int mask, QRegion region, WindowPaintData &data) override;
void postPaintWindow(EffectWindow *w) override;
bool isActive() const override;
int requestedEffectChainPosition() const override;
static bool supported();
int duration() const;
private Q_SLOTS:
void slotWindowAdded(EffectWindow *w);
void slotWindowClosed(EffectWindow *w);
void slotWindowDeleted(EffectWindow *w);
private:
bool isSheetWindow(EffectWindow *w) const;
private:
std::chrono::milliseconds m_duration;
struct Animation {
TimeLine timeLine;
int parentY;
};
QHash<EffectWindow*, Animation> m_animations;
};
inline int SheetEffect::requestedEffectChainPosition() const
{
return 60;
}
inline int SheetEffect::duration() const
{
return m_duration.count();
}
} // namespace KWin
#endif