KWin
Loading...
Searching...
No Matches
sheet.h
Go to the documentation of this file.
1/*
2 KWin - the KDE window manager
3 This file is part of the KDE project.
4
5 SPDX-FileCopyrightText: 2007 Philip Falkner <philip.falkner@gmail.com>
6 SPDX-FileCopyrightText: 2009 Martin Gräßlin <mgraesslin@kde.org>
7 SPDX-FileCopyrightText: 2018 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
8
9 SPDX-License-Identifier: GPL-2.0-or-later
10*/
11
12#pragma once
13
14// kwineffects
15#include "effect/effect.h"
16#include "effect/effectwindow.h"
17#include "effect/timeline.h"
18
19namespace KWin
20{
21
22class SheetEffect : public Effect
23{
24 Q_OBJECT
25 Q_PROPERTY(int duration READ duration)
26
27public:
29
30 void reconfigure(ReconfigureFlags flags) override;
31
32 void prePaintScreen(ScreenPrePaintData &data, std::chrono::milliseconds presentTime) override;
33 void prePaintWindow(EffectWindow *w, WindowPrePaintData &data, std::chrono::milliseconds presentTime) override;
34 void paintWindow(const RenderTarget &renderTarget, const RenderViewport &viewport, EffectWindow *w, int mask, QRegion region, WindowPaintData &data) override;
35 void postPaintWindow(EffectWindow *w) override;
36
37 bool isActive() const override;
38 int requestedEffectChainPosition() const override;
39
40 static bool supported();
41
42 int duration() const;
43
44private Q_SLOTS:
45 void slotWindowAdded(EffectWindow *w);
46 void slotWindowClosed(EffectWindow *w);
47
48private:
49 bool isSheetWindow(EffectWindow *w) const;
50
51private:
52 std::chrono::milliseconds m_duration;
53
54 struct Animation
55 {
56 EffectWindowDeletedRef deletedRef;
57 TimeLine timeLine;
58 int parentY;
59 };
60
61 QHash<EffectWindow *, Animation> m_animations;
62};
63
65{
66 return 60;
67}
68
69inline int SheetEffect::duration() const
70{
71 return m_duration.count();
72}
73
74} // namespace KWin
Base class for all KWin effects.
Definition effect.h:535
Representation of a window used by/for Effect classes.
void prePaintScreen(ScreenPrePaintData &data, std::chrono::milliseconds presentTime) override
Definition sheet.cpp:76
void reconfigure(ReconfigureFlags flags) override
Definition sheet.cpp:65
void paintWindow(const RenderTarget &renderTarget, const RenderViewport &viewport, EffectWindow *w, int mask, QRegion region, WindowPaintData &data) override
Definition sheet.cpp:94
static bool supported()
Definition sheet.cpp:157
void prePaintWindow(EffectWindow *w, WindowPrePaintData &data, std::chrono::milliseconds presentTime) override
Definition sheet.cpp:83
int requestedEffectChainPosition() const override
Definition sheet.h:64
void postPaintWindow(EffectWindow *w) override
Definition sheet.cpp:132
bool isActive() const override
Definition sheet.cpp:152