Commit dffd9777 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii

[libkwineffects] Make AnimationEffect::AniMap protected

Summary:
We need AniMap only for test purposes so it would be better to make the
typedef protected (and mark as internal as well).

Test Plan: Compiles.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D17833
parent 10e0b286
......@@ -90,6 +90,7 @@ class ScriptedEffectWithDebugSpy : public KWin::ScriptedEffect
public:
ScriptedEffectWithDebugSpy();
bool load(const QString &name);
using AnimationEffect::AniMap;
using AnimationEffect::state;
signals:
void testOutput(const QString &data);
......@@ -298,7 +299,7 @@ void ScriptedEffectsTest::testAnimations()
QCOMPARE(workspace()->activeClient(), c);
{
const AnimationEffect::AniMap state = effect->state();
const auto state = effect->state();
QCOMPARE(state.count(), 1);
QCOMPARE(state.firstKey(), c->effectWindow());
const auto &animationsForWindow = state.first().first;
......@@ -324,7 +325,7 @@ void ScriptedEffectsTest::testAnimations()
c->setMinimized(true);
{
const AnimationEffect::AniMap state = effect->state();
const auto state = effect->state();
QCOMPARE(state.count(), 1);
const auto &animationsForWindow = state.first().first;
QCOMPARE(animationsForWindow.count(), animationCount);
......@@ -343,7 +344,7 @@ void ScriptedEffectsTest::testAnimations()
}
c->setMinimized(false);
{
const AnimationEffect::AniMap state = effect->state();
const auto state = effect->state();
QCOMPARE(state.count(), 0);
}
}
......@@ -667,7 +668,7 @@ void ScriptedEffectsTest::testRedirect()
// initially, the test animation is at the source position
{
const AnimationEffect::AniMap state = effect->state();
const auto state = effect->state();
QCOMPARE(state.count(), 1);
QCOMPARE(state.firstKey(), c->effectWindow());
const QList<AniData> animations = state.first().first;
......@@ -689,7 +690,7 @@ void ScriptedEffectsTest::testRedirect()
QCOMPARE(effectOutputSpy.first().first(), QStringLiteral("ok"));
{
const AnimationEffect::AniMap state = effect->state();
const auto state = effect->state();
QCOMPARE(state.count(), 1);
QCOMPARE(state.firstKey(), c->effectWindow());
const QList<AniData> animations = state.first().first;
......@@ -704,10 +705,10 @@ void ScriptedEffectsTest::testRedirect()
QFETCH(bool, shouldTerminate);
if (shouldTerminate) {
const AnimationEffect::AniMap state = effect->state();
const auto state = effect->state();
QCOMPARE(state.count(), 0);
} else {
const AnimationEffect::AniMap state = effect->state();
const auto state = effect->state();
QCOMPARE(state.count(), 1);
QCOMPARE(state.firstKey(), c->effectWindow());
const QList<AniData> animations = state.first().first;
......@@ -744,7 +745,7 @@ void ScriptedEffectsTest::testComplete()
// initially, the test animation should be at the start position
{
const AnimationEffect::AniMap state = effect->state();
const auto state = effect->state();
QCOMPARE(state.count(), 1);
QCOMPARE(state.firstKey(), c->effectWindow());
const QList<AniData> animations = state.first().first;
......@@ -757,7 +758,7 @@ void ScriptedEffectsTest::testComplete()
QTest::qWait(250);
{
const AnimationEffect::AniMap state = effect->state();
const auto state = effect->state();
QCOMPARE(state.count(), 1);
QCOMPARE(state.firstKey(), c->effectWindow());
const QList<AniData> animations = state.first().first;
......@@ -777,7 +778,7 @@ void ScriptedEffectsTest::testComplete()
QCOMPARE(effectOutputSpy.first().first(), QStringLiteral("ok"));
{
const AnimationEffect::AniMap state = effect->state();
const auto state = effect->state();
QCOMPARE(state.count(), 1);
QCOMPARE(state.firstKey(), c->effectWindow());
const QList<AniData> animations = state.first().first;
......
......@@ -110,8 +110,6 @@ class KWINEFFECTS_EXPORT AnimationEffect : public Effect
Q_OBJECT
public:
typedef QMap< EffectWindow*, QPair<QList<AniData>, QRect> > AniMap;
enum Anchor { Left = 1<<0, Top = 1<<1, Right = 1<<2, Bottom = 1<<3,
Horizontal = Left|Right, Vertical = Top|Bottom, Mouse = 1<<4 };
Q_ENUM(Anchor)
......@@ -376,7 +374,14 @@ protected:
virtual void genericAnimation( EffectWindow *w, WindowPaintData &data, float progress, uint meta )
{Q_UNUSED(w); Q_UNUSED(data); Q_UNUSED(progress); Q_UNUSED(meta);}
//Internal for unit tests
/**
* @internal
**/
typedef QMap<EffectWindow *, QPair<QList<AniData>, QRect> > AniMap;
/**
* @internal
**/
AniMap state() const;
private:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment