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