mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 15:45:38 +00:00
all: remove exported Decode methods on operations
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>
This commit is contained in:
@@ -115,16 +115,6 @@ func (h HandlerOp) Add(o *ui.Ops) {
|
||||
o.Write(data, h.Key)
|
||||
}
|
||||
|
||||
func (h *HandlerOp) Decode(d []byte, refs []interface{}) {
|
||||
if opconst.OpType(d[0]) != opconst.TypePointerHandler {
|
||||
panic("invalid op")
|
||||
}
|
||||
*h = HandlerOp{
|
||||
Grab: d[1] != 0,
|
||||
Key: refs[0].(input.Key),
|
||||
}
|
||||
}
|
||||
|
||||
func (op PassOp) Add(o *ui.Ops) {
|
||||
data := make([]byte, opconst.TypePassLen)
|
||||
data[0] = byte(opconst.TypePass)
|
||||
@@ -134,15 +124,6 @@ func (op PassOp) Add(o *ui.Ops) {
|
||||
o.Write(data)
|
||||
}
|
||||
|
||||
func (op *PassOp) Decode(d []byte) {
|
||||
if opconst.OpType(d[0]) != opconst.TypePass {
|
||||
panic("invalid op")
|
||||
}
|
||||
*op = PassOp{
|
||||
Pass: d[1] != 0,
|
||||
}
|
||||
}
|
||||
|
||||
func (t Type) String() string {
|
||||
switch t {
|
||||
case Press:
|
||||
|
||||
Reference in New Issue
Block a user