gui

package
v0.0.0-...-49e7bce Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2018 License: MIT Imports: 13 Imported by: 0

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(b *Buffer) bool

func DeleteLine

func DeleteLine(b *Buffer) bool

func Dispose

func Dispose(c Component)

func HandleEvent

func HandleEvent(comp Component, evt strife.StrifeEvent)

func Init

func Init(c Component)

func Render

func Render(c Component, ctx *strife.Renderer)

func Save

func Save(b *Buffer) bool

func Update

func Update(c Component) bool

Types

type BaseComponent

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

func (*BaseComponent) AddComponent

func (b *BaseComponent) AddComponent(c Component)

func (*BaseComponent) DeleteComponent

func (b *BaseComponent) DeleteComponent(index int)

func (*BaseComponent) GetComponents

func (b *BaseComponent) GetComponents() []Component

func (*BaseComponent) GetInputHandler

func (b *BaseComponent) GetInputHandler() *InputHandler

func (*BaseComponent) HandleEvent

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

func (*BaseComponent) NumComponents

func (b *BaseComponent) NumComponents() int

func (*BaseComponent) Resize

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

func (*BaseComponent) SetInputHandler

func (b *BaseComponent) SetInputHandler(i *InputHandler)

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
	HasFocus bool
	// contains filtered or unexported fields
}

func NewBuffer

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

func (*Buffer) HandleEvent

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

func (*Buffer) OnDispose

func (b *Buffer) OnDispose()

func (*Buffer) OnInit

func (b *Buffer) OnInit()

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 func(*Buffer) bool

type CommandBuffer

type CommandBuffer struct {
	*Buffer
}

type CommandPalette

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

func NewCommandPalette

func NewCommandPalette() *CommandPalette

func (*CommandPalette) OnDispose

func (p *CommandPalette) OnDispose()

func (*CommandPalette) OnInit

func (p *CommandPalette) OnInit()

func (*CommandPalette) OnRender

func (c *CommandPalette) OnRender(ctx *sdl.Renderer)

func (*CommandPalette) OnUpdate

func (c *CommandPalette) OnUpdate()

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)

	GetInputHandler() *InputHandler
	SetInputHandler(h *InputHandler)
}

type Cursor

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

type InputHandler

type InputHandler struct {
	Event sdl.Event
}

type Panel

type Panel struct {
	BaseComponent
}

func NewPanel

func NewPanel(input *InputHandler) *Panel

func (*Panel) OnDispose

func (p *Panel) OnDispose()

func (*Panel) OnInit

func (p *Panel) OnInit()

func (*Panel) OnRender

func (p *Panel) OnRender(ctx *strife.Renderer)

func (*Panel) OnUpdate

func (p *Panel) OnUpdate() bool

type View

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

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

Jump to

Keyboard shortcuts

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