Documentation ¶
Index ¶
- func Console(th *Theme, screen *Screen, settings *ConsoleSettings) layout.Widget
- type AnsiReader
- type AnsiToken
- type CharacterToken
- type ConsoleSettings
- type Defaults
- type EmptyToken
- type EscapeSequence
- type LayoutChangedEvent
- type LayoutUpdateType
- type Line
- type NumberToken
- type Option
- type Point
- type Run
- type Screen
- func (s *Screen) Buffer() string
- func (s *Screen) CursorRight(i int)
- func (s *Screen) CursorUp(i int)
- func (s *Screen) Lines() []Line
- func (s *Screen) Reset()
- func (s *Screen) SetBold(b bool)
- func (s *Screen) SetFaint(b bool)
- func (s *Screen) SetForegroundColor(c color.NRGBA)
- func (s *Screen) SetForegroundColorAnsi256(c int)
- func (s *Screen) SetForegroundColorAnsi8(c int, b bool)
- func (s *Screen) VisibleLines() []Line
- func (s *Screen) Write(p []byte) (n int, err error)
- func (s *Screen) WriteCarriageReturn()
- func (s *Screen) WriteCharacters(text string)
- func (s *Screen) WriteNewLine()
- func (s *Screen) WriteString(s2 string) error
- type Style
- func (s *Style) FgColor() color.NRGBA
- func (s *Style) Reset(fgColor color.NRGBA, bgColor color.NRGBA)
- func (s *Style) SetBackgroundColor(bgColor color.NRGBA)
- func (s *Style) SetFaint(b bool)
- func (s *Style) SetForegroundAnsi256(c int)
- func (s *Style) SetForegroundAnsi8(i int, bright bool)
- func (s *Style) SetForegroundColor(c color.NRGBA)
- type VirtualLine
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AnsiReader ¶
func (*AnsiReader) HasNext ¶
func (r *AnsiReader) HasNext() bool
func (*AnsiReader) Next ¶
func (r *AnsiReader) Next() byte
func (*AnsiReader) Parse ¶
func (r *AnsiReader) Parse()
func (*AnsiReader) PeekN ¶
func (r *AnsiReader) PeekN(i int) []byte
type CharacterToken ¶
type ConsoleSettings ¶ added in v0.0.11
type ConsoleSettings struct {
// contains filtered or unexported fields
}
func NewConsoleSettings ¶ added in v0.0.9
func NewConsoleSettings(opts ...Option) *ConsoleSettings
func (*ConsoleSettings) Events ¶ added in v0.0.11
func (s *ConsoleSettings) Events() []LayoutChangedEvent
type EmptyToken ¶
type EmptyToken struct {
AnsiToken
}
type EscapeSequence ¶
type EscapeSequence struct {
Tokens []AnsiToken
}
func (EscapeSequence) ApplyOn ¶
func (t EscapeSequence) ApplyOn(s *Screen) error
func (EscapeSequence) ExpectNumber ¶
func (t EscapeSequence) ExpectNumber(n int, default_ int) (int, error)
type LayoutChangedEvent ¶ added in v0.0.9
type LayoutChangedEvent struct {
Type LayoutUpdateType
}
type LayoutUpdateType ¶ added in v0.0.9
type LayoutUpdateType int
const ( LayoutUpdateNone LayoutUpdateType = iota LayoutUpdateWidth LayoutUpdateType = 1 << 0 LayoutUpdateHeight LayoutUpdateType = 1 << 1 )
type Line ¶
type Line struct {
// contains filtered or unexported fields
}
This is a line as displayed in the terminal emulator, it will never be longer than its current width
type NumberToken ¶
type Option ¶ added in v0.0.9
type Option func(settings *ConsoleSettings)
type Run ¶
type Run struct {
// contains filtered or unexported fields
}
Runs should always be consecutive
type Screen ¶
type Screen struct { Size Point // contains filtered or unexported fields }
func (*Screen) CursorRight ¶
func (*Screen) SetForegroundColor ¶
func (*Screen) SetForegroundColorAnsi256 ¶ added in v0.0.12
func (*Screen) SetForegroundColorAnsi8 ¶ added in v0.0.12
The following are primitives that are used by the parser
func (*Screen) VisibleLines ¶
func (*Screen) WriteCarriageReturn ¶
func (s *Screen) WriteCarriageReturn()
func (*Screen) WriteCharacters ¶
func (*Screen) WriteNewLine ¶
func (s *Screen) WriteNewLine()
func (*Screen) WriteString ¶
type Style ¶
type Style struct { BgColor color.NRGBA Bold bool Faint bool // contains filtered or unexported fields }
func (*Style) SetBackgroundColor ¶
func (*Style) SetForegroundAnsi256 ¶ added in v0.0.12
func (*Style) SetForegroundAnsi8 ¶ added in v0.0.12
func (*Style) SetForegroundColor ¶
type VirtualLine ¶ added in v0.0.9
type VirtualLine struct {
// contains filtered or unexported fields
}
func (*VirtualLine) AddRun ¶ added in v0.0.9
func (v *VirtualLine) AddRun(tail Run)
func (VirtualLine) AppendLine ¶ added in v0.0.9
func (v VirtualLine) AppendLine(l2 Line) VirtualLine
func (VirtualLine) Length ¶ added in v0.0.9
func (v VirtualLine) Length() int
func (VirtualLine) Split ¶ added in v0.0.9
func (v VirtualLine) Split(maxLength int) []Line
Source Files ¶
Click to show internal directories.
Click to hide internal directories.