Focus: a lightweight UI framework for resource-constrained embedded systems, inspired by NeXTSTEP’s AppKit
Article excerpt
Joey Castillo’s Focus project is a lightweight, open-source C++ user interface framework designed specifically for resource-constrained, microcontroller-based devices like the ESP32. It replaces fragile, custom Arduino sketches with a robust, object-oriented framework capable of running on hardware with limited RAM. The project draws heavy inspiration from classic Apple UI environments, specifically UIKit from around 2008 […]
Joey Castillo’s Focus project is a lightweight, open-source C++ user interface framework designed specifically for resource-constrained, microcontroller-based devices like the ESP32.
It replaces fragile, custom Arduino sketches with a robust, object-oriented framework capable of running on hardware with limited RAM.
The project draws heavy inspiration from classic Apple UI environments, specifically UIKit from around 2008 and AppKit, to bring a familiar, structured development environment to tiny screens.The framework is the primary software engine driving the interface of Castillo’s popular DIY open-source e-book reader, the Open Book. It provides a complete view hierarchy of views and subviews, paired with view controller objects and lifecycle callbacks to manage screen states efficiently. Focus includes a single-threaded, cooperative task scheduling system that allows microcontrollers to manage multiple app actions without crashing.
Focus comes packed with standard UI controls, such as buttons and toggles, which feature target-action mechanisms and support state-keyed content like distinct pressed and idle visuals. Developers can also utilize navigation stacks for deep menu structures, modal overlays for alerts, full text rendering capabilities, and support for localizable strings.
The entire framework is fully open-source and available for developers to explore or contribute to on Joey Castillo’s GitHub repository.