app

package
v1.2.19 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2026 License: MIT, Unlicense Imports: 44 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ID = ""

Functions

func DataDir

func DataDir() (string, error)

func Events

func Events(yield func(event.Event) bool)

func Main

func Main()

func NewContext

func NewContext(ops *op.Ops, e FrameEvent) layout.Context

Types

type Config

type Config struct {
	Size image.Point

	MaxSize image.Point

	MinSize image.Point

	Title string

	Mode WindowMode

	NavigationColor color.NRGBA

	Orientation Orientation

	CustomRenderer bool

	Decorated bool

	TopMost bool

	Focused bool
	// contains filtered or unexported fields
}

type ConfigEvent

type ConfigEvent struct {
	Config Config
}

func (ConfigEvent) ImplementsEvent

func (ConfigEvent) ImplementsEvent()

type DestroyEvent

type DestroyEvent struct {
	Err error
}

func (DestroyEvent) ImplementsEvent

func (DestroyEvent) ImplementsEvent()

type DragFilesEvent added in v1.2.16

type DragFilesEvent struct {
	Position f32.Point
	Active   bool
}

DragFilesEvent is delivered while the user drags files over the window, before any drop. Active is true on drag-enter / drag-over (Position is the current cursor point in window-client coordinates) and false on drag-leave (Position is meaningless). It lets the application highlight the drop zone the cursor is currently over, like a modern editor. Emitted only on Windows.

func (DragFilesEvent) DraggedFiles added in v1.2.16

func (e DragFilesEvent) DraggedFiles() (x, y float32, active bool)

DraggedFiles exposes the drag state structurally (cursor point in client coordinates plus whether the drag is currently over the window) so apps can consume it via an interface assertion without importing this package.

func (DragFilesEvent) ImplementsEvent added in v1.2.16

func (DragFilesEvent) ImplementsEvent()

type DropFilesEvent added in v1.2.15

type DropFilesEvent struct {
	Paths    []string
	Position f32.Point
}

DropFilesEvent is delivered when the user drops one or more files from the OS file manager onto the window. It is currently emitted only on Windows (see the OLE IDropTarget handling in dnd_windows.go). Position carries the drop point in window-client coordinates (the same space as pointer events), so the application can route the drop to whatever zone it landed on.

func (DropFilesEvent) DroppedPaths added in v1.2.15

func (e DropFilesEvent) DroppedPaths() []string

DroppedPaths returns the dropped file paths. Exposing it as a method lets applications consume the event via an interface assertion, without a compile-time dependency on this concrete type.

func (DropFilesEvent) DroppedPosition added in v1.2.16

func (e DropFilesEvent) DroppedPosition() (x, y float32)

DroppedPosition returns the drop point in window-client coordinates. Like DroppedPaths, it is exposed as a method so applications can consume it structurally (via an interface assertion) without importing this package.

func (DropFilesEvent) ImplementsEvent added in v1.2.15

func (DropFilesEvent) ImplementsEvent()

type FrameEvent

type FrameEvent struct {
	Now time.Time

	Metric unit.Metric

	Size image.Point

	Insets Insets

	Frame func(frame *op.Ops)

	Source input.Source
}

func (FrameEvent) ImplementsEvent

func (FrameEvent) ImplementsEvent()

type Insets

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

type Option

type Option func(unit.Metric, *Config)

func CustomRenderer

func CustomRenderer(custom bool) Option

func Decorated

func Decorated(enabled bool) Option

func MaxSize

func MaxSize(w, h unit.Dp) Option

func MinSize

func MinSize(w, h unit.Dp) Option
func NavigationColor(color color.NRGBA) Option

func Size

func Size(w, h unit.Dp) Option

func Title

func Title(t string) Option

func TopMost

func TopMost(enabled bool) Option

type Orientation

type Orientation uint8
const (
	AnyOrientation Orientation = iota

	LandscapeOrientation

	PortraitOrientation
)

func (Orientation) Option

func (o Orientation) Option() Option

func (Orientation) String

func (o Orientation) String() string

type URLEvent

type URLEvent struct {
	URL *url.URL
}

func (URLEvent) ImplementsEvent

func (URLEvent) ImplementsEvent()

type ViewEvent

type ViewEvent interface {
	ImplementsEvent()

	Valid() bool
	// contains filtered or unexported methods
}

type WaylandViewEvent

type WaylandViewEvent struct {
	Display unsafe.Pointer

	Surface unsafe.Pointer
}

func (WaylandViewEvent) ImplementsEvent

func (WaylandViewEvent) ImplementsEvent()

func (WaylandViewEvent) Valid

func (w WaylandViewEvent) Valid() bool

type Window

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

func (*Window) Event

func (w *Window) Event() event.Event

func (*Window) Invalidate

func (w *Window) Invalidate()

func (*Window) Option

func (w *Window) Option(opts ...Option)

func (*Window) Perform

func (w *Window) Perform(actions system.Action)

func (*Window) Run

func (w *Window) Run(f func())

type WindowMode

type WindowMode uint8
const (
	Windowed WindowMode = iota

	Fullscreen

	Minimized

	Maximized
)

func (WindowMode) Option

func (m WindowMode) Option() Option

func (WindowMode) String

func (m WindowMode) String() string

type X11ViewEvent

type X11ViewEvent struct {
	Display unsafe.Pointer

	Window uintptr
}

func (X11ViewEvent) ImplementsEvent

func (X11ViewEvent) ImplementsEvent()

func (X11ViewEvent) Valid

func (x X11ViewEvent) Valid() bool

Directories

Path Synopsis
internal
windows
Win32 syscall .Call() returns non-nil errno on success; struct fields mirror Win32 ABI; (*T)(unsafe.Pointer(lParam)) is the standard window-message pattern.
Win32 syscall .Call() returns non-nil errno on success; struct fields mirror Win32 ABI; (*T)(unsafe.Pointer(lParam)) is the standard window-message pattern.
xkb

Jump to

Keyboard shortcuts

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