gui

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2018 License: MIT Imports: 17 Imported by: 2

Documentation

Index

Constants

This section is empty.

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
)

Functions

func CloseBuffer

func CloseBuffer(v *View) bool

func DeleteLine

func DeleteLine(v *View) bool

func Paste

func Paste(v *View) bool

func Save

func Save(v *View) bool

func ShowPalette added in v0.1.1

func ShowPalette(v *View) bool

Types

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) bool) BufferAction

type BufferConfig added in v0.1.1

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

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

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
}

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)

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) 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