diff options
| author | Jean-François Milants <jf@codingfield.com> | 2023-12-10 18:35:19 +0100 |
|---|---|---|
| committer | JF <JF002@users.noreply.github.com> | 2023-12-21 20:49:22 +0100 |
| commit | 39bc166e549e8ccae75468aa2dd3613d51f54e27 (patch) | |
| tree | f4f995bf75e1a8e6bd9db9d1e84b225f3c53d686 /src/displayapp/Apps.h | |
| parent | a544da9ed174bc184176ae50bedda5dd51c06021 (diff) | |
Watch face selection at build time
Watch faces can now be selected at buid time. It's implemented in a similar way than the selection of user apps, using a list of watch face description that is generated at build time (consteval, constexpr)
Diffstat (limited to 'src/displayapp/Apps.h')
| -rw-r--r-- | src/displayapp/Apps.h | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/src/displayapp/Apps.h b/src/displayapp/Apps.h index f65fd2cf..097b530e 100644 --- a/src/displayapp/Apps.h +++ b/src/displayapp/Apps.h @@ -1,9 +1,10 @@ #pragma once #include <cstddef> +#include <cstdint> namespace Pinetime { namespace Applications { - enum class Apps { + enum class Apps : uint8_t { None, Launcher, Clock, @@ -42,14 +43,31 @@ namespace Pinetime { Weather }; + enum class WatchFace : uint8_t { + Digital = 0, + Analog = 1, + PineTimeStyle = 2, + Terminal = 3, + Infineat = 4, + CasioStyleG7710 = 5, + }; + template <Apps> struct AppTraits {}; + template <WatchFace> + struct WatchFaceTraits {}; + template <Apps... As> struct TypeList { static constexpr size_t Count = sizeof...(As); }; + template <WatchFace... Ws> + struct WatchFaceTypeList { + static constexpr size_t Count = sizeof...(Ws); + }; + using UserAppTypes = TypeList<Apps::StopWatch, Apps::Alarm, Apps::Timer, @@ -66,5 +84,14 @@ namespace Pinetime { Apps::Motion */ >; + + using UserWatchFaceTypes = WatchFaceTypeList<WatchFace::Digital, + WatchFace::Analog, + WatchFace::PineTimeStyle, + WatchFace::Terminal, + WatchFace::Infineat, + WatchFace::CasioStyleG7710>; + + static_assert(UserWatchFaceTypes::Count >= 1); } } |
