Struct iced_graphics::renderer::Renderer
source · [−]pub struct Renderer<B: Backend> { /* private fields */ }
Expand description
A backend-agnostic renderer that supports all the built-in widgets.
Implementations
Trait Implementations
sourceimpl<B> Renderer for Renderer<B> where
B: Backend,
impl<B> Renderer for Renderer<B> where
B: Backend,
sourcefn layout<'a, Message>(
&mut self,
element: &Element<'a, Message, Self>,
limits: &Limits
) -> Node
fn layout<'a, Message>(
&mut self,
element: &Element<'a, Message, Self>,
limits: &Limits
) -> Node
Lays out the elements of a user interface. Read more
sourcefn with_layer(&mut self, bounds: Rectangle, f: impl FnOnce(&mut Self))
fn with_layer(&mut self, bounds: Rectangle, f: impl FnOnce(&mut Self))
Draws the primitives recorded in the given closure in a new layer. Read more
sourcefn with_translation(&mut self, translation: Vector, f: impl FnOnce(&mut Self))
fn with_translation(&mut self, translation: Vector, f: impl FnOnce(&mut Self))
Applies a translation
to the primitives recorded in the given closure.
sourcefn fill_quad(&mut self, quad: Quad, background: impl Into<Background>)
fn fill_quad(&mut self, quad: Quad, background: impl Into<Background>)
Fills a Quad
with the provided Background
.
sourceimpl<B> Renderer for Renderer<B> where
B: Backend + Text,
impl<B> Renderer for Renderer<B> where
B: Backend + Text,
sourceconst CHECKMARK_ICON: char = B::CHECKMARK_ICON
const CHECKMARK_ICON: char = B::CHECKMARK_ICON
sourceconst ARROW_DOWN_ICON: char = B::ARROW_DOWN_ICON
const ARROW_DOWN_ICON: char = B::ARROW_DOWN_ICON
sourcefn default_size(&self) -> u16
fn default_size(&self) -> u16
Returns the default size of Text
.
sourcefn measure(
&self,
content: &str,
size: u16,
font: Font,
bounds: Size
) -> (f32, f32)
fn measure(
&self,
content: &str,
size: u16,
font: Font,
bounds: Size
) -> (f32, f32)
Measures the text in the given bounds and returns the minimum boundaries that can fit the contents. Read more
sourceimpl<B> Renderer for Renderer<B> where
B: Backend + Image,
impl<B> Renderer for Renderer<B> where
B: Backend + Image,
sourceimpl<Message, P, B> Widget<Message, Renderer<B>> for Canvas<Message, P> where
P: Program<Message>,
B: Backend,
Available on crate feature canvas
only.
impl<Message, P, B> Widget<Message, Renderer<B>> for Canvas<Message, P> where
P: Program<Message>,
B: Backend,
Available on crate feature
canvas
only.sourcefn on_event(
&mut self,
event: Event,
layout: Layout<'_>,
cursor_position: Point,
_renderer: &Renderer<B>,
_clipboard: &mut dyn Clipboard,
shell: &mut Shell<'_, Message>
) -> Status
fn on_event(
&mut self,
event: Event,
layout: Layout<'_>,
cursor_position: Point,
_renderer: &Renderer<B>,
_clipboard: &mut dyn Clipboard,
shell: &mut Shell<'_, Message>
) -> Status
sourcefn mouse_interaction(
&self,
layout: Layout<'_>,
cursor_position: Point,
_viewport: &Rectangle,
_renderer: &Renderer<B>
) -> Interaction
fn mouse_interaction(
&self,
layout: Layout<'_>,
cursor_position: Point,
_viewport: &Rectangle,
_renderer: &Renderer<B>
) -> Interaction
sourceimpl<'a, Message, B> Widget<Message, Renderer<B>> for QRCode<'a> where
B: Backend,
Available on crate feature qr_code
only.
impl<'a, Message, B> Widget<Message, Renderer<B>> for QRCode<'a> where
B: Backend,
Available on crate feature
qr_code
only.sourcefn draw(
&self,
renderer: &mut Renderer<B>,
_style: &Style,
layout: Layout<'_>,
_cursor_position: Point,
_viewport: &Rectangle
)
fn draw(
&self,
renderer: &mut Renderer<B>,
_style: &Style,
layout: Layout<'_>,
_cursor_position: Point,
_viewport: &Rectangle
)
Draws the Widget
using the associated Renderer
.
sourcefn on_event(
&mut self,
_event: Event,
_layout: Layout<'_>,
_cursor_position: Point,
_renderer: &Renderer,
_clipboard: &mut dyn Clipboard,
_shell: &mut Shell<'_, Message>
) -> Status
fn on_event(
&mut self,
_event: Event,
_layout: Layout<'_>,
_cursor_position: Point,
_renderer: &Renderer,
_clipboard: &mut dyn Clipboard,
_shell: &mut Shell<'_, Message>
) -> Status
sourceimpl<Message, P, B> Widget<Message, Renderer<B>> for Canvas<Message, P> where
P: Program<Message>,
B: Backend,
impl<Message, P, B> Widget<Message, Renderer<B>> for Canvas<Message, P> where
P: Program<Message>,
B: Backend,
sourcefn layout(&self, _renderer: &Renderer<B>, limits: &Limits) -> Node
fn layout(&self, _renderer: &Renderer<B>, limits: &Limits) -> Node
Returns the layout::Node
of the Widget
. Read more
sourcefn on_event(
&mut self,
tree: &mut Tree,
event: Event,
layout: Layout<'_>,
cursor_position: Point,
_renderer: &Renderer<B>,
_clipboard: &mut dyn Clipboard,
shell: &mut Shell<'_, Message>
) -> Status
fn on_event(
&mut self,
tree: &mut Tree,
event: Event,
layout: Layout<'_>,
cursor_position: Point,
_renderer: &Renderer<B>,
_clipboard: &mut dyn Clipboard,
shell: &mut Shell<'_, Message>
) -> Status
sourcefn mouse_interaction(
&self,
tree: &Tree,
layout: Layout<'_>,
cursor_position: Point,
_viewport: &Rectangle,
_renderer: &Renderer<B>
) -> Interaction
fn mouse_interaction(
&self,
tree: &Tree,
layout: Layout<'_>,
cursor_position: Point,
_viewport: &Rectangle,
_renderer: &Renderer<B>
) -> Interaction
sourceimpl<'a, Message, B> Widget<Message, Renderer<B>> for QRCode<'a> where
B: Backend,
impl<'a, Message, B> Widget<Message, Renderer<B>> for QRCode<'a> where
B: Backend,
sourcefn layout(&self, renderer: &Renderer<B>, limits: &Limits) -> Node
fn layout(&self, renderer: &Renderer<B>, limits: &Limits) -> Node
Returns the layout::Node
of the Widget
. Read more
sourcefn draw(
&self,
_tree: &Tree,
renderer: &mut Renderer<B>,
style: &Style,
layout: Layout<'_>,
cursor_position: Point,
viewport: &Rectangle
)
fn draw(
&self,
_tree: &Tree,
renderer: &mut Renderer<B>,
style: &Style,
layout: Layout<'_>,
cursor_position: Point,
viewport: &Rectangle
)
Draws the Widget
using the associated Renderer
.
sourcefn on_event(
&mut self,
_state: &mut Tree,
_event: Event,
_layout: Layout<'_>,
_cursor_position: Point,
_renderer: &Renderer,
_clipboard: &mut dyn Clipboard,
_shell: &mut Shell<'_, Message>
) -> Status
fn on_event(
&mut self,
_state: &mut Tree,
_event: Event,
_layout: Layout<'_>,
_cursor_position: Point,
_renderer: &Renderer,
_clipboard: &mut dyn Clipboard,
_shell: &mut Shell<'_, Message>
) -> Status
Auto Trait Implementations
impl<B> RefUnwindSafe for Renderer<B> where
B: RefUnwindSafe,
impl<B> Send for Renderer<B> where
B: Send,
impl<B> Sync for Renderer<B> where
B: Sync,
impl<B> Unpin for Renderer<B> where
B: Unpin,
impl<B> UnwindSafe for Renderer<B> where
B: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more