Kiosk process owns its display lifecycle: waits for X11, keeps the fullscreen black canvas below video, stops deterministically on signal. Supervisor starts it before video, restarts only on process death, and shuts the whole process group down; X11 downtime never restarts the supervisor. Per-target opener/template abstractions for future MIPI.
24 lines
580 B
Go
24 lines
580 B
Go
package display
|
|
|
|
// StatusTemplate is the fallback kiosk layout: a cleared black canvas with
|
|
// status lines. It is the "no pilot video" state of a display target.
|
|
type StatusTemplate struct {
|
|
lines []string
|
|
}
|
|
|
|
// NewStatusTemplate builds a template that draws the given status lines.
|
|
func NewStatusTemplate(lines ...string) StatusTemplate {
|
|
return StatusTemplate{lines: lines}
|
|
}
|
|
|
|
func (t StatusTemplate) Draw(canvas Canvas) {
|
|
canvas.Clear()
|
|
_, height := canvas.Size()
|
|
y := height / 2
|
|
for _, line := range t.lines {
|
|
canvas.Text(32, y, line)
|
|
y += 32
|
|
}
|
|
canvas.Flush()
|
|
}
|