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