/******************************************************************** KWin - the KDE window manager This file is part of the KDE project. SPDX-FileCopyrightText: 2013 Martin Gräßlin SPDX-License-Identifier: GPL-2.0-or-later *********************************************************************/ #ifndef KWIN_SCREEN_EDGE_EFFECT_H #define KWIN_SCREEN_EDGE_EFFECT_H #include class QTimer; namespace Plasma { class Svg; } namespace KWin { class Glow; class GLTexture; class ScreenEdgeEffect : public Effect { Q_OBJECT public: ScreenEdgeEffect(); ~ScreenEdgeEffect() override; void prePaintScreen(ScreenPrePaintData &data, int time) override; void paintScreen(int mask, const QRegion ®ion, ScreenPaintData &data) override; bool isActive() const override; int requestedEffectChainPosition() const override { return 90; } private Q_SLOTS: void edgeApproaching(ElectricBorder border, qreal factor, const QRect &geometry); void cleanup(); private: void ensureGlowSvg(); Glow *createGlow(ElectricBorder border, qreal factor, const QRect &geometry); template T *createCornerGlow(ElectricBorder border); template T *createEdgeGlow(ElectricBorder border, const QSize &size); QSize cornerGlowSize(ElectricBorder border); Plasma::Svg *m_glow = nullptr; QHash m_borders; QTimer *m_cleanupTimer; }; class Glow { public: QScopedPointer texture; QScopedPointer image; #ifdef KWIN_HAVE_XRENDER_COMPOSITING QScopedPointer picture; #endif QSize pictureSize; qreal strength; QRect geometry; ElectricBorder border; }; } #endif