use std::sync::Weak;
mod background_thread;
#[cfg(all(target_family = "unix", not(target_os = "macos")))]
mod linux;
#[cfg(target_os = "macos")]
mod macos;
#[cfg(target_os = "windows")]
mod windows;
pub(crate) use self::background_thread::BackgroundThread;
#[cfg_attr(not(feature = "vst3"), allow(unused_imports))]
#[cfg(all(target_family = "unix", not(target_os = "macos")))]
pub(crate) use self::linux::LinuxEventLoop as OsEventLoop;
#[cfg_attr(not(feature = "vst3"), allow(unused_imports))]
#[cfg(target_os = "macos")]
pub(crate) use self::macos::MacOSEventLoop as OsEventLoop;
#[cfg_attr(not(feature = "vst3"), allow(unused_imports))]
#[cfg(target_os = "windows")]
pub(crate) use self::windows::WindowsEventLoop as OsEventLoop;
pub(crate) const TASK_QUEUE_CAPACITY: usize = 4096;
pub(crate) trait EventLoop<T, E>
where
T: Send + 'static,
E: MainThreadExecutor<T> + 'static,
{
#[allow(unused)]
fn new_and_spawn(executor: Weak<E>) -> Self;
#[must_use]
fn schedule_gui(&self, task: T) -> bool;
#[must_use]
fn schedule_background(&self, task: T) -> bool;
fn is_main_thread(&self) -> bool;
}
pub(crate) trait MainThreadExecutor<T>: Send + Sync {
fn execute(&self, task: T, is_gui_thread: bool);
}