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