#[macro_export]
macro_rules! actions {
($namespace:path, [ $( $(#[$attr:meta])* $name:ident),* $(,)? ]) => {
$(
#[derive(
::std::clone::Clone,
::std::cmp::PartialEq,
::std::default::Default,
::std::fmt::Debug,
$crate::Action
)]
#[action(namespace = $namespace)]
$(#[$attr])*
pub struct $name;
)*
};
([ $( $(#[$attr:meta])* $name:ident),* $(,)? ]) => {
$(
#[derive(
::std::clone::Clone,
::std::cmp::PartialEq,
::std::default::Default,
::std::fmt::Debug,
$crate::Action
)]
$(#[$attr])*
pub struct $name;
)*
};
}
// Public facade decision — 2026-09-08:
#[cfg(not(feature = "gpui-fast"))]
pub use ::gpui::*;
#[cfg(feature = "gpui-fast")]
pub use ::gpui_fast::*;
#[cfg(all(feature = "gpui-fast", any(feature = "inspector", debug_assertions)))]
pub use gpui_macros::derive_inspector_reflection;
#[cfg(feature = "gpui-fast")]
pub use gpui_macros::{
Action, AppContext, IntoElement, Render, VisualContext, bench, border_style_methods,
box_shadow_style_methods, cursor_style_methods, margin_style_methods, overflow_style_methods,
padding_style_methods, position_style_methods, property_test, register_action, style_helpers,
test, visibility_style_methods,
};
#[doc(hidden)]
pub use crate as gpui;
#[doc(hidden)]
pub const GPUI_FAST: bool = cfg!(feature = "gpui-fast");
#[cfg(feature = "test-support")]
pub mod test;
pub use ::gpui_base as base;
#[cfg(all(
not(any(target_os = "ios", target_os = "android")),
feature = "gpui-fast"
))]
pub use ::gpui_fast_platform as platform;
#[cfg(all(target_family = "wasm", feature = "gpui-fast"))]
pub use ::gpui_fast_web as web;
#[cfg(all(
not(any(target_os = "ios", target_os = "android")),
not(feature = "gpui-fast")
))]
pub use ::gpui_platform as platform;
#[cfg(all(target_family = "wasm", not(feature = "gpui-fast")))]
pub use ::gpui_web as web;
pub use gpui_base::is_mobile;
#[cfg(feature = "component")]
pub use ::gpui_component as component;
#[cfg(feature = "assets")]
pub use ::gpui_kit_assets as assets;
pub fn open_window<V: Render>(
options: WindowOptions,
cx: &mut App,
build: impl FnOnce(&mut Window, &mut App) -> Entity<V>,
) -> Result<(AnyWindowHandle, Entity<V>)> {
let mut built = None;
let window = cx.open_window(options, |window, cx| {
let view = build(window, cx);
built = Some(view.clone());
cx.new(|cx| base::Root::new(view, window, cx))
})?;
Ok((
window.into(),
built.expect("open_window ran its build closure"),
))
}
#[cfg(not(any(target_os = "ios", target_os = "android")))]
pub use platform::application;
pub fn init(cx: &mut App) {
#[cfg(feature = "component")]
gpui_component::init(cx);
#[cfg(not(feature = "component"))]
gpui_base::init(cx);
}
pub use gpui_base::TestSupportExt;