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 "dri3",
209], optional = true }
210# WARNING: If you change this, you must also publish a new version of zed-xim to crates.io
211xim = { git = "https://github.com/zed-industries/xim-rs.git", rev = "16f35a2c881b815a2b6cdfd6687988e84f8447d8" , features = [
212 "x11rb-xcb",
213 "x11rb-client",
214], package = "zed-xim", version = "0.4.0-zed", optional = true }
215x11-clipboard = { version = "0.9.3", optional = true }
216
217[target.'cfg(target_os = "windows")'.dependencies]
218rand.workspace = true
219windows.workspace = true
220windows-core.workspace = true
221windows-numerics = "0.2"
222windows-registry = "0.5"
223
224[dev-dependencies]
225backtrace.workspace = true
226collections = { workspace = true, features = ["test-support"] }
227env_logger.workspace = true
228http_client = { workspace = true, features = ["test-support"] }
229lyon = { version = "1.0", features = ["extra"] }
230pretty_assertions.workspace = true
231rand.workspace = true
232reqwest_client = { workspace = true, features = ["test-support"] }
233scheduler = { workspace = true, features = ["test-support"] }
234unicode-segmentation.workspace = true
235util = { workspace = true, features = ["test-support"] }
236
237[target.'cfg(target_os = "windows")'.build-dependencies]
238embed-resource = "3.0"
239windows-registry = "0.5"
240
241[target.'cfg(target_os = "macos")'.build-dependencies]
242bindgen = "0.71"
243cbindgen = { version = "0.28.0", default-features = false }
244naga.workspace = true
245
246[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.build-dependencies]
247naga.workspace = true
248
249
250[[example]]
251name = "hello_world"
252path = "examples/hello_world.rs"
253
254[[example]]
255name = "image"
256path = "examples/image/image.rs"
257
258[[example]]
259name = "input"
260path = "examples/input.rs"
261
262[[example]]
263name = "on_window_close_quit"
264path = "examples/on_window_close_quit.rs"
265
266[[example]]
267name = "opacity"
268path = "examples/opacity.rs"
269
270[[example]]
271name = "pattern"
272path = "examples/pattern.rs"
273
274[[example]]
275name = "set_menus"
276path = "examples/set_menus.rs"
277
278[[example]]
279name = "shadow"
280path = "examples/shadow.rs"
281
282[[example]]
283name = "svg"
284path = "examples/svg/svg.rs"
285
286[[example]]
287name = "tab_stop"
288path = "examples/tab_stop.rs"
289
290[[example]]
291name = "text"
292path = "examples/text.rs"
293
294[[example]]
295name = "text_wrapper"
296path = "examples/text_wrapper.rs"
297
298[[example]]
299name = "tree"
300path = "examples/tree.rs"
301
302[[example]]
303name = "uniform_list"
304path = "examples/uniform_list.rs"
305
306[[example]]
307name = "window_shadow"
308path = "examples/window_shadow.rs"
309
310[[example]]
311name = "grid_layout"
312path = "examples/grid_layout.rs"
313
314[[example]]
315name = "mouse_pressure"
316path = "examples/mouse_pressure.rs"