Struct druid::piet::cairo::Context

pub struct Context(_);

Implementations§

§

impl Context

pub unsafe fn from_raw_none(ptr: *mut cairo_t) -> Context

pub unsafe fn from_raw_borrow(ptr: *mut cairo_t) -> Borrowed<Context>

pub unsafe fn from_raw_full(ptr: *mut cairo_t) -> Context

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

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

pub fn new(target: impl AsRef<Surface>) -> Result<Context, Error>

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

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

pub fn target(&self) -> Surface

pub fn push_group(&self)

pub fn push_group_with_content(&self, content: Content)

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

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

pub fn group_target(&self) -> Surface

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

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

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

pub fn source(&self) -> Pattern

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

pub fn set_antialias(&self, antialias: Antialias)

pub fn antialias(&self) -> Antialias

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

pub fn dash_count(&self) -> i32

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

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

pub fn dash_offset(&self) -> f64

pub fn set_fill_rule(&self, fill_rule: FillRule)

pub fn fill_rule(&self) -> FillRule

pub fn set_line_cap(&self, arg: LineCap)

pub fn line_cap(&self) -> LineCap

pub fn set_line_join(&self, arg: LineJoin)

pub fn line_join(&self) -> LineJoin

pub fn set_line_width(&self, arg: f64)

pub fn line_width(&self) -> f64

pub fn set_miter_limit(&self, arg: f64)

pub fn miter_limit(&self) -> f64

pub fn set_operator(&self, op: Operator)

pub fn operator(&self) -> Operator

pub fn set_tolerance(&self, arg: f64)

pub fn tolerance(&self) -> f64

pub fn clip(&self)

pub fn clip_preserve(&self)

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

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

pub fn reset_clip(&self)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pub fn reference_count(&self) -> u32

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

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

pub fn rotate(&self, angle: f64)

pub fn transform(&self, matrix: Matrix)

pub fn set_matrix(&self, matrix: Matrix)

pub fn matrix(&self) -> Matrix

pub fn identity_matrix(&self)

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

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

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

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

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

pub fn set_font_size(&self, size: f64)

pub fn set_font_matrix(&self, matrix: Matrix)

pub fn font_matrix(&self) -> Matrix

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

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

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

pub fn font_face(&self) -> FontFace

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

pub fn scaled_font(&self) -> ScaledFont

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

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

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

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

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

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

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

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

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

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

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

pub fn new_path(&self)

pub fn new_sub_path(&self)

pub fn close_path(&self)

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

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

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

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

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

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

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

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

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

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

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

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

Trait Implementations§

§

impl Clone for Context

§

fn clone(&self) -> Context

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for Context

§

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

Formats the value using the given formatter. Read more
§

impl Display for Context

§

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

Formats the value using the given formatter. Read more
§

impl Drop for Context

§

fn drop(&mut self)

Executes the destructor for this type. Read more
§

impl FromGlibPtrBorrow<*mut cairo_t> for Context

§

impl FromGlibPtrFull<*mut cairo_t> for Context

§

impl FromGlibPtrNone<*mut cairo_t> for Context

§

impl<'a> FromValue<'a> for &'a Context

§

type Checker = GenericValueTypeOrNoneChecker<&'a Context>

Value type checker.
§

unsafe fn from_value(value: &'a Value) -> &'a Context

Get the contained value from a Value. Read more
§

impl<'a> FromValue<'a> for Context

§

type Checker = GenericValueTypeOrNoneChecker<Context>

Value type checker.
§

unsafe fn from_value(value: &'a Value) -> Context

Get the contained value from a Value. Read more
§

impl GdkContextExt for Context

§

fn create_from_window<W>(window: &W) -> Contextwhere W: IsA<Window>,

§

unsafe fn draw_from_gl<W>( &self, window: &W, source: i32, source_type: i32, buffer_scale: i32, x: i32, y: i32, width: i32, height: i32 )where W: IsA<Window>,

§

fn clip_rectangle(&self) -> Option<Rectangle>

§

fn set_source_rgba(&self, rgba: &RGBA)

§

fn set_source_pixbuf(&self, pixbuf: &Pixbuf, x: f64, y: f64)

§

fn set_source_window<W>(&self, window: &W, x: f64, y: f64)where W: IsA<Window>,

§

fn rectangle(&self, rectangle: &Rectangle)

§

fn add_region(&self, region: &Region)

§

impl StaticType for Context

§

fn static_type() -> Type

Returns the type identifier of Self.
§

impl<'a> ToGlibPtr<'a, *mut cairo_t> for &'a Context

§

type Storage = &'a Context

§

fn to_glib_none(&self) -> Stash<'a, *mut cairo_t, &'a Context>

Transfer: none. Read more
§

fn to_glib_full(&self) -> *mut cairo_t

Transfer: full. Read more
§

fn to_glib_container(&'a self) -> Stash<'a, P, Self>

Transfer: container. Read more
§

impl ToValue for Context

§

fn to_value(&self) -> Value

Convert a value to a Value.
§

fn value_type(&self) -> Type

Returns the type identifer of self. Read more
§

impl ToValueOptional for Context

§

fn to_value_optional(s: Option<&Context>) -> Value

Convert an Option to a Value.
§

impl ValueType for Context

§

type Type = Context

Type to get the Type from. Read more
§

impl ValueTypeOptional for Context

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

§

impl<T> RoundFrom<T> for T

§

fn round_from(x: T) -> T

Performs the conversion.
§

impl<T, U> RoundInto<U> for Twhere U: RoundFrom<T>,

§

fn round_into(self) -> U

Performs the conversion.
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
§

impl<T> StaticTypeExt for Twhere T: StaticType,

§

fn ensure_type()

Ensures that the type has been registered with the type system.
§

impl<T> ToClosureReturnValue for Twhere T: ToValue,

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. 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.
§

impl<T> TryFromClosureReturnValue for Twhere T: for<'a> FromValue<'a> + StaticType + 'static,

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
§

impl<'a, T, C, E> FromValueOptional<'a> for Twhere T: FromValue<'a, Checker = C>, C: ValueTypeChecker<Error = ValueTypeMismatchOrNoneError<E>>, E: Error + Send + 'static,