-
Notifications
You must be signed in to change notification settings - Fork 388
Expand file tree
/
Copy pathWAnimation.C
More file actions
79 lines (65 loc) · 1.49 KB
/
WAnimation.C
File metadata and controls
79 lines (65 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*
* Copyright (C) 2011 Emweb bvba, Kessel-Lo, Belgium.
*
* See the LICENSE file for terms of use.
*/
#include "Wt/WAnimation"
namespace Wt {
WAnimation::WAnimation()
: effects_(0),
timing_(Linear),
duration_(250)
{ }
WAnimation::WAnimation(WFlags<AnimationEffect> effects, TimingFunction timing,
int duration)
: effects_(effects),
timing_(timing),
duration_(duration)
{ }
#ifdef WT_TARGET_JAVA
WAnimation::WAnimation(AnimationEffect effect, TimingFunction timing,
int duration)
: effects_(effect),
timing_(timing),
duration_(duration)
{ }
WAnimation::WAnimation(AnimationEffect effect1, AnimationEffect effect2,
TimingFunction timing, int duration)
: effects_(effect1 | effect2),
timing_(timing),
duration_(duration)
{ }
WAnimation WAnimation::clone() const
{
WAnimation result;
result.effects_ = effects_;
result.duration_ = duration_;
return result;
}
#endif // WT_TARGET_JAVA
bool WAnimation::operator==(const WAnimation& animation) const
{
return animation.effects_ == effects_
&& animation.duration_ == duration_;
}
bool WAnimation::operator!=(const WAnimation& animation) const
{
return !(*this == animation);
}
void WAnimation::setEffects(WFlags<AnimationEffect> effects)
{
effects_ = effects;
}
void WAnimation::setDuration(int msecs)
{
duration_ = msecs;
}
void WAnimation::setTimingFunction(TimingFunction tf)
{
timing_ = tf;
}
bool WAnimation::empty() const
{
return duration_ == 0 || !effects_;
}
}