mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 17:35:36 +00:00
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:
+10
-10
@@ -38,7 +38,7 @@ type window struct {
|
||||
dpi int
|
||||
fontScale float32
|
||||
|
||||
stage stage
|
||||
stage Stage
|
||||
started bool
|
||||
|
||||
mu sync.Mutex
|
||||
@@ -96,7 +96,7 @@ func onCreateView(env *C.JNIEnv, class C.jclass, view C.jobject) C.jlong {
|
||||
views[handle] = w
|
||||
w.loadConfig(env, class)
|
||||
windows <- ow
|
||||
w.setStage(stageInvisible)
|
||||
w.setStage(StageInvisible)
|
||||
return handle
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ func onCreateView(env *C.JNIEnv, class C.jclass, view C.jobject) C.jlong {
|
||||
func onDestroyView(env *C.JNIEnv, class C.jclass, handle C.jlong) {
|
||||
w := views[handle]
|
||||
delete(views, handle)
|
||||
w.setStage(stageDead)
|
||||
w.setStage(StageDead)
|
||||
C.gio_jni_DeleteGlobalRef(env, w.view)
|
||||
w.view = 0
|
||||
}
|
||||
@@ -113,7 +113,7 @@ func onDestroyView(env *C.JNIEnv, class C.jclass, handle C.jlong) {
|
||||
func onStopView(env *C.JNIEnv, class C.jclass, handle C.jlong) {
|
||||
w := views[handle]
|
||||
w.started = false
|
||||
w.setStage(stageInvisible)
|
||||
w.setStage(StageInvisible)
|
||||
}
|
||||
|
||||
//export onStartView
|
||||
@@ -131,7 +131,7 @@ func onSurfaceDestroyed(env *C.JNIEnv, class C.jclass, handle C.jlong) {
|
||||
w.mu.Lock()
|
||||
w.win = nil
|
||||
w.mu.Unlock()
|
||||
w.setStage(stageInvisible)
|
||||
w.setStage(StageInvisible)
|
||||
}
|
||||
|
||||
//export onSurfaceChanged
|
||||
@@ -155,7 +155,7 @@ func onLowMemory() {
|
||||
func onConfigurationChanged(env *C.JNIEnv, class C.jclass, view C.jlong) {
|
||||
w := views[view]
|
||||
w.loadConfig(env, class)
|
||||
if w.stage >= stageVisible {
|
||||
if w.stage >= StageVisible {
|
||||
w.draw(true)
|
||||
}
|
||||
}
|
||||
@@ -166,7 +166,7 @@ func onFrameCallback(env *C.JNIEnv, class C.jclass, view C.jlong, nanos C.jlong)
|
||||
if !exist {
|
||||
return
|
||||
}
|
||||
if w.stage < stageVisible {
|
||||
if w.stage < StageVisible {
|
||||
return
|
||||
}
|
||||
w.mu.Lock()
|
||||
@@ -197,16 +197,16 @@ func (w *window) setVisible() {
|
||||
if width == 0 || height == 0 {
|
||||
return
|
||||
}
|
||||
w.setStage(stageVisible)
|
||||
w.setStage(StageVisible)
|
||||
w.draw(true)
|
||||
}
|
||||
|
||||
func (w *window) setStage(stage stage) {
|
||||
func (w *window) setStage(stage Stage) {
|
||||
if stage == w.stage {
|
||||
return
|
||||
}
|
||||
w.stage = stage
|
||||
w.event(changeStage{stage})
|
||||
w.event(ChangeStage{stage})
|
||||
}
|
||||
|
||||
func (w *window) display() unsafe.Pointer {
|
||||
|
||||
Reference in New Issue
Block a user