Fix code formatting
This commit is contained in:
parent
97ba1a456d
commit
473d9c4fa4
21 changed files with 73 additions and 25 deletions
|
@ -40,6 +40,7 @@ namespace Pinetime {
|
|||
Error,
|
||||
Weather
|
||||
};
|
||||
|
||||
template <Apps>
|
||||
struct AppTraits {};
|
||||
|
||||
|
|
|
@ -1,11 +1,14 @@
|
|||
#pragma once
|
||||
|
||||
namespace Pinetime {
|
||||
namespace Applications {
|
||||
class DisplayApp;
|
||||
}
|
||||
|
||||
namespace Components {
|
||||
class LittleVgl;
|
||||
}
|
||||
|
||||
namespace Controllers {
|
||||
class Battery;
|
||||
class Ble;
|
||||
|
@ -23,9 +26,11 @@ namespace Pinetime {
|
|||
class MusicService;
|
||||
class NavigationService;
|
||||
}
|
||||
|
||||
namespace System {
|
||||
class SystemTask;
|
||||
}
|
||||
|
||||
namespace Applications {
|
||||
struct AppControllers {
|
||||
const Pinetime::Controllers::Battery& batteryController;
|
||||
|
|
|
@ -98,11 +98,24 @@ DisplayApp::DisplayApp(Drivers::St7789& lcd,
|
|||
filesystem {filesystem},
|
||||
lvgl {lcd, filesystem},
|
||||
timer(this, TimerCallback),
|
||||
controllers{
|
||||
batteryController, bleController, dateTimeController, notificationManager, heartRateController,
|
||||
settingsController, motorController, motionController, alarmController, brightnessController,
|
||||
nullptr, filesystem, timer, nullptr, this, lvgl, nullptr, nullptr}
|
||||
{
|
||||
controllers {batteryController,
|
||||
bleController,
|
||||
dateTimeController,
|
||||
notificationManager,
|
||||
heartRateController,
|
||||
settingsController,
|
||||
motorController,
|
||||
motionController,
|
||||
alarmController,
|
||||
brightnessController,
|
||||
nullptr,
|
||||
filesystem,
|
||||
timer,
|
||||
nullptr,
|
||||
this,
|
||||
lvgl,
|
||||
nullptr,
|
||||
nullptr} {
|
||||
}
|
||||
|
||||
void DisplayApp::Start(System::BootErrors error) {
|
||||
|
@ -421,8 +434,7 @@ void DisplayApp::LoadScreen(Apps app, DisplayApp::FullRefreshDirections directio
|
|||
dateTimeController,
|
||||
filesystem,
|
||||
std::move(apps));
|
||||
}
|
||||
break;
|
||||
} break;
|
||||
case Apps::Clock:
|
||||
currentScreen = std::make_unique<Screens::Clock>(dateTimeController,
|
||||
batteryController,
|
||||
|
|
|
@ -73,7 +73,6 @@ namespace Pinetime {
|
|||
void Register(Pinetime::Controllers::MusicService* musicService);
|
||||
void Register(Pinetime::Controllers::NavigationService* NavigationService);
|
||||
|
||||
|
||||
private:
|
||||
TaskHandle_t taskHandle;
|
||||
static void Process(void* instance);
|
||||
|
|
|
@ -65,14 +65,18 @@ namespace Pinetime {
|
|||
Widgets::Counter minuteCounter = Widgets::Counter(0, 59, jetbrains_mono_76);
|
||||
};
|
||||
}
|
||||
|
||||
template <>
|
||||
struct AppTraits<Apps::Alarm> {
|
||||
static constexpr Apps app = Apps::Alarm;
|
||||
static constexpr const char* icon = Screens::Symbols::clock;
|
||||
static Screens::Screen *Create(AppControllers& controllers) { return new Screens::Alarm(controllers.alarmController,
|
||||
|
||||
static Screens::Screen* Create(AppControllers& controllers) {
|
||||
return new Screens::Alarm(controllers.alarmController,
|
||||
controllers.settingsController.GetClockType(),
|
||||
*controllers.systemTask,
|
||||
controllers.motorController); };
|
||||
controllers.motorController);
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,10 +38,12 @@ namespace Pinetime {
|
|||
lv_task_t* taskRefresh;
|
||||
};
|
||||
}
|
||||
|
||||
template <>
|
||||
struct AppTraits<Apps::HeartRate> {
|
||||
static constexpr Apps app = Apps::HeartRate;
|
||||
static constexpr const char* icon = Screens::Symbols::heartBeat;
|
||||
|
||||
static Screens::Screen* Create(AppControllers& controllers) {
|
||||
return new Screens::HeartRate(controllers.heartRateController, *controllers.systemTask);
|
||||
};
|
||||
|
|
|
@ -38,10 +38,12 @@ namespace Pinetime {
|
|||
uint8_t color = 2;
|
||||
};
|
||||
}
|
||||
|
||||
template <>
|
||||
struct AppTraits<Apps::Paint> {
|
||||
static constexpr Apps app = Apps::Paint;
|
||||
static constexpr const char* icon = Screens::Symbols::paintbrush;
|
||||
|
||||
static Screens::Screen* Create(AppControllers& controllers) {
|
||||
return new Screens::InfiniPaint(controllers.lvgl, controllers.motorController);
|
||||
};
|
||||
|
|
|
@ -37,10 +37,12 @@ namespace Pinetime {
|
|||
lv_task_t* taskRefresh;
|
||||
};
|
||||
}
|
||||
|
||||
template <>
|
||||
struct AppTraits<Apps::Metronome> {
|
||||
static constexpr Apps app = Apps::Metronome;
|
||||
static constexpr const char* icon = Screens::Symbols::drum;
|
||||
|
||||
static Screens::Screen* Create(AppControllers& controllers) {
|
||||
return new Screens::Metronome(controllers.motorController, *controllers.systemTask);
|
||||
};
|
||||
|
|
|
@ -32,10 +32,12 @@ namespace Pinetime {
|
|||
lv_task_t* taskRefresh;
|
||||
};
|
||||
}
|
||||
|
||||
template <>
|
||||
struct AppTraits<Apps::Motion> {
|
||||
static constexpr Apps app = Apps::Motion;
|
||||
static constexpr const char* icon = "M";
|
||||
|
||||
static Screens::Screen* Create(AppControllers& controllers) {
|
||||
return new Screens::Motion(controllers.motionController);
|
||||
};
|
||||
|
|
|
@ -85,10 +85,12 @@ namespace Pinetime {
|
|||
/** Watchapp */
|
||||
};
|
||||
}
|
||||
|
||||
template <>
|
||||
struct AppTraits<Apps::Music> {
|
||||
static constexpr Apps app = Apps::Music;
|
||||
static constexpr const char* icon = Screens::Symbols::music;
|
||||
|
||||
static Screens::Screen* Create(AppControllers& controllers) {
|
||||
return new Screens::Music(*controllers.musicService);
|
||||
};
|
||||
|
|
|
@ -58,10 +58,12 @@ namespace Pinetime {
|
|||
lv_task_t* taskRefresh;
|
||||
};
|
||||
}
|
||||
|
||||
template <>
|
||||
struct AppTraits<Apps::Navigation> {
|
||||
static constexpr Apps app = Apps::Navigation;
|
||||
static constexpr const char* icon = Screens::Symbols::map;
|
||||
|
||||
static Screens::Screen* Create(AppControllers& controllers) {
|
||||
return new Screens::Navigation(*controllers.navigationService);
|
||||
};
|
||||
|
|
|
@ -48,10 +48,12 @@ namespace Pinetime {
|
|||
lv_task_t* taskRefresh;
|
||||
};
|
||||
}
|
||||
|
||||
template <>
|
||||
struct AppTraits<Apps::Paddle> {
|
||||
static constexpr Apps app = Apps::Paddle;
|
||||
static constexpr const char* icon = Screens::Symbols::paddle;
|
||||
|
||||
static Screens::Screen* Create(AppControllers& controllers) {
|
||||
return new Screens::Paddle(controllers.lvgl);
|
||||
};
|
||||
|
|
|
@ -42,10 +42,12 @@ namespace Pinetime {
|
|||
lv_task_t* taskRefresh;
|
||||
};
|
||||
}
|
||||
|
||||
template <>
|
||||
struct AppTraits<Apps::Steps> {
|
||||
static constexpr Apps app = Apps::Steps;
|
||||
static constexpr const char* icon = Screens::Symbols::shoe;
|
||||
|
||||
static Screens::Screen* Create(AppControllers& controllers) {
|
||||
return new Screens::Steps(controllers.motionController, controllers.settingsController);
|
||||
};
|
||||
|
|
|
@ -59,10 +59,12 @@ namespace Pinetime {
|
|||
lv_task_t* taskRefresh;
|
||||
};
|
||||
}
|
||||
|
||||
template <>
|
||||
struct AppTraits<Apps::StopWatch> {
|
||||
static constexpr Apps app = Apps::StopWatch;
|
||||
static constexpr const char* icon = Screens::Symbols::stopWatch;
|
||||
|
||||
static Screens::Screen* Create(AppControllers& controllers) {
|
||||
return new Screens::StopWatch(*controllers.systemTask);
|
||||
};
|
||||
|
|
|
@ -50,6 +50,9 @@ namespace Pinetime::Applications{
|
|||
struct AppTraits<Apps::Timer> {
|
||||
static constexpr Apps app = Apps::Timer;
|
||||
static constexpr const char* icon = Screens::Symbols::hourGlass;
|
||||
static Screens::Screen *Create(AppControllers& controllers) { return new Screens::Timer(controllers.timer); };
|
||||
|
||||
static Screens::Screen* Create(AppControllers& controllers) {
|
||||
return new Screens::Timer(controllers.timer);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -36,11 +36,15 @@ namespace Pinetime {
|
|||
bool placeNewTile();
|
||||
};
|
||||
}
|
||||
|
||||
template <>
|
||||
struct AppTraits<Apps::Twos> {
|
||||
static constexpr Apps app = Apps::Twos;
|
||||
static constexpr const char* icon = "2";
|
||||
static Screens::Screen *Create(AppControllers& /*controllers*/) { return new Screens::Twos(); };
|
||||
|
||||
static Screens::Screen* Create(AppControllers& /*controllers*/) {
|
||||
return new Screens::Twos();
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,10 +44,12 @@ namespace Pinetime {
|
|||
std::unique_ptr<Screen> CreateScreenHumidity();
|
||||
};
|
||||
}
|
||||
|
||||
template <>
|
||||
struct AppTraits<Apps::Weather> {
|
||||
static constexpr Apps app = Apps::Weather;
|
||||
static constexpr const char* icon = Screens::Symbols::sun;
|
||||
|
||||
static Screens::Screen* Create(AppControllers& controllers) {
|
||||
return new Screens::Weather(controllers.displayApp, *controllers.weatherController);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue