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
fn create_window(&'static self) -> Rc<Window>
fn create_window(&'static self) -> Rc<Window>
Instantiate a window for a component.
FIXME: should return a Box
fn run_event_loop(&'static self, behavior: EventLoopQuitBehavior)
fn run_event_loop(&'static self, behavior: EventLoopQuitBehavior)
Spins an event loop and renders the visible windows.
fn quit_event_loop(&'static self)
fn quit_event_loop(&'static self)
Exits the event loop.
fn register_font_from_memory(
&'static self,
data: &'static [u8]
) -> Result<(), Box<dyn Error>>
fn register_font_from_memory(
&'static self,
data: &'static [u8]
) -> Result<(), Box<dyn Error>>
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.
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 post_event(&'static self, event: Box<dyn FnOnce() + Send>)
Send an user event to from another thread that should be run in the GUI event loop