mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 09:25:38 +00:00
ui,internal/ops,internal/opconst: move OpsReader to internal ops package
To avoid import cycles, move the op constants to its own package, internal/opconst. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+4
-4
@@ -7,7 +7,7 @@ package system
|
||||
import (
|
||||
"gioui.org/ui"
|
||||
"gioui.org/ui/input"
|
||||
"gioui.org/ui/internal/ops"
|
||||
"gioui.org/ui/internal/opconst"
|
||||
)
|
||||
|
||||
// ProfileOp registers a handler for receiving
|
||||
@@ -24,13 +24,13 @@ type ProfileEvent struct {
|
||||
}
|
||||
|
||||
func (p ProfileOp) Add(o *ui.Ops) {
|
||||
data := make([]byte, ops.TypeProfileLen)
|
||||
data[0] = byte(ops.TypeProfile)
|
||||
data := make([]byte, opconst.TypeProfileLen)
|
||||
data[0] = byte(opconst.TypeProfile)
|
||||
o.Write(data, p.Key)
|
||||
}
|
||||
|
||||
func (p *ProfileOp) Decode(d []byte, refs []interface{}) {
|
||||
if ops.OpType(d[0]) != ops.TypeProfile {
|
||||
if opconst.OpType(d[0]) != opconst.TypeProfile {
|
||||
panic("invalid op")
|
||||
}
|
||||
*p = ProfileOp{
|
||||
|
||||
Reference in New Issue
Block a user