From f0e8bb26e94d4fd7c063c2fe5ead76c165cad5a0 Mon Sep 17 00:00:00 2001 From: Jean-François Milants Date: Tue, 19 Dec 2023 17:53:48 +0100 Subject: Watch face selection with CMake Move displayapp/Apps.h into a header only library (to make the integration easier in InfiniSim. --- src/displayapp/apps/Apps.h.in | 99 ++++++++++++++++++++++++++++++++++++++ src/displayapp/apps/CMakeLists.txt | 6 +++ 2 files changed, 105 insertions(+) create mode 100644 src/displayapp/apps/Apps.h.in create mode 100644 src/displayapp/apps/CMakeLists.txt (limited to 'src/displayapp/apps') diff --git a/src/displayapp/apps/Apps.h.in b/src/displayapp/apps/Apps.h.in new file mode 100644 index 00000000..23ad12a3 --- /dev/null +++ b/src/displayapp/apps/Apps.h.in @@ -0,0 +1,99 @@ +#pragma once +#include +#include + +namespace Pinetime { + namespace Applications { + enum class Apps : uint8_t { + None, + Launcher, + Clock, + SysInfo, + FirmwareUpdate, + FirmwareValidation, + NotificationsPreview, + Notifications, + Timer, + Alarm, + FlashLight, + BatteryInfo, + Music, + Paint, + Paddle, + Twos, + HeartRate, + Navigation, + StopWatch, + Metronome, + Motion, + Steps, + PassKey, + QuickSettings, + Settings, + SettingWatchFace, + SettingTimeFormat, + SettingDisplay, + SettingWakeUp, + SettingSteps, + SettingSetDateTime, + SettingChimes, + SettingShakeThreshold, + SettingBluetooth, + Error, + Weather + }; + + enum class WatchFace : uint8_t { + Digital, + Analog, + PineTimeStyle, + Terminal, + Infineat, + CasioStyleG7710, + }; + + template + struct AppTraits {}; + + template + struct WatchFaceTraits {}; + + template + struct TypeList { + static constexpr size_t Count = sizeof...(As); + }; + + using UserAppTypes = TypeList<@USERAPP_TYPES@>; + + template + struct WatchFaceTypeList { + static constexpr size_t Count = sizeof...(Ws); + }; + + using UserAppTypes = TypeList; + + using UserWatchFaceTypes = WatchFaceTypeList; + + static_assert(UserWatchFaceTypes::Count >= 1); + } +} diff --git a/src/displayapp/apps/CMakeLists.txt b/src/displayapp/apps/CMakeLists.txt new file mode 100644 index 00000000..808496e5 --- /dev/null +++ b/src/displayapp/apps/CMakeLists.txt @@ -0,0 +1,6 @@ +add_library(infinitime_apps INTERFACE) +target_sources(infinitime_apps INTERFACE "${CMAKE_CURRENT_BINARY_DIR}/Apps.h") +target_include_directories(infinitime_apps INTERFACE "${CMAKE_CURRENT_BINARY_DIR}/") + +# Generate the list of user apps to be compiled into the firmware +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Apps.h.in ${CMAKE_CURRENT_BINARY_DIR}/Apps.h) \ No newline at end of file -- cgit v1.2.3-70-g09d2