-
Notifications
You must be signed in to change notification settings - Fork 0
/
SVGContainers.h
154 lines (110 loc) · 3.84 KB
/
SVGContainers.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
#ifndef _SVG_CONTAINERS_H_
#define _SVG_CONTAINERS_H_
#include "SVGElement.h"
#include "SVGPaintServer.h"
class BSVGDocument : public BSVGElement {
public:
BSVGDocument();
BSVGDocument(BSVGView *parent);
BSVGDocument(BSVGView *parent, const BString &data);
BSVGDocument(BMessage *data);
static BArchivable *Instantiate(BMessage *data);
virtual status_t Archive(BMessage *data, bool deep = true) const;
virtual void HandleAttribute(attribute_s *attr);
virtual element_t Type() { return B_SVG_DOCUMENT; };
virtual void CollectData(BString &into, int32 indentlevel = 0);
virtual void RecreateData();
};
class BSVGRoot : public BSVGElement {
public:
BSVGRoot();
BSVGRoot(BSVGView *parent);
BSVGRoot(BSVGView *parent, const BString &data);
BSVGRoot(BMessage *data);
static BArchivable *Instantiate(BMessage *data);
virtual status_t Archive(BMessage *data, bool deep = true) const;
virtual void HandleAttribute(attribute_s *attr);
virtual element_t Type() { return B_SVG_ROOT; };
virtual void RecreateData();
virtual void PrepareRendering(SVGState *inherit = NULL);
private:
BPoint fTranslate;
};
class BSVGGroup : public BSVGElement {
public:
BSVGGroup();
BSVGGroup(BSVGView *parent);
BSVGGroup(BSVGView *parent, const BString &data);
BSVGGroup(BMessage *data);
static BArchivable *Instantiate(BMessage *data);
virtual status_t Archive(BMessage *data, bool deep = true) const;
virtual element_t Type() { return B_SVG_GROUP; };
virtual void RecreateData();
};
class BSVGDefs : public BSVGElement {
public:
BSVGDefs();
BSVGDefs(BSVGView *parent);
BSVGDefs(BSVGView *parent, const BString &data);
BSVGDefs(BMessage *data);
static BArchivable *Instantiate(BMessage *data);
virtual status_t Archive(BMessage *data, bool deep = true) const;
virtual element_t Type() { return B_SVG_DEFS; };
virtual void CollectBounds(BRect &bounds, bool *first);
virtual void RecreateData();
private:
virtual void Render(BView *view);
virtual void Render(BWindow *window);
virtual void Render(BBitmap *bitmap);
virtual void RenderCommon();
};
class BSVGPattern : public BSVGPaintServer {
public:
BSVGPattern();
BSVGPattern(BSVGView *parent);
BSVGPattern(BSVGView *parent, const BString &data);
BSVGPattern(BMessage *data);
static BArchivable *Instantiate(BMessage *data);
virtual status_t Archive(BMessage *data, bool deep = true) const;
virtual void HandleAttribute(attribute_s *attr);
virtual element_t Type() { return B_SVG_PATTERN; };
virtual void CollectBounds(BRect &bounds, bool *first);
virtual void RecreateData();
void SetContentUnits(units_t units);
units_t ContentUnits() const;
virtual void PrepareRendering(SVGState *inherit);
virtual void ApplyPaint(BView *view);
virtual void ApplyPaint(BBitmap *bitmap);
private:
virtual void Render(BView *view);
virtual void Render(BWindow *window);
virtual void Render(BBitmap *bitmap);
virtual void RenderCommon();
units_t fContentUnits;
float fX;
float fY;
float fWidth;
float fHeight;
};
class BSVGUse : public BSVGGroup {
public:
BSVGUse();
BSVGUse(BSVGView *parent);
BSVGUse(BSVGView *parent, const BString &data);
virtual ~BSVGUse();
BSVGUse(BMessage *data);
static BArchivable *Instantiate(BMessage *data);
virtual status_t Archive(BMessage *data, bool deep = true) const;
virtual void HandleAttribute(attribute_s *attr);
virtual element_t Type() { return B_SVG_USE; };
virtual void RecreateData();
virtual void CollectData(BString &into, int32 indentlevel);
virtual void PrepareRendering(SVGState *inherit = NULL);
virtual void Render(BView *view);
virtual void Render(BWindow *window);
virtual void Render(BBitmap *bitmap);
virtual void RenderCommon();
private:
BPoint fTranslate;
};
#endif