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