xref: /haiku/src/libs/icon/flat_icon/PathCommandQueue.h (revision 25dc253d6ab28ce204fa4de2d3e7a27d167fc817)
1fb07ece0SStephan Aßmus /*
2325a6253SAxel Dörfler  * Copyright 2006-2007, Haiku. All rights reserved.
3fb07ece0SStephan Aßmus  * Distributed under the terms of the MIT License.
4fb07ece0SStephan Aßmus  *
5fb07ece0SStephan Aßmus  * Authors:
6fb07ece0SStephan Aßmus  *		Stephan Aßmus <superstippi@gmx.de>
7fb07ece0SStephan Aßmus  */
8fb07ece0SStephan Aßmus #ifndef PATH_COMMAND_QUEUE_H
9fb07ece0SStephan Aßmus #define PATH_COMMAND_QUEUE_H
10fb07ece0SStephan Aßmus 
11325a6253SAxel Dörfler 
12*25dc253dSIngo Weinhold #include "IconBuild.h"
13fb07ece0SStephan Aßmus #include "LittleEndianBuffer.h"
14fb07ece0SStephan Aßmus 
15*25dc253dSIngo Weinhold 
16fb07ece0SStephan Aßmus class BPoint;
17325a6253SAxel Dörfler 
18325a6253SAxel Dörfler 
19*25dc253dSIngo Weinhold _BEGIN_ICON_NAMESPACE
20*25dc253dSIngo Weinhold 
21325a6253SAxel Dörfler 
22fb07ece0SStephan Aßmus class VectorPath;
23fb07ece0SStephan Aßmus 
24fb07ece0SStephan Aßmus class PathCommandQueue {
25fb07ece0SStephan Aßmus  public:
26fb07ece0SStephan Aßmus 								PathCommandQueue();
27fb07ece0SStephan Aßmus 	virtual						~PathCommandQueue();
28fb07ece0SStephan Aßmus 
29fb07ece0SStephan Aßmus 			bool				Write(LittleEndianBuffer& buffer,
30fb07ece0SStephan Aßmus 									  const VectorPath* path,
31fb07ece0SStephan Aßmus 									  uint8 pointCount);
32fb07ece0SStephan Aßmus 
33fb07ece0SStephan Aßmus 			bool				Read(LittleEndianBuffer& buffer,
34fb07ece0SStephan Aßmus 									 VectorPath* path,
35fb07ece0SStephan Aßmus 									 uint8 pointCount);
36fb07ece0SStephan Aßmus 
37fb07ece0SStephan Aßmus  private:
38fb07ece0SStephan Aßmus 	// writing
39fb07ece0SStephan Aßmus 			bool				_AppendHLine(float x);
40fb07ece0SStephan Aßmus 			bool				_AppendVLine(float y);
41fb07ece0SStephan Aßmus 			bool				_AppendLine(const BPoint& point);
42fb07ece0SStephan Aßmus 			bool				_AppendCurve(const BPoint& point,
43fb07ece0SStephan Aßmus 											 const BPoint& pointIn,
44fb07ece0SStephan Aßmus 											 const BPoint& pointOut);
45fb07ece0SStephan Aßmus 
46fb07ece0SStephan Aßmus 			bool				_AppendCommand(uint8 command);
47fb07ece0SStephan Aßmus 
48fb07ece0SStephan Aßmus 	// reading
49fb07ece0SStephan Aßmus 			bool				_ReadCommand(uint8& command);
50fb07ece0SStephan Aßmus 
51fb07ece0SStephan Aßmus 			LittleEndianBuffer	fCommandBuffer;
52fb07ece0SStephan Aßmus 			LittleEndianBuffer	fPointBuffer;
53fb07ece0SStephan Aßmus 
54fb07ece0SStephan Aßmus 			uint8				fCommandByte;
55fb07ece0SStephan Aßmus 			uint8				fCommandPos;
56fb07ece0SStephan Aßmus 
57fb07ece0SStephan Aßmus 			uint8				fCommandCount;
58fb07ece0SStephan Aßmus };
59fb07ece0SStephan Aßmus 
60*25dc253dSIngo Weinhold 
61*25dc253dSIngo Weinhold _END_ICON_NAMESPACE
62*25dc253dSIngo Weinhold 
63325a6253SAxel Dörfler 
64fb07ece0SStephan Aßmus #endif	// PATH_COMMAND_QUEUE_H
65