kitty

package
v0.3.0-alpha.55 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Action       string
	Params       map[string]string
	Payload      []byte
	RawPayload   string
	More         bool
	Format       string
	Width        int
	Height       int
	Cols         int
	Rows         int
	X            int
	Y            int
	Z            int
	NoCursorMove bool
	ImageID      string
	Number       uint32
	PlacementID  uint32
	DeleteMode   string
	Compression  string
	Transmission string
}

type Cursor

type Cursor struct {
	Row int
	Col int
}

type CursorMove

type CursorMove struct {
	Cols int
	Rows int
}

type Decoder

type Decoder struct {
	// contains filtered or unexported fields
}

func (*Decoder) Process

func (d *Decoder) Process(data []byte, cursor Cursor, state *State) ([]byte, []Event)

type Delete

type Delete struct {
	All         bool   `json:"all,omitempty"`
	ImageID     string `json:"imageId,omitempty"`
	PlacementID uint32 `json:"placementId,omitempty"`
}

type Event

type Event struct {
	Kind      string     `json:"kind"`
	Image     *Image     `json:"image,omitempty"`
	Placement *Placement `json:"placement,omitempty"`
	Delete    *Delete    `json:"delete,omitempty"`
	Snapshot  *Snapshot  `json:"snapshot,omitempty"`
}

type Image

type Image struct {
	ID     string `json:"id"`
	Number uint32 `json:"number,omitempty"`
	Format string `json:"format"`
	Width  int    `json:"width,omitempty"`
	Height int    `json:"height,omitempty"`
	Data   []byte `json:"data,omitempty"`
}

type Placement

type Placement struct {
	ID      uint32 `json:"id"`
	ImageID string `json:"imageId"`
	Row     int    `json:"row"`
	Col     int    `json:"col"`
	Rows    int    `json:"rows"`
	Cols    int    `json:"cols"`
	X       int    `json:"x,omitempty"`
	Y       int    `json:"y,omitempty"`
	Z       int    `json:"z,omitempty"`
}

type Snapshot

type Snapshot struct {
	Images     []Image     `json:"images"`
	Placements []Placement `json:"placements"`
}

type State

type State struct {
	// contains filtered or unexported fields
}

func NewState

func NewState() *State

func (*State) Apply

func (s *State) Apply(cmd Command, cursor Cursor) (events []Event, move CursorMove)

func (*State) ClearAll

func (s *State) ClearAll() []Event

func (*State) MarshalJSON

func (s *State) MarshalJSON() ([]byte, error)

func (*State) Restore

func (s *State) Restore(snapshot Snapshot)

func (*State) Snapshot

func (s *State) Snapshot() Snapshot

func (*State) UnmarshalJSON

func (s *State) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL