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