23 lines
367 B
Go
23 lines
367 B
Go
package shared
|
|
|
|
import (
|
|
"sync"
|
|
|
|
"gioui.org/io/event"
|
|
)
|
|
|
|
type WindowState interface {
|
|
Run(globalState *GlobalState, event event.Event) NewState
|
|
Exit(globalState *GlobalState, wg *sync.WaitGroup)
|
|
}
|
|
|
|
type NewState struct {
|
|
// If null, keep current state
|
|
NextState WindowState
|
|
Error error
|
|
ExitCode error
|
|
}
|
|
|
|
func EmptyEvent() NewState {
|
|
return NewState{}
|
|
}
|