Documentation ¶
Overview ¶
import "code.dopame.me/veonik/squirssi"
Index ¶
- Constants
- func DisableMouseInput()
- func HandleIRCEvent(srv *Server, h IRCEventHandler) event.Handler
- func HandleUIEvent(srv *Server, fn UIHandler) event.Handler
- func Initialize(m *plugin.Manager) (plugin.Plugin, error)
- func Write329(win Window, created time.Time)
- func Write331(win Window)
- func Write332(win Window, topic string)
- func WriteAction(win Window, nick Nick, message Message)
- func WriteCTCP(win Window, target Target, sent bool, message string)
- func WriteError(win Window, name, message string)
- func WriteEval(win Window, script string)
- func WriteEvalError(win Window, script string)
- func WriteEvalResult(win Window, script string)
- func WriteHelp(win Window, cmd string, desc string)
- func WriteHelpGeneric(win Window, msg string)
- func WriteJoin(win Window, nick Nick)
- func WriteKick(win Window, kicker Nick, kicked Nick, message string)
- func WriteMessage(win Window, message string)
- func WriteMode(win Window, nick Nick, mode string)
- func WriteModes(win Window, modes string)
- func WriteNick(wm *WindowManager, nick Nick, newNick Nick)
- func WriteNotice(win Window, target Target, sent bool, message string)
- func WritePart(win Window, nick Nick, message string)
- func WritePrefixed(win Window, prefix StyledString, message string) error
- func WritePrivmsg(win Window, nick Nick, message Message)
- func WriteQuit(wm *WindowManager, nick Nick, message string)
- func WriteRaw(win Window, raw string)
- func WriteTopic(win Window, nick Nick, topic string)
- func WriteWhois(win Window, nick string, args []string)
- type Channel
- func (c *Channel) AddUser(user User)
- func (c *Channel) AutoScroll() bool
- func (c *Channel) CurrentLine() int
- func (c *Channel) DeleteUser(name string) bool
- func (c *Channel) HasActivity() bool
- func (c *Channel) HasNotice() bool
- func (c *Channel) HasUser(name string) bool
- func (c *Channel) Lines() []string
- func (c *Channel) Modes() string
- func (c *Channel) Notice()
- func (c *Channel) ScrollTo(pos int)
- func (c *Channel) SetUsers(users []string)
- func (c *Channel) Title() string
- func (c *Channel) Topic() string
- func (c *Channel) Touch()
- func (c *Channel) UpdateUser(name, newName string) bool
- func (c *Channel) UserList() []string
- func (c *Channel) Users() []string
- func (c *Channel) Write(p []byte) (n int, err error)
- func (c *Channel) WriteString(p string) (n int, err error)
- type Command
- type DirectMessage
- func (c *DirectMessage) AutoScroll() bool
- func (c *DirectMessage) CurrentLine() int
- func (c *DirectMessage) HasActivity() bool
- func (c *DirectMessage) HasNotice() bool
- func (c *DirectMessage) Lines() []string
- func (c *DirectMessage) Notice()
- func (c *DirectMessage) ScrollTo(pos int)
- func (c *DirectMessage) Title() string
- func (c *DirectMessage) Touch()
- func (c *DirectMessage) Write(p []byte) (n int, err error)
- func (c *DirectMessage) WriteString(p string) (n int, err error)
- type HistoryManager
- func (hm *HistoryManager) Append(win Window, input widget.ModedText)
- func (hm *HistoryManager) Current(win Window) widget.ModedText
- func (hm *HistoryManager) Insert(win Window, input widget.ModedText)
- func (hm *HistoryManager) Next(win Window) widget.ModedText
- func (hm *HistoryManager) Previous(win Window) widget.ModedText
- type IRCEvent
- type IRCEventHandler
- type Interrupter
- type Message
- type Nick
- type Server
- func (srv *Server) Close()
- func (srv *Server) CurrentNick() string
- func (srv *Server) IRCDoAsync(fn func(conn *irc.Connection) error)
- func (srv *Server) OnInterrupt(fn Interrupter) *Server
- func (srv *Server) Render()
- func (srv *Server) RenderOnly(items ...screenElement)
- func (srv *Server) Start() error
- func (srv *Server) Update()
- type StatusWindow
- func (c *StatusWindow) AutoScroll() bool
- func (c *StatusWindow) CurrentLine() int
- func (c *StatusWindow) HasActivity() bool
- func (c *StatusWindow) HasNotice() bool
- func (c *StatusWindow) Lines() []string
- func (c *StatusWindow) Notice()
- func (c *StatusWindow) ScrollTo(pos int)
- func (c *StatusWindow) Title() string
- func (c *StatusWindow) Touch()
- func (c *StatusWindow) Write(p []byte) (n int, err error)
- func (c *StatusWindow) WriteString(p string) (n int, err error)
- type StyledString
- type TabCompleter
- type Target
- type UIHandler
- type User
- type Window
- type WindowManager
- func (wm *WindowManager) Active() Window
- func (wm *WindowManager) ActiveIndex() int
- func (wm *WindowManager) Append(w Window)
- func (wm *WindowManager) CloseIndex(ch int)
- func (wm *WindowManager) Index(idx int) Window
- func (wm *WindowManager) Len() int
- func (wm *WindowManager) Named(name string) Window
- func (wm *WindowManager) NamedOrActive(name string) Window
- func (wm *WindowManager) ScrollOffset(offset int)
- func (wm *WindowManager) ScrollTo(pos int)
- func (wm *WindowManager) SelectIndex(idx int)
- func (wm *WindowManager) SelectNext()
- func (wm *WindowManager) SelectPrev()
- func (wm *WindowManager) TabNames() ([]string, map[int]widget.ActivityType)
- func (wm *WindowManager) Windows() []Window
- type WindowWithUserList
Constants ¶
View Source
const ( InputTextBox screenElement = iota StatusBar MainWindow )
Variables ¶
This section is empty.
Functions ¶
func HandleIRCEvent ¶
func HandleIRCEvent(srv *Server, h IRCEventHandler) event.Handler
func WriteAction ¶
func WriteError ¶
func WriteEvalError ¶
func WriteEvalResult ¶
func WriteHelpGeneric ¶
func WriteMessage ¶
func WriteModes ¶
func WriteNick ¶
func WriteNick(wm *WindowManager, nick Nick, newNick Nick)
func WritePrefixed ¶
func WritePrefixed(win Window, prefix StyledString, message string) error
func WritePrivmsg ¶
func WriteQuit ¶
func WriteQuit(wm *WindowManager, nick Nick, message string)
func WriteTopic ¶
func WriteWhois ¶
Types ¶
type Channel ¶
type Channel struct {
// contains filtered or unexported fields
}
func (*Channel) AutoScroll ¶
func (c *Channel) AutoScroll() bool
func (*Channel) CurrentLine ¶
func (c *Channel) CurrentLine() int
func (*Channel) DeleteUser ¶
func (*Channel) HasActivity ¶
func (c *Channel) HasActivity() bool
func (*Channel) UpdateUser ¶
func (*Channel) WriteString ¶
type DirectMessage ¶
type DirectMessage struct {
// contains filtered or unexported fields
}
func (*DirectMessage) AutoScroll ¶
func (c *DirectMessage) AutoScroll() bool
func (*DirectMessage) CurrentLine ¶
func (c *DirectMessage) CurrentLine() int
func (*DirectMessage) HasActivity ¶
func (c *DirectMessage) HasActivity() bool
func (*DirectMessage) WriteString ¶
type HistoryManager ¶
type HistoryManager struct {
// contains filtered or unexported fields
}
func NewHistoryManager ¶
func NewHistoryManager() *HistoryManager
func (*HistoryManager) Append ¶
func (hm *HistoryManager) Append(win Window, input widget.ModedText)
type IRCEvent ¶
type IRCEvent struct { Code string Raw string Nick string // <nick> Host string // <nick>!<usr>@<host> Source string // <host> User string // <usr> Target string Message string Args []string }
func NormalizeIRCEvent ¶
type IRCEventHandler ¶
type Interrupter ¶
type Interrupter func()
type Nick ¶
type Nick struct {
// contains filtered or unexported fields
}
func (Nick) Styled ¶
func (n Nick) Styled() StyledString
type Server ¶
A Server handles user interaction and displaying screen elements.
func (*Server) Close ¶
func (srv *Server) Close()
Close ends the UI session, returning control of stdout.
func (*Server) CurrentNick ¶
func (*Server) IRCDoAsync ¶
func (srv *Server) IRCDoAsync(fn func(conn *irc.Connection) error)
func (*Server) OnInterrupt ¶
func (srv *Server) OnInterrupt(fn Interrupter) *Server
func (*Server) RenderOnly ¶
func (srv *Server) RenderOnly(items ...screenElement)
RenderOnly renders select screen elements rather than the whole screen.
type StatusWindow ¶
type StatusWindow struct {
// contains filtered or unexported fields
}
func (*StatusWindow) AutoScroll ¶
func (c *StatusWindow) AutoScroll() bool
func (*StatusWindow) CurrentLine ¶
func (c *StatusWindow) CurrentLine() int
func (*StatusWindow) HasActivity ¶
func (c *StatusWindow) HasActivity() bool
func (*StatusWindow) Title ¶
func (c *StatusWindow) Title() string
func (*StatusWindow) WriteString ¶
type StyledString ¶
type StyledString struct { Style string // contains filtered or unexported fields }
func Styled ¶
func Styled(s, style string) StyledString
func Unstyled ¶
func Unstyled(s string) StyledString
func (StyledString) String ¶
func (s StyledString) String() string
type TabCompleter ¶
type TabCompleter struct {
// contains filtered or unexported fields
}
func NewTabCompleter ¶
func NewTabCompleter() *TabCompleter
func (*TabCompleter) Active ¶
func (t *TabCompleter) Active() bool
func (*TabCompleter) Clear ¶
func (t *TabCompleter) Clear()
func (*TabCompleter) Tab ¶
func (t *TabCompleter) Tab() string
type Target ¶
func SomeTarget ¶
type Window ¶
type Window interface { io.Writer io.StringWriter // Title of the Window. Title() string // Lines returns the contents of the Window. Lines() []string // CurrentLine returns the bottom-most visible line number, or negative to indicate // the window is pinned to the end of input. CurrentLine() int // ScrollTo sets the current line to pos. Set to negative to pin to the end of input. ScrollTo(pos int) // AutoScroll returns true if automatic scrolling is currently active. AutoScroll() bool // Touch clears the activity indicator for the window, it it's set. Touch() // HasActivity returns true if the Window has new lines since the last touch. HasActivity() bool // Notice set the notice indicator for this Window. Notice() // HasNotice returns true if the Window has new lines considered important since last touch. HasNotice() bool // contains filtered or unexported methods }
type WindowManager ¶
type WindowManager struct {
// contains filtered or unexported fields
}
func NewWindowManager ¶
func NewWindowManager(ev *event.Dispatcher) *WindowManager
func (*WindowManager) Active ¶
func (wm *WindowManager) Active() Window
func (*WindowManager) ActiveIndex ¶
func (wm *WindowManager) ActiveIndex() int
func (*WindowManager) Append ¶
func (wm *WindowManager) Append(w Window)
func (*WindowManager) CloseIndex ¶
func (wm *WindowManager) CloseIndex(ch int)
CloseIndex closes a window denoted by tab index.
func (*WindowManager) Index ¶
func (wm *WindowManager) Index(idx int) Window
func (*WindowManager) Len ¶
func (wm *WindowManager) Len() int
func (*WindowManager) Named ¶
func (wm *WindowManager) Named(name string) Window
Named returns the window with the given name, if it exists.
func (*WindowManager) NamedOrActive ¶
func (wm *WindowManager) NamedOrActive(name string) Window
func (*WindowManager) ScrollOffset ¶
func (wm *WindowManager) ScrollOffset(offset int)
ScrollTo scrolls the currently active window up relative to the current line.
func (*WindowManager) ScrollTo ¶
func (wm *WindowManager) ScrollTo(pos int)
ScrollTo scrolls the currently active window to the given position.
func (*WindowManager) SelectIndex ¶
func (wm *WindowManager) SelectIndex(idx int)
func (*WindowManager) SelectNext ¶
func (wm *WindowManager) SelectNext()
func (*WindowManager) SelectPrev ¶
func (wm *WindowManager) SelectPrev()
func (*WindowManager) TabNames ¶
func (wm *WindowManager) TabNames() ([]string, map[int]widget.ActivityType)
func (*WindowManager) Windows ¶
func (wm *WindowManager) Windows() []Window
type WindowWithUserList ¶
type WindowWithUserList interface { Window // UserList returns the styled list of users. UserList() []string // Users returns just the usernames in the window. Users() []string // HasUser returns true if the window contains the given user. HasUser(name string) bool // UpdateUser updates the user to a new name in the current window. UpdateUser(name, newNew string) bool // DeleteUser removes the user from the current window. DeleteUser(name string) bool }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.