mod dispatcher;
mod display_connection;
mod headless;
mod keyboard;
mod platform;
mod system_notifications;
#[cfg(any(feature = "wayland", feature = "x11"))]
mod text_system;
#[cfg(feature = "wayland")]
mod wayland;
#[cfg(feature = "x11")]
mod x11;
#[cfg(any(feature = "wayland", feature = "x11"))]
mod xdg_desktop_portal;
pub use dispatcher::*;
pub(crate) use display_connection::{Backend, DisplayConnection, select_backend};
pub(crate) use headless::*;
pub(crate) use keyboard::*;
pub(crate) use platform::*;
#[cfg(any(feature = "wayland", feature = "x11"))]
pub(crate) use text_system::*;
#[cfg(feature = "wayland")]
pub(crate) use wayland::*;
#[cfg(feature = "x11")]
pub(crate) use x11::*;
use std::rc::Rc;
use gpui::WindowingModes;
pub fn current_platform(headless: bool) -> Rc<dyn gpui::Platform> {
if headless || std::env::var_os("ZED_HEADLESS").is_some() {
linux_platform(WindowingModes::HEADLESS)
} else {
linux_platform(WindowingModes::all())
}
}
pub fn linux_platform(allowed_modes: WindowingModes) -> Rc<dyn gpui::Platform> {
Rc::new(LinuxPlatform::new(allowed_modes))
}