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