Documentation
¶
Index ¶
- type BackendLink
- type Hierarchy
- func (this *Hierarchy) AfterEvent()
- func (this *Hierarchy) Close()
- func (this *Hierarchy) Empty() bool
- func (this *Hierarchy) HandleFocusChange(focused bool)
- func (this *Hierarchy) HandleKeyDown(key input.Key, numberPad bool)
- func (this *Hierarchy) HandleKeyUp(key input.Key, numberPad bool)
- func (this *Hierarchy) HandleModifiers(modifiers input.Modifiers)
- func (this *Hierarchy) HandleMouseDown(button input.Button)
- func (this *Hierarchy) HandleMouseMove(position image.Point)
- func (this *Hierarchy) HandleMouseUp(button input.Button)
- func (this *Hierarchy) HandleScroll(x, y float64)
- func (this *Hierarchy) MinimumSize() image.Point
- func (this *Hierarchy) Modifiers() input.Modifiers
- func (this *Hierarchy) MousePosition() image.Point
- func (this *Hierarchy) SetCanvas(can canvas.Canvas)
- func (this *Hierarchy) SetRoot(root tomo.Box)
- type SurfaceLink
- type System
- func (this *System) NewBox() tomo.Box
- func (this *System) NewCanvasBox() tomo.CanvasBox
- func (this *System) NewContainerBox() tomo.ContainerBox
- func (this *System) NewHierarchy(link WindowLink) *Hierarchy
- func (this *System) NewSurfaceBox() (tomo.SurfaceBox, error)
- func (this *System) NewTextBox() tomo.TextBox
- func (this *System) SetFaceSet(faceSet style.FaceSet)
- func (this *System) SetIconSet(iconSet style.IconSet)
- func (this *System) SetStyle(style *style.Style)
- type WindowLink
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackendLink ¶
type BackendLink interface { // NewTexture creates a new texture from an image. NewTexture(image.Image) canvas.TextureCloser // NewSurface creates a new surface with the specified bounds. NewSurface(image.Rectangle) (SurfaceLink, error) }
BackendLink allows the System to call up into the tomo.Backend implementation which contains it in order to do things such as create new textures.
type Hierarchy ¶
type Hierarchy struct {
// contains filtered or unexported fields
}
Hierarchy is coupled to a tomo.Window implementation, and manages a tree of Boxes.
func (*Hierarchy) AfterEvent ¶
func (this *Hierarchy) AfterEvent()
AfterEvent should be called at the end of every event cycle.
func (*Hierarchy) Close ¶ added in v0.4.0
func (this *Hierarchy) Close()
Close closes the Hierarchy. This should be called when the Window that contains it has been closed.
func (*Hierarchy) HandleFocusChange ¶
HandleFocusChange sets whether or not the window containing this Hierarchy has input focus.
func (*Hierarchy) HandleKeyDown ¶
HandleKeyDown sends a key down event to the currently focused Box. If the event which triggers this comes with modifier key information, HandleModifiers must be called *before* HandleKeyDown.
func (*Hierarchy) HandleKeyUp ¶
HandleKeyUp sends a key up event to the currently focused Box. If the event which triggers this comes with modifier key information, HandleModifiers must be called *before* HandleKeyUp.
func (*Hierarchy) HandleModifiers ¶
HandleModifiers sets the modifier keys that are currently being pressed.
func (*Hierarchy) HandleMouseDown ¶
HandleMouseDown sends a mouse down event to the Boxes positioned underneath the mouse cursor and marks them as being "dragged" by that mouse button, starting at the first Box to mask events and ending at the first box to catch the event. If the event which triggers this comes with mouse position information, HandleMouseMove must be called *before* HandleMouseDown.
func (*Hierarchy) HandleMouseMove ¶
HandleMouseMove sends a mouse move event to any Boxes currently being "dragged" by a mouse button. If none are, it sends the event to the Boxes which are underneath the mouse pointer, starting at the first Box to mask events and ending at the first box to catch the event.
func (*Hierarchy) HandleMouseUp ¶
HandleMouseUp sends a mouse up event to the Boxes currently being "dragged" by the specified mouse button, and marks them as being "not dragged" by that mouse button. If the event which triggers this comes with mouse position information, HandleMouseMove must be caleld *before* HandleMouseUp
func (*Hierarchy) HandleScroll ¶
HandleScroll sends a scroll event to the Box currently underneath the mouse cursor. If the event which triggers this comes with mouse position information, HandleMouseMove must be called *before* HandleScroll.
func (*Hierarchy) MinimumSize ¶
MinimumSize returns the minimum size of the Hierarchy.
func (*Hierarchy) Modifiers ¶ added in v0.5.0
Modifiers returns the current modifier keys being held.
func (*Hierarchy) MousePosition ¶ added in v0.5.0
MousePosition returns the current mouse position.
type SurfaceLink ¶
SurfaceLink wraps a Surface created by the backend implementation, allowing the System a higher level of control over it.
type System ¶
type System struct {
// contains filtered or unexported fields
}
System is coupled to a tomo.Backend implementation, and manages Hierarchies and Boxes.
func (*System) NewCanvasBox ¶
func (*System) NewContainerBox ¶
func (this *System) NewContainerBox() tomo.ContainerBox
func (*System) NewHierarchy ¶
func (this *System) NewHierarchy(link WindowLink) *Hierarchy
NewHierarchy creates a new Hierarchy.
func (*System) NewSurfaceBox ¶
func (this *System) NewSurfaceBox() (tomo.SurfaceBox, error)
func (*System) NewTextBox ¶
func (*System) SetFaceSet ¶ added in v0.6.0
SetFaceSet sets the face set that provides font faces.
func (*System) SetIconSet ¶ added in v0.5.0
SetIconSet sets the icon set that provides icon textures, and notifies objects that the icons have changed.
type WindowLink ¶
type WindowLink interface { // GetWindow returns the tomo.Window containing the Hierarchy. GetWindow() tomo.Window // PushRegion pushes a region of the held canvas.Canvas to the screen. PushRegion(image.Rectangle) // PushAll pushes the entire canvas.Canvas to the screen. PushAll() // NotifyMinimumSizeChange notifies the tomo.Window that the minimum // size of the Hierarchy has changed, and if necessary, a resize should // be requested. NotifyMinimumSizeChange() }
WindowLink allows the Hierarchy to call up into the tomo.Window implementation which contains it. This should be a separate entity from the tomo.Window.