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
impl ContextImpl
Repaint-logic
sourcefn begin_frame_repaint_logic(&mut self, viewport_id: ViewportId)
fn begin_frame_repaint_logic(&mut self, viewport_id: ViewportId)
This is where we update the repaint logic.
fn request_repaint(&mut self, viewport_id: ViewportId, cause: RepaintCause)
fn request_repaint_after( &mut self, delay: Duration, viewport_id: ViewportId, cause: RepaintCause, )
fn requested_immediate_repaint_prev_frame( &self, viewport_id: &ViewportId, ) -> bool
fn has_requested_repaint(&self, viewport_id: &ViewportId) -> bool
source§impl ContextImpl
impl ContextImpl
fn begin_frame_mut(&mut self, new_raw_input: RawInput)
sourcefn update_fonts_mut(&mut self)
fn update_fonts_mut(&mut self)
Load fonts unless already loaded.
fn pixels_per_point(&mut self) -> f32
sourcepub(crate) fn viewport_id(&self) -> ViewportId
pub(crate) fn viewport_id(&self) -> ViewportId
Return the ViewportId
of the current viewport.
For the root viewport this will return ViewportId::ROOT
.
sourcepub(crate) fn parent_viewport_id(&self) -> ViewportId
pub(crate) fn parent_viewport_id(&self) -> ViewportId
Return the ViewportId
of his parent.
For the root viewport this will return ViewportId::ROOT
.
fn all_viewport_ids(&self) -> ViewportIdSet
sourcepub(crate) fn viewport(&mut self) -> &mut ViewportState
pub(crate) fn viewport(&mut self) -> &mut ViewportState
The current active viewport