External module api (#2290)

* added external module debug view

* integrated module driver into i2c subsystem

* implemented i2c app loader

* added view mirror api

* fixed build

* added i2c to module api

* implemented standalone app touch event

* implemented focus management

* reverted formating change

* refactoring

* refactoring

* implemented events

* fixed memory usage
This commit is contained in:
Bernd Herzog 2024-10-14 13:07:41 +02:00 committed by GitHub
parent 5a0066963e
commit dcaa02c1e1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 667 additions and 24 deletions

View file

@ -31,28 +31,34 @@ namespace ui {
class StandaloneView : public View {
public:
StandaloneView(NavigationView& nav, std::unique_ptr<uint8_t[]> app_image);
virtual ~StandaloneView() override { get_application_information()->shutdown(); }
void focus() override;
StandaloneView(NavigationView& nav, uint8_t* app_image);
virtual ~StandaloneView() override {
}
std::string title() const override { return (const char*)get_application_information()->app_name; };
void focus() override;
void paint(Painter& painter) override;
void on_focus() override;
bool on_key(const KeyEvent key) override;
bool on_encoder(const EncoderEvent event) override;
bool on_touch(const TouchEvent event) override;
bool on_keyboard(const KeyboardEvent event) override;
void on_after_attach() override;
void on_before_detach() override;
void frame_sync();
private:
bool initialized = false;
NavigationView& nav_;
std::unique_ptr<uint8_t[]> _app_image;
uint8_t* _app_image;
standalone_application_information_t* get_application_information() const {
return reinterpret_cast<standalone_application_information_t*>(_app_image.get());
return reinterpret_cast<standalone_application_information_t*>(_app_image);
}
Button dummy{
{240, 0, 0, 0},
""};
MessageHandlerRegistration message_handler_sample{
Message::ID::DisplayFrameSync,
[this](const Message* const) {