Documentation
¶
Index ¶
- Constants
- Variables
- func AttrToStyle(mask mdFormatMask) tc.Style
- func DrawButton(id int, ui *UI)
- func DrawTerminal(id int, ui *UI)
- func ProcessAttr(mask mdFormatMask) (mdFormatMask, bool)
- func ReflowLinesUTF8(lines *[]Span, buf []byte, maxWidth int)
- func Start()
- func WriteMarkdown(id int, termData *TerminalData, inputBuf []byte)
- type AttrRanges
- type Box
- type BoxType
- type ButtonData
- type LayoutData
- type Rect
- type Span
- type TerminalData
- type UI
- func (ui *UI) AddButton(name string, userFunction func()) int
- func (ui *UI) AddTerminal(name string) int
- func (ui *UI) ApplyMouseState()
- func (ui *UI) DrawBorder(id int)
- func (ui *UI) FindAndHighlightRange(id, mX, mY int)
- func (ui *UI) UpdateMouseState()
- func (ui *UI) WriteToBuffer(id int, s string)
- type Zone
Constants ¶
View Source
const ( BOLD mdFormatMask = 1 << 0 ITALIC mdFormatMask = 1 << 1 LINK mdFormatMask = 1 << 2 HEADING mdFormatMask = 1 << 3 LIST mdFormatMask = 1 << 4 HILITE mdFormatMask = 1 << 7 )
View Source
const COLOR_HEADING = 0xE36840
View Source
const COLOR_LINK = 0xC20E68
View Source
const COLOR_LIST = 0x76E3A9
View Source
const TAB_SIZE = 4
Variables ¶
View Source
var ( Hz = time.Second / 60 Mouse struct { X, Y int PrevX, PrevY int Mask tc.ButtonMask PrevMask tc.ButtonMask HotZone Zone ActZone Zone HotID int ActID int } // This can be used to prevent your main function from returning // <-fui.ExitSig // Blocks - signal is sent when fui.Exit is set to true. ExitSig chan interface{} )
View Source
var ( Redraw bool Exit bool )
Global state
Functions ¶
func AttrToStyle ¶
func DrawButton ¶
func DrawTerminal ¶
func ProcessAttr ¶
func ProcessAttr(mask mdFormatMask) (mdFormatMask, bool)
func ReflowLinesUTF8 ¶
func WriteMarkdown ¶
func WriteMarkdown(id int, termData *TerminalData, inputBuf []byte)
Types ¶
type AttrRanges ¶
type LayoutData ¶
Shared fields, hot
type TerminalData ¶
type TerminalData struct {
Buffers [][]byte
Lines [][]Span
Views []int
AttrRanges []AttrRanges
CursorXs []int
CursorYs []int
}
func (*TerminalData) AppendAttrRange ¶
func (td *TerminalData) AppendAttrRange(id, start, end int, attr mdFormatMask)
type UI ¶
type UI struct {
Layout LayoutData
Terms TerminalData
Buttons ButtonData
Names []string
Count int
}
func (*UI) AddTerminal ¶
func (*UI) ApplyMouseState ¶
func (ui *UI) ApplyMouseState()
func (*UI) DrawBorder ¶
func (*UI) FindAndHighlightRange ¶
TODO(Johan): Make more efficient
func (*UI) UpdateMouseState ¶
func (ui *UI) UpdateMouseState()
func (*UI) WriteToBuffer ¶
Directories
¶
| Path | Synopsis |
|---|---|
|
advent-of-code-2025-day10
command
|
|
|
calculator
command
|
|
|
example
command
|
|
|
sandbox
command
|
|
|
internal
|
|
Click to show internal directories.
Click to hide internal directories.