Skip to main content

Flow

Struct Flow 

Source
pub struct Flow<'a> {
    pub document: &'a Document,
    pub pictures: &'a mut Pictures,
    pub zoom: f32,
    pub palette: Palette,
    pub scroll_to_heading: Option<usize>,
    pub scroll_to_place: Option<String>,
    pub followed: Option<String>,
    pub page: Option<&'a mut PageEditor>,
    pub find: Option<Highlights<'a>>,
    pub selectable: bool,
    /* private fields */
}
Expand description

The state a run of blocks is drawn with.

Fields§

§document: &'a Document

The document, for its styles and its pictures.

§pictures: &'a mut Pictures

Pictures decoded so far.

§zoom: f32

Screen points per ODF point.

§palette: Palette

The colours to draw in where the document names none.

§scroll_to_heading: Option<usize>

The heading, counted from zero in document order, to bring into view.

Set by a panel that lists a document’s headings. It is answered while the body is drawn, because the only moment a heading’s position is known is the moment it is laid out.

§scroll_to_place: Option<String>

A place in the document to bring into view: a bookmark’s name, or a heading’s text written Name|outline. Answered while the body is drawn, for the same reason scroll_to_heading is.

§followed: Option<String>

A place in the document that a link just followed asked for, for the view to set scroll_to_place to on the next frame.

§page: Option<&'a mut PageEditor>

The page editor, which puts a caret in every paragraph under the root and paints them. Outside edit mode there is none.

§find: Option<Highlights<'a>>

The matches of a search, drawn behind the text they are in.

§selectable: bool

Whether text in the page can be dragged over to select it. Off on a slide in edit mode, where a drag moves the shape instead.

Implementations§

Source§

impl<'a> Flow<'a>

Source

pub fn new( document: &'a Document, pictures: &'a mut Pictures, zoom: f32, ) -> Self

A flow over a document, drawing at a zoom.

Source

pub fn start_at(&mut self, prefix: Vec<usize>)

Name where the root this flow draws sits under something larger, so that every path it reports and matches is from that larger root: a slide’s label is drawn from the shape and edited from the page.

Source§

impl Flow<'_>

Source

pub fn blocks(&mut self, ui: &mut Ui, parent: &Element, width: f32)

Draw every block under an element, in order.

width is the space available in screen points, and is what a paragraph wraps to.

Source

pub fn frame(&mut self, ui: &mut Ui, frame: &Element, width: f32)

A frame: a box with a picture, a text box or an object in it.

Public because a slide reaches it directly. Everywhere else a frame is found among a parent’s children by Self::blocks, but a shape on a slide is the frame, and asking blocks to draw it would look inside it for blocks and find a draw:image, which is not one.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Flow<'a>

§

impl<'a> !Send for Flow<'a>

§

impl<'a> !Sync for Flow<'a>

§

impl<'a> !UnwindSafe for Flow<'a>

§

impl<'a> Freeze for Flow<'a>

§

impl<'a> Unpin for Flow<'a>

§

impl<'a> UnsafeUnpin for Flow<'a>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more