uiterm

package
v0.0.0-...-20e3502 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2022 License: GPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attribute

type Attribute int
const (
	ColorDefault Attribute = iota
	ColorBlack
	ColorRed
	ColorGreen
	ColorYellow
	ColorBlue
	ColorMagenta
	ColorCyan
	ColorWhite
)
const (
	AttrBold Attribute = 1 << (iota + 4)
	AttrUnderline
	AttrReverse
)

type Key

type Key uint16
const (
	KeyF1 Key = 0xFFFF - iota
	KeyF2
	KeyF3
	KeyF4
	KeyF5
	KeyF6
	KeyF7
	KeyF8
	KeyF9
	KeyF10
	KeyF11
	KeyF12
	KeyInsert
	KeyDelete
	KeyHome
	KeyEnd
	KeyPgup
	KeyPgdn
	KeyArrowUp
	KeyArrowDown
	KeyArrowLeft
	KeyArrowRight

	MouseLeft
	MouseMiddle
	MouseRight
)
const (
	KeyCtrlTilde      Key = 0x00
	KeyCtrl2          Key = 0x00
	KeyCtrlSpace      Key = 0x00
	KeyCtrlA          Key = 0x01
	KeyCtrlB          Key = 0x02
	KeyCtrlC          Key = 0x03
	KeyCtrlD          Key = 0x04
	KeyCtrlE          Key = 0x05
	KeyCtrlF          Key = 0x06
	KeyCtrlG          Key = 0x07
	KeyBackspace      Key = 0x08
	KeyCtrlH          Key = 0x08
	KeyTab            Key = 0x09
	KeyCtrlI          Key = 0x09
	KeyCtrlJ          Key = 0x0A
	KeyCtrlK          Key = 0x0B
	KeyCtrlL          Key = 0x0C
	KeyEnter          Key = 0x0D
	KeyCtrlM          Key = 0x0D
	KeyCtrlN          Key = 0x0E
	KeyCtrlO          Key = 0x0F
	KeyCtrlP          Key = 0x10
	KeyCtrlQ          Key = 0x11
	KeyCtrlR          Key = 0x12
	KeyCtrlS          Key = 0x13
	KeyCtrlT          Key = 0x14
	KeyCtrlU          Key = 0x15
	KeyCtrlV          Key = 0x16
	KeyCtrlW          Key = 0x17
	KeyCtrlX          Key = 0x18
	KeyCtrlY          Key = 0x19
	KeyCtrlZ          Key = 0x1A
	KeyEsc            Key = 0x1B
	KeyCtrlLsqBracket Key = 0x1B
	KeyCtrl3          Key = 0x1B
	KeyCtrl4          Key = 0x1C
	KeyCtrlBackslash  Key = 0x1C
	KeyCtrl5          Key = 0x1D
	KeyCtrlRsqBracket Key = 0x1D
	KeyCtrl6          Key = 0x1E
	KeyCtrl7          Key = 0x1F
	KeyCtrlSlash      Key = 0x1F
	KeyCtrlUnderscore Key = 0x1F
	KeySpace          Key = 0x20
	KeyBackspace2     Key = 0x7F
	KeyCtrl8          Key = 0x7F
)

type KeyListener

type KeyListener func(ui *Ui, key Key)

type Label

type Label struct {
	Text   string
	Fg, Bg Attribute
	// contains filtered or unexported fields
}

type Modifier

type Modifier uint8
const (
	ModAlt Modifier = 0x01
)

type Textbox

type Textbox struct {
	Text   string
	Fg, Bg Attribute

	Input func(ui *Ui, textbox *Textbox, text string)
	// contains filtered or unexported fields
}

type Textview

type Textview struct {
	Lines       []string
	CurrentLine int
	Fg, Bg      Attribute
	// contains filtered or unexported fields
}

func (*Textview) AddLine

func (t *Textview) AddLine(line string)

func (*Textview) Clear

func (t *Textview) Clear()

func (*Textview) ScrollBottom

func (t *Textview) ScrollBottom()

func (*Textview) ScrollDown

func (t *Textview) ScrollDown()

func (*Textview) ScrollTop

func (t *Textview) ScrollTop()

func (*Textview) ScrollUp

func (t *Textview) ScrollUp()

type Tree

type Tree struct {
	Fg, Bg    Attribute
	Generator func(item TreeItem) []TreeItem
	Listener  func(ui *Ui, tree *Tree, item TreeItem)
	// contains filtered or unexported fields
}

func (*Tree) Rebuild

func (t *Tree) Rebuild()

type TreeItem

type TreeItem interface {
	TreeItemStyle(fg, bg Attribute, active bool) (Attribute, Attribute)
	String() string
}

type Ui

type Ui struct {
	Fg, Bg Attribute
	// contains filtered or unexported fields
}

func New

func New(manager UiManager) *Ui

func (*Ui) Active

func (ui *Ui) Active() string

func (*Ui) Add

func (ui *Ui) Add(name string, view View) error

func (*Ui) AddKeyListener

func (ui *Ui) AddKeyListener(listener KeyListener, key Key)

func (*Ui) Close

func (ui *Ui) Close()

func (*Ui) Refresh

func (ui *Ui) Refresh()

func (*Ui) Run

func (ui *Ui) Run() error

func (*Ui) SetActive

func (ui *Ui) SetActive(name string)

func (*Ui) SetBounds

func (ui *Ui) SetBounds(name string, x0, y0, x1, y1 int) error

type UiManager

type UiManager interface {
	OnUiInitialize(ui *Ui)
	OnUiResize(ui *Ui, width, height int)
}

type View

type View interface {
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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