1[package]
2name = "gpui"
3version = "0.1.0"
4edition.workspace = true
5authors = ["Nathan Sobo <nathan@zed.dev>"]
6description = "Zed's GPU-accelerated UI framework"
7publish.workspace = true
8license = "Apache-2.0"
9
10[lints]
11workspace = true
12
13[features]
14default = ["http_client", "font-kit", "wayland", "x11"]
15test-support = [
16 "backtrace",
17 "collections/test-support",
18 "rand",
19 "util/test-support",
20 "http_client?/test-support",
21 "wayland",
22 "x11",
23]
24runtime_shaders = []
25macos-blade = [
26 "blade-graphics",
27 "blade-macros",
28 "blade-util",
29 "bytemuck",
30 "objc2",
31 "objc2-metal",
32]
33wayland = [
34 "blade-graphics",
35 "blade-macros",
36 "blade-util",
37 "bytemuck",
38 "ashpd",
39 "cosmic-text",
40 "font-kit",
41 "calloop-wayland-source",
42 "wayland-backend",
43 "wayland-client",
44 "wayland-cursor",
45 "wayland-protocols",
46 "wayland-protocols-plasma",
47 "filedescriptor",
48 "xkbcommon",
49 "open",
50]
51x11 = [
52 "blade-graphics",
53 "blade-macros",
54 "blade-util",
55 "bytemuck",
56 "ashpd",
57 "cosmic-text",
58 "font-kit",
59 "as-raw-xcb-connection",
60 "x11rb",
61 "xkbcommon",
62 "xim",
63 "x11-clipboard",
64 "filedescriptor",
65 "open",
66]
67
68
69[lib]
70path = "src/gpui.rs"
71doctest = false
72
73[dependencies]
74anyhow.workspace = true
75async-task = "4.7"
76backtrace = { version = "0.3", optional = true }
77blade-graphics = { workspace = true, optional = true }
78blade-macros = { workspace = true, optional = true }
79blade-util = { workspace = true, optional = true }
80bytemuck = { version = "1", optional = true }
81collections.workspace = true
82ctor.workspace = true
83derive_more.workspace = true
84etagere = "0.2"
85futures.workspace = true
86gpui_macros.workspace = true
87http_client = { optional = true, workspace = true }
88image = "0.25.1"
89inventory.workspace = true
90itertools.workspace = true
91log.workspace = true
92num_cpus = "1.13"
93parking = "2.0.0"
94parking_lot.workspace = true
95postage.workspace = true
96profiling.workspace = true
97rand = { optional = true, workspace = true }
98raw-window-handle = "0.6"
99refineable.workspace = true
100resvg = { version = "0.44.0", default-features = false }
101usvg = { version = "0.44.0", default-features = false }
102schemars.workspace = true
103seahash = "4.1"
104semantic_version.workspace = true
105serde.workspace = true
106serde_derive.workspace = true
107serde_json.workspace = true
108slotmap = "1.0.6"
109smallvec.workspace = true
110smol.workspace = true
111strum.workspace = true
112sum_tree.workspace = true
113taffy = "0.4.3"
114thiserror.workspace = true
115util.workspace = true
116uuid.workspace = true
117waker-fn = "1.2.0"
118lyon = "1.0"
119
120[target.'cfg(target_os = "macos")'.dependencies]
121block = "0.1"
122cocoa.workspace = true
123core-foundation.workspace = true
124core-foundation-sys = "0.8"
125core-graphics = "0.23"
126core-text = "20.1"
127font-kit = { git = "https://github.com/zed-industries/font-kit", rev = "40391b7", optional = true }
128foreign-types = "0.5"
129log.workspace = true
130media.workspace = true
131objc = "0.2"
132objc2 = { version = "0.5", optional = true }
133objc2-metal = { version = "0.2", optional = true }
134#TODO: replace with "objc2"
135metal.workspace = true
136
137[target.'cfg(any(target_os = "linux", target_os = "freebsd", target_os = "macos"))'.dependencies]
138pathfinder_geometry = "0.5"
139
140[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies]
141# Always used
142flume = "0.11"
143oo7 = { version = "0.4.0", default-features = false, features = [
144 "async-std",
145 "native_crypto",
146] }
147
148# Used in both windowing options
149ashpd = { workspace = true, optional = true }
150blade-graphics = { workspace = true, optional = true }
151blade-macros = { workspace = true, optional = true }
152blade-util = { workspace = true, optional = true }
153bytemuck = { version = "1", optional = true }
154cosmic-text = { git = "https://github.com/pop-os/cosmic-text", rev = "542b20c", optional = true }
155font-kit = { git = "https://github.com/zed-industries/font-kit", rev = "40391b7", features = [
156 "source-fontconfig-dlopen",
157], optional = true }
158calloop = { version = "0.13.0" }
159filedescriptor = { version = "0.8.2", optional = true }
160open = { version = "5.2.0", optional = true }
161
162# Wayland
163calloop-wayland-source = { version = "0.3.0", optional = true }
164wayland-backend = { version = "0.3.3", features = [
165 "client_system",
166 "dlopen",
167], optional = true }
168wayland-client = { version = "0.31.2", optional = true }
169wayland-cursor = { version = "0.31.1", optional = true }
170wayland-protocols = { version = "0.31.2", features = [
171 "client",
172 "staging",
173 "unstable",
174], optional = true }
175wayland-protocols-plasma = { version = "0.2.0", features = [
176 "client",
177], optional = true }
178
179
180# X11
181as-raw-xcb-connection = { version = "1", optional = true }
182x11rb = { version = "0.13.1", features = [
183 "allow-unsafe-code",
184 "xkb",
185 "randr",
186 "xinput",
187 "cursor",
188 "resource_manager",
189 "sync",
190], optional = true }
191xkbcommon = { git = "https://github.com/ConradIrwin/xkbcommon-rs", rev = "fcbb4612185cc129ceeff51d22f7fb51810a03b2", features = [
192 "wayland",
193 "x11",
194], optional = true }
195xim = { git = "https://github.com/XDeme1/xim-rs", rev = "d50d461764c2213655cd9cf65a0ea94c70d3c4fd", features = [
196 "x11rb-xcb",
197 "x11rb-client",
198], optional = true }
199x11-clipboard = { version = "0.9.3", optional = true }
200
201[target.'cfg(windows)'.dependencies]
202blade-util.workspace = true
203bytemuck = "1"
204blade-graphics.workspace = true
205blade-macros.workspace = true
206flume = "0.11"
207rand.workspace = true
208windows.workspace = true
209windows-core = "0.58"
210
211[dev-dependencies]
212backtrace = "0.3"
213collections = { workspace = true, features = ["test-support"] }
214env_logger.workspace = true
215http_client = { workspace = true, features = ["test-support"] }
216lyon = { version = "1.0", features = ["extra"] }
217rand.workspace = true
218unicode-segmentation.workspace = true
219reqwest_client = { workspace = true, features = ["test-support"] }
220util = { workspace = true, features = ["test-support"] }
221
222[target.'cfg(target_os = "windows")'.build-dependencies]
223embed-resource = "3.0"
224naga.workspace = true
225
226[target.'cfg(target_os = "macos")'.build-dependencies]
227bindgen = "0.70.0"
228cbindgen = { version = "0.28.0", default-features = false }
229naga.workspace = true
230
231[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.build-dependencies]
232naga.workspace = true
233
234
235[[example]]
236name = "hello_world"
237path = "examples/hello_world.rs"
238
239[[example]]
240name = "image"
241path = "examples/image/image.rs"
242
243[[example]]
244name = "input"
245path = "examples/input.rs"
246
247[[example]]
248name = "opacity"
249path = "examples/opacity.rs"
250
251[[example]]
252name = "pattern"
253path = "examples/pattern.rs"
254
255[[example]]
256name = "set_menus"
257path = "examples/set_menus.rs"
258
259[[example]]
260name = "shadow"
261path = "examples/shadow.rs"
262
263[[example]]
264name = "svg"
265path = "examples/svg/svg.rs"
266
267[[example]]
268name = "text_wrapper"
269path = "examples/text_wrapper.rs"
270
271[[example]]
272name = "uniform_list"
273path = "examples/uniform_list.rs"
274
275[[example]]
276name = "window_shadow"
277path = "examples/window_shadow.rs"
278
279[[example]]
280name = "on_window_close_quit"
281path = "examples/on_window_close_quit.rs"