Skip to content

feat: add WindowProvider, PlatformProvider; remove legacy TouchEventSource#8

Merged
kolkov merged 1 commit intomainfrom
feat/window-platform-interfaces
Feb 7, 2026
Merged

feat: add WindowProvider, PlatformProvider; remove legacy TouchEventSource#8
kolkov merged 1 commit intomainfrom
feat/window-platform-interfaces

Conversation

@kolkov
Copy link
Contributor

@kolkov kolkov commented Feb 7, 2026

Summary

  • Add WindowProvider interface — window geometry (Size), DPI (ScaleFactor), and RequestRedraw for on-demand rendering
  • Add PlatformProvider interface — clipboard read/write, cursor management, dark mode, accessibility preferences (reduce motion, high contrast, font scale)
  • Add CursorShape enum with 12 standard cursor shapes and String() method
  • Add NullWindowProvider / NullPlatformProvider for testing and headless scenarios
  • Remove TouchEventSource — legacy interface fully replaced by W3C Pointer Events Level 3 (PointerEventSource with PointerType: Touch). Zero implementations, zero consumers existed
  • Update public documentation (README, CHANGELOG, ROADMAP)

Design

  • WindowProvider is a standalone interface (3 methods)
  • PlatformProvider is optional — check via type assertion: if pp, ok := provider.(PlatformProvider); ok { ... }
  • CursorShape lives in gpucontext to avoid circular dependency with ui
  • Enables gogpu/ui to access host window and platform capabilities without direct gogpu dependency

Test plan

  • 56 tests pass (go test ./...)
  • go vet clean
  • golangci-lint 0 issues
  • go fmt clean
  • CI validates cross-platform (Linux, macOS, Windows)

…ource

WindowProvider provides window geometry, DPI scale factor, and redraw
requests for UI frameworks. PlatformProvider adds optional OS integration:
clipboard, cursor management, dark mode detection, and accessibility
preferences (reduce motion, high contrast, font scale).

CursorShape enum defines 12 standard cursor shapes with String() method.
NullWindowProvider and NullPlatformProvider included for testing.

Remove TouchEventSource — fully replaced by W3C Pointer Events Level 3
(PointerEventSource with PointerType: Touch). Zero implementations,
zero consumers existed.
@codecov
Copy link

codecov bot commented Feb 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@kolkov kolkov merged commit 6ceb1e6 into main Feb 7, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant