70#define N_WRAP_SPACE (1u << 0)
72#define N_WRAP_NEWLINE (1u << 1)
static N_GUI_MOUSE_EVENT last
the last event the widget was told of, and how many
void line(BITMAP *bmp, int x1, int y1, int x2, int y2, int color)
draw a line
size_t n_wrap_layout(const n_wrap_item *items, size_t count, double max_width, n_wrap_emit emit, void *user)
Break items into lines no wider than max_width.
void(* n_wrap_rect_emit)(size_t line, double x0, double x1, void *user)
Called once per line that a span covers, by n_wrap_span_rects().
double width
advance width in the caller's units (pixels, columns, ...)
unsigned int flags
N_WRAP_SPACE / N_WRAP_NEWLINE, or 0
size_t n_wrap_span_rects(const n_wrap_item *items, size_t count, double max_width, size_t lo, size_t hi, n_wrap_rect_emit emit, void *user)
The rectangles that cover the items [lo, hi): one per line the range touches, in order,...
void(* n_wrap_emit)(size_t first, size_t last, size_t line, double width, void *user)
Called once per laid-out line, in order.
size_t n_wrap_index_at(const n_wrap_item *items, size_t count, double max_width, double line_height, double x, double y)
The item boundary nearest a point: the inverse of n_wrap_layout(), for turning a click or a drag into...
One pre-measured layout item: a glyph, an emoji cell, an inline image, or a whole word,...