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>
29#include <neogfx/core/units.hpp>
30
31namespace neogfx::file
32{
33 class svg
34 {
35 public:
36 typedef std::string url;
37 typedef std::variant<length, scalar> length_percentage;
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 };
73 {
74 enum class value
75 {
80 FillBox,
83 };
84 };
85
86 struct node;
87 typedef std::vector<std::unique_ptr<node>> nodes;
88 struct node
89 {
91 };
92 struct attribute
93 {
95 {
97 {
98 enum class value
99 {
100 Auto,
101 Baseline,
104 Middle,
105 Central,
106 AfterEdge,
110 Hanging,
112 Top,
113 Center,
114 Bottom
115 };
116 };
118 {
119 enum class value
120 {
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 };
137 {
138 enum class value
139 {
140 Url,
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}
svg(std::string const &aUri)
Definition svg.hpp:152
std::string url
Definition svg.hpp:36
std::variant< length, scalar > length_percentage
Definition svg.hpp:37
std::vector< std::unique_ptr< node > > nodes
Definition svg.hpp:87
std::variant< std::monostate, length_percentage > value_type
Definition svg.hpp:125
std::variant< std::monostate, url, std::pair< std::optional< basic_shape >, std::optional< geometry_box > > > value_type
Definition svg.hpp:144
std::variant< std::monostate, basic_rect< length > > value_type
Definition svg.hpp:134
std::variant< inset, circle, ellipse, polygon, path > value_type
Definition svg.hpp:70