xref: /haiku/src/libs/icon/transformer/StrokeTransformer.h (revision 893988af824e65e49e55f517b157db8386e8002b)
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 								StrokeTransformer(
32 									VertexSource& source,
33 									BMessage* archive);
34 
35 	virtual						~StrokeTransformer();
36 
37 	// Transformer interface
38 	virtual	Transformer*		Clone(VertexSource& source) const;
39 
40 	virtual	void				rewind(unsigned path_id);
41 	virtual	unsigned			vertex(double* x, double* y);
42 
43 	virtual	void				SetSource(VertexSource& source);
44 
45 	virtual	bool				WantsOpenPaths() const;
46 	virtual	double				ApproximationScale() const;
47 
48 #ifdef ICON_O_MATIC
49 	// IconObject interface
50 	virtual	status_t			Archive(BMessage* into,
51 										bool deep = true) const;
52 
53 	virtual	PropertyObject*		MakePropertyObject() const;
54 	virtual	bool				SetToPropertyObject(
55 									const PropertyObject* object);
56 #endif
57 };
58 
59 }	// namespace Icon
60 }	// namespace BPrivate
61 
62 #endif	// STROKE_TRANSFORMER_H
63