Shape
struct · ferroui-controls · v0.5.0
struct Shape
Provides a base class for shape elements, such as Ellipse, Polygon
and Rectangle.
Members
TYPEto_refcreate_defining_geometryon_geometry_changedfill_propertystretch_propertystroke_propertystroke_dash_array_propertystroke_dash_offset_propertystroke_thickness_propertystroke_line_cap_propertystroke_join_propertystroke_miter_limit_propertyconstructget_alpha_maskdefining_geometryrendered_geometryfillset_fillstretchset_stretchstrokeset_strokestroke_dash_arrayset_stroke_dash_arraystroke_dash_offsetset_stroke_dash_offsetstroke_thicknessset_stroke_thicknessstroke_line_capset_stroke_line_capstroke_joinset_stroke_joinstroke_miter_limitset_stroke_miter_limitaffects_geometryinvalidate_geometry
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<Shape>
Returns a strong reference to this object.
create_defining_geometry
fn create_defining_geometry(self: &Self) -> Option<Ref<Geometry>>
Creates the shape's defining geometry.
on_geometry_changed
fn on_geometry_changed(self: &Self)
Called when the underlying Geometry changed.
fill_property
fn fill_property() -> &'static StyledProperty<Option<Rc<dyn IBrush>>>
Defines the Fill property.
stretch_property
fn stretch_property() -> &'static StyledProperty<Stretch>
Defines the Stretch property.
stroke_property
fn stroke_property() -> &'static StyledProperty<Option<Rc<dyn IBrush>>>
Defines the Stroke property.
stroke_dash_array_property
fn stroke_dash_array_property() -> &'static StyledProperty<Option<MediaCollection<f64>>>
Defines the StrokeDashArray property.
stroke_dash_offset_property
fn stroke_dash_offset_property() -> &'static StyledProperty<f64>
Defines the StrokeDashOffset property.
stroke_thickness_property
fn stroke_thickness_property() -> &'static StyledProperty<f64>
Defines the StrokeThickness property.
stroke_line_cap_property
fn stroke_line_cap_property() -> &'static StyledProperty<PenLineCap>
Defines the StrokeLineCap property.
stroke_join_property
fn stroke_join_property() -> &'static StyledProperty<PenLineJoin>
Defines the StrokeJoin property.
stroke_miter_limit_property
fn stroke_miter_limit_property() -> &'static StyledProperty<f64>
Defines the StrokeMiterLimit property.
construct
fn construct() -> Self
Creates the class data; see ferroui_base::FerroObject::construct.
get_alpha_mask
fn get_alpha_mask(self: &Self) -> Option<Rc<CompositionBrush>>
Shape.GetAlphaMask: a composition brush that shows the alpha of the
shape (its fill and its stroke), for the Mask of a
DropShadow or
another composition effect. The same brush is returned on every call;
it follows the shape as the shape is drawn again (its geometry, stroke,
size and visibility). None when no compositor is available.
See AlphaMask for how the mask is drawn.
defining_geometry
fn defining_geometry(self: &Self) -> Option<Ref<Geometry>>
Gets a value that represents the Geometry of the shape.
rendered_geometry
fn rendered_geometry(self: &Self) -> Option<Ref<Geometry>>
Gets a value that represents the final rendered Geometry of the
shape.
fill
fn fill(self: &Self) -> Option<Rc<dyn IBrush>>
Gets the brush that specifies how the shape's interior is painted.
set_fill
fn set_fill(self: &Self, value: Option<Rc<dyn IBrush>>)
Sets the brush that specifies how the shape's interior is painted.
stretch
fn stretch(self: &Self) -> Stretch
Gets a Stretch value that describes how the shape fills its
allocated space.
set_stretch
fn set_stretch(self: &Self, value: Stretch)
Sets a Stretch value that describes how the shape fills its
allocated space.
stroke
fn stroke(self: &Self) -> Option<Rc<dyn IBrush>>
Gets the brush that specifies how the shape's outline is painted.
set_stroke
fn set_stroke(self: &Self, value: Option<Rc<dyn IBrush>>)
Sets the brush that specifies how the shape's outline is painted.
stroke_dash_array
fn stroke_dash_array(self: &Self) -> Option<MediaCollection<f64>>
Gets a collection of values that indicate the pattern of dashes and gaps that is used to outline shapes.
set_stroke_dash_array
fn set_stroke_dash_array(self: &Self, value: Option<MediaCollection<f64>>)
Sets a collection of values that indicate the pattern of dashes and gaps that is used to outline shapes.
stroke_dash_offset
fn stroke_dash_offset(self: &Self) -> f64
Gets a value that specifies the distance within the dash pattern where a dash begins.
set_stroke_dash_offset
fn set_stroke_dash_offset(self: &Self, value: f64)
Sets a value that specifies the distance within the dash pattern where a dash begins.
stroke_thickness
fn stroke_thickness(self: &Self) -> f64
Gets the width of the shape outline.
set_stroke_thickness
fn set_stroke_thickness(self: &Self, value: f64)
Sets the width of the shape outline.
stroke_line_cap
fn stroke_line_cap(self: &Self) -> PenLineCap
Gets a PenLineCap value that describes the shape at the ends of a
line.
set_stroke_line_cap
fn set_stroke_line_cap(self: &Self, value: PenLineCap)
Sets a PenLineCap value that describes the shape at the ends of a
line.
stroke_join
fn stroke_join(self: &Self) -> PenLineJoin
Gets a PenLineJoin value that specifies the type of join that is
used at the vertices of a shape.
set_stroke_join
fn set_stroke_join(self: &Self, value: PenLineJoin)
Sets a PenLineJoin value that specifies the type of join that is
used at the vertices of a shape.
stroke_miter_limit
fn stroke_miter_limit(self: &Self) -> f64
Gets the limit on the ratio of the miter length to half the
StrokeThickness of the pen.
set_stroke_miter_limit
fn set_stroke_miter_limit(self: &Self, value: f64)
Sets the limit on the ratio of the miter length to half the
StrokeThickness of the pen.
affects_geometry
fn affects_geometry<T: ObjectType + Upcast<Shape>>(properties: &[&'static FerroProperty])
Marks a property as affecting the shape's geometry.
After a call to this method in a control's class initialisation, any
change to the property on an object of class T causes
invalidate_geometry to be called on
the element.
invalidate_geometry
fn invalidate_geometry(self: &Self)
Invalidates the geometry of this shape.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeShapeImplExtControlImplExtBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyInputElementImplExtInteractiveImplExtLayoutableImplExtFerroObjectImplExtStyledElementImplExtClassDefaultsVisualImplExtErasedDestructorIntoEitherDerefUpcast<T>Upcast<Shape>StaticTypeObjectTypeSubclassable<T>StyledElementImplInteractiveImplInputElementImplControlImplShapeImplFerroObjectImplVisualImplLayoutableImpl
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.