Struct Scrollview

Source
pub struct Scrollview { /* private fields */ }
Expand description

Represents a single scrollview and tracks all state related to it.

Implementations§

Source§

impl Scrollview

Source

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

Source

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

Source

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

Source

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

Source

pub fn animating(&self) -> bool

True if scrollview should continue to be polled even in absence of events (fling or other animation in progress)

Source

pub fn push_pan(&mut self, axis: Axis, amount: f64, timestamp: Option<u64>)

Enqueue a pan event for the referenced scrollview

Source

pub fn push_fling(&mut self, timestamp: Option<u64>)

Enqueue a fling (finger lift at any velocity) for the referenced scrollview

Source

pub fn push_interrupt(&mut self, timestamp: Option<u64>)

Enqueue a scroll interrupt (finger down at any time, gesture start) for the referenced scrollview

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

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.