Documentation ¶
Index ¶
- Variables
- func ConfigureSurface(id uuid.UUID, origin ptypes.Point2I, size ptypes.Rectangle, style paint.Style) (err error)
- func FillSurface(id uuid.UUID, theme paint.Theme) (err error)
- func HasSurface(id uuid.UUID) (ok bool)
- func MakeConfigureSurface(id uuid.UUID, origin ptypes.Point2I, size ptypes.Rectangle, style paint.Style) (err error)
- func MakeSurface(id uuid.UUID, origin ptypes.Point2I, size ptypes.Rectangle, style paint.Style) (err error)
- func MakeTag(argv ...interface{}) (tag string)
- func RemoveSurface(id uuid.UUID)
- type CSurface
- func (c *CSurface) Box(pos ptypes.Point2I, size ptypes.Rectangle, border, fill, overlay bool, ...)
- func (c *CSurface) BoxWithTheme(pos ptypes.Point2I, size ptypes.Rectangle, border, fill bool, ...)
- func (c *CSurface) Composite(id uuid.UUID) (err error)
- func (c *CSurface) CompositeSurface(src *CSurface) error
- func (c *CSurface) DebugBox(color paint.Color, format string, argv ...interface{})
- func (c *CSurface) DrawHorizontalLine(pos ptypes.Point2I, length int, style paint.Style, lineRune rune)
- func (c *CSurface) DrawLine(pos ptypes.Point2I, length int, orient enums.Orientation, style paint.Style)
- func (c *CSurface) DrawSingleLineText(position ptypes.Point2I, maxChars int, ellipsize bool, ...)
- func (c *CSurface) DrawText(pos ptypes.Point2I, size ptypes.Rectangle, justify enums.Justification, ...)
- func (c *CSurface) DrawVerticalLine(pos ptypes.Point2I, length int, style paint.Style, lineRune rune)
- func (c *CSurface) Equals(onlyDirty bool, v *CSurface) bool
- func (c *CSurface) Fill(theme paint.Theme)
- func (c *CSurface) FillBorder(dim, border bool, theme paint.Theme)
- func (c *CSurface) FillBorderTitle(dim bool, title string, justify enums.Justification, theme paint.Theme)
- func (c *CSurface) GetContent(x, y int) (textCell TextCell)
- func (c *CSurface) GetOrigin() ptypes.Point2I
- func (c *CSurface) GetRegion() (region ptypes.Region)
- func (c *CSurface) GetSize() ptypes.Rectangle
- func (c *CSurface) GetStyle() (style paint.Style)
- func (c *CSurface) Height() (height int)
- func (c *CSurface) Render(screen Renderer) error
- func (c *CSurface) Resize(size ptypes.Rectangle)
- func (c *CSurface) SetContent(x, y int, char string, s paint.Style) error
- func (c *CSurface) SetOrigin(origin ptypes.Point2I)
- func (c *CSurface) SetRegion(region ptypes.Region)
- func (c *CSurface) SetRune(x, y int, r rune, s paint.Style) error
- func (c *CSurface) SetRuneStyle(x, y int, s paint.Style) error
- func (c *CSurface) SetStyle(style paint.Style)
- func (c *CSurface) String() string
- func (c *CSurface) Width() (width int)
- type CSurfaceBuffer
- func (b *CSurfaceBuffer) GetBgColor(x, y int) (bg paint.Color)
- func (b *CSurfaceBuffer) GetCell(x int, y int) TextCell
- func (b *CSurfaceBuffer) GetDim(x, y int) bool
- func (b *CSurfaceBuffer) LoadData(d [][]TextCell)
- func (b *CSurfaceBuffer) Resize(size ptypes.Rectangle)
- func (b *CSurfaceBuffer) SetCell(x int, y int, r rune, style paint.Style) error
- func (b *CSurfaceBuffer) SetStyle(style paint.Style)
- func (b *CSurfaceBuffer) Size() (size ptypes.Rectangle)
- func (b *CSurfaceBuffer) String() string
- func (b *CSurfaceBuffer) Style() (style paint.Style)
- type CTango
- type CTextBuffer
- func (b *CTextBuffer) CharacterCount() (cellCount int)
- func (b *CTextBuffer) ClearText(wordWrap enums.WrapMode, ellipsize bool, justify enums.Justification, ...) (plain string)
- func (b *CTextBuffer) Clone() (cloned TextBuffer)
- func (b *CTextBuffer) Draw(canvas Surface, singleLine bool, wordWrap enums.WrapMode, ellipsize bool, ...) enums.EventFlag
- func (b *CTextBuffer) Input() (raw string)
- func (b *CTextBuffer) LineCount() (lineCount int)
- func (b *CTextBuffer) Mnemonic() (enabled bool)
- func (b *CTextBuffer) PlainText(wordWrap enums.WrapMode, ellipsize bool, justify enums.Justification, ...) (plain string)
- func (b *CTextBuffer) PlainTextInfo(wordWrap enums.WrapMode, ellipsize bool, justify enums.Justification, ...) (longestLine, lineCount int)
- func (b *CTextBuffer) Select(start, end int)
- func (b *CTextBuffer) Set(input string, style paint.Style)
- func (b *CTextBuffer) SetInput(input WordLine)
- func (b *CTextBuffer) SetMnemonic(enabled bool)
- func (b *CTextBuffer) SetStyle(style paint.Style)
- func (b *CTextBuffer) Style() paint.Style
- func (b *CTextBuffer) WordCount() (wordCount int)
- type CTextCell
- func (t *CTextCell) Count() int
- func (t *CTextCell) Dirty() bool
- func (t *CTextCell) Equals(mc rune, style paint.Style, width int) bool
- func (t *CTextCell) IsNewline() bool
- func (t *CTextCell) IsNil() bool
- func (t *CTextCell) IsSpace() bool
- func (t *CTextCell) Set(r rune)
- func (t *CTextCell) SetByte(b []byte)
- func (t *CTextCell) SetStyle(style paint.Style)
- func (t *CTextCell) String() string
- func (t *CTextCell) StringValue() string
- func (t *CTextCell) Style() paint.Style
- func (t *CTextCell) Value() rune
- func (t *CTextCell) Width() int
- type CTextChar
- type CWordCell
- func (w *CWordCell) AppendRune(r rune, style paint.Style)
- func (w *CWordCell) Characters() []TextCell
- func (w *CWordCell) CompactLen() (count int)
- func (w *CWordCell) GetCharacter(index int) (char TextCell)
- func (w *CWordCell) HasSpace() bool
- func (w *CWordCell) IsNewline() bool
- func (w *CWordCell) IsNil() bool
- func (w *CWordCell) IsSpace() bool
- func (w *CWordCell) Len() (count int)
- func (w *CWordCell) NewlineCount() (newlineCount int)
- func (w *CWordCell) Set(word string, style paint.Style)
- func (w *CWordCell) String() (s string)
- func (w *CWordCell) Value() (word string)
- type CWordLine
- func (w *CWordLine) AppendWord(word string, style paint.Style)
- func (w *CWordLine) AppendWordCell(word WordCell)
- func (w *CWordLine) AppendWordRune(wordIndex int, char rune, style paint.Style) error
- func (w *CWordLine) CharacterCount() (count int)
- func (w *CWordLine) GetCharacter(index int) TextCell
- func (w *CWordLine) GetCharacterStyle(index int) (style paint.Style, ok bool)
- func (w *CWordLine) GetWord(index int) WordCell
- func (w *CWordLine) HasSpace() bool
- func (w *CWordLine) Len() (wordSpaceCount int)
- func (w *CWordLine) LineCount() (lineCount int)
- func (w *CWordLine) Make(mnemonic bool, wrap enums.WrapMode, ellipsize bool, ...) (formatted []WordLine)
- func (w *CWordLine) RemoveWord(index int)
- func (w *CWordLine) SetCharacter(index int, r rune)
- func (w *CWordLine) SetCharacterStyle(index int, style paint.Style)
- func (w *CWordLine) SetLine(line string, style paint.Style)
- func (w *CWordLine) String() (s string)
- func (w *CWordLine) Value() (s string)
- func (w *CWordLine) WordCount() (wordCount int)
- func (w *CWordLine) Words() []WordCell
- type CWordLineCache
- type CWordPage
- type Renderer
- type Surface
- type SurfaceBuffer
- type Tango
- type TextBuffer
- type TextCell
- type TextChar
- type TextProfile
- func (tp *TextProfile) Crop(region ptypes.Region) (cropped string)
- func (tp *TextProfile) Delete(startPos int, endPos int) (modified string, ok bool)
- func (tp *TextProfile) EndsWithNewLine() (ok bool)
- func (tp *TextProfile) Get() string
- func (tp *TextProfile) GetCropSelect(selection ptypes.Range, region ptypes.Region) (cropped ptypes.Range)
- func (tp *TextProfile) GetPointFromPosition(position int) (point ptypes.Point2I)
- func (tp *TextProfile) GetPositionFromPoint(point ptypes.Point2I) (position int)
- func (tp *TextProfile) Height() int
- func (tp *TextProfile) Insert(text string, position int) (modified string, ok bool)
- func (tp *TextProfile) Len() int
- func (tp *TextProfile) Overwrite(text string, startPos, endPos int) (modified string, ok bool)
- func (tp *TextProfile) Select(start, end int) (selected string)
- func (tp *TextProfile) Set(text string)
- func (tp *TextProfile) Width() int
- type WordCell
- type WordLine
- type WordLineCacheFn
- type WordPageCache
Constants ¶
This section is empty.
Variables ¶
var (
TapSpace = " "
)
Functions ¶
func ConfigureSurface ¶
func HasSurface ¶ added in v0.5.4
func MakeConfigureSurface ¶ added in v0.5.4
func MakeSurface ¶ added in v0.5.4
func RemoveSurface ¶ added in v0.4.4
Types ¶
type CSurface ¶
concrete implementation of the Surface interface
func NewSurface ¶
create a new canvas object with the given origin point, size and theme
func (*CSurface) Box ¶
func (c *CSurface) Box(pos ptypes.Point2I, size ptypes.Rectangle, border, fill, overlay bool, fillRune rune, contentStyle, borderStyle paint.Style, borderRunes paint.BorderRuneSet)
draw a box, at position, of size, with or without a border, with or without being filled in and following the given theme
func (*CSurface) BoxWithTheme ¶
func (*CSurface) CompositeSurface ¶
apply the given canvas to this canvas, at the given one's origin. returns an error if the underlying buffer write failed or if the given canvas is beyond the bounds of this canvas
func (*CSurface) DebugBox ¶
draw a box with Sprintf-formatted text along the top-left of the box, useful for debugging more than anything else as the normal draw primitives are far more flexible
func (*CSurface) DrawHorizontalLine ¶
func (c *CSurface) DrawHorizontalLine(pos ptypes.Point2I, length int, style paint.Style, lineRune rune)
convenience method to draw a horizontal line
func (*CSurface) DrawLine ¶
func (c *CSurface) DrawLine(pos ptypes.Point2I, length int, orient enums.Orientation, style paint.Style)
draw a line vertically or horizontally with the given style
func (*CSurface) DrawSingleLineText ¶
func (c *CSurface) DrawSingleLineText(position ptypes.Point2I, maxChars int, ellipsize bool, justify enums.Justification, style paint.Style, markup, mnemonic bool, text string)
write a single line of text to the canvas at the given position, of at most maxChars, with the text justified and styled. supports Tango markup content
func (*CSurface) DrawText ¶
func (c *CSurface) DrawText(pos ptypes.Point2I, size ptypes.Rectangle, justify enums.Justification, singleLineMode bool, wrap enums.WrapMode, ellipsize bool, style paint.Style, markup, mnemonic bool, text string)
Write text to the canvas buffer origin is the top-left coordinate for the text area being rendered alignment is based on origin.X boxed by maxChars or canvas size.W
func (*CSurface) DrawVerticalLine ¶
func (c *CSurface) DrawVerticalLine(pos ptypes.Point2I, length int, style paint.Style, lineRune rune)
convenience method to draw a vertical line
func (*CSurface) Equals ¶
returns true if the given canvas is painted the same as this one, can compare for only cells that were "set" (dirty) or compare every cell of the two canvases
func (*CSurface) FillBorder ¶
fill the entire canvas, with or without 'dim' styling, with or without a border
func (*CSurface) FillBorderTitle ¶
func (c *CSurface) FillBorderTitle(dim bool, title string, justify enums.Justification, theme paint.Theme)
fill the entire canvas, with or without 'dim' styling, with plain text justified across the top border
func (*CSurface) GetContent ¶
get the text cell at the given coordinates
func (*CSurface) GetRegion ¶ added in v0.4.4
GetRegion returns the origin and size as a Region type.
func (*CSurface) SetContent ¶
from the given string, set the character and style of the cell at the given coordinates. note that only the first UTF-8 byte is used
func (*CSurface) SetOrigin ¶
set the origin (top-left corner) position of the canvas, used when compositing one canvas with another
func (*CSurface) SetRegion ¶ added in v0.4.4
SetRegion is a convenience method wrapping SetOrigin and Resize, using the given Region for the values. The existing Style is used for the Resize call.
func (*CSurface) SetRuneStyle ¶ added in v0.5.10
set the style of the cell at the given coordinates
type CSurfaceBuffer ¶
concrete implementation of the SurfaceBuffer interface
func NewSurfaceBuffer ¶
func NewSurfaceBuffer(size ptypes.Rectangle, style paint.Style) *CSurfaceBuffer
construct a new canvas buffer
func (*CSurfaceBuffer) GetBgColor ¶
func (b *CSurfaceBuffer) GetBgColor(x, y int) (bg paint.Color)
return the background color at the given coordinates
func (*CSurfaceBuffer) GetCell ¶
func (b *CSurfaceBuffer) GetCell(x int, y int) TextCell
return the text cell at the given coordinates, nil if not found
func (*CSurfaceBuffer) GetDim ¶
func (b *CSurfaceBuffer) GetDim(x, y int) bool
return true if the given coordinates are styled 'dim', false otherwise
func (*CSurfaceBuffer) LoadData ¶
func (b *CSurfaceBuffer) LoadData(d [][]TextCell)
given matrix array of text cells, load that data in this canvas space
func (*CSurfaceBuffer) Resize ¶
func (b *CSurfaceBuffer) Resize(size ptypes.Rectangle)
resize the buffer
func (*CSurfaceBuffer) SetStyle ¶ added in v0.5.10
func (b *CSurfaceBuffer) SetStyle(style paint.Style)
return the rectangle size of the buffer
func (*CSurfaceBuffer) Size ¶
func (b *CSurfaceBuffer) Size() (size ptypes.Rectangle)
return the rectangle size of the buffer
func (*CSurfaceBuffer) String ¶
func (b *CSurfaceBuffer) String() string
return a string describing the buffer, only useful for debugging purposes
func (*CSurfaceBuffer) Style ¶
func (b *CSurfaceBuffer) Style() (style paint.Style)
return the rectangle size of the buffer
type CTango ¶
type CTango struct {
// contains filtered or unexported fields
}
func (*CTango) TextBuffer ¶
func (m *CTango) TextBuffer(mnemonic bool) TextBuffer
type CTextBuffer ¶
func (*CTextBuffer) CharacterCount ¶
func (b *CTextBuffer) CharacterCount() (cellCount int)
func (*CTextBuffer) ClearText ¶
func (b *CTextBuffer) ClearText(wordWrap enums.WrapMode, ellipsize bool, justify enums.Justification, maxChars int) (plain string)
func (*CTextBuffer) Clone ¶ added in v0.5.9
func (b *CTextBuffer) Clone() (cloned TextBuffer)
func (*CTextBuffer) Draw ¶
func (b *CTextBuffer) Draw(canvas Surface, singleLine bool, wordWrap enums.WrapMode, ellipsize bool, justify enums.Justification, vAlign enums.VerticalAlignment) enums.EventFlag
func (*CTextBuffer) Input ¶
func (b *CTextBuffer) Input() (raw string)
func (*CTextBuffer) LineCount ¶ added in v0.5.6
func (b *CTextBuffer) LineCount() (lineCount int)
func (*CTextBuffer) Mnemonic ¶
func (b *CTextBuffer) Mnemonic() (enabled bool)
func (*CTextBuffer) PlainText ¶
func (b *CTextBuffer) PlainText(wordWrap enums.WrapMode, ellipsize bool, justify enums.Justification, maxChars int) (plain string)
func (*CTextBuffer) PlainTextInfo ¶
func (b *CTextBuffer) PlainTextInfo(wordWrap enums.WrapMode, ellipsize bool, justify enums.Justification, maxChars int) (longestLine, lineCount int)
func (*CTextBuffer) Select ¶ added in v0.5.10
func (b *CTextBuffer) Select(start, end int)
func (*CTextBuffer) SetInput ¶
func (b *CTextBuffer) SetInput(input WordLine)
func (*CTextBuffer) SetMnemonic ¶
func (b *CTextBuffer) SetMnemonic(enabled bool)
func (*CTextBuffer) SetStyle ¶
func (b *CTextBuffer) SetStyle(style paint.Style)
func (*CTextBuffer) Style ¶
func (b *CTextBuffer) Style() paint.Style
func (*CTextBuffer) WordCount ¶
func (b *CTextBuffer) WordCount() (wordCount int)
type CTextCell ¶
type CTextCell struct {
// contains filtered or unexported fields
}
func NewTextCellFromRune ¶ added in v0.5.9
func (*CTextCell) StringValue ¶ added in v0.2.2
type CTextChar ¶
func NewTextChar ¶
type CWordCell ¶
type CWordCell struct {
// contains filtered or unexported fields
}
func (*CWordCell) Characters ¶
func (*CWordCell) CompactLen ¶
same as `Len()` with space-words being treated as 1 character wide rather than the literal number of spaces from the input string
func (*CWordCell) GetCharacter ¶
func (*CWordCell) NewlineCount ¶ added in v0.5.6
type CWordLine ¶
func (*CWordLine) AppendWordCell ¶
func (*CWordLine) AppendWordRune ¶
func (*CWordLine) CharacterCount ¶
func (*CWordLine) GetCharacter ¶
func (*CWordLine) GetCharacterStyle ¶ added in v0.2.2
func (*CWordLine) Make ¶
func (w *CWordLine) Make(mnemonic bool, wrap enums.WrapMode, ellipsize bool, justify enums.Justification, maxChars int, fillerStyle paint.Style) (formatted []WordLine)
wrap, justify and align the set input, with filler style
func (*CWordLine) RemoveWord ¶
func (*CWordLine) SetCharacter ¶
func (*CWordLine) SetCharacterStyle ¶ added in v0.2.2
type CWordLineCache ¶
type CWordLineCache struct {
// contains filtered or unexported fields
}
func NewWordPageCache ¶
func NewWordPageCache() (wpc *CWordLineCache)
func (*CWordLineCache) Clear ¶
func (c *CWordLineCache) Clear()
func (*CWordLineCache) Hit ¶
func (c *CWordLineCache) Hit(tag string, fn WordLineCacheFn) (lines []WordLine)
type Surface ¶
type Surface interface { GetStyle() (style paint.Style) SetStyle(style paint.Style) String() string Resize(size ptypes.Rectangle) GetContent(x, y int) (textCell TextCell) SetContent(x, y int, char string, s paint.Style) error SetRune(x, y int, r rune, s paint.Style) error SetRuneStyle(x, y int, s paint.Style) error SetOrigin(origin ptypes.Point2I) GetOrigin() ptypes.Point2I GetSize() ptypes.Rectangle Width() (width int) Height() (height int) GetRegion() (region ptypes.Region) SetRegion(region ptypes.Region) Equals(onlyDirty bool, v *CSurface) bool CompositeSurface(v *CSurface) error Composite(id uuid.UUID) (err error) Render(display Renderer) error DrawText(pos ptypes.Point2I, size ptypes.Rectangle, justify enums.Justification, singleLineMode bool, wrap enums.WrapMode, ellipsize bool, style paint.Style, markup, mnemonic bool, text string) DrawSingleLineText(position ptypes.Point2I, maxChars int, ellipsize bool, justify enums.Justification, style paint.Style, markup, mnemonic bool, text string) DrawLine(pos ptypes.Point2I, length int, orient enums.Orientation, style paint.Style) DrawHorizontalLine(pos ptypes.Point2I, length int, style paint.Style, lineRune rune) DrawVerticalLine(pos ptypes.Point2I, length int, style paint.Style, lineRune rune) Box(pos ptypes.Point2I, size ptypes.Rectangle, border, fill, overlay bool, fillRune rune, contentStyle, borderStyle paint.Style, borderRunes paint.BorderRuneSet) BoxWithTheme(pos ptypes.Point2I, size ptypes.Rectangle, border, fill bool, theme paint.Theme) DebugBox(color paint.Color, format string, argv ...interface{}) Fill(theme paint.Theme) FillBorder(dim, border bool, theme paint.Theme) FillBorderTitle(dim bool, title string, justify enums.Justification, theme paint.Theme) }
a Surface is the primary means of drawing to the terminal display within CDK
type SurfaceBuffer ¶
type SurfaceBuffer interface { String() string Style() (style paint.Style) SetStyle(style paint.Style) Size() (size ptypes.Rectangle) Width() (width int) Height() (height int) Resize(size ptypes.Rectangle) GetDim(x, y int) bool GetBgColor(x, y int) (bg paint.Color) GetCell(x, y int) (textCell TextCell) SetCell(x int, y int, r rune, style paint.Style) error LoadData(d [][]TextCell) }
provide an underlying buffer for Canvases
type Tango ¶
type Tango interface { Raw() string TextBuffer(mnemonic bool) TextBuffer }
type TextBuffer ¶
type TextBuffer interface { Clone() TextBuffer Set(input string, style paint.Style) Select(start, end int) Input() (raw string) SetInput(input WordLine) Style() paint.Style SetStyle(style paint.Style) Mnemonic() (enabled bool) SetMnemonic(enabled bool) CharacterCount() (cellCount int) WordCount() (wordCount int) LineCount() (lineCount int) ClearText(wordWrap enums.WrapMode, ellipsize bool, justify enums.Justification, maxChars int) (plain string) PlainText(wordWrap enums.WrapMode, ellipsize bool, justify enums.Justification, maxChars int) (plain string) PlainTextInfo(wordWrap enums.WrapMode, ellipsize bool, justify enums.Justification, maxChars int) (longestLine, lineCount int) Draw(canvas Surface, singleLine bool, wordWrap enums.WrapMode, ellipsize bool, justify enums.Justification, vAlign enums.VerticalAlignment) enums.EventFlag }
func NewEmptyTextBuffer ¶
func NewEmptyTextBuffer(style paint.Style, mnemonic bool) TextBuffer
func NewTextBuffer ¶
func NewTextBuffer(input string, style paint.Style, mnemonic bool) TextBuffer
type TextProfile ¶ added in v0.5.6
type TextProfile struct {
// contains filtered or unexported fields
}
func NewTextProfile ¶ added in v0.5.6
func NewTextProfile(input string) (tp *TextProfile)
func (*TextProfile) Crop ¶ added in v0.5.6
func (tp *TextProfile) Crop(region ptypes.Region) (cropped string)
func (*TextProfile) Delete ¶ added in v0.5.6
func (tp *TextProfile) Delete(startPos int, endPos int) (modified string, ok bool)
func (*TextProfile) EndsWithNewLine ¶ added in v0.5.6
func (tp *TextProfile) EndsWithNewLine() (ok bool)
func (*TextProfile) Get ¶ added in v0.5.6
func (tp *TextProfile) Get() string
func (*TextProfile) GetCropSelect ¶ added in v0.5.10
func (*TextProfile) GetPointFromPosition ¶ added in v0.5.6
func (tp *TextProfile) GetPointFromPosition(position int) (point ptypes.Point2I)
func (*TextProfile) GetPositionFromPoint ¶ added in v0.5.6
func (tp *TextProfile) GetPositionFromPoint(point ptypes.Point2I) (position int)
func (*TextProfile) Height ¶ added in v0.5.6
func (tp *TextProfile) Height() int
func (*TextProfile) Insert ¶ added in v0.5.6
func (tp *TextProfile) Insert(text string, position int) (modified string, ok bool)
func (*TextProfile) Len ¶ added in v0.5.6
func (tp *TextProfile) Len() int
func (*TextProfile) Overwrite ¶ added in v0.5.6
func (tp *TextProfile) Overwrite(text string, startPos, endPos int) (modified string, ok bool)
func (*TextProfile) Select ¶ added in v0.5.10
func (tp *TextProfile) Select(start, end int) (selected string)
func (*TextProfile) Set ¶ added in v0.5.6
func (tp *TextProfile) Set(text string)
func (*TextProfile) Width ¶ added in v0.5.6
func (tp *TextProfile) Width() int
type WordCell ¶
type WordCell interface { Characters() []TextCell Set(word string, style paint.Style) GetCharacter(index int) (char TextCell) AppendRune(r rune, style paint.Style) IsNil() bool IsSpace() bool HasSpace() bool IsNewline() bool NewlineCount() (newlineCount int) Len() (count int) CompactLen() (count int) Value() (word string) String() (s string) }
func NewEmptyWordCell ¶
func NewEmptyWordCell() WordCell
func NewNilWordCell ¶
type WordLine ¶
type WordLine interface { SetLine(line string, style paint.Style) AppendWord(word string, style paint.Style) AppendWordCell(word WordCell) AppendWordRune(wordIndex int, char rune, style paint.Style) error GetWord(index int) WordCell RemoveWord(index int) GetCharacter(index int) TextCell SetCharacter(index int, r rune) GetCharacterStyle(index int) (style paint.Style, ok bool) SetCharacterStyle(index int, style paint.Style) Words() []WordCell Len() (wordSpaceCount int) CharacterCount() (count int) WordCount() (wordCount int) LineCount() (lineCount int) HasSpace() bool Value() (s string) String() (s string) Make(mnemonic bool, wrap enums.WrapMode, ellipsize bool, justify enums.Justification, maxChars int, fillerStyle paint.Style) (formatted []WordLine) }
func NewEmptyWordLine ¶
func NewEmptyWordLine() WordLine
type WordLineCacheFn ¶
type WordLineCacheFn = func() []WordLine
type WordPageCache ¶
type WordPageCache interface {
Hit(tag string, fn WordLineCacheFn) []WordLine
}