windowbackend

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2026 License: Apache-2.0 Imports: 1 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package windowbackend defines the platform-neutral contract shared by Pure-Go window implementations.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrWindowNotFound reports that no window matched the requested target.
	ErrWindowNotFound = errors.New("window not found")
	// ErrInvalidWindow reports a zero, stale, or otherwise invalid native handle.
	ErrInvalidWindow = errors.New("invalid window handle")
	// ErrOperation reports a failed native window operation.
	ErrOperation = errors.New("window operation failed")
	// ErrUnsupported reports a missing platform or window-manager capability.
	ErrUnsupported = errors.New("window operation unsupported")
	// ErrPermission reports a platform security policy that denied window access.
	ErrPermission = errors.New("window operation permission denied")
)

Functions

This section is empty.

Types

type Backend

type Backend interface {
	Active() (Handle, error)
	Resolve(target int, isHandle bool) (Handle, error)
	Select(target int, isHandle bool) error
	Selected() Handle
	PID(Handle) (int, error)
	Title(Handle) (string, error)
	Bounds(Handle, bool) (Rect, error)
	Activate(Handle) error
	SetState(Handle, State, bool) error
	State(Handle, State) (bool, error)
	TopMost(Handle) (bool, error)
	SetTopMost(Handle, bool) error
	Close(Handle) error
}

Backend is the behavior required by the public Pure-Go window adapter. Implementations keep platform-specific discovery, validation, and mutation below this boundary.

type Handle

type Handle uintptr

Handle is an opaque native top-level window identifier.

type Rect

type Rect struct {
	X      int
	Y      int
	Width  int
	Height int
}

Rect contains screen-relative window geometry.

type State

type State uint8

State identifies a queryable and mutable presentation state.

const (
	// StateMinimized identifies a minimized window.
	StateMinimized State = iota
	// StateMaximized identifies a maximized window.
	StateMaximized
)

Jump to

Keyboard shortcuts

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