app: [API] remove StageEvent and Stage

StageEvent served only redundant purposes:

- To detect whether the window has focus. That is covered by
  key.FocusEvent.
- To detect whether the window is currently visible. That is covered by
  the absence or presence of FrameEvents.
- To detect when the window native handle is valid. That is
  covered by ViewEvent.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2023-12-15 16:45:02 -06:00
parent f3fc0d62b8
commit d58d386b9b
9 changed files with 41 additions and 162 deletions
-3
View File
@@ -138,7 +138,6 @@ func onCreate(view, controller C.CFTypeRef) {
w.displayLink = dl
C.gio_viewSetHandle(view, C.uintptr_t(cgo.NewHandle(w)))
w.Configure(wopts.options)
w.ProcessEvent(StageEvent{Stage: StageRunning})
w.ProcessEvent(UIKitViewEvent{ViewController: uintptr(controller)})
}
@@ -189,14 +188,12 @@ func (w *window) draw(sync bool) {
func onStop(h C.uintptr_t) {
w := viewFor(h)
w.hidden = true
w.ProcessEvent(StageEvent{Stage: StagePaused})
}
//export onStart
func onStart(h C.uintptr_t) {
w := viewFor(h)
w.hidden = false
w.ProcessEvent(StageEvent{Stage: StageRunning})
w.draw(true)
}