pub struct WindowInternal {
pub renderer_resources: RendererResources,
pub renderer_type: Option<RendererType>,
pub previous_window_state: Option<FullWindowState>,
pub current_window_state: FullWindowState,
pub document_id: DocumentId,
pub id_namespace: IdNamespace,
pub epoch: Epoch,
pub layout_results: Vec<LayoutResult>,
pub gl_texture_cache: GlTextureCache,
pub scroll_states: ScrollStates,
pub timers: BTreeMap<TimerId, Timer>,
pub threads: BTreeMap<ThreadId, Thread>,
}Fields§
§renderer_resources: RendererResourcesCurrently loaded fonts and images present in this renderer (window)
renderer_type: Option<RendererType>Renderer type: Hardware-with-software-fallback, pure software or pure hardware renderer?
previous_window_state: Option<FullWindowState>Windows state of the window of (current frame - 1): initialized to None on startup
current_window_state: FullWindowStateWindow state of this current window (current frame): initialized to the state of WindowCreateOptions
document_id: DocumentIdA “document” in WebRender usually corresponds to one tab (i.e. in Azuls case, the whole window).
id_namespace: IdNamespaceID namespace under which every font / image for this window is registered
epoch: EpochThe “epoch” is a frame counter, to remove outdated images, fonts and OpenGL textures when they’re not in use anymore.
layout_results: Vec<LayoutResult>Currently active, layouted rectangles and styled DOMs
gl_texture_cache: GlTextureCacheCurrently GL textures inside the active CachedDisplayList
scroll_states: ScrollStatesStates of scrolling animations, updated every frame
timers: BTreeMap<TimerId, Timer>Timer ID -> Timer + Win32 pointer map (created using SetTimer)
threads: BTreeMap<ThreadId, Thread>List of threads running in the background
Implementations§
Source§impl WindowInternal
impl WindowInternal
pub fn get_dpi_scale_factor(&self) -> DpiScaleFactor
Source§impl WindowInternal
impl WindowInternal
Sourcepub fn new<F>(
init: WindowInternalInit,
data: &mut RefAny,
image_cache: &ImageCache,
gl_context: &OptionGlContextPtr,
all_resource_updates: &mut Vec<ResourceUpdate>,
callbacks: &RenderCallbacks,
fc_cache_real: &mut FcFontCache,
relayout_fn: RelayoutFn,
hit_test_func: F,
) -> Self
pub fn new<F>( init: WindowInternalInit, data: &mut RefAny, image_cache: &ImageCache, gl_context: &OptionGlContextPtr, all_resource_updates: &mut Vec<ResourceUpdate>, callbacks: &RenderCallbacks, fc_cache_real: &mut FcFontCache, relayout_fn: RelayoutFn, hit_test_func: F, ) -> Self
Initializes the WindowInternal on window creation. Calls the layout() method once to
initializes the layout
Sourcepub fn regenerate_styled_dom<F>(
&mut self,
data: &mut RefAny,
image_cache: &ImageCache,
gl_context: &OptionGlContextPtr,
all_resource_updates: &mut Vec<ResourceUpdate>,
current_window_dpi: DpiScaleFactor,
callbacks: &RenderCallbacks,
fc_cache_real: &mut FcFontCache,
relayout_fn: RelayoutFn,
hit_test_func: F,
)
pub fn regenerate_styled_dom<F>( &mut self, data: &mut RefAny, image_cache: &ImageCache, gl_context: &OptionGlContextPtr, all_resource_updates: &mut Vec<ResourceUpdate>, current_window_dpi: DpiScaleFactor, callbacks: &RenderCallbacks, fc_cache_real: &mut FcFontCache, relayout_fn: RelayoutFn, hit_test_func: F, )
Calls the layout function again and updates the self.internal.gl_texture_cache field
Sourcepub fn get_current_scroll_states(
&self,
) -> BTreeMap<DomId, BTreeMap<NodeHierarchyItemId, ScrollPosition>>
pub fn get_current_scroll_states( &self, ) -> BTreeMap<DomId, BTreeMap<NodeHierarchyItemId, ScrollPosition>>
Returns a copy of the current scroll states + scroll positions
Sourcepub fn get_content_size(&self) -> LogicalSize
pub fn get_content_size(&self) -> LogicalSize
Returns the overflowing size of the root body node. If WindowCreateOptions.size_to_content is set, the window size should be adjusted to this size before the window is shown.
Sourcepub fn do_quick_resize(
&mut self,
image_cache: &ImageCache,
callbacks: &RenderCallbacks,
relayout_fn: RelayoutFn,
fc_cache: &FcFontCache,
gl_context: &OptionGlContextPtr,
window_size: &WindowSize,
window_theme: WindowTheme,
) -> QuickResizeResult
pub fn do_quick_resize( &mut self, image_cache: &ImageCache, callbacks: &RenderCallbacks, relayout_fn: RelayoutFn, fc_cache: &FcFontCache, gl_context: &OptionGlContextPtr, window_size: &WindowSize, window_theme: WindowTheme, ) -> QuickResizeResult
Does a full re-layout (without calling layout()) again: called in simple resize() scenarios
Sourcepub fn may_have_changed_monitor(&self) -> bool
pub fn may_have_changed_monitor(&self) -> bool
Returns whether the size or position of the window changed (if true, the caller needs to update the monitor field), since the window may have moved to a different monitor
pub fn get_layout_size(&self) -> LayoutSize
Returns the menu bar set on the LayoutResults[0] node 0 or None
Returns the current context menu on the nearest hit node or None if no context menu was found
Sourcepub fn run_single_timer(
&mut self,
timer_id: usize,
frame_start: Instant,
current_window_handle: &RawWindowHandle,
gl_context: &OptionGlContextPtr,
image_cache: &mut ImageCache,
system_fonts: &mut FcFontCache,
system_callbacks: &ExternalSystemCallbacks,
) -> CallCallbacksResult
pub fn run_single_timer( &mut self, timer_id: usize, frame_start: Instant, current_window_handle: &RawWindowHandle, gl_context: &OptionGlContextPtr, image_cache: &mut ImageCache, system_fonts: &mut FcFontCache, system_callbacks: &ExternalSystemCallbacks, ) -> CallCallbacksResult
Runs a single timer, similar to CallbacksOfHitTest.call()
NOTE: The timer has to be selected first by the calling code and verified that it is ready to run
pub fn run_all_threads( &mut self, data: &mut RefAny, current_window_handle: &RawWindowHandle, gl_context: &OptionGlContextPtr, image_cache: &mut ImageCache, system_fonts: &mut FcFontCache, system_callbacks: &ExternalSystemCallbacks, ) -> CallCallbacksResult
pub fn invoke_single_callback( &mut self, callback: &mut Callback, data: &mut RefAny, current_window_handle: &RawWindowHandle, gl_context: &OptionGlContextPtr, image_cache: &mut ImageCache, system_fonts: &mut FcFontCache, system_callbacks: &ExternalSystemCallbacks, ) -> CallCallbacksResult
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WindowInternal
impl RefUnwindSafe for WindowInternal
impl Send for WindowInternal
impl Sync for WindowInternal
impl Unpin for WindowInternal
impl UnwindSafe for WindowInternal
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
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 more