mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-07 14:12:31 -04:00
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:
parent
5a0066963e
commit
dcaa02c1e1
18 changed files with 667 additions and 24 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue