mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 15:45:38 +00:00
03db2817ac
Key had an unfortunate association with keyboard input.
This is an API change. The following rewrites were run to fixup
Gio code:
$ gofmt -r 'pointer.InputOp{Key:a} -> pointer.InputOp{Tag:a}' -w .
$ gofmt -r 'pointer.InputOp{Key:a, Grab:b} -> pointer.InputOp{Tag:a, Grab:b}' -w .
$ gofmt -r 'key.InputOp{Key:a} -> key.InputOp{Tag:a}' -w .
$ gofmt -r 'key.InputOp{Key:a, Focus:b} -> key.InputOp{Tag:a, Focus:b}' -w .
$ gofmt -r 'event.Key -> event.Tag' -w .
Signed-off-by: Elias Naur <mail@eliasnaur.com>
32 lines
583 B
Go
32 lines
583 B
Go
// SPDX-License-Identifier: Unlicense OR MIT
|
|
|
|
// Package profiles provides access to rendering
|
|
// profiles.
|
|
package profile
|
|
|
|
import (
|
|
"gioui.org/internal/opconst"
|
|
"gioui.org/io/event"
|
|
"gioui.org/op"
|
|
)
|
|
|
|
// Op registers a handler for receiving
|
|
// Events.
|
|
type Op struct {
|
|
Tag event.Tag
|
|
}
|
|
|
|
// Event contains profile data from a single
|
|
// rendered frame.
|
|
type Event struct {
|
|
// Timings. Very likely to change.
|
|
Timings string
|
|
}
|
|
|
|
func (p Op) Add(o *op.Ops) {
|
|
data := o.Write(opconst.TypeProfileLen, p.Tag)
|
|
data[0] = byte(opconst.TypeProfile)
|
|
}
|
|
|
|
func (p Event) ImplementsEvent() {}
|