xref: /haiku/src/libs/icon/transformer/StrokeTransformer.h (revision 9ecf9d1c1d4888d341a6eac72112c72d1ae3a4cb)
1 /*
2  * Copyright 2006, Haiku.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Stephan Aßmus <superstippi@gmx.de>
7  */
8 
9 #ifndef STROKE_TRANSFORMER_H
10 #define STROKE_TRANSFORMER_H
11 
12 #include <agg_conv_stroke.h>
13 
14 #include "Transformer.h"
15 
16 typedef agg::conv_stroke<VertexSource>		Stroke;
17 
18 class StrokeTransformer : public Transformer,
19 						  public Stroke {
20  public:
21 	enum {
22 		archive_code	= 'strk',
23 	};
24 
25 								StrokeTransformer(
26 									VertexSource& source);
27 #ifdef ICON_O_MATIC
28 								StrokeTransformer(
29 									VertexSource& source,
30 									BMessage* archive);
31 #endif
32 	virtual						~StrokeTransformer();
33 
34 	// Transformer interface
35 	virtual	Transformer*		Clone(VertexSource& source) const;
36 
37 	virtual	void				rewind(unsigned path_id);
38 	virtual	unsigned			vertex(double* x, double* y);
39 
40 	virtual	void				SetSource(VertexSource& source);
41 
42 	virtual	bool				WantsOpenPaths() const;
43 	virtual	double				ApproximationScale() const;
44 
45 #ifdef ICON_O_MATIC
46 	// IconObject interface
47 	virtual	status_t			Archive(BMessage* into,
48 										bool deep = true) const;
49 
50 	virtual	PropertyObject*		MakePropertyObject() const;
51 	virtual	bool				SetToPropertyObject(
52 									const PropertyObject* object);
53 #endif
54 };
55 
56 #endif // STROKE_TRANSFORMER_H
57