FlyUI is a minimal, kernel-side GUI toolkit designed for Chrysalis OS. It provides widgets, event dispatch, and drawing logic while remaining independent from hardware and window management.
- Manage widget trees
- Dispatch input events
- Draw widgets into window surfaces
- Handle focus and redraw logic
- Provide basic widgets
- Create or manage windows
- Access GPU or framebuffer directly
- Handle hardware input
- Perform scheduling
INPUT → WM → FlyUI → Widgets → Surface → Compositor → Framebuffer
FlyUI sits strictly between WM and Compositor.
All UI elements are widgets.
typedef struct FlyWidget {
int x, y, w, h;
bool visible;
bool needs_redraw;
struct FlyWidget* parent;
struct FlyWidget* children;
struct FlyWidget* next;
void (*draw)(struct FlyWidget*);
void (*on_event)(struct FlyWidget*, FlyEvent*);
} FlyWidget;Supported events:
- Mouse move
- Mouse button down/up
- Key down/up
Events are dispatched:
- Hit-test children
- Deliver to top-most widget
- Bubble to parent if unhandled
- Rendering is explicit, not automatic
- A render pass walks the widget tree
- Only widgets marked
needs_redraware redrawn - Drawing is clipped to widget bounds
FlyUI drawing primitives operate on a Surface* provided by the Window Manager.
Supported primitives:
- Rect fill
- Border draw
- Text draw (via existing font system)
- Displays text
- No interaction
- Rectangle with text
- Handles mouse click
- Emits serial log on click
- Container widget
- Used for layout grouping
- No allocation in IRQ context
- Widgets allocated at init time
- All failures logged via serial()
- No blocking operations
FlyUI is designed to be:
- Modder-friendly
- Easy to extend with new widgets
- Portable to userland in the future
- Move FlyUI to userland (
/user/lib/flyui) - Add IPC-based event delivery
- Support themes and skins
- Add advanced widgets