Documentation
¶
Overview ¶
pkg/backend/terminal/color.go
Index ¶
- type Buffer
- func (b *Buffer) Clear()
- func (b *Buffer) CopyFrom(other *Buffer)
- func (b *Buffer) GetCell(x, y int) (Cell, bool)
- func (b *Buffer) GetCursor() geometry.Point
- func (b *Buffer) MoveCursor(dx, dy int)
- func (b *Buffer) Resize(size geometry.Size)
- func (b *Buffer) SetCell(x, y int, ch rune, combining []rune, style tcell.Style)
- func (b *Buffer) SetCursor(x, y int)
- func (b *Buffer) Size() geometry.Size
- type Capabilities
- type Cell
- type ClipboardProvider
- type ColorMode
- type ColorOptimizer
- type Config
- type Event
- type FallbackClipboard
- type KeyEvent
- type MouseEvent
- type MouseMode
- type StyleMask
- type SystemClipboard
- type Terminal
- func (t *Terminal) Capabilities() Capabilities
- func (t *Terminal) Clear()
- func (t *Terminal) ColorMode() ColorMode
- func (t *Terminal) DisableCombiningChars()
- func (t *Terminal) DisableMouse()
- func (t *Terminal) DisableUnicode()
- func (t *Terminal) DrawCell(x, y int, ch rune, fg, bg color.Color)
- func (t *Terminal) DrawRegion(region geometry.Rect, style tcell.Style, ch rune)
- func (t *Terminal) DrawStyledCell(x, y int, ch rune, fg, bg color.Color, style StyleMask)
- func (t *Terminal) DrawText(x, y int, text string, fg, bg color.Color, style StyleMask)
- func (t *Terminal) EnableCombiningChars()
- func (t *Terminal) EnableMouse()
- func (t *Terminal) EnableUnicode()
- func (t *Terminal) EnterAltScreen() error
- func (t *Terminal) ExitAltScreen() error
- func (t *Terminal) GetClipboard() (string, error)
- func (t *Terminal) GetCursor() geometry.Point
- func (t *Terminal) GetTitle() string
- func (t *Terminal) HandleEvents(handler func(Event) bool)
- func (t *Terminal) HideCursor()
- func (t *Terminal) Init() error
- func (t *Terminal) OnFocusChange(callback func(bool))
- func (t *Terminal) OnResize(callback func(geometry.Size))
- func (t *Terminal) OnResume(callback func())
- func (t *Terminal) OnSuspend(callback func())
- func (t *Terminal) Present() error
- func (t *Terminal) Resume() error
- func (t *Terminal) SetClipboard(content string) error
- func (t *Terminal) SetCursor(x, y int)
- func (t *Terminal) SetMouseMode(mode MouseMode)
- func (t *Terminal) SetTitle(title string)
- func (t *Terminal) Shutdown() error
- func (t *Terminal) Size() geometry.Size
- func (t *Terminal) StringWidth(s string) int
- func (t *Terminal) SupportsColor() bool
- func (t *Terminal) SupportsTrueColor() bool
- func (t *Terminal) SupportsUnicode() bool
- func (t *Terminal) Suspend() error
- func (t *Terminal) SwapBuffers()
- func (t *Terminal) Sync()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
Buffer represents a screen buffer
func (*Buffer) MoveCursor ¶
MoveCursor moves the cursor relative to its current position
type Capabilities ¶
type Capabilities struct { ColorMode ColorMode Unicode bool Italic bool Strikethrough bool Mouse bool ModifiedKeys bool BracketedPaste bool URLs bool Title bool }
Capabilities represents what the terminal supports
func DetectCapabilities ¶
func DetectCapabilities(screen tcell.Screen) Capabilities
DetectCapabilities returns the terminal's capabilities
type ClipboardProvider ¶
ClipboardProvider defines the interface for clipboard operations
type ColorOptimizer ¶
type ColorOptimizer struct {
// contains filtered or unexported fields
}
ColorOptimizer handles color optimization and caching
func NewColorOptimizer ¶
func NewColorOptimizer(mode ColorMode) *ColorOptimizer
func (*ColorOptimizer) GetColor ¶
func (co *ColorOptimizer) GetColor(c color.Color) tcell.Color
GetColor returns an optimized tcell.Color for the given core_color.Color
type Config ¶
type Config struct { EnableMouse bool MouseMode MouseMode ColorMode tcell.Color PollInterval time.Duration HandleSuspend bool HandleResize bool CaptureEvents bool }
Config holds terminal configuration
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns the default terminal configuration
type FallbackClipboard ¶
type FallbackClipboard struct {
// contains filtered or unexported fields
}
FallbackClipboard provides in-memory clipboard when system clipboard is unavailable
func (*FallbackClipboard) Get ¶
func (c *FallbackClipboard) Get() (string, error)
func (*FallbackClipboard) Set ¶
func (c *FallbackClipboard) Set(content string) error
type KeyEvent ¶
type KeyEvent struct { Key tcell.Key Rune rune Modifiers tcell.ModMask // contains filtered or unexported fields }
Event types for the terminal
type MouseEvent ¶
type MouseEvent struct { Buttons tcell.ButtonMask Position geometry.Point // contains filtered or unexported fields }
func (MouseEvent) When ¶
func (e MouseEvent) When() time.Time
type SystemClipboard ¶
type SystemClipboard struct{}
SystemClipboard implements platform-specific clipboard operations
func (*SystemClipboard) Get ¶
func (c *SystemClipboard) Get() (string, error)
func (*SystemClipboard) Set ¶
func (c *SystemClipboard) Set(content string) error
type Terminal ¶
type Terminal struct {
// contains filtered or unexported fields
}
Terminal represents a terminal backend
func NewWithConfig ¶
NewWithConfig creates a new terminal with the provided configuration
func NewWithScreen ¶
NewWithScreen creates a new terminal with a provided screen
func (*Terminal) Capabilities ¶
func (t *Terminal) Capabilities() Capabilities
func (*Terminal) DisableCombiningChars ¶
func (t *Terminal) DisableCombiningChars()
func (*Terminal) DisableMouse ¶
func (t *Terminal) DisableMouse()
func (*Terminal) DisableUnicode ¶
func (t *Terminal) DisableUnicode()
func (*Terminal) DrawRegion ¶
func (*Terminal) DrawStyledCell ¶
func (*Terminal) DrawText ¶
DrawText draws a string of text, handling combining characters appropriately
func (*Terminal) EnableCombiningChars ¶
func (t *Terminal) EnableCombiningChars()
func (*Terminal) EnableMouse ¶
func (t *Terminal) EnableMouse()
func (*Terminal) EnableUnicode ¶
func (t *Terminal) EnableUnicode()
func (*Terminal) EnterAltScreen ¶
func (*Terminal) ExitAltScreen ¶
func (*Terminal) GetClipboard ¶
GetClipboard retrieves the clipboard content
func (*Terminal) HandleEvents ¶
Add this new method
func (*Terminal) HideCursor ¶
func (t *Terminal) HideCursor()
func (*Terminal) OnFocusChange ¶
func (*Terminal) SetClipboard ¶
SetClipboard sets the clipboard content
func (*Terminal) SetMouseMode ¶
func (*Terminal) StringWidth ¶
func (*Terminal) SupportsColor ¶
func (*Terminal) SupportsTrueColor ¶
func (*Terminal) SupportsUnicode ¶
func (*Terminal) SwapBuffers ¶
func (t *Terminal) SwapBuffers()
SwapBuffers swaps the front and back buffers