screen

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2020 License: BSD-3-Clause Imports: 10 Imported by: 6

Documentation

Index

Constants

View Source
const (
	Over = draw.Over
	Src  = draw.Src
)

Variables

View Source
var Dev = &Device{
	Scroll:    make(chan Scroll, 1),
	Mouse:     make(chan Mouse, 1),
	Key:       make(chan Key, 1),
	Size:      make(chan Size, 1),
	Paint:     make(chan Paint, 1),
	Lifecycle: make(chan Lifecycle, 1),
}

Functions

func SendKey added in v0.6.7

func SendKey(e Key)

func SendLifecycle added in v0.6.7

func SendLifecycle(e Lifecycle)

func SendMouse added in v0.6.7

func SendMouse(e Mouse)

func SendPaint added in v0.6.7

func SendPaint(e Paint)

func SendScroll added in v0.6.7

func SendScroll(e Scroll)

func SendSize added in v0.6.7

func SendSize(e Size)

Types

type Buffer

type Buffer interface {
	Release()
	Size() image.Point
	Bounds() image.Rectangle
	RGBA() *image.RGBA
}

type Device added in v0.6.7

type Device struct {
	Lifecycle chan Lifecycle
	Scroll    chan Scroll
	Mouse     chan Mouse
	Key       chan Key
	Size      chan Size
	Paint     chan Paint
}

type DrawOptions

type DrawOptions struct {
}

type Drawer

type Drawer interface {
	Draw(src2dst f64.Aff3, src Texture, sr image.Rectangle, op draw.Op, opts *DrawOptions)
	DrawUniform(src2dst f64.Aff3, src color.Color, sr image.Rectangle, op draw.Op, opts *DrawOptions)
	Copy(dp image.Point, src Texture, sr image.Rectangle, op draw.Op, opts *DrawOptions)
	Scale(dr image.Rectangle, src Texture, sr image.Rectangle, op draw.Op, opts *DrawOptions)
}

type Key added in v0.6.7

type Key = key.Event

type Lifecycle added in v0.6.7

type Lifecycle = lifecycle.Event

type Mouse added in v0.6.7

type Mouse = mouse.Event

type NewWindowOptions

type NewWindowOptions struct {
	Width, Height int
	Title         string

	// Overlay, if true, attempts to create a new window over top
	// of the parent process's existing window (similar to running
	// a graphical application in Plan9 over top an existing Rio
	// window).
	Overlay bool
}

NewWindowOptions are optional arguments to NewWindow. TODO(as): NewWindowOptions could be named better

func (*NewWindowOptions) GetTitle

func (o *NewWindowOptions) GetTitle() string

type Paint added in v0.6.7

type Paint = paint.Event

type PublishResult

type PublishResult struct {
	BackBufferPreserved bool
}

PublishResult is the result of an Window.Publish call.

type Screen

type Screen interface {
	NewBuffer(size image.Point) (Buffer, error)
	NewTexture(size image.Point) (Texture, error)
	NewWindow(opts *NewWindowOptions) (Window, error)
}

Screen creates Buffers, Textures and Windows.

type Scroll added in v0.6.7

type Scroll = mouse.Event

type Size added in v0.6.7

type Size = size.Event

type Texture

type Texture interface {
	Release()
	Size() image.Point
	Bounds() image.Rectangle
	Uploader
}

type Uploader

type Uploader interface {
	Upload(dp image.Point, src Buffer, sr image.Rectangle)
	Fill(dr image.Rectangle, src color.Color, op draw.Op)
}

Uploader is something you can upload a Buffer to.

type Window

type Window interface {
	Device() *Device
	Release()
	Uploader
	Drawer
	Publish() PublishResult
}

Window is a top-level, double-buffered GUI window.

Jump to

Keyboard shortcuts

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