Skip to main content

PanelCx

Struct PanelCx 

Source
pub struct PanelCx<'a, S: Spec> {
    pub window: WindowId,
    pub leaf: LeafId,
    pub panel: &'a S::Panel,
    pub index: usize,
    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 dock leaf’s content hook context (design §6.3).

Fields§

§window: WindowId

The window being composed.

§leaf: LeafId

The leaf being drawn.

§panel: &'a S::Panel

The app’s own panel value (the active tab of the leaf).

§index: usize

The panel’s tab index inside the leaf.

§rect: Rect

Content rect, window-local logical pixels (inside the leaf frame and its tab strip).

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

§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 PanelCx<'a, S>

Source§

type Spec = S

The app vocabulary of the context.
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 PanelCx<'a, S>

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

impl<'a, S> UnsafeUnpin for PanelCx<'a, S>
where &'a <S as Spec>::Panel: 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.