2020-08-02 22:22:19 +00:00
|
|
|
/*
|
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
2009-01-31 15:12:14 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-FileCopyrightText: 2009 Lucas Murray <lmurray@undefinedfire.com>
|
2009-01-31 15:12:14 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
2009-01-31 15:12:14 +00:00
|
|
|
|
|
|
|
#ifndef KWIN_HIGHLIGHTWINDOW_H
|
|
|
|
#define KWIN_HIGHLIGHTWINDOW_H
|
|
|
|
|
2021-01-27 11:36:45 +00:00
|
|
|
#include <kwinanimationeffect.h>
|
2009-01-31 15:12:14 +00:00
|
|
|
|
|
|
|
namespace KWin
|
|
|
|
{
|
|
|
|
|
2021-01-27 11:36:45 +00:00
|
|
|
class HighlightWindowEffect : public AnimationEffect
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2011-02-25 21:06:02 +00:00
|
|
|
Q_OBJECT
|
2021-01-27 11:36:45 +00:00
|
|
|
|
2011-01-30 14:34:42 +00:00
|
|
|
public:
|
|
|
|
HighlightWindowEffect();
|
|
|
|
|
2014-03-24 10:50:09 +00:00
|
|
|
int requestedEffectChainPosition() const override {
|
|
|
|
return 70;
|
|
|
|
}
|
|
|
|
|
2016-08-30 13:50:31 +00:00
|
|
|
bool provides(Feature feature) override;
|
|
|
|
bool perform(Feature feature, const QVariantList &arguments) override;
|
|
|
|
|
2011-02-25 21:06:02 +00:00
|
|
|
public Q_SLOTS:
|
2012-01-29 11:29:24 +00:00
|
|
|
void slotWindowAdded(KWin::EffectWindow* w);
|
|
|
|
void slotWindowClosed(KWin::EffectWindow *w);
|
|
|
|
void slotWindowDeleted(KWin::EffectWindow *w);
|
Use nullptr everywhere
Summary:
Because KWin is a very old project, we use three kinds of null pointer
literals: 0, NULL, and nullptr. Since C++11, it's recommended to use
nullptr keyword.
This change converts all usages of 0 and NULL literal to nullptr. Even
though it breaks git history, we need to do it in order to have consistent
code as well to ease code reviews (it's very tempting for some people to
add unrelated changes to their patches, e.g. converting NULL to nullptr).
Test Plan: Compiles.
Reviewers: #kwin, davidedmundson, romangg
Reviewed By: #kwin, davidedmundson, romangg
Subscribers: romangg, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D23618
2019-09-19 14:46:54 +00:00
|
|
|
void slotPropertyNotify(KWin::EffectWindow* w, long atom, EffectWindow *addedWindow = nullptr);
|
2011-02-25 21:06:02 +00:00
|
|
|
|
2011-01-30 14:34:42 +00:00
|
|
|
private:
|
2021-01-27 11:36:45 +00:00
|
|
|
void startGhostAnimation(EffectWindow *window, int duration = -1);
|
|
|
|
void startHighlightAnimation(EffectWindow *window, int duration = -1);
|
|
|
|
void startRevertAnimation(EffectWindow *window);
|
|
|
|
|
|
|
|
bool isHighlighted(EffectWindow *window) const;
|
|
|
|
|
2011-01-30 14:34:42 +00:00
|
|
|
void prepareHighlighting();
|
|
|
|
void finishHighlighting();
|
2016-08-30 13:50:31 +00:00
|
|
|
void highlightWindows(const QVector<KWin::EffectWindow *> &windows);
|
|
|
|
|
2011-01-30 14:34:42 +00:00
|
|
|
long m_atom;
|
2021-01-27 11:36:45 +00:00
|
|
|
QList<EffectWindow *> m_highlightedWindows;
|
|
|
|
QHash<EffectWindow *, quint64> m_animations;
|
|
|
|
QEasingCurve m_easingCurve;
|
|
|
|
int m_fadeDuration;
|
|
|
|
EffectWindow *m_monitorWindow;
|
2013-09-03 19:55:39 +00:00
|
|
|
QList<WId> m_highlightedIds;
|
2021-01-27 11:36:45 +00:00
|
|
|
float m_ghostOpacity = 0.15;
|
2011-01-30 14:34:42 +00:00
|
|
|
};
|
2009-01-31 15:12:14 +00:00
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
#endif
|