Back to godoc.org
gioui.org/io/router

package router

v0.0.0 (278e9bc)
Latest Go to latest
Published: Jun 3, 2020 | Licenses: MIT, Unlicense | Module: gioui.org

Overview

Package router implements Router, a event.Queue implementation that that disambiguates and routes events to handlers declared in operation lists.

Router is used by app.Window and is otherwise only useful for using Gio with external window implementations.

Index

type Router

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

Router is a Queue implementation that routes events to handlers declared in operation lists.

func (*Router) Add

func (q *Router) Add(events ...event.Event) bool

func (*Router) Events

func (q *Router) Events(k event.Tag) []event.Event

Events returns the available events for the handler key.

func (*Router) Frame

func (q *Router) Frame(ops *op.Ops)

Frame replaces the declared handlers from the supplied operation list. The text input state, wakeup time and whether there are active profile handlers is also saved.

func (*Router) Profiling

func (q *Router) Profiling() bool

Profiling reports whether there was profile handlers in the most recent Frame call.

func (*Router) TextInputState

func (q *Router) TextInputState() TextInputState

TextInputState returns the input state from the most recent call to Frame.

func (*Router) WakeupTime

func (q *Router) WakeupTime() (time.Time, bool)

WakeupTime returns the most recent time for doing another frame, as determined from the last call to Frame.

type TextInputState

type TextInputState uint8
const (
	TextInputKeep TextInputState = iota
	TextInputClose
	TextInputOpen
)
Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
f or F : Jump to identifier