Loading...
Searching...
No Matches
src
drain
image
SVG.h
1
/*
2
3
MIT License
4
5
Copyright (c) 2023 FMI Open Development / Markus Peura, first.last@fmi.fi
6
7
Permission is hereby granted, free of charge, to any person obtaining a copy
8
of this software and associated documentation files (the "Software"), to deal
9
in the Software without restriction, including without limitation the rights
10
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
copies of the Software, and to permit persons to whom the Software is
12
furnished to do so, subject to the following conditions:
13
14
The above copyright notice and this permission notice shall be included in all
15
copies or substantial portions of the Software.
16
17
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
SOFTWARE.
24
25
*/
26
/*
27
Part of Rack development has been done in the BALTRAD projects part-financed
28
by the European Union (European Regional Development Fund and European
29
Neighbourhood Partnership Instrument, Baltic Sea Region Programme 2007-2013)
30
*/
31
/*
32
* TreeSVG.h
33
*
34
* Created on: Nov, 2024
35
* Author: mpeura
36
*/
37
38
#ifndef DRAIN_SVG
39
#define DRAIN_SVG
40
41
#include <string>
42
43
//#include "drain/Enum.h"
44
#include "drain/util/XML.h"
45
#include "drain/util/Frame.h"
46
// #include "AlignSVG.h"
47
48
49
namespace
drain
{
50
51
namespace
image {
52
53
struct
svg
{
54
55
typedef
float
coord_t;
56
57
enum
tag_t {
58
UNDEFINED=XML::UNDEFINED,
59
COMMENT=XML::COMMENT,
60
CTEXT=XML::CTEXT,
61
SCRIPT=XML::SCRIPT,
62
STYLE=XML::STYLE,
63
STYLE_SELECT=XML::STYLE_SELECT,
64
SCOPE_CURLY=XML::SCOPE_CURLY,
65
SVG=10,
66
CIRCLE, CLIP_PATH, DEFS, DESC, GROUP, IMAGE, LINE, LINEAR_GRADIENT, MASK, METADATA, PATH, POLYGON, RECT, TEXT, TITLE, TSPAN };
67
// check CTEXT, maybe implement in XML
68
69
};
70
71
/*
72
class NodeSVG;
73
74
// typedef drain::UnorderedMultiTree<NodeSVG,false, NodeXML<>::path_t> TreeSVG;
75
typedef DRAIN_XML_TREE(NodeSVG) TreeSVG;
76
77
typedef SelectXML<svg::tag_t> SelectSVG;
78
*/
79
80
}
// image::
81
82
83
84
85
86
87
88
namespace
image {
89
90
91
class
BBoxSVG
:
public
drain::Box
<svg::coord_t> {
92
93
public
:
94
95
inline
96
BBoxSVG
(svg::coord_t x=0, svg::coord_t y=0, svg::coord_t width=0, svg::coord_t height=0) :
drain::Box<svg::coord_t>
(x, y, width, height) {
97
}
98
99
inline
100
BBoxSVG
(
const
BBoxSVG
& bbox) :
drain::Box<svg::coord_t>
(bbox) {
101
}
102
103
BBoxSVG
& operator=(
const
BBoxSVG
&) =
default
;
104
105
106
// New
107
108
109
110
// Future option - also other units!
111
/*
112
bool x_PERCENTAGE = false;
113
bool y_PERCENTAGE = false;
114
bool width_PERCENTAGE = false;
115
bool height_PERCENTAGE = false;
116
*/
117
};
118
119
120
121
122
123
}
// image::
124
125
// template <>
126
// const Enum<image::svg::tag_t>::dict_t Enum<image::svg::tag_t>::dict;
127
DRAIN_ENUM_DICT(image::svg::tag_t);
128
129
DRAIN_ENUM_OSTREAM(image::svg::tag_t)
130
131
132
}
// drain::
133
134
135
136
#endif
// DRAIN_COORDS_SVG
137
drain::image::BBoxSVG
Definition
SVG.h:91
drain
Definition
Data.h:1473
drain::Box
Something that has coordinates (x,y) and dimensions (width, height).
Definition
Frame.h:225
drain::image::svg
Definition
SVG.h:53
Generated by
1.9.8