diff options
Diffstat (limited to 'include/cru/platform/gui/InputMethod.hpp')
-rw-r--r-- | include/cru/platform/gui/InputMethod.hpp | 51 |
1 files changed, 25 insertions, 26 deletions
diff --git a/include/cru/platform/gui/InputMethod.hpp b/include/cru/platform/gui/InputMethod.hpp index 9b07959c..c259e63c 100644 --- a/include/cru/platform/gui/InputMethod.hpp +++ b/include/cru/platform/gui/InputMethod.hpp @@ -3,7 +3,6 @@ #include "cru/common/Event.hpp" -#include <fmt/format.h> #include <memory> #include <vector> @@ -54,28 +53,28 @@ struct IInputMethodContext : virtual IPlatformResource { }; } // namespace cru::platform::gui -template <> -struct fmt::formatter<cru::platform::gui::CompositionText, char16_t> - : fmt::formatter<std::u16string_view, char16_t> { - auto parse(fmt::basic_format_parse_context<char16_t>& ctx) { - return fmt::formatter<std::u16string_view, char16_t>::parse(ctx); - } - - template <typename FormatContext> - auto format(const cru::platform::gui::CompositionText& ct, - FormatContext& ctx) { - auto output = ctx.out(); - output = format_to(output, u"text: {}\n", ct.text); - output = format_to(output, u"clauses:\n"); - for (gsl::index i = 0; i < static_cast<gsl::index>(ct.clauses.size()); - i++) { - const auto& clause = ct.clauses[i]; - output = - format_to(output, u"\t{}. start: {} end: {}{}\n", i, clause.start, - clause.end, clause.target ? u" target" : u""); - } - output = format_to(output, u"selection: position: {} count: {}", - ct.selection.position, ct.selection.count); - return output; - } -}; +// template <> +// struct fmt::formatter<cru::platform::gui::CompositionText, char16_t> +// : fmt::formatter<std::u16string_view, char16_t> { +// auto parse(fmt::basic_format_parse_context<char16_t>& ctx) { +// return fmt::formatter<std::u16string_view, char16_t>::parse(ctx); +// } + +// template <typename FormatContext> +// auto format(const cru::platform::gui::CompositionText& ct, +// FormatContext& ctx) { +// auto output = ctx.out(); +// output = format_to(output, u"text: {}\n", ct.text); +// output = format_to(output, u"clauses:\n"); +// for (gsl::index i = 0; i < static_cast<gsl::index>(ct.clauses.size()); +// i++) { +// const auto& clause = ct.clauses[i]; +// output = +// format_to(output, u"\t{}. start: {} end: {}{}\n", i, clause.start, +// clause.end, clause.target ? u" target" : u""); +// } +// output = format_to(output, u"selection: position: {} count: {}", +// ct.selection.position, ct.selection.count); +// return output; +// } +// }; |