swtk

package module
v0.0.0-...-9188e6c Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2013 License: BSD-3-Clause Imports: 7 Imported by: 0

README

go.swtk

Simple Widget Toolkit

Documentation

Index

Constants

View Source
const (
	AlignCenter alignment = iota
	AlignCenterLeft
	AlignCenterRight
	AlignTop
	AlignTopLeft
	AlignTopRight
	AlignBottom
	AlignBottomLeft
	AlignBottomRight
)

Variables

View Source
var (
	Dpi         float64
	Fontfile    string
	FontSize    float64
	LineSpacing float64
	Font        *truetype.Font
)

Functions

This section is empty.

Types

type Alignmenter

type Alignmenter interface {
	Alignment() alignment
}

type ContactState

type ContactState struct {
	Device int
	Id     int
	X, Y   int
}

This is where on screen has been 'touched' ie: with finger, or mouse button down There will certainly be multiple contacts from multiple Devices

type DisplayPane

type DisplayPane interface {
	SetPane(pane Pane)
	SetRenderer(r Renderer)

	Draw()
	SetSize(size ResizeEvent)
	Close()

	DrawingHandler()
}

type InputHandler

type InputHandler interface {
	SetPane(pn Pane)
	HandleMouseState(ms MouseState)
	//	HandlePointerState(ps PointerState)
	//	HandleContactState(cs ContactState)
	InputHandler()
}

type LayoutPane

type LayoutPane interface {
	SetPane(pane Pane)
	HandleResizeEvent(re ResizeEvent)
	HandleCloseEvent()
	RegisterRenderer(wr Renderer)

	//This initializes pane
	//no further setup should be possible afterwards
	AddPane(pane Pane, x, y int)
}

This handles children size and location

type MouseState

type MouseState struct {
	B    int8
	X, Y int16
}

type Pane

type Pane interface {
	//return minimum and maximum sizes desired
	//0 means not applicable.
	//minimum may not be respected.
	MinMax() (image.Point, image.Point)
	SetMinMax(min, max image.Point)

	SetSize(size ResizeEvent)
	Close()

	//Event handling
	SetMouseState(ms MouseState)

	SetLayoutPane(lp LayoutPane)
	LayoutPane() LayoutPane

	SetDisplayPane(dp DisplayPane)
	DisplayPane() DisplayPane

	SetInputHandler(ih InputHandler)
	InputHandler() InputHandler

	PaneHandler()
}

type PaneCoords

type PaneCoords struct {
	Pane   Pane
	Coords image.Point
	Size   image.Point
}

type PaneImage

type PaneImage struct {
	Pane  Pane
	Image draw.Image
}

type PointerState

type PointerState struct {
	Device int
	Id     int
	X, Y   int
}

This is where on screen the pointer is There may be multiple pointers from multiple Devices

type Renderer

type Renderer interface {
	RegisterPane(pane Pane, parentPane Pane)
	SetAspect(pi PaneImage)
	SetLocation(pc PaneCoords)
	SetBasePane(pane Pane)
	Run()
	BackEndRun()
}

type ResizeEvent

type ResizeEvent struct {
	Size image.Point
	View image.Rectangle
}

type StandardPane

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

func NewStandardPane

func NewStandardPane() *StandardPane

func (*StandardPane) Close

func (pn *StandardPane) Close()

func (*StandardPane) DisplayPane

func (pn *StandardPane) DisplayPane() DisplayPane

func (*StandardPane) InputHandler

func (pn *StandardPane) InputHandler() InputHandler

func (*StandardPane) LayoutPane

func (pn *StandardPane) LayoutPane() LayoutPane

func (*StandardPane) MinMax

func (pn *StandardPane) MinMax() (image.Point, image.Point)

func (*StandardPane) PaneHandler

func (pn *StandardPane) PaneHandler()

func (*StandardPane) SetDisplayPane

func (pn *StandardPane) SetDisplayPane(dp DisplayPane)

func (*StandardPane) SetInputHandler

func (pn *StandardPane) SetInputHandler(ih InputHandler)

func (*StandardPane) SetLayoutPane

func (pn *StandardPane) SetLayoutPane(lp LayoutPane)

func (*StandardPane) SetMinMax

func (pn *StandardPane) SetMinMax(min, max image.Point)

func (*StandardPane) SetMouseState

func (pn *StandardPane) SetMouseState(ms MouseState)

func (*StandardPane) SetSize

func (pn *StandardPane) SetSize(size ResizeEvent)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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