Trait GraphicsContextMethods

Source
pub trait GraphicsContextMethods: GraphicsObjectMethods {
Show 54 methods // Provided methods fn create_window<W: WindowMethods>( window: Option<&W>, ) -> Option<GraphicsContextIsOwned<false>> { ... } fn create_windowdc<W: WindowDCMethods>( window_dc: &W, ) -> Option<GraphicsContextIsOwned<false>> { ... } fn create_memorydc<M: MemoryDCMethods>( memory_dc: &M, ) -> Option<GraphicsContextIsOwned<false>> { ... } fn create_enhmetafiledc( meta_file_dc: *const c_void, ) -> Option<GraphicsContextIsOwned<false>> { ... } fn create_from_unknown_dc<D: DCMethods>( dc: &D, ) -> Option<GraphicsContextIsOwned<false>> { ... } fn create_image<I: ImageMethods>( image: &I, ) -> Option<GraphicsContextIsOwned<false>> { ... } fn create_from_native( context: *mut c_void, ) -> Option<GraphicsContextIsOwned<false>> { ... } fn create_from_native_window( window: *mut c_void, ) -> Option<GraphicsContextIsOwned<false>> { ... } fn create() -> Option<GraphicsContextIsOwned<false>> { ... } fn reset_clip(&self) { ... } fn clip<R: RegionMethods>(&self, region: &R) { ... } fn get_clip_box( &self, x: *mut c_void, y: *mut c_void, w: *mut c_void, h: *mut c_void, ) { ... } fn create_matrix<A: AffineMatrix2DBaseMethods>( &self, mat: &A, ) -> GraphicsMatrix { ... } fn concat_transform<G: GraphicsMatrixMethods>(&self, matrix: &G) { ... } fn get_transform(&self) -> GraphicsMatrix { ... } fn set_transform<G: GraphicsMatrixMethods>(&self, matrix: &G) { ... } fn create_brush<B: BrushMethods>(&self, brush: &B) -> GraphicsBrush { ... } fn set_brush_brush<B: BrushMethods>(&self, brush: &B) { ... } fn set_brush_graphicsbrush<G: GraphicsBrushMethods>(&self, brush: &G) { ... } fn create_pen_pen<P: PenMethods>(&self, pen: &P) -> GraphicsPen { ... } fn create_pen_graphicspeninfo(&self, info: *const c_void) -> GraphicsPen { ... } fn set_pen_pen<P: PenMethods>(&self, pen: &P) { ... } fn set_pen_graphicspen<G: GraphicsPenMethods>(&self, pen: &G) { ... } fn create_path(&self) -> GraphicsPath { ... } fn stroke_lines_point2ddouble( &self, n: usize, begin_points: *const c_void, end_points: *const c_void, ) { ... } fn stroke_lines(&self, n: usize, points: *const c_void) { ... } fn stroke_path<G: GraphicsPathMethods>(&self, path: &G) { ... } fn create_font_font<F: FontMethods, C: ColourMethods>( &self, font: &F, col: &C, ) -> GraphicsFont { ... } fn create_font_double<C: ColourMethods>( &self, size_in_pixels: c_double, facename: &str, flags: c_int, col: &C, ) -> GraphicsFont { ... } fn set_font_font<F: FontMethods, C: ColourMethods>( &self, font: &F, colour: &C, ) { ... } fn set_font_graphicsfont<G: GraphicsFontMethods>(&self, font: &G) { ... } fn get_partial_text_extents(&self, text: &str, widths: *mut c_void) { ... } fn get_text_extent( &self, text: &str, width: *mut c_void, height: *mut c_void, descent: *mut c_void, external_leading: *mut c_void, ) { ... } fn start_doc(&self, message: &str) -> bool { ... } fn end_doc(&self) { ... } fn end_page(&self) { ... } fn end_layer(&self) { ... } fn push_state(&self) { ... } fn pop_state(&self) { ... } fn flush(&self) { ... } fn get_native_context(&self) -> *mut c_void { ... } fn get_size(&self, width: *mut c_void, height: *mut c_void) { ... } fn get_dpi(&self, dpi_x: *mut c_void, dpi_y: *mut c_void) { ... } fn get_window(&self) -> WeakRef<Window> { ... } fn should_offset(&self) -> bool { ... } fn enable_offset(&self, enable: bool) { ... } fn disable_offset(&self) { ... } fn offset_enabled(&self) -> bool { ... } fn from_dip_size<S: SizeMethods>(&self, sz: &S) -> Size { ... } fn from_dip_point<P: PointMethods>(&self, pt: &P) -> Point { ... } fn from_dip_int(&self, d: c_int) -> c_int { ... } fn to_dip_size<S: SizeMethods>(&self, sz: &S) -> Size { ... } fn to_dip_point<P: PointMethods>(&self, pt: &P) -> Point { ... } fn to_dip_int(&self, d: c_int) -> c_int { ... }
}
Expand description

