pub struct CompositionBrush { /* private fields */ }Expand description
A brush of the composition API.
Implementations§
Source§impl CompositionBrush
impl CompositionBrush
Sourcepub fn brush_props(&self) -> &CompositionBrushProps
pub fn brush_props(&self) -> &CompositionBrushProps
The generated properties of CompositionBrush.
pub fn compositor(&self) -> &Rc<Compositor>
Sourcepub fn object(&self) -> &CompositionObject
pub fn object(&self) -> &CompositionObject
The embedded CompositionObject.
Sourcepub fn server(&self) -> ServerObjectId
pub fn server(&self) -> ServerObjectId
The id of the server-side brush.
pub fn is_disposed(&self) -> bool
Sourcepub fn to_rc(&self) -> Rc<CompositionBrush>
pub fn to_rc(&self) -> Rc<CompositionBrush>
The handle of the brush, from a reference to it (an IBrush seen as
a CompositionBrush through IBrush::as_composition_brush).
Sourcepub fn implicit_animations(&self) -> Option<Rc<ImplicitAnimationCollection>>
pub fn implicit_animations(&self) -> Option<Rc<ImplicitAnimationCollection>>
The collection of implicit animations attached to this object.
pub fn set_implicit_animations( &self, value: Option<Rc<ImplicitAnimationCollection>>, )
pub fn opacity(&self) -> f64
pub fn set_opacity(&self, value: f64)
pub fn transform_origin(&self) -> RelativePoint
pub fn set_transform_origin(&self, value: RelativePoint)
pub fn transform(&self) -> Option<Rc<dyn ITransform>>
Sourcepub fn set_transform(&self, value: Option<Rc<dyn ITransform>>)
pub fn set_transform(&self, value: Option<Rc<dyn ITransform>>)
Sets the transform. What the server receives is the form a
transform takes on a compositor (GetServer): an immutable
transform as it is, a mutable one as a copy of its current value.
pub fn relative_transform(&self) -> Option<Rc<dyn ITransform>>
Sourcepub fn set_relative_transform(&self, value: Option<Rc<dyn ITransform>>)
pub fn set_relative_transform(&self, value: Option<Rc<dyn ITransform>>)
Sets the relative transform; see set_transform.
Trait Implementations§
Source§impl AsCompositionObject for CompositionBrush
impl AsCompositionObject for CompositionBrush
Source§fn as_composition_object(&self) -> &CompositionObject
fn as_composition_object(&self) -> &CompositionObject
The embedded
CompositionObject.Source§fn composition_type_name(&self) -> &'static str
fn composition_type_name(&self) -> &'static str
The name of the class of the object, for messages.
Source§fn as_property_set(self: Rc<Self>) -> Option<Rc<CompositionPropertySet>>
fn as_property_set(self: Rc<Self>) -> Option<Rc<CompositionPropertySet>>
The object as a property set, if it is one (the
is CompositionPropertySet test of upstream).Source§impl CompositionBrushHooks for CompositionBrush
InitializeDefaultsExtra activates the server object: done when the
server object is created (see the constructors of the server brushes).
impl CompositionBrushHooks for CompositionBrush
InitializeDefaultsExtra activates the server object: done when the
server object is created (see the constructors of the server brushes).
fn initialize_defaults_extra(&self)
fn validate_opacity_change(&self, _old_value: f64, _new_value: f64)
fn on_opacity_changed(&self)
fn on_opacity_changing(&self)
fn validate_transform_origin_change( &self, _old_value: RelativePoint, _new_value: RelativePoint, )
fn on_transform_origin_changed(&self)
fn on_transform_origin_changing(&self)
fn validate_transform_change( &self, _old_value: &Option<BatchResource<dyn ITransform>>, _new_value: &Option<BatchResource<dyn ITransform>>, )
fn on_transform_changed(&self)
fn on_transform_changing(&self)
fn validate_relative_transform_change( &self, _old_value: &Option<BatchResource<dyn ITransform>>, _new_value: &Option<BatchResource<dyn ITransform>>, )
fn on_relative_transform_changed(&self)
fn on_relative_transform_changing(&self)
Source§impl CompositionConicGradientBrushHooks for CompositionBrush
impl CompositionConicGradientBrushHooks for CompositionBrush
Source§fn base_serialize_changes_core(&self, writer: &mut BatchStreamWriter<'_>)
fn base_serialize_changes_core(&self, writer: &mut BatchStreamWriter<'_>)
base.SerializeChangesCore(writer): serializes the changes of the
hand-written base class CompositionGradientBrush.fn initialize_defaults_extra(&self)
fn validate_angle_change(&self, _old_value: f64, _new_value: f64)
fn on_angle_changed(&self)
fn on_angle_changing(&self)
fn validate_center_change( &self, _old_value: RelativePoint, _new_value: RelativePoint, )
fn on_center_changed(&self)
fn on_center_changing(&self)
Source§impl CompositionLinearGradientBrushHooks for CompositionBrush
impl CompositionLinearGradientBrushHooks for CompositionBrush
Source§fn base_serialize_changes_core(&self, writer: &mut BatchStreamWriter<'_>)
fn base_serialize_changes_core(&self, writer: &mut BatchStreamWriter<'_>)
base.SerializeChangesCore(writer): serializes the changes of the
hand-written base class CompositionGradientBrush.fn initialize_defaults_extra(&self)
fn validate_start_point_change( &self, _old_value: RelativePoint, _new_value: RelativePoint, )
fn on_start_point_changed(&self)
fn on_start_point_changing(&self)
fn validate_end_point_change( &self, _old_value: RelativePoint, _new_value: RelativePoint, )
fn on_end_point_changed(&self)
fn on_end_point_changing(&self)
Source§impl CompositionRadialGradientBrushHooks for CompositionBrush
impl CompositionRadialGradientBrushHooks for CompositionBrush
Source§fn base_serialize_changes_core(&self, writer: &mut BatchStreamWriter<'_>)
fn base_serialize_changes_core(&self, writer: &mut BatchStreamWriter<'_>)
base.SerializeChangesCore(writer): serializes the changes of the
hand-written base class CompositionGradientBrush.fn initialize_defaults_extra(&self)
fn validate_center_change( &self, _old_value: RelativePoint, _new_value: RelativePoint, )
fn on_center_changed(&self)
fn on_center_changing(&self)
fn validate_gradient_origin_change( &self, _old_value: RelativePoint, _new_value: RelativePoint, )
fn on_gradient_origin_changed(&self)
fn on_gradient_origin_changing(&self)
fn validate_radius_x_change( &self, _old_value: RelativeScalar, _new_value: RelativeScalar, )
fn on_radius_x_changed(&self)
fn on_radius_x_changing(&self)
fn validate_radius_y_change( &self, _old_value: RelativeScalar, _new_value: RelativeScalar, )
fn on_radius_y_changed(&self)
fn on_radius_y_changing(&self)
Source§impl CompositionSolidColorBrushHooks for CompositionBrush
impl CompositionSolidColorBrushHooks for CompositionBrush
fn initialize_defaults_extra(&self)
fn validate_color_change(&self, _old_value: Color, _new_value: Color)
fn on_color_changed(&self)
fn on_color_changing(&self)
Source§impl IBrush for CompositionBrush
impl IBrush for CompositionBrush
Source§fn transform_origin(&self) -> RelativePoint
fn transform_origin(&self) -> RelativePoint
The origin of the brush
transform.Source§fn relative_transform(&self) -> Option<Rc<dyn ITransform>>
fn relative_transform(&self) -> Option<Rc<dyn ITransform>>
The transform of the brush, relative to the bounds of the painted
area.
Source§fn as_any(&self) -> &dyn Any
fn as_any(&self) -> &dyn Any
The implementing value, for downcasts to immutable brush types. For
mutable brushes use
as_object.Source§fn as_solid_color_brush(&self) -> Option<&dyn ISolidColorBrush>
fn as_solid_color_brush(&self) -> Option<&dyn ISolidColorBrush>
The brush viewed as
ISolidColorBrush, when it is one.Source§fn as_gradient_brush(&self) -> Option<&dyn IGradientBrush>
fn as_gradient_brush(&self) -> Option<&dyn IGradientBrush>
The brush viewed as
IGradientBrush, when it is one.Source§fn as_linear_gradient_brush(&self) -> Option<&dyn ILinearGradientBrush>
fn as_linear_gradient_brush(&self) -> Option<&dyn ILinearGradientBrush>
The brush viewed as
ILinearGradientBrush, when it is one.Source§fn as_radial_gradient_brush(&self) -> Option<&dyn IRadialGradientBrush>
fn as_radial_gradient_brush(&self) -> Option<&dyn IRadialGradientBrush>
The brush viewed as
IRadialGradientBrush, when it is one.Source§fn as_conic_gradient_brush(&self) -> Option<&dyn IConicGradientBrush>
fn as_conic_gradient_brush(&self) -> Option<&dyn IConicGradientBrush>
The brush viewed as
IConicGradientBrush, when it is one.Source§fn as_composition_brush(&self) -> Option<&CompositionBrush>
fn as_composition_brush(&self) -> Option<&CompositionBrush>
The brush as a composition brush, when it is one (the
is CompositionBrush test of upstream).Source§fn as_object(&self) -> Option<&FerroObject>
fn as_object(&self) -> Option<&FerroObject>
The object behind the brush when it is a mutable
Brush.Source§fn as_tile_brush(&self) -> Option<&dyn ITileBrush>
fn as_tile_brush(&self) -> Option<&dyn ITileBrush>
The brush viewed as
ITileBrush, when it is one.Source§fn as_image_brush(&self) -> Option<&dyn IImageBrush>
fn as_image_brush(&self) -> Option<&dyn IImageBrush>
The brush viewed as
IImageBrush, when it is one.Source§fn as_scene_brush(&self) -> Option<&dyn ISceneBrush>
fn as_scene_brush(&self) -> Option<&dyn ISceneBrush>
The brush viewed as
ISceneBrush, when it is one.Source§fn as_mutable_brush(&self) -> Option<&dyn IMutableBrush>
fn as_mutable_brush(&self) -> Option<&dyn IMutableBrush>
The brush viewed as
IMutableBrush, when it is one.Source§fn as_immutable_brush(&self) -> Option<&dyn IImmutableBrush>
fn as_immutable_brush(&self) -> Option<&dyn IImmutableBrush>
The brush viewed as
IImmutableBrush, when it is one (the is IImmutableBrush test of upstream).Source§fn as_composition_render_resource(
&self,
) -> Option<&dyn ICompositionRenderResource>
fn as_composition_render_resource( &self, ) -> Option<&dyn ICompositionRenderResource>
The composition render resource behind the object, if it is a
mutable object with server-side counterparts on the compositors it
is drawn with.
Source§fn into_immutable_brush(self: Rc<Self>) -> Option<Rc<dyn IImmutableBrush>>
fn into_immutable_brush(self: Rc<Self>) -> Option<Rc<dyn IImmutableBrush>>
The brush as an
IImmutableBrush handle, when it is immutable.The form of the brush that is sent to the render thread, when the
type keeps one: see
SharedBrush. An
immutable brush creates it once, so its identity is stable.Source§impl ICompositionObjectAnimations for CompositionBrush
impl ICompositionObjectAnimations for CompositionBrush
Source§fn try_start_animation(
&self,
property_name: &str,
animation: &dyn ICompositionAnimation,
final_value: Option<ExpressionVariant>,
) -> bool
fn try_start_animation( &self, property_name: &str, animation: &dyn ICompositionAnimation, final_value: Option<ExpressionVariant>, ) -> bool
StartAnimation(propertyName, animation, finalValue) of the class:
returns false for a property the class does not know.Source§fn get_composition_property(
&self,
property_name: &str,
) -> Option<&'static CompositionProperty>
fn get_composition_property( &self, property_name: &str, ) -> Option<&'static CompositionProperty>
The composition property with the given name.
Source§fn composition_object(&self) -> &CompositionObject
fn composition_object(&self) -> &CompositionObject
The embedded
CompositionObject.Source§fn start_animation(
&self,
property_name: &str,
animation: &dyn ICompositionAnimation,
)
fn start_animation( &self, property_name: &str, animation: &dyn ICompositionAnimation, )
Connects an animation with the named property of the object and
starts the animation.
fn start_animation_with_final_value( &self, property_name: &str, animation: &dyn ICompositionAnimation, final_value: Option<ExpressionVariant>, )
Source§fn stop_animation(&self, property_name: &str)
fn stop_animation(&self, property_name: &str)
Disconnects an animation from the named property and stops it.
Source§fn start_animation_group(&self, grp: &dyn ICompositionAnimationBase)
fn start_animation_group(&self, grp: &dyn ICompositionAnimationBase)
Starts an animation group.
The StartAnimationGroup method on CompositionObject lets you start CompositionAnimationGroup.
All the animations in the group will be started at the same time on the object.
Source§fn start_animation_group_part(
&self,
animation: &dyn ICompositionAnimation,
target: &str,
final_value: ExpressionVariant,
) -> bool
fn start_animation_group_part( &self, animation: &dyn ICompositionAnimation, target: &str, final_value: ExpressionVariant, ) -> bool
StartAnimationGroupPart.Source§fn start_animation_group_for(
&self,
grp: &dyn ICompositionAnimationBase,
target: &str,
final_value: ExpressionVariant,
) -> bool
fn start_animation_group_for( &self, grp: &dyn ICompositionAnimationBase, target: &str, final_value: ExpressionVariant, ) -> bool
Starts an animation or an animation group triggered by the change
of property
target to final_value. Returns whether one of the
animations targets that property.Source§fn stop_animation_group(&self, grp: &dyn ICompositionAnimationBase)
fn stop_animation_group(&self, grp: &dyn ICompositionAnimationBase)
Stops an animation group.
Source§impl ICompositionObjectHost for CompositionBrush
impl ICompositionObjectHost for CompositionBrush
Source§fn server(&self) -> ServerObjectId
fn server(&self) -> ServerObjectId
The id of the server-side counterpart of the object.
Source§fn pending_animations(&self) -> &PendingAnimations
fn pending_animations(&self) -> &PendingAnimations
The animations waiting to be sent with the next batch.
Source§fn implicit_animation(
&self,
property_name: &str,
) -> Option<Rc<dyn ICompositionAnimationBase>>
fn implicit_animation( &self, property_name: &str, ) -> Option<Rc<dyn ICompositionAnimationBase>>
The implicit animation attached to a property of the object, if
there is one (
ImplicitAnimations?.TryGetValue(name)).Source§fn start_animation_group(
&self,
grp: &Rc<dyn ICompositionAnimationBase>,
target: &str,
final_value: ExpressionVariant,
) -> bool
fn start_animation_group( &self, grp: &Rc<dyn ICompositionAnimationBase>, target: &str, final_value: ExpressionVariant, ) -> bool
Starts an animation or an animation group triggered by the change
of property
target to final_value. Returns whether one of the
animations targets that property.Source§impl ICompositorSerializable for CompositionBrush
impl ICompositorSerializable for CompositionBrush
Source§fn try_get_server(&self, c: &Compositor) -> Option<ServerObjectId>
fn try_get_server(&self, c: &Compositor) -> Option<ServerObjectId>
The server-side counterpart of the object on compositor
c, if it
has one.Source§fn serialize_changes(&self, c: &Compositor, writer: &mut BatchStreamWriter<'_>)
fn serialize_changes(&self, c: &Compositor, writer: &mut BatchStreamWriter<'_>)
Writes the pending changes of the object for compositor
c.Source§fn serialization_key(&self) -> *const ()
fn serialization_key(&self) -> *const ()
The identity of the object, by which a compositor avoids queueing
it twice. The default is the address of the implementing value; an
adapter around an object returns the identity of that object.
Source§fn prepare_serialization(&self, _c: &Compositor)
fn prepare_serialization(&self, _c: &Compositor)
Called before the changes of the object are written for compositor
c. Read moreSource§impl IGradientBrush for CompositionBrush
impl IGradientBrush for CompositionBrush
Source§fn gradient_stops(&self) -> Vec<Rc<dyn IGradientStop>>
fn gradient_stops(&self) -> Vec<Rc<dyn IGradientStop>>
The brush’s gradient stops.
Source§fn spread_method(&self) -> GradientSpreadMethod
fn spread_method(&self) -> GradientSpreadMethod
The brush’s spread method that defines how to draw a gradient that
doesn’t fill the bounds of the destination control.
Source§impl ILinearGradientBrush for CompositionBrush
impl ILinearGradientBrush for CompositionBrush
Source§fn start_point(&self) -> RelativePoint
fn start_point(&self) -> RelativePoint
The start point for the gradient.
Source§fn end_point(&self) -> RelativePoint
fn end_point(&self) -> RelativePoint
The end point for the gradient.
Source§impl IRadialGradientBrush for CompositionBrush
impl IRadialGradientBrush for CompositionBrush
Source§fn center(&self) -> RelativePoint
fn center(&self) -> RelativePoint
The start point for the gradient.
Source§fn gradient_origin(&self) -> RelativePoint
fn gradient_origin(&self) -> RelativePoint
The location of the two-dimensional focal point that defines the
beginning of the gradient.
Source§fn radius_x(&self) -> RelativeScalar
fn radius_x(&self) -> RelativeScalar
The horizontal radius of the outermost circle of the radial gradient.
Source§fn radius_y(&self) -> RelativeScalar
fn radius_y(&self) -> RelativeScalar
The vertical radius of the outermost circle of the radial gradient.
Source§impl IRegisterForSerialization for CompositionBrush
impl IRegisterForSerialization for CompositionBrush
fn register_for_serialization(&self)
Source§impl ISolidColorBrush for CompositionBrush
impl ISolidColorBrush for CompositionBrush
Auto Trait Implementations§
impl !Freeze for CompositionBrush
impl !RefUnwindSafe for CompositionBrush
impl !Send for CompositionBrush
impl !Sync for CompositionBrush
impl !UnwindSafe for CompositionBrush
impl Unpin for CompositionBrush
impl UnsafeUnpin for CompositionBrush
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
Mutably borrows from an owned value. Read more
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
The static constructor of a type: work done once per thread, after
the properties of the type are registered and before its first
instance exists (class handlers,
affects_render, metadata
overrides). Read more