"""Retired prototype LVGL runtime.

This module used to initialize LVGL, start an unbounded camera capture loop,
poll an unsigned updater, and enter an infinite UI loop as import side effects.
The production UI lives in :mod:`main.lvgl_frontend`; keeping this file as a
fail-closed shim prevents stale launchers from silently resurrecting the
prototype while preserving a deterministic import path for diagnostics.
"""

from __future__ import annotations


LEGACY_LVGL_DISABLED_MESSAGE = (
    "Legacy LVGL runtime is retired: use main.lvgl_frontend with the "
    "labcobot-lvgl system service"
)


class LegacyLVGLRuntimeDisabledError(RuntimeError):
    """Raised whenever the retired prototype runtime is invoked."""


def _disabled(*_args, **_kwargs):
    raise LegacyLVGLRuntimeDisabledError(LEGACY_LVGL_DISABLED_MESSAGE)


# Historical public names remain importable, but none can initialize LVGL,
# start threads, access a camera, or contact an update server.
load_screen = _disabled
make_button = _disabled
depthai_worker = _disabled
ota_worker = _disabled


def main() -> None:
    """Reject stale attempts to launch the retired prototype."""

    _disabled()


if __name__ == "__main__":  # pragma: no cover - exercised by launchers
    main()
