ui

package
v0.0.0-...-b2e6541 Latest Latest
Warning

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

Go to latest
Published: May 8, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Box

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

Box docs here.

func CenteredBox

func CenteredBox(center XY, height, width uint) Box

CenteredBox docs here.

func MinBox

func MinBox() Box

MinBox docs here.

func (Box) Center

func (box Box) Center() XY

Center docs here.

func (Box) HorDiv

func (box Box) HorDiv(n uint) BoxIter

HorDiv docs here.

func (Box) HorPad

func (box Box) HorPad(left, right uint) Box

HorPad docs here.

func (Box) Move

func (box Box) Move(hor, vert int) Box

Move docs here.

func (Box) MoveXY

func (box Box) MoveXY(nw XY) Box

MoveXY docs here.

func (*Box) NE

func (box *Box) NE() XY

NE docs here.

func (*Box) NW

func (box *Box) NW() XY

NW docs here.

func (Box) Pad

func (box Box) Pad(pad uint) Box

Pad docs here.

func (Box) Resize

func (box Box) Resize(height, width uint) Box

Resize docs here.

func (*Box) SE

func (box *Box) SE() XY

SE docs here.

func (*Box) SW

func (box *Box) SW() XY

SW docs here.

func (Box) VertDiv

func (box Box) VertDiv(n uint) BoxIter

VertDiv docs here.

func (Box) VertPad

func (box Box) VertPad(top, bottom uint) Box

VertPad docs here.

type BoxIter

type BoxIter struct {
	Next  func() bool
	Value func() Box
	Index func() int
}

BoxIter docs here.

type CmdBox

type CmdBox struct {
	WinBox
	// contains filtered or unexported fields
}

CmdBox docs here.

func NewCmdBox

func NewCmdBox(box Box) (CmdBox, error)

NewCmdBox docs here.

func (*CmdBox) Exec

func (cb *CmdBox) Exec()

Exec docs here. TODO: overflow goes to lines bellow

type Header struct {
	WinBox
	// contains filtered or unexported fields
}

Header docs here.

func CastHeader

func CastHeader(win WinBox, text string) Header

CastHeader docs here.

func NewHeader

func NewHeader(box Box, text string) (Header, error)

NewHeader docs here.

func (*Header) Draw

func (hdr *Header) Draw()

Draw docs here.

func (*Header) NoutRefresh

func (hdr *Header) NoutRefresh()

NoutRefresh docs here.

func (*Header) Refresh

func (hdr *Header) Refresh()

Refresh docs here.

func (*Header) SetText

func (hdr *Header) SetText(text string)

SetText docs here.

type PadBox

type PadBox struct {
	Box
	*gc.Pad
	// contains filtered or unexported fields
}

PadBox docs here.

func NewPadBox

func NewPadBox(box Box, height, width uint) (PadBox, error)

NewPadBox docs here.

func (*PadBox) BoundBuffer

func (pb *PadBox) BoundBuffer(x, y int) XY

BoundBuffer docs here.

func (*PadBox) BoundBufferXY

func (pb *PadBox) BoundBufferXY(xy XY) XY

BoundBufferXY docs here.

func (*PadBox) Delete

func (pb *PadBox) Delete() error

Delete docs here.

func (*PadBox) MoveCursor

func (pb *PadBox) MoveCursor(x, y uint) XY

MoveCursor docs here.

func (*PadBox) MoveCursorXY

func (pb *PadBox) MoveCursorXY(xy XY) XY

MoveCursorXY docs here.

func (*PadBox) NoutRefresh

func (pb *PadBox) NoutRefresh()

NoutRefresh docs here.

func (*PadBox) Offset

func (pb *PadBox) Offset(offset XY)

Offset docs here.

func (*PadBox) Refresh

func (pb *PadBox) Refresh()

Refresh docs here.

func (*PadBox) Resize

func (pb *PadBox) Resize(box Box)

Resize docs here.

func (*PadBox) ResizeBuffer

func (pb *PadBox) ResizeBuffer(height, width uint)

ResizeBuffer docs here.

func (*PadBox) Scroll

func (pb *PadBox) Scroll(x, y int)

Scroll docs here.

type RefPrinter

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

RefPrinter docs here.

func NewRefPrinter

func NewRefPrinter(ref *bib.Ref, vsr *bib.Version, width uint) RefPrinter

NewRefPrinter docs here.

func (*RefPrinter) LinesRequired

func (rp *RefPrinter) LinesRequired() uint

LinesRequired docs here.

func (*RefPrinter) Print

func (rp *RefPrinter) Print(pad *PadBox) uint

Print docs here.

type UI

type UI struct {
	WinBox

	Versions []*bib.Version
	// contains filtered or unexported fields
}

UI docs here.

func (*UI) AsyncLoop

func (ui *UI) AsyncLoop() <-chan error

AsyncLoop docs here.

func (*UI) Close

func (ui *UI) Close()

Close should be deferred before initiating the UI, so that in all cases it is ended before any error logging or such, to avoid terminal glitches.

