screen

package
v0.0.0-...-a1cdf6c Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2024 License: MIT Imports: 7 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alignment

type Alignment int
const (
	AlignLeft Alignment = iota
	AlignCenter
	AlignRight
)

type Cell

type Cell struct {
	Ch    rune // int32
	Style tcell.Style
	Width int // screen cell width
	Class CharClass
}

Cell represents a single character Cell on screen.

type CharClass

type CharClass int16

Character classification

const (
	OTHER             CharClass = 1 << iota
	CONTROLCODE                 // ^X
	TAB                         // ^X
	LINEFEED                    // ^X
	DEL                         // ^?
	NUMBER                      //
	ALPHABET                    //
	PROHIBITED                  //
	DECIMAL_SEPARATOR           // comma, dot
	WIDECHAR                    // Zenkaku
)

func GetCharClass

func GetCharClass(ch rune) CharClass

Requires different processing depending on locale an prohibited character, Return the character classification

type LabelParams

type LabelParams struct {
	Style          tcell.Style
	Align          Alignment
	Ellipsis       rune
	CenterEllipsis bool
}

type Screen

type Screen struct {
	tcell.Screen
	utils.Rect
	CX, CY int // cursor position
	// contains filtered or unexported fields
}

func Get

func Get() *Screen

func (*Screen) DrawLabel

func (s *Screen) DrawLabel(dest utils.Rect, params *LabelParams, text string)

func (m *Screen) DrawLabel(dest utils.Rect, params *LabelParams, text []byte) {

func (*Screen) DrawMiniBuffer

func (s *Screen) DrawMiniBuffer(x, y, width, maxThreshold int, cells []Cell, index int, clearStyle tcell.Style, prefix string, prefixWidth int, prefixStyle tcell.Style, echo bool) (drawStartIndex, drawEndIndex int)

x, y int : 描画領域の始点 width int : 領域の幅 maxThreshold int : カーソル位置左右 cells []Cell, index int : 表示内容, 表示開始位置 clearStyle tcell.Style prefixBytes []byte, prefixWidth int, prefixStyle tcell.Style: prefix 文字と幅、スタイル echo bool : 表示のみ

func (*Screen) DrawString

func (s *Screen) DrawString(x, y, width int, str string, style tcell.Style)

fill space if width > 0

func (*Screen) Echo

func (s *Screen) Echo(message string)

Append message to Screen.echo []string

func (*Screen) Fill

func (s *Screen) Fill(dest utils.Rect, proto Cell)

Fills an area which is an intersection between buffer and 'dest' with 'proto'.

func (*Screen) HideCursor

func (s *Screen) HideCursor()

func (*Screen) PrintEcho

func (s *Screen) PrintEcho(str ...string)

引数が指定されている場合には 指定された文字列を screen.echo に追加して内容を即表示する 引数が指定されていない場合には screen.echo の内容を表示する

func (*Screen) Resize

func (s *Screen) Resize(w, h int)

Resizes the Buffer, buffer contents are invalid after the resize.

func (*Screen) ShowCursor

func (s *Screen) ShowCursor(x, y int)

ShowCursor sets the cursor position to (x, y).

func (*Screen) Suspend

func (screen *Screen) Suspend()

Jump to

Keyboard shortcuts

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