forked from joejulian/gio
6e26c92c75
Add decode functions to the packages that need them instead. For TransformOp that is used in multiple packages, add the decode function to the internal ops package. Signed-off-by: Elias Naur <mail@eliasnaur.com>
33 lines
665 B
Go
33 lines
665 B
Go
// SPDX-License-Identifier: Unlicense OR MIT
|
|
|
|
// Package system contain ops and types for
|
|
// system events.
|
|
package system
|
|
|
|
import (
|
|
"gioui.org/ui"
|
|
"gioui.org/ui/input"
|
|
"gioui.org/ui/internal/opconst"
|
|
)
|
|
|
|
// ProfileOp registers a handler for receiving
|
|
// ProfileEvents.
|
|
type ProfileOp struct {
|
|
Key input.Key
|
|
}
|
|
|
|
// ProfileEvent contain profile data from a single
|
|
// rendered frame.
|
|
type ProfileEvent struct {
|
|
// String with timings. Very likely to change.
|
|
Timings string
|
|
}
|
|
|
|
func (p ProfileOp) Add(o *ui.Ops) {
|
|
data := make([]byte, opconst.TypeProfileLen)
|
|
data[0] = byte(opconst.TypeProfile)
|
|
o.Write(data, p.Key)
|
|
}
|
|
|
|
func (p ProfileEvent) ImplementsEvent() {}
|