screens: Remove explicit Screen constructors

This constructor didn't do anything since DisplayApp reference was
removed from the Screen base class.
This commit is contained in:
Riku Isokoski 2023-02-22 22:18:15 +02:00
parent 7c7a8602c4
commit c78211952e
33 changed files with 32 additions and 44 deletions

View File

@ -45,7 +45,7 @@ Alarm::Alarm(DisplayApp* app,
Controllers::Settings::ClockType clockType, Controllers::Settings::ClockType clockType,
System::SystemTask& systemTask, System::SystemTask& systemTask,
Controllers::MotorController& motorController) Controllers::MotorController& motorController)
: Screen(app), alarmController {alarmController}, systemTask {systemTask}, motorController {motorController} { : alarmController {alarmController}, systemTask {systemTask}, motorController {motorController} {
hourCounter.Create(); hourCounter.Create();
lv_obj_align(hourCounter.GetObject(), nullptr, LV_ALIGN_IN_TOP_LEFT, 0, 0); lv_obj_align(hourCounter.GetObject(), nullptr, LV_ALIGN_IN_TOP_LEFT, 0, 0);

View File

@ -6,7 +6,7 @@
using namespace Pinetime::Applications::Screens; using namespace Pinetime::Applications::Screens;
BatteryInfo::BatteryInfo(Pinetime::Applications::DisplayApp* app, const Pinetime::Controllers::Battery& batteryController) BatteryInfo::BatteryInfo(Pinetime::Applications::DisplayApp* app, const Pinetime::Controllers::Battery& batteryController)
: Screen(app), batteryController {batteryController} { : batteryController {batteryController} {
batteryPercent = batteryController.PercentRemaining(); batteryPercent = batteryController.PercentRemaining();
batteryVoltage = batteryController.Voltage(); batteryVoltage = batteryController.Voltage();

View File

@ -19,8 +19,7 @@ CheckboxList::CheckboxList(const uint8_t screenID,
uint32_t originalValue, uint32_t originalValue,
std::function<void(uint32_t)> OnValueChanged, std::function<void(uint32_t)> OnValueChanged,
std::array<Item, MaxItems> options) std::array<Item, MaxItems> options)
: Screen(app), : screenID {screenID},
screenID {screenID},
OnValueChanged {std::move(OnValueChanged)}, OnValueChanged {std::move(OnValueChanged)},
options {options}, options {options},
value {originalValue}, value {originalValue},

View File

@ -9,7 +9,7 @@ namespace {
} }
} }
Error::Error(Pinetime::Applications::DisplayApp* app, System::BootErrors error) : Screen(app) { Error::Error(Pinetime::Applications::DisplayApp* app, System::BootErrors error) {
lv_obj_t* warningLabel = lv_label_create(lv_scr_act(), nullptr); lv_obj_t* warningLabel = lv_label_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_text_color(warningLabel, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_ORANGE); lv_obj_set_style_local_text_color(warningLabel, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_ORANGE);

View File

@ -6,7 +6,7 @@
using namespace Pinetime::Applications::Screens; using namespace Pinetime::Applications::Screens;
FirmwareUpdate::FirmwareUpdate(Pinetime::Applications::DisplayApp* app, const Pinetime::Controllers::Ble& bleController) FirmwareUpdate::FirmwareUpdate(Pinetime::Applications::DisplayApp* app, const Pinetime::Controllers::Ble& bleController)
: Screen(app), bleController {bleController} { : bleController {bleController} {
titleLabel = lv_label_create(lv_scr_act(), nullptr); titleLabel = lv_label_create(lv_scr_act(), nullptr);
lv_label_set_text_static(titleLabel, "Firmware update"); lv_label_set_text_static(titleLabel, "Firmware update");

View File

@ -15,7 +15,7 @@ namespace {
} }
FirmwareValidation::FirmwareValidation(Pinetime::Applications::DisplayApp* app, Pinetime::Controllers::FirmwareValidator& validator) FirmwareValidation::FirmwareValidation(Pinetime::Applications::DisplayApp* app, Pinetime::Controllers::FirmwareValidator& validator)
: Screen {app}, validator {validator} { : validator {validator} {
labelVersion = lv_label_create(lv_scr_act(), nullptr); labelVersion = lv_label_create(lv_scr_act(), nullptr);
lv_label_set_text_fmt(labelVersion, lv_label_set_text_fmt(labelVersion,
"Version : %lu.%lu.%lu\n" "Version : %lu.%lu.%lu\n"

View File

@ -17,7 +17,7 @@ namespace {
FlashLight::FlashLight(Pinetime::Applications::DisplayApp* app, FlashLight::FlashLight(Pinetime::Applications::DisplayApp* app,
System::SystemTask& systemTask, System::SystemTask& systemTask,
Controllers::BrightnessController& brightnessController) Controllers::BrightnessController& brightnessController)
: Screen(app), systemTask {systemTask}, brightnessController {brightnessController} { : systemTask {systemTask}, brightnessController {brightnessController} {
brightnessController.Set(Controllers::BrightnessController::Levels::Low); brightnessController.Set(Controllers::BrightnessController::Levels::Low);

View File

@ -31,7 +31,7 @@ namespace {
HeartRate::HeartRate(Pinetime::Applications::DisplayApp* app, HeartRate::HeartRate(Pinetime::Applications::DisplayApp* app,
Controllers::HeartRateController& heartRateController, Controllers::HeartRateController& heartRateController,
System::SystemTask& systemTask) System::SystemTask& systemTask)
: Screen(app), heartRateController {heartRateController}, systemTask {systemTask} { : heartRateController {heartRateController}, systemTask {systemTask} {
bool isHrRunning = heartRateController.State() != Controllers::HeartRateController::States::Stopped; bool isHrRunning = heartRateController.State() != Controllers::HeartRateController::States::Stopped;
label_hr = lv_label_create(lv_scr_act(), nullptr); label_hr = lv_label_create(lv_scr_act(), nullptr);

View File

@ -10,7 +10,7 @@ using namespace Pinetime::Applications::Screens;
InfiniPaint::InfiniPaint(Pinetime::Applications::DisplayApp* app, InfiniPaint::InfiniPaint(Pinetime::Applications::DisplayApp* app,
Pinetime::Components::LittleVgl& lvgl, Pinetime::Components::LittleVgl& lvgl,
Pinetime::Controllers::MotorController& motor) Pinetime::Controllers::MotorController& motor)
: Screen(app), lvgl {lvgl}, motor {motor} { : lvgl {lvgl}, motor {motor} {
std::fill(b, b + bufferSize, selectColor); std::fill(b, b + bufferSize, selectColor);
} }

View File

@ -22,7 +22,7 @@ namespace {
} }
Metronome::Metronome(DisplayApp* app, Controllers::MotorController& motorController, System::SystemTask& systemTask) Metronome::Metronome(DisplayApp* app, Controllers::MotorController& motorController, System::SystemTask& systemTask)
: Screen(app), motorController {motorController}, systemTask {systemTask} { : motorController {motorController}, systemTask {systemTask} {
bpmArc = lv_arc_create(lv_scr_act(), nullptr); bpmArc = lv_arc_create(lv_scr_act(), nullptr);
bpmArc->user_data = this; bpmArc->user_data = this;

View File

@ -6,7 +6,7 @@
using namespace Pinetime::Applications::Screens; using namespace Pinetime::Applications::Screens;
Motion::Motion(Pinetime::Applications::DisplayApp* app, Controllers::MotionController& motionController) Motion::Motion(Pinetime::Applications::DisplayApp* app, Controllers::MotionController& motionController)
: Screen(app), motionController {motionController} { : motionController {motionController} {
chart = lv_chart_create(lv_scr_act(), nullptr); chart = lv_chart_create(lv_scr_act(), nullptr);
lv_obj_set_size(chart, 240, 240); lv_obj_set_size(chart, 240, 240);
lv_obj_align(chart, nullptr, LV_ALIGN_IN_TOP_MID, 0, 0); lv_obj_align(chart, nullptr, LV_ALIGN_IN_TOP_MID, 0, 0);

View File

@ -47,7 +47,7 @@ inline void lv_img_set_src_arr(lv_obj_t* img, const lv_img_dsc_t* src_img) {
* *
* TODO: Investigate Apple Media Service and AVRCPv1.6 support for seamless integration * TODO: Investigate Apple Media Service and AVRCPv1.6 support for seamless integration
*/ */
Music::Music(Pinetime::Applications::DisplayApp* app, Pinetime::Controllers::MusicService& music) : Screen(app), musicService(music) { Music::Music(Pinetime::Applications::DisplayApp* app, Pinetime::Controllers::MusicService& music) : musicService(music) {
lv_obj_t* label; lv_obj_t* label;
lv_style_init(&btn_style); lv_style_init(&btn_style);

View File

@ -130,7 +130,7 @@ namespace {
* *
*/ */
Navigation::Navigation(Pinetime::Applications::DisplayApp* app, Pinetime::Controllers::NavigationService& nav) Navigation::Navigation(Pinetime::Applications::DisplayApp* app, Pinetime::Controllers::NavigationService& nav)
: Screen(app), navService(nav) { : navService(nav) {
imgFlag = lv_label_create(lv_scr_act(), nullptr); imgFlag = lv_label_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_text_font(imgFlag, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &lv_font_navi_80); lv_obj_set_style_local_text_font(imgFlag, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &lv_font_navi_80);

View File

@ -6,7 +6,7 @@
using namespace Pinetime::Applications::Screens; using namespace Pinetime::Applications::Screens;
Paddle::Paddle(Pinetime::Applications::DisplayApp* app, Pinetime::Components::LittleVgl& lvgl) : Screen(app), lvgl {lvgl} { Paddle::Paddle(Pinetime::Applications::DisplayApp* app, Pinetime::Components::LittleVgl& lvgl) : lvgl {lvgl} {
background = lv_obj_create(lv_scr_act(), nullptr); background = lv_obj_create(lv_scr_act(), nullptr);
lv_obj_set_size(background, LV_HOR_RES + 1, LV_VER_RES); lv_obj_set_size(background, LV_HOR_RES + 1, LV_VER_RES);
lv_obj_set_pos(background, -1, 0); lv_obj_set_pos(background, -1, 0);

View File

@ -3,7 +3,7 @@
using namespace Pinetime::Applications::Screens; using namespace Pinetime::Applications::Screens;
PassKey::PassKey(Pinetime::Applications::DisplayApp* app, uint32_t key) : Screen(app) { PassKey::PassKey(Pinetime::Applications::DisplayApp* app, uint32_t key) {
passkeyLabel = lv_label_create(lv_scr_act(), nullptr); passkeyLabel = lv_label_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_text_color(passkeyLabel, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_YELLOW); lv_obj_set_style_local_text_color(passkeyLabel, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_YELLOW);
lv_obj_set_style_local_text_font(passkeyLabel, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_42); lv_obj_set_style_local_text_font(passkeyLabel, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_42);

View File

@ -50,9 +50,6 @@ namespace Pinetime {
} }
public: public:
explicit Screen(DisplayApp* app) {
}
explicit Screen() = default; explicit Screen() = default;
virtual ~Screen() = default; virtual ~Screen() = default;

View File

@ -13,7 +13,7 @@ static void lap_event_handler(lv_obj_t* obj, lv_event_t event) {
Steps::Steps(Pinetime::Applications::DisplayApp* app, Steps::Steps(Pinetime::Applications::DisplayApp* app,
Controllers::MotionController& motionController, Controllers::MotionController& motionController,
Controllers::Settings& settingsController) Controllers::Settings& settingsController)
: Screen(app), motionController {motionController}, settingsController {settingsController} { : motionController {motionController}, settingsController {settingsController} {
stepsArc = lv_arc_create(lv_scr_act(), nullptr); stepsArc = lv_arc_create(lv_scr_act(), nullptr);

View File

@ -33,7 +33,7 @@ namespace {
constexpr TickType_t blinkInterval = pdMS_TO_TICKS(1000); constexpr TickType_t blinkInterval = pdMS_TO_TICKS(1000);
} }
StopWatch::StopWatch(DisplayApp* app, System::SystemTask& systemTask) : Screen(app), systemTask {systemTask} { StopWatch::StopWatch(DisplayApp* app, System::SystemTask& systemTask) : systemTask {systemTask} {
static constexpr uint8_t btnWidth = 115; static constexpr uint8_t btnWidth = 115;
static constexpr uint8_t btnHeight = 80; static constexpr uint8_t btnHeight = 80;
btnPlayPause = lv_btn_create(lv_scr_act(), nullptr); btnPlayPause = lv_btn_create(lv_scr_act(), nullptr);

View File

@ -17,7 +17,7 @@ static void btnEventHandler(lv_obj_t* obj, lv_event_t event) {
} }
} }
Timer::Timer(DisplayApp* app, Controllers::TimerController& timerController) : Screen(app), timerController {timerController} { Timer::Timer(DisplayApp* app, Controllers::TimerController& timerController) : timerController {timerController} {
lv_obj_t* colonLabel = lv_label_create(lv_scr_act(), nullptr); lv_obj_t* colonLabel = lv_label_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_text_font(colonLabel, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_76); lv_obj_set_style_local_text_font(colonLabel, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_76);

View File

@ -5,7 +5,7 @@
using namespace Pinetime::Applications::Screens; using namespace Pinetime::Applications::Screens;
Twos::Twos(Pinetime::Applications::DisplayApp* app) : Screen(app) { Twos::Twos(Pinetime::Applications::DisplayApp* app) {
struct colorPair { struct colorPair {
lv_color_t bg; lv_color_t bg;

View File

@ -49,8 +49,7 @@ WatchFaceAnalog::WatchFaceAnalog(Pinetime::Applications::DisplayApp* app,
const Controllers::Ble& bleController, const Controllers::Ble& bleController,
Controllers::NotificationManager& notificationManager, Controllers::NotificationManager& notificationManager,
Controllers::Settings& settingsController) Controllers::Settings& settingsController)
: Screen(app), : currentDateTime {{}},
currentDateTime {{}},
dateTimeController {dateTimeController}, dateTimeController {dateTimeController},
batteryController {batteryController}, batteryController {batteryController},
bleController {bleController}, bleController {bleController},

View File

@ -24,8 +24,7 @@ WatchFaceCasioStyleG7710::WatchFaceCasioStyleG7710(DisplayApp* app,
Controllers::HeartRateController& heartRateController, Controllers::HeartRateController& heartRateController,
Controllers::MotionController& motionController, Controllers::MotionController& motionController,
Controllers::FS& filesystem) Controllers::FS& filesystem)
: Screen(app), : currentDateTime {{}},
currentDateTime {{}},
dateTimeController {dateTimeController}, dateTimeController {dateTimeController},
batteryController {batteryController}, batteryController {batteryController},
bleController {bleController}, bleController {bleController},

View File

@ -22,8 +22,7 @@ WatchFaceDigital::WatchFaceDigital(DisplayApp* app,
Controllers::Settings& settingsController, Controllers::Settings& settingsController,
Controllers::HeartRateController& heartRateController, Controllers::HeartRateController& heartRateController,
Controllers::MotionController& motionController) Controllers::MotionController& motionController)
: Screen(app), : currentDateTime {{}},
currentDateTime {{}},
dateTimeController {dateTimeController}, dateTimeController {dateTimeController},
notificationManager {notificationManager}, notificationManager {notificationManager},
settingsController {settingsController}, settingsController {settingsController},

View File

@ -28,8 +28,7 @@ WatchFaceInfineat::WatchFaceInfineat(DisplayApp* app,
Controllers::Settings& settingsController, Controllers::Settings& settingsController,
Controllers::MotionController& motionController, Controllers::MotionController& motionController,
Controllers::FS& filesystem) Controllers::FS& filesystem)
: Screen(app), : currentDateTime {{}},
currentDateTime {{}},
dateTimeController {dateTimeController}, dateTimeController {dateTimeController},
batteryController {batteryController}, batteryController {batteryController},
bleController {bleController}, bleController {bleController},

View File

@ -51,8 +51,7 @@ WatchFacePineTimeStyle::WatchFacePineTimeStyle(DisplayApp* app,
Controllers::NotificationManager& notificationManager, Controllers::NotificationManager& notificationManager,
Controllers::Settings& settingsController, Controllers::Settings& settingsController,
Controllers::MotionController& motionController) Controllers::MotionController& motionController)
: Screen(app), : currentDateTime {{}},
currentDateTime {{}},
dateTimeController {dateTimeController}, dateTimeController {dateTimeController},
batteryController {batteryController}, batteryController {batteryController},
bleController {bleController}, bleController {bleController},

View File

@ -21,8 +21,7 @@ WatchFaceTerminal::WatchFaceTerminal(DisplayApp* app,
Controllers::Settings& settingsController, Controllers::Settings& settingsController,
Controllers::HeartRateController& heartRateController, Controllers::HeartRateController& heartRateController,
Controllers::MotionController& motionController) Controllers::MotionController& motionController)
: Screen(app), : currentDateTime {{}},
currentDateTime {{}},
dateTimeController {dateTimeController}, dateTimeController {dateTimeController},
batteryController {batteryController}, batteryController {batteryController},
bleController {bleController}, bleController {bleController},

View File

@ -45,8 +45,7 @@ namespace {
} }
SettingChimes::SettingChimes(Pinetime::Applications::DisplayApp* app, Pinetime::Controllers::Settings& settingsController) SettingChimes::SettingChimes(Pinetime::Applications::DisplayApp* app, Pinetime::Controllers::Settings& settingsController)
: Screen(app), : checkboxList(
checkboxList(
0, 0,
1, 1,
app, app,

View File

@ -48,7 +48,7 @@ namespace {
SettingSetDate::SettingSetDate(Pinetime::Applications::DisplayApp* app, SettingSetDate::SettingSetDate(Pinetime::Applications::DisplayApp* app,
Pinetime::Controllers::DateTime& dateTimeController, Pinetime::Controllers::DateTime& dateTimeController,
Pinetime::Applications::Screens::SettingSetDateTime& settingSetDateTime) Pinetime::Applications::Screens::SettingSetDateTime& settingSetDateTime)
: Screen(app), dateTimeController {dateTimeController}, settingSetDateTime {settingSetDateTime} { : dateTimeController {dateTimeController}, settingSetDateTime {settingSetDateTime} {
lv_obj_t* title = lv_label_create(lv_scr_act(), nullptr); lv_obj_t* title = lv_label_create(lv_scr_act(), nullptr);
lv_label_set_text_static(title, "Set current date"); lv_label_set_text_static(title, "Set current date");

View File

@ -29,7 +29,7 @@ SettingSetTime::SettingSetTime(Pinetime::Applications::DisplayApp* app,
Pinetime::Controllers::DateTime& dateTimeController, Pinetime::Controllers::DateTime& dateTimeController,
Pinetime::Controllers::Settings& settingsController, Pinetime::Controllers::Settings& settingsController,
Pinetime::Applications::Screens::SettingSetDateTime& settingSetDateTime) Pinetime::Applications::Screens::SettingSetDateTime& settingSetDateTime)
: Screen(app), dateTimeController {dateTimeController}, settingsController {settingsController}, settingSetDateTime {settingSetDateTime} { : dateTimeController {dateTimeController}, settingsController {settingsController}, settingSetDateTime {settingSetDateTime} {
lv_obj_t* title = lv_label_create(lv_scr_act(), nullptr); lv_obj_t* title = lv_label_create(lv_scr_act(), nullptr);
lv_label_set_text_static(title, "Set current time"); lv_label_set_text_static(title, "Set current time");

View File

@ -18,7 +18,7 @@ SettingShakeThreshold::SettingShakeThreshold(DisplayApp* app,
Controllers::Settings& settingsController, Controllers::Settings& settingsController,
Controllers::MotionController& motionController, Controllers::MotionController& motionController,
System::SystemTask& systemTask) System::SystemTask& systemTask)
: Screen(app), settingsController {settingsController}, motionController {motionController}, systemTask {systemTask} { : settingsController {settingsController}, motionController {motionController}, systemTask {systemTask} {
lv_obj_t* title = lv_label_create(lv_scr_act(), nullptr); lv_obj_t* title = lv_label_create(lv_scr_act(), nullptr);
lv_label_set_text_static(title, "Wake Sensitivity"); lv_label_set_text_static(title, "Wake Sensitivity");

View File

@ -14,7 +14,7 @@ namespace {
} }
SettingSteps::SettingSteps(Pinetime::Applications::DisplayApp* app, Pinetime::Controllers::Settings& settingsController) SettingSteps::SettingSteps(Pinetime::Applications::DisplayApp* app, Pinetime::Controllers::Settings& settingsController)
: Screen(app), settingsController {settingsController} { : settingsController {settingsController} {
lv_obj_t* container1 = lv_cont_create(lv_scr_act(), nullptr); lv_obj_t* container1 = lv_cont_create(lv_scr_act(), nullptr);

View File

@ -43,8 +43,7 @@ namespace {
} }
SettingTimeFormat::SettingTimeFormat(Pinetime::Applications::DisplayApp* app, Pinetime::Controllers::Settings& settingsController) SettingTimeFormat::SettingTimeFormat(Pinetime::Applications::DisplayApp* app, Pinetime::Controllers::Settings& settingsController)
: Screen(app), : checkboxList(
checkboxList(
0, 0,
1, 1,
app, app,

View File

@ -20,7 +20,7 @@ namespace {
} }
SettingWakeUp::SettingWakeUp(Pinetime::Applications::DisplayApp* app, Pinetime::Controllers::Settings& settingsController) SettingWakeUp::SettingWakeUp(Pinetime::Applications::DisplayApp* app, Pinetime::Controllers::Settings& settingsController)
: Screen(app), settingsController {settingsController} { : settingsController {settingsController} {
lv_obj_t* container1 = lv_cont_create(lv_scr_act(), nullptr); lv_obj_t* container1 = lv_cont_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_bg_opa(container1, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_TRANSP); lv_obj_set_style_local_bg_opa(container1, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_TRANSP);