func (*UI) End

func (ui *UI) End()

End docs here.

func (*UI) HandleKey

func (ui *UI) HandleKey(key gc.Key) bool

HandleKey docs here. TODO: delegate key handling to nested windows to better segregate logic.

func (*UI) IncrPadding

func (ui *UI) IncrPadding(padding int)

IncrPadding docs here.

func (*UI) Init

func (ui *UI) Init() (err error)

Init docs here.

func (*UI) Loop

func (ui *UI) Loop() (err error)

Loop docs here.

func (*UI) Refresh

func (ui *UI) Refresh(all bool)

Refresh docs here.

func (*UI) Resize

func (ui *UI) Resize(height, width uint)

Resize docs here.

type VersionMenu

type VersionMenu struct {
	WinBox
	// contains filtered or unexported fields
}

VersionMenu docs here.

func NewVersionMenu

func NewVersionMenu(box Box, vsrs ...*bib.Version) (vmenu VersionMenu, err error)

NewVersionMenu docs here.

func (*VersionMenu) Current

func (vmenu *VersionMenu) Current() *bib.Version

Current docs here.

func (*VersionMenu) Delete

func (vmenu *VersionMenu) Delete()

Delete docs here.

func (*VersionMenu) Draw

func (vmenu *VersionMenu) Draw()

Draw docs here.

func (*VersionMenu) Resize

func (vmenu *VersionMenu) Resize(box Box)

Resize docs here.

func (*VersionMenu) Select

func (vmenu *VersionMenu) Select() (*bib.Version, error)

Select docs here.

type VersionPad

type VersionPad struct {
	WinBox
	// contains filtered or unexported fields
}

VersionPad docs here.

func NewVersionPad

func NewVersionPad(
	vsr *bib.Version, box Box, padding uint) (vsrp VersionPad, err error)

NewVersionPad docs here.

func (*VersionPad) Delete

func (vsrp *VersionPad) Delete()

Delete docs here.

func (*VersionPad) GetChar

func (vsrp *VersionPad) GetChar() gc.Key

GetChar docs here.

func (*VersionPad) GotoCursor

func (vsrp *VersionPad) GotoCursor(y, x uint)

GotoCursor docs here.

func (*VersionPad) LoadRef

func (vsrp *VersionPad) LoadRef(ref *bib.Ref)

LoadRef docs here.

func (*VersionPad) MoveCursor

func (vsrp *VersionPad) MoveCursor(yoffset, xoffset int)

MoveCursor docs here.

func (*VersionPad) NoutRefresh

func (vsrp *VersionPad) NoutRefresh()

NoutRefresh docs here.

func (*VersionPad) RefLoaded

func (vsrp *VersionPad) RefLoaded() *bib.Ref

RefLoaded docs here.

func (*VersionPad) Refresh

func (vsrp *VersionPad) Refresh()

Refresh docs here.

func (*VersionPad) Resize

func (vsrp *VersionPad) Resize(box Box, padding uint)

Resize docs here.

func (*VersionPad) Scroll

func (vsrp *VersionPad) Scroll(offset int)

Scroll docs here.

func (*VersionPad) SetVersion

func (vsrp *VersionPad) SetVersion(vsr *bib.Version)

SetVersion docs here.

type WinBox

type WinBox struct {
	Box
	*gc.Window
}

WinBox docs here.

func CastWinBox

func CastWinBox(box Box, win *gc.Window) WinBox

CastWinBox docs here.

func NewBoxWin

func NewBoxWin(box Box) (WinBox, error)

NewBoxWin docs here.

func (*WinBox) Delete

func (wb *WinBox) Delete() error

Delete docs here.

func (*WinBox) MoveXY

func (wb *WinBox) MoveXY(xy XY)

MoveXY docs here.

func (*WinBox) Resize

func (wb *WinBox) Resize(height, width uint)

Resize docs here.

func (*WinBox) ResizeBox

func (wb *WinBox) ResizeBox(box Box)

ResizeBox docs here.

func (*WinBox) Sub

func (wb *WinBox) Sub(box Box) WinBox

Sub docs here.

type WordIter

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

WordIter docs here.

func NewWordIter

func NewWordIter(str string) WordIter

NewWordIter docs here.

func (*WordIter) Next

func (iter *WordIter) Next() bool

Next docs here.

func (*WordIter) Value

func (iter *WordIter) Value() string

Value docs here.

type XY

type XY struct {
	X, Y int
}

XY docs here.

func (XY) Bound

func (xy XY) Bound(box *Box) XY

Bound docs here.

func (XY) Eq

func (xy XY) Eq(xy2 XY) bool

Eq docs here.

func (XY) Move

func (xy XY) Move(x, y int) XY

Move docs here.

func (XY) Neg

func (xy XY) Neg() XY

Neg docs here.

func (*XY) RelTo

func (xy *XY) RelTo(xy2 XY) XY

RelTo docs here.

Jump to

Keyboard shortcuts

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