Changeset View
Changeset View
Standalone View
Standalone View
libkwineffects/anidata.cpp
1 | /******************************************************************** | 1 | /******************************************************************** | ||
---|---|---|---|---|---|
2 | KWin - the KDE window manager | 2 | KWin - the KDE window manager | ||
3 | This file is part of the KDE project. | 3 | This file is part of the KDE project. | ||
4 | 4 | | |||
5 | Copyright (C) 2011 Thomas Lübking <thomas.luebking@web.de> | 5 | Copyright (C) 2011 Thomas Lübking <thomas.luebking@web.de> | ||
6 | Copyright (C) 2018 Vlad Zagorodniy <vladzzag@gmail.com> | ||||
6 | 7 | | |||
7 | This program is free software; you can redistribute it and/or modify | 8 | This program is free software; you can redistribute it and/or modify | ||
8 | it under the terms of the GNU General Public License as published by | 9 | it under the terms of the GNU General Public License as published by | ||
9 | the Free Software Foundation; either version 2 of the License, or | 10 | the Free Software Foundation; either version 2 of the License, or | ||
10 | (at your option) any later version. | 11 | (at your option) any later version. | ||
11 | 12 | | |||
12 | This program is distributed in the hope that it will be useful, | 13 | This program is distributed in the hope that it will be useful, | ||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
Show All 22 Lines | 36 | { | |||
36 | effects->setActiveFullScreenEffect(effect); | 37 | effects->setActiveFullScreenEffect(effect); | ||
37 | } | 38 | } | ||
38 | 39 | | |||
39 | FullScreenEffectLock::~FullScreenEffectLock() | 40 | FullScreenEffectLock::~FullScreenEffectLock() | ||
40 | { | 41 | { | ||
41 | effects->setActiveFullScreenEffect(nullptr); | 42 | effects->setActiveFullScreenEffect(nullptr); | ||
42 | } | 43 | } | ||
43 | 44 | | |||
45 | KeepAliveLock::KeepAliveLock(EffectWindow *w) | ||||
46 | : m_window(w) | ||||
47 | { | ||||
48 | m_window->refWindow(); | ||||
49 | } | ||||
50 | | ||||
51 | KeepAliveLock::~KeepAliveLock() | ||||
52 | { | ||||
53 | m_window->unrefWindow(); | ||||
54 | } | ||||
55 | | ||||
44 | AniData::AniData() | 56 | AniData::AniData() | ||
45 | : attribute(AnimationEffect::Opacity) | 57 | : attribute(AnimationEffect::Opacity) | ||
46 | , customCurve(0) // Linear | 58 | , customCurve(0) // Linear | ||
47 | , time(0) | 59 | , time(0) | ||
48 | , duration(0) | 60 | , duration(0) | ||
49 | , meta(0) | 61 | , meta(0) | ||
50 | , startTime(0) | 62 | , startTime(0) | ||
51 | , windowType((NET::WindowTypeMask)0) | 63 | , windowType((NET::WindowTypeMask)0) | ||
52 | , waitAtSource(false) | 64 | , waitAtSource(false) | ||
53 | , keepAtTarget(false) | 65 | , keepAtTarget(false) | ||
66 | , keepAlive(true) | ||||
54 | { | 67 | { | ||
55 | } | 68 | } | ||
56 | 69 | | |||
57 | AniData::AniData(AnimationEffect::Attribute a, int meta_, int ms, const FPx2 &to_, | 70 | AniData::AniData(AnimationEffect::Attribute a, int meta_, int ms, const FPx2 &to_, | ||
58 | QEasingCurve curve_, int delay, const FPx2 &from_, bool waitAtSource_, bool keepAtTarget_, | 71 | QEasingCurve curve_, int delay, const FPx2 &from_, bool waitAtSource_, bool keepAtTarget_, | ||
59 | FullScreenEffectLockPtr fullScreenEffectLock_) | 72 | FullScreenEffectLockPtr fullScreenEffectLock_, bool keepAlive) | ||
60 | : attribute(a) | 73 | : attribute(a) | ||
61 | , curve(curve_) | 74 | , curve(curve_) | ||
62 | , from(from_) | 75 | , from(from_) | ||
63 | , to(to_) | 76 | , to(to_) | ||
64 | , time(0) | 77 | , time(0) | ||
65 | , duration(ms) | 78 | , duration(ms) | ||
66 | , meta(meta_) | 79 | , meta(meta_) | ||
67 | , startTime(AnimationEffect::clock() + delay) | 80 | , startTime(AnimationEffect::clock() + delay) | ||
68 | , windowType((NET::WindowTypeMask)0) | 81 | , windowType((NET::WindowTypeMask)0) | ||
69 | , fullScreenEffectLock(fullScreenEffectLock_) | 82 | , fullScreenEffectLock(fullScreenEffectLock_) | ||
70 | , waitAtSource(waitAtSource_) | 83 | , waitAtSource(waitAtSource_) | ||
71 | , keepAtTarget(keepAtTarget_) | 84 | , keepAtTarget(keepAtTarget_) | ||
85 | , keepAlive(keepAlive) | ||||
72 | { | 86 | { | ||
73 | } | 87 | } | ||
74 | 88 | | |||
75 | static QString attributeString(KWin::AnimationEffect::Attribute attribute) | 89 | static QString attributeString(KWin::AnimationEffect::Attribute attribute) | ||
76 | { | 90 | { | ||
77 | switch (attribute) { | 91 | switch (attribute) { | ||
78 | case KWin::AnimationEffect::Opacity: return QStringLiteral("Opacity"); | 92 | case KWin::AnimationEffect::Opacity: return QStringLiteral("Opacity"); | ||
79 | case KWin::AnimationEffect::Brightness: return QStringLiteral("Brightness"); | 93 | case KWin::AnimationEffect::Brightness: return QStringLiteral("Brightness"); | ||
Show All 21 Lines |