This trait represents C++ wxGraphicsContext class’s methods and inheritance.

See GraphicsContextIsOwned documentation for the class usage.

Provided Methods§

Source

fn create_window<W: WindowMethods>( window: Option<&W>, ) -> Option<GraphicsContextIsOwned<false>>

Creates a wxGraphicsContext from a wxWindow.

See C++ wxGraphicsContext::Create()’s documentation.

Source

fn create_windowdc<W: WindowDCMethods>( window_dc: &W, ) -> Option<GraphicsContextIsOwned<false>>

Creates a wxGraphicsContext from a wxWindowDC.

See C++ wxGraphicsContext::Create()’s documentation.

Source

fn create_memorydc<M: MemoryDCMethods>( memory_dc: &M, ) -> Option<GraphicsContextIsOwned<false>>

Creates a wxGraphicsContext from a wxMemoryDC.

See C++ wxGraphicsContext::Create()’s documentation.

Source

fn create_enhmetafiledc( meta_file_dc: *const c_void, ) -> Option<GraphicsContextIsOwned<false>>

Creates a wxGraphicsContext from a wxEnhMetaFileDC.

See C++ wxGraphicsContext::Create()’s documentation.

Source

fn create_from_unknown_dc<D: DCMethods>( dc: &D, ) -> Option<GraphicsContextIsOwned<false>>

Creates a wxGraphicsContext from a DC of unknown specific type.

See C++ wxGraphicsContext::CreateFromUnknownDC()’s documentation.

Source

fn create_image<I: ImageMethods>( image: &I, ) -> Option<GraphicsContextIsOwned<false>>

Creates a wxGraphicsContext associated with a wxImage.

See C++ wxGraphicsContext::Create()’s documentation.

Source

fn create_from_native( context: *mut c_void, ) -> Option<GraphicsContextIsOwned<false>>

Creates a wxGraphicsContext from a native context.

See C++ wxGraphicsContext::CreateFromNative()’s documentation.

Source

fn create_from_native_window( window: *mut c_void, ) -> Option<GraphicsContextIsOwned<false>>

Creates a wxGraphicsContext from a native window.

See C++ wxGraphicsContext::CreateFromNativeWindow()’s documentation.

Source

fn create() -> Option<GraphicsContextIsOwned<false>>

Create a lightweight context that can be used only for measuring text.

See C++ wxGraphicsContext::Create()’s documentation.

Source

fn reset_clip(&self)

Resets the clipping to original shape.

See C++ wxGraphicsContext::ResetClip()’s documentation.

Source

fn clip<R: RegionMethods>(&self, region: &R)

Sets the clipping region to the intersection of the given region and the previously set clipping region.

See C++ wxGraphicsContext::Clip()’s documentation.

Source

fn get_clip_box( &self, x: *mut c_void, y: *mut c_void, w: *mut c_void, h: *mut c_void, )

Returns bounding box of the current clipping region.

See C++ wxGraphicsContext::GetClipBox()’s documentation.

Source

fn create_matrix<A: AffineMatrix2DBaseMethods>(&self, mat: &A) -> GraphicsMatrix

Creates a native affine transformation matrix from the passed generic one.

See C++ wxGraphicsContext::CreateMatrix()’s documentation.

Source

fn concat_transform<G: GraphicsMatrixMethods>(&self, matrix: &G)

