mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-03 00:16:15 +00:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user