pub struct WidgetInfoTree(/* private fields */);Expand description
A tree of WidgetInfo.
The tree is behind an Arc pointer so cloning and storing this type is very cheap.
Instantiated using WidgetInfoBuilder.
Implementations§
Source§impl WidgetInfoTree
impl WidgetInfoTree
Sourcepub fn access_enabled(&self) -> AccessEnabled
pub fn access_enabled(&self) -> AccessEnabled
If this tree contains accessibility information.
If accessibility is enabled for the window and will stay enabled for its lifetime.
Sourcepub fn to_access_tree(&self) -> AccessTree
pub fn to_access_tree(&self) -> AccessTree
Build an access tree from the info tree.
If not access_enabled returns a placeholder tree with only the root node.
Sourcepub fn to_access_updates(&self, prev_tree: &Self) -> Option<AccessTreeUpdate>
pub fn to_access_updates(&self, prev_tree: &Self) -> Option<AccessTreeUpdate>
Build partial or full access trees for updated widgets.
Returns None if not access_enabled or no access info has changed. The focused value is always set
to the root ID, it must be changed to the correct focused widget.
This is usually called by window implementers just after the next frame after info rebuild. Note that these
updates will also include to_access_updates_bounds.
Sourcepub fn to_access_updates_bounds(&self) -> Option<AccessTreeUpdate>
pub fn to_access_updates_bounds(&self) -> Option<AccessTreeUpdate>
Build partial access trees for widgets that changed transform, size or visibility.
Returns None if not access_enabled or no transform/visibility changed. The focused value is always set
to the root ID, it must be changed to the correct focused widget.
This is usually called by window implementers after each frame that is not to_access_updates.
Source§impl WidgetInfoTree
impl WidgetInfoTree
Sourcepub fn wgt(window_id: WindowId, root_id: WidgetId) -> Self
pub fn wgt(window_id: WindowId, root_id: WidgetId) -> Self
Blank window that contains only the root widget taking no space.
Sourcepub fn stats(&self) -> WidgetInfoTreeStats
pub fn stats(&self) -> WidgetInfoTreeStats
Statistics abound the info tree.
Sourcepub fn scale_factor(&self) -> Factor
pub fn scale_factor(&self) -> Factor
Scale factor of the last rendered frame.
Sourcepub fn view_process_gen(&self) -> ViewProcessGen
pub fn view_process_gen(&self) -> ViewProcessGen
View-process generation.
Is ViewProcessGen::INVALID before first render and in headless apps.
Sourcepub fn build_meta(&self) -> StateMapRef<'_, WidgetInfoMeta>
pub fn build_meta(&self) -> StateMapRef<'_, WidgetInfoMeta>
Custom metadata associated with the tree during info build.
Any widget (that was not reused) can have inserted metadata.
Sourcepub fn root(&self) -> WidgetInfo
pub fn root(&self) -> WidgetInfo
Reference to the root widget in the tree.
Sourcepub fn all_widgets(&self) -> TreeIter ⓘ
pub fn all_widgets(&self) -> TreeIter ⓘ
All widgets including root.
Sourcepub fn window_id(&self) -> WindowId
pub fn window_id(&self) -> WindowId
Id of the window that owns all widgets represented in the tree.
Sourcepub fn get(&self, widget_id: impl Into<WidgetId>) -> Option<WidgetInfo>
pub fn get(&self, widget_id: impl Into<WidgetId>) -> Option<WidgetInfo>
Reference to the widget in the tree, if it is present.
Sourcepub fn contains(&self, widget_id: impl Into<WidgetId>) -> bool
pub fn contains(&self, widget_id: impl Into<WidgetId>) -> bool
If the tree contains the widget.
Sourcepub fn get_or_parent(&self, path: &WidgetPath) -> Option<WidgetInfo>
pub fn get_or_parent(&self, path: &WidgetPath) -> Option<WidgetInfo>
Reference to the widget or first parent that is present.
Sourcepub fn is_rendered(&self) -> bool
pub fn is_rendered(&self) -> bool
If the widgets in this tree have been rendered at least once, after the first render the widget bounds info are always up-to-date and spatial queries can be made on the widgets.
Sourcepub fn out_of_bounds(
&self,
) -> impl ExactSizeIterator<Item = WidgetInfo> + 'static + use<>
pub fn out_of_bounds( &self, ) -> impl ExactSizeIterator<Item = WidgetInfo> + 'static + use<>
Iterator over all widgets with inner-bounds not fully contained by their parent inner bounds.
Sourcepub fn spatial_bounds(&self) -> PxRect
pub fn spatial_bounds(&self) -> PxRect
Gets the bounds box that envelops all widgets, including the out-of-bounds widgets.
Trait Implementations§
Source§impl Clone for WidgetInfoTree
impl Clone for WidgetInfoTree
Source§fn clone(&self) -> WidgetInfoTree
fn clone(&self) -> WidgetInfoTree
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WidgetInfoTree
impl Debug for WidgetInfoTree
Source§impl PartialEq for WidgetInfoTree
impl PartialEq for WidgetInfoTree
impl Eq for WidgetInfoTree
Auto Trait Implementations§
impl Freeze for WidgetInfoTree
impl !RefUnwindSafe for WidgetInfoTree
impl Send for WidgetInfoTree
impl Sync for WidgetInfoTree
impl Unpin for WidgetInfoTree
impl !UnwindSafe for WidgetInfoTree
Blanket Implementations§
Source§impl<T> AnyVarValue for T
impl<T> AnyVarValue for T
Source§fn clone_boxed(&self) -> BoxAnyVarValue
fn clone_boxed(&self) -> BoxAnyVarValue
Source§fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
self and other are equal.Source§fn try_swap(&mut self, other: &mut (dyn AnyVarValue + 'static)) -> bool
fn try_swap(&mut self, other: &mut (dyn AnyVarValue + 'static)) -> bool
other if both are of the same type.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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more