logo
pub trait Backend: Send + Sync {
    fn create_window(&'static self) -> Rc<Window>;
    fn run_event_loop(&'static self, behavior: EventLoopQuitBehavior);
    fn quit_event_loop(&'static self);
    fn register_font_from_memory(
        &'static self,
        data: &'static [u8]
    ) -> Result<(), Box<dyn Error>>; fn register_font_from_path(
        &'static self,
        path: &Path
    ) -> Result<(), Box<dyn Error>>; fn set_clipboard_text(&'static self, text: String); fn clipboard_text(&'static self) -> Option<String>; fn post_event(&'static self, event: Box<dyn FnOnce() + Send>); fn image_size(&'static self, image: &Image) -> IntSize; fn register_bitmap_font(&'static self, _font_data: &'static BitmapFont) { ... } fn duration_since_start(&'static self) -> Duration { ... } }
Expand description

Interface implemented by back-ends

Required Methods

Instantiate a window for a component. FIXME: should return a Box

Spins an event loop and renders the visible windows.

Exits the event loop.

This function can be used to register a custom TrueType font with Slint, for use with the font-family property. The provided slice must be a valid TrueType font.

This function can be used to register a custom TrueType font with Slint, for use with the font-family property. The provided path must refer to a valid TrueType font.

Send an user event to from another thread that should be run in the GUI event loop

Provided Methods

Implementors