Skip to main content

OverlayCx

Struct OverlayCx 

Source
pub struct OverlayCx<'a, S: Spec> {
    pub window: WindowId,
    pub id: S::Overlay,
    pub body: Rect,
    pub rect: Rect,
    pub dpr: f64,
    pub tokens: &'a Tokens,
    pub render: &'a mut dyn RenderContext,
    pub widgets: Widgets<'a>,
    pub view: &'a VisualView<S>,
    pub time: FrameTime,
    pub out: &'a mut HookOps<S>,
}
Expand description

One open overlay’s body hook context (design §6.3); same reach as PanelCx, plus the overlay identity and the body rect the kernel’s frame leaves.

Fields§

§window: WindowId

The window being composed.

§id: S::Overlay

The overlay being drawn.

§body: Rect

Body rect, window-local logical pixels (inside the kernel-drawn frame).

§rect: Rect

Content rect the body may register widgets into (equals body).

§dpr: f64

Device pixel ratio of the window.

§tokens: &'a Tokens

Active theme tokens.

§render: &'a mut dyn RenderContext

The paint target.

§widgets: Widgets<'a>

Widget registration face (the overlay’s own layer).

§view: &'a VisualView<S>

This frame’s input truth of the window.

§time: FrameTime

Frame clock.

§out: &'a mut HookOps<S>

Declared effects out.

Trait Implementations§

Source§

impl<'a, S: Spec> ContentCx<'a> for OverlayCx<'a, S>

Source§

type Spec = S

The app vocabulary of the context.
Source§

fn frame_now_ms(&self) -> f64

The frame clock in milliseconds, unrounded: the stamp scroll containers share within one frame.
Source§

fn request_frame(&mut self)

Ask for another frame (an animation or a scroll is still moving).
Source§

fn is_overlay(&self) -> bool

Painting into an overlay (a modal makes the page’s scroll containers inert to keys).
Source§

fn ime_area(&mut self, rect: Rect)

Report the focused field’s caret rect so the OS IME window opens there.
Source§

fn time_ms(&self) -> u64

Host clock in whole milliseconds. Same unit as TextFieldStore::cursor_visible.
Source§

fn with_paint<R>( &mut self, f: impl FnOnce(&mut dyn RenderContext, &mut Widgets<'a>, &VisualView<S>, &Tokens) -> R, ) -> R

Run f against this frame’s paint target and registration face.

Auto Trait Implementations§

§

impl<'a, S> !RefUnwindSafe for OverlayCx<'a, S>

§

impl<'a, S> !Send for OverlayCx<'a, S>

§

impl<'a, S> !Sync for OverlayCx<'a, S>

§

impl<'a, S> !UnwindSafe for OverlayCx<'a, S>

§

impl<'a, S> Forget for OverlayCx<'a, S>

§

impl<'a, S> Freeze for OverlayCx<'a, S>
where <S as Spec>::Overlay: Freeze, &'a VisualView<S>: Freeze, &'a mut HookOps<S>: Freeze,

§

impl<'a, S> Move for OverlayCx<'a, S>

§

impl<'a, S> Unpin for OverlayCx<'a, S>
where <S as Spec>::Overlay: Unpin, &'a VisualView<S>: Unpin, &'a mut HookOps<S>: Unpin,

§

impl<'a, S> UnsafeUnpin for OverlayCx<'a, S>
where <S as Spec>::Overlay: UnsafeUnpin, &'a VisualView<S>: UnsafeUnpin, &'a mut HookOps<S>: UnsafeUnpin,

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> 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.