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: 1

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 added in v0.1.6

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

func GotoLine added in v0.1.2

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

func NewFile added in v0.1.2

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

func OpenFile added in v0.1.6

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

func Paste

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

func Redo added in v0.1.7

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

func Save

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

func ShowPalette added in v0.1.1

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

func Undo added in v0.1.7

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

Types

type AutoCompleteBox added in v0.1.3

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 added in v0.1.1

func (b *BaseComponent) HasFocus() bool

func (*BaseComponent) Resize

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

func (*BaseComponent) SetFocus added in v0.1.1

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 added in v0.1.1

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

type BufferConfig added in v0.1.1

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

type BufferPane added in v0.1.2

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

func NewBufferPane added in v0.1.2

func NewBufferPane(buff *Buffer) *BufferPane

func (*BufferPane) OnRender added in v0.1.2

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

func (*BufferPane) OnUpdate added in v0.1.2

func (b *BufferPane) OnUpdate() bool

func (*BufferPane) Resize added in v0.1.2

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

func (*BufferPane) SetFocus added in v0.1.6

func (b *BufferPane) SetFocus(focus bool)

func (*BufferPane) SetPosition added in v0.1.2

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 added in v0.1.6

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 added in v0.1.8

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

func (*Cursor) SetSize added in v0.1.8

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

type ReloadBufferEvent added in v0.1.6

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

func (*ReloadBufferEvent) Process added in v0.1.6

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

func (*ReloadBufferEvent) String added in v0.1.6

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 added in v0.1.6

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 added in v0.1.8

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

func (*View) UnfocusBuffers added in v0.1.1

func (n *View) UnfocusBuffers()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL