Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::view::web::WebInputRouter Class Reference

Routes translated browser events into a live View tree. More...

#include <web_event_translate.hpp>

Public Member Functions

 WebInputRouter (View &root)
void set_mapping (const ViewportMapping &mapping)
const ViewportMapping & mapping () const
void set_dirty_callback (std::function< void()> cb)
 Called after any handler that changed view state, so the host can mark the surface dirty.
void invalidate ()
 Forget cached drag / hover / focus targets.
View * focused_view () const
View * drag_target () const
bool handle_pointer (const BrowserPointerEvent &event)
bool handle_wheel (const BrowserWheelEvent &event)
bool handle_key (const BrowserKeyEvent &event)
bool handle_text (const std::string &text)
 Composed text from a DOM input / IME commit.

Detailed Description

Routes translated browser events into a live View tree.

Every coordinate passes through css_to_root() exactly once, at the top of each handler — the single chokepoint that keeps hit-testing aligned with paint under a design viewport.

Constructor & Destructor Documentation

◆ WebInputRouter()

pulp::view::web::WebInputRouter::WebInputRouter ( View & root)
inlineexplicit

Member Function Documentation

◆ drag_target()

View * pulp::view::web::WebInputRouter::drag_target ( ) const
inline

◆ focused_view()

View * pulp::view::web::WebInputRouter::focused_view ( ) const
inline

◆ handle_key()

bool pulp::view::web::WebInputRouter::handle_key ( const BrowserKeyEvent & event)
inline

◆ handle_pointer()

bool pulp::view::web::WebInputRouter::handle_pointer ( const BrowserPointerEvent & event)
inline

◆ handle_text()

bool pulp::view::web::WebInputRouter::handle_text ( const std::string & text)
inline

Composed text from a DOM input / IME commit.

NOT DRIVEN BY THE BROWSER YET. web_input.cpp exports the C entry point (pulp_web_on_text) but installs no input / compositionend listener, so nothing in-tree feeds this. The only text that reaches a focused view today is handle_key()'s printable-key fallback above, which cannot express an IME composition. This is the seam an IME implementation plugs into (attach a hidden contenteditable / <input>, forward its committed text to pulp_web_on_text); until then it is exercised only by test_window_host_web.cpp.

◆ handle_wheel()

bool pulp::view::web::WebInputRouter::handle_wheel ( const BrowserWheelEvent & event)
inline

◆ invalidate()

void pulp::view::web::WebInputRouter::invalidate ( )
inline

Forget cached drag / hover / focus targets.

The host calls this when the view tree is rebuilt and the raw pointers may dangle.

◆ mapping()

const ViewportMapping & pulp::view::web::WebInputRouter::mapping ( ) const
inline

◆ set_dirty_callback()

void pulp::view::web::WebInputRouter::set_dirty_callback ( std::function< void()> cb)
inline

Called after any handler that changed view state, so the host can mark the surface dirty.

◆ set_mapping()

void pulp::view::web::WebInputRouter::set_mapping ( const ViewportMapping & mapping)
inline

The documentation for this class was generated from the following file: