xref: /haiku/src/libs/icon/transformer/PathSource.h (revision 325a6253ceb7c4162df2805f7aabc2a119c93534)
1fb07ece0SStephan Aßmus /*
2*325a6253SAxel Dörfler  * Copyright 2006-2007, Haiku.
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_SOURCE_H
9fb07ece0SStephan Aßmus #define PATH_SOURCE_H
10fb07ece0SStephan Aßmus 
11*325a6253SAxel Dörfler 
12fb07ece0SStephan Aßmus #include "Transformer.h"
13fb07ece0SStephan Aßmus 
14fb07ece0SStephan Aßmus #include "agg_path_storage.h"
15fb07ece0SStephan Aßmus #include "agg_conv_curve.h"
16fb07ece0SStephan Aßmus 
17*325a6253SAxel Dörfler 
18*325a6253SAxel Dörfler namespace BPrivate {
19*325a6253SAxel Dörfler namespace Icon {
20*325a6253SAxel Dörfler 
21fb07ece0SStephan Aßmus class PathContainer;
22fb07ece0SStephan Aßmus class VectorPath;
23fb07ece0SStephan Aßmus 
24fb07ece0SStephan Aßmus typedef agg::path_storage					AGGPath;
25fb07ece0SStephan Aßmus typedef agg::conv_curve<AGGPath>			AGGCurvedPath;
26fb07ece0SStephan Aßmus 
27fb07ece0SStephan Aßmus class PathSource : public VertexSource {
28fb07ece0SStephan Aßmus  public:
29fb07ece0SStephan Aßmus 								PathSource(PathContainer* paths);
30fb07ece0SStephan Aßmus 	virtual						~PathSource();
31fb07ece0SStephan Aßmus 
32fb07ece0SStephan Aßmus     virtual	void				rewind(unsigned path_id);
33fb07ece0SStephan Aßmus     virtual	unsigned			vertex(double* x, double* y);
34fb07ece0SStephan Aßmus 
35fb07ece0SStephan Aßmus 	virtual	bool				WantsOpenPaths() const;
36fb07ece0SStephan Aßmus 	virtual	double				ApproximationScale() const;
37fb07ece0SStephan Aßmus 
38fb07ece0SStephan Aßmus 	// PathSource
39fb07ece0SStephan Aßmus 			void				Update(bool leavePathsOpen,
40fb07ece0SStephan Aßmus 									   double approximationScale);
41fb07ece0SStephan Aßmus 
42fb07ece0SStephan Aßmus  private:
43fb07ece0SStephan Aßmus 		 	PathContainer*		fPaths;
44fb07ece0SStephan Aßmus 		 	AGGPath				fAGGPath;
45fb07ece0SStephan Aßmus 		 	AGGCurvedPath		fAGGCurvedPath;
46fb07ece0SStephan Aßmus };
47fb07ece0SStephan Aßmus 
48*325a6253SAxel Dörfler }	// namespace Icon
49*325a6253SAxel Dörfler }	// namespace BPrivate
50*325a6253SAxel Dörfler 
51fb07ece0SStephan Aßmus #endif	// PATH_SOURCE_H
52