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 "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 = { 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.8.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]
221flume = "0.11"
222rand.workspace = true
223windows.workspace = true
224windows-core.workspace = true
225windows-numerics = "0.2"
226windows-registry = "0.5"
227
228[dev-dependencies]
229backtrace = "0.3"
230collections = { workspace = true, features = ["test-support"] }
231env_logger.workspace = true
232http_client = { workspace = true, features = ["test-support"] }
233lyon = { version = "1.0", features = ["extra"] }
234rand.workspace = true
235unicode-segmentation.workspace = true
236reqwest_client = { workspace = true, features = ["test-support"] }
237util = { workspace = true, features = ["test-support"] }
238
239[target.'cfg(target_os = "windows")'.build-dependencies]
240embed-resource = "3.0"
241
242[target.'cfg(target_os = "macos")'.build-dependencies]
243bindgen = "0.71"
244cbindgen = { version = "0.28.0", default-features = false }
245naga.workspace = true
246
247[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.build-dependencies]
248naga.workspace = true
249
250
251[[example]]
252name = "hello_world"
253path = "examples/hello_world.rs"
254
255[[example]]
256name = "image"
257path = "examples/image/image.rs"
258
259[[example]]
260name = "input"
261path = "examples/input.rs"
262
263[[example]]
264name = "on_window_close_quit"
265path = "examples/on_window_close_quit.rs"
266
267[[example]]
268name = "opacity"
269path = "examples/opacity.rs"
270
271[[example]]
272name = "pattern"
273path = "examples/pattern.rs"
274
275[[example]]
276name = "set_menus"
277path = "examples/set_menus.rs"
278
279[[example]]
280name = "shadow"
281path = "examples/shadow.rs"
282
283[[example]]
284name = "svg"
285path = "examples/svg/svg.rs"
286
287[[example]]
288name = "tab_stop"
289path = "examples/tab_stop.rs"
290
291[[example]]
292name = "text"
293path = "examples/text.rs"
294
295[[example]]
296name = "text_wrapper"
297path = "examples/text_wrapper.rs"
298
299[[example]]
300name = "tree"
301path = "examples/tree.rs"
302
303[[example]]
304name = "uniform_list"
305path = "examples/uniform_list.rs"
306
307[[example]]
308name = "window_shadow"
309path = "examples/window_shadow.rs"