Get app running and test passing after gpui App+Platform restructure

This commit is contained in:
Max Brunsfeld
2021-04-09 16:56:32 -07:00
parent 4ecc17b1bb
commit 079050541f
17 changed files with 719 additions and 749 deletions
+1 -12
View File
@@ -22,24 +22,13 @@ use async_task::Runnable;
pub use event::Event;
use std::{ops::Range, path::PathBuf, rc::Rc, sync::Arc};
pub trait Runner {
fn on_finish_launching<F: 'static + FnOnce()>(self, callback: F) -> Self;
fn on_menu_command<F: 'static + FnMut(&str)>(self, callback: F) -> Self;
fn on_become_active<F: 'static + FnMut()>(self, callback: F) -> Self;
fn on_resign_active<F: 'static + FnMut()>(self, callback: F) -> Self;
fn on_event<F: 'static + FnMut(Event) -> bool>(self, callback: F) -> Self;
fn on_open_files<F: 'static + FnMut(Vec<PathBuf>)>(self, callback: F) -> Self;
fn set_menus(self, menus: &[Menu]) -> Self;
fn run(self);
}
pub trait Platform {
fn on_menu_command(&self, callback: Box<dyn FnMut(&str)>);
fn on_become_active(&self, callback: Box<dyn FnMut()>);
fn on_resign_active(&self, callback: Box<dyn FnMut()>);
fn on_event(&self, callback: Box<dyn FnMut(Event) -> bool>);
fn on_open_files(&self, callback: Box<dyn FnMut(Vec<PathBuf>)>);
fn run(&self, on_finish_launching: Box<dyn FnOnce() -> ()>);
fn on_finish_launching(&self, callback: Box<dyn FnOnce() -> ()>);
fn dispatcher(&self) -> Arc<dyn Dispatcher>;
fn fonts(&self) -> Arc<dyn FontSystem>;