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

Pointer/keyboard/text routing for one plug-in editor window. More...

#include <win_plugin_input_router.hpp>

Public Member Functions

 PluginInputRouter (InputRouterHost &host) noexcept
 PluginInputRouter (const PluginInputRouter &)=delete
PluginInputRouter & operator= (const PluginInputRouter &)=delete
void on_mouse_down (Point pt, MouseButton button, std::uint16_t modifiers)
void on_mouse_move (Point pt, std::uint32_t button_mask, std::uint16_t modifiers)
 button_mask is the raw MK_* word from the move message; the router asks drag_continues() whether the pressed button is still down, which is how a button released outside the window ends its gesture.
void on_mouse_up (Point pt, MouseButton button, std::uint16_t modifiers)
void on_capture_lost () noexcept
void on_mouse_leave ()
void on_mouse_wheel (Point pt, float dx, float dy, std::uint16_t modifiers=0)
bool on_key (KeyCode key, std::uint16_t modifiers, bool is_down, bool is_repeat)
bool on_text_unit (char16_t unit)
 One UTF-16 code unit from WM_CHAR.
void on_focus_changed (bool gained)
void cancel_gesture () noexcept
 End any live gesture, delivering the cancellation the widgets need.
bool gesture_active () const noexcept
MouseButton gesture_button () const noexcept
bool has_captured_target () const noexcept
const View * captured_target () const noexcept
Point last_point () const noexcept
bool tracking_mouse_leave () const noexcept
bool has_pending_high_surrogate () const noexcept

Detailed Description

Pointer/keyboard/text routing for one plug-in editor window.

Owns the gesture state — the PointerSession, the captured drag target, the last pointer position, leave-tracking and the pending high surrogate — so the host no longer carries five loose fields whose invariants were only expressed by the order of statements in its handlers.

All methods run on the UI thread. Points are already in ROOT (layout) coordinates: the DPI scale and the design-viewport transform are the host's, so the router never sees a physical pixel.

Constructor & Destructor Documentation

◆ PluginInputRouter() [1/2]

pulp::view::win_input::PluginInputRouter::PluginInputRouter ( InputRouterHost & host)
inlineexplicitnoexcept

◆ PluginInputRouter() [2/2]

pulp::view::win_input::PluginInputRouter::PluginInputRouter ( const PluginInputRouter & )
delete

Member Function Documentation

◆ cancel_gesture()

void pulp::view::win_input::PluginInputRouter::cancel_gesture ( )
inlinenoexcept

End any live gesture, delivering the cancellation the widgets need.

noexcept because detach/destroy call it and a throw there would cross a host boundary.

◆ captured_target()

const View * pulp::view::win_input::PluginInputRouter::captured_target ( ) const
inlinenoexcept

◆ gesture_active()

bool pulp::view::win_input::PluginInputRouter::gesture_active ( ) const
inlinenoexcept

◆ gesture_button()

MouseButton pulp::view::win_input::PluginInputRouter::gesture_button ( ) const
inlinenoexcept

◆ has_captured_target()

bool pulp::view::win_input::PluginInputRouter::has_captured_target ( ) const
inlinenoexcept

◆ has_pending_high_surrogate()

bool pulp::view::win_input::PluginInputRouter::has_pending_high_surrogate ( ) const
inlinenoexcept

◆ last_point()

Point pulp::view::win_input::PluginInputRouter::last_point ( ) const
inlinenoexcept

◆ on_capture_lost()

void pulp::view::win_input::PluginInputRouter::on_capture_lost ( )
inlinenoexcept

◆ on_focus_changed()

void pulp::view::win_input::PluginInputRouter::on_focus_changed ( bool gained)
inline

◆ on_key()

bool pulp::view::win_input::PluginInputRouter::on_key ( KeyCode key,
std::uint16_t modifiers,
bool is_down,
bool is_repeat )
inline

◆ on_mouse_down()

void pulp::view::win_input::PluginInputRouter::on_mouse_down ( Point pt,
MouseButton button,
std::uint16_t modifiers )
inline

◆ on_mouse_leave()

void pulp::view::win_input::PluginInputRouter::on_mouse_leave ( )
inline

◆ on_mouse_move()

void pulp::view::win_input::PluginInputRouter::on_mouse_move ( Point pt,
std::uint32_t button_mask,
std::uint16_t modifiers )
inline

button_mask is the raw MK_* word from the move message; the router asks drag_continues() whether the pressed button is still down, which is how a button released outside the window ends its gesture.

◆ on_mouse_up()

void pulp::view::win_input::PluginInputRouter::on_mouse_up ( Point pt,
MouseButton button,
std::uint16_t modifiers )
inline

◆ on_mouse_wheel()

void pulp::view::win_input::PluginInputRouter::on_mouse_wheel ( Point pt,
float dx,
float dy,
std::uint16_t modifiers = 0 )
inline

◆ on_text_unit()

bool pulp::view::win_input::PluginInputRouter::on_text_unit ( char16_t unit)
inline

One UTF-16 code unit from WM_CHAR.

Returns whether the unit was consumed by the text channel — a false return means no focused view accepts text, so the host should let default processing have it.

◆ operator=()

PluginInputRouter & pulp::view::win_input::PluginInputRouter::operator= ( const PluginInputRouter & )
delete

◆ tracking_mouse_leave()

bool pulp::view::win_input::PluginInputRouter::tracking_mouse_leave ( ) const
inlinenoexcept

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