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