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