xref: /haiku/src/libs/icon/transformer/StrokeTransformer.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 STROKE_TRANSFORMER_H
9fb07ece0SStephan Aßmus #define STROKE_TRANSFORMER_H
10fb07ece0SStephan Aßmus 
11fb07ece0SStephan Aßmus 
12fb07ece0SStephan Aßmus #include "Transformer.h"
13fb07ece0SStephan Aßmus 
14*325a6253SAxel Dörfler #include <agg_conv_stroke.h>
15*325a6253SAxel Dörfler 
16*325a6253SAxel Dörfler 
17*325a6253SAxel Dörfler namespace BPrivate {
18*325a6253SAxel Dörfler namespace Icon {
19*325a6253SAxel Dörfler 
20fb07ece0SStephan Aßmus typedef agg::conv_stroke<VertexSource> Stroke;
21fb07ece0SStephan Aßmus 
22fb07ece0SStephan Aßmus class StrokeTransformer : public Transformer,
23fb07ece0SStephan Aßmus 						  public Stroke {
24fb07ece0SStephan Aßmus  public:
25fb07ece0SStephan Aßmus 	enum {
26fb07ece0SStephan Aßmus 		archive_code	= 'strk',
27fb07ece0SStephan Aßmus 	};
28fb07ece0SStephan Aßmus 
29fb07ece0SStephan Aßmus 								StrokeTransformer(
30fb07ece0SStephan Aßmus 									VertexSource& source);
31fb07ece0SStephan Aßmus #ifdef ICON_O_MATIC
32fb07ece0SStephan Aßmus 								StrokeTransformer(
33fb07ece0SStephan Aßmus 									VertexSource& source,
34fb07ece0SStephan Aßmus 									BMessage* archive);
35fb07ece0SStephan Aßmus #endif
36fb07ece0SStephan Aßmus 	virtual						~StrokeTransformer();
37fb07ece0SStephan Aßmus 
38fb07ece0SStephan Aßmus 	// Transformer interface
39fb07ece0SStephan Aßmus 	virtual	Transformer*		Clone(VertexSource& source) const;
40fb07ece0SStephan Aßmus 
41fb07ece0SStephan Aßmus 	virtual	void				rewind(unsigned path_id);
42fb07ece0SStephan Aßmus 	virtual	unsigned			vertex(double* x, double* y);
43fb07ece0SStephan Aßmus 
44fb07ece0SStephan Aßmus 	virtual	void				SetSource(VertexSource& source);
45fb07ece0SStephan Aßmus 
46fb07ece0SStephan Aßmus 	virtual	bool				WantsOpenPaths() const;
47fb07ece0SStephan Aßmus 	virtual	double				ApproximationScale() const;
48fb07ece0SStephan Aßmus 
49fb07ece0SStephan Aßmus #ifdef ICON_O_MATIC
50fb07ece0SStephan Aßmus 	// IconObject interface
51fb07ece0SStephan Aßmus 	virtual	status_t			Archive(BMessage* into,
52fb07ece0SStephan Aßmus 										bool deep = true) const;
53fb07ece0SStephan Aßmus 
54fb07ece0SStephan Aßmus 	virtual	PropertyObject*		MakePropertyObject() const;
55fb07ece0SStephan Aßmus 	virtual	bool				SetToPropertyObject(
56fb07ece0SStephan Aßmus 									const PropertyObject* object);
57fb07ece0SStephan Aßmus #endif
58fb07ece0SStephan Aßmus };
59fb07ece0SStephan Aßmus 
60*325a6253SAxel Dörfler }	// namespace Icon
61*325a6253SAxel Dörfler }	// namespace BPrivate
62*325a6253SAxel Dörfler 
63fb07ece0SStephan Aßmus #endif	// STROKE_TRANSFORMER_H
64