draw

package
v0.0.0-...-7126e5d Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2021 License: BSD-3-Clause, MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Refnone = draw.Refnone

	KeyCmd      = draw.KeyCmd
	KeyDown     = draw.KeyDown
	KeyEnd      = draw.KeyEnd
	KeyHome     = draw.KeyHome
	KeyInsert   = draw.KeyInsert
	KeyLeft     = draw.KeyLeft
	KeyPageDown = draw.KeyPageDown
	KeyPageUp   = draw.KeyPageUp
	KeyRight    = draw.KeyRight
	KeyUp       = draw.KeyUp

	Darkyellow    = draw.Darkyellow
	Medblue       = draw.Medblue
	Nofill        = draw.Nofill
	Notacolor     = draw.Notacolor
	Palebluegreen = draw.Palebluegreen
	Palegreygreen = draw.Palegreygreen
	Paleyellow    = draw.Paleyellow
	Purpleblue    = draw.Purpleblue
	Transparent   = draw.Transparent
	White         = draw.White
	Yellowgreen   = draw.Yellowgreen
)

Variables

View Source
var Init = draw.Init

Functions

func Main

func Main(f func(*Device))

Types

type Color

type Color = draw.Color

type Cursor

type Cursor = draw.Cursor

type Device

type Device struct{}

func (*Device) NewDisplay

func (dev *Device) NewDisplay(errch chan<- error, fontname, label, winsize string) (Display, error)

type Display

type Display interface {
	ScreenImage() Image
	White() Image
	Black() Image
	Opaque() Image
	Transparent() Image

	InitKeyboard() *Keyboardctl
	InitMouse() *Mousectl
	OpenFont(name string) (Font, error)
	AllocImage(r image.Rectangle, pix Pix, repl bool, val Color) (Image, error)
	AllocImageMix(color1, color3 Color) Image
	Attach(ref int) error
	Flush() error
	ScaleSize(n int) int
	ReadSnarf(buf []byte) (int, int, error)
	WriteSnarf(data []byte) error
	MoveTo(pt image.Point) error
	SetCursor(c *Cursor) error
	Close() error
}

type Font

type Font interface {
	Name() string
	Height() int
	BytesWidth(b []byte) int
	RunesWidth(r []rune) int
	StringWidth(s string) int
}

type Image

type Image interface {
	Display() Display
	Pix() Pix
	R() image.Rectangle

	Draw(r image.Rectangle, src, mask Image, p1 image.Point)
	Border(r image.Rectangle, n int, color Image, sp image.Point)
	Bytes(pt image.Point, src Image, sp image.Point, f Font, b []byte) image.Point
	Free() error
}

type Keyboardctl

type Keyboardctl = draw.Keyboardctl

type Mouse

type Mouse = draw.Mouse

type Mousectl

type Mousectl = draw.Mousectl

type Pix

type Pix = draw.Pix

Directories

Path Synopsis
Package drawutil contains draw related utility functions.
Package drawutil contains draw related utility functions.

Jump to

Keyboard shortcuts

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