1[package]
2name = "gpui"
3version = "0.1.0"
4edition.workspace = true
5authors = ["Nathan Sobo <nathan@zed.dev>"]
6description = "Zed's GPU-accelerated UI framework"
7repository = "https://github.com/zed-industries/zed"
8publish.workspace = true
9license = "Apache-2.0"
10
11[lints]
12workspace = true
13
14[features]
15default = ["font-kit", "wayland", "x11", "windows-manifest"]
16test-support = [
17 "leak-detection",
18 "collections/test-support",
19 "rand",
20 "util/test-support",
21 "http_client/test-support",
22 "wayland",
23 "x11",
24]
25inspector = ["gpui_macros/inspector"]
26leak-detection = ["backtrace"]
27runtime_shaders = []
28macos-blade = [
29 "blade-graphics",
30 "blade-macros",
31 "blade-util",
32 "bytemuck",
33 "objc2",
34 "objc2-metal",
35]
36wayland = [
37 "blade-graphics",
38 "blade-macros",
39 "blade-util",
40 "bytemuck",
41 "ashpd",
42 "cosmic-text",
43 "font-kit",
44 "calloop-wayland-source",
45 "wayland-backend",
46 "wayland-client",
47 "wayland-cursor",
48 "wayland-protocols",
49 "wayland-protocols-plasma",
50 "filedescriptor",
51 "xkbcommon",
52 "open",
53]
54x11 = [
55 "blade-graphics",
56 "blade-macros",
57 "blade-util",
58 "bytemuck",
59 "ashpd",
60 "cosmic-text",
61 "font-kit",
62 "as-raw-xcb-connection",
63 "x11rb",
64 "xkbcommon",
65 "xim",
66 "x11-clipboard",
67 "filedescriptor",
68 "open",
69 "scap?/x11",
70]
71screen-capture = [
72 "scap",
73]
74windows-manifest = []
75
76[lib]
77path = "src/gpui.rs"
78doctest = false
79
80[dependencies]
81anyhow.workspace = true
82async-task = "4.7"
83backtrace = { version = "0.3", optional = true }
84blade-graphics = { workspace = true, optional = true }
85blade-macros = { workspace = true, optional = true }
86blade-util = { workspace = true, optional = true }
87bytemuck = { version = "1", optional = true }
88collections.workspace = true
89ctor.workspace = true
90derive_more.workspace = true
91etagere = "0.2"
92futures.workspace = true
93gpui_macros.workspace = true
94http_client.workspace = true
95image.workspace = true
96inventory.workspace = true
97itertools.workspace = true
98log.workspace = true
99num_cpus = "1.13"
100parking = "2.0.0"
101parking_lot.workspace = true
102postage.workspace = true
103profiling.workspace = true
104rand = { optional = true, workspace = true }
105raw-window-handle = "0.6"
106refineable.workspace = true
107resvg = { version = "0.45.0", default-features = false, features = [
108 "text",
109 "system-fonts",
110 "memmap-fonts",
111] }
112usvg = { version = "0.45.0", default-features = false }
113util_macros.workspace = true
114schemars.workspace = true
115seahash = "4.1"
116semantic_version.workspace = true
117serde.workspace = true
118serde_json.workspace = true
119slotmap.workspace = true
120smallvec.workspace = true
121smol.workspace = true
122stacksafe.workspace = true
123strum.workspace = true
124sum_tree.workspace = true
125taffy = "=0.9.0"
126thiserror.workspace = true
127util.workspace = true
128uuid.workspace = true
129waker-fn = "1.2.0"
130lyon = "1.0"
131workspace-hack.workspace = true
132libc.workspace = true
133
134[target.'cfg(target_os = "macos")'.dependencies]
135block = "0.1"
136cocoa.workspace = true
137core-foundation.workspace = true
138core-foundation-sys.workspace = true
139core-graphics = "0.24"
140core-video.workspace = true
141core-text = "21"
142font-kit = { git = "https://github.com/zed-industries/font-kit", rev = "5474cfad4b719a72ec8ed2cb7327b2b01fd10568", optional = true }
143foreign-types = "0.5"
144log.workspace = true
145media.workspace = true
146objc.workspace = true
147objc2 = { version = "0.6", optional = true }
148objc2-metal = { version = "0.3", optional = true }
149#TODO: replace with "objc2"
150metal.workspace = true
151
152[target.'cfg(any(target_os = "linux", target_os = "freebsd", target_os = "macos"))'.dependencies]
153pathfinder_geometry = "0.5"
154
155[target.'cfg(any(target_os = "linux", target_os = "freebsd", target_os = "windows"))'.dependencies]
156scap = { workspace = true, optional = true }
157
158[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies]
159# Always used
160flume = "0.11"
161oo7 = { version = "0.5.0", default-features = false, features = [
162 "async-std",
163 "native_crypto",
164] }
165
166# Used in both windowing options
167ashpd = { workspace = true, optional = true }
168blade-graphics = { workspace = true, optional = true }
169blade-macros = { workspace = true, optional = true }
170blade-util = { workspace = true, optional = true }
171bytemuck = { version = "1", optional = true }
172cosmic-text = { version = "0.14.0", optional = true }
173font-kit = { git = "https://github.com/zed-industries/font-kit", rev = "5474cfad4b719a72ec8ed2cb7327b2b01fd10568", features = [
174 "source-fontconfig-dlopen",
175], optional = true }
176
177calloop = { version = "0.13.0" }
178filedescriptor = { version = "0.8.2", optional = true }
179open = { version = "5.2.0", optional = true }
180
181# Wayland
182calloop-wayland-source = { version = "0.3.0", optional = true }
183wayland-backend = { version = "0.3.3", features = [
184 "client_system",
185 "dlopen",
186], optional = true }
187wayland-client = { version = "0.31.2", optional = true }
188wayland-cursor = { version = "0.31.1", optional = true }
189wayland-protocols = { version = "0.31.2", features = [
190 "client",
191 "staging",
192 "unstable",
193], optional = true }
194wayland-protocols-plasma = { version = "0.2.0", 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 }
209xkbcommon = { version = "0.8.0", features = [
210 "wayland",
211 "x11",
212], optional = true }
213xim = { git = "https://github.com/zed-industries/xim-rs", rev = "c0a70c1bd2ce197364216e5e818a2cb3adb99a8d" , features = [
214 "x11rb-xcb",
215 "x11rb-client",
216], optional = true }
217x11-clipboard = { version = "0.9.3", optional = true }
218
219[target.'cfg(target_os = "windows")'.dependencies]
220flume = "0.11"
221rand.workspace = true
222windows.workspace = true
223windows-core.workspace = true
224windows-numerics = "0.2"
225windows-registry = "0.5"
226
227[dev-dependencies]
228backtrace = "0.3"
229collections = { workspace = true, features = ["test-support"] }
230env_logger.workspace = true
231http_client = { workspace = true, features = ["test-support"] }
232lyon = { version = "1.0", features = ["extra"] }
233rand.workspace = true
234unicode-segmentation.workspace = true
235reqwest_client = { workspace = true, features = ["test-support"] }
236util = { workspace = true, features = ["test-support"] }
237
238[target.'cfg(target_os = "windows")'.build-dependencies]
239embed-resource = "3.0"
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"