Trait rsvg::element::ElementTrait
source · pub trait ElementTrait {
// Provided methods
fn set_attributes(&mut self, _attributes: &Attributes, _session: &Session) { ... }
fn draw(
&self,
_node: &Node<NodeData>,
_acquired_nodes: &mut AcquiredNodes<'_>,
_cascaded: &CascadedValues<'_>,
_viewport: &Viewport,
draw_ctx: &mut DrawingCtx,
_clipping: bool,
) -> Result<BoundingBox, InternalRenderingError> { ... }
fn layout(
&self,
_node: &Node<NodeData>,
_acquired_nodes: &mut AcquiredNodes<'_>,
_cascaded: &CascadedValues<'_>,
_viewport: &Viewport,
_draw_ctx: &mut DrawingCtx,
_clipping: bool,
) -> Result<Option<Layer>, InternalRenderingError> { ... }
}
Provided Methods§
sourcefn set_attributes(&mut self, _attributes: &Attributes, _session: &Session)
fn set_attributes(&mut self, _attributes: &Attributes, _session: &Session)
Sets per-element attributes.
Each element is supposed to iterate the attributes
, and parse any ones it needs.
SVG specifies that unknown attributes should be ignored, and known attributes with invalid
values should be ignored so that the attribute ends up with its “initial value”.
You can use the set_attribute
function to do that.
sourcefn draw(
&self,
_node: &Node<NodeData>,
_acquired_nodes: &mut AcquiredNodes<'_>,
_cascaded: &CascadedValues<'_>,
_viewport: &Viewport,
draw_ctx: &mut DrawingCtx,
_clipping: bool,
) -> Result<BoundingBox, InternalRenderingError>
fn draw( &self, _node: &Node<NodeData>, _acquired_nodes: &mut AcquiredNodes<'_>, _cascaded: &CascadedValues<'_>, _viewport: &Viewport, draw_ctx: &mut DrawingCtx, _clipping: bool, ) -> Result<BoundingBox, InternalRenderingError>
Draw an element.
Each element is supposed to draw itself as needed.
sourcefn layout(
&self,
_node: &Node<NodeData>,
_acquired_nodes: &mut AcquiredNodes<'_>,
_cascaded: &CascadedValues<'_>,
_viewport: &Viewport,
_draw_ctx: &mut DrawingCtx,
_clipping: bool,
) -> Result<Option<Layer>, InternalRenderingError>
fn layout( &self, _node: &Node<NodeData>, _acquired_nodes: &mut AcquiredNodes<'_>, _cascaded: &CascadedValues<'_>, _viewport: &Viewport, _draw_ctx: &mut DrawingCtx, _clipping: bool, ) -> Result<Option<Layer>, InternalRenderingError>
Create a layout object for the current element.
This resolves property values, coordinates, lengths, etc. and produces a layout item for rendering.