seat

package
v0.0.0-...-63dc931 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MouseButtonLeft = MouseButton(iota)
	MouseButtonRight
	MouseButtonMiddle
)
View Source
const (
	WindowClosed = WindowEvent(iota)
	WindowFocused
	WindowUnfocused
)
View Source
const (
	DefaultWidth  = 640
	DefaultHeight = 480
	DefaultDepth  = 16
)
View Source
const (
	Windowed = ScreenMode(iota + 1)
	Fullscreen
	Borderless
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Input

type Input interface {
	// InputTick runs input event processing, triggering all relevant callback functions.
	InputTick()
	// ReplaceInputs replaces all inputs by a provided configuration, and returns the previous configuration.
	ReplaceInputs(InputConfig) InputConfig
	// OnInput adds a handler function that will be called on each input event.
	OnInput(fnc func(ev InputEvent))
	// SetTextInput enables or disables text input mode.
	SetTextInput(enable bool)
}

type InputConfig

type InputConfig []func(ev InputEvent)

type InputEvent

type InputEvent interface {
	// contains filtered or unexported methods
}

type KeyboardEvent

type KeyboardEvent struct {
	Key     keybind.Key
	Pressed bool
}

type MouseButton

type MouseButton int

type MouseButtonEvent

type MouseButtonEvent struct {
	Button  MouseButton
	Pressed bool
}

type MouseMoveEvent

type MouseMoveEvent struct {
	Relative bool
	Pos      image.Point
	Rel      types.Pointf
}

type MouseWheelEvent

type MouseWheelEvent struct {
	Wheel int
}

type Screen

type Screen interface {
	// ScreenSize returns current size of the screen.
	ScreenSize() image.Point
	// ScreenMaxSize returns max size of the screen.
	ScreenMaxSize() image.Point
	// ResizeScreen changes the size of the screen.
	ResizeScreen(sz image.Point)
	// SetScreenMode changes the screen mode. Fullscreen will maximize the screen to max, while Windowed will return
	// is back to the previous state.
	SetScreenMode(mode ScreenMode)
	// SetGamma sets screen gamma parameter.
	SetGamma(v float32)
	// OnScreenResize adds a handler function that will be called on screen resize.
	OnScreenResize(fnc func(sz image.Point))
	// NewSurface creates a new screen surface.
	NewSurface(sz image.Point, filter bool) Surface
	// Clear the screen.
	Clear()
	// Present the current buffer to the screen.
	Present()
}

type ScreenMode

type ScreenMode int

type Seat

type Seat interface {
	Screen
	Input
	// Close the seat and release resources.
	Close() error
}

type Surface

type Surface interface {
	// Size of the surface.
	Size() image.Point
	// Update the surface with 16 bit data.
	Update(data *noximage.Image16)
	// Draw the surface in a given viewport rectangle.
	Draw(vp image.Rectangle)
	// Destroy the surface.
	Destroy()
}

type TextEditEvent

type TextEditEvent struct {
	Text string
}

type TextInputEvent

type TextInputEvent struct {
	Text string
}

type WindowEvent

type WindowEvent int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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