From fcaadb369800cf00f4cf856bcedec1b1ce0a717e Mon Sep 17 00:00:00 2001 From: Pierre Curto Date: Tue, 11 Jan 2022 10:31:22 +0100 Subject: [PATCH] app: remove unused types and func arguments Signed-off-by: Pierre Curto --- app/os.go | 7 ------- app/window.go | 23 +++++++++-------------- 2 files changed, 9 insertions(+), 21 deletions(-) diff --git a/app/os.go b/app/os.go index fc5c266f..b524a357 100644 --- a/app/os.go +++ b/app/os.go @@ -1,7 +1,5 @@ // SPDX-License-Identifier: Unlicense OR MIT -// package app implements platform specific windows -// and GPU contexts. package app import ( @@ -17,11 +15,6 @@ import ( "gioui.org/unit" ) -type size struct { - Width unit.Value - Height unit.Value -} - // errOutOfDate is reported when the GPU surface dimensions or properties no // longer match the window. var errOutOfDate = errors.New("app: GPU surface out of date") diff --git a/app/window.go b/app/window.go index d40f2f4d..40acc5a5 100644 --- a/app/window.go +++ b/app/window.go @@ -80,11 +80,6 @@ type Window struct { } } -type semanticResult struct { - found bool - node router.SemanticNode -} - type callbacks struct { w *Window d driver @@ -142,7 +137,7 @@ func (w *Window) Events() <-chan event.Event { return w.out } -// update updates the window contents, input operations declare input handlers, +// update the window contents, input operations declare input handlers, // and so on. The supplied operations list completely replaces the window state // from previous calls. func (w *Window) update(frame *op.Ops) { @@ -150,7 +145,7 @@ func (w *Window) update(frame *op.Ops) { <-w.frameAck } -func (w *Window) validateAndProcess(d driver, frameStart time.Time, size image.Point, sync bool, frame *op.Ops) error { +func (w *Window) validateAndProcess(d driver, size image.Point, sync bool, frame *op.Ops) error { for { if w.gpu == nil && !w.nocontext { var err error @@ -463,7 +458,7 @@ func (c *callbacks) SemanticAt(pos f32.Point) (router.SemanticID, bool) { return c.w.queue.q.SemanticAt(pos) } -func (w *Window) waitAck(d driver) { +func (w *Window) waitAck() { w.waiting = true defer func() { w.waiting = false @@ -498,7 +493,7 @@ func (w *Window) destroyGPU() { // waitFrame waits for the client to either call FrameEvent.Frame // or to continue event handling. It returns whether the client // called Frame or not. -func (w *Window) waitFrame(d driver) (*op.Ops, bool) { +func (w *Window) waitFrame() (*op.Ops, bool) { w.waiting = true defer func() { w.waiting = false @@ -588,7 +583,7 @@ func (w *Window) processEvent(d driver, e event.Event) { w.stage = e2.Stage w.updateAnimation(d) w.out <- e - w.waitAck(d) + w.waitAck() case frameEvent: if e2.Size == (image.Point{}) { panic(errors.New("internal error: zero-sized Draw")) @@ -602,8 +597,8 @@ func (w *Window) processEvent(d driver, e event.Event) { e2.Frame = w.update e2.Queue = &w.queue w.out <- e2.FrameEvent - frame, gotFrame := w.waitFrame(d) - err := w.validateAndProcess(d, frameStart, e2.Size, e2.Sync, frame) + frame, gotFrame := w.waitFrame() + err := w.validateAndProcess(d, e2.Size, e2.Sync, frame) if gotFrame { // We're done with frame, let the client continue. w.frameAck <- struct{}{} @@ -619,7 +614,7 @@ func (w *Window) processEvent(d driver, e event.Event) { w.updateCursor(d) case *system.CommandEvent: w.out <- e - w.waitAck(d) + w.waitAck() case system.DestroyEvent: w.destroyGPU() w.out <- e2 @@ -627,7 +622,7 @@ func (w *Window) processEvent(d driver, e event.Event) { close(w.out) case ViewEvent: w.out <- e2 - w.waitAck(d) + w.waitAck() case wakeupEvent: case event.Event: if w.queue.q.Queue(e2) {