pub struct PaintCtx { /* private fields */ }Implementations§
Source§impl PaintCtx
impl PaintCtx
pub const fn window_id(&self) -> WindowId
pub const fn widget_id(&self) -> WidgetId
pub const fn focused_widget_id(&self) -> Option<WidgetId>
pub fn is_focused(&self) -> bool
pub const fn bounds(&self) -> Rect
pub const fn dpi(&self) -> DpiInfo
pub fn measure_text( &self, text: impl Into<String>, style: TextStyle, ) -> Result<TextMeasurement>
pub fn shape_text( &self, text: impl Into<String>, box_size: Size, style: TextStyle, ) -> Result<TextLayout>
pub fn layout_text_document( &self, request: TextLayoutRequest, ) -> Result<TextLayout>
pub fn clear(&mut self, color: Color)
pub fn fill(&mut self, path: impl Into<Path>, brush: impl Into<Brush>)
pub fn fill_rect(&mut self, rect: Rect, brush: impl Into<Brush>)
pub fn fill_bounds(&mut self, brush: impl Into<Brush>)
pub fn stroke( &mut self, path: impl Into<Path>, brush: impl Into<Brush>, stroke: StrokeStyle, )
pub fn stroke_rect( &mut self, rect: Rect, brush: impl Into<Brush>, stroke: StrokeStyle, )
pub fn stroke_bounds(&mut self, brush: impl Into<Brush>, stroke: StrokeStyle)
pub fn draw_text( &mut self, rect: Rect, text: impl Into<String>, style: TextStyle, )
pub fn draw_text_layout(&mut self, origin: Point, layout: &TextLayout)
pub fn draw_text_layout_with_color( &mut self, origin: Point, layout: &TextLayout, color: Color, )
pub fn draw_persistent_text_layout( &mut self, origin: Point, layout: &PersistentTextLayout, )
pub fn draw_persistent_text_layout_with_color( &mut self, origin: Point, layout: &PersistentTextLayout, color: Color, )
pub fn draw_persistent_text_layout_window( &mut self, origin: Point, layout: &PersistentTextLayout, line_range: Range<usize>, )
pub fn draw_persistent_text_layout_window_with_color( &mut self, origin: Point, layout: &PersistentTextLayout, line_range: Range<usize>, color: Color, )
pub fn label(&mut self, rect: Rect, text: impl Into<String>, color: Color)
pub fn push_text_render_policy(&mut self, policy: TextRenderPolicy)
pub fn pop_text_render_policy(&mut self)
pub fn draw_image(&mut self, rect: Rect, image: ImageHandle)
pub fn image_registered(&self, image: ImageHandle) -> bool
pub fn draw_image_source(&mut self, rect: Rect, source: ImageSource)
pub fn draw_image_quad(&mut self, points: [Point; 4], image: ImageHandle)
pub fn draw_image_quad_source( &mut self, points: [Point; 4], source: ImageSource, )
pub fn widget_image_handle(&self, slot: u64) -> ImageHandle
pub fn register_image(&mut self, handle: ImageHandle, image: RegisteredImage)
Sourcepub fn register_external_image(
&mut self,
handle: ImageHandle,
image: RegisteredExternalImage,
)
pub fn register_external_image( &mut self, handle: ImageHandle, image: RegisteredExternalImage, )
Register renderer-neutral metadata for an externally owned image.
The active renderer must have a matching backend resource registered
for handle. The external resource remains app-owned; this only makes
its dimensions available to layout and scene construction for the
current frame.
pub fn draw_shader_rect(&mut self, rect: Rect, shader: WidgetShader)
Sourcepub fn fill_rrect(
&mut self,
rect: Rect,
radii: [f32; 4],
brush: impl Into<Brush>,
)
pub fn fill_rrect( &mut self, rect: Rect, radii: [f32; 4], brush: impl Into<Brush>, )
Fill a rounded rectangle (per-corner radii [tl, tr, br, bl]) with a brush.
Sourcepub fn fill_rrect_bordered(
&mut self,
rect: Rect,
radii: [f32; 4],
brush: impl Into<Brush>,
border: Border,
)
pub fn fill_rrect_bordered( &mut self, rect: Rect, radii: [f32; 4], brush: impl Into<Brush>, border: Border, )
Fill a rounded rectangle with a brush and stroke an inset border.
Sourcepub fn draw_shadow(&mut self, rect: Rect, radii: [f32; 4], shadow: ShadowParams)
pub fn draw_shadow(&mut self, rect: Rect, radii: [f32; 4], shadow: ShadowParams)
Paint just a soft drop shadow for a rounded rectangle (no fill).
Sourcepub fn fill_rrect_with_shadow(
&mut self,
rect: Rect,
radii: [f32; 4],
brush: impl Into<Brush>,
shadow: ShadowParams,
)
pub fn fill_rrect_with_shadow( &mut self, rect: Rect, radii: [f32; 4], brush: impl Into<Brush>, shadow: ShadowParams, )
Fill a rounded rectangle with a brush behind a soft drop shadow.
pub fn push_clip(&mut self, path: impl Into<Path>)
pub fn push_clip_rect(&mut self, rect: Rect)
pub fn pop_clip(&mut self)
pub fn push_transform(&mut self, transform: Transform)
pub fn translate(&mut self, delta: Vector)
pub fn pop_transform(&mut self)
pub fn push(&mut self, command: SceneCommand)
pub fn scene(&self) -> &Scene
pub fn scene_mut(&mut self) -> &mut Scene
pub fn request(&mut self, request: InvalidationRequest)
pub fn request_paint(&mut self)
pub fn request_paint_rect(&mut self, rect: Rect)
pub fn invalidations(&self) -> &[InvalidationRequest]
pub fn set_ime_composition_rect(&mut self, rect: Rect)
pub fn clear_ime_composition_rect(&mut self)
pub const fn ime_composition_rect(&self) -> Option<Rect>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for PaintCtx
impl !UnwindSafe for PaintCtx
impl Freeze for PaintCtx
impl Send for PaintCtx
impl Sync for PaintCtx
impl Unpin for PaintCtx
impl UnsafeUnpin for PaintCtx
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