drawer4

package
v2.0.0-...-7f6935a Latest Latest
Warning

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

Go to latest
Published: May 5, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoPaddedIndentedLines bool
View Source
var WrapLineRune = rune('←') // positioned at the start of wrapped line (left)

Functions

This section is empty.

Types

type Annotation

type Annotation struct {
	Offset     int
	Bytes      []byte
	NotesBytes []byte
}

type Annotations

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

func (*Annotations) End

func (ann *Annotations) End()

func (*Annotations) Init

func (ann *Annotations) Init()

func (*Annotations) Iter

func (ann *Annotations) Iter()

type AnnotationsIndexOf

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

func (*AnnotationsIndexOf) End

func (aio *AnnotationsIndexOf) End()

func (*AnnotationsIndexOf) Init

func (aio *AnnotationsIndexOf) Init()

func (*AnnotationsIndexOf) Iter

func (aio *AnnotationsIndexOf) Iter()

type BgFill

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

func (*BgFill) End

func (bgf *BgFill) End()

func (*BgFill) Init

func (bgf *BgFill) Init()

func (*BgFill) Iter

func (bgf *BgFill) Iter()

type Colorize

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

func (*Colorize) End

func (c *Colorize) End()

func (*Colorize) Init

func (c *Colorize) Init()

func (*Colorize) Iter

func (c *Colorize) Iter()

type ColorizeGroup

type ColorizeGroup struct {
	Off bool
	Ops []*ColorizeOp
}

type ColorizeOp

type ColorizeOp struct {
	Offset    int
	Fg, Bg    color.Color
	ProcColor func(fg, bg color.Color) (fg2, bg2 color.Color)
	Line      bool
	SetNil    bool
}

type CurColors

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

Current colors

func (*CurColors) End

func (cc *CurColors) End()

func (*CurColors) Init

func (cc *CurColors) Init()

func (*CurColors) Iter

func (cc *CurColors) Iter()

type Cursor

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

func (*Cursor) End

func (c *Cursor) End()

func (*Cursor) Init

func (c *Cursor) Init()

func (*Cursor) Iter

func (c *Cursor) Iter()

type CursorDelay

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

type DrawRune

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

func (*DrawRune) End

func (dr *DrawRune) End()

func (*DrawRune) Init

func (dr *DrawRune) Init()

func (*DrawRune) Iter

func (dr *DrawRune) Iter()

type DrawRuneDelay

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

type Drawer

type Drawer struct {

	// external options
	Opt struct {
		QuickMeasure bool // just return the bounds size
		RuneReader   struct {
			StartOffsetX int
		}
		LineWrap struct {
			On     bool
			Fg, Bg color.Color
		}
		Cursor struct {
			On         bool
			Fg         color.Color
			AddedWidth int
		}
		Colorize struct {
			Groups []*ColorizeGroup
		}
		Annotations struct {
			On       bool
			Fg, Bg   color.Color
			Selected struct {
				EntryIndex int
				Fg, Bg     color.Color
			}
			Entries []*Annotation // must be ordered by offset
		}
		WordHighlight struct {
			On     bool
			Fg, Bg color.Color
			Group  ColorizeGroup
		}
		ParenthesisHighlight struct {
			On     bool
			Fg, Bg color.Color
			Group  ColorizeGroup
		}
		SyntaxHighlight struct {
			On      bool
			Comment struct {
				Defs   []*drawutil.SyntaxHighlightComment
				Fg, Bg color.Color
			}
			String struct {
				Fg, Bg color.Color
			}
			Group ColorizeGroup
		}
	}
	// contains filtered or unexported fields
}

func New

func New() *Drawer

func (*Drawer) AnnotationsIndexOf

func (d *Drawer) AnnotationsIndexOf(p image.Point) (int, int, bool)

func (*Drawer) Bounds

func (d *Drawer) Bounds() image.Rectangle

func (*Drawer) ContentChanged

func (d *Drawer) ContentChanged()

func (*Drawer) Draw

func (d *Drawer) Draw(img draw.Image)

func (*Drawer) FirstLineOffsetX

func (d *Drawer) FirstLineOffsetX() int

func (*Drawer) FontFace

func (d *Drawer) FontFace() *fontutil.FontFace

func (*Drawer) LineHeight

func (d *Drawer) LineHeight() int

func (*Drawer) LocalIndexOf

func (d *Drawer) LocalIndexOf(p image.Point) int

func (*Drawer) LocalPointOf

func (d *Drawer) LocalPointOf(index int) image.Point

func (*Drawer) Measure

func (d *Drawer) Measure() image.Point

func (*Drawer) RangeVisible

func (d *Drawer) RangeVisible(offset, length int) bool

func (*Drawer) RangeVisibleOffset

func (d *Drawer) RangeVisibleOffset(offset, length int) int

func (*Drawer) Reader

func (d *Drawer) Reader() iorw.ReaderAt

func (*Drawer) RuneOffset

func (d *Drawer) RuneOffset() int

func (*Drawer) ScrollOffset

func (d *Drawer) ScrollOffset() image.Point

func (*Drawer) ScrollPageSizeY

func (d *Drawer) ScrollPageSizeY(up bool) int

func (*Drawer) ScrollSize

func (d *Drawer) ScrollSize() image.Point

func (*Drawer) ScrollViewSize

func (d *Drawer) ScrollViewSize() image.Point

func (*Drawer) ScrollWheelSizeY

func (d *Drawer) ScrollWheelSizeY(up bool) int

func (*Drawer) SetBounds

func (d *Drawer) SetBounds(r image.Rectangle)

func (*Drawer) SetCursorOffset

func (d *Drawer) SetCursorOffset(v int)

func (*Drawer) SetFg

func (d *Drawer) SetFg(fg color.Color)

func (*Drawer) SetFirstLineOffsetX

func (d *Drawer) SetFirstLineOffsetX(x int)

func (*Drawer) SetFontFace

func (d *Drawer) SetFontFace(ff *fontutil.FontFace)

func (*Drawer) SetReader

func (d *Drawer) SetReader(r iorw.ReaderAt)

func (*Drawer) SetRuneOffset

func (d *Drawer) SetRuneOffset(v int)

func (*Drawer) SetScrollOffset

func (d *Drawer) SetScrollOffset(o image.Point)

type EarlyExit

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

func (*EarlyExit) End

func (ee *EarlyExit) End()

func (*EarlyExit) Init

func (ee *EarlyExit) Init()

func (*EarlyExit) Iter

func (ee *EarlyExit) Iter()

type FnIter

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

func (*FnIter) End

func (it *FnIter) End()

func (*FnIter) Init

func (it *FnIter) Init()

func (*FnIter) Iter

func (it *FnIter) Iter()

type Indent

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

func (*Indent) End

func (in *Indent) End()

func (*Indent) Init

func (in *Indent) Init()

func (*Indent) Iter

func (in *Indent) Iter()

type IndexOf

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

func (*IndexOf) End

func (io *IndexOf) End()

func (*IndexOf) Init

func (io *IndexOf) Init()

func (*IndexOf) Iter

func (io *IndexOf) Iter()

type Iterator

type Iterator interface {
	Init()
	Iter()
	End()
}

type Line

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

func (*Line) End

func (l *Line) End()

func (*Line) Init

func (l *Line) Init()

func (*Line) Iter

func (l *Line) Iter()

type LineStart

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

func (*LineStart) End

func (ls *LineStart) End()

func (*LineStart) Init

func (ls *LineStart) Init()

func (*LineStart) Iter

func (ls *LineStart) Iter()

type LineWrap

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

func (*LineWrap) End

func (lw *LineWrap) End()

func (*LineWrap) Init

func (lw *LineWrap) Init()

func (*LineWrap) Iter

func (lw *LineWrap) Iter()

type Measure

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

func (*Measure) End

func (m *Measure) End()

func (*Measure) Init

func (m *Measure) Init()

func (*Measure) Iter

func (m *Measure) Iter()

type PenVisibility

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

type PointOf

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

func (*PointOf) End

func (po *PointOf) End()

func (*PointOf) Init

func (po *PointOf) Init()

func (*PointOf) Iter

func (po *PointOf) Iter()

type RuneReader

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

func (*RuneReader) End

func (rr *RuneReader) End()

func (*RuneReader) Init

func (rr *RuneReader) Init()

func (*RuneReader) Iter

func (rr *RuneReader) Iter()

type State

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

State should not be stored/restored except in initializations. ex: runeR.extra and runeR.ru won't be correctly set if the iterators were stopped.

func (State) Dump

func (st State) Dump()

type SyntaxHighlight

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

Jump to

Keyboard shortcuts

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