gui

package
Version: v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2018 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_SCROLL_AMOUNT = 10
)

Variables

View Source
var (
	SHIFT_DOWN   bool = false
	SUPER_DOWN        = false // cmd on mac, ctrl on windows
	CONTROL_DOWN      = false // what is this on windows?
	ALT_DOWN          = false // option on mac
	CAPS_LOCK         = false
)
View Source
var DEBUG_MODE = false

Functions

func CloseBuffer

func CloseBuffer(v *View, commands []string) bool

func DeleteLine

func DeleteLine(v *View, commands []string) bool

func ExitPhi

func ExitPhi(v *View, commands []string) bool

func GotoLine

func GotoLine(v *View, commands []string) bool

func NewFile

func NewFile(v *View, commands []string) bool

func OpenFile

func OpenFile(v *View, commands []string) bool

func Paste

func Paste(v *View, commands []string) bool

func Redo

func Redo(v *View, commands []string) bool

func Save

func Save(v *View, commands []string) bool

func ShowPalette

func ShowPalette(v *View, commands []string) bool

func Undo

func Undo(v *View, commands []string) bool

Types

type AutoCompleteBox

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

TODO maybe have a thread that finds words in the current file and adds them to the vocabulary.

type BaseComponent

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

func (*BaseComponent) HandleEvent

func (b *BaseComponent) HandleEvent(evt strife.StrifeEvent)

func (*BaseComponent) HasFocus

func (b *BaseComponent) HasFocus() bool

func (*BaseComponent) Resize

func (b *BaseComponent) Resize(w, h int)

func (*BaseComponent) SetFocus

func (b *BaseComponent) SetFocus(focus bool)

func (*BaseComponent) SetPosition

func (b *BaseComponent) SetPosition(x, y int)

func (*BaseComponent) Translate

func (b *BaseComponent) Translate(x, y int)

type Buffer

type Buffer struct {
	BaseComponent
	// contains filtered or unexported fields
}

func NewBuffer

func NewBuffer(conf *cfg.TomlConfig, buffOpts BufferConfig, parent *View, index int) *Buffer

func (*Buffer) HandleEvent

func (b *Buffer) HandleEvent(evt strife.StrifeEvent)

func (*Buffer) OnRender

func (b *Buffer) OnRender(ctx *strife.Renderer)

func (*Buffer) OnUpdate

func (b *Buffer) OnUpdate() bool

func (*Buffer) OpenFile

func (b *Buffer) OpenFile(filePath string)

type BufferAction

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

func NewBufferAction

func NewBufferAction(name string, proc func(*View, []string) bool) BufferAction

type BufferConfig

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

type BufferPane

type BufferPane struct {
	BaseComponent
	Buff *Buffer
	// contains filtered or unexported fields
}

func NewBufferPane

func NewBufferPane(buff *Buffer) *BufferPane

func (*BufferPane) OnRender

func (b *BufferPane) OnRender(ctx *strife.Renderer)

func (*BufferPane) OnUpdate

func (b *BufferPane) OnUpdate() bool

func (*BufferPane) Resize

func (b *BufferPane) Resize(w, h int)

func (*BufferPane) SetFocus

func (b *BufferPane) SetFocus(focus bool)

func (*BufferPane) SetPosition

func (b *BufferPane) SetPosition(x, y int)

type CommandPalette

type CommandPalette struct {
	BaseComponent
	// contains filtered or unexported fields
}

func NewCommandPalette

func NewCommandPalette(conf cfg.TomlConfig, view *View) *CommandPalette

func (*CommandPalette) OnRender

func (b *CommandPalette) OnRender(ctx *strife.Renderer)

func (*CommandPalette) OnUpdate

func (b *CommandPalette) OnUpdate() bool

func (*CommandPalette) SetFocus

func (p *CommandPalette) SetFocus(focus bool)

type Component

type Component interface {
	SetPosition(x, y int)
	Translate(x, y int)
	Resize(w, h int)

	OnInit()
	OnUpdate() bool
	OnRender(*strife.Renderer)
	OnDispose()

	NumComponents() int
	AddComponent(c Component)
	GetComponents() []Component

	HandleEvent(evt strife.StrifeEvent)

	SetFocus(focus bool)
	HasFocus() bool
}

type Cursor

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

func (*Cursor) Render

func (c *Cursor) Render(ctx *strife.Renderer, xOff, yOff int)

func (*Cursor) SetSize

func (c *Cursor) SetSize(w, h int)

type ReloadBufferEvent

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

func (*ReloadBufferEvent) Process

func (r *ReloadBufferEvent) Process(view *View)

func (*ReloadBufferEvent) String

func (r *ReloadBufferEvent) String() string

type View

type View struct {
	BaseComponent
	// contains filtered or unexported fields
}

View is an array of buffers basically.

func NewView

func NewView(width, height int, conf *cfg.TomlConfig) *View

func (*View) AddBuffer

func (n *View) AddBuffer() *Buffer

func (*View) ChangeFocus

func (n *View) ChangeFocus(dir int)

FIXME

func (*View) Close

func (n *View) Close()

func (*View) OnDispose

func (n *View) OnDispose()

func (*View) OnInit

func (n *View) OnInit()

func (*View) OnRender

func (n *View) OnRender(ctx *strife.Renderer)

func (*View) OnUpdate

func (n *View) OnUpdate() bool

func (*View) Resize

func (n *View) Resize(w, h int)

func (*View) UnfocusBuffers

func (n *View) UnfocusBuffers()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto