Struct egui::context::ContextImpl

source ·
struct ContextImpl {
Show 16 fields fonts: BTreeMap<OrderedFloat<f32>, Fonts>, font_definitions: FontDefinitions, memory: Memory, animation_manager: AnimationManager, plugins: Plugins, tex_manager: WrappedTextureManager, new_zoom_factor: Option<f32>, os: OperatingSystem, viewport_stack: Vec<ViewportIdPair>, last_viewport: ViewportId, paint_stats: PaintStats, request_repaint_callback: Option<Box<dyn Fn(RequestRepaintInfo) + Send + Sync>>, viewport_parents: ViewportIdMap<ViewportId>, viewports: ViewportIdMap<ViewportState>, embed_viewports: bool, loaders: Arc<Loaders>,
}

Fields§

§fonts: BTreeMap<OrderedFloat<f32>, Fonts>

Since we could have multiple viewports across multiple monitors with different pixels_per_point, we need a Fonts instance for each unique pixels_per_point. This is because the Fonts depend on pixels_per_point for the font atlas as well as kerning, font sizes, etc.

§font_definitions: FontDefinitions§memory: Memory§animation_manager: AnimationManager§plugins: Plugins§tex_manager: WrappedTextureManager

All viewports share the same texture manager and texture namespace.

In all viewports, TextureId::default is special, and points to the font atlas. The font-atlas texture may be different across viewports, as they may have different pixels_per_point, so we do special book-keeping for that. See https://github.com/emilk/egui/issues/3664.

§new_zoom_factor: Option<f32>

Set during the frame, becomes active at the start of the next frame.

§os: OperatingSystem§viewport_stack: Vec<ViewportIdPair>

How deeply nested are we?

§last_viewport: ViewportId

What is the last viewport rendered?

§paint_stats: PaintStats§request_repaint_callback: Option<Box<dyn Fn(RequestRepaintInfo) + Send + Sync>>§viewport_parents: ViewportIdMap<ViewportId>§viewports: ViewportIdMap<ViewportState>§embed_viewports: bool§loaders: Arc<Loaders>

Implementations§

source§

impl ContextImpl

Repaint-logic

source

fn begin_frame_repaint_logic(&mut self, viewport_id: ViewportId)

This is where we update the repaint logic.

source

fn request_repaint(&mut self, viewport_id: ViewportId, cause: RepaintCause)

source

fn request_repaint_after( &mut self, delay: Duration, viewport_id: ViewportId, cause: RepaintCause, )

source

fn requested_immediate_repaint_prev_frame( &self, viewport_id: &ViewportId, ) -> bool

source

fn has_requested_repaint(&self, viewport_id: &ViewportId) -> bool

source§

impl ContextImpl

source

fn begin_frame_mut(&mut self, new_raw_input: RawInput)

source

fn update_fonts_mut(&mut self)

Load fonts unless already loaded.

source

fn pixels_per_point(&mut self) -> f32

source

pub(crate) fn viewport_id(&self) -> ViewportId

Return the ViewportId of the current viewport.

For the root viewport this will return ViewportId::ROOT.

source

pub(crate) fn parent_viewport_id(&self) -> ViewportId

Return the ViewportId of his parent.

For the root viewport this will return ViewportId::ROOT.

source

fn all_viewport_ids(&self) -> ViewportIdSet

source

pub(crate) fn viewport(&mut self) -> &mut ViewportState

The current active viewport

source

fn viewport_for(&mut self, viewport_id: ViewportId) -> &mut ViewportState

source§

impl ContextImpl

source

fn end_frame(&mut self) -> FullOutput

Trait Implementations§

source§

impl Default for ContextImpl

source§

fn default() -> ContextImpl

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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.