3 * Copyright 2006 The Android Open Source Project
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
10 #ifndef SkDrawGroup_DEFINED
11 #define SkDrawGroup_DEFINED
13 #include "SkADrawable.h"
14 #include "SkIntArray.h"
15 #include "SkMemberInfo.h"
17 class SkGroup : public SkADrawable { //interface for schema element <g>
19 DECLARE_MEMBER_INFO(Group);
22 bool addChild(SkAnimateMaker& , SkDisplayable* child) SK_OVERRIDE;
23 bool contains(SkDisplayable* ) SK_OVERRIDE;
25 SkBool copySet(int index);
26 SkDisplayable* deepCopy(SkAnimateMaker* ) SK_OVERRIDE;
27 bool doEvent(SkDisplayEvent::Kind , SkEventState* state ) SK_OVERRIDE;
28 bool draw(SkAnimateMaker& ) SK_OVERRIDE;
29 #ifdef SK_DUMP_ENABLED
30 void dump(SkAnimateMaker* ) SK_OVERRIDE;
31 virtual void dumpDrawables(SkAnimateMaker* );
32 void dumpEvents() SK_OVERRIDE;
34 int findGroup(SkADrawable* drawable, SkTDDrawableArray** list,
35 SkGroup** parent, SkGroup** found, SkTDDrawableArray** grandList);
36 bool enable(SkAnimateMaker& ) SK_OVERRIDE;
37 SkTDDrawableArray* getChildren() { return &fChildren; }
38 SkGroup* getOriginal() { return fOriginal; }
39 bool hasEnable() const SK_OVERRIDE;
40 void initialize() SK_OVERRIDE;
41 SkBool isACopy() { return fOriginal != NULL; }
42 void markCopyClear(int index);
43 void markCopySet(int index);
44 void markCopySize(int index);
45 bool markedForDelete(int index) const { return (fCopies[index >> 5] & 1 << (index & 0x1f)) == 0; }
47 bool resolveIDs(SkAnimateMaker& maker, SkDisplayable* original, SkApply* ) SK_OVERRIDE;
48 void setSteps(int steps) SK_OVERRIDE;
50 void validate() SK_OVERRIDE;
53 bool ifCondition(SkAnimateMaker& maker, SkADrawable* drawable,
54 SkString& conditionString);
56 SkString enableCondition;
57 SkTDDrawableArray fChildren;
58 SkTDDrawableArray* fParentList;
62 typedef SkADrawable INHERITED;
65 class SkSave: public SkGroup {
66 DECLARE_MEMBER_INFO(Save);
67 bool draw(SkAnimateMaker& ) SK_OVERRIDE;
69 typedef SkGroup INHERITED;
72 #endif // SkDrawGroup_DEFINED