diff options
Diffstat (limited to 'src/displayapp')
21 files changed, 38 insertions, 0 deletions
diff --git a/src/displayapp/DisplayApp.h b/src/displayapp/DisplayApp.h index 3c1829d5..c1d04cc9 100644 --- a/src/displayapp/DisplayApp.h +++ b/src/displayapp/DisplayApp.h @@ -29,6 +29,7 @@ namespace Pinetime { class Cst816S; class WatchdogView; } + namespace Controllers { class Settings; class Battery; @@ -43,6 +44,7 @@ namespace Pinetime { namespace System { class SystemTask; }; + namespace Applications { class DisplayApp { public: diff --git a/src/displayapp/DisplayAppRecovery.h b/src/displayapp/DisplayAppRecovery.h index 7d4f0fd0..97aaca88 100644 --- a/src/displayapp/DisplayAppRecovery.h +++ b/src/displayapp/DisplayAppRecovery.h @@ -22,6 +22,7 @@ namespace Pinetime { class Cst816S; class WatchdogView; } + namespace Controllers { class Settings; class Battery; @@ -63,9 +64,11 @@ namespace Pinetime { Pinetime::Controllers::TouchHandler& touchHandler, Pinetime::Controllers::FS& filesystem); void Start(); + void Start(Pinetime::System::BootErrors) { Start(); }; + void PushMessage(Pinetime::Applications::Display::Messages msg); void Register(Pinetime::System::SystemTask* systemTask); diff --git a/src/displayapp/DummyLittleVgl.h b/src/displayapp/DummyLittleVgl.h index 05355a97..7a8ae999 100644 --- a/src/displayapp/DummyLittleVgl.h +++ b/src/displayapp/DummyLittleVgl.h @@ -11,6 +11,7 @@ namespace Pinetime { class LittleVgl { public: enum class FullRefreshDirections { None, Up, Down }; + LittleVgl(Pinetime::Drivers::St7789& lcd, Pinetime::Drivers::Cst816S& touchPanel) { } @@ -24,13 +25,17 @@ namespace Pinetime { void FlushDisplay(const lv_area_t* area, lv_color_t* color_p) { } + bool GetTouchPadInfo(lv_indev_data_t* ptr) { return false; } + void SetFullRefresh(FullRefreshDirections direction) { } + void SetNewTapEvent(uint16_t x, uint16_t y) { } + void SetNewTouchPoint(uint16_t x, uint16_t y, bool contact) { } }; diff --git a/src/displayapp/LittleVgl.h b/src/displayapp/LittleVgl.h index 45826165..aedb69d8 100644 --- a/src/displayapp/LittleVgl.h +++ b/src/displayapp/LittleVgl.h @@ -52,9 +52,11 @@ namespace Pinetime { static constexpr uint8_t nbWriteLines = 4; static constexpr uint16_t totalNbLines = 320; static constexpr uint16_t visibleNbLines = 240; + static constexpr uint8_t MaxScrollOffset() { return LV_VER_RES_MAX - nbWriteLines; } + FullRefreshDirections scrollDirection = FullRefreshDirections::None; uint16_t writeOffset = 0; uint16_t scrollOffset = 0; diff --git a/src/displayapp/Messages.h b/src/displayapp/Messages.h index 58df4556..afa7709a 100644 --- a/src/displayapp/Messages.h +++ b/src/displayapp/Messages.h @@ -1,5 +1,6 @@ #pragma once #include <cstdint> + namespace Pinetime { namespace Applications { namespace Display { diff --git a/src/displayapp/screens/CheckboxList.h b/src/displayapp/screens/CheckboxList.h index 48125d4b..359b835e 100644 --- a/src/displayapp/screens/CheckboxList.h +++ b/src/displayapp/screens/CheckboxList.h @@ -15,6 +15,7 @@ namespace Pinetime { class CheckboxList : public Screen { public: static constexpr size_t MaxItems = 4; + struct Item { const char* name; bool enabled; diff --git a/src/displayapp/screens/FirmwareUpdate.h b/src/displayapp/screens/FirmwareUpdate.h index 5156b7ea..cc3b09b2 100644 --- a/src/displayapp/screens/FirmwareUpdate.h +++ b/src/displayapp/screens/FirmwareUpdate.h @@ -8,6 +8,7 @@ namespace Pinetime { namespace Controllers { class Ble; } + namespace Applications { namespace Screens { diff --git a/src/displayapp/screens/HeartRate.h b/src/displayapp/screens/HeartRate.h index 2ad00351..d68133ad 100644 --- a/src/displayapp/screens/HeartRate.h +++ b/src/displayapp/screens/HeartRate.h @@ -11,6 +11,7 @@ namespace Pinetime { namespace Controllers { class HeartRateController; } + namespace Applications { namespace Screens { diff --git a/src/displayapp/screens/InfiniPaint.h b/src/displayapp/screens/InfiniPaint.h index 8c427402..a6b6eb18 100644 --- a/src/displayapp/screens/InfiniPaint.h +++ b/src/displayapp/screens/InfiniPaint.h @@ -10,6 +10,7 @@ namespace Pinetime { namespace Components { class LittleVgl; } + namespace Applications { namespace Screens { diff --git a/src/displayapp/screens/Notifications.h b/src/displayapp/screens/Notifications.h index bdaac7bb..a4d2709b 100644 --- a/src/displayapp/screens/Notifications.h +++ b/src/displayapp/screens/Notifications.h @@ -13,6 +13,7 @@ namespace Pinetime { namespace Controllers { class AlertNotificationService; } + namespace Applications { namespace Screens { @@ -45,9 +46,11 @@ namespace Pinetime { Pinetime::Controllers::AlertNotificationService& alertNotificationService, Pinetime::Controllers::MotorController& motorController); ~NotificationItem(); + bool IsRunning() const { return running; } + void OnCallButtonEvent(lv_obj_t*, lv_event_t event); private: diff --git a/src/displayapp/screens/Paddle.h b/src/displayapp/screens/Paddle.h index 3a30eee6..d62550c4 100644 --- a/src/displayapp/screens/Paddle.h +++ b/src/displayapp/screens/Paddle.h @@ -8,6 +8,7 @@ namespace Pinetime { namespace Components { class LittleVgl; } + namespace Applications { namespace Screens { diff --git a/src/displayapp/screens/Screen.h b/src/displayapp/screens/Screen.h index e72a2368..a2452da5 100644 --- a/src/displayapp/screens/Screen.h +++ b/src/displayapp/screens/Screen.h @@ -7,13 +7,16 @@ namespace Pinetime { namespace Applications { class DisplayApp; + namespace Screens { template <class T> class DirtyValue { public: DirtyValue() = default; // Use NSDMI + explicit DirtyValue(T const& v) : value {v} { } // Use MIL and const-lvalue-ref + bool IsUpdated() { if (this->isUpdated) { this->isUpdated = false; @@ -21,10 +24,12 @@ namespace Pinetime { } return false; } + T const& Get() { this->isUpdated = false; return value; } // never expose a non-const lvalue-ref + DirtyValue& operator=(const T& other) { if (this->value != other) { this->value = other; @@ -46,6 +51,7 @@ namespace Pinetime { public: explicit Screen(DisplayApp* app) : app {app} { } + virtual ~Screen() = default; static void RefreshTaskCallback(lv_task_t* task); @@ -64,6 +70,7 @@ namespace Pinetime { virtual bool OnTouchEvent(TouchEvents event) { return false; } + virtual bool OnTouchEvent(uint16_t x, uint16_t y) { return false; } diff --git a/src/displayapp/screens/ScreenList.h b/src/displayapp/screens/ScreenList.h index ad882948..6c9a2218 100644 --- a/src/displayapp/screens/ScreenList.h +++ b/src/displayapp/screens/ScreenList.h @@ -11,6 +11,7 @@ namespace Pinetime { namespace Screens { enum class ScreenListModes { UpDown, RightLeft, LongPress }; + template <size_t N> class ScreenList : public Screen { public: ScreenList(DisplayApp* app, diff --git a/src/displayapp/screens/Twos.h b/src/displayapp/screens/Twos.h index da935724..15017581 100644 --- a/src/displayapp/screens/Twos.h +++ b/src/displayapp/screens/Twos.h @@ -9,6 +9,7 @@ namespace Pinetime { bool merged = false; unsigned int value = 0; }; + namespace Screens { class Twos : public Screen { public: diff --git a/src/displayapp/screens/WatchFaceAnalog.h b/src/displayapp/screens/WatchFaceAnalog.h index 04d9e711..6e4e88a3 100644 --- a/src/displayapp/screens/WatchFaceAnalog.h +++ b/src/displayapp/screens/WatchFaceAnalog.h @@ -18,6 +18,7 @@ namespace Pinetime { class Ble; class NotificationManager; } + namespace Applications { namespace Screens { diff --git a/src/displayapp/screens/WatchFaceInfineat.h b/src/displayapp/screens/WatchFaceInfineat.h index 6c3c30ba..2dbb0ab3 100644 --- a/src/displayapp/screens/WatchFaceInfineat.h +++ b/src/displayapp/screens/WatchFaceInfineat.h @@ -118,6 +118,7 @@ namespace Pinetime { static constexpr int nLines = 9; static constexpr int nColors = 7; // must match number of colors in InfineatColors + struct InfineatColors { int orange[nLines] = {0xfd872b, 0xdb3316, 0x6f1000, 0xfd7a0a, 0xffffff, 0xffffff, 0xffffff, 0xe85102, 0xea1c00}; int blue[nLines] = {0xe7f8ff, 0x2232d0, 0x182a8b, 0xe7f8ff, 0xffffff, 0xffffff, 0xffffff, 0x5991ff, 0x1636ff}; diff --git a/src/displayapp/screens/settings/SettingChimes.h b/src/displayapp/screens/settings/SettingChimes.h index 3054d06b..3146503b 100644 --- a/src/displayapp/screens/settings/SettingChimes.h +++ b/src/displayapp/screens/settings/SettingChimes.h @@ -23,6 +23,7 @@ namespace Pinetime { Controllers::Settings::ChimesOption chimesOption; const char* name; }; + static constexpr std::array<Option, 3> options = {{{Controllers::Settings::ChimesOption::None, "Off"}, {Controllers::Settings::ChimesOption::Hours, "Every hour"}, {Controllers::Settings::ChimesOption::HalfHours, "Every 30 mins"}}}; diff --git a/src/displayapp/screens/settings/SettingShakeThreshold.h b/src/displayapp/screens/settings/SettingShakeThreshold.h index 43319468..d0979fa6 100644 --- a/src/displayapp/screens/settings/SettingShakeThreshold.h +++ b/src/displayapp/screens/settings/SettingShakeThreshold.h @@ -6,6 +6,7 @@ #include "displayapp/screens/Screen.h" #include <components/motion/MotionController.h> #include "systemtask/SystemTask.h" + namespace Pinetime { namespace Applications { diff --git a/src/displayapp/screens/settings/SettingTimeFormat.h b/src/displayapp/screens/settings/SettingTimeFormat.h index dc0413ec..426dc197 100644 --- a/src/displayapp/screens/settings/SettingTimeFormat.h +++ b/src/displayapp/screens/settings/SettingTimeFormat.h @@ -24,6 +24,7 @@ namespace Pinetime { Controllers::Settings::ClockType clockType; const char* name; }; + static constexpr std::array<Option, 2> options = {{ {Controllers::Settings::ClockType::H12, "12-hour"}, {Controllers::Settings::ClockType::H24, "24-hour"}, diff --git a/src/displayapp/screens/settings/SettingWakeUp.h b/src/displayapp/screens/settings/SettingWakeUp.h index 54282f5d..2a4e7509 100644 --- a/src/displayapp/screens/settings/SettingWakeUp.h +++ b/src/displayapp/screens/settings/SettingWakeUp.h @@ -23,6 +23,7 @@ namespace Pinetime { Controllers::Settings::WakeUpMode wakeUpMode; const char* name; }; + Controllers::Settings& settingsController; static constexpr std::array<Option, 4> options = {{ {Controllers::Settings::WakeUpMode::SingleTap, "Single Tap"}, diff --git a/src/displayapp/widgets/StatusIcons.h b/src/displayapp/widgets/StatusIcons.h index f4a30a80..7d9e3ae3 100644 --- a/src/displayapp/widgets/StatusIcons.h +++ b/src/displayapp/widgets/StatusIcons.h @@ -15,9 +15,11 @@ namespace Pinetime { StatusIcons(Controllers::Battery& batteryController, Controllers::Ble& bleController); void Align(); void Create(); + lv_obj_t* GetObject() { return container; } + void Update(); private: |