Files
gio/ui/system/system.go
T
Elias Naur 3944ef4b2e ui: merge package input
Event handling is as fundamental as operations, so move the input
package declarations to package ui.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-09-24 22:24:10 +02:00

32 lines
640 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/internal/opconst"
)
// ProfileOp registers a handler for receiving
// ProfileEvents.
type ProfileOp struct {
Key ui.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() {}