KWindowSystem

windoweffects.h
1/*
2 SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
3 SPDX-FileCopyrightText: 2015 Marco Martin <mart@kde.org>
4
5 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
6*/
7#ifndef WINDOWEFFECTS_H
8#define WINDOWEFFECTS_H
9#include "kwindoweffects_p.h"
10#include <kwindowsystem_version.h>
11
12#include <QHash>
13#include <QObject>
14#include <QPointer>
15
16class BlurManager;
17class Blur;
18class ContrastManager;
19class Contrast;
20class SlideManager;
21
22class WindowEffects : public QObject, public KWindowEffectsPrivate
23{
25public:
26 WindowEffects();
27 ~WindowEffects() override;
28
29 bool eventFilter(QObject *watched, QEvent *event) override;
30 void trackWindow(QWindow *window);
31 void releaseWindow(QWindow *window);
32
33 bool isEffectAvailable(KWindowEffects::Effect effect) override;
34 void slideWindow(QWindow *window, KWindowEffects::SlideFromLocation location, int offset) override;
35 void enableBlurBehind(QWindow *window, bool enable = true, const QRegion &region = QRegion()) override;
36 void enableBackgroundContrast(QWindow *window,
37 bool enable = true,
38 qreal contrast = 1,
39 qreal intensity = 1,
40 qreal saturation = 1,
41 const QRegion &region = QRegion()) override;
42
43private:
44 void installContrast(QWindow *window, bool enable = true, qreal contrast = 1, qreal intensity = 1, qreal saturation = 1, const QRegion &region = QRegion());
45 void installBlur(QWindow *window, bool enable, const QRegion &region);
46 void installSlide(QWindow *window, KWindowEffects::SlideFromLocation location, int offset);
47
48 void resetBlur(QWindow *window, Blur *blur = nullptr);
49 void resetContrast(QWindow *window, Contrast *contrast = nullptr);
50
52 QHash<QWindow *, QRegion> m_blurRegions;
53 struct BackgroundContrastData {
54 qreal contrast = 1;
55 qreal intensity = 1;
56 qreal saturation = 1;
57 QRegion region;
58 };
59 QHash<QWindow *, BackgroundContrastData> m_backgroundConstrastRegions;
62 struct SlideData {
63 KWindowEffects::SlideFromLocation location;
64 int offset;
65 };
67 BlurManager *m_blurManager;
68 ContrastManager *m_contrastManager;
69 SlideManager *m_slideManager;
70};
71
72#endif
Q_OBJECTQ_OBJECT
virtual bool event(QEvent *e)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:10:18 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.