interfaces

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthMode

type AuthMode int
const (
	AuthModeNone     AuthMode = iota
	AuthModePassword AuthMode = iota
	AuthModeFull     AuthMode = iota
)

type ColorDef

type ColorDef int
const (
	ColorNoneDef          ColorDef = iota
	ColorRedDef           ColorDef = iota
	ColorGreenDef         ColorDef = iota
	ColorYellowDef        ColorDef = iota
	ColorBlueDef          ColorDef = iota
	ColorMagentaDef       ColorDef = iota
	ColorCyanDef          ColorDef = iota
	ColorWhiteDef         ColorDef = iota
	ColorBlackDef         ColorDef = iota
	ColorBrightRedDef     ColorDef = iota
	ColorBrightGreenDef   ColorDef = iota
	ColorBrightYellowDef  ColorDef = iota
	ColorBrightBlueDef    ColorDef = iota
	ColorBrightMagentaDef ColorDef = iota
	ColorBrightCyanDef    ColorDef = iota
	ColorBrightWhiteDef   ColorDef = iota
	ColorBrightBlackDef   ColorDef = iota
	ColorGrayDef          ColorDef = iota
	ColorNormalDef        ColorDef = iota
)

type ColorMode

type ColorMode int
const (
	ModeNormal ColorMode = iota
	Mode8bit   ColorMode = iota
)

type CursorCodeDef

type CursorCodeDef rune
const (
	CursorUpDef    CursorCodeDef = iota
	CursorDownDef  CursorCodeDef = iota
	CursorLeftDef  CursorCodeDef = iota
	CursorRightDef CursorCodeDef = iota
)

type HistoryAction

type HistoryAction int
const (
	HistoryActionList  HistoryAction = iota
	HistoryActionClear HistoryAction = iota
	HistoryActionExec  HistoryAction = iota
)

type IAuthenticator

type IAuthenticator interface {
	GetAuthenticationMode() AuthMode
	IsAuthenticated(user string, password string) bool
}

type IContext

type IContext interface {
	Write(data string)
	WriteLn(data string)
	WriteColor(data string, fg ColorDef, bg ColorDef, mode ColorMode)
	WriteColorLn(data string, fg ColorDef, bg ColorDef, mode ColorMode)
	GetScreenSize() (int, int)
	SetContext(pid int, ctx interface{}) bool
	IsActive(pid int) bool
	CreateTimer(pid int, first int, interval int, count int) bool
	StopTimer(pid int, tid int) bool
	PaintRequest(pid int) bool
	SetCaption(pid int, caption string) bool
	SetBasePath(arg string)
	SetSelectionMode(int)
	SetSelectionOptions(option rune, value float64) bool
	SetSelectionModeNext()
	SetSelectionModePrevious()
	Deactivate(pid int) bool
	DeactivateAll(name string) int
	History(verb HistoryAction, idx int)
	ClearScreen()
	TaskList() string
	SaveTasks(name string) bool
	RestoreTasks(name string) bool
	ListTasks() []string
	SetExit()
	SetFg(pid int) bool
}

type ISurface

type ISurface interface {
	GetSize() (int, int)
	Draw(rows int, column int, c rune)
	DrawColor(rows int, column int, c rune, fg ColorDef, bg ColorDef, mode ColorMode)
	DrawText(rows int, column int, c string)
	DrawTextColor(rows int, column int, c string, fg ColorDef, bg ColorDef, mode ColorMode)
	//DrawEntity(e * matrix.Entity)
	DrawSeries(data []float64, w int, h int, min float64, max float64)
}

type ITerminal

type ITerminal interface {
	SetKeyFunc(k KeyFunc)

	SetEnterKey(key rune)

	Colorize(text string, fg int, bg int, mode ColorMode) string

	WriteColor(text string, fg ColorDef, bg ColorDef, mode ColorMode) (int, error)

	Write(text string) (int, error)

	SaveCursor() (int, error)

	RestoreCursor() (int, error)

	MoveCursorLeft() (int, error)

	MoveCursorRight() (int, error)

	MoveCursorTopLeft() (int, error)

	ClearLine(line string) (int, error)

	ClearScreen() (int, error)

	SetSize(w int, h int)

	Scan(data []byte)
}

type KeyData

type KeyData struct {
	Type KeyType
	Key  rune
}

func NewKeyData

func NewKeyData(t KeyType, key rune) *KeyData

func (*KeyData) GetType

func (e *KeyData) GetType() KeyType

type KeyFunc

type KeyFunc func(event *KeyData)

type KeyType

type KeyType int
const (
	KeyTypeKey KeyType = iota
	KeyTypeCursor
	KeyTypeCtrl
	KeyTypeEnter
	KeyTypeTab
	KeyTypeBackspace
	KeyTypeCancel
)

Jump to

Keyboard shortcuts

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