Revert "ui/app,apps: unexport ChangeStage and Stage"

I found a convincing use case: stopping asynchronous activities
while paused. A follow up change will rename the stages and add
an example.

This reverts commit f9840b0963.
This commit is contained in:
Elias Naur
2019-05-12 14:47:38 +02:00
parent af7a0ad293
commit 4441a3e13e
8 changed files with 62 additions and 57 deletions
+7 -7
View File
@@ -33,7 +33,7 @@ func init() {
type window struct {
view C.CFTypeRef
w *Window
stage stage
stage Stage
}
// Only support one main window for now.
@@ -61,12 +61,12 @@ func (w *window) setAnimating(anim bool) {
C.gio_setAnimating(w.view, animb)
}
func (w *window) setStage(stage stage) {
func (w *window) setStage(stage Stage) {
if stage == w.stage {
return
}
w.stage = stage
w.w.event(changeStage{stage})
w.w.event(ChangeStage{stage})
}
//export gio_onFrameCallback
@@ -134,7 +134,7 @@ func (w *window) draw(sync bool) {
}
cfg := getConfig()
cfg.Now = time.Now()
w.setStage(stageVisible)
w.setStage(StageVisible)
w.w.event(Draw{
Size: image.Point{
X: width,
@@ -161,20 +161,20 @@ func getConfig() ui.Config {
func gio_onTerminate(view C.CFTypeRef) {
w := views[view]
delete(views, view)
w.setStage(stageDead)
w.setStage(StageDead)
close(windows)
}
//export gio_onHide
func gio_onHide(view C.CFTypeRef) {
w := views[view]
w.setStage(stageInvisible)
w.setStage(StageInvisible)
}
//export gio_onShow
func gio_onShow(view C.CFTypeRef) {
w := views[view]
w.setStage(stageVisible)
w.setStage(StageVisible)
}
//export gio_onCreate