summaryrefslogtreecommitdiffstats
path: root/skia/animator/SkDisplayable.h
diff options
context:
space:
mode:
authorinitial.commit <initial.commit@0039d316-1c4b-4281-b951-d872f2087c98>2008-07-27 00:09:42 +0000
committerinitial.commit <initial.commit@0039d316-1c4b-4281-b951-d872f2087c98>2008-07-27 00:09:42 +0000
commitae2c20f398933a9e86c387dcc465ec0f71065ffc (patch)
treede668b1411e2ee0b4e49b6d8f8b68183134ac990 /skia/animator/SkDisplayable.h
parent09911bf300f1a419907a9412154760efd0b7abc3 (diff)
downloadchromium_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/SkDisplayable.h')
-rw-r--r--skia/animator/SkDisplayable.h120
1 files changed, 120 insertions, 0 deletions
diff --git a/skia/animator/SkDisplayable.h b/skia/animator/SkDisplayable.h
new file mode 100644
index 0000000..0c35d10
--- /dev/null
+++ b/skia/animator/SkDisplayable.h
@@ -0,0 +1,120 @@
+/* libs/graphics/animator/SkDisplayable.h
+**
+** Copyright 2006, Google Inc.
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+
+#ifndef SkDisplayable_DEFINED
+#define SkDisplayable_DEFINED
+
+#include "SkOperand.h"
+#ifdef SK_DEBUG
+#include "SkString.h"
+#endif
+#include "SkIntArray.h"
+#include "SkRect.h"
+#include "SkTDArray.h"
+
+class SkAnimateMaker;
+class SkApply;
+class SkEvents;
+struct SkMemberInfo;
+struct SkScriptValue;
+class SkOpArray; // compiled scripting experiment
+union SkOperand2; // compiled scripting experiment
+
+class SkDisplayable {
+public:
+#ifdef SK_DEBUG
+ SkDisplayable();
+#endif
+ virtual ~SkDisplayable();
+ virtual bool add(SkAnimateMaker& , SkDisplayable* child);
+ virtual bool canContainDependents() const;
+ virtual bool childrenNeedDisposing() const;
+ virtual void clearBounder();
+ virtual bool contains(SkDisplayable* );
+ virtual SkDisplayable* contains(const SkString& );
+ virtual SkDisplayable* deepCopy(SkAnimateMaker* );
+ virtual void dirty();
+#ifdef SK_DUMP_ENABLED
+ virtual void dump(SkAnimateMaker* );
+ void dumpAttrs(SkAnimateMaker* );
+ void dumpBase(SkAnimateMaker* );
+ void dumpChildren(SkAnimateMaker* maker, bool closedAngle = false );
+ void dumpEnd(SkAnimateMaker* );
+ virtual void dumpEvents();
+#endif
+ virtual bool enable( SkAnimateMaker& );
+ virtual void enableBounder();
+ virtual void executeFunction(SkDisplayable* , int functionIndex,
+ SkTDArray<SkScriptValue>& , SkDisplayTypes , SkScriptValue* );
+ void executeFunction(SkDisplayable* , const SkMemberInfo* ,
+ SkTypedArray* , SkScriptValue* );
+ virtual void executeFunction2(SkDisplayable* , int functionIndex,
+ SkOpArray* params , SkDisplayTypes , SkOperand2* ); // compiled scripting experiment
+ virtual void getBounds(SkRect* );
+ virtual const SkFunctionParamType* getFunctionsParameters();
+ virtual const SkMemberInfo* getMember(int index);
+ virtual const SkMemberInfo* getMember(const char name[]);
+ const SkFunctionParamType* getParameters(const SkMemberInfo* info,
+ int* paramCount);
+ virtual SkDisplayable* getParent() const;
+ virtual bool getProperty(int index, SkScriptValue* value) const;
+ virtual bool getProperty2(int index, SkOperand2* value) const; // compiled scripting experiment
+ virtual SkDisplayTypes getType() const;
+ virtual bool hasEnable() const;
+ bool isAnimate() const {
+ SkDisplayTypes type = getType();
+ return type == SkType_Animate || type == SkType_Set; }
+ bool isApply() const { return getType() == SkType_Apply; }
+ bool isColor() const { return getType() == SkType_Color; }
+ virtual bool isDrawable() const;
+ bool isGroup() const { return getType() == SkType_Group ||
+ getType() == SkType_Save || getType() == SkType_DrawTo ||
+ getType() == SkType_SaveLayer; }
+ bool isMatrix() const { return getType() == SkType_Matrix; }
+ virtual bool isPaint() const { return getType() == SkType_Paint; }
+ virtual bool isPath() const { return false; }
+ bool isPost() const { return getType() == SkType_Post; }
+ virtual void onEndElement(SkAnimateMaker& );
+ virtual const SkMemberInfo* preferredChild(SkDisplayTypes type);
+ virtual bool resolveIDs(SkAnimateMaker& maker, SkDisplayable* original, SkApply* );
+ virtual void setChildHasID();
+ virtual bool setParent(SkDisplayable* );
+ virtual bool setProperty(int index, SkScriptValue& );
+ void setReference(const SkMemberInfo* info, SkDisplayable* ref);
+#ifdef SK_DEBUG
+ bool isData() const { return getType() == SkType_Data; };
+ bool isEvent() const { return getType() == SkType_Event; }
+ virtual bool isMatrixPart() const { return false; }
+ bool isPatch() const { return getType() == SkType_3D_Patch; }
+ virtual bool isPaintPart() const { return false; }
+ virtual bool isPathPart() const { return false; }
+ virtual void validate();
+ SkString _id;
+ const char* id;
+// static int fAllocationCount;
+ static SkTDDisplayableArray fAllocations;
+#else
+ void validate() {}
+#endif
+#ifdef SK_DUMP_ENABLED
+private:
+ void dumpValues(const SkMemberInfo* info, SkDisplayTypes type, SkOperand op, SkOperand blankOp,
+ SkOperand op2, SkOperand blankOp2);
+#endif
+};
+
+#endif // SkDisplayable_DEFINED