pub struct DrawingGroup { /* private fields */ }Expand description
Represents a collection of drawings that can be operated upon as a single drawing.
Implementations§
Source§impl DrawingGroup
impl DrawingGroup
Source§impl DrawingGroup
impl DrawingGroup
Sourcepub fn opacity_property() -> &'static StyledProperty<f64>
pub fn opacity_property() -> &'static StyledProperty<f64>
Defines the Opacity property.
Sourcepub fn transform_property() -> &'static StyledProperty<Option<Ref<Transform>>>
pub fn transform_property() -> &'static StyledProperty<Option<Ref<Transform>>>
Defines the Transform property.
Sourcepub fn clip_geometry_property() -> &'static StyledProperty<Option<Ref<Geometry>>>
pub fn clip_geometry_property() -> &'static StyledProperty<Option<Ref<Geometry>>>
Defines the ClipGeometry property.
Sourcepub fn opacity_mask_property() -> &'static StyledProperty<Option<Rc<dyn IBrush>>>
pub fn opacity_mask_property() -> &'static StyledProperty<Option<Rc<dyn IBrush>>>
Defines the OpacityMask property.
Sourcepub fn effect_property() -> &'static StyledProperty<Option<Rc<dyn IEffect>>>
pub fn effect_property() -> &'static StyledProperty<Option<Rc<dyn IEffect>>>
Defines the Effect property.
Sourcepub fn children_property() -> &'static DirectProperty<DrawingGroup, DrawingCollection>
pub fn children_property() -> &'static DirectProperty<DrawingGroup, DrawingCollection>
Defines the Children property.
Source§impl DrawingGroup
impl DrawingGroup
pub fn new() -> Ref<Self>
pub fn set_opacity(&self, value: f64)
pub fn set_transform(&self, value: impl Into<Nullable<Transform>>)
Sourcepub fn clip_geometry(&self) -> Option<Ref<Geometry>>
pub fn clip_geometry(&self) -> Option<Ref<Geometry>>
The geometry the children are clipped to.
pub fn set_clip_geometry(&self, value: impl Into<Nullable<Geometry>>)
Sourcepub fn opacity_mask(&self) -> Option<Rc<dyn IBrush>>
pub fn opacity_mask(&self) -> Option<Rc<dyn IBrush>>
The opacity mask the children are drawn through.
pub fn set_opacity_mask(&self, value: Option<Rc<dyn IBrush>>)
pub fn set_effect(&self, value: Option<Rc<dyn IEffect>>)
Sourcepub fn children(&self) -> DrawingCollection
pub fn children(&self) -> DrawingCollection
The collection that contains the child drawings.
pub fn set_children(&self, value: DrawingCollection)
Sourcepub fn open(&self) -> DrawingContext<'static>
pub fn open(&self) -> DrawingContext<'static>
Opens the group for populating: what is drawn on the returned context replaces the children of the group when the context is disposed (or dropped).
Panics when no platform render interface is registered.
Methods from Deref<Target = Drawing>§
Sourcepub fn draw_core(&self, context: &mut DrawingContext<'_>)
pub fn draw_core(&self, context: &mut DrawingContext<'_>)
Draws the content to a drawing context; see Drawing::draw.
Sourcepub fn get_bounds(&self) -> Rect
pub fn get_bounds(&self) -> Rect
The bounds of the drawn content.
Sourcepub fn draw(&self, context: &mut DrawingContext<'_>)
pub fn draw(&self, context: &mut DrawingContext<'_>)
Draws this drawing to the given drawing context.
Methods from Deref<Target = FerroObject>§
Sourcepub fn dispatcher(&self) -> &Arc<Dispatcher> ⓘ
pub fn dispatcher(&self) -> &Arc<Dispatcher> ⓘ
Returns the Dispatcher that this object is associated with: the
dispatcher of the thread that owns the object.
Sourcepub fn check_access(&self) -> bool
pub fn check_access(&self) -> bool
Returns whether the calling thread is the thread that owns this object.
Sourcepub fn verify_access(&self)
pub fn verify_access(&self)
Sourcepub fn to_ref(&self) -> Ref<FerroObject>
pub fn to_ref(&self) -> Ref<FerroObject>
A strong reference to this object.
Sourcepub fn to_weak(&self) -> WeakRef<FerroObject>
pub fn to_weak(&self) -> WeakRef<FerroObject>
A weak reference to this object.
Sourcepub fn is<T: ObjectType>(&self) -> bool
pub fn is<T: ObjectType>(&self) -> bool
Whether the object is of class T or a class derived from it.
Sourcepub fn downcast_ref<T: ObjectType>(&self) -> Option<&T>
pub fn downcast_ref<T: ObjectType>(&self) -> Option<&T>
Returns the object viewed as class T if it is one.
Sourcepub fn on_property_changed(&self, change: &FerroPropertyChangedEventArgs<'_>)
pub fn on_property_changed(&self, change: &FerroPropertyChangedEventArgs<'_>)
Invokes the on_property_changed virtual member.
Sourcepub fn inheritance_parent(&self) -> Option<Ref<FerroObject>>
pub fn inheritance_parent(&self) -> Option<Ref<FerroObject>>
The parent object that inherited property values are inherited from.
Sourcepub fn set_inheritance_parent(&self, value: impl Into<Nullable<FerroObject>>)
pub fn set_inheritance_parent(&self, value: impl Into<Nullable<FerroObject>>)
Sets the parent object that inherited property values are inherited from.
Sourcepub fn clear_value<T: PropertyValue>(
&self,
property: &'static StyledProperty<T>,
)
pub fn clear_value<T: PropertyValue>( &self, property: &'static StyledProperty<T>, )
Clears a property’s local value.
Sourcepub fn get_value<T: PropertyValue>(
&self,
property: &'static StyledProperty<T>,
) -> T
pub fn get_value<T: PropertyValue>( &self, property: &'static StyledProperty<T>, ) -> T
Gets a property value.
Sourcepub fn get_base_value<T: PropertyValue>(
&self,
property: &'static StyledProperty<T>,
) -> Option<T>
pub fn get_base_value<T: PropertyValue>( &self, property: &'static StyledProperty<T>, ) -> Option<T>
Gets a property’s base value: the value excluding animated values.
Returns None if the value comes from inheritance or the default.
Sourcepub fn is_animating(&self, property: &FerroProperty) -> bool
pub fn is_animating(&self, property: &FerroProperty) -> bool
Checks whether a property is animating.
Sourcepub fn is_set(&self, property: &FerroProperty) -> bool
pub fn is_set(&self, property: &FerroProperty) -> bool
Checks whether a styled property has a value assigned to it or a binding targeting it.
Sourcepub fn set_value<T: PropertyValue>(
&self,
property: &'static StyledProperty<T>,
value: T,
)
pub fn set_value<T: PropertyValue>( &self, property: &'static StyledProperty<T>, value: T, )
Sets a property value with local value priority.
Sourcepub fn set_value_with_priority<T: PropertyValue>(
&self,
property: &'static StyledProperty<T>,
value: T,
priority: BindingPriority,
) -> Option<Rc<dyn IDisposable>>
pub fn set_value_with_priority<T: PropertyValue>( &self, property: &'static StyledProperty<T>, value: T, priority: BindingPriority, ) -> Option<Rc<dyn IDisposable>>
Sets a property value with the given priority. For priorities other than local value, disposing the returned handle removes the value.
Sourcepub fn set_current_value<T: PropertyValue>(
&self,
property: &'static StyledProperty<T>,
value: T,
)
pub fn set_current_value<T: PropertyValue>( &self, property: &'static StyledProperty<T>, value: T, )
Sets the value of a property without changing its value source.
This is used by a component that programmatically sets the value of one of its own properties without disabling an application’s declared use of the property: the effective value changes, but existing bindings and styles continue to work. The new value has the property’s current priority.
Sourcepub fn bind_binding(
&self,
property: &'static FerroProperty,
binding: &dyn BindingBase,
) -> Rc<dyn BindingExpressionBase>
pub fn bind_binding( &self, property: &'static FerroProperty, binding: &dyn BindingBase, ) -> Rc<dyn BindingExpressionBase>
Binds a property to a binding. Returns the binding expression which represents the binding instance on this object.
Sourcepub fn bind_binding_with_anchor(
&self,
property: &'static FerroProperty,
binding: &dyn BindingBase,
anchor: Option<&Ref<FerroObject>>,
) -> Rc<dyn BindingExpressionBase>
pub fn bind_binding_with_anchor( &self, property: &'static FerroProperty, binding: &dyn BindingBase, anchor: Option<&Ref<FerroObject>>, ) -> Rc<dyn BindingExpressionBase>
Binds a property to a binding.
Some bindings need context to locate their source: a data context,
named elements or resources. If this object is not an element, or is
not yet attached to the tree, anchor provides that context.
Sourcepub fn indexer(&self, binding: &IndexerDescriptor) -> IndexerBinding
pub fn indexer(&self, binding: &IndexerDescriptor) -> IndexerBinding
Gets a binding to a property of this object: the indexer taking an
IndexerDescriptor
(source[!Property] is source.indexer(&Property.bind())).
Sourcepub fn bind_indexer(
&self,
binding: &IndexerDescriptor,
value: &dyn BindingBase,
) -> Rc<dyn BindingExpressionBase>
pub fn bind_indexer( &self, binding: &IndexerDescriptor, value: &dyn BindingBase, ) -> Rc<dyn BindingExpressionBase>
Binds the property of an
IndexerDescriptor to a binding:
the setter of the indexer (target[!Property] = binding is
target.bind_indexer(&Property.bind(), &binding)).
Sourcepub fn bind<T: PropertyValue>(
&self,
property: &'static StyledProperty<T>,
source: Rc<dyn IObservable<T>>,
priority: BindingPriority,
) -> Rc<dyn IDisposable>
pub fn bind<T: PropertyValue>( &self, property: &'static StyledProperty<T>, source: Rc<dyn IObservable<T>>, priority: BindingPriority, ) -> Rc<dyn IDisposable>
Binds a property to an observable.
Sourcepub fn bind_value<T: PropertyValue>(
&self,
property: &'static StyledProperty<T>,
source: Rc<dyn IObservable<BindingValue<T>>>,
priority: BindingPriority,
) -> Rc<dyn IDisposable>
pub fn bind_value<T: PropertyValue>( &self, property: &'static StyledProperty<T>, source: Rc<dyn IObservable<BindingValue<T>>>, priority: BindingPriority, ) -> Rc<dyn IDisposable>
Binds a property to an observable of binding values.
Sourcepub fn bind_untyped<T: PropertyValue>(
&self,
property: &'static StyledProperty<T>,
source: Rc<dyn IObservable<BoxedValue>>,
priority: BindingPriority,
) -> Rc<dyn IDisposable>
pub fn bind_untyped<T: PropertyValue>( &self, property: &'static StyledProperty<T>, source: Rc<dyn IObservable<BoxedValue>>, priority: BindingPriority, ) -> Rc<dyn IDisposable>
Binds a property to an observable of untyped values.
Sourcepub fn coerce_value(&self, property: &'static FerroProperty)
pub fn coerce_value(&self, property: &'static FerroProperty)
Coerces the specified property.
Sourcepub fn get_direct_value<T: PropertyValue>(
&self,
property: &'static DirectPropertyBase<T>,
) -> T
pub fn get_direct_value<T: PropertyValue>( &self, property: &'static DirectPropertyBase<T>, ) -> T
Gets a direct property value.
Sourcepub fn set_direct_value<T: PropertyValue>(
&self,
property: &'static DirectPropertyBase<T>,
value: T,
)
pub fn set_direct_value<T: PropertyValue>( &self, property: &'static DirectPropertyBase<T>, value: T, )
Sets a direct property value.
Sourcepub fn clear_direct_value<T: PropertyValue>(
&self,
property: &'static DirectPropertyBase<T>,
)
pub fn clear_direct_value<T: PropertyValue>( &self, property: &'static DirectPropertyBase<T>, )
Resets a direct property to its unset value.
Sourcepub fn bind_direct<T: PropertyValue>(
&self,
property: &'static DirectPropertyBase<T>,
source: Rc<dyn IObservable<T>>,
) -> Rc<dyn IDisposable>
pub fn bind_direct<T: PropertyValue>( &self, property: &'static DirectPropertyBase<T>, source: Rc<dyn IObservable<T>>, ) -> Rc<dyn IDisposable>
Binds a direct property to an observable.
Sourcepub fn bind_direct_value<T: PropertyValue>(
&self,
property: &'static DirectPropertyBase<T>,
source: Rc<dyn IObservable<BindingValue<T>>>,
) -> Rc<dyn IDisposable>
pub fn bind_direct_value<T: PropertyValue>( &self, property: &'static DirectPropertyBase<T>, source: Rc<dyn IObservable<BindingValue<T>>>, ) -> Rc<dyn IDisposable>
Binds a direct property to an observable of binding values.
Sourcepub fn bind_direct_untyped<T: PropertyValue>(
&self,
property: &'static DirectPropertyBase<T>,
source: Rc<dyn IObservable<BoxedValue>>,
) -> Rc<dyn IDisposable>
pub fn bind_direct_untyped<T: PropertyValue>( &self, property: &'static DirectPropertyBase<T>, source: Rc<dyn IObservable<BoxedValue>>, ) -> Rc<dyn IDisposable>
Binds a direct property to an observable of untyped values.
Sourcepub fn set_and_raise<T: PropertyValue>(
&self,
property: &'static DirectPropertyBase<T>,
field: &RefCell<T>,
value: T,
) -> bool
pub fn set_and_raise<T: PropertyValue>( &self, property: &'static DirectPropertyBase<T>, field: &RefCell<T>, value: T, ) -> bool
Sets the backing field of a direct property, raising a change notification if the value changed. Returns true if it changed.
Sourcepub fn set_and_raise_cell<T: PropertyValue + Copy>(
&self,
property: &'static DirectPropertyBase<T>,
field: &Cell<T>,
value: T,
) -> bool
pub fn set_and_raise_cell<T: PropertyValue + Copy>( &self, property: &'static DirectPropertyBase<T>, field: &Cell<T>, value: T, ) -> bool
set_and_raise for Copy values stored in a
Cell.
Sourcepub fn get_value_untyped(&self, property: &'static FerroProperty) -> BoxedValue
pub fn get_value_untyped(&self, property: &'static FerroProperty) -> BoxedValue
Gets a property value as an untyped value.
Sourcepub fn set_value_untyped(
&self,
property: &'static FerroProperty,
value: &dyn Any,
priority: BindingPriority,
) -> Option<Rc<dyn IDisposable>>
pub fn set_value_untyped( &self, property: &'static FerroProperty, value: &dyn Any, priority: BindingPriority, ) -> Option<Rc<dyn IDisposable>>
Sets a property from an untyped value, which must hold exactly the property’s value type or the unset marker.
Sourcepub fn set_current_value_untyped(
&self,
property: &'static FerroProperty,
value: &dyn Any,
)
pub fn set_current_value_untyped( &self, property: &'static FerroProperty, value: &dyn Any, )
set_current_value with an untyped value.
Sourcepub fn clear_value_untyped(&self, property: &'static FerroProperty)
pub fn clear_value_untyped(&self, property: &'static FerroProperty)
Clears a property’s local value.
Sourcepub fn bind_property_untyped(
&self,
property: &'static FerroProperty,
source: Rc<dyn IObservable<BoxedValue>>,
priority: BindingPriority,
) -> Rc<dyn IDisposable>
pub fn bind_property_untyped( &self, property: &'static FerroProperty, source: Rc<dyn IObservable<BoxedValue>>, priority: BindingPriority, ) -> Rc<dyn IDisposable>
Binds a property to an observable of untyped values.
Sourcepub fn property_changed(
&self,
handler: impl Fn(&FerroPropertyChangedEventArgs<'_>) + 'static,
) -> Rc<dyn IDisposable>
pub fn property_changed( &self, handler: impl Fn(&FerroPropertyChangedEventArgs<'_>) + 'static, ) -> Rc<dyn IDisposable>
Subscribes to property changes on this object. Disposing the returned handle unsubscribes.
Sourcepub fn add_property_changed_handler(
&self,
handler: Rc<dyn Fn(&FerroPropertyChangedEventArgs<'_>)>,
) -> u64
pub fn add_property_changed_handler( &self, handler: Rc<dyn Fn(&FerroPropertyChangedEventArgs<'_>)>, ) -> u64
Subscribes handler to property changes on this object and returns
the token that remove_property_changed_handler
takes: property_changed for a subscriber
that keeps the object and the token itself, so that no handle is made.
Sourcepub fn remove_property_changed_handler(&self, token: u64) -> bool
pub fn remove_property_changed_handler(&self, token: u64) -> bool
Ends a subscription of add_property_changed_handler.
Sourcepub fn property_changed_subscriber_count(&self) -> usize
pub fn property_changed_subscriber_count(&self) -> usize
The number of subscribers to property changes on this object (a diagnostics member, used by tests to verify that subscriptions are released).
Sourcepub fn raise_property_changed<T: PropertyValue>(
&self,
property: &'static FerroProperty,
old_value: Option<&T>,
new_value: &T,
priority: BindingPriority,
is_effective_value: bool,
)
pub fn raise_property_changed<T: PropertyValue>( &self, property: &'static FerroProperty, old_value: Option<&T>, new_value: &T, priority: BindingPriority, is_effective_value: bool, )
Raises a property changed notification.
Sourcepub fn raise_direct_property_changed<T: PropertyValue>(
&self,
property: &'static DirectPropertyBase<T>,
old_value: &T,
new_value: &T,
)
pub fn raise_direct_property_changed<T: PropertyValue>( &self, property: &'static DirectPropertyBase<T>, old_value: &T, new_value: &T, )
Raises a property changed notification for a direct property.
Trait Implementations§
Source§impl Deref for DrawingGroup
impl Deref for DrawingGroup
Source§impl DrawingImpl for DrawingGroup
impl DrawingImpl for DrawingGroup
Source§fn draw_core(this: &Self, context: &mut DrawingContext<'_>)
fn draw_core(this: &Self, context: &mut DrawingContext<'_>)
Drawing::draw.Source§fn get_bounds(this: &Self) -> Rect
fn get_bounds(this: &Self) -> Rect
Source§impl FerroObjectImpl for DrawingGroup
impl FerroObjectImpl for DrawingGroup
Source§fn constructed(this: &Self)
fn constructed(this: &Self)
parent_constructed first.Source§fn on_property_changed_core(
this: &Self,
change: &FerroPropertyChangedEventArgs<'_>,
)
fn on_property_changed_core( this: &Self, change: &FerroPropertyChangedEventArgs<'_>, )
on_property_changed instead.Source§fn on_property_changed(this: &Self, change: &FerroPropertyChangedEventArgs<'_>)
fn on_property_changed(this: &Self, change: &FerroPropertyChangedEventArgs<'_>)
Source§fn update_data_validation(
this: &Self,
property: &'static FerroProperty,
state: BindingValueType,
error: Option<&BindingError>,
)
fn update_data_validation( this: &Self, property: &'static FerroProperty, state: BindingValueType, error: Option<&BindingError>, )
Source§impl ObjectType for DrawingGroup
impl ObjectType for DrawingGroup
Source§impl StaticType for DrawingGroup
impl StaticType for DrawingGroup
impl<T> Subclassable<T> for DrawingGroupwhere
Drawing: Subclassable<T>,
Source§impl Upcast<DrawingGroup> for DrawingGroup
impl Upcast<DrawingGroup> for DrawingGroup
fn upcast(&self) -> &DrawingGroup
Auto Trait Implementations§
impl !Freeze for DrawingGroup
impl !RefUnwindSafe for DrawingGroup
impl !Send for DrawingGroup
impl !Sync for DrawingGroup
impl !UnwindSafe for DrawingGroup
impl Unpin for DrawingGroup
impl UnsafeUnpin for DrawingGroup
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
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more