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 = ["http_client", "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]
70screen-capture = [
71 "scap",
72]
73windows-manifest = []
74enable-renderdoc = []
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 = { optional = true, 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_derive.workspace = true
118serde_json.workspace = true
119slotmap = "1.0.6"
120smallvec.workspace = true
121smol.workspace = true
122strum.workspace = true
123sum_tree.workspace = true
124taffy = "0.4.3"
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
133renderdoc = "0.12.1"
134
135[target.'cfg(target_os = "macos")'.dependencies]
136block = "0.1"
137cocoa.workspace = true
138core-foundation.workspace = true
139core-foundation-sys.workspace = true
140core-graphics = "0.24"
141core-video.workspace = true
142core-text = "21"
143font-kit = { git = "https://github.com/zed-industries/font-kit", rev = "5474cfad4b719a72ec8ed2cb7327b2b01fd10568", optional = true }
144foreign-types = "0.5"
145log.workspace = true
146media.workspace = true
147objc.workspace = true
148objc2 = { version = "0.6", optional = true }
149objc2-metal = { version = "0.3", optional = true }
150#TODO: replace with "objc2"
151metal.workspace = true
152
153[target.'cfg(any(target_os = "linux", target_os = "freebsd", target_os = "macos"))'.dependencies]
154pathfinder_geometry = "0.5"
155
156[target.'cfg(any(target_os = "linux", target_os = "freebsd", target_os = "windows"))'.dependencies]
157scap = { workspace = true, optional = true }
158
159[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies]
160# Always used
161flume = "0.11"
162oo7 = { version = "0.4.0", default-features = false, features = [
163 "async-std",
164 "native_crypto",
165] }
166
167# Used in both windowing options
168ashpd = { workspace = true, optional = true }
169blade-graphics = { workspace = true, optional = true }
170blade-macros = { workspace = true, optional = true }
171blade-util = { workspace = true, optional = true }
172bytemuck = { version = "1", optional = true }
173cosmic-text = { version = "0.14.0", optional = true }
174font-kit = { git = "https://github.com/zed-industries/font-kit", rev = "5474cfad4b719a72ec8ed2cb7327b2b01fd10568", features = [
175 "source-fontconfig-dlopen",
176], optional = true }
177
178calloop = { version = "0.13.0" }
179filedescriptor = { version = "0.8.2", optional = true }
180open = { version = "5.2.0", optional = true }
181
182# Wayland
183calloop-wayland-source = { version = "0.3.0", optional = true }
184wayland-backend = { version = "0.3.3", features = [
185 "client_system",
186 "dlopen",
187], optional = true }
188wayland-client = { version = "0.31.2", optional = true }
189wayland-cursor = { version = "0.31.1", optional = true }
190wayland-protocols = { version = "0.31.2", features = [
191 "client",
192 "staging",
193 "unstable",
194], optional = true }
195wayland-protocols-plasma = { version = "0.2.0", features = [
196 "client",
197], optional = true }
198
199# X11
200as-raw-xcb-connection = { version = "1", optional = true }
201x11rb = { version = "0.13.1", features = [
202 "allow-unsafe-code",
203 "xkb",
204 "randr",
205 "xinput",
206 "cursor",
207 "resource_manager",
208 "sync",
209], optional = true }
210xkbcommon = { version = "0.8.0", features = [
211 "wayland",
212 "x11",
213], optional = true }
214xim = { git = "https://github.com/XDeme1/xim-rs", rev = "d50d461764c2213655cd9cf65a0ea94c70d3c4fd", features = [
215 "x11rb-xcb",
216 "x11rb-client",
217], optional = true }
218x11-clipboard = { version = "0.9.3", optional = true }
219
220[target.'cfg(target_os = "windows")'.dependencies]
221blade-util.workspace = true
222bytemuck = "1"
223blade-graphics.workspace = true
224blade-macros.workspace = true
225flume = "0.11"
226rand.workspace = true
227windows.workspace = true
228windows-core.workspace = true
229windows-numerics = "0.2"
230windows-registry = "0.5"
231
232[dev-dependencies]
233backtrace = "0.3"
234collections = { workspace = true, features = ["test-support"] }
235env_logger.workspace = true
236http_client = { workspace = true, features = ["test-support"] }
237lyon = { version = "1.0", features = ["extra"] }
238rand.workspace = true
239unicode-segmentation.workspace = true
240reqwest_client = { workspace = true, features = ["test-support"] }
241util = { workspace = true, features = ["test-support"] }
242
243[target.'cfg(target_os = "windows")'.build-dependencies]
244embed-resource = "3.0"
245naga.workspace = true
246
247[target.'cfg(target_os = "macos")'.build-dependencies]
248bindgen = "0.71"
249cbindgen = { version = "0.28.0", default-features = false }
250naga.workspace = true
251
252[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.build-dependencies]
253naga.workspace = true
254
255
256[[example]]
257name = "hello_world"
258path = "examples/hello_world.rs"
259
260[[example]]
261name = "image"
262path = "examples/image/image.rs"
263
264[[example]]
265name = "input"
266path = "examples/input.rs"
267
268[[example]]
269name = "on_window_close_quit"
270path = "examples/on_window_close_quit.rs"
271
272[[example]]
273name = "opacity"
274path = "examples/opacity.rs"
275
276[[example]]
277name = "pattern"
278path = "examples/pattern.rs"
279
280[[example]]
281name = "set_menus"
282path = "examples/set_menus.rs"
283
284[[example]]
285name = "shadow"
286path = "examples/shadow.rs"
287
288[[example]]
289name = "svg"
290path = "examples/svg/svg.rs"
291
292[[example]]
293name = "text"
294path = "examples/text.rs"
295
296[[example]]
297name = "text_wrapper"
298path = "examples/text_wrapper.rs"
299
300[[example]]
301name = "uniform_list"
302path = "examples/uniform_list.rs"
303
304[[example]]
305name = "window_shadow"
306path = "examples/window_shadow.rs"