Extract a platform::Lifecycle trait

This will allow us to make platform::Platform be Send + Sync and keep the lifecycle on the main thread.
This commit is contained in:
Nathan Sobo
2021-06-07 17:02:24 -06:00
parent 748c101076
commit 14b519f78d
5 changed files with 161 additions and 129 deletions
+6 -2
View File
@@ -11,11 +11,15 @@ mod window;
use cocoa::base::{BOOL, NO, YES};
pub use dispatcher::Dispatcher;
pub use fonts::FontSystem;
use platform::MacPlatform;
use platform::{MacLifecycle, MacPlatform};
use std::rc::Rc;
use window::Window;
pub fn platform() -> Rc<dyn super::Platform> {
pub(crate) fn lifecycle() -> Rc<dyn super::Lifecycle> {
Rc::new(MacLifecycle::default())
}
pub(crate) fn platform() -> Rc<dyn super::Platform> {
Rc::new(MacPlatform::new())
}