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

@ -38,6 +38,14 @@ Widget* FocusManager::focus_widget() const {
return focus_widget_;
}
void FocusManager::setMirror(Widget* const mirror_widget) {
mirror_widget_ = mirror_widget;
}
void FocusManager::clearMirror() {
mirror_widget_ = nullptr;
}
void FocusManager::set_focus_widget(Widget* const new_focus_widget) {
// Widget already has focus.
if (new_focus_widget == focus_widget()) {
@ -153,9 +161,12 @@ static int32_t rect_distances(
}
}
void FocusManager::update(
Widget* const top_widget,
const KeyEvent event) {
void FocusManager::update(Widget* const top_widget, const KeyEvent event) {
if (mirror_widget_) {
if (mirror_widget_->on_key(event))
return;
}
if (focus_widget()) {
const auto focus_screen_rect = focus_widget()->screen_rect();