Concatenates the passed in transform with the current transform of this context.

See C++ wxGraphicsContext::ConcatTransform()’s documentation.

Source

fn get_transform(&self) -> GraphicsMatrix

Gets the current transformation matrix of this context.

See C++ wxGraphicsContext::GetTransform()’s documentation.

Source

fn set_transform<G: GraphicsMatrixMethods>(&self, matrix: &G)

Sets the current transformation matrix of this context.

See C++ wxGraphicsContext::SetTransform()’s documentation.

Source

fn create_brush<B: BrushMethods>(&self, brush: &B) -> GraphicsBrush

Creates a native brush from a wxBrush.

See C++ wxGraphicsContext::CreateBrush()’s documentation.

Source

fn set_brush_brush<B: BrushMethods>(&self, brush: &B)

Sets the brush for filling paths.

See C++ wxGraphicsContext::SetBrush()’s documentation.

Source

fn set_brush_graphicsbrush<G: GraphicsBrushMethods>(&self, brush: &G)

Sets the brush for filling paths.

See C++ wxGraphicsContext::SetBrush()’s documentation.

Source

fn create_pen_pen<P: PenMethods>(&self, pen: &P) -> GraphicsPen

Creates a native pen from a wxPen.

See C++ wxGraphicsContext::CreatePen()’s documentation.

Source

fn create_pen_graphicspeninfo(&self, info: *const c_void) -> GraphicsPen

Creates a native pen from a wxGraphicsPenInfo.

See C++ wxGraphicsContext::CreatePen()’s documentation.

Source

fn set_pen_pen<P: PenMethods>(&self, pen: &P)

Sets the pen used for stroking.

See C++ wxGraphicsContext::SetPen()’s documentation.

Source

fn set_pen_graphicspen<G: GraphicsPenMethods>(&self, pen: &G)

Sets the pen used for stroking.

See C++ wxGraphicsContext::SetPen()’s documentation.

Source

fn create_path(&self) -> GraphicsPath

Creates a native graphics path which is initially empty.

See C++ wxGraphicsContext::CreatePath()’s documentation.

Source

fn stroke_lines_point2ddouble( &self, n: usize, begin_points: *const c_void, end_points: *const c_void, )

Stroke disconnected lines from begin to end points, fastest method available for this purpose.

See C++ wxGraphicsContext::StrokeLines()’s documentation.

Source

fn stroke_lines(&self, n: usize, points: *const c_void)

Stroke lines connecting all the points.

See C++ wxGraphicsContext::StrokeLines()’s documentation.

Source

fn stroke_path<G: GraphicsPathMethods>(&self, path: &G)

Strokes along a path with the current pen.

See C++ wxGraphicsContext::StrokePath()’s documentation.

Source

fn create_font_font<F: FontMethods, C: ColourMethods>( &self, font: &F, col: &C, ) -> GraphicsFont

Creates a native graphics font from a wxFont and a text colour.

See C++ wxGraphicsContext::CreateFont()’s documentation.

Source

fn create_font_double<C: ColourMethods>( &self, size_in_pixels: c_double, facename: &str, flags: c_int, col: &C, ) -> GraphicsFont

Creates a font object with the specified attributes.

See C++ wxGraphicsContext::CreateFont()’s documentation.

Source

fn set_font_font<F: FontMethods, C: ColourMethods>(&self, font: &F, colour: &C)

Sets the font for drawing text.

See C++ wxGraphicsContext::SetFont()’s documentation.

Source

fn set_font_graphicsfont<G: GraphicsFontMethods>(&self, font: &G)

Sets the font for drawing text.

See C++ wxGraphicsContext::SetFont()’s documentation.

Source

fn get_partial_text_extents(&self, text: &str, widths: *mut c_void)

Fills the widths array with the widths from the beginning of text to the corresponding character of text.

See C++ wxGraphicsContext::GetPartialTextExtents()’s documentation.

Source

fn get_text_extent( &self, text: &str, width: *mut c_void, height: *mut c_void, descent: *mut c_void, external_leading: *mut c_void, )

Gets the dimensions of the string using the currently selected font.

