Documentation ¶
Index ¶
- Constants
- func PadSpace(b []byte, width uint32) []byte
- type Devicer
- type MockDevicer
- type State
- type TextDisplay
- func (td *TextDisplay) Clear()
- func (td *TextDisplay) GetLine(line int) string
- func (td *TextDisplay) JustCenter(b []byte) []byte
- func (td *TextDisplay) Message(s1, s2 string, wait func())
- func (td *TextDisplay) PadRight(b []byte) []byte
- func (td *TextDisplay) Run()
- func (td *TextDisplay) SetCodepage(cp string) error
- func (td *TextDisplay) SetDevice(dev Devicer)
- func (td *TextDisplay) SetLine(line int, value string)
- func (td *TextDisplay) SetLines(line1 string, line2 string)
- func (td *TextDisplay) SetScrollDelay(d time.Duration)
- func (td *TextDisplay) SetUpdateChan(ch chan<- State)
- func (td *TextDisplay) State() State
- func (td *TextDisplay) Tick()
- func (td *TextDisplay) Translate(s string) []byte
- type TextDisplayConfig
Constants ¶
View Source
const MaxWidth = 40
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MockDevicer ¶
type MockDevicer struct { }
func (*MockDevicer) Clear ¶
func (m *MockDevicer) Clear()
func (*MockDevicer) CursorYX ¶
func (m *MockDevicer) CursorYX(y, x uint8) bool
func (*MockDevicer) Write ¶
func (m *MockDevicer) Write(b []byte)
type TextDisplay ¶
type TextDisplay struct {
// contains filtered or unexported fields
}
func NewMockTextDisplay ¶
func NewMockTextDisplay(opt *TextDisplayConfig) *TextDisplay
func NewTextDisplay ¶
func NewTextDisplay(opt *TextDisplayConfig) (*TextDisplay, error)
func (*TextDisplay) Clear ¶
func (td *TextDisplay) Clear()
func (*TextDisplay) GetLine ¶ added in v0.240915.0
func (td *TextDisplay) GetLine(line int) string
func (*TextDisplay) JustCenter ¶
func (td *TextDisplay) JustCenter(b []byte) []byte
sometimes returns slice into shared spaceBytes sometimes returns `b` (len>=width-1) sometimes allocates new buffer
func (*TextDisplay) Message ¶
func (td *TextDisplay) Message(s1, s2 string, wait func())
func (*TextDisplay) PadRight ¶
func (td *TextDisplay) PadRight(b []byte) []byte
returns `b` when len>=width otherwise pads with spaces
func (*TextDisplay) Run ¶
func (td *TextDisplay) Run()
func (*TextDisplay) SetCodepage ¶
func (td *TextDisplay) SetCodepage(cp string) error
func (*TextDisplay) SetDevice ¶
func (td *TextDisplay) SetDevice(dev Devicer)
func (*TextDisplay) SetLine ¶ added in v0.240915.0
func (td *TextDisplay) SetLine(line int, value string)
func (*TextDisplay) SetLines ¶
func (td *TextDisplay) SetLines(line1 string, line2 string)
func (*TextDisplay) SetScrollDelay ¶
func (td *TextDisplay) SetScrollDelay(d time.Duration)
func (*TextDisplay) SetUpdateChan ¶
func (td *TextDisplay) SetUpdateChan(ch chan<- State)
func (*TextDisplay) State ¶
func (td *TextDisplay) State() State
func (*TextDisplay) Tick ¶
func (td *TextDisplay) Tick()
func (*TextDisplay) Translate ¶
func (td *TextDisplay) Translate(s string) []byte
Click to show internal directories.
Click to hide internal directories.