memphis

package
v0.5.23 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2024 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TapSpace = "    "
)

Functions

func ConfigureSurface

func ConfigureSurface(id uuid.UUID, origin ptypes.Point2I, size ptypes.Rectangle, style paint.Style) (err error)

func FillSurface

func FillSurface(id uuid.UUID, theme paint.Theme) (err error)

func HasSurface added in v0.5.4

func HasSurface(id uuid.UUID) (ok bool)

func MakeConfigureSurface added in v0.5.4

func MakeConfigureSurface(id uuid.UUID, origin ptypes.Point2I, size ptypes.Rectangle, style paint.Style) (err error)

func MakeSurface added in v0.5.4

func MakeSurface(id uuid.UUID, origin ptypes.Point2I, size ptypes.Rectangle, style paint.Style) (err error)

func MakeTag

func MakeTag(argv ...interface{}) (tag string)

func RemoveSurface added in v0.4.4

func RemoveSurface(id uuid.UUID)

Types

type CSurface

type CSurface struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

concrete implementation of the Surface interface

func GetSurface

func GetSurface(id uuid.UUID) (*CSurface, error)

func NewSurface

func NewSurface(origin ptypes.Point2I, size ptypes.Rectangle, style paint.Style) *CSurface

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 (c *CSurface) BoxWithTheme(pos ptypes.Point2I, size ptypes.Rectangle, border, fill bool, theme paint.Theme)

func (*CSurface) Composite

func (c *CSurface) Composite(id uuid.UUID) (err error)

func (*CSurface) CompositeSurface

func (c *CSurface) CompositeSurface(src *CSurface) error

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

func (c *CSurface) DebugBox(color paint.Color, format string, argv ...interface{})

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

func (c *CSurface) Equals(onlyDirty bool, v *CSurface) bool

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) Fill

func (c *CSurface) Fill(theme paint.Theme)

fill the entire canvas according to the given theme

func (*CSurface) FillBorder

func (c *CSurface) FillBorder(dim, border bool, theme paint.Theme)

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

func (c *CSurface) GetContent(x, y int) (textCell TextCell)

get the text cell at the given coordinates

func (*CSurface) GetOrigin

func (c *CSurface) GetOrigin() ptypes.Point2I

get the origin point of the canvas

func (*CSurface) GetRegion added in v0.4.4

func (c *CSurface) GetRegion() (region ptypes.Region)

GetRegion returns the origin and size as a Region type.

func (*CSurface) GetSize

func (c *CSurface) GetSize() ptypes.Rectangle

get the rectangle size of the canvas

func (*CSurface) GetStyle

func (c *CSurface) GetStyle() (style paint.Style)

func (*CSurface) Height

func (c *CSurface) Height() (height int)

convenience method to get just the height of the canvas

func (*CSurface) Render

func (c *CSurface) Render(screen Renderer) error

render this canvas upon the given display

func (*CSurface) Resize

func (c *CSurface) Resize(size ptypes.Rectangle)

change the size of the canvas, not recommended to do this in practice

func (*CSurface) SetContent

func (c *CSurface) SetContent(x, y int, char string, s paint.Style) error

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

func (c *CSurface) SetOrigin(origin ptypes.Point2I)

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

func (c *CSurface) SetRegion(region ptypes.Region)

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) SetRune

func (c *CSurface) SetRune(x, y int, r rune, s paint.Style) error

set the rune and the style of the cell at the given coordinates

func (*CSurface) SetRuneStyle added in v0.5.10

func (c *CSurface) SetRuneStyle(x, y int, s paint.Style) error

set the style of the cell at the given coordinates

func (*CSurface) SetStyle added in v0.5.9

func (c *CSurface) SetStyle(style paint.Style)

func (*CSurface) String

func (c *CSurface) String() string

return a string describing the canvas metadata, useful for debugging

func (*CSurface) Width

func (c *CSurface) Width() (width int)

convenience method to get just the width of the canvas

type CSurfaceBuffer

type CSurfaceBuffer struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

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) SetCell

func (b *CSurfaceBuffer) SetCell(x int, y int, r rune, style paint.Style) error

set the cell content at the given (literal) coordinates

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) Raw

func (m *CTango) Raw() string

func (*CTango) TextBuffer

func (m *CTango) TextBuffer(mnemonic bool) TextBuffer

type CTextBuffer

type CTextBuffer struct {
	sync.Mutex
	// contains filtered or unexported fields
}

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) Set

func (b *CTextBuffer) Set(input string, style paint.Style)

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 NewTextCell

func NewTextCell(char *CTextChar, style paint.Style) *CTextCell

func NewTextCellFromRune added in v0.5.9

func NewTextCellFromRune(char rune, style paint.Style) *CTextCell

func (*CTextCell) Count added in v0.5.6

func (t *CTextCell) Count() int

func (*CTextCell) Dirty

func (t *CTextCell) Dirty() bool

func (*CTextCell) Equals

func (t *CTextCell) Equals(mc rune, style paint.Style, width int) bool

func (*CTextCell) IsNewline added in v0.5.6

func (t *CTextCell) IsNewline() bool

func (*CTextCell) IsNil

func (t *CTextCell) IsNil() bool

func (*CTextCell) IsSpace

func (t *CTextCell) IsSpace() bool

func (*CTextCell) Set

func (t *CTextCell) Set(r rune)

func (*CTextCell) SetByte

func (t *CTextCell) SetByte(b []byte)

func (*CTextCell) SetStyle

func (t *CTextCell) SetStyle(style paint.Style)

func (*CTextCell) String

func (t *CTextCell) String() string

func (*CTextCell) StringValue added in v0.2.2

