[][src]Struct libscroll::Scrollview

pub struct Scrollview { /* fields omitted */ }

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

Methods

impl Scrollview[src]

pub fn new() -> Scrollview[src]

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

pub fn del(_: Scrollview)[src]

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

pub fn set_geometry(
    &mut self,
    content_height: u64,
    content_width: u64,
    viewport_height: u64,
    viewport_width: u64
)
[src]

Set the geometry for the given scrollview

Can be used both on scrollview initialization and on scrollview resize

pub fn animating(&self) -> bool[src]

Add an event to the queue to be processed for the next call to step_frame() NOTE: doesn't simplify usage much and hurts ffi interop, so currently exposing the individual push_... functions instead (impl complexity is similar/same between both methods) True if scrollview should continue to be polled even in absence of events (fling or other animation in progress)

pub fn step_frame(&mut self, timestamp: Option<u64>)[src]

Advances scrollview state by a frame, Serves to step through animations one frame at a time

After any event, continue to call this on every page-flip (new frame) until animating() returns false

pub fn set_avg_frametime(&mut self, milliseconds: f64)[src]

Should be called at scrollview initialization time. Will internally flush any active events or animations, so should only be used when scrollview is inactive or when absolutely necessary (monitor refresh rate changes)

Used for position prediction (better pan tracking)

pub fn set_next_frame_predict(&mut self, milliseconds: f64)[src]

Indicate how long there is until the next frame will be rendered to the screen.

Used for position prediction (better pan tracking)

pub fn get_position_absolute(&self) -> AxisVector<f64>[src]

Get the position of the content's top-left corner relative to the top-left corner of the viewport

NOTE: either axis may be negative. This indicates an overscroll is occurring. Recommended way of handling this is to checkerboard that area visually and draw true to the provided geometry. This matches platform behavior for OSX and Windows, as well as some Linux programs, and is often called the "rubber band effect"

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

Enqueue a pan event for the referenced scrollview

pub fn push_fling(&mut self, _timestamp: Option<u64>)[src]

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

pub fn push_interrupt(&mut self, _timestamp: Option<u64>)[src]

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

pub fn set_source(&mut self, source: Source)[src]

Set what device type is going to be providing any events that follow until the next source is declared

Trait Implementations

impl Default for Scrollview[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.