neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
settings.hpp
Go to the documentation of this file.
1// settings.hpp
2/*
3 neogfx C++ App/Game Engine
4 Copyright (c) 2020 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 <neolib/core/pair.hpp>
28
29namespace neogfx
30{
32}
33
35
36namespace neogfx
37{
38 template <typename Elem, typename Traits>
39 inline std::basic_ostream<Elem, Traits>& operator<<(std::basic_ostream<Elem, Traits>& aStream, const neolib::abstract_t<extended_font>& aExtendedFont)
40 {
41 aStream << "[";
42 aStream << aExtendedFont.first();
43 aStream << ",";
44 aStream << aExtendedFont.second();
45 aStream << "]";
46 return aStream;
47 }
48
49 template <typename Elem, typename Traits>
50 inline std::basic_istream<Elem, Traits>& operator>>(std::basic_istream<Elem, Traits>& aStream, neolib::abstract_t<extended_font>& aExtendedFont)
51 {
52 char ignore;
53 aStream >> ignore;
54 aStream >> aExtendedFont.first();
55 aStream >> ignore;
56 aStream >> aExtendedFont.second();
57 aStream >> ignore;
58 return aStream;
59 }
60
62 using neolib::setting;
68
69 class i_setting_icons : public i_reference_counted
70 {
71 public:
72 typedef i_setting_icons abstract_type;
73 public:
74 virtual ~i_setting_icons() = default;
75 public:
76 virtual i_texture const& default_icon() const = 0;
77 virtual i_texture const& category_icon(i_string const& aCategorySubkey) const = 0;
78 virtual i_texture const& group_icon(i_string const& aGroupSubkey) const = 0;
79 virtual i_texture const& setting_icon(neolib::i_setting const& aSetting) const = 0;
80 };
81
82 class settings : public neolib::settings
83 {
84 typedef neolib::settings base_type;
85 public:
86 settings(std::string const& aFileName = "settings.xml");
87 };
88}
#define define_setting_type(T)
neolib::pair< font_info, text_format > extended_font
Definition settings.hpp:31
typename detail::abstract_type< T >::type abstract_t
Definition neolib.hpp:178