17 GAnimStep& operator<<(GString
const& str) ;
18 GAnimStep& operator<<(
GProp& p) {list_.push_back(p);
return *
this;}
19 GAnimStep& operator<<(
GProp* p) {list_.push_back(p);
return *
this;}
20 bool empty()
const {
return list_.empty();}
21 std::vector<gptr<GProp>> list_;
31 enum {Infinite = -1, OneShot = -2};
34 GAnim(GTime duration = 0,
int repetitions = Infinite);
35 GAnim(GString
const& spec);
38 GAnim* toAnim()
override {
return this;}
41 void start(
bool yes =
true);
42 void stop() {
start(
false);}
47 GAnim& operator<<(GAnimStep& prop);
48 GAnim& operator<<(GString
const& proplist);
49 GAnim& operator<<(GProp& prop);
50 GAnim& operator<<(GProp* prop);
51 GAnim& operator<<(GFunction
const& fun);
53 int repetitions()
const {
return count_;}
54 GAnim& setRepetitions(
int count);
56 bool isRunning()
const;
57 GTime duration()
const {
return duration_;}
58 GTimer* timer() {
return timer_;}
61 using GType = GPropType_<GAnim,GProp>;
63 GType& type()
const override {
return Type();}
68 void removePropsFrom(
Gadget&);
74 void fireCallbacks(
GEvent&);
75 GTime duration_{}, elapsed_{}, timeout_{};
80 std::vector<GAnimStep*> steps_;
81 void updateProps(GAnimStep& from, GAnimStep&
to,
float alpha);
85 inline GAnim& Anim(GTime duration = 0,
int count = GAnim::Infinite) {
86 return *
new GAnim(duration, count);