ui

package
v0.5.32 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2022 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Highlight

type Highlight byte
const (
	HLNone Highlight = 1 << iota
	HLTitle
	HLActive
	HLMuted
	HLSlight
	HLProblem
	HLOwn
	HLTemporary
)

type Msg

type Msg struct {
	From      string
	Stamp     time.Time
	Meta      string
	Message   string
	Notify    chatdata.Notify
	Highlight Highlight
}

func (Msg) NotifyNever

func (m Msg) NotifyNever() bool

func (Msg) NotifyPersonal

func (m Msg) NotifyPersonal() bool

type PlainUI

type PlainUI struct {
	io.Writer
}

func Plain

func Plain(w io.Writer) *PlainUI

func (*PlainUI) Broadcast

func (p *PlainUI) Broadcast(msgs []Msg, scroll bool)

func (*PlainUI) Clear

func (p *PlainUI) Clear()

func (*PlainUI) Err

func (p *PlainUI) Err(err error)

func (*PlainUI) Flash

func (p *PlainUI) Flash(msg string, dur time.Duration)

func (*PlainUI) JumpToActive

func (p *PlainUI) JumpToActive()

func (*PlainUI) Latency

func (p *PlainUI) Latency(time.Duration)

func (*PlainUI) Log

func (p *PlainUI) Log(msg string)

func (*PlainUI) MusicState

func (p *PlainUI) MusicState(s State)

func (*PlainUI) UserTyping added in v0.3.9

func (p *PlainUI) UserTyping(string, bool)

func (*PlainUI) Users

func (p *PlainUI) Users([]string)

type State

type State struct {
	Song     string
	Paused   bool
	Position time.Duration
	Duration time.Duration
	Volume   float64
}

func (State) Pos

func (s State) Pos() float64

type TermUI

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

assumes utf-8

func Term

func Term(
	metaPrefix bool,
	maxMessages,
	indent int,
	scrollTop bool,
	visible Visible,
	zug bool,
) *TermUI

func (*TermUI) BackspaceInput

func (ui *TermUI) BackspaceInput()

func (*TermUI) Broadcast

func (ui *TermUI) Broadcast(msgs []Msg, scroll bool)

func (*TermUI) Clear

func (ui *TermUI) Clear()

func (*TermUI) CursorHide added in v0.3.7

func (ui *TermUI) CursorHide(set bool)

func (*TermUI) Err

func (ui *TermUI) Err(err error)

func (*TermUI) ErrStr

func (ui *TermUI) ErrStr(err string)

func (*TermUI) Flash

func (ui *TermUI) Flash(msg string, dur time.Duration)

func (*TermUI) Flush

func (ui *TermUI) Flush()

func (*TermUI) GetInput

func (ui *TermUI) GetInput() string

func (*TermUI) Input

func (ui *TermUI) Input(n byte)

func (*TermUI) JumpToActive

func (ui *TermUI) JumpToActive()

func (*TermUI) Latency

func (ui *TermUI) Latency(n time.Duration)

func (*TermUI) Left added in v0.5.7

func (ui *TermUI) Left()
func (ui *TermUI) Link(id string) (*url.URL, bool)

func (*TermUI) Log

func (ui *TermUI) Log(msg string)

func (*TermUI) MusicState

func (ui *TermUI) MusicState(s State)

func (*TermUI) ResetInput

func (ui *TermUI) ResetInput() []byte

func (*TermUI) Right added in v0.5.7

func (ui *TermUI) Right()

func (*TermUI) Scroll

func (ui *TermUI) Scroll(amount int)

func (*TermUI) ScrollPageDown

func (ui *TermUI) ScrollPageDown()

func (*TermUI) ScrollPageUp

func (ui *TermUI) ScrollPageUp()

func (*TermUI) Search added in v0.3.7

func (ui *TermUI) Search(qry string)

func (*TermUI) SetInput

func (ui *TermUI) SetInput(n string)

func (*TermUI) Start

func (ui *TermUI) Start()

func (*TermUI) UserTyping added in v0.3.9

func (ui *TermUI) UserTyping(who string, is bool)

func (*TermUI) Users

func (ui *TermUI) Users(users []string)

type Visible added in v0.5.5

type Visible uint8
const (
	VisibleStatus Visible = 1 << iota
	VisibleUsers
	VisibleBrowser
	VisibleSeek
	VisibleInput

	VisibleDefault = VisibleStatus | VisibleUsers | VisibleBrowser | VisibleSeek | VisibleInput
)

type Zug added in v0.5.18

type Zug struct {
	*zug.Zug
	// contains filtered or unexported fields
}

func (*Zug) IsNOOP added in v0.5.18

func (z *Zug) IsNOOP() bool

Jump to

Keyboard shortcuts

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