1[package]
2name = "gpui"
3version = "0.1.0"
4edition.workspace = true
5authors = ["Nathan Sobo <nathan@zed.dev>"]
6description = "Zed's GPU-accelerated UI framework"
7publish.workspace = true
8license = "Apache-2.0"
9
10[lints]
11workspace = true
12
13[features]
14default = ["http_client", "font-kit", "wayland", "x11"]
15test-support = [
16 "leak-detection",
17 "collections/test-support",
18 "rand",
19 "util/test-support",
20 "http_client?/test-support",
21 "wayland",
22 "x11",
23]
24leak-detection = ["backtrace"]
25runtime_shaders = []
26macos-blade = [
27 "blade-graphics",
28 "blade-macros",
29 "blade-util",
30 "bytemuck",
31 "objc2",
32 "objc2-metal",
33]
34wayland = [
35 "blade-graphics",
36 "blade-macros",
37 "blade-util",
38 "bytemuck",
39 "ashpd",
40 "cosmic-text",
41 "font-kit",
42 "calloop-wayland-source",
43 "wayland-backend",
44 "wayland-client",
45 "wayland-cursor",
46 "wayland-protocols",
47 "wayland-protocols-plasma",
48 "filedescriptor",
49 "xkbcommon",
50 "open",
51]
52x11 = [
53 "blade-graphics",
54 "blade-macros",
55 "blade-util",
56 "bytemuck",
57 "ashpd",
58 "cosmic-text",
59 "font-kit",
60 "as-raw-xcb-connection",
61 "x11rb",
62 "xkbcommon",
63 "xim",
64 "x11-clipboard",
65 "filedescriptor",
66 "open",
67]
68
69
70[lib]
71path = "src/gpui.rs"
72doctest = false
73
74[dependencies]
75anyhow.workspace = true
76async-task = "4.7"
77backtrace = { version = "0.3", optional = true }
78blade-graphics = { workspace = true, optional = true }
79blade-macros = { workspace = true, optional = true }
80blade-util = { workspace = true, optional = true }
81bytemuck = { version = "1", optional = true }
82collections.workspace = true
83ctor.workspace = true
84derive_more.workspace = true
85etagere = "0.2"
86futures.workspace = true
87gpui_macros.workspace = true
88http_client = { optional = true, workspace = true }
89image = "0.25.1"
90inventory.workspace = true
91itertools.workspace = true
92log.workspace = true
93num_cpus = "1.13"
94parking = "2.0.0"
95parking_lot.workspace = true
96postage.workspace = true
97profiling.workspace = true
98rand = { optional = true, workspace = true }
99raw-window-handle = "0.6"
100refineable.workspace = true
101resvg = { version = "0.44.0", default-features = false }
102usvg = { version = "0.44.0", default-features = false }
103schemars.workspace = true
104seahash = "4.1"
105semantic_version.workspace = true
106serde.workspace = true
107serde_derive.workspace = true
108serde_json.workspace = true
109slotmap = "1.0.6"
110smallvec.workspace = true
111smol.workspace = true
112strum.workspace = true
113sum_tree.workspace = true
114taffy = "0.4.3"
115thiserror.workspace = true
116util.workspace = true
117uuid.workspace = true
118waker-fn = "1.2.0"
119lyon = "1.0"
120
121[target.'cfg(target_os = "macos")'.dependencies]
122block = "0.1"
123cocoa.workspace = true
124core-foundation.workspace = true
125core-foundation-sys = "0.8"
126core-graphics = "0.23"
127core-text = "20.1"
128font-kit = { git = "https://github.com/zed-industries/font-kit", rev = "40391b7", optional = true }
129foreign-types = "0.5"
130log.workspace = true
131media.workspace = true
132objc = "0.2"
133objc2 = { version = "0.5", optional = true }
134objc2-metal = { version = "0.2", optional = true }
135#TODO: replace with "objc2"
136metal.workspace = true
137
138[target.'cfg(any(target_os = "linux", target_os = "freebsd", target_os = "macos"))'.dependencies]
139pathfinder_geometry = "0.5"
140
141[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies]
142# Always used
143flume = "0.11"
144oo7 = { version = "0.4.0", default-features = false, features = [
145 "async-std",
146 "native_crypto",
147] }
148
149# Used in both windowing options
150ashpd = { workspace = true, optional = true }
151blade-graphics = { workspace = true, optional = true }
152blade-macros = { workspace = true, optional = true }
153blade-util = { workspace = true, optional = true }
154bytemuck = { version = "1", optional = true }
155cosmic-text = { git = "https://github.com/pop-os/cosmic-text", rev = "542b20c", optional = true }
156font-kit = { git = "https://github.com/zed-industries/font-kit", rev = "40391b7", features = [
157 "source-fontconfig-dlopen",
158], optional = true }
159calloop = { version = "0.13.0" }
160filedescriptor = { version = "0.8.2", optional = true }
161open = { version = "5.2.0", optional = true }
162
163# Wayland
164calloop-wayland-source = { version = "0.3.0", optional = true }
165wayland-backend = { version = "0.3.3", features = [
166 "client_system",
167 "dlopen",
168], optional = true }
169wayland-client = { version = "0.31.2", optional = true }
170wayland-cursor = { version = "0.31.1", optional = true }
171wayland-protocols = { version = "0.31.2", features = [
172 "client",
173 "staging",
174 "unstable",
175], optional = true }
176wayland-protocols-plasma = { version = "0.2.0", features = [
177 "client",
178], optional = true }
179
180
181# X11
182as-raw-xcb-connection = { version = "1", optional = true }
183x11rb = { version = "0.13.1", features = [
184 "allow-unsafe-code",
185 "xkb",
186 "randr",
187 "xinput",
188 "cursor",
189 "resource_manager",
190 "sync",
191], optional = true }
192xkbcommon = { git = "https://github.com/ConradIrwin/xkbcommon-rs", rev = "fcbb4612185cc129ceeff51d22f7fb51810a03b2", features = [
193 "wayland",
194 "x11",
195], optional = true }
196xim = { git = "https://github.com/XDeme1/xim-rs", rev = "d50d461764c2213655cd9cf65a0ea94c70d3c4fd", features = [
197 "x11rb-xcb",
198 "x11rb-client",
199], optional = true }
200x11-clipboard = { version = "0.9.3", optional = true }
201
202[target.'cfg(windows)'.dependencies]
203blade-util.workspace = true
204bytemuck = "1"
205blade-graphics.workspace = true
206blade-macros.workspace = true
207flume = "0.11"
208rand.workspace = true
209windows.workspace = true
210windows-core = "0.58"
211
212[dev-dependencies]
213backtrace = "0.3"
214collections = { workspace = true, features = ["test-support"] }
215env_logger.workspace = true
216http_client = { workspace = true, features = ["test-support"] }
217lyon = { version = "1.0", features = ["extra"] }
218rand.workspace = true
219unicode-segmentation.workspace = true
220reqwest_client = { workspace = true, features = ["test-support"] }
221util = { workspace = true, features = ["test-support"] }
222
223[target.'cfg(target_os = "windows")'.build-dependencies]
224embed-resource = "3.0"
225naga.workspace = true
226
227[target.'cfg(target_os = "macos")'.build-dependencies]
228bindgen = "0.70.0"
229cbindgen = { version = "0.28.0", default-features = false }
230naga.workspace = true
231
232[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.build-dependencies]
233naga.workspace = true
234
235
236[[example]]
237name = "hello_world"
238path = "examples/hello_world.rs"
239
240[[example]]
241name = "image"
242path = "examples/image/image.rs"
243
244[[example]]
245name = "input"
246path = "examples/input.rs"
247
248[[example]]
249name = "opacity"
250path = "examples/opacity.rs"
251
252[[example]]
253name = "pattern"
254path = "examples/pattern.rs"
255
256[[example]]
257name = "set_menus"
258path = "examples/set_menus.rs"
259
260[[example]]
261name = "shadow"
262path = "examples/shadow.rs"
263
264[[example]]
265name = "svg"
266path = "examples/svg/svg.rs"
267
268[[example]]
269name = "text_wrapper"
270path = "examples/text_wrapper.rs"
271
272[[example]]
273name = "uniform_list"
274path = "examples/uniform_list.rs"
275
276[[example]]
277name = "window_shadow"
278path = "examples/window_shadow.rs"
279
280[[example]]
281name = "on_window_close_quit"
282path = "examples/on_window_close_quit.rs"