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

Owns a PointerCoalescer plus the host-side policy around it: the frame-driver opt-in, the idle->pending dirty edge, and the counters. More...

#include <host_drag_coalescer.hpp>

Classes

struct  SubmitResult
 What a host must do in response to a submitted sample. More...
struct  Stats

Public Types

using Deliver = std::function<void(const PointerSample&)>
 Delivers one sample to the view tree.

Public Member Functions

void set_frame_driver_running (bool running, const Deliver &deliver)
 Opt in only from a host that has committed to calling flush_frame once per presented frame.
bool frame_driver_running () const
SubmitResult submit (const PointerSample &sample, const Deliver &deliver)
 Feed one raw pointer sample.
std::size_t flush_frame (const Deliver &deliver)
 Release motion held since the last presented frame.
void discard ()
 Drop held motion WITHOUT delivering it, for a host tearing down mid-gesture where the target may already be freed.
bool has_pending () const
const Stats & stats () const

Detailed Description

Owns a PointerCoalescer plus the host-side policy around it: the frame-driver opt-in, the idle->pending dirty edge, and the counters.

Timing still belongs to the caller. There is no clock here: the host calls submit per raw event and flush_frame once per PRESENTED frame.

Member Typedef Documentation

◆ Deliver

using pulp::view::HostDragCoalescer::Deliver = std::function<void(const PointerSample&)>

Delivers one sample to the view tree.

Called synchronously, and the host may deliver to a target that has since been unmounted, so the callable is responsible for its own liveness re-check.

Member Function Documentation

◆ discard()

void pulp::view::HostDragCoalescer::discard ( )

Drop held motion WITHOUT delivering it, for a host tearing down mid-gesture where the target may already be freed.

◆ flush_frame()

std::size_t pulp::view::HostDragCoalescer::flush_frame ( const Deliver & deliver)

Release motion held since the last presented frame.

Call once per PRESENTED frame, BEFORE the frame's render decision — a frame that decides not to paint must still release input, or latency grows without bound while the UI is visually idle. Returns the number delivered.

◆ frame_driver_running()

bool pulp::view::HostDragCoalescer::frame_driver_running ( ) const
inline

◆ has_pending()

bool pulp::view::HostDragCoalescer::has_pending ( ) const
inline

◆ set_frame_driver_running()

void pulp::view::HostDragCoalescer::set_frame_driver_running ( bool running,
const Deliver & deliver )

Opt in only from a host that has committed to calling flush_frame once per presented frame.

Default is OFF, and that default is load bearing: holding motion nothing will ever release is not a slow drag, it is no drag at all.

Turning it OFF flushes, so a sample submitted during teardown dispatches immediately rather than joining a batch nobody is left to release. Call discard first when the target may already be gone.

◆ stats()

const Stats & pulp::view::HostDragCoalescer::stats ( ) const
inline

◆ submit()

SubmitResult pulp::view::HostDragCoalescer::submit ( const PointerSample & sample,
const Deliver & deliver )

Feed one raw pointer sample.


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