From 39bc166e549e8ccae75468aa2dd3613d51f54e27 Mon Sep 17 00:00:00 2001 From: Jean-François Milants Date: Sun, 10 Dec 2023 18:35:19 +0100 Subject: 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) --- src/displayapp/Apps.h | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'src/displayapp/Apps.h') 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 +#include 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 struct AppTraits {}; + template + struct WatchFaceTraits {}; + template struct TypeList { static constexpr size_t Count = sizeof...(As); }; + template + struct WatchFaceTypeList { + static constexpr size_t Count = sizeof...(Ws); + }; + using UserAppTypes = TypeList; + + using UserWatchFaceTypes = WatchFaceTypeList; + + static_assert(UserWatchFaceTypes::Count >= 1); } } -- cgit v1.2.3-70-g09d2