/src/wt/src/Wt/WAnimation.C
Line | Count | Source |
1 | | /* |
2 | | * Copyright (C) 2011 Emweb bv, Herent, Belgium. |
3 | | * |
4 | | * See the LICENSE file for terms of use. |
5 | | */ |
6 | | #include "Wt/WAnimation.h" |
7 | | |
8 | | namespace Wt { |
9 | | |
10 | | WAnimation::WAnimation() |
11 | 0 | : effects_(), |
12 | 0 | timing_(TimingFunction::Linear), |
13 | 0 | duration_(250) |
14 | 0 | { } |
15 | | |
16 | | WAnimation::WAnimation(WFlags<AnimationEffect> effects, TimingFunction timing, |
17 | | int duration) |
18 | 0 | : effects_(effects), |
19 | 0 | timing_(timing), |
20 | 0 | duration_(duration) |
21 | 0 | { } |
22 | | |
23 | | #ifdef WT_TARGET_JAVA |
24 | | |
25 | | WAnimation::WAnimation(AnimationEffect effect, TimingFunction timing, |
26 | | int duration) |
27 | | : effects_(effect), |
28 | | timing_(timing), |
29 | | duration_(duration) |
30 | | { } |
31 | | |
32 | | WAnimation::WAnimation(AnimationEffect effect1, AnimationEffect effect2, |
33 | | TimingFunction timing, int duration) |
34 | | : effects_(effect1 | effect2), |
35 | | timing_(timing), |
36 | | duration_(duration) |
37 | | { } |
38 | | |
39 | | WAnimation WAnimation::clone() const |
40 | | { |
41 | | WAnimation result; |
42 | | result.effects_ = effects_; |
43 | | result.duration_ = duration_; |
44 | | return result; |
45 | | } |
46 | | #endif // WT_TARGET_JAVA |
47 | | |
48 | | bool WAnimation::operator==(const WAnimation& animation) const |
49 | 0 | { |
50 | 0 | return animation.effects_ == effects_ && |
51 | 0 | animation.duration_ == duration_; |
52 | 0 | } |
53 | | |
54 | | bool WAnimation::operator!=(const WAnimation& animation) const |
55 | 0 | { |
56 | 0 | return !(*this == animation); |
57 | 0 | } |
58 | | |
59 | | void WAnimation::setEffects(WFlags<AnimationEffect> effects) |
60 | 0 | { |
61 | 0 | effects_ = effects; |
62 | 0 | } |
63 | | |
64 | | void WAnimation::setDuration(int msecs) |
65 | 0 | { |
66 | 0 | duration_ = msecs; |
67 | 0 | } |
68 | | |
69 | | void WAnimation::setTimingFunction(TimingFunction tf) |
70 | 0 | { |
71 | 0 | timing_ = tf; |
72 | 0 | } |
73 | | |
74 | | bool WAnimation::empty() const |
75 | 0 | { |
76 | 0 | return duration_ == 0 || !effects_; |
77 | 0 | } |
78 | | |
79 | | } |