reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame^] | 1 | #ifndef SkAnimatorScript2_DEFINED |
| 2 | #define SkAnimatorScript2_DEFINED |
| 3 | |
| 4 | #include "SkDisplayable.h" |
| 5 | #include "SkScript2.h" |
| 6 | #include "SkTypedArray.h" |
| 7 | |
| 8 | class SkAnimateMaker; |
| 9 | struct SkMemberInfo; |
| 10 | |
| 11 | #ifndef SkAnimatorScript_DEFINED |
| 12 | struct SkDisplayEnumMap { |
| 13 | SkDisplayTypes fType; |
| 14 | const char* fValues; |
| 15 | }; |
| 16 | #endif |
| 17 | |
| 18 | class SkAnimatorScript2 : public SkScriptEngine2 { |
| 19 | public: |
| 20 | SkAnimatorScript2(SkAnimateMaker& , SkDisplayable* working, SkDisplayTypes type); |
| 21 | ~SkAnimatorScript2(); |
| 22 | bool evalMemberCommon(const SkMemberInfo* info, |
| 23 | SkDisplayable* displayable, SkOperand2* value); |
| 24 | SkAnimateMaker& getMaker() { return fMaker; } |
| 25 | SkDisplayable* getWorking() { return fWorking; } |
| 26 | static bool MapEnums(const char* ptr, const char* match, size_t len, int* value); |
| 27 | static const SkDisplayEnumMap& GetEnumValues(SkDisplayTypes type); |
| 28 | static SkDisplayTypes ToDisplayType(SkOperand2::OpType type); |
| 29 | static SkOperand2::OpType ToOpType(SkDisplayTypes type); |
| 30 | private: |
| 31 | SkAnimateMaker& fMaker; |
| 32 | SkDisplayable* fWorking; |
| 33 | friend class SkDump; |
| 34 | friend struct SkScriptNAnswer; |
| 35 | // illegal |
| 36 | SkAnimatorScript2& operator=(const SkAnimatorScript2&); |
| 37 | #ifdef SK_DEBUG |
| 38 | public: |
| 39 | static void UnitTest(); |
| 40 | #endif |
| 41 | }; |
| 42 | |
| 43 | #endif // SkAnimatorScript2_DEFINED |