Struct relm4::drawing::DrawContext

source ·
pub struct DrawContext { /* private fields */ }
Expand description

Context returned by DrawHandler that stores a Context along with additional data required for drawing.

Methods from Deref<Target = Context>§

source

pub fn to_raw_none(&self) -> *mut cairo_t

source

pub fn status(&self) -> Result<(), Error>

source

pub fn save(&self) -> Result<(), Error>

source

pub fn restore(&self) -> Result<(), Error>

source

pub fn target(&self) -> Surface

source

pub fn push_group(&self)

source

pub fn push_group_with_content(&self, content: Content)

source

pub fn pop_group(&self) -> Result<Pattern, Error>

source

pub fn pop_group_to_source(&self) -> Result<(), Error>

source

pub fn group_target(&self) -> Surface

source

pub fn set_source_rgb(&self, red: f64, green: f64, blue: f64)

source

pub fn set_source_rgba(&self, red: f64, green: f64, blue: f64, alpha: f64)

source

pub fn set_source(&self, source: impl AsRef<Pattern>) -> Result<(), Error>

source

pub fn source(&self) -> Pattern

source

pub fn set_source_surface( &self, surface: impl AsRef<Surface>, x: f64, y: f64 ) -> Result<(), Error>

source

pub fn set_antialias(&self, antialias: Antialias)

source

pub fn antialias(&self) -> Antialias

source

pub fn set_dash(&self, dashes: &[f64], offset: f64)

source

pub fn dash_count(&self) -> i32

source

pub fn dash(&self) -> (Vec<f64, Global>, f64)

source

pub fn dash_dashes(&self) -> Vec<f64, Global>

source

pub fn dash_offset(&self) -> f64

source

pub fn set_fill_rule(&self, fill_rule: FillRule)

source

pub fn fill_rule(&self) -> FillRule

source

pub fn set_line_cap(&self, arg: LineCap)

source

pub fn line_cap(&self) -> LineCap

source

pub fn set_line_join(&self, arg: LineJoin)

source

pub fn line_join(&self) -> LineJoin

source

pub fn set_line_width(&self, arg: f64)

source

pub fn line_width(&self) -> f64

source

pub fn set_hairline(&self, set_hairline: bool)

source

pub fn hairline(&self) -> bool

source

pub fn set_miter_limit(&self, arg: f64)

source

pub fn miter_limit(&self) -> f64

source

pub fn set_operator(&self, op: Operator)

source

pub fn operator(&self) -> Operator

source

pub fn set_tolerance(&self, arg: f64)

source

pub fn tolerance(&self) -> f64

source

pub fn clip(&self)

source

pub fn clip_preserve(&self)

source

pub fn clip_extents(&self) -> Result<(f64, f64, f64, f64), Error>

source

pub fn in_clip(&self, x: f64, y: f64) -> Result<bool, Error>

source

pub fn reset_clip(&self)

source

pub fn copy_clip_rectangle_list(&self) -> Result<RectangleList, Error>

source

pub fn fill(&self) -> Result<(), Error>

source

pub fn fill_preserve(&self) -> Result<(), Error>

source

pub fn fill_extents(&self) -> Result<(f64, f64, f64, f64), Error>

source

pub fn in_fill(&self, x: f64, y: f64) -> Result<bool, Error>

source

pub fn mask(&self, pattern: impl AsRef<Pattern>) -> Result<(), Error>

source

pub fn mask_surface( &self, surface: impl AsRef<Surface>, x: f64, y: f64 ) -> Result<(), Error>

source

pub fn paint(&self) -> Result<(), Error>

source

pub fn paint_with_alpha(&self, alpha: f64) -> Result<(), Error>

source

pub fn stroke(&self) -> Result<(), Error>

source

pub fn stroke_preserve(&self) -> Result<(), Error>

source

pub fn stroke_extents(&self) -> Result<(f64, f64, f64, f64), Error>

source

pub fn in_stroke(&self, x: f64, y: f64) -> Result<bool, Error>

source

pub fn copy_page(&self) -> Result<(), Error>

source

pub fn show_page(&self) -> Result<(), Error>

source

pub fn reference_count(&self) -> u32

source

