blob: 4b75b078d0ca2419df3392565384ec20f714fd2f [file] [log] [blame]
reed@android.com8a1c16f2008-12-17 15:59:43 +00001/* libs/graphics/animator/SkDisplayPost.h
2**
3** Copyright 2006, The Android Open Source Project
4**
5** Licensed under the Apache License, Version 2.0 (the "License");
6** you may not use this file except in compliance with the License.
7** You may obtain a copy of the License at
8**
9** http://www.apache.org/licenses/LICENSE-2.0
10**
11** Unless required by applicable law or agreed to in writing, software
12** distributed under the License is distributed on an "AS IS" BASIS,
13** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14** See the License for the specific language governing permissions and
15** limitations under the License.
16*/
17
18#ifndef SkDisplayPost_DEFINED
19#define SkDisplayPost_DEFINED
20
21#include "SkDisplayable.h"
22#include "SkEvent.h"
23#include "SkEventSink.h"
24#include "SkMemberInfo.h"
25#include "SkIntArray.h"
26
27class SkData;
28class SkAnimateMaker;
29
30class SkPost : public SkDisplayable {
31 DECLARE_MEMBER_INFO(Post);
32 enum Mode {
33 kDeferred,
34 kImmediate
35 };
36 SkPost();
37 virtual ~SkPost();
38 virtual bool add(SkAnimateMaker& , SkDisplayable* child);
39 virtual bool childrenNeedDisposing() const;
40 virtual void dirty();
41#ifdef SK_DUMP_ENABLED
42 virtual void dump(SkAnimateMaker* );
43#endif
44 virtual bool enable(SkAnimateMaker& );
45 virtual bool hasEnable() const;
46 virtual void onEndElement(SkAnimateMaker& );
47 virtual void setChildHasID();
48 virtual bool setProperty(int index, SkScriptValue& );
49protected:
50 SkMSec delay;
51 SkString sink;
52// SkBool initialized;
53 Mode mode;
54 SkEvent fEvent;
55 SkAnimateMaker* fMaker;
56 SkTDDataArray fParts;
57 SkEventSinkID fSinkID;
58 SkAnimateMaker* fTargetMaker;
59 SkBool8 fChildHasID;
60 SkBool8 fDirty;
61private:
62 void findSinkID();
63 friend class SkData;
64 typedef SkDisplayable INHERITED;
65};
66
67#endif //SkDisplayPost_DEFINED