feat(display): add configurable multi-backend display system

This commit is contained in:
2026-03-15 21:17:16 -07:00
parent ac1306373d
commit d7b044ceae
6 changed files with 78 additions and 17 deletions

View File

@@ -100,3 +100,30 @@ class NullDisplay:
def cleanup(self) -> None:
pass
class MultiDisplay:
"""Display that forwards to multiple displays."""
def __init__(self, displays: list[Display]):
self.displays = displays
self.width = 80
self.height = 24
def init(self, width: int, height: int) -> None:
self.width = width
self.height = height
for d in self.displays:
d.init(width, height)
def show(self, buffer: list[str]) -> None:
for d in self.displays:
d.show(buffer)
def clear(self) -> None:
for d in self.displays:
d.clear()
def cleanup(self) -> None:
for d in self.displays:
d.cleanup()