Public Access
Steps 5 and 6 of M0. - lib/ui (host-tested): ListModel, LineEditor (UTF-8, byte-limited), wrapText, ToastQueue, DialogModel - lib/input (host-tested): KeyMapper turns keyboard state into logical keys (Fn arrows, ` Back, Fn+` Home) and composes accents with opt - src/ui: off-screen 16-bit frame pushed in one transfer (fixes the flicker), Status Bar, list, text, line editor, dialog, Toast widgets, Notifier (Toast + beep + LED), vendored public-domain Latin-1 fonts - Apps: minimal Launcher, Widget demo, Diagnostics (SD erase now behind a confirmation dialog) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EhqxQ49eCju4CzKYNjZzwT
25 lines
684 B
C++
25 lines
684 B
C++
#include "screen.h"
|
|
|
|
#include <M5Cardputer.h>
|
|
|
|
namespace roro {
|
|
|
|
bool Screen::begin() {
|
|
canvas_.setColorDepth(16);
|
|
canvas_.setPsram(false);
|
|
return canvas_.createSprite(theme::kWidth, theme::kHeight) != nullptr;
|
|
}
|
|
|
|
void Screen::render(AppManager& apps, const StatusInfo& status, const Toast* toast) {
|
|
canvas_.fillSprite(theme::kBackground);
|
|
const auto& area = theme::kContent;
|
|
canvas_.setClipRect(area.x, area.y, area.w, area.h);
|
|
apps.foreground().draw(canvas_);
|
|
canvas_.clearClipRect();
|
|
widgets::statusBar(canvas_, status);
|
|
if (toast) widgets::toast(canvas_, *toast);
|
|
canvas_.pushSprite(&M5Cardputer.Display, 0, 0);
|
|
}
|
|
|
|
} // namespace roro
|