neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
svg.hpp
Go to the documentation of this file.
1
// svg.hpp
2
/*
3
neogfx C++ App/Game Engine
4
Copyright (c) 2021 Leigh Johnston. All Rights Reserved.
5
6
This program is free software: you can redistribute it and / or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation, either version 3 of the License, or
9
(at your option) any later version.
10
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
15
16
You should have received a copy of the GNU General Public License
17
along with this program. If not, see <http://www.gnu.org/licenses/>.
18
*/
19
20
#pragma once
21
22
#include <
neogfx/neogfx.hpp
>
23
#include <vector>
24
#include <memory>
25
#include <variant>
26
#include <optional>
27
#include <string>
28
#include <
neogfx/core/numerical.hpp
>
29
#include <
neogfx/core/units.hpp
>
30
31
namespace
neogfx::file
32
{
33
class
svg
34
{
35
public
:
36
typedef
std::string
url
;
37
typedef
std::variant<length, scalar>
length_percentage
;
38
struct
basic_shape
39
{
40
enum class
value
41
{
42
Inset
,
43
Circle
,
44
Ellipse
,
45
Polygon
,
46
Path
47
};
48
49
struct
inset
50
{
51
// todo
52
};
53
struct
circle
54
{
55
// todo
56
};
57
struct
ellipse
58
{
59
// todo
60
};
61
struct
polygon
62
{
63
// todo
64
};
65
struct
path
66
{
67
// todo
68
};
69
70
typedef
std::variant<inset, circle, ellipse, polygon, path>
value_type
;
71
};
72
struct
geometry_box
73
{
74
enum class
value
75
{
76
MarginBox
,
77
BorderBox
,
78
PaddingBox
,
79
ContentBox
,
80
FillBox
,
81
StrokeBox
,
82
ViewBox
83
};
84
};
85
86
struct
node;
87
typedef
std::vector<std::unique_ptr<node>>
nodes
;
88
struct
node
89
{
90
nodes
children
;
91
};
92
struct
attribute
93
{
94
struct
presentation
95
{
96
struct
alignment_baseline
97
{
98
enum class
value
99
{
100
Auto
,
101
Baseline
,
102
BeforeEdge
,
103
TextBeforeEdge
,
104
Middle
,
105
Central
,
106
AfterEdge
,
107
TextAfterEdge
,
108
Ideographic
,
109
Alphabetic
,
110
Hanging
,
111
Mathematical
,
112
Top
,
113
Center
,
114
Bottom
115
};
116
};
117
struct
baseline_shift
118
{
119
enum class
value
120
{
121
LengthPercentage
,
122
Sub
,
123
Super
124
};
125
typedef
std::variant<std::monostate, length_percentage>
value_type
;
126
};
127
struct
clip
128
{
129
enum class
value
130
{
131
Auto
,
132
Rect
133
};
134
typedef
std::variant<std::monostate, basic_rect<length>>
value_type
;
135
};
136
struct
clip_path
137
{
138
enum class
value
139
{
140
Url
,
141
BasicShapeGeometryBox
,
142
None
143
};
144
typedef
std::variant<std::monostate, url, std::pair<std::optional<basic_shape>, std::optional<geometry_box>>>
value_type
;
145
};
146
};
147
};
148
struct
group
:
node
149
{
150
};
151
public
:
152
svg
(std::string
const
& aUri) {}
153
public
:
154
155
};
156
}
neogfx::file::svg
Definition
svg.hpp:34
neogfx::file::svg::svg
svg(std::string const &aUri)
Definition
svg.hpp:152
neogfx::file::svg::url
std::string url
Definition
svg.hpp:36
neogfx::file::svg::length_percentage
std::variant< length, scalar > length_percentage
Definition
svg.hpp:37
neogfx::file::svg::nodes
std::vector< std::unique_ptr< node > > nodes
Definition
svg.hpp:87
neogfx::file
Definition
gltf.hpp:30
numerical.hpp
neogfx.hpp
neogfx::file::svg::attribute::presentation::alignment_baseline
Definition
svg.hpp:97
neogfx::file::svg::attribute::presentation::alignment_baseline::value
value
Definition
svg.hpp:99
neogfx::file::svg::attribute::presentation::alignment_baseline::value::Auto
@ Auto
neogfx::file::svg::attribute::presentation::alignment_baseline::value::Bottom
@ Bottom
neogfx::file::svg::attribute::presentation::alignment_baseline::value::Central
@ Central
neogfx::file::svg::attribute::presentation::alignment_baseline::value::Mathematical
@ Mathematical
neogfx::file::svg::attribute::presentation::alignment_baseline::value::Center
@ Center
neogfx::file::svg::attribute::presentation::alignment_baseline::value::Ideographic
@ Ideographic
neogfx::file::svg::attribute::presentation::alignment_baseline::value::AfterEdge
@ AfterEdge
neogfx::file::svg::attribute::presentation::alignment_baseline::value::TextBeforeEdge
@ TextBeforeEdge
neogfx::file::svg::attribute::presentation::alignment_baseline::value::TextAfterEdge
@ TextAfterEdge
neogfx::file::svg::attribute::presentation::alignment_baseline::value::Baseline
@ Baseline
neogfx::file::svg::attribute::presentation::alignment_baseline::value::Top
@ Top
neogfx::file::svg::attribute::presentation::alignment_baseline::value::Hanging
@ Hanging
neogfx::file::svg::attribute::presentation::alignment_baseline::value::Middle
@ Middle
neogfx::file::svg::attribute::presentation::alignment_baseline::value::BeforeEdge
@ BeforeEdge
neogfx::file::svg::attribute::presentation::alignment_baseline::value::Alphabetic
@ Alphabetic
neogfx::file::svg::attribute::presentation::baseline_shift
Definition
svg.hpp:118
neogfx::file::svg::attribute::presentation::baseline_shift::value
value
Definition
svg.hpp:120
neogfx::file::svg::attribute::presentation::baseline_shift::value::Super
@ Super
neogfx::file::svg::attribute::presentation::baseline_shift::value::Sub
@ Sub
neogfx::file::svg::attribute::presentation::baseline_shift::value::LengthPercentage
@ LengthPercentage
neogfx::file::svg::attribute::presentation::baseline_shift::value_type
std::variant< std::monostate, length_percentage > value_type
Definition
svg.hpp:125
neogfx::file::svg::attribute::presentation::clip_path
Definition
svg.hpp:137
neogfx::file::svg::attribute::presentation::clip_path::value_type
std::variant< std::monostate, url, std::pair< std::optional< basic_shape >, std::optional< geometry_box > > > value_type
Definition
svg.hpp:144
neogfx::file::svg::attribute::presentation::clip_path::value
value
Definition
svg.hpp:139
neogfx::file::svg::attribute::presentation::clip_path::value::Url
@ Url
neogfx::file::svg::attribute::presentation::clip_path::value::BasicShapeGeometryBox
@ BasicShapeGeometryBox
neogfx::file::svg::attribute::presentation::clip_path::value::None
@ None
neogfx::file::svg::attribute::presentation::clip
Definition
svg.hpp:128
neogfx::file::svg::attribute::presentation::clip::value_type
std::variant< std::monostate, basic_rect< length > > value_type
Definition
svg.hpp:134
neogfx::file::svg::attribute::presentation::clip::value
value
Definition
svg.hpp:130
neogfx::file::svg::attribute::presentation::clip::value::Auto
@ Auto
neogfx::file::svg::attribute::presentation::clip::value::Rect
@ Rect
neogfx::file::svg::attribute::presentation
Definition
svg.hpp:95
neogfx::file::svg::attribute
Definition
svg.hpp:93
neogfx::file::svg::basic_shape::circle
Definition
svg.hpp:54
neogfx::file::svg::basic_shape::ellipse
Definition
svg.hpp:58
neogfx::file::svg::basic_shape::inset
Definition
svg.hpp:50
neogfx::file::svg::basic_shape::path
Definition
svg.hpp:66
neogfx::file::svg::basic_shape::polygon
Definition
svg.hpp:62
neogfx::file::svg::basic_shape
Definition
svg.hpp:39
neogfx::file::svg::basic_shape::value_type
std::variant< inset, circle, ellipse, polygon, path > value_type
Definition
svg.hpp:70
neogfx::file::svg::basic_shape::value
value
Definition
svg.hpp:41
neogfx::file::svg::basic_shape::value::Ellipse
@ Ellipse
neogfx::file::svg::basic_shape::value::Circle
@ Circle
neogfx::file::svg::basic_shape::value::Polygon
@ Polygon
neogfx::file::svg::basic_shape::value::Path
@ Path
neogfx::file::svg::basic_shape::value::Inset
@ Inset
neogfx::file::svg::geometry_box
Definition
svg.hpp:73
neogfx::file::svg::geometry_box::value
value
Definition
svg.hpp:75
neogfx::file::svg::geometry_box::value::MarginBox
@ MarginBox
neogfx::file::svg::geometry_box::value::ContentBox
@ ContentBox
neogfx::file::svg::geometry_box::value::PaddingBox
@ PaddingBox
neogfx::file::svg::geometry_box::value::ViewBox
@ ViewBox
neogfx::file::svg::geometry_box::value::BorderBox
@ BorderBox
neogfx::file::svg::geometry_box::value::StrokeBox
@ StrokeBox
neogfx::file::svg::geometry_box::value::FillBox
@ FillBox
neogfx::file::svg::group
Definition
svg.hpp:149
neogfx::file::svg::node
Definition
svg.hpp:89
neogfx::file::svg::node::children
nodes children
Definition
svg.hpp:90
units.hpp
include
neogfx
support
file
gfx
svg.hpp
Generated by
1.9.8