pub struct GenericDC { /* private fields */ }Expand description
A generic device context that can wrap any raw DC pointer.
Implementations§
Source§impl GenericDC
impl GenericDC
Sourcepub unsafe fn from_ffi_ptr(ptr: *mut wxd_DC_t) -> Self
pub unsafe fn from_ffi_ptr(ptr: *mut wxd_DC_t) -> Self
Create a GenericDC from a raw FFI pointer, taking ownership.
§Safety
The pointer must be valid and should be destroyed by calling wxd_DC_Destroy.
Sourcepub unsafe fn from_ffi_ptr_unowned(ptr: *mut wxd_DC_t) -> Self
pub unsafe fn from_ffi_ptr_unowned(ptr: *mut wxd_DC_t) -> Self
Create a GenericDC from a raw FFI pointer without taking ownership.
§Safety
The pointer must be valid for the duration of the GenericDC’s lifetime.
Trait Implementations§
Source§impl DeviceContext for GenericDC
impl DeviceContext for GenericDC
Source§fn set_background(&self, colour: Colour)
fn set_background(&self, colour: Colour)
Set the background color of the device context
Source§fn set_background_mode(&self, mode: BackgroundMode)
fn set_background_mode(&self, mode: BackgroundMode)
Set the background mode of the device context
Source§fn set_text_background(&self, colour: Colour)
fn set_text_background(&self, colour: Colour)
Set the text background color
Source§fn set_text_foreground(&self, colour: Colour)
fn set_text_foreground(&self, colour: Colour)
Set the text foreground color
Source§fn set_pen(&self, colour: Colour, width: i32, style: PenStyle)
fn set_pen(&self, colour: Colour, width: i32, style: PenStyle)
Set the pen for drawing outlines
Source§fn set_brush(&self, colour: Colour, style: BrushStyle)
fn set_brush(&self, colour: Colour, style: BrushStyle)
Set the brush for filling shapes
Source§fn draw_point(&self, x: i32, y: i32)
fn draw_point(&self, x: i32, y: i32)
Draw a point at the specified coordinates
Source§fn draw_rectangle(&self, x: i32, y: i32, width: i32, height: i32)
fn draw_rectangle(&self, x: i32, y: i32, width: i32, height: i32)
Draw a rectangle with the specified dimensions
Source§fn draw_circle(&self, x: i32, y: i32, radius: i32)
fn draw_circle(&self, x: i32, y: i32, radius: i32)
Draw a circle with the specified center and radius
Source§fn draw_ellipse(&self, x: i32, y: i32, width: i32, height: i32)
fn draw_ellipse(&self, x: i32, y: i32, width: i32, height: i32)
Draw an ellipse inside the specified rectangle
Source§fn draw_rounded_rectangle(
&self,
x: i32,
y: i32,
width: i32,
height: i32,
radius: f64,
)
fn draw_rounded_rectangle( &self, x: i32, y: i32, width: i32, height: i32, radius: f64, )
Draw a rounded rectangle with the specified dimensions and corner radius
Source§fn draw_bitmap(&self, bitmap: &Bitmap, x: i32, y: i32, transparent: bool)
fn draw_bitmap(&self, bitmap: &Bitmap, x: i32, y: i32, transparent: bool)
Draw a bitmap at the specified position
Source§fn get_text_extent(&self, text: &str) -> (i32, i32)
fn get_text_extent(&self, text: &str) -> (i32, i32)
Get the text extent (width and height) for the specified string
Source§fn set_clipping_region(&self, x: i32, y: i32, width: i32, height: i32)
fn set_clipping_region(&self, x: i32, y: i32, width: i32, height: i32)
Set a clipping region to restrict drawing operations
Source§fn destroy_clipping_region(&self)
fn destroy_clipping_region(&self)
Remove the current clipping region
Source§fn draw_polygon(
&self,
points: &[Point],
x_offset: i32,
y_offset: i32,
fill_mode: PolygonFillMode,
)
fn draw_polygon( &self, points: &[Point], x_offset: i32, y_offset: i32, fill_mode: PolygonFillMode, )
Draw a polygon using the specified points
Source§fn draw_elliptic_arc(
&self,
x: i32,
y: i32,
width: i32,
height: i32,
start_angle: f64,
end_angle: f64,
)
fn draw_elliptic_arc( &self, x: i32, y: i32, width: i32, height: i32, start_angle: f64, end_angle: f64, )
Draw an elliptic arc
Source§fn draw_lines(&self, points: &[Point], x_offset: i32, y_offset: i32)
fn draw_lines(&self, points: &[Point], x_offset: i32, y_offset: i32)
Draw multiple connected lines
Source§fn draw_arc(&self, x1: i32, y1: i32, x2: i32, y2: i32, xc: i32, yc: i32)
fn draw_arc(&self, x1: i32, y1: i32, x2: i32, y2: i32, xc: i32, yc: i32)
Draw an arc from (x1, y1) to (x2, y2) with center at (xc, yc)
Source§fn draw_spline(&self, points: &[Point])
fn draw_spline(&self, points: &[Point])
Draw a smooth spline through the given points
Source§fn draw_rotated_text(&self, text: &str, x: i32, y: i32, angle: f64)
fn draw_rotated_text(&self, text: &str, x: i32, y: i32, angle: f64)
Draw rotated text at the specified position
Source§fn draw_label(
&self,
text: &str,
rect: Rect,
alignment: TextAlignment,
index_accel: i32,
)
fn draw_label( &self, text: &str, rect: Rect, alignment: TextAlignment, index_accel: i32, )
Draw text with alignment within a rectangle
Source§fn blit(&self, source: &dyn DeviceContext, config: BlitConfig) -> bool
fn blit(&self, source: &dyn DeviceContext, config: BlitConfig) -> bool
Copy a portion of one DC to another using configuration struct
Source§fn stretch_blit(
&self,
source: &dyn DeviceContext,
config: StretchBlitConfig,
) -> bool
fn stretch_blit( &self, source: &dyn DeviceContext, config: StretchBlitConfig, ) -> bool
Copy and stretch a portion of one DC to another using configuration struct
Source§fn set_clipping_region_from_points(&self, points: &[Point])
fn set_clipping_region_from_points(&self, points: &[Point])
Set clipping region from a set of points
Source§fn get_clipping_box(&self) -> Rect
fn get_clipping_box(&self) -> Rect
Get the clipping box coordinates
Source§fn set_device_origin(&self, x: i32, y: i32)
fn set_device_origin(&self, x: i32, y: i32)
Set the device origin
Source§fn set_logical_origin(&self, x: i32, y: i32)
fn set_logical_origin(&self, x: i32, y: i32)
Set the logical origin
Source§fn set_user_scale(&self, x_scale: f64, y_scale: f64)
fn set_user_scale(&self, x_scale: f64, y_scale: f64)
Set the user scale factors
Source§fn set_logical_scale(&self, x_scale: f64, y_scale: f64)
fn set_logical_scale(&self, x_scale: f64, y_scale: f64)
Set the logical scale factors
Source§fn set_map_mode(&self, mode: MapMode)
fn set_map_mode(&self, mode: MapMode)
Set the mapping mode
Source§fn get_device_origin(&self) -> Point
fn get_device_origin(&self) -> Point
Get the device origin
Source§fn get_logical_origin(&self) -> Point
fn get_logical_origin(&self) -> Point
Get the logical origin
Source§fn get_user_scale(&self) -> (f64, f64)
fn get_user_scale(&self) -> (f64, f64)
Get the user scale factors
Source§fn get_logical_scale(&self) -> (f64, f64)
fn get_logical_scale(&self) -> (f64, f64)
Get the logical scale factors
Source§fn get_map_mode(&self) -> MapMode
fn get_map_mode(&self) -> MapMode
Get the current mapping mode
Source§fn device_to_logical_x(&self, x: i32) -> i32
fn device_to_logical_x(&self, x: i32) -> i32
Convert device coordinates to logical coordinates (X)
Source§fn device_to_logical_y(&self, y: i32) -> i32
fn device_to_logical_y(&self, y: i32) -> i32
Convert device coordinates to logical coordinates (Y)
Source§fn logical_to_device_x(&self, x: i32) -> i32
fn logical_to_device_x(&self, x: i32) -> i32
Convert logical coordinates to device coordinates (X)
Source§fn logical_to_device_y(&self, y: i32) -> i32
fn logical_to_device_y(&self, y: i32) -> i32
Convert logical coordinates to device coordinates (Y)
Source§fn get_size_mm(&self) -> (i32, i32)
fn get_size_mm(&self) -> (i32, i32)
Get the size in millimeters
Source§fn get_full_text_extent(
&self,
text: &str,
font: Option<&Font>,
) -> (i32, i32, i32, i32)
fn get_full_text_extent( &self, text: &str, font: Option<&Font>, ) -> (i32, i32, i32, i32)
Get full text extent including descent and external leading
Source§fn get_multi_line_text_extent(
&self,
text: &str,
font: Option<&Font>,
) -> (i32, i32, i32)
fn get_multi_line_text_extent( &self, text: &str, font: Option<&Font>, ) -> (i32, i32, i32)
Get text extent for multi-line text
Source§fn get_char_height(&self) -> i32
fn get_char_height(&self) -> i32
Get the character height for the current font
Source§fn get_char_width(&self) -> i32
fn get_char_width(&self) -> i32
Get the character width for the current font
Source§fn get_background(&self) -> Colour
fn get_background(&self) -> Colour
Get the current background color
Source§fn get_background_mode(&self) -> BackgroundMode
fn get_background_mode(&self) -> BackgroundMode
Get the current background mode
Source§fn get_text_background(&self) -> Colour
fn get_text_background(&self) -> Colour
Get the current text background color
Source§fn get_text_foreground(&self) -> Colour
fn get_text_foreground(&self) -> Colour
Get the current text foreground color
Source§fn get_content_scale_factor(&self) -> f64
fn get_content_scale_factor(&self) -> f64
Get the content scale factor (for high-DPI displays)
Source§fn gradient_fill_linear(
&self,
rect: Rect,
initial_colour: Colour,
dest_colour: Colour,
direction: GradientDirection,
)
fn gradient_fill_linear( &self, rect: Rect, initial_colour: Colour, dest_colour: Colour, direction: GradientDirection, )
Fill a rectangle with a linear gradient
Source§fn gradient_fill_concentric(
&self,
rect: Rect,
initial_colour: Colour,
dest_colour: Colour,
circle_center: Point,
)
fn gradient_fill_concentric( &self, rect: Rect, initial_colour: Colour, dest_colour: Colour, circle_center: Point, )
Fill a rectangle with a concentric gradient
Source§fn flood_fill(
&self,
x: i32,
y: i32,
colour: Colour,
style: FloodFillMode,
) -> bool
fn flood_fill( &self, x: i32, y: i32, colour: Colour, style: FloodFillMode, ) -> bool
Flood fill starting from a point
Source§fn set_logical_function(&self, function: LogicalFunction)
fn set_logical_function(&self, function: LogicalFunction)
Set the logical function for drawing operations
Source§fn get_logical_function(&self) -> LogicalFunction
fn get_logical_function(&self) -> LogicalFunction
Get the current logical function
Auto Trait Implementations§
impl !Send for GenericDC
impl !Sync for GenericDC
impl Freeze for GenericDC
impl RefUnwindSafe for GenericDC
impl Unpin for GenericDC
impl UnsafeUnpin for GenericDC
impl UnwindSafe for GenericDC
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more