Skip to main content

CompositionTarget

Struct CompositionTarget 

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

The root of a composition visual tree: what a renderer draws to a render target.

Implementations§

Source§

impl CompositionTarget

Source

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

Source

pub fn server(&self) -> ServerObjectId

The id of the server-side target.

Source

pub fn id(&self) -> i64

The identity of the target, shared with its server side.

Source

pub fn is_disposed(&self) -> bool

Source

pub fn dispose(&self)

Source

pub fn root(&self) -> Option<Rc<CompositionVisual>>

Source

pub fn set_root(&self, value: Option<Rc<CompositionVisual>>)

Source

pub fn is_enabled(&self) -> bool

Source

pub fn set_is_enabled(&self, value: bool)

Source

pub fn debug_overlays(&self) -> RendererDebugOverlays

Source

pub fn set_debug_overlays(&self, value: RendererDebugOverlays)

Source

pub fn last_layout_pass_timing(&self) -> LayoutPassTiming

Source

pub fn set_last_layout_pass_timing(&self, value: LayoutPassTiming)

Source

pub fn scaling(&self) -> f64

Source

pub fn set_scaling(&self, value: f64)

Source

pub fn size(&self) -> Size

Source

pub fn set_size(&self, value: Size)

Source

pub fn transparency_level(&self) -> CompositionTransparencyLevel

Source

pub fn set_transparency_level(&self, value: CompositionTransparencyLevel)

Source

pub fn platform_specific_scene_info(&self) -> Option<Arc<dyn Any + Send + Sync>>

Source

pub fn set_platform_specific_scene_info( &self, value: Option<Arc<dyn Any + Send + Sync>>, )

Source

pub fn set_debug_events( &self, events: Option<Arc<dyn ICompositionTargetDebugEvents>>, )

Sets the receiver of the debug events of the server-side target. It is handed over with the next batch.

Source

pub fn try_hit_test<H: ICompositionHitTester>( &self, input: &H::Input, root: Option<&Rc<CompositionVisual>>, filter: Option<&'_ dyn Fn(&Rc<CompositionVisual>) -> bool>, ) -> Option<Vec<(IntersectionResult, Rc<CompositionVisual>)>>

Collects the visuals hit by input (in the coordinates of root, or of the root of the target), topmost first, with how they are hit. None when the tree has not been rendered yet.

Source

pub fn try_hit_test_first<H: ICompositionHitTester>( &self, input: &H::Input, root: Option<&Rc<CompositionVisual>>, filter: Option<&'_ dyn Fn(&Rc<CompositionVisual>) -> bool>, result_filter: Option<&'_ dyn Fn(&Rc<CompositionVisual>) -> bool>, ) -> (Option<Rc<CompositionVisual>>, IntersectionResult)

Finds the topmost visual hit by input that passes result_filter and returns it with how it is hit.

Source

pub fn request_redraw(&self)

Trait Implementations§

Source§

impl AsCompositionObject for CompositionTarget

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 CompositionTargetHooks for CompositionTarget

Source§

fn on_root_changed(&self)

Source§

fn on_root_changing(&self)

Source§

fn initialize_defaults_extra(&self)

Source§

fn validate_root_change( &self, _old_value: &Option<Rc<dyn ICompositionObject>>, _new_value: &Option<Rc<dyn ICompositionObject>>, )

Source§

fn validate_is_enabled_change(&self, _old_value: bool, _new_value: bool)

Source§

fn on_is_enabled_changed(&self)

Source§

fn on_is_enabled_changing(&self)

Source§

fn validate_debug_overlays_change( &self, _old_value: RendererDebugOverlays, _new_value: RendererDebugOverlays, )

Source§

fn on_debug_overlays_changed(&self)

Source§

fn on_debug_overlays_changing(&self)

Source§

fn validate_last_layout_pass_timing_change( &self, _old_value: LayoutPassTiming, _new_value: LayoutPassTiming, )

Source§

fn on_last_layout_pass_timing_changed(&self)

Source§

fn on_last_layout_pass_timing_changing(&self)

Source§

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

Source§

fn on_scaling_changed(&self)

Source§

fn on_scaling_changing(&self)

Source§

fn validate_size_change(&self, _old_value: Size, _new_value: Size)

Source§

fn on_size_changed(&self)

Source§

fn on_size_changing(&self)

Source§

fn validate_transparency_level_change( &self, _old_value: CompositionTransparencyLevel, _new_value: CompositionTransparencyLevel, )

Source§

fn on_transparency_level_changed(&self)

Source§

fn on_transparency_level_changing(&self)

Source§

fn validate_platform_specific_scene_info_change( &self, _old_value: &Option<Arc<dyn Any + Send + Sync>>, _new_value: &Option<Arc<dyn Any + Send + Sync>>, )

Source§

fn on_platform_specific_scene_info_changed(&self)

Source§

fn on_platform_specific_scene_info_changing(&self)

Source§

impl ICompositionObject for CompositionTarget

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 CompositionTarget

The class has no animated property: upstream does not override StartAnimation, whose base implementation rejects every property.

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 CompositionTarget

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 CompositionTarget

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 IRegisterForSerialization for CompositionTarget

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.