Remembers the pointer position and the style last handed to the platform.
More...
#include <hover_cursor.hpp>
Remembers the pointer position and the style last handed to the platform.
A host calls set_pointer / clear_pointer from its enter/move/exit handlers, note_published whenever it pushes a style through its own pointer-driven path, and poll once per rendered frame. poll yields a style only when it differs from the last published one, so the platform call happens on change rather than on every frame.
◆ clear_pointer()
| void pulp::view::HoverCursorTracker::clear_pointer |
( |
| ) |
|
|
inline |
The pointer left the surface.
Also drops the published style, so the first resolve after the pointer returns always publishes.
◆ has_pointer()
| bool pulp::view::HoverCursorTracker::has_pointer |
( |
| ) |
const |
|
inline |
◆ note_published()
Record a style the host just pushed to the platform itself, so the next poll does not push the same style again.
◆ pointer()
| Point pulp::view::HoverCursorTracker::pointer |
( |
| ) |
const |
|
inline |
◆ poll()
Re-resolve at the remembered pointer position and report a change.
nullopt when no pointer is over the surface or the style is unchanged. This is the stationary-pointer path: it takes no event and no new coordinates, so a content change alone can move the cursor.
◆ poll_resolved()
Change detection over a style the caller resolved itself.
Hosts that layer an overlay or inspector override on top of the hit-test answer resolve the final style and route it through here. Returns the style when it differs from the last published one, nullopt otherwise, and records a returned style as published.
◆ published()
The style last pushed to the platform, or default_ before any push.
◆ set_pointer()
| void pulp::view::HoverCursorTracker::set_pointer |
( |
Point | p | ) |
|
|
inline |
Record that the pointer is over the surface at p (root coordinates).
The documentation for this class was generated from the following file: