Documentation
¶
Overview ¶
Package layoutreport owns the versioned JSON projection `sidecar layout get` returns: grid, kinds, targets, sessions, caps, and floors. Both the project workspace and the global Sessions surface build this document from a pane tree so the wire shape cannot drift.
Index ¶
Constants ¶
const Version = 1
Variables ¶
This section is empty.
Functions ¶
func Build ¶
func Build(src Source) json.RawMessage
Build projects Source onto the get-report JSON document. A tree that escapes the grid vocabulary reports "grid": null plus the raw tree.
func LiveBoxes ¶
func LiveBoxes(root *panelayout.Node, peer panelayout.Box, floors panelayout.Floors) map[int]panelayout.Box
LiveBoxes is each leaf's tiled OUTER box for the current viewport, or nil when the tree does not fit: a get answer then reports structure without pretending geometry it cannot draw.
Types ¶
type Floors ¶
Floors reports the per-kind minimum OUTER box the frame enforces, keyed by the vocabulary's wire names.
func FloorsJSON ¶
func FloorsJSON(floors panelayout.Floors) Floors
FloorsJSON projects panelayout.Floors onto the get-report's keyed object.
type Report ¶
type Report struct {
Version int `json:"version"`
Surface string `json:"surface,omitempty"`
Root string `json:"root,omitempty"`
Grid *Grid `json:"grid"`
Tree json.RawMessage `json:"tree,omitempty"`
Viewport *Box `json:"viewport,omitempty"`
Caps Caps `json:"caps"`
Floors Floors `json:"floors"`
}
Report is one versioned JSON document describing a surface's pane tree.
type Source ¶
type Source struct {
Surface string
Root string
Tree *panelayout.Node
Viewport *panelayout.Box
Floors panelayout.Floors
Layout *state.PaneLayoutJSON
Boxes map[int]panelayout.Box
}
Source is everything a host supplies to project a get answer. Layout is the panecodec encoding of Tree (tabs, session, raw tree); Boxes are live outer geometry keyed by leaf id, omitted when the tree does not fit.