Trait sixtyfps_corelib::backend::Backend[][src]

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) -> Size; }
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 SixtyFPS, 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 SixtyFPS, 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

Implementors