xref: /haiku/src/libs/icon/transformer/StrokeTransformer.h (revision c6c2c0428420c1a7a9b16a843b41ab26903bc5fb)
1fb07ece0SStephan Aßmus /*
2325a6253SAxel 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 STROKE_TRANSFORMER_H
9fb07ece0SStephan Aßmus #define STROKE_TRANSFORMER_H
10fb07ece0SStephan Aßmus 
11fb07ece0SStephan Aßmus 
1225dc253dSIngo Weinhold #include "IconBuild.h"
13*c6c2c042SZardshard #include "PathTransformer.h"
14fb07ece0SStephan Aßmus #include "Transformer.h"
15fb07ece0SStephan Aßmus 
16325a6253SAxel Dörfler #include <agg_conv_stroke.h>
17325a6253SAxel Dörfler 
18325a6253SAxel Dörfler 
1925dc253dSIngo Weinhold _BEGIN_ICON_NAMESPACE
2025dc253dSIngo Weinhold 
21325a6253SAxel Dörfler 
22fb07ece0SStephan Aßmus typedef agg::conv_stroke<VertexSource> Stroke;
23fb07ece0SStephan Aßmus 
24fb07ece0SStephan Aßmus class StrokeTransformer : public Transformer,
25*c6c2c042SZardshard 						  public PathTransformer,
26fb07ece0SStephan Aßmus 						  public Stroke {
27fb07ece0SStephan Aßmus  public:
28fb07ece0SStephan Aßmus 	enum {
29fb07ece0SStephan Aßmus 		archive_code	= 'strk',
30fb07ece0SStephan Aßmus 	};
31fb07ece0SStephan Aßmus 
32fb07ece0SStephan Aßmus 								StrokeTransformer(
33fb07ece0SStephan Aßmus 									VertexSource& source);
34fb07ece0SStephan Aßmus 								StrokeTransformer(
35fb07ece0SStephan Aßmus 									VertexSource& source,
36fb07ece0SStephan Aßmus 									BMessage* archive);
378b8d44bfSMichael Lotz 
38fb07ece0SStephan Aßmus 	virtual						~StrokeTransformer();
39fb07ece0SStephan Aßmus 
40fb07ece0SStephan Aßmus 	// Transformer interface
41*c6c2c042SZardshard 	virtual	Transformer*		Clone() const;
42fb07ece0SStephan Aßmus 
43*c6c2c042SZardshard 	// PathTransformer interface
44fb07ece0SStephan Aßmus 	virtual	void				rewind(unsigned path_id);
45fb07ece0SStephan Aßmus 	virtual	unsigned			vertex(double* x, double* y);
46fb07ece0SStephan Aßmus 
47fb07ece0SStephan Aßmus 	virtual	void				SetSource(VertexSource& source);
48fb07ece0SStephan Aßmus 
49fb07ece0SStephan Aßmus 	virtual	bool				WantsOpenPaths() const;
50fb07ece0SStephan Aßmus 	virtual	double				ApproximationScale() const;
51fb07ece0SStephan Aßmus 
52fb07ece0SStephan Aßmus #ifdef ICON_O_MATIC
53fb07ece0SStephan Aßmus 	// IconObject interface
54fb07ece0SStephan Aßmus 	virtual	status_t			Archive(BMessage* into,
55fb07ece0SStephan Aßmus 										bool deep = true) const;
56fb07ece0SStephan Aßmus 
57fb07ece0SStephan Aßmus 	virtual	PropertyObject*		MakePropertyObject() const;
58fb07ece0SStephan Aßmus 	virtual	bool				SetToPropertyObject(
59fb07ece0SStephan Aßmus 									const PropertyObject* object);
60fb07ece0SStephan Aßmus #endif
61fb07ece0SStephan Aßmus };
62fb07ece0SStephan Aßmus 
6325dc253dSIngo Weinhold 
6425dc253dSIngo Weinhold _END_ICON_NAMESPACE
6525dc253dSIngo Weinhold 
66325a6253SAxel Dörfler 
67fb07ece0SStephan Aßmus #endif	// STROKE_TRANSFORMER_H
68