mirror of
https://github.com/InfiniTimeOrg/InfiniTime.git
synced 2026-05-05 04:06:27 +02:00
Code cleaning : Split displayapp/apps/Apps.h.in into 2 files : Apps.h and WatchFaces.h
This commit is contained in:
parent
73b22aaaa4
commit
45f0d9880c
@ -4,6 +4,7 @@
|
||||
#include "components/brightness/BrightnessController.h"
|
||||
#include "components/fs/FS.h"
|
||||
#include "displayapp/apps/Apps.h"
|
||||
#include "displayapp/apps/WatchFaces.h"
|
||||
|
||||
namespace Pinetime {
|
||||
namespace Controllers {
|
||||
|
||||
@ -45,35 +45,14 @@ namespace Pinetime {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -36,3 +36,4 @@ 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)
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/WatchFaces.h.in ${CMAKE_CURRENT_BINARY_DIR}/WatchFaces.h)
|
||||
|
||||
28
src/displayapp/apps/WatchFaces.h.in
Normal file
28
src/displayapp/apps/WatchFaces.h.in
Normal file
@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
|
||||
namespace Pinetime {
|
||||
namespace Applications {
|
||||
enum class WatchFace : uint8_t {
|
||||
Digital,
|
||||
Analog,
|
||||
PineTimeStyle,
|
||||
Terminal,
|
||||
Infineat,
|
||||
CasioStyleG7710,
|
||||
};
|
||||
|
||||
template <WatchFace T>
|
||||
struct WatchFaceTraits {};
|
||||
|
||||
template <WatchFace... Ws>
|
||||
struct WatchFaceTypeList {
|
||||
static constexpr size_t Count = sizeof...(Ws);
|
||||
};
|
||||
|
||||
using UserWatchFaceTypes = WatchFaceTypeList<@WATCHFACE_TYPES@>;
|
||||
|
||||
static_assert(UserWatchFaceTypes::Count >= 1);
|
||||
}
|
||||
}
|
||||
@ -11,6 +11,8 @@
|
||||
#include "components/ble/NotificationManager.h"
|
||||
#include "displayapp/screens/BatteryIcon.h"
|
||||
#include "utility/DirtyValue.h"
|
||||
#include "displayapp/apps/WatchFaces.h"
|
||||
|
||||
|
||||
namespace Pinetime {
|
||||
namespace Controllers {
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
#include "components/datetime/DateTimeController.h"
|
||||
#include "components/ble/BleController.h"
|
||||
#include "utility/DirtyValue.h"
|
||||
#include "displayapp/apps/Apps.h"
|
||||
#include "displayapp/apps/WatchFaces.h"
|
||||
|
||||
namespace Pinetime {
|
||||
namespace Controllers {
|
||||
|
||||
@ -10,7 +10,8 @@
|
||||
#include "components/ble/BleController.h"
|
||||
#include "displayapp/widgets/StatusIcons.h"
|
||||
#include "utility/DirtyValue.h"
|
||||
#include "displayapp/apps/Apps.h"
|
||||
#include "displayapp/apps/WatchFaces.h"
|
||||
|
||||
|
||||
namespace Pinetime {
|
||||
namespace Controllers {
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
#include "displayapp/screens/Screen.h"
|
||||
#include "components/datetime/DateTimeController.h"
|
||||
#include "utility/DirtyValue.h"
|
||||
#include "displayapp/apps/Apps.h"
|
||||
#include "displayapp/apps/WatchFaces.h"
|
||||
|
||||
namespace Pinetime {
|
||||
namespace Controllers {
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
#include "displayapp/screens/Screen.h"
|
||||
#include "components/datetime/DateTimeController.h"
|
||||
#include "utility/DirtyValue.h"
|
||||
#include "displayapp/apps/WatchFaces.h"
|
||||
|
||||
namespace Pinetime {
|
||||
namespace Controllers {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user