git.lucas.co / cce-ui
GPU-accelerated UI toolkit (Vulkan)
git clone https://git.lucas.co/cce-ui.git

Cargo.toml (10.1K)

  1 [package]
  2 name = "cce-ui"
  3 version = "0.1.0"
  4 edition = "2021"
  5 
  6 [lib]
  7 name = "cce_ui"
  8 path = "src/lib.rs"
  9 
 10 [lints.clippy]
 11 # House style, not defects (CI runs clippy with warnings as errors; anything not listed here
 12 # is fixed, not allowed):
 13 # - the paint and tessellation functions take geometry and colour piecewise;
 14 too_many_arguments = "allow"
 15 # - the legacy tuple views (`(f32, f32, f32, f32, [f32; 4])` quads and friends);
 16 type_complexity = "allow"
 17 # - colour and curve constants are written as their specs give them;
 18 excessive_precision = "allow"
 19 # - geometry loops index several arrays in step;
 20 needless_range_loop = "allow"
 21 # - a widget's `new` returns `Adapted<Self>`, which a `Default` would not.
 22 new_without_default = "allow"
 23 
 24 [features]
 25 # `widget::markdown` (MarkdownView): lays out vault notes for reading views
 26 # and note cards. Brings in cce-vault and its Markdown parser, so only the
 27 # clients that show notes turn it on.
 28 markdown = ["dep:cce-vault"]
 29 # `widget::doc_editor` (DocEditor): the line-buffer document editor with
 30 # Markdown live preview (cce-notes' editing mode). No extra dependencies.
 31 doc_editor = []
 32 # Publish each window's accessibility tree to screen readers through AT-SPI
 33 # (accesskit_unix, in the Wayland shell; rfc-accessibility-locale phase 2). An
 34 # app must still opt in at run time (`Application::publishes_accessibility`, or
 35 # CCE_A11Y=1), since a workspace build turns a feature on for every app at once.
 36 a11y = ["dep:accesskit_unix"]
 37 
 38 [dependencies]
 39 # The GUI-free half: config, input, motion, units, ipc and the spec parsers,
 40 # re-exported at their old paths (`cce_ui::config`, …). See lib.rs.
 41 cce-core = { git = "https://github.com/lsgalante/cce-core.git", rev = "ea9d65d5e0ea4ec3849b65b7394817637d1d9f05", features = ["l10n"] }
 42 # The accessibility tree's schema (rfc-accessibility-locale § 5): pure data, built for
 43 # every target; `crate::a11y` produces its TreeUpdate. The platform adapters are separate.
 44 accesskit = "0.25"
 45 cce-vault = { git = "https://github.com/lsgalante/cce-vault.git", rev = "41ca52bd51ea3655a791c58005be9fce939e4333", optional = true }
 46 glam = "0.29"
 47 bytemuck = { version = "1", features = ["derive"] }
 48 # WGSL parsing and validation everywhere — a compute kernel is checked, and
 49 # its `@workgroup_size` read, before any device sees it; native adds the
 50 # SPIR-V writer below.
 51 naga = { version = "24", features = ["wgsl-in"] }
 52 # Text shaping. This was reached through glyphon until the wgpu path was retired;
 53 # every `glyphon::` item cce-ui ever used was a cosmic-text re-export (the sole
 54 # exception, `TextBounds`, is now defined in backend/text.rs), so depending
 55 # on cosmic-text directly drops glyphon, wgpu and 17 more crates from the build —
 56 # the rest of wgpu's tree stays only because naga/ash below already pull it.
 57 # Pinned to the exact version glyphon 0.8 resolved to, so shaping does not change:
 58 # verified by diffing shaped glyph ids/advances both ways over 288 runs.
 59 cosmic-text = "=0.12.1"
 60 # A paragraph's base direction and the reordering of styled runs (accessibility RFC phase 4).
 61 # Already in the tree through cosmic-text, which shapes with it.
 62 unicode-bidi = { version = "0.3.13", default-features = false, features = ["hardcoded-data"] }
 63 bitflags = "2"
 64 # The cursor names an app returns. smithay-client-toolkit re-exports this same
 65 # crate's type, so the Wayland shell hands it over unconverted; depending on it
 66 # directly keeps the client contract free of the toolkit.
 67 cursor-icon = "1.2"
 68 resvg = "0.41.0"
 69 # App/tray icon themes are overwhelmingly PNG; resvg covers only the SVG half.
 70 png = "0.17"
 71 serde = { version = "1.0", features = ["derive"] }
 72 serde_json = "1.0"
 73 kdl = "4.6"
 74 log = "0.4"
 75 # `Instant` that works in the browser: std's panics on wasm32-unknown-unknown,
 76 # which has no clock of its own. On every other target this IS std's.
 77 web-time = "1"
 78 
 79 # The native shell and renderer: Wayland through smithay-client-toolkit on a
 80 # calloop loop, Vulkan through ash. None of it builds for the browser, where
 81 # the shell and renderer are the web platform's (`cargo check --lib --target
 82 # wasm32-unknown-unknown` is the check that keeps the rest portable).
 83 [target.'cfg(not(target_arch = "wasm32"))'.dependencies]
 84 raw-window-handle = "0.6"
 85 # Raw-Vulkan backend (versions match what wgpu 24 already pulled in).
 86 ash = "0.38"
 87 gpu-allocator = { version = "0.28", default-features = false, features = ["vulkan", "std"] }
 88 naga = { version = "24", features = ["wgsl-in", "spv-out"] }
 89 libc = "0.2"
 90 rfd = "0.15"
 91 
 92 # The Wayland shell: every native target but macOS, which has its own shell
 93 # (`src/mac`, AppKit) over the same Vulkan renderer through MoltenVK.
 94 [target.'cfg(not(any(target_arch = "wasm32", target_os = "macos")))'.dependencies]
 95 smithay-client-toolkit = { version = "0.19.2", features = ["calloop"] }
 96 calloop = "0.13.0"
 97 calloop-wayland-source = "0.3.0"
 98 wayland-client = { version = "0.31", features = ["system"] }
 99 wayland-protocols = { version = "0.31", features = ["client", "unstable"] }
