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