1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
//! GPUI Kit: one dependency for building desktop applications with GPUI.
//!
//! GPUI itself is published as a family of `gpui-pre-*` crates that move
//! together. This crate depends on the matching set for you, so an
//! application lists `gpui-kit` alone. `use gpui_kit::*;` is GPUI, and each
//! layer is reachable by name:
//!
//! | Path | Crate | Feature |
//! | --------------- | ----------------- | ---------------- |
//! | `gpui_kit::*` | `gpui` | always |
//! | [`platform`] | `gpui_platform` | always |
//! | [`base`] | `gpui-base` | always |
//! | [`component`] | `gpui-component` | `component` (on) |
//! | [`assets`] | `gpui-kit-assets` | `assets` (on) |
//!
//! [`application`] opens the platform and [`init`] initializes the enabled
//! layers:
//!
//! ```no_run
//! use gpui_kit::*;
//!
//! actions!(hello, [Quit]);
//!
//! struct Hello;
//!
//! impl Render for Hello {
//! fn render(&mut self, _: &mut Window, _: &mut Context<Self>) -> impl IntoElement {
//! div().child("Hello, World!")
//! }
//! }
//!
//! fn main() {
//! gpui_kit::application().run(|cx| {
//! gpui_kit::init(cx);
//! cx.spawn(async move |cx| {
//! cx.open_window(WindowOptions::default(), |_, cx| cx.new(|_| Hello))
//! .expect("failed to open window");
//! })
//! .detach();
//! });
//! }
//! ```
//!
//! See [`component`] for the same program with the styled component library.
/// Defines unit actions without requiring consumers to depend on GPUI under the
/// crate name `gpui`.
///
/// GPUI's original macro spells its derive as `gpui::Action`, which does not
/// resolve when GPUI is consumed solely through this facade.
;
=>