Add Linux platform, gate usage of CVImageBuffer by macOS

This commit is contained in:
Dzmitry Malyshau 2024-01-24 22:04:47 -08:00
parent ef4ef5f0e8
commit d675abf70c
7 changed files with 265 additions and 5 deletions

View file

@ -2,6 +2,8 @@ mod app_menu;
mod keystroke;
#[cfg(target_os = "macos")]
mod mac;
#[cfg(target_os = "linux")]
mod linux;
#[cfg(any(test, feature = "test-support"))]
mod test;
@ -35,6 +37,8 @@ pub use app_menu::*;
pub use keystroke::*;
#[cfg(target_os = "macos")]
pub(crate) use mac::*;
#[cfg(target_os = "linux")]
pub(crate) use linux::*;
#[cfg(any(test, feature = "test-support"))]
pub(crate) use test::*;
use time::UtcOffset;
@ -44,6 +48,10 @@ pub use util::SemanticVersion;
pub(crate) fn current_platform() -> Rc<dyn Platform> {
Rc::new(MacPlatform::new())
}
#[cfg(target_os = "linux")]
pub(crate) fn current_platform() -> Rc<dyn Platform> {
Rc::new(LinuxPlatform::new())
}
pub(crate) trait Platform: 'static {
fn background_executor(&self) -> BackgroundExecutor;