Skip to main content

Module wrap

Module wrap 

Source
Expand description

Line breaking and per-message layout.

Produces a LayoutCache for one message at one width: its total pixel height and the line boxes needed for hit-testing. This is where both layouts live: two columns, with the timestamp and nick gutter on the left and the body indented past it, and one, with the nick at the start of the body’s first line.

Measurement goes through TextMeasure, one call per run, never per character. xtext’s find_next_wrap (xtext.c:3685) measured character by character through a full Pango layout round trip each time; that is the single hottest thing in its append path and the reason a resize of a large buffer visibly hitches.

Structs§

AvatarBox
A square avatar slot in the gutter, in row-local coordinates.
LayoutCache
What a laid-out message knows about itself.
LayoutGeneration
Identifies the conditions a LayoutCache was computed under.
LayoutParams
Geometry knobs, supplied by the view.
LineBox
One visual line within a message.

Enums§

LineSource
What a LineBox draws text from.

Functions§

estimate_height
Rough height for a row that has never been laid out.
is_muted
Whether a message draws in the muted secondary colour.
layout_message
Lay one message out.
spans_in
Spans of p clipped to range, for the view’s snapshot pass.