kwin/effects/screenedge/screenedgeeffect.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

68 lines
1.7 KiB
C++

/********************************************************************
KWin - the KDE window manager
This file is part of the KDE project.
SPDX-FileCopyrightText: 2013 Martin Gräßlin <mgraesslin@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*********************************************************************/
#ifndef KWIN_SCREEN_EDGE_EFFECT_H
#define KWIN_SCREEN_EDGE_EFFECT_H
#include <kwineffects.h>
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 &region, 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 <typename T>
T *createCornerGlow(ElectricBorder border);
template <typename T>
T *createEdgeGlow(ElectricBorder border, const QSize &size);
QSize cornerGlowSize(ElectricBorder border);
Plasma::Svg *m_glow = nullptr;
QHash<ElectricBorder, Glow*> m_borders;
QTimer *m_cleanupTimer;
};
class Glow
{
public:
QScopedPointer<GLTexture> texture;
QScopedPointer<QImage> image;
#ifdef KWIN_HAVE_XRENDER_COMPOSITING
QScopedPointer<XRenderPicture> picture;
#endif
QSize pictureSize;
qreal strength;
QRect geometry;
ElectricBorder border;
};
}
#endif