See C++ wxGraphicsContext::GetTextExtent()’s documentation.

Source

fn start_doc(&self, message: &str) -> bool

Begin a new document (relevant only for printing / pdf etc.) If there is a progress dialog, message will be shown.

See C++ wxGraphicsContext::StartDoc()’s documentation.

Source

fn end_doc(&self)

Done with that document (relevant only for printing / pdf etc.)

See C++ wxGraphicsContext::EndDoc()’s documentation.

Source

fn end_page(&self)

Ends the current page (relevant only for printing / pdf etc.)

See C++ wxGraphicsContext::EndPage()’s documentation.

Source

fn end_layer(&self)

Composites back the drawings into the context with the opacity given at the BeginLayer() call.

See C++ wxGraphicsContext::EndLayer()’s documentation.

Source

fn push_state(&self)

Push the current state (like transformations, clipping region and quality settings) of the context on a stack.

See C++ wxGraphicsContext::PushState()’s documentation.

Source

fn pop_state(&self)

Sets current state of the context to the state saved by a preceding call to PushState() and removes that state from the stack of saved states.

See C++ wxGraphicsContext::PopState()’s documentation.

Source

fn flush(&self)

Make sure that the current content of this context is immediately visible.

See C++ wxGraphicsContext::Flush()’s documentation.

Source

fn get_native_context(&self) -> *mut c_void

Returns the native context (CGContextRef for Core Graphics, Graphics pointer for GDIPlus and cairo_t pointer for cairo).

See C++ wxGraphicsContext::GetNativeContext()’s documentation.

Source

fn get_size(&self, width: *mut c_void, height: *mut c_void)

Returns the size of the graphics context in device coordinates.

See C++ wxGraphicsContext::GetSize()’s documentation.

Source

fn get_dpi(&self, dpi_x: *mut c_void, dpi_y: *mut c_void)

Returns the resolution of the graphics context in device points per inch.

See C++ wxGraphicsContext::GetDPI()’s documentation.

Source

fn get_window(&self) -> WeakRef<Window>

Returns the associated window if any.

See C++ wxGraphicsContext::GetWindow()’s documentation.

Source

fn should_offset(&self) -> bool

Helper to determine if a 0.5 offset should be applied for the drawing operation.

See C++ wxGraphicsContext::ShouldOffset()’s documentation.

Source

fn enable_offset(&self, enable: bool)

Indicates whether the context should try to offset for pixel boundaries.

See C++ wxGraphicsContext::EnableOffset()’s documentation.

Source

fn disable_offset(&self)

Helper to determine if a 0.5 offset should be applied for the drawing operation.

See C++ wxGraphicsContext::DisableOffset()’s documentation.

Source

fn offset_enabled(&self) -> bool

Helper to determine if a 0.5 offset should be applied for the drawing operation.

See C++ wxGraphicsContext::OffsetEnabled()’s documentation.

Source

fn from_dip_size<S: SizeMethods>(&self, sz: &S) -> Size

Convert DPI-independent pixel values to the value in pixels appropriate for the graphics context.

See C++ wxGraphicsContext::FromDIP()’s documentation.

Source

fn from_dip_point<P: PointMethods>(&self, pt: &P) -> Point

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

See C++ wxGraphicsContext::FromDIP()’s documentation.

Source

fn from_dip_int(&self, d: c_int) -> c_int

Convert DPI-independent value in pixels to the value in pixels appropriate for the graphics context.

See C++ wxGraphicsContext::FromDIP()’s documentation.

Source

fn to_dip_size<S: SizeMethods>(&self, sz: &S) -> Size

Convert pixel values of the current graphics context to DPI-independent pixel values.

See C++ wxGraphicsContext::ToDIP()’s documentation.

Source

fn to_dip_point<P: PointMethods>(&self, pt: &P) -> Point

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

See C++ wxGraphicsContext::ToDIP()’s documentation.

Source

fn to_dip_int(&self, d: c_int) -> c_int

Convert pixel values of the current graphics context to DPI-independent pixel values.

See C++ wxGraphicsContext::ToDIP()’s documentation.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§