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 TRANSFORMER_H 9 #define TRANSFORMER_H 10 11 12 #ifdef ICON_O_MATIC 13 # include "IconObject.h" 14 #else 15 # include <Message.h> 16 # include <SupportDefs.h> 17 #endif 18 19 20 namespace BPrivate { 21 namespace Icon { 22 23 class VertexSource { 24 public: 25 VertexSource(); 26 virtual ~VertexSource(); 27 28 virtual void rewind(unsigned path_id) = 0; 29 virtual unsigned vertex(double* x, double* y) = 0; 30 31 virtual bool WantsOpenPaths() const = 0; 32 virtual double ApproximationScale() const = 0; 33 }; 34 35 36 #ifdef ICON_O_MATIC 37 class Transformer : public VertexSource, 38 public IconObject { 39 #else 40 class Transformer : public VertexSource { 41 #endif 42 public: 43 Transformer(VertexSource& source, 44 const char* name); 45 Transformer(VertexSource& source, 46 BMessage* archive); 47 48 virtual ~Transformer(); 49 50 // Transformer 51 virtual Transformer* Clone(VertexSource& source) const = 0; 52 53 virtual void rewind(unsigned path_id); 54 virtual unsigned vertex(double* x, double* y); 55 56 virtual void SetSource(VertexSource& source); 57 58 virtual bool WantsOpenPaths() const; 59 virtual double ApproximationScale() const; 60 61 protected: 62 VertexSource& fSource; 63 }; 64 65 } // namespace Icon 66 } // namespace BPrivate 67 68 #endif // TRANSFORMER_H 69