Skip to main content

CompositionBrush

Struct CompositionBrush 

Source
pub struct CompositionBrush { /* private fields */ }
Expand description

A brush of the composition API.

Implementations§

Source§

impl CompositionBrush

Source

pub fn brush_props(&self) -> &CompositionBrushProps

The generated properties of CompositionBrush.

Source

pub fn compositor(&self) -> &Rc<Compositor>

Source

pub fn object(&self) -> &CompositionObject

The embedded CompositionObject.

Source

pub fn server(&self) -> ServerObjectId

The id of the server-side brush.

Source

pub fn is_disposed(&self) -> bool

Source

pub fn type_name(&self) -> &'static str

The name of the concrete class, for messages.

Source

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).

Source

pub fn as_brush(&self) -> Rc<dyn IBrush>

The brush as an IBrush handle.

Source

pub fn implicit_animations(&self) -> Option<Rc<ImplicitAnimationCollection>>

The collection of implicit animations attached to this object.

Source

pub fn set_implicit_animations( &self, value: Option<Rc<ImplicitAnimationCollection>>, )

Source

pub fn opacity(&self) -> f64

Source

pub fn set_opacity(&self, value: f64)

Source

pub fn transform_origin(&self) -> RelativePoint

Source

pub fn set_transform_origin(&self, value: RelativePoint)

Source

pub fn transform(&self) -> Option<Rc<dyn ITransform>>

Source

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.

Source

pub fn relative_transform(&self) -> Option<Rc<dyn ITransform>>

Source

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

Source§

fn as_composition_object(&self) -> &CompositionObject

The embedded CompositionObject.
Source§

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>>

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).

Source§

impl CompositionConicGradientBrushHooks for CompositionBrush

Source§

