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 PATH_SOURCE_H 9 #define PATH_SOURCE_H 10 11 12 #include "Transformer.h" 13 14 #include "agg_path_storage.h" 15 #include "agg_conv_curve.h" 16 17 18 namespace BPrivate { 19 namespace Icon { 20 21 class PathContainer; 22 class VectorPath; 23 24 typedef agg::path_storage AGGPath; 25 typedef agg::conv_curve<AGGPath> AGGCurvedPath; 26 27 class PathSource : public VertexSource { 28 public: 29 PathSource(PathContainer* paths); 30 virtual ~PathSource(); 31 32 virtual void rewind(unsigned path_id); 33 virtual unsigned vertex(double* x, double* y); 34 35 virtual bool WantsOpenPaths() const; 36 virtual double ApproximationScale() const; 37 38 // PathSource 39 void Update(bool leavePathsOpen, 40 double approximationScale); 41 42 void SetGlobalScale(double scale); 43 44 private: 45 PathContainer* fPaths; 46 AGGPath fAGGPath; 47 AGGCurvedPath fAGGCurvedPath; 48 49 double fGlobalScale; 50 double fLastTransformerScale; 51 }; 52 53 } // namespace Icon 54 } // namespace BPrivate 55 56 #endif // PATH_SOURCE_H 57