bite-gpui-ce 0.20260928.0

A community fork of Zed's GPU-accelerated UI framework
#![doc = include_str!("../README.md")]
#![warn(missing_docs)]
#![allow(clippy::type_complexity)] // Not useful, GPUI makes heavy use of callbacks
#![allow(clippy::collapsible_else_if)] // False positives in platform specific code
#![allow(unused_mut)] // False positives in platform specific code

// Macros generated by `gpui_macros` name `gpui::` paths, so within this crate
// `gpui` is an alias for itself.
extern crate self as gpui;

// The bulk of GPUI — the reactive store, the windows and the element DSL — lives in
// `gpui_authoring`, and the value, scene and platform vocabulary lives in the leaf
// crates. Each module below is a shim re-exporting what it lost, so every `gpui::…` path
// and every dotted module path (`gpui::colors::…`, `gpui::profiler::…`) is unchanged; the
// trailing globs pick up the items the layers define at their own roots. The five modules
// the facade never published at all — `arena`, `key_dispatch`, `tab_stop`, `taffy` and
// `util`, which only contributed the root-level names re-exported from the authoring layer
// below — are left private in that layer, with no shim here.
#[macro_use]
mod action;
// `#[macro_export]` lifts these to the authoring layer's crate root rather than into its
// `action`/`elements::text` modules, so a glob cannot carry them.
pub use gpui_authoring::{actions, text};
mod animated;
mod app;

mod asset_cache;
mod assets;
/// The default colors used by GPUI.
pub mod colors;
#[cfg(feature = "profiler")]
mod debug_overlay;
mod element;
mod elements;
/// The `TaskExt` extension trait over the leaf's `Task`; the executors themselves live in
/// `gpui_platform`.
mod executor;
mod gestures;
mod global;
mod input;
mod inspector;
mod interactive;
mod keymap;
mod lerp;
mod motion;
mod path_builder;
mod platform;
pub mod prelude;
/// Profiling utilities for task, frame, and thread performance tracking.
pub mod profiler;
#[cfg(any(
    test,
    target_os = "windows",
    target_os = "linux",
    target_family = "wasm",
    feature = "test-support",
    feature = "bench-support"
))]
pub use gpui_platform::queue;
mod shared_uri;
mod spring;
mod style;
mod style_transitions;
mod styled;
mod subscription;
mod svg_renderer;
#[cfg(feature = "test-support")]
pub mod test;
mod text_system;
mod transition;
mod view;
mod window;

#[cfg(feature = "test-support")]
pub use proptest;

#[cfg(doc)]
pub mod _accessibility;
#[cfg(doc)]
pub mod _ownership_and_data_flow;

/// Do not touch, here be dragons for use by gpui_macros and such.
#[doc(hidden)]
pub use gpui_authoring::private;

pub use accesskit;
pub use accesskit::Action as AccessibleAction;
pub use accesskit::{Orientation, Role, Toggled};
pub use action::*;
pub use animated::*;
pub use anyhow::Result;
pub use app::*;
pub use asset_cache::*;
pub use assets::*;
pub use ctor::ctor;
#[cfg(feature = "profiler")]
pub use debug_overlay::*;
pub use element::*;
pub use elements::*;
pub use executor::*;
pub use gestures::*;
pub use global::*;
pub use gpui_macros::{IntoElement, Render, bench, property_test, register_action, test};
pub use spring::*;

/// Defines a Criterion benchmark group for benchmarks annotated with [`gpui::bench`].
///
/// This mirrors `criterion::criterion_group!` so GPUI benchmark files can keep the
/// same shape as ordinary Criterion benchmarks.
///
/// [`gpui::bench`]: crate::bench
#[macro_export]
macro_rules! bench_group {
    ($($tokens:tt)*) => {
        criterion::criterion_group!($($tokens)*);
    };
}

/// Defines the entry point for GPUI Criterion benchmark groups.
///
/// This mirrors `criterion::criterion_main!` so GPUI benchmark files can keep the
/// same shape as ordinary Criterion benchmarks.
#[macro_export]
macro_rules! bench_main {
    ($($tokens:tt)*) => {
        criterion::criterion_main!($($tokens)*);
    };
}
pub use gpui_ce_types::*;
pub use gpui_shared_string::*;
pub use gpui_types::*;

// `gpui_types` and `gpui_ce_types` both name `Shadow`: upstream's inset flag is a
// `u32`, this fork's is a `ShaderBool`. An explicit re-export shadows the globs,
// so the fork's own type is what `gpui` publishes.
pub use gpui_ce_types::Shadow;
pub use gpui_util::arc_cow::ArcCow;
/// HTTP client abstraction for making requests.
pub mod http_client;
pub use input::*;
pub use inspector::*;
pub use interactive::*;
pub use keymap::*;
pub use lerp::*;
pub use motion::*;
pub use path_builder::*;
pub use platform::*;
pub use profiler::*;
#[cfg(any(target_os = "windows", target_os = "linux", target_family = "wasm"))]
pub use queue::{PriorityQueueReceiver, PriorityQueueSender};
pub use refineable::*;
pub use shared_uri::*;
pub use style::*;
pub use style_transitions::*;
pub use styled::*;
pub use subscription::*;
pub use svg_renderer::*;
#[cfg(feature = "test-support")]
pub use test::*;
pub use text_system::*;
// Deliberately the last of the globs: the modules above re-export names it also carries, and a
// glob placed before them makes their re-exports look unused.
pub use gpui_engine::*;
// Placed after `gpui_engine` for the same reason: `gpui_platform` also re-exports the
// `gpui_types`/`gpui_shared_string` names the modules above carry.
pub use gpui_platform::*;
// The authoring layer carries the items its lib root defines — `AppContext`,
// `VisualContext`, `EventEmitter`, `BorrowAppContext`, `BoundsExt`, `GpuSpecs` — which no
// module shim above can re-export; everything else it defines is reachable through those
// shims. `AppContext` and `VisualContext` arrive with their `gpui_macros` derives attached,
// which is why they are not named in the derive re-export below.
pub use gpui_authoring::{
    AppContext, BorrowAppContext, BoundsExt, EventEmitter, FutureExt, GpuSpecs, LayoutId,
    Reservation, Timeout, VisualContext,
};
// The process harness: `Application`, how a host program builds and starts an app. It sits
// above the authoring layer (which owns everything an app *is* once running) and below this
// facade, which globs both.
pub use gpui_runtime::*;
pub use transition::*;
pub use view::*;
pub use window::*;

#[cfg(not(target_family = "wasm"))]
pub use pollster::block_on;