HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
text_decoration.hpp
1// Copyright Take Vos 2021.
2// Distributed under the Boost Software License, Version 1.0.
3// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
4
5#pragma once
6
7#include "../utility/utility.hpp"
8#include "../macros.hpp"
9#include <unordered_map>
10#include <string>
11#include <ostream>
12
13hi_export_module(hikogui.text.text_decoration);
14
15
16hi_export namespace hi::inline v1 {
17
24enum class text_decoration {
25 None,
26 Underline,
27 WavyUnderline,
28 StrikeThrough
29};
30
31// clang-format off
32constexpr auto text_decoration_metadata = enum_metadata{
33 text_decoration::None, "none",
34 text_decoration::Underline, "underline",
35 text_decoration::WavyUnderline, "wavy-underline",
36 text_decoration::StrikeThrough, "strike-through"
37};
38// clang-format on
39
40[[nodiscard]] inline std::string_view to_string(text_decoration const &rhs) noexcept
41{
42 return text_decoration_metadata[rhs];
43}
44
45inline std::ostream &operator<<(std::ostream &lhs, text_decoration const &rhs)
46{
47 return lhs << text_decoration_metadata[rhs];
48}
49
50} // namespace hi::inline v1
DOXYGEN BUG.
Definition algorithm_misc.hpp:20
text_decoration
Describes how a grapheme should be underlined when rendering the text.
Definition text_decoration.hpp:24
T to_string(T... args)