func (t *CTextCell) StringValue() string

func (*CTextCell) Style

func (t *CTextCell) Style() paint.Style

func (*CTextCell) Value

func (t *CTextCell) Value() rune

func (*CTextCell) Width

func (t *CTextCell) Width() int

type CTextChar

type CTextChar struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewTextChar

func NewTextChar(b []byte) *CTextChar

func (*CTextChar) Count added in v0.5.6

func (c *CTextChar) Count() int

func (*CTextChar) IsNewline added in v0.5.6

func (c *CTextChar) IsNewline() bool

func (*CTextChar) IsSpace

func (c *CTextChar) IsSpace() bool

func (*CTextChar) Set

func (c *CTextChar) Set(r rune)

func (*CTextChar) SetByte

func (c *CTextChar) SetByte(b []byte)

func (*CTextChar) String

func (c *CTextChar) String() string

func (*CTextChar) Value

func (c *CTextChar) Value() rune

func (*CTextChar) Width

func (c *CTextChar) Width() int

type CWordCell

type CWordCell struct {
	// contains filtered or unexported fields
}

func (*CWordCell) AppendRune

func (w *CWordCell) AppendRune(r rune, style paint.Style)

func (*CWordCell) Characters

func (w *CWordCell) Characters() []TextCell

func (*CWordCell) CompactLen

func (w *CWordCell) CompactLen() (count int)

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 (w *CWordCell) GetCharacter(index int) (char TextCell)

func (*CWordCell) HasSpace

func (w *CWordCell) HasSpace() bool

func (*CWordCell) IsNewline added in v0.5.10

func (w *CWordCell) IsNewline() bool

func (*CWordCell) IsNil

func (w *CWordCell) IsNil() bool

func (*CWordCell) IsSpace

func (w *CWordCell) IsSpace() bool

func (*CWordCell) Len

func (w *CWordCell) Len() (count int)

the total number of characters in this word

func (*CWordCell) NewlineCount added in v0.5.6

func (w *CWordCell) NewlineCount() (newlineCount int)

func (*CWordCell) Set

func (w *CWordCell) Set(word string, style paint.Style)

func (*CWordCell) String

func (w *CWordCell) String() (s string)

returns the debuggable value of the word

func (*CWordCell) Value

func (w *CWordCell) Value() (word string)

returns the literal string value of the word

type CWordLine

type CWordLine struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*CWordLine) AppendWord

func (w *CWordLine) AppendWord(word string, style paint.Style)

func (*CWordLine) AppendWordCell

func (w *CWordLine) AppendWordCell(word WordCell)

func (*CWordLine) AppendWordRune

func (w *CWordLine) AppendWordRune(wordIndex int, char rune, style paint.Style) error

func (*CWordLine) CharacterCount

func (w *CWordLine) CharacterCount() (count int)

func (*CWordLine) GetCharacter

func (w *CWordLine) GetCharacter(index int) TextCell

func (*CWordLine) GetCharacterStyle added in v0.2.2

func (w *CWordLine) GetCharacterStyle(index int) (style paint.Style, ok bool)

func (*CWordLine) GetWord

func (w *CWordLine) GetWord(index int) WordCell

func (*CWordLine) HasSpace

func (w *CWordLine) HasSpace() bool

func (*CWordLine) Len

func (w *CWordLine) Len() (wordSpaceCount int)

func (*CWordLine) LineCount added in v0.5.6

func (w *CWordLine) LineCount() (lineCount int)

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 (w *CWordLine) RemoveWord(index int)

func (*CWordLine) SetCharacter

func (w *CWordLine) SetCharacter(index int, r rune)

func (*CWordLine) SetCharacterStyle added in v0.2.2

func (w *CWordLine) SetCharacterStyle(index int, style paint.Style)

func (*CWordLine) SetLine

func (w *CWordLine) SetLine(line string, style paint.Style)

func (*CWordLine) String

func (w *CWordLine) String() (s string)

func (*CWordLine) Value

func (w *CWordLine) Value() (s string)

func (*CWordLine) WordCount

func (w *CWordLine) WordCount() (wordCount int)

func (*CWordLine) Words

func (w *CWordLine) Words() []WordCell

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 CWordPage

type CWordPage []WordLine

type Renderer

type Renderer interface {
	GetContent(x, y int) (mainc rune, combc []rune, style paint.Style, width int)
	SetContent(x int, y int, mainc rune, combc []rune, style paint.Style)
}

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
}

func NewMarkup

func NewMarkup(text string, style paint.Style) (markup Tango, err error)

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 TextCell

type TextCell interface {
	Dirty() bool
	Set(r rune)
	SetByte(b []byte)
	SetStyle(style paint.Style)
	Equals(mc rune, style paint.Style, width int) bool
	Width() int
	Count() int
	Value() rune
	StringValue() string
	String() string
	Style() paint.Style
	IsNil() bool
	IsSpace() bool
	IsNewline() bool
}

type TextChar

type TextChar interface {
	Set(r rune)
	SetByte(b []byte)
	Width() int
	Count() int
	Value() rune
	String() string
	IsSpace() bool
	IsNewline() bool
}

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 (tp *TextProfile) GetCropSelect(selection ptypes.Range, region ptypes.Region) (cropped ptypes.Range)

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

func NewNilWordCell(style paint.Style) WordCell

func NewWordCell

func NewWordCell(word string, style paint.Style) WordCell

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

func NewWordLine

func NewWordLine(line string, style paint.Style) WordLine

type WordLineCacheFn

type WordLineCacheFn = func() []WordLine

type WordPageCache

type WordPageCache interface {
	Hit(tag string, fn WordLineCacheFn) []WordLine
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL