pub struct DrawingCtx {
    session: Session,
    initial_viewport: Viewport,
    dpi: Dpi,
    cr_stack: Rc<RefCell<Vec<Context>>>,
    cr: Context,
    user_language: UserLanguage,
    drawsub_stack: Vec<Node<NodeData>>,
    measuring: bool,
    testing: bool,
}

Fields§

§session: Session§initial_viewport: Viewport§dpi: Dpi§cr_stack: Rc<RefCell<Vec<Context>>>§cr: Context§user_language: UserLanguage§drawsub_stack: Vec<Node<NodeData>>§measuring: bool§testing: bool

Implementations§

Copies a DrawingCtx for temporary use on a Cairo surface.

DrawingCtx maintains state using during the drawing process, and sometimes we would like to use that same state but on a different Cairo surface and context than the ones being used on self. This function copies the self state into a new DrawingCtx, and ties the copied one to the supplied cr.

Gets the transform that will be used on the target surface, whether using an isolated stacking context or not.

This is only used in the text code, and we should probably try to remove it.

Creates a new coordinate space inside a viewport and sets a clipping rectangle.

Note that this actually changes the draw_ctx.cr’s transformation to match the new coordinate space, but the old one is not restored after the result’s Viewport is dropped. Thus, this function must be called inside with_saved_cr or draw_ctx.with_discrete_layer.

Run the drawing function with the specified opacity

Start a Cairo tag for PDF links

End a Cairo tag for PDF links

Computes and returns a surface corresponding to the given paint server.

Extracts the font options for the current state of the DrawingCtx.

You can use the font options later with create_pango_context().

Trait Implementations§

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Checks if self is actually part of its subset T (and can be converted to it).
Use with care! Same as self.to_subset but without any property checks. Always succeeds.
The inclusion map: converts self to the equivalent element of its superset.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.