op: rename StackOp/Push/Pop to StateOp/Save/Load

The semantics were relaxed in a previous commit; this change renames
to operations accordingly.

API change. Use gofmt to adjust your code accordingly:

gofmt -r 'op.Push(a).Pop() -> op.Save(a).Load()'
gofmt -r 'op.Push(a) -> op.Save(a)'
gofmt -r 'v.Pop() -> v.Load()'
gofmt -r 'op.StackOp -> op.StateOp'

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2021-01-12 20:48:41 +01:00
parent ae2c74ec13
commit d331dd2de8
25 changed files with 177 additions and 177 deletions
+3 -3
View File
@@ -243,12 +243,12 @@ func TestMultipleAreas(t *testing.T) {
var ops op.Ops
addPointerHandler(&ops, handler, image.Rect(0, 0, 100, 100))
st := op.Push(&ops)
st := op.Save(&ops)
pointer.Rect(image.Rect(50, 50, 200, 200)).Add(&ops)
// Second area has no Types set, yet should receive events because
// Types for the same handles are or-ed together.
pointer.InputOp{Tag: handler}.Add(&ops)
st.Pop()
st.Load()
var r Router
r.Frame(&ops)
@@ -468,7 +468,7 @@ func TestCursorNameOp(t *testing.T) {
// addPointerHandler adds a pointer.InputOp for the tag in a
// rectangular area.
func addPointerHandler(ops *op.Ops, tag event.Tag, area image.Rectangle) {
defer op.Push(ops).Pop()
defer op.Save(ops).Load()
pointer.Rect(area).Add(ops)
pointer.InputOp{
Tag: tag,