Documentation
¶
Overview ¶
Package hitmap is pure geometry: it maps a screen (row, col) to a Hit zone using the rectangles a layout publishes. It operates on integers and zone names only.
Go port of Ruby's lib/tui/hit_map.rb.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Outside = Hit{Zone: ZoneOutside}
Outside is the never-nil answer for coordinates off the frame.
Functions ¶
This section is empty.
Types ¶
type FooterPayload ¶
type FooterPayload struct {
}
FooterPayload is the payload a footer hit carries.
type FooterRole ¶
type FooterRole string
FooterRole classifies a footer line for routing purposes.
const ( RoleChrome FooterRole = "chrome" RoleResponse FooterRole = "response" RolePrompt FooterRole = "prompt" )
type Hit ¶
Hit is one resolved zone. Index carries the row/line payload for list, modal, popup and footer zones; Tab carries the tab key; Footer carries the footer index and role.
type HitMap ¶
type HitMap struct {
// contains filtered or unexported fields
}
HitMap answers zone queries for one sampled frame.
type MarkerSpan ¶
type MarkerSpan struct{ Start, End int }
MarkerSpan is the half-open column range of a row's collapse marker, measured inside the row text (after the two-cell cursor prefix).
type Options ¶
type Options struct {
Layout *layout.Layout
TabSpans []TabSpan
RowCount int
Modal *layout.Modal
Popup *layout.Popup
Panel bool
MarkerSpans map[int]MarkerSpan
}
Options builds a HitMap.
type Zone ¶
type Zone string
Zone names a clickable region of the frame.
const ( ZoneOutside Zone = "outside" ZoneBorder Zone = "border" ZoneHeader Zone = "header" ZoneTab Zone = "tab" ZoneListRow Zone = "list_row" ZoneCollapseMarker Zone = "collapse_marker" ZonePanel Zone = "panel" ZonePanelDivider Zone = "panel_divider" ZoneModalRow Zone = "modal_row" ZonePopupRow Zone = "popup_row" )