HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
device_type.hpp
1
2
3#pragma once
4
5#include "enum_metadata.hpp"
6
7namespace hi { inline namespace v1 {
8
14enum class device_type : unsigned char {
15 desktop = 120, // low density display
16 server = 121,
17 watch = 160, // medium density display
18 phone = 161,
19 tablet = 162,
20 game_console = 208, // (1.33 * medium density display) & 0xf8
21 television = 209,
22};
23
24// clang-format off
25constexpr auto device_type_metadata = enum_metadata{
26 device_type::desktop, "desktop",
27 device_type::server, "server",
28 device_type::watch, "watch",
29 device_type::phone, "phone",
30 device_type::tablet, "tablet",
31 device_type::game_console, "game console",
32 device_type::television, "television"
33};
34// clang-format on
35
36}}
37
38// XXX #617 MSVC bug does not handle partial specialization in modules.
39hi_export template<>
40struct std::formatter<hi::device_type, char> : std::formatter<std::string_view, char> {
41 auto format(hi::device_type const& t, auto& fc) const
42 {
43 return std::formatter<std::string_view, char>::format(hi::device_type_metadata[t], fc);
44 }
45};
46
The HikoGUI namespace.
Definition array_generic.hpp:20
device_type
The device type this application is running on.
Definition device_type.hpp:14
DOXYGEN BUG.
Definition algorithm_misc.hpp:20