Skip to main content

gpui_platform/
gpui_platform.rs

1//! Abstract platform traits shared by `gpui` and its platform backends.
2//!
3//! This crate is the contract between the GPUI facade and the concrete
4//! platform implementations (`gpui_macos`, `gpui_linux`, `gpui_windows`,
5//! `gpui_web`). It depends only on `gpui_types` and other low-level leaf
6//! crates, never on `gpui`, so a backend can implement these traits without
7//! depending on the entire framework.
8//!
9//! The `gpui` crate re-exports everything here, so consumers keep using
10//! `gpui::PlatformKeyboardMapper` and friends.
11
12#![warn(missing_docs)]
13
14mod app;
15mod clipboard;
16mod cursor;
17mod dispatcher;
18mod display;
19mod executor;
20mod executor_runtime;
21mod gestures;
22mod gpu;
23mod input;
24mod input_handler;
25mod keyboard;
26#[cfg(all(target_os = "linux", feature = "wayland"))]
27pub mod layer_shell;
28mod menu;
29mod notification;
30mod platform;
31mod platform_renderer;
32mod platform_scheduler;
33mod platform_window;
34pub mod popup;
35pub mod profiler;
36mod prompt;
37#[cfg(any(
38    test,
39    target_os = "windows",
40    target_os = "linux",
41    target_family = "wasm",
42    feature = "test-support",
43    feature = "bench-support"
44))]
45#[expect(missing_docs)]
46pub mod queue;
47#[cfg(all(
48    feature = "screen-capture",
49    any(target_os = "windows", target_os = "linux", target_os = "freebsd",)
50))]
51pub mod scap_screen_capture;
52mod screen_capture;
53#[cfg(any(test, feature = "test-support"))]
54mod test_dispatcher;
55mod text_input;
56mod window;
57mod window_id;
58mod window_metrics;
59
60pub use app::*;
61pub use clipboard::*;
62pub use cursor::*;
63pub use dispatcher::*;
64pub use display::*;
65pub use executor::*;
66pub use executor_runtime::*;
67pub use gestures::*;
68pub use gpu::*;
69pub use gpui_shared_string::*;
70pub use gpui_types::*;
71pub use input::*;
72pub use input_handler::*;
73pub use keyboard::*;
74pub use menu::*;
75pub use notification::*;
76pub use platform::*;
77pub use platform_renderer::*;
78pub use platform_scheduler::*;
79pub use platform_window::*;
80pub use profiler::{
81    ForegroundRunnableCounter, foreground_runnable_counter, foreground_runnable_finished,
82};
83pub use prompt::*;
84#[cfg(any(
85    test,
86    target_os = "windows",
87    target_os = "linux",
88    target_family = "wasm",
89    feature = "test-support",
90    feature = "bench-support"
91))]
92pub use queue::*;
93pub use screen_capture::*;
94#[cfg(any(test, feature = "test-support"))]
95pub use test_dispatcher::*;
96pub use text_input::*;
97pub use window::*;
98pub use window_id::*;
99pub use window_metrics::*;