Trait sixtyfps_corelib::window::PlatformWindow [−][src]
pub trait PlatformWindow {}Show methods
fn show(self: Rc<Self>); fn hide(self: Rc<Self>); fn request_redraw(&self); fn scale_factor(&self) -> f32; fn set_scale_factor(&self, factor: f32); fn free_graphics_resources<'a>(
self: Rc<Self>,
items: &Slice<'a, Pin<ItemRef<'a>>>
); fn show_popup(&self, popup: &ComponentRc, position: Point); fn close_popup(&self); fn request_window_properties_update(&self); fn apply_window_properties(&self, window_item: Pin<&Window>); fn font_metrics(
&self,
item_graphics_cache: &CachedRenderingData,
unresolved_font_request_getter: &dyn Fn() -> FontRequest,
reference_text: Pin<&Property<SharedString>>
) -> Option<Box<dyn FontMetrics>>; fn image_size(&self, source: Pin<&Property<ImageReference>>) -> Size; fn as_any(&self) -> &dyn Any;
This trait represents the interface that the generated code and the run-time require in order to implement functionality such as device-independent pixels, window resizing and other typicaly windowing system related tasks.
Required methods
fn show(self: Rc<Self>)
[src]
Registers the window with the windowing system.
fn hide(self: Rc<Self>)
[src]
Deregisters the window from the windowing system.
fn request_redraw(&self)
[src]
Issue a request to the windowing system to re-render the contents of the window. This is typically an asynchronous request.
fn scale_factor(&self) -> f32
[src]
Returns the scale factor set on the window, as provided by the windowing system.
fn set_scale_factor(&self, factor: f32)
[src]
Sets an overriding scale factor for the window. This is typically only used for testing.
fn free_graphics_resources<'a>(
self: Rc<Self>,
items: &Slice<'a, Pin<ItemRef<'a>>>
)
[src]
self: Rc<Self>,
items: &Slice<'a, Pin<ItemRef<'a>>>
)
This function is called by the generated code when a component and therefore its tree of items are destroyed. The
implementation typically uses this to free the underlying graphics resources cached via crate::graphics::RenderingCache
.
fn show_popup(&self, popup: &ComponentRc, position: Point)
[src]
Show a popup at the given position
fn close_popup(&self)
[src]
Close the active popup if any
fn request_window_properties_update(&self)
[src]
Request for the event loop to wake up and call Window::update_window_properties()
.
fn apply_window_properties(&self, window_item: Pin<&Window>)
[src]
Request for the given title string to be set to the windowing system for use as window title.
fn font_metrics(
&self,
item_graphics_cache: &CachedRenderingData,
unresolved_font_request_getter: &dyn Fn() -> FontRequest,
reference_text: Pin<&Property<SharedString>>
) -> Option<Box<dyn FontMetrics>>
[src]
&self,
item_graphics_cache: &CachedRenderingData,
unresolved_font_request_getter: &dyn Fn() -> FontRequest,
reference_text: Pin<&Property<SharedString>>
) -> Option<Box<dyn FontMetrics>>
Return a font metrics trait object for the given font request. This is typically provided by the backend and requested by text related items in order to measure text metrics with the item’s chosen font. Note that if the FontRequest’s pixel_size is 0, it is interpreted as the undefined size and that the system default font size should be used for the returned font. With some backends this may return none unless the window is mapped.
fn image_size(&self, source: Pin<&Property<ImageReference>>) -> Size
[src]
Return the size of the image referenced by the specified resource, multiplied by the window scale factor.
fn as_any(&self) -> &dyn Any
[src]
Return self as any so the backend can upcast