|
Ersa Wearable Platform
Embedded smartwatch firmware and application framework
|
#include <application.h>


Public Member Functions | |
| virtual | ~Application ()=default |
| virtual const char * | getId () const =0 |
| virtual const char * | getTitle () const =0 |
| virtual void | onCreate () |
| virtual void | onStart () |
| virtual void | onResume () |
| virtual void | onPause () |
| virtual void | onStop () |
| virtual void | onDestroy () |
| virtual void | onEnter () |
| virtual void | onExit () |
| void | onEvent (const events::Event &event) override |
| virtual void | render (hal::IDisplay &display, bool fullRefresh) |
| virtual void | render (ui::Canvas &canvas) |
| virtual Rect | getPartialBounds () const |
| virtual void | tick () |
Public Member Functions inherited from ersa::events::IEventListener | |
| virtual | ~IEventListener ()=default |
Base contract for a screen or watchface that can be selected by the UI.
The manager owns navigation, lifecycle dispatch, refresh scheduling, and event delivery; an application owns only its screen state and behavior. Implementations are statically linked into the firmware, so IDs are stable navigation keys rather than runtime package names. Keep callbacks bounded: long radio or storage operations belong in a service/task, not the UI loop.
|
virtualdefault |
Destroy through the base interface when application ownership ends.
|
pure virtual |
Return a stable, unique, null-terminated navigation key.
Implemented in ersa::app::Watchface, ersa::watchface::AppWatchface, TestAppA, and TestAppB.
|
inlinevirtual |
Return the smallest display rectangle that may have changed. The UI uses this to limit partial e-paper refreshes and reduce visible flashing; return the whole panel when the changed region cannot be bounded. The default describes the 200 by 200 reference canvas and is conservative for the current product; other geometries should provide their own.
Reimplemented in ersa::watchface::AppWatchface.
|
pure virtual |
Return the user-facing name shown by the app drawer.
Implemented in ersa::app::Watchface, ersa::watchface::AppWatchface, TestAppA, and TestAppB.
|
inlinevirtual |
|
inlinevirtual |
Called when the manager permanently removes this app. Free app-owned resources and unregister any remaining listeners. Static firmware apps normally live for an entire boot, so this callback is uncommon.
|
inlinevirtual |
Compatibility hook for adapters using the earlier enter/exit lifecycle. New app code should use onStart() and onResume(); this no-op remains so existing adapters continue to compile.
Reimplemented in ersa::watchface::AppWatchface.
|
inlineoverridevirtual |
Receive a normalized system or input event while this app is active. Override this to translate button, clock, battery, and companion events into app state changes. Payloads are copied values, so app logic does not need to depend on the device driver that produced the event. The base implementation intentionally ignores events for static screens.
Implements ersa::events::IEventListener.
Reimplemented in ersa::watchface::AppWatchface, and TestAppA.
|
inlinevirtual |
Compatibility counterpart of onEnter(); prefer onPause() or onStop().
Reimplemented in ersa::watchface::AppWatchface.
|
inlinevirtual |
Called before another screen temporarily covers this app. Stop animations and polling, and release temporary wake/performance leases. The manager retains the app instance, so this is not destruction.
Reimplemented in TestAppA.
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
Called when navigation leaves this app. Release foreground-only resources and callbacks. Use onPause() for a temporary cover and onDestroy() only when the manager permanently removes the object.
Reimplemented in TestAppA.
|
inlinevirtual |
Render through the display HAL. fullRefresh requests a panel-wide update when the hardware supports a distinct full-refresh waveform. The UI calls this only when content is dirty. Draw into the framebuffer; the display manager owns physical refresh timing and panel power so app code stays independent of e-paper driver APIs.
Reimplemented in TestAppA, and ersa::watchface::AppWatchface.
|
inlinevirtual |
Render through the lightweight canvas contract used by watchfaces. This overload supports canvas-oriented apps; override the overload used by the registry adapter for the app being implemented.
Reimplemented in ersa::app::Watchface.
|
inlinevirtual |
Perform short periodic work while this application is active. The manager invokes this from the UI task, so return promptly. Use a service or worker for network, filesystem, or radio operations and let tick() consume their completed results instead of waiting for I/O.