Trait i_slint_core::platform::Platform
source · [−]pub trait Platform {
fn create_window_adapter(&self) -> Rc<dyn WindowAdapter>;
fn run_event_loop(&self) { ... }
fn new_event_loop_proxy(&self) -> Option<Box<dyn EventLoopProxy>> { ... }
fn duration_since_start(&self) -> Duration { ... }
fn set_clipboard_text(&self, _text: &str) { ... }
fn clipboard_text(&self) -> Option<String> { ... }
fn debug_log(&self, _arguments: Arguments<'_>) { ... }
}Expand description
This trait defines the interface between Slint and platform APIs typically provided by operating and windowing systems.
Required Methods
sourcefn create_window_adapter(&self) -> Rc<dyn WindowAdapter>
fn create_window_adapter(&self) -> Rc<dyn WindowAdapter>
Instantiate a window for a component.
Provided Methods
sourcefn run_event_loop(&self)
fn run_event_loop(&self)
Spins an event loop and renders the visible windows.
sourcefn new_event_loop_proxy(&self) -> Option<Box<dyn EventLoopProxy>>
fn new_event_loop_proxy(&self) -> Option<Box<dyn EventLoopProxy>>
Return an EventLoopProxy that can be used to send event to the event loop
If this function returns None (the default implementation), then it will
not be possible to send event to the event loop and the function
slint::invoke_from_event_loop() and
slint::quit_event_loop() will panic
sourcefn duration_since_start(&self) -> Duration
fn duration_since_start(&self) -> Duration
Returns the current time as a monotonic duration since the start of the program
This is used by the animations and timer to compute the elapsed time.
When the std feature is enabled, this function is implemented in terms of
std::time::Instant::now(), but on #![no_std] platform, this function must
be implemented.
sourcefn set_clipboard_text(&self, _text: &str)
fn set_clipboard_text(&self, _text: &str)
Sends the given text into the system clipboard
sourcefn clipboard_text(&self) -> Option<String>
fn clipboard_text(&self) -> Option<String>
Returns a copy of text stored in the system clipboard, if any.