2023-10-23 18:12:34 +00:00
|
|
|
#pragma once
|
|
|
|
#include "Apps.h"
|
|
|
|
#include "Controllers.h"
|
|
|
|
|
|
|
|
#include "displayapp/screens/Alarm.h"
|
|
|
|
#include "displayapp/screens/Timer.h"
|
|
|
|
#include "displayapp/screens/Twos.h"
|
|
|
|
#include "displayapp/screens/Tile.h"
|
|
|
|
#include "displayapp/screens/ApplicationList.h"
|
2023-12-10 17:35:19 +00:00
|
|
|
#include "displayapp/screens/WatchFaceDigital.h"
|
|
|
|
#include "displayapp/screens/WatchFaceAnalog.h"
|
|
|
|
#include "displayapp/screens/WatchFaceCasioStyleG7710.h"
|
|
|
|
#include "displayapp/screens/WatchFaceInfineat.h"
|
|
|
|
#include "displayapp/screens/WatchFacePineTimeStyle.h"
|
|
|
|
#include "displayapp/screens/WatchFaceTerminal.h"
|
2023-10-23 18:12:34 +00:00
|
|
|
|
|
|
|
namespace Pinetime {
|
|
|
|
namespace Applications {
|
|
|
|
namespace Screens {
|
|
|
|
class Screen;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct AppDescription {
|
|
|
|
Apps app;
|
|
|
|
const char* icon;
|
|
|
|
Screens::Screen* (*create)(AppControllers& controllers);
|
|
|
|
};
|
|
|
|
|
2023-12-10 17:35:19 +00:00
|
|
|
struct WatchFaceDescription {
|
|
|
|
WatchFace watchFace;
|
|
|
|
const char* name;
|
|
|
|
Screens::Screen* (*create)(AppControllers& controllers);
|
|
|
|
bool (*isAvailable)(Controllers::FS& fileSystem);
|
|
|
|
};
|
|
|
|
|
2023-10-23 18:12:34 +00:00
|
|
|
template <Apps t>
|
|
|
|
consteval AppDescription CreateAppDescription() {
|
|
|
|
return {AppTraits<t>::app, AppTraits<t>::icon, &AppTraits<t>::Create};
|
|
|
|
}
|
|
|
|
|
2023-12-10 17:35:19 +00:00
|
|
|
template <WatchFace t>
|
|
|
|
consteval WatchFaceDescription CreateWatchFaceDescription() {
|
|
|
|
return {WatchFaceTraits<t>::watchFace, WatchFaceTraits<t>::name, &WatchFaceTraits<t>::Create, &WatchFaceTraits<t>::IsAvailable};
|
|
|
|
}
|
|
|
|
|
2023-11-01 20:06:26 +00:00
|
|
|
template <template <Apps...> typename T, Apps... ts>
|
2023-10-23 18:12:34 +00:00
|
|
|
consteval std::array<AppDescription, sizeof...(ts)> CreateAppDescriptions(T<ts...>) {
|
|
|
|
return {CreateAppDescription<ts>()...};
|
|
|
|
}
|
|
|
|
|
2023-12-10 17:35:19 +00:00
|
|
|
template <template <WatchFace...> typename T, WatchFace... ts>
|
|
|
|
consteval std::array<WatchFaceDescription, sizeof...(ts)> CreateWatchFaceDescriptions(T<ts...>) {
|
|
|
|
return {CreateWatchFaceDescription<ts>()...};
|
|
|
|
}
|
|
|
|
|
2023-10-23 18:12:34 +00:00
|
|
|
constexpr auto userApps = CreateAppDescriptions(UserAppTypes {});
|
2023-12-10 17:35:19 +00:00
|
|
|
constexpr auto userWatchFaces = CreateWatchFaceDescriptions(UserWatchFaceTypes {});
|
2023-10-23 18:12:34 +00:00
|
|
|
}
|
|
|
|
}
|