gui/pkg/screen/messages.go
Claude ab0722d19e
feat(screen): expand with QueryCurrent, ScreenPlacement, Rect geometry
- Platform.GetCurrent() for active screen query
- ScreenPlacement with Apply() for window positioning rules
- Rect geometry: Origin, Corner, InsideCorner, IsEmpty, Contains, RectSize, Intersect
- Point type, Alignment/OffsetReference constants
- 18 new tests with Good/Bad/Ugly coverage

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 14:54:17 +01:00

26 lines
897 B
Go

// pkg/screen/messages.go
package screen
// QueryAll returns all screens. Result: []Screen
type QueryAll struct{}
// QueryPrimary returns the primary screen. Result: *Screen (nil if not found)
type QueryPrimary struct{}
// QueryByID returns a screen by ID. Result: *Screen (nil if not found)
type QueryByID struct{ ID string }
// QueryAtPoint returns the screen containing a point. Result: *Screen (nil if none)
type QueryAtPoint struct{ X, Y int }
// QueryWorkAreas returns work areas for all screens. Result: []Rect
type QueryWorkAreas struct{}
// QueryCurrent returns the most recently active screen. Result: *Screen (nil if no screens registered)
//
// result, _, _ := c.QUERY(screen.QueryCurrent{})
// current := result.(*screen.Screen)
type QueryCurrent struct{}
// ActionScreensChanged is broadcast when displays change (future).
type ActionScreensChanged struct{ Screens []Screen }