vfs: check userland buffers before reading them.
[haiku.git] / src / libs / icon / transformer / Transformer.h
blobb67c1b8fccaec33fda29b2a7309109b3193f7d72
1 /*
2 * Copyright 2006-2007, Haiku.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Stephan Aßmus <superstippi@gmx.de>
7 */
8 #ifndef TRANSFORMER_H
9 #define TRANSFORMER_H
12 #ifdef ICON_O_MATIC
13 # include "IconObject.h"
14 #else
15 # include <Message.h>
16 # include <SupportDefs.h>
17 #endif
19 #include "IconBuild.h"
22 _BEGIN_ICON_NAMESPACE
25 class VertexSource {
26 public:
27 VertexSource();
28 virtual ~VertexSource();
30 virtual void rewind(unsigned path_id) = 0;
31 virtual unsigned vertex(double* x, double* y) = 0;
33 virtual bool WantsOpenPaths() const = 0;
34 virtual double ApproximationScale() const = 0;
38 #ifdef ICON_O_MATIC
39 class Transformer : public VertexSource,
40 public IconObject {
41 #else
42 class Transformer : public VertexSource {
43 #endif
44 public:
45 Transformer(VertexSource& source,
46 const char* name);
47 Transformer(VertexSource& source,
48 BMessage* archive);
50 virtual ~Transformer();
52 // Transformer
53 virtual Transformer* Clone(VertexSource& source) const = 0;
55 virtual void rewind(unsigned path_id);
56 virtual unsigned vertex(double* x, double* y);
58 virtual void SetSource(VertexSource& source);
60 virtual bool WantsOpenPaths() const;
61 virtual double ApproximationScale() const;
63 protected:
64 VertexSource& fSource;
68 _END_ICON_NAMESPACE
71 #endif // TRANSFORMER_H