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
impl CompositionTarget
pub fn compositor(&self) -> &Rc<Compositor>
Sourcepub fn server(&self) -> ServerObjectId
pub fn server(&self) -> ServerObjectId
The id of the server-side target.
pub fn is_disposed(&self) -> bool
pub fn dispose(&self)
pub fn root(&self) -> Option<Rc<CompositionVisual>>
pub fn set_root(&self, value: Option<Rc<CompositionVisual>>)
pub fn is_enabled(&self) -> bool
pub fn set_is_enabled(&self, value: bool)
pub fn debug_overlays(&self) -> RendererDebugOverlays
pub fn set_debug_overlays(&self, value: RendererDebugOverlays)
pub fn last_layout_pass_timing(&self) -> LayoutPassTiming
pub fn set_last_layout_pass_timing(&self, value: LayoutPassTiming)
pub fn scaling(&self) -> f64
pub fn set_scaling(&self, value: f64)
pub fn size(&self) -> Size
pub fn set_size(&self, value: Size)
pub fn transparency_level(&self) -> CompositionTransparencyLevel
pub fn set_transparency_level(&self, value: CompositionTransparencyLevel)
pub fn platform_specific_scene_info(&self) -> Option<Arc<dyn Any + Send + Sync>>
pub fn set_platform_specific_scene_info( &self, value: Option<Arc<dyn Any + Send + Sync>>, )
Sourcepub fn set_debug_events(
&self,
events: Option<Arc<dyn ICompositionTargetDebugEvents>>,
)
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.
Sourcepub 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>)>>
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.
Sourcepub 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)
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.
pub fn request_redraw(&self)
Trait Implementations§
Source§impl AsCompositionObject for CompositionTarget
impl AsCompositionObject for CompositionTarget
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 CompositionTargetHooks for CompositionTarget
impl CompositionTargetHooks for CompositionTarget
fn on_root_changed(&self)
fn on_root_changing(&self)
fn initialize_defaults_extra(&self)
fn validate_root_change( &self, _old_value: &Option<Rc<dyn ICompositionObject>>, _new_value: &Option<Rc<dyn ICompositionObject>>, )
fn validate_is_enabled_change(&self, _old_value: bool, _new_value: bool)
fn on_is_enabled_changed(&self)
fn on_is_enabled_changing(&self)
fn validate_debug_overlays_change( &self, _old_value: RendererDebugOverlays, _new_value: RendererDebugOverlays, )
fn on_debug_overlays_changed(&self)
fn on_debug_overlays_changing(&self)
fn validate_last_layout_pass_timing_change( &self, _old_value: LayoutPassTiming, _new_value: LayoutPassTiming, )
fn on_last_layout_pass_timing_changed(&self)
fn on_last_layout_pass_timing_changing(&self)
fn validate_scaling_change(&self, _old_value: f64, _new_value: f64)
fn on_scaling_changed(&self)
fn on_scaling_changing(&self)
fn validate_size_change(&self, _old_value: Size, _new_value: Size)
fn on_size_changed(&self)
fn on_size_changing(&self)
fn validate_transparency_level_change( &self, _old_value: CompositionTransparencyLevel, _new_value: CompositionTransparencyLevel, )
fn on_transparency_level_changed(&self)
fn on_transparency_level_changing(&self)
fn validate_platform_specific_scene_info_change( &self, _old_value: &Option<Arc<dyn Any + Send + Sync>>, _new_value: &Option<Arc<dyn Any + Send + Sync>>, )
fn on_platform_specific_scene_info_changed(&self)
fn on_platform_specific_scene_info_changing(&self)
Source§impl ICompositionObjectAnimations for CompositionTarget
The class has no animated property: upstream does not override
StartAnimation, whose base implementation rejects every property.
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
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 CompositionTarget
impl ICompositionObjectHost for CompositionTarget
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 CompositionTarget
impl ICompositorSerializable for CompositionTarget
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 moreAuto Trait Implementations§
impl !Freeze for CompositionTarget
impl !RefUnwindSafe for CompositionTarget
impl !Send for CompositionTarget
impl !Sync for CompositionTarget
impl !UnwindSafe for CompositionTarget
impl Unpin for CompositionTarget
impl UnsafeUnpin for CompositionTarget
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