fn base_serialize_changes_core(&self, writer: &mut BatchStreamWriter<'_>)

base.SerializeChangesCore(writer): serializes the changes of the hand-written base class CompositionGradientBrush.
Source§

fn initialize_defaults_extra(&self)

Source§

fn validate_angle_change(&self, _old_value: f64, _new_value: f64)

Source§

fn on_angle_changed(&self)

Source§

fn on_angle_changing(&self)

Source§

fn validate_center_change( &self, _old_value: RelativePoint, _new_value: RelativePoint, )

Source§

fn on_center_changed(&self)

Source§

fn on_center_changing(&self)

Source§

impl CompositionLinearGradientBrushHooks for CompositionBrush

Source§

fn base_serialize_changes_core(&self, writer: &mut BatchStreamWriter<'_>)

base.SerializeChangesCore(writer): serializes the changes of the hand-written base class CompositionGradientBrush.
Source§

fn initialize_defaults_extra(&self)

Source§

fn validate_start_point_change( &self, _old_value: RelativePoint, _new_value: RelativePoint, )

Source§

fn on_start_point_changed(&self)

Source§

fn on_start_point_changing(&self)

Source§

fn validate_end_point_change( &self, _old_value: RelativePoint, _new_value: RelativePoint, )

Source§

fn on_end_point_changed(&self)

Source§

fn on_end_point_changing(&self)

Source§

impl CompositionRadialGradientBrushHooks for CompositionBrush

Source§

fn base_serialize_changes_core(&self, writer: &mut BatchStreamWriter<'_>)

base.SerializeChangesCore(writer): serializes the changes of the hand-written base class CompositionGradientBrush.
Source§

fn initialize_defaults_extra(&self)

Source§

fn validate_center_change( &self, _old_value: RelativePoint, _new_value: RelativePoint, )

Source§

fn on_center_changed(&self)

Source§

fn on_center_changing(&self)

Source§

fn validate_gradient_origin_change( &self, _old_value: RelativePoint, _new_value: RelativePoint, )

Source§

fn on_gradient_origin_changed(&self)

Source§

fn on_gradient_origin_changing(&self)

Source§

fn validate_radius_x_change( &self, _old_value: RelativeScalar, _new_value: RelativeScalar, )

Source§

fn on_radius_x_changed(&self)

Source§

fn on_radius_x_changing(&self)

Source§

fn validate_radius_y_change( &self, _old_value: RelativeScalar, _new_value: RelativeScalar, )

Source§

fn on_radius_y_changed(&self)

Source§

fn on_radius_y_changing(&self)

Source§

impl CompositionSolidColorBrushHooks for CompositionBrush

Source§

impl IBrush for CompositionBrush

Source§

fn opacity(&self) -> f64

The opacity of the brush.
Source§

fn transform(&self) -> Option<Rc<dyn ITransform>>

The transform of the brush.
Source§

fn transform_origin(&self) -> RelativePoint

The origin of the brush transform.
Source§

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

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>

The brush viewed as ISolidColorBrush, when it is one.
Source§

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>

The brush viewed as ILinearGradientBrush, when it is one.
Source§

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>

The brush viewed as IConicGradientBrush, when it is one.
Source§

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>

The object behind the brush when it is a mutable Brush.
Source§

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>

The brush viewed as IImageBrush, when it is one.
Source§

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>

The brush viewed as IMutableBrush, when it is one.
Source§

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>

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>>

The brush as an IImmutableBrush handle, when it is immutable.
Source§

fn to_shared(&self) -> Option<SharedBrush>

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§

fn equals(&self, other: &dyn IBrush) -> bool

Whether the brush equals other. Brushes compare by reference unless the type defines structural equality (immutable solid color brushes).
Source§

impl ICompositionObject for CompositionBrush

Source§

fn server(&self) -> ServerObjectId

The id of the server-side counterpart of the object.
Source§

fn as_any(&self) -> &dyn Any

Source§

fn into_any_rc(self: Rc<Self>) -> Rc<dyn Any>

Source§

impl ICompositionObjectAnimations for CompositionBrush

Source§

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>

The composition property with the given name.
Source§

fn composition_object(&self) -> &CompositionObject

The embedded CompositionObject.
Source§

fn start_animation( &self, property_name: &str, animation: &dyn ICompositionAnimation, )

Connects an animation with the named property of the object and starts the animation.
Source§

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)

Disconnects an animation from the named property and stops it.
Source§

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

StartAnimationGroupPart.
Source§

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)

Stops an animation group.
Source§

impl ICompositionObjectHost for CompositionBrush

Source§

fn server(&self) -> ServerObjectId

The id of the server-side counterpart of the object.
Source§

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>>

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

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

Source§

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<'_>)

Writes the pending changes of the object for compositor c.
Source§

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)

Called before the changes of the object are written for compositor c. Read more
Source§

impl IConicGradientBrush for CompositionBrush

Source§

fn center(&self) -> RelativePoint

The center point for the gradient.
Source§

fn angle(&self) -> f64

The starting angle for the gradient in degrees, measured from the point above the center point.
Source§

impl IGradientBrush for CompositionBrush

Source§

fn gradient_stops(&self) -> Vec<Rc<dyn IGradientStop>>

The brush’s gradient stops.
Source§

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

Source§

fn start_point(&self) -> RelativePoint

The start point for the gradient.
Source§

fn end_point(&self) -> RelativePoint

The end point for the gradient.
Source§

impl IRadialGradientBrush for CompositionBrush

Source§

fn center(&self) -> RelativePoint

The start point for the gradient.
Source§

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

The horizontal radius of the outermost circle of the radial gradient.
Source§

fn radius_y(&self) -> RelativeScalar

The vertical radius of the outermost circle of the radial gradient.
Source§

impl IRegisterForSerialization for CompositionBrush

Source§

impl ISolidColorBrush for CompositionBrush

Source§

fn color(&self) -> Color

The color of the brush.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ClassDefaults for T
where T: ?Sized,

Source§

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
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.