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 }
113schemars.workspace = true
114seahash = "4.1"
115semantic_version.workspace = true
116serde.workspace = true
117serde_json.workspace = true
118slotmap.workspace = true
119smallvec.workspace = true
120smol.workspace = true
121stacksafe.workspace = true
122strum.workspace = true
123sum_tree.workspace = true
124taffy = "=0.9.0"
125thiserror.workspace = true
126util.workspace = true
127uuid.workspace = true
128waker-fn = "1.2.0"
129lyon = "1.0"
130workspace-hack.workspace = true
131libc.workspace = true
132
133[target.'cfg(target_os = "macos")'.dependencies]
134block = "0.1"
135cocoa.workspace = true
136core-foundation.workspace = true
137core-foundation-sys.workspace = true
138core-graphics = "0.24"
139core-video.workspace = true
140core-text = "21"
141font-kit = { git = "https://github.com/zed-industries/font-kit", rev = "5474cfad4b719a72ec8ed2cb7327b2b01fd10568", optional = true }
142foreign-types = "0.5"
143log.workspace = true
144media.workspace = true
145objc.workspace = true
146objc2 = { version = "0.6", optional = true }
147objc2-metal = { version = "0.3", optional = 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
159flume = "0.11"
160oo7 = { version = "0.5.0", default-features = false, features = [
161 "async-std",
162 "native_crypto",
163] }
164
165# Used in both windowing options
166ashpd = { workspace = true, optional = true }
167blade-graphics = { workspace = true, optional = true }
168blade-macros = { workspace = true, optional = true }
169blade-util = { workspace = true, optional = true }
170bytemuck = { version = "1", optional = true }
171cosmic-text = { version = "0.14.0", optional = true }
172font-kit = { git = "https://github.com/zed-industries/font-kit", rev = "5474cfad4b719a72ec8ed2cb7327b2b01fd10568", features = [
173 "source-fontconfig-dlopen",
174], optional = true }
175
176calloop = { version = "0.13.0" }
177filedescriptor = { version = "0.8.2", optional = true }
178open = { version = "5.2.0", optional = true }
179
180# Wayland
181calloop-wayland-source = { version = "0.3.0", optional = true }
182wayland-backend = { version = "0.3.3", features = [
183 "client_system",
184 "dlopen",
185], optional = true }
186wayland-client = { version = "0.31.2", optional = true }
187wayland-cursor = { version = "0.31.1", optional = true }
188wayland-protocols = { version = "0.31.2", features = [
189 "client",
190 "staging",
191 "unstable",
192], optional = true }
193wayland-protocols-plasma = { version = "0.2.0", features = [
194 "client",
195], optional = true }
196
197# X11
198as-raw-xcb-connection = { version = "1", optional = true }
199x11rb = { version = "0.13.1", features = [
200 "allow-unsafe-code",
201 "xkb",
202 "randr",
203 "xinput",
204 "cursor",
205 "resource_manager",
206 "sync",
207], optional = true }
208xkbcommon = { version = "0.8.0", features = [
209 "wayland",
210 "x11",
211], optional = true }
212xim = { git = "https://github.com/zed-industries/xim-rs", rev = "c0a70c1bd2ce197364216e5e818a2cb3adb99a8d" , features = [
213 "x11rb-xcb",
214 "x11rb-client",
215], optional = true }
216x11-clipboard = { version = "0.9.3", optional = true }
217
218[target.'cfg(target_os = "windows")'.dependencies]
219flume = "0.11"
220rand.workspace = true
221windows.workspace = true
222windows-core.workspace = true
223windows-numerics = "0.2"
224windows-registry = "0.5"
225
226[dev-dependencies]
227backtrace = "0.3"
228collections = { workspace = true, features = ["test-support"] }
229env_logger.workspace = true
230http_client = { workspace = true, features = ["test-support"] }
231lyon = { version = "1.0", features = ["extra"] }
232rand.workspace = true
233unicode-segmentation.workspace = true
234reqwest_client = { workspace = true, features = ["test-support"] }
235util = { workspace = true, features = ["test-support"] }
236
237[target.'cfg(target_os = "windows")'.build-dependencies]
238embed-resource = "3.0"
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"