gui

package
v0.0.0-...-799c34b Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoApp = errors.New("no app available")
View Source
var ErrUnableToCreateWin = errors.New("unable to create window")

Functions

func Main

func Main(addr string)

func Start

func Start(loop func(*App)) error

Types

type App

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

func (*App) CellSize

func (a *App) CellSize() screen.Vector2

func (*App) EventChannel

func (a *App) EventChannel() <-chan interface{}

func (*App) GetWindow

func (a *App) GetWindow(id int) Window

func (*App) NewWindow

func (a *App) NewWindow(width, height int) (Window, error)

type ApplicationEvent

type ApplicationEvent struct {
	Event interface{}
}

type Client

type Client struct {
	Addr string
	Conn *websocket.Conn

	ClearBG screen.Color
	// contains filtered or unexported fields
}

func NewClient

func NewClient(addr string, app *App) (*Client, error)

func (*Client) Connect

func (c *Client) Connect() error

func (*Client) Resize

func (c *Client) Resize(w, h int)

func (*Client) SendInput

func (c *Client) SendInput(input string)

type InputEvent

type InputEvent string
type MenuEvent string

type MoveEvent

type MoveEvent struct {
	X int
	Y int
}

type NewWindowEvent

type NewWindowEvent struct {
	Window
}

type ResizeEvent

type ResizeEvent struct {
	Width      int
	Height     int
	GridWidth  int
	GridHeight int
}

type StateEvent

type StateEvent string

type StreamReader

type StreamReader struct {
	Data []byte
	// contains filtered or unexported fields
}

func (*StreamReader) ReadEint32

func (s *StreamReader) ReadEint32() int

func (*StreamReader) ReadInt16

func (s *StreamReader) ReadInt16() int16

func (*StreamReader) ReadOp

func (s *StreamReader) ReadOp() screen.Op

func (*StreamReader) ReadString

func (s *StreamReader) ReadString() string

func (*StreamReader) ReadUint24

func (s *StreamReader) ReadUint24() int

func (*StreamReader) ReadUint8

func (s *StreamReader) ReadUint8() uint8

func (*StreamReader) Remaining

func (s *StreamReader) Remaining() int

type Window

type Window interface {
	GetID() uintptr
	PutString(s string, index int, attrs screen.CellAttrs) error
	PutRepeatedString(s rune, length, index int, attrs screen.CellAttrs) error
	SetGrid(cols, rows int) error
	Scroll(delta, top, bottom, left, right int, bg screen.Color) error
	Clear(bg screen.Color) error
	Flush(mode int, character string, width int, cursor screen.Vector2, attrs screen.CellAttrs) error
	SetTitle(title string) error
	SetIcon(icon string) error
	Bell(visual bool) error
	Close() error
	SendEvent(interface{})
	NextEvent() interface{}
	EventChannel() <-chan interface{}
}

type WindowEvent

type WindowEvent struct {
	Window
	Event interface{}
}

Jump to

Keyboard shortcuts

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