gui

package
v0.0.0-...-9a2d19c Latest Latest
Warning

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

Go to latest
Published: May 16, 2018 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package gui handles user interface related stuff eg.: window creation, graphic context preparation and rendering (but not drawing rutines itself) event handling - mouse, keyboard, resize,...

Index

Constants

View Source
const (
	NoIcon = '\x00'

	QuitIcon = '\uea0f' // '\uea0d'
	FileIcon = '\uf4c4'
	OpenIcon = '\ue930'
	SaveIcon = '\uf4be'

	ExportIcon = '\uf4e4'
	ImportIcon = '\uf4e5'

	SettingsIcon = '\ue992'

	ReloadIcon = '\u27f2'

	PlayIcon  = '\u25b6' // '\uea15'
	PauseIcon = '\u25ae' // '\uea16'
	StopIcon  = '\u25a0' // '\uea17'

	BeginIcon = '\u23ea' // '\uea18'
	EndIcon   = '\u23e9' // '\uea19'

	NextStepIcon = '\ue966'
	PrevStepIcon = '\ue965'

	CenterOnIcon  = '\ue3b4'
	CenterOffIcon = '\ue3b5'
	RotateIcon    = '\ue1c1'
)
View Source
const (
	// points with 72 dpi
	A4_WIDTH  = 595
	A4_HEIGHT = 842
)

Variables

This section is empty.

Functions

func AlwaysIcon

func AlwaysIcon(icon Icon) func() Icon

func IsExportOn

func IsExportOn() bool

func LoadFile

func LoadFile(cb func(string))

func Run

func Run(handler func(*Screen))

func SaveFile

func SaveFile(cb func(string))

func ToggleExport

func ToggleExport(export func(string))

func ToggleSettings

func ToggleSettings()

func True

func True() bool

Types

type Icon

type Icon rune

type RedrawFunc

type RedrawFunc func(draw.Drawer)

type Screen

type Screen struct {
	*glfw.Window
	// contains filtered or unexported fields
}

Screen provide exported functions for drawing graphic content

func (*Screen) DrawInArc

func (s *Screen) DrawInArc(path []draw.Pos, weight int)

func (*Screen) DrawInhibitorArc

func (s *Screen) DrawInhibitorArc(path []draw.Pos)

func (*Screen) DrawOutArc

func (s *Screen) DrawOutArc(path []draw.Pos, weight int)

func (*Screen) DrawPlace

func (s *Screen) DrawPlace(pos draw.Pos, n int, description string)

func (*Screen) DrawTransition

func (s *Screen) DrawTransition(pos draw.Pos, attrs, description string)

func (*Screen) ForceRedraw

func (s *Screen) ForceRedraw(block bool)

func (*Screen) OnDrag

func (s *Screen) OnDrag(centered bool, cb func(x, y, deltax, deltaY, startX, startY float64, done bool))

func (*Screen) OnKey

func (s *Screen) OnKey(keyName string, cb func())

func (*Screen) OnMenu

func (s *Screen) OnMenu(menu *menu, menuIndex int, cb func())

func (*Screen) OnMouseMove

func (s *Screen) OnMouseMove(centered bool, cb func(float64, float64) bool)

func (*Screen) Pan

func (s *Screen) Pan(dx, dy float64)

func (*Screen) RegisterControl

func (s *Screen) RegisterControl(which int, key string, getIcon func() Icon, label string, handler func(), isEnabled func() bool)

func (*Screen) Reset

func (s *Screen) Reset()

func (*Screen) SetRedrawFunc

func (s *Screen) SetRedrawFunc(f RedrawFunc)

func (*Screen) SetRedrawFuncToSplash

func (s *Screen) SetRedrawFuncToSplash(title string)

func (*Screen) SetStyle

func (s *Screen) SetStyle(style draw.Style)

func (*Screen) SetTitle

func (s *Screen) SetTitle(title string)

Jump to

Keyboard shortcuts

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