pub struct PlatformViewHosting<A> { /* private fields */ }Expand description
The bookkeeping a platform layer needs while it hosts native views, kept apart from the native calls so attach, reposition, restack and detach sequencing can be tested without a window.
A carries whatever the platform layer captured at attach time and must put
back verbatim at detach: on Windows the child window’s parent, window styles
and window region.
Implementations§
Source§impl<A> PlatformViewHosting<A>
impl<A> PlatformViewHosting<A>
Sourcepub fn contains(&self, id: PlatformViewId) -> bool
pub fn contains(&self, id: PlatformViewId) -> bool
Returns whether the given view is hosted.
Sourcepub fn attach(&mut self, id: PlatformViewId, attributes: A)
pub fn attach(&mut self, id: PlatformViewId, attributes: A)
Records a view as hosted, stacked above every view hosted so far.
Attaching a view that is already hosted replaces what has to be restored for it and forgets its applied frame, so the next placement is applied unconditionally.
Sourcepub fn detach(&mut self, id: PlatformViewId) -> Option<A>
pub fn detach(&mut self, id: PlatformViewId) -> Option<A>
Forgets a hosted view, returning what the platform layer must restore.
Sourcepub fn detach_all(&mut self) -> Vec<(PlatformViewId, A)>
pub fn detach_all(&mut self) -> Vec<(PlatformViewId, A)>
Forgets every hosted view, bottom-most first.
Sourcepub fn restack(&mut self, order: &[PlatformViewId]) -> bool
pub fn restack(&mut self, order: &[PlatformViewId]) -> bool
Adopts order — bottom-most first — as the stacking order, returning
true when it differs from the order last applied and the platform layer
therefore has to restack.
Ids that are not hosted are ignored, and hosted views the frame did not mention keep their relative order beneath the ordered ones.
Sourcepub fn place(
&mut self,
id: PlatformViewId,
bounds: Bounds<Pixels>,
scale_factor: f32,
) -> Option<Bounds<DevicePixels>>
pub fn place( &mut self, id: PlatformViewId, bounds: Bounds<Pixels>, scale_factor: f32, ) -> Option<Bounds<DevicePixels>>
Records the frame a hosted view was laid out at, returning the physical
rectangle to move it to, or None when it already sits there.
Sourcepub fn attributes(&self, id: PlatformViewId) -> Option<&A>
pub fn attributes(&self, id: PlatformViewId) -> Option<&A>
Returns what the platform layer must restore for a hosted view.
Sourcepub fn ids(&self) -> Vec<PlatformViewId>
pub fn ids(&self) -> Vec<PlatformViewId>
Returns the hosted views in the stacking order last applied, bottom-most first.
Trait Implementations§
Auto Trait Implementations§
impl<A> Freeze for PlatformViewHosting<A>
impl<A> RefUnwindSafe for PlatformViewHosting<A>where
A: RefUnwindSafe,
impl<A> Send for PlatformViewHosting<A>where
A: Send,
impl<A> Sync for PlatformViewHosting<A>where
A: Sync,
impl<A> Unpin for PlatformViewHosting<A>where
A: Unpin,
impl<A> UnsafeUnpin for PlatformViewHosting<A>
impl<A> UnwindSafe for PlatformViewHosting<A>where
A: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().