Documentation
¶
Index ¶
- Constants
- Variables
- func DecodeImage(r io.Reader) (image.Image, string, error)
- func IsSplitRune(r rune) bool
- func New(config Config) (ui *UI, colors ConfigColors, err error)
- func NotifyStart(opened func(*NotifyEvent))
- func NotifyStop()
- type BufferList
- func (bs *BufferList) Add(netID, netName, title string) (i int, added bool)
- func (bs *BufferList) AddLine(netID, title string, line Line)
- func (bs *BufferList) AddLines(netID, title string, before, after []Line)
- func (bs *BufferList) Buffer(i int) (netID, title string, ok bool)
- func (bs *BufferList) CloseOverlay()
- func (bs *BufferList) Current() (netID, title string)
- func (bs *BufferList) DrawHorizontalBufferList(vx *Vaxis, x0, y0, width int, offset *int)
- func (bs *BufferList) DrawTimeline(ui *UI, x0, y0, nickColWidth int)
- func (bs *BufferList) DrawVerticalBufferList(vx *Vaxis, x0, y0, width, height int, offset *int)
- func (bs *BufferList) FilterBuffers(enable bool, query string)
- func (bs *BufferList) Focused() bool
- func (bs *BufferList) GetLeftMost(screenWidth int) int
- func (bs *BufferList) GetMuted(netID, title string) bool
- func (bs *BufferList) GetPinned(netID, title string) bool
- func (bs *BufferList) HasOverlay() bool
- func (bs *BufferList) Highlights() int
- func (bs *BufferList) HorizontalBufferOffset(x int, offset int) int
- func (bs *BufferList) LinesAboveOffset() int
- func (bs *BufferList) Next()
- func (bs *BufferList) NextUnread()
- func (bs *BufferList) OpenOverlay()
- func (bs *BufferList) Previous()
- func (bs *BufferList) PreviousUnread()
- func (bs *BufferList) Remove(netID, title string) bool
- func (bs *BufferList) RemoveNetwork(netID string)
- func (bs *BufferList) ResizeTimeline(tlInnerWidth, tlHeight, textWidth int)
- func (bs *BufferList) ScrollDown(n int)
- func (bs *BufferList) ScrollDownHighlight() bool
- func (bs *BufferList) ScrollTopicLeft(n int)
- func (bs *BufferList) ScrollTopicRight(n int)
- func (bs *BufferList) ScrollUp(n int)
- func (bs *BufferList) ScrollUpHighlight() bool
- func (bs *BufferList) SetFocused(focused bool)
- func (bs *BufferList) SetMuted(netID, title string, muted bool)
- func (bs *BufferList) SetPinned(netID, title string, pinned bool)
- func (bs *BufferList) SetRead(netID, title string, timestamp time.Time)
- func (bs *BufferList) SetTopic(netID, title string, topic StyledString)
- func (bs *BufferList) To(i int) bool
- func (bs *BufferList) UpdateRead() (netID, title string, timestamp time.Time)
- func (bs *BufferList) VerticalBufferOffset(y int, offset int) int
- type ColorScheme
- type ColorSchemeType
- type Completion
- type Config
- type ConfigColors
- type Editor
- func (e *Editor) AsyncCompletions(id int, cs []Completion)
- func (e *Editor) AutoComplete() (ok bool)
- func (e *Editor) BackSearch()
- func (e *Editor) Clear() bool
- func (e *Editor) Content() []rune
- func (e *Editor) Down()
- func (e *Editor) Draw(vx *Vaxis, x0, y int, hint string)
- func (e *Editor) Empty() bool
- func (e *Editor) End()
- func (e *Editor) Enter() bool
- func (e *Editor) Flush() string
- func (e *Editor) Home()
- func (e *Editor) Left()
- func (e *Editor) LeftWord()
- func (e *Editor) PutRune(r rune)
- func (e *Editor) RemCluster() (ok bool)
- func (e *Editor) RemClusterForward() (ok bool)
- func (e *Editor) RemWord() (ok bool)
- func (e *Editor) Resize(width int)
- func (e *Editor) Right()
- func (e *Editor) RightWord()
- func (e *Editor) Set(text string)
- func (e *Editor) Up()
- type Line
- type NotifyEvent
- type NotifyType
- type StyledString
- type StyledStringBuilder
- type UI
- func (ui *UI) AddBuffer(netID, netName, title string) (i int, added bool)
- func (ui *UI) AddLine(netID, buffer string, line Line)
- func (ui *UI) AddLines(netID, buffer string, before, after []Line)
- func (ui *UI) AsyncCompletions(id int, cs []Completion)
- func (ui *UI) Beep()
- func (ui *UI) Buffer(i int) (netID, title string, ok bool)
- func (ui *UI) ChannelColClicked() bool
- func (ui *UI) ChannelWidth() int
- func (ui *UI) Click(x, y int, event vaxis.Mouse)
- func (ui *UI) ClickBuffer(i int)
- func (ui *UI) ClickChannelCol(v bool)
- func (ui *UI) ClickMember(i int)
- func (ui *UI) ClickMemberCol(v bool)
- func (ui *UI) ClickedBuffer() int
- func (ui *UI) ClickedMember() int
- func (ui *UI) Close()
- func (ui *UI) CloseOverlay()
- func (ui *UI) CurrentBuffer() (netID, title string)
- func (ui *UI) Draw(members []irc.Member)
- func (ui *UI) Exit()
- func (ui *UI) FilterBuffers(enable bool, query string)
- func (ui *UI) Focused() bool
- func (ui *UI) GetMuted(netID, buffer string) bool
- func (ui *UI) GetPinned(netID, buffer string) bool
- func (ui *UI) GoToBufferNo(i int)
- func (ui *UI) HasEvent(x, y int) bool
- func (ui *UI) HasOverlay() bool
- func (ui *UI) Highlights() int
- func (ui *UI) HorizontalBufferOffset(x int) int
- func (ui *UI) IdentColor(scheme ColorScheme, ident string, self bool) vaxis.Color
- func (ui *UI) IdentString(scheme ColorScheme, ident string, self bool) StyledString
- func (ui *UI) ImageReady() bool
- func (ui *UI) InputAutoComplete() (ok bool)
- func (ui *UI) InputBackSearch()
- func (ui *UI) InputBackspace() (ok bool)
- func (ui *UI) InputClear() bool
- func (ui *UI) InputContent() []rune
- func (ui *UI) InputDelete() (ok bool)
- func (ui *UI) InputDeleteWord() (ok bool)
- func (ui *UI) InputDown()
- func (ui *UI) InputEnd()
- func (ui *UI) InputEnter() bool
- func (ui *UI) InputFlush() (content string)
- func (ui *UI) InputHome()
- func (ui *UI) InputLeft()
- func (ui *UI) InputLeftWord()
- func (ui *UI) InputRight()
- func (ui *UI) InputRightWord()
- func (ui *UI) InputRune(r rune)
- func (ui *UI) InputSet(text string)
- func (ui *UI) InputUp()
- func (ui *UI) JumpBuffer(sub string) bool
- func (ui *UI) JumpBufferIndex(i int) bool
- func (ui *UI) JumpBufferNetwork(netID, buffer string) bool
- func (ui *UI) LinesAboveOffset() int
- func (ui *UI) MemberColClicked() bool
- func (ui *UI) MemberOffset() int
- func (ui *UI) MemberWidth() int
- func (ui *UI) NextBuffer()
- func (ui *UI) NextUnreadBuffer()
- func (ui *UI) Notify(title string, body string)
- func (ui *UI) OpenOverlay(hint string)
- func (ui *UI) PreviousBuffer()
- func (ui *UI) PreviousUnreadBuffer()
- func (ui *UI) RemoveBuffer(netID, title string)
- func (ui *UI) RemoveNetworkBuffers(netID string)
- func (ui *UI) Resize()
- func (ui *UI) ResizeChannelCol(x int)
- func (ui *UI) ResizeMemberCol(x int)
- func (ui *UI) ScrollChannelDownBy(n int)
- func (ui *UI) ScrollChannelUpBy(n int)
- func (ui *UI) ScrollDown()
- func (ui *UI) ScrollDownBy(n int)
- func (ui *UI) ScrollDownHighlight() bool
- func (ui *UI) ScrollMemberDownBy(n int)
- func (ui *UI) ScrollMemberUpBy(n int)
- func (ui *UI) ScrollToBuffer()
- func (ui *UI) ScrollTopicLeftBy(n int)
- func (ui *UI) ScrollTopicRightBy(n int)
- func (ui *UI) ScrollUp()
- func (ui *UI) ScrollUpBy(n int)
- func (ui *UI) ScrollUpHighlight() bool
- func (ui *UI) SetColorTheme(mode vaxis.ColorThemeMode)
- func (ui *UI) SetFocused(focused bool)
- func (ui *UI) SetMouseShape(shape vaxis.MouseShape)
- func (ui *UI) SetMuted(netID, buffer string, muted bool)
- func (ui *UI) SetPinned(netID, buffer string, pinned bool)
- func (ui *UI) SetPrompt(prompt StyledString)
- func (ui *UI) SetRead(netID, buffer string, timestamp time.Time)
- func (ui *UI) SetStatus(status string)
- func (ui *UI) SetTitle(title string)
- func (ui *UI) SetTopic(netID, buffer string, topic StyledString)
- func (ui *UI) ShouldExit() bool
- func (ui *UI) ShowImage(img image.Image) bool
- func (ui *UI) Size() (int, int)
- func (ui *UI) ToggleChannelList()
- func (ui *UI) ToggleMemberList()
- func (ui *UI) UpdateRead() (netID, buffer string, timestamp time.Time)
- func (ui *UI) VerticalBufferOffset(y int) int
- type Vaxis
Constants ¶
View Source
const Overlay = "/overlay"
Variables ¶
View Source
var ColorDefault = vaxis.Color(0)
View Source
var ColorGreen = vaxis.IndexColor(2)
View Source
var ColorRed = vaxis.IndexColor(9)
Functions ¶
func IsSplitRune ¶
func NotifyStart ¶
func NotifyStart(opened func(*NotifyEvent))
func NotifyStop ¶
func NotifyStop()
Types ¶
type BufferList ¶
type BufferList struct {
// contains filtered or unexported fields
}
func NewBufferList ¶
func NewBufferList(ui *UI) BufferList
NewBufferList returns a new BufferList. Call Resize() once before using it.
func (*BufferList) Add ¶
func (bs *BufferList) Add(netID, netName, title string) (i int, added bool)
func (*BufferList) AddLine ¶
func (bs *BufferList) AddLine(netID, title string, line Line)
func (*BufferList) AddLines ¶
func (bs *BufferList) AddLines(netID, title string, before, after []Line)
func (*BufferList) CloseOverlay ¶
func (bs *BufferList) CloseOverlay()
func (*BufferList) Current ¶
func (bs *BufferList) Current() (netID, title string)
func (*BufferList) DrawHorizontalBufferList ¶
func (bs *BufferList) DrawHorizontalBufferList(vx *Vaxis, x0, y0, width int, offset *int)
func (*BufferList) DrawTimeline ¶
func (bs *BufferList) DrawTimeline(ui *UI, x0, y0, nickColWidth int)
func (*BufferList) DrawVerticalBufferList ¶
func (bs *BufferList) DrawVerticalBufferList(vx *Vaxis, x0, y0, width, height int, offset *int)
func (*BufferList) FilterBuffers ¶
func (bs *BufferList) FilterBuffers(enable bool, query string)
func (*BufferList) Focused ¶
func (bs *BufferList) Focused() bool
func (*BufferList) GetLeftMost ¶
func (bs *BufferList) GetLeftMost(screenWidth int) int
func (*BufferList) GetMuted ¶
func (bs *BufferList) GetMuted(netID, title string) bool
func (*BufferList) GetPinned ¶
func (bs *BufferList) GetPinned(netID, title string) bool
func (*BufferList) HasOverlay ¶
func (bs *BufferList) HasOverlay() bool
func (*BufferList) Highlights ¶
func (bs *BufferList) Highlights() int
func (*BufferList) HorizontalBufferOffset ¶
func (bs *BufferList) HorizontalBufferOffset(x int, offset int) int
func (*BufferList) LinesAboveOffset ¶
func (bs *BufferList) LinesAboveOffset() int
LinesAboveOffset returns a rough approximate of the number of lines above the offset (that is, starting from the bottom of the screen, up to the first line).
func (*BufferList) Next ¶
func (bs *BufferList) Next()
func (*BufferList) NextUnread ¶
func (bs *BufferList) NextUnread()
func (*BufferList) OpenOverlay ¶
func (bs *BufferList) OpenOverlay()
func (*BufferList) Previous ¶
func (bs *BufferList) Previous()
func (*BufferList) PreviousUnread ¶
func (bs *BufferList) PreviousUnread()
func (*BufferList) Remove ¶
func (bs *BufferList) Remove(netID, title string) bool
func (*BufferList) RemoveNetwork ¶
func (bs *BufferList) RemoveNetwork(netID string)
func (*BufferList) ResizeTimeline ¶
func (bs *BufferList) ResizeTimeline(tlInnerWidth, tlHeight, textWidth int)
func (*BufferList) ScrollDown ¶
func (bs *BufferList) ScrollDown(n int)
func (*BufferList) ScrollDownHighlight ¶
func (bs *BufferList) ScrollDownHighlight() bool
func (*BufferList) ScrollTopicLeft ¶
func (bs *BufferList) ScrollTopicLeft(n int)
func (*BufferList) ScrollTopicRight ¶
func (bs *BufferList) ScrollTopicRight(n int)
func (*BufferList) ScrollUp ¶
func (bs *BufferList) ScrollUp(n int)
func (*BufferList) ScrollUpHighlight ¶
func (bs *BufferList) ScrollUpHighlight() bool
func (*BufferList) SetFocused ¶
func (bs *BufferList) SetFocused(focused bool)
func (*BufferList) SetMuted ¶
func (bs *BufferList) SetMuted(netID, title string, muted bool)
func (*BufferList) SetPinned ¶
func (bs *BufferList) SetPinned(netID, title string, pinned bool)
func (*BufferList) SetRead ¶
func (bs *BufferList) SetRead(netID, title string, timestamp time.Time)
func (*BufferList) SetTopic ¶
func (bs *BufferList) SetTopic(netID, title string, topic StyledString)
func (*BufferList) To ¶
func (bs *BufferList) To(i int) bool
func (*BufferList) UpdateRead ¶
func (bs *BufferList) UpdateRead() (netID, title string, timestamp time.Time)
func (*BufferList) VerticalBufferOffset ¶
func (bs *BufferList) VerticalBufferOffset(y int, offset int) int
type ColorScheme ¶
type ColorScheme struct { Type ColorSchemeType Others vaxis.Color Self vaxis.Color }
type ColorSchemeType ¶
type ColorSchemeType int
const ( ColorSchemeBase ColorSchemeType = iota ColorSchemeExtended ColorSchemeFixed )
type Completion ¶
type Config ¶
type Config struct { NickColWidth int ChanColWidth int ChanColEnabled bool MemberColWidth int MemberColEnabled bool TextMaxWidth int AutoComplete func(cursorIdx int, text []rune) []Completion Mouse bool MergeLine func(former *Line, addition Line) Colors ConfigColors LocalIntegrations bool WithConsole console.Console WithTTY string }
type ConfigColors ¶
type Editor ¶
type Editor struct {
// contains filtered or unexported fields
}
Editor is the text field where the user writes messages and commands.
func (*Editor) AsyncCompletions ¶
func (e *Editor) AsyncCompletions(id int, cs []Completion)
func (*Editor) AutoComplete ¶
func (*Editor) BackSearch ¶
func (e *Editor) BackSearch()
func (*Editor) RemCluster ¶
func (*Editor) RemClusterForward ¶
type Line ¶
type Line struct { At time.Time Head string Body StyledString HeadColor vaxis.Color Notify NotifyType Highlight bool Readable bool Mergeable bool Data interface{} // contains filtered or unexported fields }
type NotifyEvent ¶
type NotifyType ¶
type NotifyType int
const ( NotifyNone NotifyType = iota NotifyUnread NotifyHighlight )
type StyledString ¶
type StyledString struct {
// contains filtered or unexported fields
}
func IRCString ¶
func IRCString(raw string) StyledString
func PlainSprintf ¶
func PlainSprintf(format string, a ...interface{}) StyledString
func PlainString ¶
func PlainString(s string) StyledString
func (StyledString) ParseURLs ¶
func (s StyledString) ParseURLs() StyledString
func (StyledString) String ¶
func (s StyledString) String() string
type StyledStringBuilder ¶
func (*StyledStringBuilder) AddStyle ¶
func (sb *StyledStringBuilder) AddStyle(start int, style vaxis.Style)
func (*StyledStringBuilder) Reset ¶
func (sb *StyledStringBuilder) Reset()
func (*StyledStringBuilder) SetStyle ¶
func (sb *StyledStringBuilder) SetStyle(style vaxis.Style)
func (*StyledStringBuilder) StyledString ¶
func (sb *StyledStringBuilder) StyledString() StyledString
func (*StyledStringBuilder) WriteStyledString ¶
func (sb *StyledStringBuilder) WriteStyledString(s StyledString)
type UI ¶
type UI struct { Events chan any // contains filtered or unexported fields }
func (*UI) AsyncCompletions ¶
func (ui *UI) AsyncCompletions(id int, cs []Completion)
func (*UI) ChannelColClicked ¶
func (*UI) ChannelWidth ¶
func (*UI) ClickBuffer ¶
func (*UI) ClickChannelCol ¶
func (*UI) ClickMember ¶
func (*UI) ClickMemberCol ¶
func (*UI) ClickedBuffer ¶
func (*UI) ClickedMember ¶
func (*UI) CloseOverlay ¶
func (ui *UI) CloseOverlay()
func (*UI) CurrentBuffer ¶
func (*UI) FilterBuffers ¶
func (*UI) GoToBufferNo ¶
func (*UI) HasOverlay ¶
func (*UI) Highlights ¶
func (*UI) HorizontalBufferOffset ¶
func (*UI) IdentColor ¶
func (*UI) IdentString ¶
func (ui *UI) IdentString(scheme ColorScheme, ident string, self bool) StyledString
func (*UI) ImageReady ¶
func (*UI) InputAutoComplete ¶
func (*UI) InputBackSearch ¶
func (ui *UI) InputBackSearch()
func (*UI) InputBackspace ¶
func (*UI) InputClear ¶
func (*UI) InputContent ¶
InputContent result must not be modified.
func (*UI) InputDelete ¶
func (*UI) InputDeleteWord ¶
func (*UI) InputEnter ¶
InputEnter returns true if the event was eaten
func (*UI) InputFlush ¶
func (*UI) InputLeftWord ¶
func (ui *UI) InputLeftWord()
func (*UI) InputRight ¶
func (ui *UI) InputRight()
func (*UI) InputRightWord ¶
func (ui *UI) InputRightWord()
func (*UI) JumpBuffer ¶
func (*UI) JumpBufferIndex ¶
func (*UI) JumpBufferNetwork ¶
func (*UI) LinesAboveOffset ¶
func (*UI) MemberColClicked ¶
func (*UI) MemberOffset ¶
func (*UI) MemberWidth ¶
func (*UI) NextBuffer ¶
func (ui *UI) NextBuffer()
func (*UI) NextUnreadBuffer ¶
func (ui *UI) NextUnreadBuffer()
func (*UI) OpenOverlay ¶
func (*UI) PreviousBuffer ¶
func (ui *UI) PreviousBuffer()
func (*UI) PreviousUnreadBuffer ¶
func (ui *UI) PreviousUnreadBuffer()
func (*UI) RemoveBuffer ¶
func (*UI) RemoveNetworkBuffers ¶
func (*UI) ResizeChannelCol ¶
func (*UI) ResizeMemberCol ¶
func (*UI) ScrollChannelDownBy ¶
func (*UI) ScrollChannelUpBy ¶
func (*UI) ScrollDown ¶
func (ui *UI) ScrollDown()
func (*UI) ScrollDownBy ¶
func (*UI) ScrollDownHighlight ¶
func (*UI) ScrollMemberDownBy ¶
func (*UI) ScrollMemberUpBy ¶
func (*UI) ScrollToBuffer ¶
func (ui *UI) ScrollToBuffer()
func (*UI) ScrollTopicLeftBy ¶
func (*UI) ScrollTopicRightBy ¶
func (*UI) ScrollUpBy ¶
func (*UI) ScrollUpHighlight ¶
func (*UI) SetColorTheme ¶
func (ui *UI) SetColorTheme(mode vaxis.ColorThemeMode)
func (*UI) SetFocused ¶
func (*UI) SetMouseShape ¶
func (ui *UI) SetMouseShape(shape vaxis.MouseShape)
func (*UI) SetPrompt ¶
func (ui *UI) SetPrompt(prompt StyledString)
func (*UI) SetTopic ¶
func (ui *UI) SetTopic(netID, buffer string, topic StyledString)
func (*UI) ShouldExit ¶
func (*UI) ToggleChannelList ¶
func (ui *UI) ToggleChannelList()
func (*UI) ToggleMemberList ¶
func (ui *UI) ToggleMemberList()
func (*UI) VerticalBufferOffset ¶
Click to show internal directories.
Click to hide internal directories.