ui: let OpsReader keep track of references

Instead of exposing the entire reference slice, return the relevant
references from Next.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-06-01 20:48:36 +02:00
parent 5966aab77e
commit 0d2cffe196
11 changed files with 166 additions and 104 deletions
+25 -7
View File
@@ -2,8 +2,11 @@ package ops
type OpType byte
// Start at a high number for easier debugging.
const FirstOpIndex = 200
const (
TypeBlockDef OpType = iota
TypeBlockDef OpType = iota + FirstOpIndex
TypeBlock
TypeTransform
TypeLayer
@@ -20,18 +23,33 @@ const (
)
const (
TypeBlockDefLen = 1 + 4
TypeBlockLen = 1 + 4
TypeBlockDefLen = 1 + 4 + 4
TypeBlockLen = 1 + 4 + 4
TypeTransformLen = 1 + 4*2
TypeLayerLen = 1
TypeRedrawLen = 1 + 8
TypeClipLen = 1 + 4
TypeImageLen = 1 + 4 + 4*4
TypeClipLen = 1
TypeImageLen = 1 + 4*4
TypeDrawLen = 1 + 4*4
TypeColorLen = 1 + 4
TypePointerHandlerLen = 1 + 4 + 4 + 1
TypeKeyHandlerLen = 1 + 4 + 1
TypePointerHandlerLen = 1 + 1
TypeKeyHandlerLen = 1 + 1
TypeHideInputLen = 1
TypePushLen = 1
TypePopLen = 1
TypeBlockDefRefs = 0
TypeBlockRefs = 0
TypeTransformRefs = 0
TypeLayerRefs = 0
TypeRedrawRefs = 0
TypeClipRefs = 1
TypeImageRefs = 1
TypeDrawRefs = 0
TypeColorRefs = 0
TypePointerHandlerRefs = 2
TypeKeyHandlerRefs = 1
TypeHideInputRefs = 0
TypePushRefs = 0
TypePopRefs = 0
)