diff options
Diffstat (limited to 'src/displayapp/apps')
| -rw-r--r-- | src/displayapp/apps/Apps.h.in | 80 | ||||
| -rw-r--r-- | src/displayapp/apps/CMakeLists.txt | 39 |
2 files changed, 119 insertions, 0 deletions
diff --git a/src/displayapp/apps/Apps.h.in b/src/displayapp/apps/Apps.h.in new file mode 100644 index 00000000..e697096a --- /dev/null +++ b/src/displayapp/apps/Apps.h.in @@ -0,0 +1,80 @@ +#pragma once +#include <cstddef> +#include <cstdint> + +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, + Calculator, + Steps, + Dice, + Weather, + PassKey, + QuickSettings, + Settings, + SettingWatchFace, + SettingTimeFormat, + SettingWeatherFormat, + SettingDisplay, + SettingWakeUp, + SettingSteps, + SettingSetDateTime, + SettingChimes, + SettingShakeThreshold, + SettingBluetooth, + Error + }; + + enum class WatchFace : uint8_t { + Digital, + Analog, + PineTimeStyle, + Terminal, + Infineat, + CasioStyleG7710, + }; + + template <Apps> + struct AppTraits {}; + + template <WatchFace> + struct WatchFaceTraits {}; + + template <Apps... As> + struct TypeList { + static constexpr size_t Count = sizeof...(As); + }; + + using UserAppTypes = TypeList<@USERAPP_TYPES@>; + + template <WatchFace... Ws> + struct WatchFaceTypeList { + static constexpr size_t Count = sizeof...(Ws); + }; + + using UserWatchFaceTypes = WatchFaceTypeList<@WATCHFACE_TYPES@>; + + 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..33e54323 --- /dev/null +++ b/src/displayapp/apps/CMakeLists.txt @@ -0,0 +1,39 @@ +if(DEFINED ENABLE_USERAPPS) + set(USERAPP_TYPES ${ENABLE_USERAPPS} CACHE STRING "List of user apps to build into the firmware") +else () + set(DEFAULT_USER_APP_TYPES "Apps::StopWatch") + set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Alarm") + set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Timer") + set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Steps") + set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::HeartRate") + set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Music") + set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Paint") + set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Paddle") + set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Twos") + set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Dice") + set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Metronome") + set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Navigation") + set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Calculator") + set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Weather") + #set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Motion") + set(USERAPP_TYPES "${DEFAULT_USER_APP_TYPES}" CACHE STRING "List of user apps to build into the firmware") +endif () + +if(DEFINED ENABLE_WATCHFACES) + set(WATCHFACE_TYPES ${ENABLE_WATCHFACES} CACHE STRING "List of watch faces to build into the firmware") +else() + set(DEFAULT_WATCHFACE_TYPES "WatchFace::Digital") + set(DEFAULT_WATCHFACE_TYPES "${DEFAULT_WATCHFACE_TYPES}, WatchFace::Analog") + set(DEFAULT_WATCHFACE_TYPES "${DEFAULT_WATCHFACE_TYPES}, WatchFace::PineTimeStyle") + set(DEFAULT_WATCHFACE_TYPES "${DEFAULT_WATCHFACE_TYPES}, WatchFace::Terminal") + set(DEFAULT_WATCHFACE_TYPES "${DEFAULT_WATCHFACE_TYPES}, WatchFace::Infineat") + set(DEFAULT_WATCHFACE_TYPES "${DEFAULT_WATCHFACE_TYPES}, WatchFace::CasioStyleG7710") + set(WATCHFACE_TYPES "${DEFAULT_WATCHFACE_TYPES}" CACHE STRING "List of watch faces to build into the firmware") +endif() + +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) |
