134 float solid_remaining_ = 0.0f;
Definition canvas.hpp:240
CaretBlink() noexcept
Adopts default_caret_blink() as it stands at construction, so an app that sets a process-wide default...
void set_config(const CaretBlinkConfig &config) noexcept
void advance(float dt) noexcept
Advance real time by dt seconds.
void reset() noexcept
Focus gained: solid, with the blink phase rewound.
const CaretBlinkConfig & config() const noexcept
Definition caret.hpp:109
bool visible() const noexcept
True when the caret should be painted this frame.
void keep_solid() noexcept
The caret moved or the text changed: show it, and restart the hold.
bool holding_solid() const noexcept
True while the post-movement solid hold is still running.
Definition caret.hpp:129
Definition affine_transform.hpp:24
Hover-cursor tracking for platform window hosts.
Definition fwd.hpp:27
void paint_caret_over_text(canvas::Canvas &canvas, CaretStyle style, const CaretMetrics &metrics, canvas::Color color, canvas::Color text_bg, const std::string &text, float text_x)
Paint the caret, and for block redraw the covered glyph in text_bg so it stays legible against the fi...
CaretStyle default_caret_style() noexcept
Process-wide caret defaults.
@ text
Plain text (default color).
Definition code_editor_tokenizer.hpp:37
Rect caret_rect_for_style(CaretStyle style, const CaretMetrics &metrics) noexcept
The rect a caret of style occupies.
const CaretBlinkConfig & default_caret_blink() noexcept
void paint_caret(canvas::Canvas &canvas, CaretStyle style, const CaretMetrics &metrics, canvas::Color color)
Fill the caret rect.
float caret_advance(const CaretMetrics &metrics) noexcept
The width the underline and block shapes cover: advance when there is a glyph at the caret,...
CaretStyle
Caret shape. All three anchor at the same caret x.
Definition caret.hpp:63
@ block
Filled glyph cell; the covered glyph is drawn in the bg color.
Definition caret.hpp:66
@ ibeam
Vertical rule spanning the glyph cell. The default.
Definition caret.hpp:64
@ underline
Rule at the underline position, one glyph cell wide.
Definition caret.hpp:65
const char * caret_style_to_string(CaretStyle style) noexcept
Stable lowercase names, for serialization and the JS bridge.
void set_default_caret_blink(const CaretBlinkConfig &config) noexcept
@ color
Definition css_animation.hpp:121
CaretStyle caret_style_from_string(std::string_view name) noexcept
Parse a name produced by caret_style_to_string.
void set_default_caret_style(CaretStyle style) noexcept
Blink timing. The defaults are the values Pulp has always used.
Definition caret.hpp:78
float duty
Fraction of the period the caret is visible. Clamped to [0, 1].
Definition caret.hpp:82
float period_seconds
Full on+off cycle, in seconds. Clamped to >= 0.05 s when applied.
Definition caret.hpp:80
float solid_hold_seconds
How long the caret stays solid after a movement or an edit.
Definition caret.hpp:84
bool enabled
False → the caret never blinks and is always visible while focused.
Definition caret.hpp:86
Where a caret goes, in the coordinate space the widget paints text in.
Definition caret.hpp:144
float cell_top
Top of the glyph cell.
Definition caret.hpp:146
float cell_height
Height of the glyph cell.
Definition caret.hpp:147
float stroke
I-beam width and underline thickness.
Definition caret.hpp:151
float advance
Width of the glyph at the caret; 0 at end of text.
Definition caret.hpp:149
float nominal_advance
Fallback width when advance is 0.
Definition caret.hpp:150
float x
Left edge of the caret, for every style.
Definition caret.hpp:145
float baseline
Text baseline, for the underline shape.
Definition caret.hpp:148
Axis-aligned rectangle in continuous (float) coordinates.
Definition geometry.hpp:52