diff options
author | initial.commit <initial.commit@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-07-27 00:09:42 +0000 |
---|---|---|
committer | initial.commit <initial.commit@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-07-27 00:09:42 +0000 |
commit | ae2c20f398933a9e86c387dcc465ec0f71065ffc (patch) | |
tree | de668b1411e2ee0b4e49b6d8f8b68183134ac990 /skia/animator/SkScriptCallBack.h | |
parent | 09911bf300f1a419907a9412154760efd0b7abc3 (diff) | |
download | chromium_src-ae2c20f398933a9e86c387dcc465ec0f71065ffc.zip chromium_src-ae2c20f398933a9e86c387dcc465ec0f71065ffc.tar.gz chromium_src-ae2c20f398933a9e86c387dcc465ec0f71065ffc.tar.bz2 |
Add skia to the repository.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia/animator/SkScriptCallBack.h')
-rw-r--r-- | skia/animator/SkScriptCallBack.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/skia/animator/SkScriptCallBack.h b/skia/animator/SkScriptCallBack.h new file mode 100644 index 0000000..725e493 --- /dev/null +++ b/skia/animator/SkScriptCallBack.h @@ -0,0 +1,58 @@ +#ifndef SkScriptCallBack_DEFINED +#define SkScriptCallBack_DEFINED + +#include "SkOperand2.h" +#include "SkTDArray_Experimental.h" + +class SkScriptCallBack { +public: + enum Type { + kBox, + kFunction, + kMember, + kMemberFunction, + kProperty, + kUnbox + }; + + virtual bool getReference(const char* , size_t len, SkScriptValue2* result) { return false; } + virtual SkOperand2::OpType getReturnType(size_t ref, SkOperand2*) { + return SkOperand2::kS32; } + virtual Type getType() const = 0; +}; + +class SkScriptCallBackConvert : public SkScriptCallBack { +public: + virtual bool convert(SkOperand2::OpType type, SkOperand2* operand) = 0; +}; + +class SkScriptCallBackFunction : public SkScriptCallBack { +public: + virtual void getParamTypes(SkIntArray(SkOperand2::OpType)* types) = 0; + virtual Type getType() const { return kFunction; } + virtual bool invoke(size_t ref, SkOpArray* params, SkOperand2* value) = 0; +}; + +class SkScriptCallBackMember: public SkScriptCallBack { +public: + bool getMemberReference(const char* , size_t len, void* object, SkScriptValue2* ref); + virtual Type getType() const { return kMember; } + virtual bool invoke(size_t ref, void* object, SkOperand2* value) = 0; +}; + +class SkScriptCallBackMemberFunction : public SkScriptCallBack { +public: + bool getMemberReference(const char* , size_t len, void* object, SkScriptValue2* ref); + virtual void getParamTypes(SkIntArray(SkOperand2::OpType)* types) = 0; + virtual Type getType() const { return kMemberFunction; } + virtual bool invoke(size_t ref, void* object, SkOpArray* params, SkOperand2* value) = 0; +}; + +class SkScriptCallBackProperty : public SkScriptCallBack { +public: + virtual bool getConstValue(const char* name, size_t len, SkOperand2* value) { return false; } + virtual bool getResult(size_t ref, SkOperand2* answer) { return false; } + virtual Type getType() const { return kProperty; } +}; + +#endif // SkScriptCallBack_DEFINED |