system

package
Version: v0.0.0-...-e5c040b Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2021 License: MIT, Unlicense Imports: 5 Imported by: 214

Documentation

Overview

Package system contains events usually handled at the top-level program level.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandEvent

type CommandEvent struct {
	Type CommandType
	// Cancel suppress the default action of the command.
	Cancel bool
}

CommandEvent is a system event. Unlike most other events, CommandEvent is delivered as a pointer to allow Cancel to suppress it.

func (*CommandEvent) ImplementsEvent

func (*CommandEvent) ImplementsEvent()

type CommandType

type CommandType uint8

CommandType is the type of a CommandEvent.

const (
	// CommandBack is the command for a back action
	// such as the Android back button.
	CommandBack CommandType = iota
)

type DestroyEvent

type DestroyEvent struct {
	// Err is nil for normal window closures. If a
	// window is prematurely closed, Err is the cause.
	Err error
}

DestroyEvent is the last event sent through a window event channel.

func (DestroyEvent) ImplementsEvent

func (DestroyEvent) ImplementsEvent()

type FrameEvent

type FrameEvent struct {
	// Now is the current animation. Use Now instead of time.Now to
	// synchronize animation and to avoid the time.Now call overhead.
	Now time.Time
	// Metric converts device independent dp and sp to device pixels.
	Metric unit.Metric
	// Size is the dimensions of the window.
	Size image.Point
	// Insets is the insets to apply.
	Insets Insets
	// Frame completes the FrameEvent by drawing the graphical operations
	// from ops into the window.
	Frame func(frame *op.Ops)
	// Queue supplies the events for event handlers.
	Queue event.Queue
}

A FrameEvent requests a new frame in the form of a list of operations that describes what to display and how to handle input.

func (FrameEvent) ImplementsEvent

func (FrameEvent) ImplementsEvent()

type Insets

type Insets struct {
	Top, Bottom, Left, Right unit.Value
}

Insets is the space taken up by system decoration such as translucent system bars and software keyboards.

type Stage

type Stage uint8

Stage of a Window.

const (
	// StagePaused is the Stage for inactive Windows.
	// Inactive Windows don't receive FrameEvents.
	StagePaused Stage = iota
	// StateRunning is for active Windows.
	StageRunning
)

func (Stage) String

func (l Stage) String() string

type StageEvent

type StageEvent struct {
	Stage Stage
}

A StageEvent is generated whenever the stage of a Window changes.

func (StageEvent) ImplementsEvent

func (StageEvent) ImplementsEvent()

Source Files

Jump to

Keyboard shortcuts

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