Documentation ¶
Index ¶
- Constants
- func PadSpace(b []byte, width uint32) []byte
- type Devicer
- type MockDevicer
- type State
- type TextDisplay
- func (self *TextDisplay) Clear()
- func (self *TextDisplay) JustCenter(b []byte) []byte
- func (self *TextDisplay) Message(s1, s2 string, wait func())
- func (self *TextDisplay) PadRight(b []byte) []byte
- func (self *TextDisplay) Run()
- func (self *TextDisplay) SetCodepage(cp string) error
- func (self *TextDisplay) SetDevice(dev Devicer)
- func (self *TextDisplay) SetLines(line1, line2 string)
- func (self *TextDisplay) SetLinesBytes(b1, b2 []byte)
- func (self *TextDisplay) SetScrollDelay(d time.Duration)
- func (self *TextDisplay) SetUpdateChan(ch chan<- State)
- func (self *TextDisplay) State() State
- func (self *TextDisplay) Tick()
- func (self *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 (self *MockDevicer) Clear()
func (*MockDevicer) CursorYX ¶
func (self *MockDevicer) CursorYX(y, x uint8) bool
func (*MockDevicer) Write ¶
func (self *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 (self *TextDisplay) Clear()
func (*TextDisplay) JustCenter ¶
func (self *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 (self *TextDisplay) Message(s1, s2 string, wait func())
func (*TextDisplay) PadRight ¶
func (self *TextDisplay) PadRight(b []byte) []byte
returns `b` when len>=width otherwise pads with spaces
func (*TextDisplay) Run ¶
func (self *TextDisplay) Run()
func (*TextDisplay) SetCodepage ¶
func (self *TextDisplay) SetCodepage(cp string) error
func (*TextDisplay) SetDevice ¶
func (self *TextDisplay) SetDevice(dev Devicer)
func (*TextDisplay) SetLines ¶
func (self *TextDisplay) SetLines(line1, line2 string)
func (*TextDisplay) SetLinesBytes ¶
func (self *TextDisplay) SetLinesBytes(b1, b2 []byte)
nil: don't change len=0: set empty
func (*TextDisplay) SetScrollDelay ¶
func (self *TextDisplay) SetScrollDelay(d time.Duration)
func (*TextDisplay) SetUpdateChan ¶
func (self *TextDisplay) SetUpdateChan(ch chan<- State)
func (*TextDisplay) State ¶
func (self *TextDisplay) State() State
func (*TextDisplay) Tick ¶
func (self *TextDisplay) Tick()
func (*TextDisplay) Translate ¶
func (self *TextDisplay) Translate(s string) []byte
Click to show internal directories.
Click to hide internal directories.