pub struct Scrollview { /* private fields */ }
Expand description
Represents a single scrollview and tracks all state related to it.
Implementations§
Source§impl Scrollview
impl Scrollview
Sourcepub fn sample(&mut self, timestamp: u64) -> AxisVector<f64>
pub fn sample(&mut self, timestamp: u64) -> AxisVector<f64>
Gives the current best estimate for the position of the content relative to the viewport in device pixels
Sourcepub fn new() -> Scrollview
pub fn new() -> Scrollview
Create a new scrollview with default settings
Warning: these settings are unlikely to be particularly useful, so set_geometry(), set_avg_frametime(), and any other relevant initialization functions still need to be used
Sourcepub fn del(_: Scrollview)
pub fn del(_: Scrollview)
Deletes/deinitializes the current scrollview
Primarily intended for ffi use, Scrollview implements Drop where deinitialization is required, so this is only useful for ffi use
NOTE: likely will be removed, not sure why I put this in here to begin with
Sourcepub fn set_geometry(
&mut self,
content_height: f64,
content_width: f64,
viewport_height: f64,
viewport_width: f64,
)
pub fn set_geometry( &mut self, content_height: f64, content_width: f64, viewport_height: f64, viewport_width: f64, )
Set the geometry for the given scrollview
Can be used both on scrollview initialization and on scrollview resize
Sourcepub fn animating(&self) -> bool
pub fn animating(&self) -> bool
True if scrollview should continue to be polled even in absence of events (fling or other animation in progress)
Sourcepub fn push_pan(&mut self, axis: Axis, amount: f64, timestamp: Option<u64>)
pub fn push_pan(&mut self, axis: Axis, amount: f64, timestamp: Option<u64>)
Enqueue a pan event for the referenced scrollview
Sourcepub fn push_fling(&mut self, timestamp: Option<u64>)
pub fn push_fling(&mut self, timestamp: Option<u64>)
Enqueue a fling (finger lift at any velocity) for the referenced scrollview
Sourcepub fn push_interrupt(&mut self, timestamp: Option<u64>)
pub fn push_interrupt(&mut self, timestamp: Option<u64>)
Enqueue a scroll interrupt (finger down at any time, gesture start) for the referenced scrollview
Sourcepub fn set_source(&mut self, source: Source)
pub fn set_source(&mut self, source: Source)
Set what device type is going to be providing any events that follow until the next source is declared