io/pointer: added CursorNameOp

The cursor can now be customized for a given area.

Signed-off-by: pierre <pierre.curto@gmail.com>
This commit is contained in:
pierre
2020-12-08 18:54:50 +01:00
committed by Elias Naur
parent 675e86b8e8
commit 7c5bcd3db8
6 changed files with 57 additions and 3 deletions
+4 -1
View File
@@ -30,6 +30,7 @@ const (
TypeAux
TypeClip
TypeProfile
TypeCursor
)
const (
@@ -55,6 +56,7 @@ const (
TypeAuxLen = 1
TypeClipLen = 1 + 4*4 + 4 + 2 + 4
TypeProfileLen = 1
TypeCursorLen = 1 + 1
)
func (t OpType) Size() int {
@@ -81,12 +83,13 @@ func (t OpType) Size() int {
TypeAuxLen,
TypeClipLen,
TypeProfileLen,
TypeCursorLen,
}[t-firstOpIndex]
}
func (t OpType) NumRefs() int {
switch t {
case TypeKeyInput, TypePointerInput, TypeProfile, TypeCall, TypeClipboardRead, TypeClipboardWrite:
case TypeKeyInput, TypePointerInput, TypeProfile, TypeCall, TypeClipboardRead, TypeClipboardWrite, TypeCursor:
return 1
case TypeImage:
return 2