pub trait ContainerLayer: Layer {
const AS_OFFSET: Option<fn() -> &'static OffsetLayerVTable> = None;
// Required methods
fn container_layer_data(
self: Handle<Self>,
app: &App,
) -> &ContainerLayerData;
fn container_layer_data_mut(
self: Handle<Self>,
app: &mut App,
) -> &mut ContainerLayerData;
// Provided methods
fn as_container_layer(self: Handle<Self>) -> AnyContainerLayer { ... }
fn apply_transform(
self: Handle<Self>,
app: &App,
child: Option<AnyLayer>,
transform: &mut Matrix4,
) { ... }
fn fire_composition_callbacks(
self: Handle<Self>,
app: &mut App,
include_children: bool,
) { ... }
fn supports_rasterization(self: Handle<Self>, app: &App) -> bool { ... }
fn dispose(self: Handle<Self>, app: &mut App) { ... }
fn find_annotations(
self: Handle<Self>,
app: &App,
result: &mut AnnotationSearch,
local_position: Offset,
only_first: bool,
) -> bool { ... }
fn attach(self: Handle<Self>, app: &mut App, owner: HandleId) { ... }
fn detach(self: Handle<Self>, app: &mut App) { ... }
fn redepth_children(self: Handle<Self>, app: &mut App) { ... }
fn add_to_scene(
self: Handle<Self>,
app: &mut App,
builder: &mut SceneBuilder,
) { ... }
}Expand description
A composited layer that has a list of children.
A ContainerLayer instance merely takes a list of children and inserts them into the
composited rendering in order. There are subclasses of ContainerLayer which apply more
elaborate effects in the process.
Flutter’s ContainerLayer: the child list lives on AnyContainerLayer; this trait holds
the virtual apply_transform and the bodies of the Layer methods it overrides. A leaf’s
impl Layer forwards to them: fn attach(..) { ContainerLayer::attach(self, app, owner) }.
Provided Associated Constants§
Required Methods§
Sourcefn container_layer_data(self: Handle<Self>, app: &App) -> &ContainerLayerData
fn container_layer_data(self: Handle<Self>, app: &App) -> &ContainerLayerData
Mixin field access.
Sourcefn container_layer_data_mut(
self: Handle<Self>,
app: &mut App,
) -> &mut ContainerLayerData
fn container_layer_data_mut( self: Handle<Self>, app: &mut App, ) -> &mut ContainerLayerData
See container_layer_data.
Provided Methods§
Sourcefn as_container_layer(self: Handle<Self>) -> AnyContainerLayer
fn as_container_layer(self: Handle<Self>) -> AnyContainerLayer
Dart’s implicit upcast of a concrete layer to ContainerLayer.
Sourcefn apply_transform(
self: Handle<Self>,
app: &App,
child: Option<AnyLayer>,
transform: &mut Matrix4,
)
fn apply_transform( self: Handle<Self>, app: &App, child: Option<AnyLayer>, transform: &mut Matrix4, )
Applies the transform that would be applied when compositing the given child to the given matrix.
Specifically, this should apply the transform that is applied to child’s origin. When
using apply_transform with a chain of layers, results will be unreliable unless the
deepest layer in the chain collapses the layerOffset in add_to_scene to zero, meaning
that it passes Offset::ZERO to its children, and bakes any incoming layerOffset into
the SceneBuilder as (for instance) a transform (which is then also included in the
transformation applied by apply_transform).
This method is only valid immediately after add_to_scene has been called, before any of
the properties have been changed.
The default implementation does nothing, since ContainerLayer, by default, composites
its children at the origin of the ContainerLayer itself.
The child argument should generally not be None, since in principle a layer could
transform each child independently. However, certain layers may explicitly allow None
as a value, for example if they know that they transform all their children identically.
Used by FollowerLayer to transform its child to a LeaderLayer’s position.
Sourcefn fire_composition_callbacks(
self: Handle<Self>,
app: &mut App,
include_children: bool,
)
fn fire_composition_callbacks( self: Handle<Self>, app: &mut App, include_children: bool, )
ContainerLayer._fireCompositionCallbacks.
Sourcefn supports_rasterization(self: Handle<Self>, app: &App) -> bool
fn supports_rasterization(self: Handle<Self>, app: &App) -> bool
ContainerLayer.supportsRasterization.
Sourcefn find_annotations(
self: Handle<Self>,
app: &App,
result: &mut AnnotationSearch,
local_position: Offset,
only_first: bool,
) -> bool
fn find_annotations( self: Handle<Self>, app: &App, result: &mut AnnotationSearch, local_position: Offset, only_first: bool, ) -> bool
ContainerLayer.findAnnotations.
Sourcefn redepth_children(self: Handle<Self>, app: &mut App)
fn redepth_children(self: Handle<Self>, app: &mut App)
ContainerLayer.redepthChildren.
Sourcefn add_to_scene(self: Handle<Self>, app: &mut App, builder: &mut SceneBuilder)
fn add_to_scene(self: Handle<Self>, app: &mut App, builder: &mut SceneBuilder)
ContainerLayer.addToScene.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".