100 wayland-backend = "0.3"
101 wayland-scanner = "0.31"
102 xkeysym = "0.2"
103 accesskit_unix = { version = "0.24", optional = true }
104 
105 # The AppKit shell (`src/mac`): the window, its CAMetalLayer, the run loop.
106 [target.'cfg(target_os = "macos")'.dependencies]
107 objc2 = "0.6"
108 objc2-foundation = { version = "0.3", default-features = false, features = ["std", "NSString", "NSGeometry", "NSNotification", "NSObject", "NSDate", "NSDictionary", "NSArray", "NSAttributedString", "NSRange", "NSObjCRuntime"] }
109 objc2-app-kit = { version = "0.3", default-features = false, features = ["std", "NSApplication", "NSWindow", "NSView", "NSResponder", "NSEvent", "NSScreen", "NSCursor", "NSMenu", "NSMenuItem", "NSPasteboard", "NSTextInputClient", "NSTextInputContext", "NSColor", "NSTrackingArea", "NSGraphics", "NSGraphicsContext", "NSRunningApplication", "objc2-quartz-core", "objc2-core-foundation"] }
110 objc2-quartz-core = { version = "0.3", default-features = false, features = ["std", "CALayer", "CAMetalLayer", "objc2-core-foundation"] }
111 dispatch2 = "0.3"
112 
113 # The browser shell and renderer (W2/W3 of the web port): WebGPU through
114 # web-sys, the page through wasm-bindgen.
115 [target.'cfg(target_arch = "wasm32")'.dependencies]
116 wasm-bindgen = "0.2"
117 wasm-bindgen-futures = "0.4"
118 js-sys = "0.3"
119 web-sys = { version = "0.3", features = [
120     "console",
121     "Window",
122     "Navigator",
123     "Clipboard",
124     "ClipboardEvent",
125     "DataTransfer",
126     "Document",
127     "Element",
128     "HtmlCanvasElement",
129     "HtmlElement",
130     "HtmlTextAreaElement",
131     "CompositionEvent",
132     "InputEvent",
133     "DomRect",
134     "Node",
135     "CssStyleDeclaration",
136     "EventTarget",
137     "Event",
138     "AddEventListenerOptions",
139     "MouseEvent",
140     "PointerEvent",
141     "WheelEvent",
142     "KeyboardEvent",
143     "FocusEvent",
144     "ResizeObserver",
145     "Gpu",
146     "GpuAdapter",
147     "GpuDevice",
148     "GpuQueue",
149     "GpuCanvasContext",
150     "GpuCanvasConfiguration",
151     "GpuCanvasAlphaMode",
152     "GpuTextureFormat",
153     "GpuShaderModule",
154     "GpuShaderModuleDescriptor",
155     "GpuBindGroupLayout",
156     "GpuBindGroupLayoutDescriptor",
157     "GpuBindGroupLayoutEntry",
158     "GpuBufferBindingLayout",
159     "GpuBufferBindingType",
160     "GpuTextureBindingLayout",
161     "GpuTextureSampleType",
162     "GpuTextureViewDimension",
163     "GpuSamplerBindingLayout",
164     "GpuSamplerBindingType",
165     "GpuPipelineLayout",
166     "GpuPipelineLayoutDescriptor",
167     "GpuRenderPipeline",
168     "GpuRenderPipelineDescriptor",
169     "GpuVertexState",
170     "GpuVertexBufferLayout",
171     "GpuVertexAttribute",
172     "GpuVertexFormat",
173     "GpuVertexStepMode",
174     "GpuFragmentState",
175     "GpuColorTargetState",
176     "GpuBlendState",
177     "GpuBlendComponent",
178     "GpuBlendFactor",
179     "GpuBlendOperation",
180     "GpuPrimitiveState",
181     "GpuPrimitiveTopology",
182     "GpuBindGroup",
183     "GpuBindGroupDescriptor",
184     "GpuBindGroupEntry",
185     "GpuBufferBinding",
186     "GpuBuffer",
187     "GpuBufferDescriptor",
188     "GpuTexture",
189     "GpuTextureDescriptor",
190     "GpuTextureDimension",
191     "GpuTextureView",
192     "GpuTextureViewDescriptor",
193     "GpuSampler",
194     "GpuSamplerDescriptor",
195     "GpuAddressMode",
196     "GpuFilterMode",
197     "GpuMipmapFilterMode",
198     "GpuCommandEncoder",
199     "GpuCommandEncoderDescriptor",
200     "GpuCommandBuffer",
201     "GpuRenderPassEncoder",
202     "GpuRenderPassDescriptor",
203     "GpuRenderPassColorAttachment",
204     "GpuLoadOp",
205     "GpuStoreOp",
206     "GpuColorDict",
207     "GpuExtent3dDict",
208     "GpuOrigin3dDict",
209     "GpuTexelCopyTextureInfo",
210     "GpuTexelCopyBufferInfo",
211     "GpuTexelCopyBufferLayout",
212     "gpu_buffer_usage",
213     "gpu_texture_usage",
214     "gpu_shader_stage",
215     "gpu_map_mode",
216     "GpuDeviceDescriptor",
217     "GpuSupportedLimits",
218     "GpuAdapterInfo",
219     "GpuComputePipeline",
220     "GpuComputePipelineDescriptor",
221     "GpuProgrammableStage",
222     "GpuComputePassEncoder",
223     "GpuComputePassDescriptor",
224     "GpuErrorFilter",
225     "GpuError",
226     "GpuDepthStencilState",
227     "GpuCompareFunction",
228     "GpuCullMode",
229     "GpuFrontFace",
230     "GpuRenderPassDepthStencilAttachment",
231     "GpuStorageTextureAccess",
232     "GpuStorageTextureBindingLayout",
233 ] }
234 
235 # The renderer probe: one scene through both renderers (examples/probe/).
236 # probe_web is the browser half, a cdylib for wasm-bindgen; natively it is empty.
237 [[example]]
238 name = "probe_web"
239 crate-type = ["cdylib"]
240 
241 # The 3D probe's browser half (examples/probe3d/); empty natively.
242 [[example]]
243 name = "probe3d_web"
244 crate-type = ["cdylib"]
245 
246 # The compute probe's browser half (examples/compute_probe/); empty natively.
247 [[example]]
248 name = "compute_web"
249 crate-type = ["cdylib"]
250 
251 # The reference app (src/main.rs) in a browser, on the browser shell; a
252 # cdylib for wasm-bindgen, empty natively.
253 [[example]]
254 name = "demo_web"
255 crate-type = ["cdylib"]
256 
257 [dev-dependencies]
258 # The same crate with its `cfg(test)` behaviour switched on, so this suite reads
259 # no machine config now that config/input/motion live there (cce-core's
260 # `test-isolation`; resolver 2 keeps it out of normal builds).
261 cce-core = { git = "https://github.com/lsgalante/cce-core.git", rev = "ea9d65d5e0ea4ec3849b65b7394817637d1d9f05", features = ["test-isolation"] }
262 
263 [build-dependencies]
264 # build.rs compiles the fixed WGSL shaders to SPIR-V once, instead of in every
265 # process that builds a renderer. Same version as the runtime dependency above,
266 # which still compiles the shaders made at run time.
267 naga = { version = "24", features = ["wgsl-in", "spv-out"] }