/* KWin - the KDE window manager This file is part of the KDE project. SPDX-FileCopyrightText: 2007 Philip Falkner SPDX-FileCopyrightText: 2009 Martin Gräßlin SPDX-FileCopyrightText: 2018 Vlad Zahorodnii SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef KWIN_SHEET_H #define KWIN_SHEET_H // kwineffects #include 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, std::chrono::milliseconds presentTime) override; void prePaintWindow(EffectWindow *w, WindowPrePaintData &data, std::chrono::milliseconds presentTime) 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; std::chrono::milliseconds lastPresentTime = std::chrono::milliseconds::zero(); }; QHash m_animations; }; inline int SheetEffect::requestedEffectChainPosition() const { return 60; } inline int SheetEffect::duration() const { return m_duration.count(); } } // namespace KWin #endif