54 std::vector<SelectableLine>
lines;
A widget whose painted text can join a document-level selection.
Definition selectable_text.hpp:58
const View * selectable_view() const
Definition selectable_text.hpp:78
virtual void set_selection_highlight(int start_utf8, int end_utf8)=0
Paint this byte range as selected. start >= end clears the highlight.
virtual View * selectable_view()=0
The View this capability is mixed into. Never null.
virtual ~SelectableText()=default
virtual SelectableLayout selectable_layout() const =0
Where the glyphs landed at the last paint. See SelectableLayout.
virtual bool selection_highlight(int &start_utf8, int &end_utf8) const =0
The current highlight. Returns false when nothing is highlighted.
virtual std::string_view selectable_text() const =0
The widget's text, in UTF-8.
Hover-cursor tracking for platform window hosts.
Definition fwd.hpp:27
View * enclosing_text_selection_region(View &from)
The nearest enclosing text-content region of from (itself included), or null when it is not inside on...
int selectable_index_at_point(const SelectableLayout &layout, Point local)
Nearest cluster boundary to local within layout.
std::vector< Rect > selectable_rects_for_range(const SelectableLayout &layout, int start_utf8, int end_utf8)
The painted rects covering [start_utf8, end_utf8), in local coordinates, one per touched line.
int selectable_first_index(const SelectableLayout &layout)
First / last selectable byte offset in layout.
int selectable_last_index(const SelectableLayout &layout)
Definition geometry.hpp:20
The painted line geometry of one widget.
Definition selectable_text.hpp:52
bool measured
Definition selectable_text.hpp:53
std::vector< SelectableLine > lines
Definition selectable_text.hpp:54
One painted line of selectable text, in the widget's LOCAL coordinates.
Definition selectable_text.hpp:36
std::vector< float > x_offsets
Definition selectable_text.hpp:41
int start_utf8
First byte of this line in selectable_text().
Definition selectable_text.hpp:37
float height
Definition selectable_text.hpp:40
float top
Definition selectable_text.hpp:39
int end_utf8
One past this line's last byte.
Definition selectable_text.hpp:38
std::vector< int > byte_offsets
Definition selectable_text.hpp:42