"""Registry mapping a Widget's widget_type to its render/action module -- the widget-system's analogue of routers/device.py's old RENDERERS/ ADVANCE_RENDERERS/BACK_RENDERERS dicts, generalized from "one mode owns the whole panel" to "each widget renders into its own region and optionally responds to named button actions." Each module in this package exposes: render(db, frame, widget, target_w, target_h) -> Image.Image An RGB image exactly target_w x target_h, unquantized -- the widget's content composed into its own region. Never returns packed panel bytes or raises for a foreseeable failure (a widget's own fetch hiccup shows a small placeholder instead) -- image_pipeline.render_panel composites every widget's own render() result onto one shared canvas and quantizes/packs the whole thing once (see its own docstring). ACTIONS: dict[str, Callable[[Session, Frame, Widget], None]] Named button actions this widget type supports (e.g. "advance", "back", "check_now") -- see models.FrameButtonAction. Each function mutates the widget's own state via db.widget_locked internally; none return a value or re-render themselves -- whatever dispatches a button press (routers/device.py, once the widget-system cutover lands) re-renders the whole panel once after running every assigned action. ACTION_LABELS: dict[str, str] Human-readable labels for ACTIONS' keys, for the button- assignment UI. """ from __future__ import annotations from . import calendar, photos, whiteboard WIDGET_TYPES = { "photos": photos, "calendar": calendar, "whiteboard": whiteboard, }