pub fn translate(&self, tx: f64, ty: f64)

source

pub fn scale(&self, sx: f64, sy: f64)

source

pub fn rotate(&self, angle: f64)

source

pub fn transform(&self, matrix: Matrix)

source

pub fn set_matrix(&self, matrix: Matrix)

source

pub fn matrix(&self) -> Matrix

source

pub fn identity_matrix(&self)

source

pub fn user_to_device(&self, x: f64, y: f64) -> (f64, f64)

source

pub fn user_to_device_distance( &self, dx: f64, dy: f64 ) -> Result<(f64, f64), Error>

source

pub fn device_to_user(&self, x: f64, y: f64) -> Result<(f64, f64), Error>

source

pub fn device_to_user_distance( &self, dx: f64, dy: f64 ) -> Result<(f64, f64), Error>

source

pub fn select_font_face( &self, family: &str, slant: FontSlant, weight: FontWeight )

source

pub fn set_font_size(&self, size: f64)

source

pub fn set_font_matrix(&self, matrix: Matrix)

source

pub fn font_matrix(&self) -> Matrix

source

pub fn set_font_options(&self, options: &FontOptions)

source

pub fn font_options(&self) -> Result<FontOptions, Error>

source

pub fn set_font_face(&self, font_face: &FontFace)

source

pub fn font_face(&self) -> FontFace

source

pub fn set_scaled_font(&self, scaled_font: &ScaledFont)

source

pub fn scaled_font(&self) -> ScaledFont

source

pub fn show_text(&self, text: &str) -> Result<(), Error>

source

pub fn show_glyphs(&self, glyphs: &[Glyph]) -> Result<(), Error>

source

pub fn show_text_glyphs( &self, text: &str, glyphs: &[Glyph], clusters: &[TextCluster], cluster_flags: TextClusterFlags ) -> Result<(), Error>

source

pub fn font_extents(&self) -> Result<FontExtents, Error>

source

pub fn text_extents(&self, text: &str) -> Result<TextExtents, Error>

source

pub fn glyph_extents(&self, glyphs: &[Glyph]) -> Result<TextExtents, Error>

source

pub fn copy_path(&self) -> Result<Path, Error>

source

pub fn copy_path_flat(&self) -> Result<Path, Error>

source

pub fn append_path(&self, path: &Path)

source

pub fn has_current_point(&self) -> Result<bool, Error>

source

pub fn current_point(&self) -> Result<(f64, f64), Error>

source

pub fn new_path(&self)

source

pub fn new_sub_path(&self)

source

pub fn close_path(&self)

source

pub fn arc(&self, xc: f64, yc: f64, radius: f64, angle1: f64, angle2: f64)

source

pub fn arc_negative( &self, xc: f64, yc: f64, radius: f64, angle1: f64, angle2: f64 )

source

pub fn curve_to(&self, x1: f64, y1: f64, x2: f64, y2: f64, x3: f64, y3: f64)

source

pub fn line_to(&self, x: f64, y: f64)

source

pub fn move_to(&self, x: f64, y: f64)

source

pub fn rectangle(&self, x: f64, y: f64, width: f64, height: f64)

source

pub fn text_path(&self, str_: &str)

source

pub fn glyph_path(&self, glyphs: &[Glyph])

source

pub fn rel_curve_to( &self, dx1: f64, dy1: f64, dx2: f64, dy2: f64, dx3: f64, dy3: f64 )

source

pub fn rel_line_to(&self, dx: f64, dy: f64)

source

pub fn rel_move_to(&self, dx: f64, dy: f64)

source

pub fn path_extents(&self) -> Result<(f64, f64, f64, f64), Error>

source

pub fn tag_begin(&self, tag_name: &str, attributes: &str)

source

pub fn tag_end(&self, tag_name: &str)

Trait Implementations§

source§

impl Debug for DrawContext

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Deref for DrawContext

§

type Target = Context

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl Drop for DrawContext

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<C> AsyncPosition<()> for C

source§

fn position(_index: usize)

Returns the position. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · 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 Twhere U: From<T>,

const: unstable · 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<C> Position<()> for C

source§

fn position(&self, _index: usize)

Returns the position. Read more
source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
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