2020-08-21 09:55:59 +00:00
|
|
|
#pragma once
|
|
|
|
|
2020-11-15 15:49:36 +00:00
|
|
|
#include <lvgl/lvgl.h>
|
2020-08-21 09:55:59 +00:00
|
|
|
#include <cstdint>
|
2021-11-03 22:02:30 +00:00
|
|
|
#include <algorithm> // std::fill
|
2021-10-13 20:08:35 +00:00
|
|
|
#include "displayapp/screens/Screen.h"
|
2021-12-02 20:42:56 +00:00
|
|
|
#include "components/motor/MotorController.h"
|
2020-08-21 09:55:59 +00:00
|
|
|
|
|
|
|
namespace Pinetime {
|
2020-11-15 15:49:36 +00:00
|
|
|
namespace Components {
|
|
|
|
class LittleVgl;
|
|
|
|
}
|
2020-08-21 09:55:59 +00:00
|
|
|
namespace Applications {
|
|
|
|
namespace Screens {
|
2020-11-15 15:49:36 +00:00
|
|
|
|
2020-10-09 08:35:32 +00:00
|
|
|
class InfiniPaint : public Screen {
|
2021-04-24 09:00:45 +00:00
|
|
|
public:
|
2021-10-31 20:23:43 +00:00
|
|
|
InfiniPaint(DisplayApp* app, Pinetime::Components::LittleVgl& lvgl, Controllers::MotorController& motor);
|
2020-11-15 15:49:36 +00:00
|
|
|
|
2020-10-09 08:35:32 +00:00
|
|
|
~InfiniPaint() override;
|
2020-11-15 15:49:36 +00:00
|
|
|
|
2020-10-09 08:35:32 +00:00
|
|
|
bool OnTouchEvent(TouchEvents event) override;
|
2020-11-15 15:49:36 +00:00
|
|
|
|
2020-10-09 08:35:32 +00:00
|
|
|
bool OnTouchEvent(uint16_t x, uint16_t y) override;
|
2020-11-15 15:49:36 +00:00
|
|
|
|
2021-04-24 09:00:45 +00:00
|
|
|
private:
|
2020-10-09 08:35:32 +00:00
|
|
|
Pinetime::Components::LittleVgl& lvgl;
|
2021-10-31 20:23:43 +00:00
|
|
|
Controllers::MotorController& motor;
|
2020-10-09 08:35:32 +00:00
|
|
|
static constexpr uint16_t width = 10;
|
|
|
|
static constexpr uint16_t height = 10;
|
|
|
|
static constexpr uint16_t bufferSize = width * height;
|
|
|
|
lv_color_t b[bufferSize];
|
2021-04-04 02:08:51 +00:00
|
|
|
lv_color_t selectColor = LV_COLOR_WHITE;
|
|
|
|
uint8_t color = 2;
|
2020-08-21 09:55:59 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|