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 = []
74
75[lib]
76path = "src/gpui.rs"
77doctest = false
78
79[dependencies]
80anyhow.workspace = true
81async-task = "4.7"
82backtrace = { version = "0.3", optional = true }
83blade-graphics = { workspace = true, optional = true }
84blade-macros = { workspace = true, optional = true }
85blade-util = { workspace = true, optional = true }
86bytemuck = { version = "1", optional = true }
87collections.workspace = true
88ctor.workspace = true
89derive_more.workspace = true
90etagere = "0.2"
91futures.workspace = true
92gpui_macros.workspace = true
93http_client = { optional = true, workspace = true }
94image.workspace = true
95inventory.workspace = true
96itertools.workspace = true
97log.workspace = true
98num_cpus = "1.13"
99parking = "2.0.0"
100parking_lot.workspace = true
101postage.workspace = true
102profiling.workspace = true
103rand = { optional = true, workspace = true }
104raw-window-handle = "0.6"
105refineable.workspace = true
106resvg = { version = "0.45.0", default-features = false, features = [
107 "text",
108 "system-fonts",
109 "memmap-fonts",
110] }
111usvg = { version = "0.45.0", default-features = false }
112schemars.workspace = true
113seahash = "4.1"
114semantic_version.workspace = true
115serde.workspace = true
116serde_derive.workspace = true
117serde_json.workspace = true
118slotmap = "1.0.6"
119smallvec.workspace = true
120smol.workspace = true
121strum.workspace = true
122sum_tree.workspace = true
123taffy = "0.4.3"
124thiserror.workspace = true
125util.workspace = true
126uuid.workspace = true
127waker-fn = "1.2.0"
128lyon = "1.0"
129workspace-hack.workspace = true
130libc.workspace = true
131
132[target.'cfg(target_os = "macos")'.dependencies]
133block = "0.1"
134cocoa.workspace = true
135core-foundation.workspace = true
136core-foundation-sys.workspace = true
137core-graphics = "0.24"
138core-video.workspace = true
139core-text = "21"
140font-kit = { git = "https://github.com/zed-industries/font-kit", rev = "5474cfad4b719a72ec8ed2cb7327b2b01fd10568", optional = true }
141foreign-types = "0.5"
142log.workspace = true
143media.workspace = true
144objc.workspace = true
145objc2 = { version = "0.6", optional = true }
146objc2-metal = { version = "0.3", optional = true }
147#TODO: replace with "objc2"
148metal.workspace = true
149
150[target.'cfg(any(target_os = "linux", target_os = "freebsd", target_os = "macos"))'.dependencies]
151pathfinder_geometry = "0.5"
152
153[target.'cfg(any(target_os = "linux", target_os = "freebsd", target_os = "windows"))'.dependencies]
154scap = { workspace = true, optional = true }
155
156[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies]
157# Always used
158flume = "0.11"
159oo7 = { version = "0.4.0", default-features = false, features = [
160 "async-std",
161 "native_crypto",
162] }
163
164# Used in both windowing options
165ashpd = { workspace = true, optional = true }
166blade-graphics = { workspace = true, optional = true }
167blade-macros = { workspace = true, optional = true }
168blade-util = { workspace = true, optional = true }
169bytemuck = { version = "1", optional = true }
170cosmic-text = { version = "0.14.0", optional = true }
171font-kit = { git = "https://github.com/zed-industries/font-kit", rev = "5474cfad4b719a72ec8ed2cb7327b2b01fd10568", features = [
172 "source-fontconfig-dlopen",
173], optional = true }
174
175calloop = { version = "0.13.0" }
176filedescriptor = { version = "0.8.2", optional = true }
177open = { version = "5.2.0", optional = true }
178
179# Wayland
180calloop-wayland-source = { version = "0.3.0", optional = true }
181wayland-backend = { version = "0.3.3", features = [
182 "client_system",
183 "dlopen",
184], optional = true }
185wayland-client = { version = "0.31.2", optional = true }
186wayland-cursor = { version = "0.31.1", optional = true }
187wayland-protocols = { version = "0.31.2", features = [
188 "client",
189 "staging",
190 "unstable",
191], optional = true }
192wayland-protocols-plasma = { version = "0.2.0", features = [
193 "client",
194], optional = true }
195
196# X11
197as-raw-xcb-connection = { version = "1", optional = true }
198x11rb = { version = "0.13.1", features = [
199 "allow-unsafe-code",
200 "xkb",
201 "randr",
202 "xinput",
203 "cursor",
204 "resource_manager",
205 "sync",
206], optional = true }
207xkbcommon = { version = "0.8.0", features = [
208 "wayland",
209 "x11",
210], optional = true }
211xim = { git = "https://github.com/XDeme1/xim-rs", rev = "d50d461764c2213655cd9cf65a0ea94c70d3c4fd", features = [
212 "x11rb-xcb",
213 "x11rb-client",
214], optional = true }
215x11-clipboard = { version = "0.9.3", optional = true }
216
217[target.'cfg(target_os = "windows")'.dependencies]
218blade-util.workspace = true
219bytemuck = "1"
220blade-graphics.workspace = true
221blade-macros.workspace = true
222flume = "0.11"
223rand.workspace = true
224windows.workspace = true
225windows-core.workspace = true
226windows-numerics = "0.2"
227windows-registry = "0.5"
228
229[dev-dependencies]
230backtrace = "0.3"
231collections = { workspace = true, features = ["test-support"] }
232env_logger.workspace = true
233http_client = { workspace = true, features = ["test-support"] }
234lyon = { version = "1.0", features = ["extra"] }
235rand.workspace = true
236unicode-segmentation.workspace = true
237reqwest_client = { workspace = true, features = ["test-support"] }
238util = { workspace = true, features = ["test-support"] }
239
240[target.'cfg(target_os = "windows")'.build-dependencies]
241embed-resource = "3.0"
242naga.workspace = true
243
244[target.'cfg(target_os = "macos")'.build-dependencies]
245bindgen = "0.71"
246cbindgen = { version = "0.28.0", default-features = false }
247naga.workspace = true
248
249[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.build-dependencies]
250naga.workspace = true
251
252
253[[example]]
254name = "hello_world"
255path = "examples/hello_world.rs"
256
257[[example]]
258name = "image"
259path = "examples/image/image.rs"
260
261[[example]]
262name = "input"
263path = "examples/input.rs"
264
265[[example]]
266name = "on_window_close_quit"
267path = "examples/on_window_close_quit.rs"
268
269[[example]]
270name = "opacity"
271path = "examples/opacity.rs"
272
273[[example]]
274name = "pattern"
275path = "examples/pattern.rs"
276
277[[example]]
278name = "set_menus"
279path = "examples/set_menus.rs"
280
281[[example]]
282name = "shadow"
283path = "examples/shadow.rs"
284
285[[example]]
286name = "svg"
287path = "examples/svg/svg.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 = "uniform_list"
299path = "examples/uniform_list.rs"
300
301[[example]]
302name = "window_shadow"
303path = "examples/window_shadow.rs"