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 "Transformer.h" 14 15 #include <agg_conv_stroke.h> 16 17 18 _BEGIN_ICON_NAMESPACE 19 20 21 typedef agg::conv_stroke<VertexSource> Stroke; 22 23 class StrokeTransformer : public Transformer, 24 public Stroke { 25 public: 26 enum { 27 archive_code = 'strk', 28 }; 29 30 StrokeTransformer( 31 VertexSource& source); 32 StrokeTransformer( 33 VertexSource& source, 34 BMessage* archive); 35 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 61 _END_ICON_NAMESPACE 62 63 64 #endif // STROKE_TRANSFORMER_H 65