Brush
struct · ferroui-base · v0.5.0
struct Brush
Describes how an area is painted. Abstract base class of the mutable brushes.
Members
TYPEto_refon_referenced_from_compositoron_unreferenced_from_compositorprepare_serializationopacity_propertytransform_propertytransform_origin_propertyrelative_transform_propertyconstructopacityset_opacitytransformset_transformtransform_originset_transform_originrelative_transformset_relative_transformparseinvalidated
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<Brush>
Returns a strong reference to this object.
on_referenced_from_compositor
fn on_referenced_from_compositor(self: &Self, c: &Rc<Compositor>)
Called when the brush got its counterpart on a compositor.
on_unreferenced_from_compositor
fn on_unreferenced_from_compositor(self: &Self, c: &Rc<Compositor>)
Called when the brush lost its counterpart on a compositor.
prepare_serialization
fn prepare_serialization(self: &Self, c: &Rc<Compositor>)
Creates the server objects the state of the brush refers to,
before the state is written for its counterpart on a compositor
(see ICompositorSerializable::prepare_serialization).
opacity_property
fn opacity_property() -> &'static StyledProperty<f64>
transform_property
fn transform_property() -> &'static StyledProperty<Option<Rc<dyn ITransform>>>
transform_origin_property
fn transform_origin_property() -> &'static StyledProperty<RelativePoint>
relative_transform_property
fn relative_transform_property() -> &'static StyledProperty<Option<Rc<dyn ITransform>>>
construct
fn construct() -> Self
Creates the class data; see FerroObject::construct.
opacity
fn opacity(self: &Self) -> f64
The opacity of the brush.
set_opacity
fn set_opacity(self: &Self, value: f64)
transform
fn transform(self: &Self) -> Option<Rc<dyn ITransform>>
The transform of the brush.
set_transform
fn set_transform(self: &Self, value: Option<Rc<dyn ITransform>>)
transform_origin
fn transform_origin(self: &Self) -> RelativePoint
The origin of the brush transform.
set_transform_origin
fn set_transform_origin(self: &Self, value: RelativePoint)
relative_transform
fn relative_transform(self: &Self) -> Option<Rc<dyn ITransform>>
The transform of the brush, relative to the bounds of the painted area.
set_relative_transform
fn set_relative_transform(self: &Self, value: Option<Rc<dyn ITransform>>)
parse
fn parse(s: &str) -> Result<Rc<dyn IBrush>, FormatError>
Parses a brush string: a known color name or any color format
accepted by Color::parse.
invalidated
fn invalidated(self: &Self, handler: impl Fn() -> () + 'static) -> Subscription
Subscribes to invalidation of the brush: raised whenever a change
requires the brush to be redrawn. Dropping the returned guard removes
the handler; Subscription::detach keeps it for the life of the
brush.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBrushImplExtFerroObjectImplExtClassDefaultsBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyErasedDestructorIntoEitherDerefUpcast<T>Upcast<Brush>StaticTypeObjectTypeSubclassable<T>FerroObjectImplBrushImplICompositionRenderResourceIAffectsRender
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.