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