2022-09-14 09:47:43 +00:00
|
|
|
mod appearance;
|
2021-03-30 04:46:26 +00:00
|
|
|
mod atlas;
|
2022-08-30 17:05:33 +00:00
|
|
|
mod dispatcher;
|
2021-02-20 17:02:34 +00:00
|
|
|
mod event;
|
2021-03-24 15:51:28 +00:00
|
|
|
mod fonts;
|
2021-02-20 23:05:36 +00:00
|
|
|
mod geometry;
|
2021-09-14 16:11:59 +00:00
|
|
|
mod image_cache;
|
2021-04-09 19:03:26 +00:00
|
|
|
mod platform;
|
2021-03-20 15:38:36 +00:00
|
|
|
mod renderer;
|
2021-03-23 14:15:41 +00:00
|
|
|
mod sprite_cache;
|
2022-09-08 17:07:11 +00:00
|
|
|
mod status_item;
|
2021-02-20 23:05:36 +00:00
|
|
|
mod window;
|
|
|
|
|
|
|
|
use cocoa::base::{BOOL, NO, YES};
|
|
|
|
pub use dispatcher::Dispatcher;
|
2021-03-24 15:51:28 +00:00
|
|
|
pub use fonts::FontSystem;
|
2021-06-07 23:42:49 +00:00
|
|
|
use platform::{MacForegroundPlatform, MacPlatform};
|
2022-08-30 16:17:54 +00:00
|
|
|
pub use renderer::Surface;
|
2021-06-07 23:35:27 +00:00
|
|
|
use std::{rc::Rc, sync::Arc};
|
2021-02-20 23:05:36 +00:00
|
|
|
use window::Window;
|
|
|
|
|
2021-06-07 23:35:27 +00:00
|
|
|
pub(crate) fn platform() -> Arc<dyn super::Platform> {
|
|
|
|
Arc::new(MacPlatform::new())
|
2021-02-20 23:05:36 +00:00
|
|
|
}
|
2021-04-02 21:26:53 +00:00
|
|
|
|
2021-06-07 23:42:49 +00:00
|
|
|
pub(crate) fn foreground_platform() -> Rc<dyn super::ForegroundPlatform> {
|
|
|
|
Rc::new(MacForegroundPlatform::default())
|
|
|
|
}
|
|
|
|
|
2021-02-20 23:05:36 +00:00
|
|
|
trait BoolExt {
|
|
|
|
fn to_objc(self) -> BOOL;
|
|
|
|
}
|
2021-02-20 17:02:34 +00:00
|
|
|
|
2021-02-20 23:05:36 +00:00
|
|
|
impl BoolExt for bool {
|
|
|
|
fn to_objc(self) -> BOOL {
|
|
|
|
if self {
|
|
|
|
YES
|
|
|
|
} else {
|
|
|
|
NO
|
|
|
|
}
|
|
|
|
}
|
2021-02-20 17:02:34 +00:00
|
|
|
}
|