2 * Copyright 2002-2010 Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
9 #include <Archivable.h>
22 class BShapeIterator
{
25 virtual ~BShapeIterator();
27 virtual status_t
IterateMoveTo(BPoint
* point
);
28 virtual status_t
IterateLineTo(int32 lineCount
,
30 virtual status_t
IterateBezierTo(int32 bezierCount
,
31 BPoint
* bezierPoints
);
32 virtual status_t
IterateClose();
34 virtual status_t
IterateArcTo(float& rx
, float& ry
,
35 float& angle
, bool largeArc
,
36 bool counterClockWise
, BPoint
& point
);
38 status_t
Iterate(BShape
* shape
);
41 virtual void _ReservedShapeIterator2();
42 virtual void _ReservedShapeIterator3();
43 virtual void _ReservedShapeIterator4();
49 class BShape
: public BArchivable
{
52 BShape(const BShape
& other
);
53 BShape(BMessage
* archive
);
56 static BArchivable
* Instantiate(BMessage
* archive
);
57 virtual status_t
Archive(BMessage
* archive
,
58 bool deep
= true) const;
60 BShape
& operator=(const BShape
& other
);
62 bool operator==(const BShape
& other
) const;
63 bool operator!=(const BShape
& other
) const;
67 BPoint
CurrentPosition() const;
69 status_t
AddShape(const BShape
* other
);
71 status_t
MoveTo(BPoint point
);
72 status_t
LineTo(BPoint linePoint
);
73 status_t
BezierTo(BPoint controlPoints
[3]);
74 status_t
BezierTo(const BPoint
& control1
,
75 const BPoint
& control2
,
76 const BPoint
& endPoint
);
77 status_t
ArcTo(float rx
, float ry
,
78 float angle
, bool largeArc
,
79 bool counterClockWise
,
85 virtual status_t
Perform(perform_code code
, void* data
);
87 virtual void _ReservedShape1();
88 virtual void _ReservedShape2();
89 virtual void _ReservedShape3();
90 virtual void _ReservedShape4();
93 friend class BShapeIterator
;
96 friend class BPrivate::PicturePlayer
;
97 friend class BPrivate::ServerLink
;
99 void GetData(int32
* opCount
, int32
* ptCount
,
100 uint32
** opList
, BPoint
** ptList
);
101 void SetData(int32 opCount
, int32 ptCount
,
102 const uint32
* opList
,
103 const BPoint
* ptList
);
105 bool AllocatePts(int32 count
);
106 bool AllocateOps(int32 count
);